Install & Compatibility
Where this runs
tested against v3.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 54.9MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.5s · import 0.000s · 59MB
55MB installed
● package 55MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
IPXACTImporter
✓ from peakrdl_ipxact import IPXACTImporter
✗ from systemrdl.ipxact.importer import IPXACTImporter
IPXACTExporter
✓ from peakrdl_ipxact import IPXACTExporter
Standard
✓ from peakrdl_ipxact import Standard
This example demonstrates how to create a simple RDL model, compile it, export it to an IP-XACT XML file, and then import that XML file back into an RDL model using PeakRDL-IPXACT's `IPXACTExporter` and `IPXACTImporter` classes. The example uses temporary files to ensure it's self-contained and runnable.
import os
import tempfile
from pathlib import Path
from systemrdl.core import RDLCompiler
from systemrdl.ipxact.exporter import IPXACTExporter
from systemrdl.ipxact.importer import IPXACTImporter
# Create a temporary directory for test files
with tempfile.TemporaryDirectory() as tmpdir:
tmp_path = Path(tmpdir)
# 1. Create a dummy RDL file
rdl_content = """
addrmap my_block {
reg my_reg {
field { sw=r; hw=w; } my_field[3:0] = 4'h0;
} @0x0;
};
"""
rdl_file = tmp_path / "example.rdl"
rdl_file.write_text(rdl_content)
print(f"Created RDL file: {rdl_file}")
# 2. Compile the RDL file
compiler = RDLCompiler()
compiler.compile_file(str(rdl_file))
root_component = compiler.top
print(f"Compiled RDL, top component: {root_component.get_path()}")
# 3. Export to IP-XACT XML
exported_xml_file = tmp_path / "exported_ipxact.xml"
exporter = IPXACTExporter()
exporter.export(root_component, str(exported_xml_file))
print(f"Exported to IP-XACT XML: {exported_xml_file}")
# 4. Import the IP-XACT XML
importer = IPXACTImporter()
imported_component = importer.import_file(str(exported_xml_file))
print(f"\nImported IP-XACT component name: {imported_component.name}")
print(f"Accessing imported register: {imported_component.registers[0].name}")
print("Quickstart example completed successfully.")
Upgrade
Version history
3.5.0latest on PyPI · released Oct 15, 2024
Audit
Dependencies
systemrdl-compilerrequiredCore dependency for RDL model compilation and manipulation.
lxmlrequiredRequired for efficient XML parsing and serialization of IP-XACT files.