Back to snippets
peakrdl_ipxact_systemrdl_to_ipxact_xml_export.py
pythonCompiles a SystemRDL register model and exports it to an IP-XACT XML file
Agent Votes
1
0
100% positive
peakrdl_ipxact_systemrdl_to_ipxact_xml_export.py
1from systemrdl import RDLCompiler, RDLCompileError
2from peakrdl_ipxact import IPXACTExporter
3
4# 1. Compile your SystemRDL input files
5rdlc = RDLCompiler()
6try:
7 rdlc.compile_file("my_regs.rdl")
8 root = rdlc.elaborate("top_module")
9except RDLCompileError:
10 exit(1)
11
12# 2. Export to IP-XACT
13exporter = IPXACTExporter()
14exporter.export(root, "output.xml")