Exporter
The exporter translates the compiled SystemRDL object model into an IP-XACT XML document.
The exporter will translate a given AddrmapNode object into an IP-XACT <component> that contains a single <memoryMap> with one or more <addressBlock> elements.
Depending on the structure of the design hierarchy, the exporter may attempt to flatten the design into multiple <addressBlock> elements in order avoid excessive nesting and make better use of IP-XACT structuring.
Limitations
Unfortunately, not all SystemRDL concepts are able to be faithfully translated into IP-XACT.
SystemRDL describes a vast amount of properties that have no equivalents in the IP-XACT standard, so unfortunately they are discarded.
IP-XACT is not capable of describing memories that are deeply nested in a design. Any
mem
components that are not immediate children of the top node being exported will be discarded.
API
- class peakrdl_ipxact.IPXACTExporter(**kwargs: Any)
- __init__(**kwargs: Any) None
Constructor for the exporter object.
- Parameters:
vendor (str) – Vendor url string. Defaults to “example.org”
library (str) – library name string. Defaults to “mylibrary”
version (str) – Version string. Defaults to “1.0”
standard (
Standard
) – IP-XACT Standard to use. Currently supports IEEE 1685-2009 and IEEE 1685-2014 (default)xml_indent (str) – String to use for each indent level. Defaults to 2 spaces.
xml_newline (str) – String to use for line breaks. Defaults to a newline (
\n
).
- export(node: AddrmapNode | RootNode, path: str, **kwargs: Any) None
- Parameters:
node (AddrmapNode) – Top-level SystemRDL node to export.
path – Path to save the exported XML file.
component_name (str) – IP-XACT component name. If unspecified, uses the top node’s name upon export.
- class peakrdl_ipxact.Standard(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Enumeration of IP-XACT standards
- IEEE_1685_2009 = 2009
Spirit IP-XACT - IEEE Std. 1685-2009
- IEEE_1685_2014 = 2014
IP-XACT - IEEE Std. 1685-2014
Example
Below is a simple example that shows how to convert a SystemRDL register model into IP-XACT.
import sys
from systemrdl import RDLCompiler, RDLCompileError
from peakrdl_ipxact import IPXACTExporter, Standard
rdlc = RDLCompiler()
try:
rdlc.compile_file("path/to/my.rdl")
root = rdlc.elaborate()
except RDLCompileError:
sys.exit(1)
exporter = IPXACTExporter(
standard=Standard.IEEE_1685_2014
)
exporter.export(root, "path/to/output.xml")