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 peakrdl_cocotb_ralgen.callbacks.bsv import Callback
from peakrdl_cocotb_ralgen.testcases import rw_test, reset_test
from <AddrMap Name>_RAL import <AddrMap_Name>_RAL_Test as RAL
...

To read and check the value of all registers at Reset.

@cocotb.test
async def test_ral_reset(dut):
    """Ral test reset."""
    env = Env(dut)
    ral = RAL(env.reg, callback=Callback(dut))
    env.start()
    await FallingEdge(dut.rst_n)
    await ReadOnly()
    await reset_test.reset_test(ral, verbose=True)

To Perform Read write checks:

@cocotb.test
async def test_ral_readwrite(dut):
    """Ral test reset."""
    env = Env(dut)
    ral = RAL(env.reg, callback=Callback(dut))
    await RisingEdge(dut.rst_n)
    await ReadOnly()
    await rw_test.rw_test(ral,
    verbose=True
        foreground_read=True,
        foreground_write=False,
        count=1,
        verbose=True,
    )
...

supporting different RTL Generators.

For interfacing your RTL Generator generated code, ralgen needs to know the pattern used by you for signal naming. You can provide this information by passing a Callback function which maps the signal from systemRDL to RTL and provides methods to read & write to it.

Adding new tests.

New tests can be added to the testcases folder.

Contribution

PR's for supporting different RTL generators or test strategies are welcome.

#Example

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

Uploaded Source

Built Distribution

peakrdl_cocotb_ralgen-0.1.6-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: peakrdl_cocotb_ralgen-0.1.6.tar.gz
  • Upload date:
  • Size: 17.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.6.tar.gz
Algorithm Hash digest
SHA256 98bb30dbb0efb795647f5e4ea5b411841298b3166b4ab33e924dbba1e11cd92b
MD5 c45a903e4dbbc58314522a43b85a0c68
BLAKE2b-256 b9e73590a5cb940ee9637042278ce63743de642681bc39e9a09acd9e6e22c181

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 305315f30f25bb72eca393438d78dc77d65a6c2be13c466957688d28521a42e5
MD5 8643b1ee4b1617b6c7a131fffedbdac0
BLAKE2b-256 7eaf5e1f666417a963a4110f1849bde3fa8d4e7603c56b384a771a3df38dfcc7

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