Generate RAL tests from systemRDL depends on peakrdl-python to create the class for frontend access
Project description
peakrdl-cocotb-ralgen
A SystemRDL to Raltest converter for cocotb.
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.5.post8.tar.gz
.
File metadata
- Download URL: peakrdl_cocotb_ralgen-0.1.5.post8.tar.gz
- Upload date:
- Size: 17.9 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 | 804d36e175241dd160607abfbbba4807126efad28b44d8d341c3397a218ca5f2 |
|
MD5 | 1f56482848b6468373a1dd71ef0a8cd6 |
|
BLAKE2b-256 | a3628e119de824db47e08f96b4961af3107dc8d5caee5ff52d2e6c70593a3f61 |
File details
Details for the file peakrdl_cocotb_ralgen-0.1.5.post8-py3-none-any.whl
.
File metadata
- Download URL: peakrdl_cocotb_ralgen-0.1.5.post8-py3-none-any.whl
- Upload date:
- Size: 10.9 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 | f55ef29020fc6d258294c0dfec7ef82fc30ce5249a14ec4f8f9d3c62d9921901 |
|
MD5 | 6fe68099326d9f9e8e5ff89e008629bd |
|
BLAKE2b-256 | ff9ce94ff13b96bfc05299a75f8f02c0f58a6998afad40c3014217c8ca0ae30a |