{"id":8409,"library":"peakrdl-uvm","title":"PeakRDL-uvm","description":"PeakRDL-uvm is a Python library that generates a Universal Verification Methodology (UVM) register model from compiled SystemRDL input. It is part of the broader PeakRDL ecosystem for control and status register (CSR) automation. The current version is 2.4.0, and the project maintains an active development and release cadence.","status":"active","version":"2.4.0","language":"en","source_language":"en","source_url":"https://github.com/SystemRDL/PeakRDL-uvm","tags":["UVM","SystemRDL","register model","EDA","hardware design","verification","code generation","FPGA","ASIC"],"install":[{"cmd":"pip install peakrdl-uvm","lang":"bash","label":"Install library"},{"cmd":"pip install peakrdl peakrdl-uvm","lang":"bash","label":"Install with PeakRDL CLI tool"}],"dependencies":[{"reason":"Required to compile SystemRDL input files into an elaboratable model.","package":"systemrdl-compiler"},{"reason":"Used as the templating engine for generating the UVM output.","package":"jinja2"},{"reason":"Provides the 'peakrdl' command-line interface, which simplifies the use of PeakRDL-uvm and other PeakRDL plugins. While not a direct library dependency for API usage, it's the easiest and recommended way to use the tool.","package":"peakrdl"}],"imports":[{"note":"The `peakrdl.uvm` namespace package was deprecated in v2.1.0 and completely removed in v2.3.0. Always use `from peakrdl_uvm import UVMExporter`.","wrong":"from peakrdl.uvm import UVMExporter","symbol":"UVMExporter","correct":"from peakrdl_uvm import UVMExporter"}],"quickstart":{"code":"import sys\nimport os\nfrom systemrdl import RDLCompiler, RDLCompileError\nfrom peakrdl_uvm import UVMExporter\n\n# Create a dummy RDL file for demonstration\nrdl_content = \"\"\"\naddrmap my_design {\n    reg {\n        field { sw = w; hw = r; } foo;\n    } bar at 0x0;\n};\n\"\"\"\nwith open(\"my_design.rdl\", \"w\") as f:\n    f.write(rdl_content)\n\n# Compile the SystemRDL file\nrdlc = RDLCompiler()\ntry:\n    rdlc.compile_file(\"my_design.rdl\")\n    root = rdlc.elaborate()\nexcept RDLCompileError:\n    print(\"RDL Compilation Error!\")\n    sys.exit(1)\n\n# Export the UVM register model\nexporter = UVMExporter()\noutput_path = \"my_design_uvm_pkg.sv\"\nexporter.export(node=root, path=output_path)\n\nprint(f\"UVM register model generated to {output_path}\")\n\n# Clean up dummy files\nos.remove(\"my_design.rdl\")\nos.remove(output_path)","lang":"python","description":"This quickstart demonstrates how to use the `UVMExporter` class programmatically to compile a SystemRDL file and generate a UVM register model. It first creates a dummy RDL file, compiles it using `systemrdl-compiler`, elaborates the design, and then uses `PeakRDL-uvm` to export the UVM package."},"warnings":[{"fix":"Update all package names, import statements, and command-line references from `RALBot-uvm` to `PeakRDL-uvm`.","message":"The project was renamed from `RALBot-uvm` to `PeakRDL-uvm` in version 2.0.0. Older import paths or commands using `RALBot-uvm` will no longer work.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Consult the release notes for v2.0.0 and update your API calls according to the new `UVMExporter` interface. The export process was reworked to use Jinja templates.","message":"Version 2.0.0 introduced a significant refactoring of the UVM exporter implementation, leading to substantial API differences. Code written for versions prior to 2.0.0 will likely break.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Change all import statements from `from peakrdl.uvm import ...` to `from peakrdl_uvm import ...`.","message":"The `peakrdl.uvm` namespace package import was deprecated in v2.1.0 and removed in v2.3.0. Attempting to import from this path in newer versions will fail.","severity":"deprecated","affected_versions":">=2.1.0"},{"fix":"Upgrade your Python environment to version 3.7 or newer. The project requires `Python >=3.7`.","message":"Support for Python 3.5 and 3.6 was dropped in version 2.4.0. Users on these Python versions will not be able to install or run `peakrdl-uvm` v2.4.0 or later.","severity":"breaking","affected_versions":">=2.4.0"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Update your import statements to `from peakrdl_uvm import UVMExporter`.","cause":"Attempting to import from the deprecated `peakrdl.uvm` namespace after it was removed in v2.3.0 (deprecated since v2.1.0).","error":"ImportError: No module named 'peakrdl.uvm'"},{"fix":"Refer to the documentation or release notes for v2.0.0 to understand the new API. You will need to rewrite parts of your exporter logic.","cause":"Major API refactoring occurred in v2.0.0, causing methods and properties from older versions to become unavailable.","error":"AttributeError: 'UVMExporter' object has no attribute 'old_method_name'"},{"fix":"Upgrade `peakrdl-uvm` to version 2.4.0 or newer to use the `user_template_dir` option. Alternatively, remove the `user_template_dir` argument if not strictly needed.","cause":"Configuration option `user_template_dir` was added in v2.4.0. Using it with older versions of the library will result in an error.","error":"TypeError: UVMExporter.__init__() got an unexpected keyword argument 'user_template_dir'"}]}