{"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.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install peakrdl-systemrdl","pip install peakrdl-systemrdl[cli]"],"cli":{"name":"peakrdl","version":"sh: 1: peakrdl: not found"}},"imports":["from peakrdl_systemrdl import SystemRDLConverter"],"auth":{"required":false,"env_vars":[]},"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`).","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}