Files
PeakRDL-BusDecoder/tests/unroll/conftest.py
Arnav Sacheti b1f1bf983a Refactor tests (better grouping + cocotb support) (#15)
* initial refactor

* fix cocotb tests

* fix typecheck

* install verilator
2025-10-26 17:56:35 -07:00

41 lines
915 B
Python

from collections.abc import Callable
import pytest
from systemrdl.node import AddrmapNode
@pytest.fixture
def sample_rdl(compile_rdl: Callable[..., AddrmapNode]) -> AddrmapNode:
"""Create a simple RDL design with an array."""
rdl_source = """
addrmap top {
reg my_reg {
field {
sw=rw;
hw=r;
} data[31:0];
};
my_reg regs[4] @ 0x0 += 0x4;
};
"""
return compile_rdl(rdl_source)
@pytest.fixture
def multidim_array_rdl(compile_rdl: Callable[..., AddrmapNode]) -> AddrmapNode:
"""Create an RDL design with a multi-dimensional array."""
rdl_source = """
addrmap top {
reg my_reg {
field {
sw=rw;
hw=r;
} data[31:0];
};
my_reg matrix[2][3] @ 0x0 += 0x4;
};
"""
return compile_rdl(rdl_source)