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-python peakrdl-cocotb-raltest

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 DMA_Reg_RAL import DMA_Reg_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 DMA_Reg.reg_model.DMA_Reg import DMA_Reg_cls
from DMA_Reg.lib  import AsyncCallbackSet
from DMA_Reg_RAL import DMA_Reg_RAL_Test as RAL
class Env:
     def __init__(dut,...):
	self.reg=DMA_Reg_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 test 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.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

peakrdl_cocotb_ralgen-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: peakrdl_cocotb_ralgen-0.1.0.tar.gz
  • Upload date:
  • Size: 14.8 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.0.tar.gz
Algorithm Hash digest
SHA256 f271204ad5305d545af37e5de823a5716593d2d7b7bc7f6933d2ea70cc3ca81f
MD5 960d3e2a7bdec13f525d5a30b7312589
BLAKE2b-256 633db6d4dd67539961ebe46379cc831932d9a589a99e25298e654be7641a0a69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 200598585cd550384b67154612a95027a51708b07fc93d1492f4a80b066ffab5
MD5 cdc6e1a022a2cd59210ee1f1a057b4f4
BLAKE2b-256 e9c001421ee116a1a0a8dafed42be48aeaaeacc6d6294c13c88f71a9411b442b

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