Initial Commit - Forked from PeakRDL-regblock @ a440cc19769069be831d267505da4f3789a26695
This commit is contained in:
0
tests/test_write_strobes/__init__.py
Normal file
0
tests/test_write_strobes/__init__.py
Normal file
54
tests/test_write_strobes/regblock.rdl
Normal file
54
tests/test_write_strobes/regblock.rdl
Normal file
@@ -0,0 +1,54 @@
|
||||
addrmap top {
|
||||
|
||||
reg {
|
||||
field {
|
||||
sw=rw; hw=na;
|
||||
onwrite = woset;
|
||||
} f1[3:0] = 0x0;
|
||||
|
||||
field {
|
||||
sw=rw; hw=na;
|
||||
onwrite = woclr;
|
||||
} f2[7:4] = 0xF;
|
||||
|
||||
field {
|
||||
sw=rw; hw=na;
|
||||
onwrite = wot;
|
||||
} f3[11:8] = 0x0;
|
||||
} r1;
|
||||
|
||||
reg {
|
||||
field {
|
||||
sw=rw; hw=na;
|
||||
onwrite = wzs;
|
||||
} f1[3:0] = 0x0;
|
||||
|
||||
field {
|
||||
sw=rw; hw=na;
|
||||
onwrite = wzc;
|
||||
} f2[7:4] = 0xF;
|
||||
|
||||
field {
|
||||
sw=rw; hw=na;
|
||||
onwrite = wzt;
|
||||
} f3[11:8] = 0x0;
|
||||
} r2;
|
||||
|
||||
reg {
|
||||
field {
|
||||
sw=rw; hw=na;
|
||||
onwrite = wclr;
|
||||
} f1[7:0] = 0xF0;
|
||||
|
||||
field {
|
||||
sw=rw; hw=na;
|
||||
onwrite = wset;
|
||||
} f2[15:8] = 0x0F;
|
||||
} r3;
|
||||
|
||||
reg {
|
||||
field {
|
||||
sw=rw; hw=na;
|
||||
} f3[7:0] = 0x00;
|
||||
} r4;
|
||||
};
|
||||
31
tests/test_write_strobes/tb_template.sv
Normal file
31
tests/test_write_strobes/tb_template.sv
Normal file
@@ -0,0 +1,31 @@
|
||||
{% extends "lib/tb_base.sv" %}
|
||||
|
||||
{% block seq %}
|
||||
{% sv_line_anchor %}
|
||||
##1;
|
||||
cb.rst <= '0;
|
||||
##1;
|
||||
|
||||
cpuif.assert_read('h0, 'h0_F_0);
|
||||
cpuif.write ('h0, 'h5_5_5, 'h3_3_3);
|
||||
cpuif.assert_read('h0, 'h1_E_1);
|
||||
cpuif.write ('h0, 'h5_A_A, 'h3_3_3);
|
||||
cpuif.assert_read('h0, 'h0_C_3);
|
||||
|
||||
cpuif.assert_read('h4, 'h0_F_0);
|
||||
cpuif.write ('h4, 'hA_A_A, 'h3_3_3);
|
||||
cpuif.assert_read('h4, 'h1_E_1);
|
||||
cpuif.write ('h4, 'hA_5_5, 'h3_3_3);
|
||||
cpuif.assert_read('h4, 'h0_C_3);
|
||||
|
||||
cpuif.assert_read('h8, 'h0F_F0);
|
||||
cpuif.write ('h8, 'h12_34, 'hFF_00);
|
||||
cpuif.assert_read('h8, 'hFF_00);
|
||||
|
||||
cpuif.assert_read('hC, 'h00);
|
||||
cpuif.write ('hC, 'hFF, 'hF0);
|
||||
cpuif.assert_read('hC, 'hF0);
|
||||
cpuif.write ('hC, 'h00, 'h3C);
|
||||
cpuif.assert_read('hC, 'hC0);
|
||||
|
||||
{% endblock %}
|
||||
9
tests/test_write_strobes/testcase.py
Normal file
9
tests/test_write_strobes/testcase.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from ..lib.sim_testcase import SimTestCase
|
||||
|
||||
from ..lib.cpuifs.passthrough import Passthrough
|
||||
|
||||
class Test(SimTestCase):
|
||||
cpuif = Passthrough()
|
||||
|
||||
def test_dut(self):
|
||||
self.run_test()
|
||||
Reference in New Issue
Block a user