PeakRDL-IPXACT
PeakRDL-IPXACT is a plugin for the systemrdl-compiler library, enabling the import and export of IP-XACT XML files to and from the SystemRDL register model. It provides functionality to parse IP-XACT descriptions into an RDL model and serialize an RDL model back into IP-XACT. The current version is 3.5.0, with a release cadence that includes frequent bug fixes and occasional minor feature updates.
Warnings
- breaking The `peakrdl.ipxact` namespace was removed. All imports must now use `systemrdl.ipxact`.
- breaking The importer's mapping of IP-XACT names to SystemRDL type names was reworked to prevent namespace collisions. This changes how component/memoryMap names are concatenated.
- gotcha When exporting, nodes marked with `ispresent=false` (e.g., fields, registers) are now discarded if the target IP-XACT standard does not explicitly support the `isPresent` tag.
Install
-
pip install peakrdl-ipxact
Imports
- IPXACTImporter
from peakrdl.ipxact.importer import IPXACTImporter
from systemrdl.ipxact.importer import IPXACTImporter
- IPXACTExporter
from peakrdl.ipxact.exporter import IPXACTExporter
from systemrdl.ipxact.exporter import IPXACTExporter
Quickstart
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.")