30
30
from cocotb .handle import SimHandleBase
31
31
32
32
33
+ # Disable AXI ID filtering to let the CSR requests pass through
34
+ def disable_id_filtering (dut ):
35
+ if hasattr (dut , "disable_id_filtering_i" ):
36
+ dut .disable_id_filtering_i .value = 1
37
+ if hasattr (dut , "priv_ids_i" ):
38
+ dut .priv_ids_i .value = [0 ] * len (dut .priv_ids_i )
39
+
40
+
33
41
async def read_csr_and_verify (
34
42
testIf : FrontBusTestInterface ,
35
43
addr : int ,
@@ -67,7 +75,7 @@ async def write_csr_and_verify(
67
75
@cocotb .test ()
68
76
async def test_read_hci_version_csr (dut : SimHandleBase ):
69
77
"""Run test to read HCI version register."""
70
-
78
+ disable_id_filtering ( dut )
71
79
tb = get_frontend_bus_if ()(dut )
72
80
await tb .register_test_interfaces ()
73
81
@@ -80,7 +88,7 @@ async def test_read_hci_version_csr(dut: SimHandleBase):
80
88
@cocotb .test ()
81
89
async def test_read_pio_section_offset (dut : SimHandleBase ):
82
90
"""Run test to read PIO section offset register."""
83
-
91
+ disable_id_filtering ( dut )
84
92
tb = get_frontend_bus_if ()(dut )
85
93
await tb .register_test_interfaces ()
86
94
@@ -90,7 +98,7 @@ async def test_read_pio_section_offset(dut: SimHandleBase):
90
98
@cocotb .test ()
91
99
async def test_write_to_controller_device_addr (dut : SimHandleBase ):
92
100
"""Run test to write & read from Controller Device Address."""
93
-
101
+ disable_id_filtering ( dut )
94
102
tb = get_frontend_bus_if ()(dut )
95
103
await tb .register_test_interfaces ()
96
104
@@ -104,7 +112,7 @@ async def test_write_to_controller_device_addr(dut: SimHandleBase):
104
112
@cocotb .test ()
105
113
async def test_write_should_not_affect_ro_csr (dut : SimHandleBase ):
106
114
"""Run test to write to RO HC Capabilities."""
107
-
115
+ disable_id_filtering ( dut )
108
116
tb = get_frontend_bus_if ()(dut )
109
117
await tb .register_test_interfaces ()
110
118
@@ -119,6 +127,7 @@ async def test_write_should_not_affect_ro_csr(dut: SimHandleBase):
119
127
120
128
@cocotb .test ()
121
129
async def test_sequence_csr_read (dut : SimHandleBase ):
130
+ disable_id_filtering (dut )
122
131
tb = get_frontend_bus_if ()(dut )
123
132
await tb .register_test_interfaces ()
124
133
@@ -153,6 +162,7 @@ async def test_sequence_csr_read(dut: SimHandleBase):
153
162
154
163
@cocotb .test ()
155
164
async def test_sequence_csr_write (dut : SimHandleBase ):
165
+ disable_id_filtering (dut )
156
166
tb = get_frontend_bus_if ()(dut )
157
167
await tb .register_test_interfaces ()
158
168
0 commit comments