{"id":9171,"library":"peakrdl-systemrdl","title":"PeakRDL SystemRDL Exporter","description":"PeakRDL-systemrdl is a plugin for the PeakRDL compiler that allows users to export an in-memory register model to a SystemRDL file. It currently supports version 1.0.1 and generally releases new versions based on new features, bug fixes, or compatibility updates with the main PeakRDL library.","status":"active","version":"1.0.1","language":"en","source_language":"en","source_url":"https://github.com/SystemRDL/PeakRDL-systemrdl","tags":["rdl","systemrdl","hardware-description","compiler","exporter","eda","register"],"install":[{"cmd":"pip install peakrdl-systemrdl","lang":"bash","label":"Standard installation"},{"cmd":"pip install peakrdl-systemrdl[cli]","lang":"bash","label":"Installation with CLI support"}],"dependencies":[{"reason":"This library is a plugin for PeakRDL and requires it to compile and export RDL models.","package":"peakrdl","optional":false}],"imports":[{"note":"Pre-v0.2.0, `SystemRDLConverter` was not directly exposed via the top-level package and required importing from a deeper module path. The current import path is stable for v0.2.0 and above.","wrong":"from peakrdl_systemrdl.exporter import SystemRDLConverter","symbol":"SystemRDLConverter","correct":"from peakrdl_systemrdl import SystemRDLConverter"}],"quickstart":{"code":"import peakrdl\nfrom peakrdl_systemrdl import SystemRDLConverter\nfrom pathlib import Path\nimport os\n\n# Create a simple RDL content string for demonstration\nrdl_content = \"\"\"\naddrmap my_block {\n    reg { \n        field { hw = r; sw = w; reset = 0; accesswidth = 32; } my_field[32];\n    } my_reg;\n}\n\"\"\"\n\n# Initialize the PeakRDL compiler\ncompiler = peakrdl.RDLCompiler()\n\n# Compile the RDL content from a string (or a file: compiler.compile(Path(\"my_design.rdl\")))\ncompiler.compile_string(rdl_content, \"my_design.rdl\")\n\n# Define the output path for the SystemRDL file\noutput_path = Path(\"my_design.systemrdl\")\n\n# Export the compiled RDL model using the SystemRDLConverter\ncompiler.export(SystemRDLConverter, output_path)\n\nprint(f\"RDL model successfully exported to {output_path.name}\")\n\n# Optional: Clean up the generated file\n# os.remove(output_path)\n","lang":"python","description":"This quickstart demonstrates how to use `peakrdl-systemrdl` as an exporter plugin for the `PeakRDL` compiler. It compiles a simple RDL string into an in-memory model and then exports it to a `.systemrdl` file. Ensure `peakrdl` is also installed (e.g., `pip install peakrdl`)."},"warnings":[{"fix":"Upgrade Python to 3.7 or newer. If unable to upgrade, pin `peakrdl-systemrdl<1.0.0` in your dependencies.","message":"Python 3.6 support was officially dropped in version 1.0.0. Users on Python 3.6 or older must upgrade their Python environment to 3.7+ or remain on `peakrdl-systemrdl` < 1.0.0.","severity":"breaking","affected_versions":"< 1.0.0"},{"fix":"Reinstall the package using the extra: `pip install peakrdl-systemrdl[cli]`.","message":"To enable the command-line interface (CLI) functionality provided by `peakrdl-systemrdl`, you must install the library with the `[cli]` extra: `pip install peakrdl-systemrdl[cli]`.","severity":"gotcha","affected_versions":">= 1.0.1"},{"fix":"Upgrade to `peakrdl-systemrdl >= 1.0.1` to automatically handle keyword escaping. Alternatively, rename your identifiers to avoid conflicts with SystemRDL keywords.","message":"Identifiers in RDL models that happen to be SystemRDL keywords could lead to parsing errors in downstream tools due to improper escaping. Version 1.0.1 introduced keyword filtering to correctly escape such identifiers.","severity":"gotcha","affected_versions":"< 1.0.1"},{"fix":"Upgrade to `peakrdl-systemrdl >= 1.0.1` to ensure correct and legal external field instantiation in the exported SystemRDL.","message":"Versions prior to 1.0.1 could generate an illegal external field instantiation in the resulting SystemRDL output, leading to invalid RDL files that fail to parse with other tools.","severity":"gotcha","affected_versions":"< 1.0.1"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install the package using pip: `pip install peakrdl-systemrdl`.","cause":"The `peakrdl-systemrdl` package is not installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'peakrdl_systemrdl'"},{"fix":"Install the `peakrdl` library: `pip install peakrdl`.","cause":"The `peakrdl` core library, which `peakrdl-systemrdl` is a plugin for, is not installed.","error":"ModuleNotFoundError: No module named 'peakrdl'"},{"fix":"Ensure you are using `from peakrdl_systemrdl import SystemRDLConverter`. If the error persists, upgrade to `peakrdl-systemrdl >= 0.2.0`.","cause":"The `SystemRDLConverter` class was not directly exposed at the top-level package in very old versions (<0.2.0), or an incorrect import path is being used.","error":"AttributeError: module 'peakrdl_systemrdl' has no attribute 'SystemRDLConverter'"},{"fix":"Upgrade to `peakrdl-systemrdl >= 1.0.1`. If the issue persists, review your RDL source for syntax errors or consider renaming identifiers that might clash with SystemRDL keywords.","cause":"An identifier in your RDL source either conflicts with a SystemRDL keyword or there's an issue with external field instantiation, particularly in versions prior to 1.0.1.","error":"peakrdl.core.exception.RDLCompileError: ERROR: Invalid identifier: '<your_identifier>'"}]}