Metadata-Version: 2.1
Name: peakrdl-cocotb-ralgen
Version: 0.1.3.post11
Summary: Generate RAL tests from systemRDL depends on peakrdl-python to create the class for frontend access
Author-Email: Vijayvithal Jahagirdar <jahagirdar.vs@gmail.com>
License: MIT
Project-URL: Homepage, https://dyumnin.com/cocotb_ralgen
Project-URL: Repository, https://github.com/dyumnin/cocotb-ralgen.git
Project-URL: Issues, https://github.com/dyumnin/cocotb-ralgen/issues
Requires-Python: >=3.10
Requires-Dist: peakrdl-python>=0.8.1
Requires-Dist: systemrdl-compiler>=1.27.3
Requires-Dist: jinja2>=3.1.4
Requires-Dist: peakrdl>=1.1.0
Description-Content-Type: text/markdown

# 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.
