Library to export rdl files
Project description
rdlexporter
A library to generate SystemRDL files from the Hierarchical Register Model.
How to use it:
uv pip install rdlexporter
Example:
from rdlexporter import RdlExporter
from systemrdl import RDLCompiler, RDLImporter
from systemrdl.rdltypes import AccessType
rdlc = RDLCompiler()
imp = RDLImporter(rdlc)
imp.default_src_ref = None
addrmap = imp.create_addrmap_definition("generic")
field_en = imp.create_field_definition("EN")
field_en = imp.instantiate_field(field_en, "EN", 0, 1)
imp.assign_property(field_en, "reset", 0x00)
imp.assign_property(field_en, "swmod", value=True)
imp.assign_property(field_en, "desc", "Enable the ip")
imp.assign_property(field_mode, "reset", 0x7)
imp.assign_property(field_mode, "desc", "Define the mode.")
imp.assign_property(field_mode, "sw", AccessType.rw)
reg = imp.create_reg_definition("CTRL")
imp.add_child(reg, field_en)
imp.add_child(reg, field_mode)
reg = imp.instantiate_reg(reg, "CTRL", 0x04, [4], 0x04)
imp.add_child(addrmap, reg)
imp.register_root_component(addrmap)
RdlExporter(rdlc).export("./generic.rdl")
Contributing
How to run tests
cd rdlexporter
uv run pytest
How to build the package and install it locally
Install dev dependencies
uv sync --all-extras
Build package
uv build --all
Install the package locally
uv pip install dist/rdlexporter-0.1.0-py3-none-any.whl
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
rdlexporter-0.2.0.tar.gz
(11.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rdlexporter-0.2.0.tar.gz.
File metadata
- Download URL: rdlexporter-0.2.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b20af613f7fe81115ae6a948bd8f4752a8a7adc97594e6689c2703f53cd03b3e
|
|
| MD5 |
c1b4816cbd2f32f2e3f5f936f338d68c
|
|
| BLAKE2b-256 |
81e7286b3443cbb955095d223b18a3612dd1825f347c0e4ad2e01314d2dcc589
|
File details
Details for the file rdlexporter-0.2.0-py3-none-any.whl.
File metadata
- Download URL: rdlexporter-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38d2dbdda140d9d6aa2977aa49a8857b564a011dd79f774afa50d9b8ebb2ec17
|
|
| MD5 |
0e1572022001fb72ae44344edfd1776e
|
|
| BLAKE2b-256 |
6fe427bbadacbf88c3f515f15fbc177738898a63bbeec3fad8965244cb748be2
|