pyralgen
pyralgen is a lightweight Python-based UVM-RAL code generator. It leverages the
SystemRDL standard to describe
the register specifications and extends the PeakRDL-uvm
framework to include build-in register coverage support.
Features
- UVM-RAL code generation with automatic coverage model insertion
- Template-driven: easily extend or override code templates
- Industry best practices: idiomatic, maintainable SystemVerilog output
- Configurable: enable or disable coverage, factory usage, and more via CLI options
Prerequisites
- Python 3.9.21 or later.
Installing
Note: pyralgen is still under active development.
Clone the repository and set up the Python environment :
# Clone project
git clone https://github.com/cirofabianbermudez/pyralgen.git
cd pyralgen
# Bootstrap Python venv and install deps
./scripts/setup/setup_python_env.sh
source .venv/bin/activate
# Verify installation
pyuvcgen -h
Example
The easiest way to use pyralgen is via the command line tool:
# Generate UVM-RAL
pyralgen -c registers.rdl -o ral_regs_pkg.sv
Integration
Inside the top_env.sv make sure to enable coverage models for register model before
creating the register model and enable sampling of coverage after building the register
model.
class top_env extends uvm_env;
`uvm_component_utils(top_env)
function void top_env::build_phase(uvm_phase phase);
...
if (regmodel == null) begin
// Enable Coverage models for register model <- Add this
uvm_reg::include_coverage("*", UVM_CVR_ALL);
// Create and build the register model
regmodel = ral_reg_block::type_id::create("regmodel", this);
uvm_config_db #(ral_reg_block)::set(this, "", "regmodel", regmodel);
regmodel.build();
// Enable sampling of coverage <- Add this
if (m_config.coverage_enable) begin
regmodel.set_coverage(UVM_CVR_ALL);
end
// Lock and reset
regmodel.lock_model();
regmodel.reset()
end
Development
-
Clone de repository and navigate to its root directory:
git clone https://github.com/cirofabianbermudez/pyralgen.git cd pyuvcgen
-
Create a Python virtual environment and install dependencies:
./script/setup/setup_python_env.sh source .venv/bin/activate
-
Verify installation:
pyuvcgen -h
License
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check issues or submit a pull request.
Metadata
Release files for pyralgen 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyralgen-1.0.1.tar.gz | 10.3 kB | Without provenance | Details for pyralgen-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyralgen-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pyralgen-1.0.1-py3-none-any.whl |
Total release size: 21.7 kB
Release files / pyralgen-1.0.1.tar.gz
| Download URL | pyralgen-1.0.1.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c133c28a616ad5763bc0f959773b2c9f647f2fa2cbae1ec20917ca261e461663
|
|
BLAKE2b-256 checksum How to use checksums |
6896d069dee40f6158950c3fc7bf06087c96a73071e5c75fe73a56c7cba27859
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Release files / pyralgen-1.0.1-py3-none-any.whl
| Download URL | pyralgen-1.0.1-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f431bdd598fd85f69f16903de5a7275c90c3b985902786c06174f12572eda2f7
|
|
BLAKE2b-256 checksum How to use checksums |
a148e906273b06f42864bf46306de077b62a8bfbe5b741f3327d4262f2070711
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Security for pyralgen 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.