Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peakrdl_cocotb_ralgen-0.1.3.post28.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file peakrdl_cocotb_ralgen-0.1.3.post28.tar.gz.

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.3.post28.tar.gz
Algorithm Hash digest
SHA256 9d5e5cad36859012d404f18461d7f3c5cb1251990ba1d84144871af15e051f32
MD5 67752b793bb0b1c2a3f368f2bbe26e2c
BLAKE2b-256 02984045559147f7950d4bc42e75e69954a6bea9eca598d243508e6a001762a1

See more details on using hashes here.

File details

Details for the file peakrdl_cocotb_ralgen-0.1.3.post28-py3-none-any.whl.

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.3.post28-py3-none-any.whl
Algorithm Hash digest
SHA256 2403d9de5d504c5128128bab1f9eb18227616c6dc460cd8c11c83dd6e4d404e5
MD5 2ab947f474f3f474fb78c95552cdb61f
BLAKE2b-256 995b7e7e6419324f8cf7930f9677dca07e05e95bd4529534a3122eafd7ee6b9f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page