Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 709 Bytes

api.rst

File metadata and controls

34 lines (23 loc) · 709 Bytes

Python API

If you want to embed this tool into your own script, you can do so with the following API.

Example

The following example shows how to compile a SystemRDL file and then generate the C header using the Python API.

from systemrdl import RDLCompiler
from peakrdl_cheader.exporter import CHeaderExporter

# compile the SystemRDL
rdlc = RDLCompiler()
rdlc.compile_file('example.rdl')
top = rdlc.elaborate()

# generate the C header
exporter = CHeaderExporter()
exporter.export(node=top, path='out.h')

Exporter Class

peakrdl_cheader.exporter.CHeaderExporter