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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

peakrdl_cocotb_ralgen-0.1.3.post18-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: peakrdl_cocotb_ralgen-0.1.3.post18.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.19.3 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.3.post18.tar.gz
Algorithm Hash digest
SHA256 ce1eff3d3ced32fb678b6c50515e706fed0bed219637fef7e8ffd9fc0980510e
MD5 e48a4f3505c4608c440ccbbb9b2a6014
BLAKE2b-256 a123cc0a1ff4b92d1fae8acdcaff9cc9b459445d4151b4a12fcc4fd8ecc80d9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.3.post18-py3-none-any.whl
Algorithm Hash digest
SHA256 a36ee05ff73705f8d8445d10931e2add021888c008efccc798d7d0cb46e81bb6
MD5 f2bb9d8128a6bec0caa7949890ce8ebc
BLAKE2b-256 e9c386297fb8feec57ecb5a51d2533c859b83dac7ab323131688350480d85949

See more details on using hashes here.

Supported by

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