Skip to content

Commit 9591af8

Browse files
wkkunakgugala
authored andcommitted
i3c_config: Enable ID filtering by default
Disables ID filtering for older tests as their default behavior of AXI TID for issuing reads & writes is to incremental with regards to the transaction. Signed-off-by: Wiktoria Kuna <[email protected]>
1 parent 27a587e commit 9591af8

File tree

8 files changed

+38
-8
lines changed

8 files changed

+38
-8
lines changed

i3c_core_configs.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ axi:
4646
FrontendBusDataWidth: 32
4747
FrontendBusUserWidth: 32
4848
FrontendBusIdWidth: 8
49-
FrontendBusIdFiltering: False
49+
FrontendBusIdFiltering: True
50+
NumPrivIds: 4
5051
DisableInputFF: True
5152

5253
axi_ff:
@@ -63,5 +64,6 @@ axi_ff:
6364
FrontendBusDataWidth: 32
6465
FrontendBusUserWidth: 32
6566
FrontendBusIdWidth: 8
66-
FrontendBusIdFiltering: False
67+
FrontendBusIdFiltering: True
68+
NumPrivIds: 4
6769
DisableInputFF: False

src/i3c_defines.svh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
`define AXI_DATA_WIDTH 32
1818
`define AXI_USER_WIDTH 32
1919
`define AXI_ID_WIDTH 8
20+
`define AXI_ID_FILTERING 1
21+
`define NUM_PRIV_IDS 4
2022
`define DISABLE_INPUT_FF 1
2123

2224
`endif // I3C_CONFIG

verification/cocotb/block/axi_adapter/test_bus_stress.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ async def initialize(dut, timeout=50):
5858
dut.wvalid.value = 0
5959
dut.bready.value = 0
6060

61+
if hasattr(dut, "disable_id_filtering_i"):
62+
dut.disable_id_filtering_i.value = 1
63+
6164
# Configure testbench
6265
tb = get_frontend_bus_if()(dut)
6366
tb.log = dut._log

verification/cocotb/block/hci_queues_axi/hci_queues_wrapper.sv

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// SPDX-License-Identifier: Apache-2.0
2+
`include "i3c_defines.svh"
23

34
module hci_queues_wrapper
45
import i3c_pkg::*;
@@ -12,6 +13,9 @@ module hci_queues_wrapper
1213
parameter int unsigned AxiDataWidth = 32,
1314
parameter int unsigned AxiUserWidth = 32,
1415
parameter int unsigned AxiIdWidth = 2,
16+
`ifdef AXI_ID_FILTERING
17+
parameter int unsigned NumPrivIds = 4,
18+
`endif
1519

1620
parameter int unsigned HciRespFifoDepth = 64,
1721
parameter int unsigned HciCmdFifoDepth = 64,
@@ -107,7 +111,7 @@ module hci_queues_wrapper
107111

108112
`ifdef AXI_ID_FILTERING
109113
input logic disable_id_filtering_i,
110-
input logic [AxiIdWidth-1:0] priv_ids_i [NumPrivIds-1],
114+
input logic [AxiIdWidth-1:0] priv_ids_i [NumPrivIds],
111115
`endif
112116

113117
// HCI queues (FSM side)

verification/cocotb/block/lib_adapter/test_csr_sw_access.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
from cocotb.handle import SimHandleBase
3131

3232

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+
3341
async def read_csr_and_verify(
3442
testIf: FrontBusTestInterface,
3543
addr: int,
@@ -67,7 +75,7 @@ async def write_csr_and_verify(
6775
@cocotb.test()
6876
async def test_read_hci_version_csr(dut: SimHandleBase):
6977
"""Run test to read HCI version register."""
70-
78+
disable_id_filtering(dut)
7179
tb = get_frontend_bus_if()(dut)
7280
await tb.register_test_interfaces()
7381

@@ -80,7 +88,7 @@ async def test_read_hci_version_csr(dut: SimHandleBase):
8088
@cocotb.test()
8189
async def test_read_pio_section_offset(dut: SimHandleBase):
8290
"""Run test to read PIO section offset register."""
83-
91+
disable_id_filtering(dut)
8492
tb = get_frontend_bus_if()(dut)
8593
await tb.register_test_interfaces()
8694

@@ -90,7 +98,7 @@ async def test_read_pio_section_offset(dut: SimHandleBase):
9098
@cocotb.test()
9199
async def test_write_to_controller_device_addr(dut: SimHandleBase):
92100
"""Run test to write & read from Controller Device Address."""
93-
101+
disable_id_filtering(dut)
94102
tb = get_frontend_bus_if()(dut)
95103
await tb.register_test_interfaces()
96104

@@ -104,7 +112,7 @@ async def test_write_to_controller_device_addr(dut: SimHandleBase):
104112
@cocotb.test()
105113
async def test_write_should_not_affect_ro_csr(dut: SimHandleBase):
106114
"""Run test to write to RO HC Capabilities."""
107-
115+
disable_id_filtering(dut)
108116
tb = get_frontend_bus_if()(dut)
109117
await tb.register_test_interfaces()
110118

@@ -119,6 +127,7 @@ async def test_write_should_not_affect_ro_csr(dut: SimHandleBase):
119127

120128
@cocotb.test()
121129
async def test_sequence_csr_read(dut: SimHandleBase):
130+
disable_id_filtering(dut)
122131
tb = get_frontend_bus_if()(dut)
123132
await tb.register_test_interfaces()
124133

@@ -153,6 +162,7 @@ async def test_sequence_csr_read(dut: SimHandleBase):
153162

154163
@cocotb.test()
155164
async def test_sequence_csr_write(dut: SimHandleBase):
165+
disable_id_filtering(dut)
156166
tb = get_frontend_bus_if()(dut)
157167
await tb.register_test_interfaces()
158168

verification/cocotb/block/lib_hci_queues/hci_queues.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ async def setup(self):
2828
self.dut.tti_ibi_rready_i.value = 0
2929
self.dut.bypass_i3c_core_i.value = 0
3030

31+
if hasattr(self.dut, "disable_id_filtering_i"):
32+
self.dut.disable_id_filtering_i.value = 1
33+
3134
await super()._setup(get_frontend_bus_if())
3235

3336
async def reset(self):

verification/cocotb/top/lib_i3c_top/i3c_test_wrapper.sv

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ module i3c_test_wrapper #(
1616
parameter int unsigned AxiAddrWidth = `AXI_ADDR_WIDTH,
1717
parameter int unsigned AxiUserWidth = `AXI_USER_WIDTH,
1818
parameter int unsigned AxiIdWidth = `AXI_ID_WIDTH,
19+
`ifdef AXI_ID_FILTERING
20+
parameter int unsigned NumPrivIds = `NUM_PRIV_IDS,
21+
`endif
1922
`endif
2023
parameter int unsigned DatAw = i3c_pkg::DatAw,
2124
parameter int unsigned DctAw = i3c_pkg::DctAw,
@@ -86,7 +89,7 @@ module i3c_test_wrapper #(
8689

8790
`ifdef AXI_ID_FILTERING
8891
input logic disable_id_filtering_i,
89-
input logic [AxiIdWidth-1:0] priv_ids_i [NumPrivIds-1],
92+
input logic [AxiIdWidth-1:0] priv_ids_i [NumPrivIds],
9093
`endif
9194
`endif
9295
// I3C Target Simulation model

verification/cocotb/top/lib_i3c_top/interface.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ async def setup(self, fclk=500.0):
3636
self.dut._log.warning(f"Enforcing min. system clock frequency of {fmin:.3f} MHz")
3737
fclk = fmin
3838

39+
if hasattr(self.dut, "disable_id_filtering_i"):
40+
self.dut.disable_id_filtering_i.value = 1
41+
3942
await self.busIf.register_test_interfaces(fclk)
4043
await ClockCycles(self.clk, 20)
4144
await reset_n(self.clk, self.rst_n, cycles=5)

0 commit comments

Comments
 (0)