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.post23.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.3.post23.tar.gz
Algorithm Hash digest
SHA256 f34c3025098f94b6448ebfff8a0ad95d72dcdc7941f8d5248edf8388ac9888cb
MD5 793338eca655446d86359651c801c2c6
BLAKE2b-256 22971f5c498d1da2355d449423c34994a17ef9e98857eb2fabe9a6b4fa8999fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.3.post23-py3-none-any.whl
Algorithm Hash digest
SHA256 7ed72386fcf51b94813f34a44c57106a74a20abc22c5cc370b5bc7c0cd56196d
MD5 697936c8bdbd87e0a1f078bb7dc83fe1
BLAKE2b-256 96d31557d2da16dfc8bcf91a3d4e31a51b2073ec0e8b2c43f0acd422f64d7cf9

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