Skip to main content

Generate RAL tests from systemRDL.

Project description

peakrdl-cocotb-ralgen

A SystemRDL to raltest converter for cocotb.

This VIP confirms to sysrdl 1.2 and ral 1.0 format.

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.8.tar.gz (882.1 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.8-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: peakrdl_cocotb_ralgen-0.1.8.tar.gz
  • Upload date:
  • Size: 882.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.6 CPython/3.12.3 Linux/6.8.0-101-generic

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.8.tar.gz
Algorithm Hash digest
SHA256 386680938424ff7de36b538f80634256d7113a3a4d8d46cf8e5340acbd076899
MD5 7be9aeba43308b9304813521e78d5ad8
BLAKE2b-256 059ba177be32b386e646092cd526d3f8e642ff91d792a7c5aa6d5276e2befd40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 434c3097ed571238cc9d989a5d3193510adbbca0e3f45eeb25e1995c35399a7c
MD5 6c426c868ff880504e09eeeaa1871af1
BLAKE2b-256 6c68dc6dbd7b71b56546412bc3568c105089ffa73309610170d95eb76f60d920

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