Generate RAL tests from systemRDL.
Project description
peakrdl-cocotb-ralgen
A SystemRDL to raltest converter for cocotb.
This VIP confirms to sysrdl 1.2 and ral 1.0 format.
Installation
pip3 install peakrdl-cocotb-ralgen
Usage
peakrdl cocotb_ralgen <SystemRDL File> -o <output folder>
peakrdl python <SystemRDL File> -o <output folder>
Then in your cocotb test file
...
from peakrdl_cocotb_ralgen.callbacks.bsv import Callback
from peakrdl_cocotb_ralgen.testcases import rw_test, reset_test
from <AddrMap Name>_RAL import <AddrMap_Name>_RAL_Test as RAL
...
To read and check the value of all registers at Reset.
@cocotb.test
async def test_ral_reset(dut):
"""Ral test reset."""
env = Env(dut)
ral = RAL(env.reg, callback=Callback(dut))
env.start()
await FallingEdge(dut.rst_n)
await ReadOnly()
await reset_test.reset_test(ral, verbose=True)
To perform read write checks:
@cocotb.test
async def test_ral_readwrite(dut):
"""Ral test reset."""
env = Env(dut)
ral = RAL(env.reg, callback=Callback(dut))
await RisingEdge(dut.rst_n)
await ReadOnly()
await rw_test.rw_test(ral,
verbose=True
foreground_read=True,
foreground_write=False,
count=1,
verbose=True,
)
...
Supporting different RTL generators.
For interfacing your RTL Generator generated code, ralgen needs to know the pattern used by you for signal naming. You can provide this information by passing a Callback function which maps the signal from systemRDL to RTL and provides methods to read & write to it.
Adding new tests.
New tests can be added to the testcases folder.
Contribution
PR's for supporting different RTL generators or test strategies are welcome.
Example
For a complete working example check the tests folder.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file peakrdl_cocotb_ralgen-0.1.6.post4.tar.gz
.
File metadata
- Download URL: peakrdl_cocotb_ralgen-0.1.6.post4.tar.gz
- Upload date:
- Size: 57.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.19.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8b7a1177ddcf0617fed9b95a9eec2e7f672783518dd128395a7d357e4994f25 |
|
MD5 | 345750c421b34ebd2ffe86653b684e21 |
|
BLAKE2b-256 | bb2f8b03f3ae5debce3467d93cba08737b6fc4b6d5b0dec70442cffff8fe4f4a |
File details
Details for the file peakrdl_cocotb_ralgen-0.1.6.post4-py3-none-any.whl
.
File metadata
- Download URL: peakrdl_cocotb_ralgen-0.1.6.post4-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.19.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a4d3ae23a315720f191da52ad2d2e5d208ae2fb6d09d2d846f072f893346100 |
|
MD5 | 510d6cddd040d0a1d2647c0cd368c175 |
|
BLAKE2b-256 | 1d51e6d215df0ddb8f7e5ce15d53fb1921d93ff036cab1e6b2257a388af757a0 |