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()
...
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.post8.tar.gz
.
File metadata
- Download URL: peakrdl_cocotb_ralgen-0.1.3.post8.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.19.3 CPython/3.10.12 Linux/6.8.0-47-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bcfa1a134f517e2b95fe47603c34e67b270ca4951576037332db9a514c2d457 |
|
MD5 | bc2152d5de97e93370422eb4a7edcd5c |
|
BLAKE2b-256 | c4f317ff6301b92319d76cb5b2e5f1aeb4f104737452809c5ec408c51d138a65 |
File details
Details for the file peakrdl_cocotb_ralgen-0.1.3.post8-py3-none-any.whl
.
File metadata
- Download URL: peakrdl_cocotb_ralgen-0.1.3.post8-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.19.3 CPython/3.10.12 Linux/6.8.0-47-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fbf9fa98d438203dd925fde76db3c0570423e649d5d17d206d8a19d1bfa7deb |
|
MD5 | aab9837468ced783b67416575d785662 |
|
BLAKE2b-256 | 8a8e4352533d48214f5d6d2c75fa222add6ddf875e9247228cc411c8f0299c51 |