Generate python wrapper for a register model compiled SystemRDL input
Project description
PeakRDL-python
Generate Python wrapper for a register model compiled SystemRDL input
Installing
Install from github only at the moment.
Exporter Usage
Pass the elaborated output of the SystemRDL Compiler to the exporter.
import sys
from systemrdl import RDLCompiler, RDLCompileError
from peakrdl.python.exporter import PythonExporter
rdlc = RDLCompiler()
try:
rdlc.compile_file("path/to/my.rdl")
root = rdlc.elaborate()
except RDLCompileError:
sys.exit(1)
exporter = PythonExporter()
exporter.export(root, "path/to/output")
The exporter will create a python package in the specified output directory consists of the python wrapper and a test bench for the wrapper which can be run within a unittest framework.
Reference
PythonExporter(**kwargs)
Constructor for the Python Exporter class
Optional Parameters
user_template_dir
- Path to a directory where user-defined template overrides are stored.
user_template_context
- Additional context variables to load into the template namespace.
PythonExporter.export(node, path, **kwargs)
Perform the export!
Parameters
node
- Top-level node to export. Can be the top-level
RootNode
or any internalAddrmapNode
.
- Top-level node to export. Can be the top-level
path
- Output directory.
autoformatoutputs
- True - All the generated code is run through autopep8 (warning this can be slow for large designs)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
peakrdl-python-0.0.9.tar.gz
(36.8 kB
view hashes)
Built Distribution
Close
Hashes for peakrdl_python-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fea47b841cf1016a3407369a4c857e7b059a8b5518e269b0ad1e27f998e7cb7c |
|
MD5 | d6786e85ac1b74a7fb0417c645e7fc65 |
|
BLAKE2b-256 | 9d85c56da3cd9ff7eb69602b5b1d4dae5cce0a467df4e74e24bef850c7147821 |