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

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.3.post14.tar.gz
Algorithm Hash digest
SHA256 719ae6f0ee450590679716a8b67f6db3ee30d6a66df96eae19c773a43b0253cc
MD5 989a8550b0c557b9a5b7706ad9bd78c0
BLAKE2b-256 2994cfea2b02aaec2287278c5632879261543430c757cb05f908b0db9c05250e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.3.post14-py3-none-any.whl
Algorithm Hash digest
SHA256 a8241099cbe8eb64f0db4718fa15289b8f452374f1aba962b523801af448f950
MD5 0f06e34c19b28a1f936f9709a4291651
BLAKE2b-256 6eaf648ad9954b278da539f1420a5f1f5a1c13258ce7ab17bf7658b0d000a9bd

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