The systemrdl-compiler project implements a generic compiler front-end for Accellera's SystemRDL 2.0 register description language. It provides an elaborated register model that is easy to traverse and query, facilitating the creation of custom register space view generators. The project is actively maintained with frequent minor releases addressing bugs and adding features.
pip install systemrdl-compilerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to compile a simple SystemRDL string, elaborate it into a register model, and then traverse the resulting `RootNode` to inspect components like registers and fields. The `RDLCompiler` is the entry point, `compile_string` parses the RDL, and `elaborate` creates the hierarchical `RootNode` representation. The `descendants()` and `find_by_path()` methods are shown for model traversal and access.
Migrate code to use equivalent properties and methods directly from the `Node` API layer instead of accessing `Node.inst` internals. Consult the documentation for alternative access patterns.
Always install the latest stable version or a specific patched version (e.g., `1.30.1` or later) to avoid this known problematic release.
Ensure your development environment uses Python 3.7 or newer to maintain compatibility.
If your design uses overlapping fields and you rely on `RegNode.fields(include_gaps=True)`, verify the output against the new, correct behavior.
While this change often has 'zero impact', if your code explicitly relied on generator properties, review usage. Explicitly casting to `list()` is no longer necessary but harmless.
Install Perl on your system if you use RDL files with Perl preprocessor directives. Windows users need to download and install Perl separately.
If your tools or scripts relied on `FieldNode.is_volatile` for singlepulse fields, verify that the updated behavior aligns with your expectations.
pip install systemrdl-compiler
from systemrdl.compiler import RDLCompiler
Review the specific error message (which typically includes file, line, and column) and correct the SystemRDL source code according to the SystemRDL 2.0 specification.
Ensure `compiler.compile_file("your_file.rdl")` or `compiler.compile_string("your_rdl_string")` is called and completes successfully before attempting to retrieve the root node of the design.Review your SystemRDL file at the specified line and column to define 'foo' or correct the reference to an existing member.