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()
...

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

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.3.post12.tar.gz
Algorithm Hash digest
SHA256 32b9940ba1ca9d500f20d6f310b71997b106c88e2e88323bb9907e6491df993f
MD5 e59f7d22c2691e214b32856cb896e4c5
BLAKE2b-256 4c025837fa93cf8d86428e78f10b314ed436f16d54010cffaebb6c4327c25138

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.3.post12-py3-none-any.whl
Algorithm Hash digest
SHA256 7f90542a853f8b203d43c239cf191251eeb76b0b0a4abb8549b747ea207dd20f
MD5 d973eed93318fdcd2bccb582605ed21c
BLAKE2b-256 f12fc4f6b99a6214e58a3f63b23b7f4dfbe6cae97154aa2f64f438c1e6810524

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