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

Uploaded Source

Built Distribution

peakrdl_cocotb_ralgen-0.1.4-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file peakrdl_cocotb_ralgen-0.1.4.tar.gz.

File metadata

  • Download URL: peakrdl_cocotb_ralgen-0.1.4.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.19.3 CPython/3.8.18 Linux/5.15.0-1073-azure

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.4.tar.gz
Algorithm Hash digest
SHA256 57af76f197514a7e8fbad8cba511ad5915cb317c0843f329a5a87beb50fcd183
MD5 90c1d01c25de6b7ac115da8b62922cb8
BLAKE2b-256 dbb62033443e2dd1c2bcd87615d88cc43747e172cd725e013800a64b26d7144e

See more details on using hashes here.

File details

Details for the file peakrdl_cocotb_ralgen-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b98dd56aafb54ab9381c0f40a36dd6764313087183d98a0e0132b49fa52348f8
MD5 8e2bf6a65fceeceb21b08ad88c2d2c3e
BLAKE2b-256 667dd87ec30739e317e7b3eff823239ce208a1864eab9b7b611a47a16555897e

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