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 <AddrMap Name>_RAL import <AddrMap Name>_RAL_Test
...
ral=<AddrMap Name>_RAL_Test(regmodel)
from <AddrMap_Name>_RAL import <AddrMap_Name>_RAL_Test as RAL
@cocotb.test
async def test_ral(dut):
env=Env(dut)
await env.ral.rw_test()
...
And in your cocotb env file
from <AddrMap_Name>.reg_model.<AddrMap_Name> import <AddrMap_Name>_cls
from <AddrMap_Name>.lib import AsyncCallbackSet
from <AddrMap_Name>_RAL import <AddrMap_Name>_RAL_Test as RAL
class Env:
def __init__(dut,...):
self.reg=<AddrMap_Name>_cls(
callbacks=AsyncCallbackSet(
read_callback=self.readReg,
write_callback=self.writeReg
))
self.ral=RAL(self.reg)
async def ral_rw(self):
self.ral.rw_test()
...
To support background read and writes you need to create callbacks which will return the signal value 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.3.post19.tar.gz
.
File metadata
- Download URL: peakrdl_cocotb_ralgen-0.1.3.post19.tar.gz
- Upload date:
- Size: 15.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 | e58d9f51bcf6b248d5bd6b01cbc15d7a5c12f49edb5d1e3195f68752ccf64fb7 |
|
MD5 | f2fa94f75ddb123792e37f373df929c5 |
|
BLAKE2b-256 | 39700a8cc2ffe417115d9576a2bc2627fd3d9a3ccc61ee46475ee602a5aef51b |
File details
Details for the file peakrdl_cocotb_ralgen-0.1.3.post19-py3-none-any.whl
.
File metadata
- Download URL: peakrdl_cocotb_ralgen-0.1.3.post19-py3-none-any.whl
- Upload date:
- Size: 7.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 | 12b1c3d4b76af5905b3fbc10c86bc7997fab360414464cfa4d6b504dd24e5a3f |
|
MD5 | dd34d5918cab0b31eb1302f836cf3662 |
|
BLAKE2b-256 | a53035e11415bede4e5013d178ba79a0fc37acbacc28580eae4f47733f9e7edb |