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.7a5.post4.tar.gz (57.2 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file peakrdl_cocotb_ralgen-0.1.7a5.post4.tar.gz.

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.7a5.post4.tar.gz
Algorithm Hash digest
SHA256 d29c3aafa3941aaa617be3b762a0c4c4d47a260ac9ab5109980124342f20e130
MD5 98e5ad269d18e08649f0cd41106f9d85
BLAKE2b-256 efe06f28994ea6c8f6cdbc7b37a93d28edc6db82fa9b0221f9dbd3d33060e8b4

See more details on using hashes here.

File details

Details for the file peakrdl_cocotb_ralgen-0.1.7a5.post4-py3-none-any.whl.

File metadata

File hashes

Hashes for peakrdl_cocotb_ralgen-0.1.7a5.post4-py3-none-any.whl
Algorithm Hash digest
SHA256 2e88c7d4623b5c71f2ce47cf0c00efe0386d1c087413ac147e569f31a89b9a43
MD5 bbdafcc1c606676b07a7850347297c7d
BLAKE2b-256 cc983e471aabee59c3ef860fc58f6296bc5481b55c36d9d88ad7942d4040c816

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