Skip to content

Commit a15583b

Browse files
anujickslominski-ant
authored andcommitted
[DV] add initial path resolving for VCS hierarchies
Signed-off-by: Angelo Nujic <anujic@antmicro.com>
1 parent fb66759 commit a15583b

10 files changed

Lines changed: 87 additions & 60 deletions

File tree

‎verification/cocotb/top/lib_i3c_top/common.py‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,40 @@ def log_seed(dut):
3232
seed = cocotb.plusargs.get("seed", None)
3333
dut._log.info(f"Random seed: {seed or 'unknown (set via RANDOM_SEED plusarg)'}")
3434

35+
def resolve_path(parent, path_string):
36+
"""
37+
Dynamically walks a hierarchical path string, automatically healing
38+
VCS squashed generate-block scopes.
39+
40+
Usage:
41+
sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller")
42+
"""
43+
parts = path_string.split('.')
44+
current = parent
45+
46+
i = 0
47+
while i < len(parts):
48+
part = parts[i]
49+
try:
50+
# 1. Try standard IEEE traversal (Verilator / Normal hierarchy)
51+
current = getattr(current, part)
52+
i += 1
53+
except AttributeError:
54+
# 2. VCS Flattening Detected!
55+
# If getattr fails, VCS likely squashed this scope with the next one.
56+
if i + 1 < len(parts):
57+
next_part = parts[i + 1]
58+
# Try to fetch the combined "squashed" name using cocotb's native _id()
59+
current = current._id(f"{part}.{next_part}", extended=False)
60+
i += 2 # We successfully consumed two parts of the path, skip ahead!
61+
else:
62+
# We hit a genuine missing signal at the end of the path
63+
raise AttributeError(
64+
f"VCS/VPI Error: Cannot resolve '{part}' inside '{current._name}'"
65+
)
66+
67+
return current
68+
3569

3670
# =============================================================================
3771
# CCC helpers

‎verification/cocotb/top/lib_i3c_top/te_error_monitor.py‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import cocotb
1616
from cocotb.triggers import RisingEdge, FallingEdge, ClockCycles, First
17+
from common import resolve_path
1718

1819

1920
# FSM state constants (from i3c_target_fsm.sv primary_state_e)
@@ -48,7 +49,7 @@ def __init__(self, dut):
4849
self._expected_types = set() # Error types the test expects to see
4950
self._unexpected_errors = [] # Accumulated unexpected errors for check()
5051

51-
i3c = getattr(dut, "xi3c_wrapper").gen_target_config.i3c
52+
i3c = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c")
5253
self._te_signals = [
5354
i3c.te0_err,
5455
i3c.te1_err,
@@ -59,9 +60,7 @@ def __init__(self, dut):
5960
i3c.framing_err,
6061
]
6162

62-
fsm = (getattr(dut, "xi3c_wrapper").gen_target_config.i3c
63-
.xcontroller.gen_target_controller_standby.xcontroller_standby
64-
.xcontroller_standby_i3c.xi3c_target_fsm)
63+
fsm = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.xi3c_target_fsm")
6564
self._state_d = fsm.state_d
6665

6766
# Resolve clock
@@ -151,12 +150,11 @@ def __init__(self, dut):
151150
self.entry_count = 0
152151
self.recovery_count = 0
153152

154-
ccc = (getattr(dut, "xi3c_wrapper").gen_target_config.i3c
155-
.xcontroller.gen_target_controller_standby.xcontroller_standby
156-
.xcontroller_standby_i3c.xccc)
153+
ccc = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.xccc")
154+
157155
self._in_hdr_err_mode = ccc.in_hdr_err_mode_o
158156

159-
tti = getattr(dut, "xi3c_wrapper").gen_target_config.i3c.gen_target_tti.xtti
157+
tti = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.gen_target_tti.xtti")
160158
self._rx_data_write = tti.rx_data_queue_write_r
161159
self._rx_desc_write = tti.rx_desc_queue_write_r
162160

@@ -247,12 +245,12 @@ def __init__(self, dut):
247245
self.violation_count = 0
248246
self._violations = []
249247

250-
i3c = getattr(dut, "xi3c_wrapper").gen_target_config.i3c
248+
i3c = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c")
251249
self._te2_err = i3c.te2_err
252-
self._rx_data_write = i3c.gen_target_tti.xtti.rx_data_queue_write_r
250+
rx_data_write = resolve_path(i3c, "gen_target_tti.xtti.rx_data_queue_write_r")
251+
self._rx_data_write = rx_data_write
253252

254-
fsm = (i3c.xcontroller.gen_target_controller_standby.xcontroller_standby
255-
.xcontroller_standby_i3c.xi3c_target_fsm)
253+
fsm = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.xi3c_target_fsm")
256254
self._state_d = fsm.state_d
257255

258256
if hasattr(dut, 'aclk'):

‎verification/cocotb/top/lib_i3c_top/test_bus_timers.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import cocotb
2121
from cocotb.triggers import ClockCycles, FallingEdge, ReadOnly, RisingEdge, Timer
2222

23-
from common import VALID_I3C_ADDRESSES, log_seed
23+
from common import VALID_I3C_ADDRESSES, log_seed, resolve_path
2424

2525
# =============================================================================
2626
# Constants
@@ -336,7 +336,7 @@ async def test_bus_edge_detectors(dut):
336336

337337
i3c_controller, tb = await test_setup(dut)
338338

339-
SIG_STATE = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xbus_monitor
339+
SIG_STATE = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xbus_monitor")
340340
await i3c_controller.take_bus_control()
341341

342342
async def check_edge_occurred(edge, timing):

‎verification/cocotb/top/lib_i3c_top/test_ccc.py‎

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
from common import (
2121
VALID_I3C_ADDRESSES, log_seed, build_ccc_stress_table,
22-
do_getbcr, do_enec_direct,
22+
do_getbcr, do_enec_direct, resolve_path
2323
)
2424

2525
TGT_ADR = 0x5A
@@ -925,7 +925,7 @@ async def test_ccc_setmwl_direct(dut):
925925
ccc=command_set, directed_data=[(tgt_addr, [mwl_msb, mwl_lsb])])
926926

927927
# Check CSR value
928-
sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value
928+
sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value")
929929
assert mwl_val == int(sig), \
930930
f"SETMWL CSR mismatch: expected 0x{mwl_val:04X}, got 0x{int(sig):04X}"
931931

@@ -974,7 +974,7 @@ async def test_ccc_setmrl_direct(dut):
974974
ccc=command_set, directed_data=[(tgt_addr, [mrl_msb, mrl_lsb, ibil])])
975975

976976
# Check CSR value
977-
sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xconfiguration.get_mrl_o.value
977+
sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xconfiguration.get_mrl_o.value")
978978
assert mrl_val == int(sig), \
979979
f"SETMRL CSR mismatch: expected 0x{mrl_val:04X}, got 0x{int(sig):04X}"
980980

@@ -1029,7 +1029,7 @@ async def test_ccc_setmwl_bcast(dut):
10291029
await i3c_controller.i3c_ccc_write(ccc=command, broadcast_data=[mwl_msb, mwl_lsb])
10301030

10311031
# Check if MWL got written
1032-
sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value
1032+
sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value")
10331033
mwl = (mwl_msb << 8) | mwl_lsb
10341034
assert mwl == int(sig), f"SETMWL register mismatch: CCC sent={mwl} RTL={int(sig)}"
10351035

@@ -1061,7 +1061,7 @@ async def test_ccc_setmrl_bcast(dut):
10611061
await i3c_controller.i3c_ccc_write(ccc=command, broadcast_data=[mrl_msb, mrl_lsb, ibil])
10621062

10631063
# Check if MRL got written
1064-
sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xconfiguration.get_mrl_o.value
1064+
sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xconfiguration.get_mrl_o.value")
10651065
mrl = (mrl_msb << 8) | mrl_lsb
10661066
assert mrl == int(sig), f"SETMRL register mismatch: CCC sent={mrl} RTL={int(sig)}"
10671067

@@ -1124,7 +1124,7 @@ async def test_ccc_rstact(dut, type, rstact):
11241124
)
11251125

11261126
# Check if reset action got stored correctly in the logic after RSTACT CCC
1127-
sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.rst_action_o
1127+
sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.rst_action_o")
11281128
assert rst_action == int(sig), f"Expected rst_action_o={rst_action}, got {int(sig)}"
11291129

11301130
# Check if RST_ACTION field in STBY_CR_CCC_CONFIG_RSTACT_PARAMS CSR was updated
@@ -1325,7 +1325,7 @@ async def test_ccc_direct_multiple_wr(dut):
13251325
result = False
13261326

13271327
# Check if MWL got written
1328-
sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value
1328+
sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value")
13291329
mwl = 0xA2
13301330
if mwl != int(sig):
13311331
dut._log.error(f"Written MWL mismatch ({mwl} vs. {int(sig)})")
@@ -1488,7 +1488,7 @@ async def test_ccc_rstact_read_action(dut):
14881488
dynamic_addr=DYNAMIC_ADDR, virtual_dynamic_addr=VIRT_DYNAMIC_ADDR)
14891489
await ClockCycles(tb.clk, 50)
14901490

1491-
rst_action_sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.rst_action_o
1491+
rst_action_sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.rst_action_o")
14921492

14931493
for tgt_addr in [DYNAMIC_ADDR, VIRT_DYNAMIC_ADDR]:
14941494
# Arm peripheral reset (DB=0x01), check internal signal
@@ -1619,7 +1619,7 @@ async def test_ccc_rstact_arm_clear_on_start(dut):
16191619
await i3c_controller.i3c_ccc_write(
16201620
ccc=CCC.BCAST.RSTACT, defining_byte=0x02, stop=True)
16211621

1622-
rst_action_sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.rst_action_o
1622+
rst_action_sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.rst_action_o")
16231623

16241624
# Issue a private read (START + addr/R + data + STOP) — START clears arm
16251625
responses = await i3c_controller.i3c_ccc_read(
@@ -1772,8 +1772,8 @@ async def test_ccc_chain_bcast(dut):
17721772
broadcast_data=[(mrl_val >> 8) & 0xFF, mrl_val & 0xFF, ibil_val])
17731773

17741774
# Verify both took effect
1775-
sig_mwl = int(dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value)
1776-
sig_mrl = int(dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xconfiguration.get_mrl_o.value)
1775+
sig_mwl = int(resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value"))
1776+
sig_mrl = int(resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xconfiguration.get_mrl_o.value"))
17771777
assert sig_mwl == mwl_val, f"Chained SETMWL: expected 0x{mwl_val:04X}, got 0x{sig_mwl:04X}"
17781778
assert sig_mrl == mrl_val, f"Chained SETMRL: expected 0x{mrl_val:04X}, got 0x{sig_mrl:04X}"
17791779

@@ -1802,7 +1802,7 @@ async def test_ccc_chain_direct(dut):
18021802
(VIRT_DYNAMIC_ADDR, [(mwl_val >> 8) & 0xFF, mwl_val & 0xFF]),
18031803
])
18041804

1805-
sig_mwl = int(dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value)
1805+
sig_mwl = int(resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value"))
18061806
assert sig_mwl == mwl_val, f"Chained direct SETMWL: expected 0x{mwl_val:04X}, got 0x{sig_mwl:04X}"
18071807

18081808
await tb.teardown()
@@ -2108,7 +2108,7 @@ async def test_ccc_abort_bcast_stop(dut):
21082108
ccc=CCC.DIRECT.SETMWL,
21092109
directed_data=[(DYNAMIC_ADDR, [(mwl_val >> 8) & 0xFF, mwl_val & 0xFF])])
21102110

2111-
sig_mwl = int(dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value)
2111+
sig_mwl = int(resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o.value"))
21122112
assert sig_mwl == mwl_val, \
21132113
f"Recovery SETMWL: expected 0x{mwl_val:04X}, got 0x{sig_mwl:04X}"
21142114

@@ -2806,7 +2806,7 @@ async def test_ccc_entdaa_arb_lost(dut):
28062806
await ClockCycles(tb.clk, 50)
28072807

28082808
# Get handle to the arbitration_lost_i signal inside ccc_entdaa
2809-
entdaa_path = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.xccc.xccc_entdaa
2809+
entdaa_path = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.xccc.xccc_entdaa")
28102810
arb_lost_sig = entdaa_path.arbitration_lost_i
28112811
state_sig = entdaa_path.state_q
28122812

@@ -2906,7 +2906,7 @@ async def test_ccc_getstatus_sr_abort_clears_protocol_err(dut):
29062906
dynamic_addr=DYNAMIC_ADDR, virtual_dynamic_addr=VIRT_DYNAMIC_ADDR)
29072907
await ClockCycles(tb.clk, 50)
29082908

2909-
err_o_sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.err_o
2909+
err_o_sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.err_o")
29102910

29112911
# Step 1: Trigger a Protocol Error via TE2 (bad T-bit on CCC defining byte)
29122912
log.info("Step 1: Triggering TE2 error to set Protocol Error")
@@ -2985,10 +2985,9 @@ async def test_ccc_getstatus_sr_abort_done_assert(dut):
29852985
dut, STATIC_ADDR, VIRT_STATIC_ADDR,
29862986
dynamic_addr=DYNAMIC_ADDR, virtual_dynamic_addr=VIRT_DYNAMIC_ADDR)
29872987

2988-
err_o_sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.err_o
2988+
err_o_sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.err_o")
29892989
get_status_done_sig = (
2990-
dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby
2991-
.xcontroller_standby_i3c.xccc.get_status_done_o
2990+
resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.xcontroller_standby_i3c.xccc.get_status_done_o")
29922991
)
29932992

29942993
# Step 1: Trigger a Protocol Error via TE2 to set err_o
@@ -3081,7 +3080,7 @@ async def test_ccc_setmwl_sr_abort_during_data(dut):
30813080
dynamic_addr=DYNAMIC_ADDR, virtual_dynamic_addr=VIRT_DYNAMIC_ADDR)
30823081
await ClockCycles(tb.clk, 50)
30833082

3084-
mwl_sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o
3083+
mwl_sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o")
30853084

30863085
# Step 1: Set MWL to a known value via normal SETMWL
30873086
known_mwl = 0x0100
@@ -3185,8 +3184,8 @@ async def test_ccc_getstatus_abort_then_chain_setmwl(dut):
31853184
dynamic_addr=DYNAMIC_ADDR, virtual_dynamic_addr=VIRT_DYNAMIC_ADDR)
31863185
await ClockCycles(tb.clk, 50)
31873186

3188-
err_o_sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.err_o
3189-
mwl_sig = dut.xi3c_wrapper.gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o
3187+
err_o_sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.gen_target_controller_standby.xcontroller_standby.err_o")
3188+
mwl_sig = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.xcontroller.xconfiguration.get_mwl_o")
31903189

31913190
# Step 1: Trigger a Protocol Error via TE2
31923191
log.info("Step 1: Triggering TE2 error to set Protocol Error")

‎verification/cocotb/top/lib_i3c_top/test_empty_queue_read.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import cocotb
2424
from cocotb.result import SimTimeoutError
2525
from cocotb.triggers import ClockCycles, Combine, RisingEdge, Timer
26-
from common import timeout_task, log_seed
26+
from common import timeout_task, log_seed, resolve_path
2727

2828
STATIC_ADDR = 0x5A
2929
VIRT_STATIC_ADDR = 0x5B
@@ -335,7 +335,7 @@ async def i3c_recovery_read():
335335

336336
async def axi_read_rx_desc():
337337
# Wait for recovery_pending to actually assert (I3C address phase must complete first)
338-
recovery_pending = dut.xi3c_wrapper.gen_target_config.i3c.gen_target_recovery_handler.xrecovery_handler.recovery_pending
338+
recovery_pending = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.gen_target_recovery_handler.xrecovery_handler.recovery_pending")
339339
dut._log.info("[AXI] Waiting for recovery_pending to assert...")
340340
await RisingEdge(recovery_pending)
341341
dut._log.info("[AXI] recovery_pending is HIGH -- issuing AXI read")
@@ -374,7 +374,7 @@ async def i3c_recovery_read():
374374
dut._log.info(f"[I3C] PROT_CAP read done, pec_ok={pec_ok}")
375375

376376
async def axi_write_tx_desc():
377-
recovery_pending = dut.xi3c_wrapper.gen_target_config.i3c.gen_target_recovery_handler.xrecovery_handler.recovery_pending
377+
recovery_pending = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.gen_target_recovery_handler.xrecovery_handler.recovery_pending")
378378
dut._log.info("[AXI] Waiting for recovery_pending to assert...")
379379
await RisingEdge(recovery_pending)
380380
dut._log.info("[AXI] recovery_pending is HIGH -- issuing AXI write")
@@ -414,7 +414,7 @@ async def i3c_recovery_read():
414414
dut._log.info(f"[I3C] PROT_CAP read done, pec_ok={pec_ok}")
415415

416416
async def axi_queue_access():
417-
recovery_pending = dut.xi3c_wrapper.gen_target_config.i3c.gen_target_recovery_handler.xrecovery_handler.recovery_pending
417+
recovery_pending = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.gen_target_recovery_handler.xrecovery_handler.recovery_pending")
418418
dut._log.info("[AXI] Waiting for recovery_pending to assert...")
419419
await RisingEdge(recovery_pending)
420420
dut._log.info("[AXI] recovery_pending is HIGH -- issuing AXI accesses")
@@ -474,8 +474,8 @@ async def test_recovery_write_rx_data_observation(dut):
474474
async def rx_data_monitor():
475475
"""Watch tti_rx_depth; on >=1 DWORD, read RX_DATA_PORT via AXI."""
476476
nonlocal monitor_done
477-
rx_depth = dut.xi3c_wrapper.gen_target_config.i3c.tti_rx_depth
478-
rx_empty = dut.xi3c_wrapper.gen_target_config.i3c.tti_rx_empty
477+
rx_depth = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.tti_rx_depth")
478+
rx_empty = resolve_path(dut.xi3c_wrapper, "gen_target_config.i3c.tti_rx_empty")
479479

480480
dut._log.info("[MONITOR] Starting RX data queue monitor")
481481
dut._log.info(f"[MONITOR] Initial tti_rx_depth={int(rx_depth)}, tti_rx_empty={int(rx_empty)}")

‎verification/cocotb/top/lib_i3c_top/test_i3c_target.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import cocotb
1515
from cocotb.triggers import ClockCycles, FallingEdge, RisingEdge, Timer
1616
from cocotbext_i3c.common import I3cState
17-
from common import VALID_I3C_ADDRESSES, timeout_task, log_seed
17+
from common import VALID_I3C_ADDRESSES, timeout_task, log_seed, resolve_path
1818

1919
TARGET_ADDRESS = 0x5A
2020

@@ -107,7 +107,7 @@ async def rx_agent(tb, data_transfers):
107107
for i, tx_length in enumerate(data_transfers):
108108

109109
# Wait for the interrupt signal to go high
110-
irq = tb.dut.xi3c_wrapper.gen_target_config.i3c.irq_o
110+
irq = resolve_path(tb.dut.xi3c_wrapper, "gen_target_config.i3c.irq_o")
111111
if irq.value == 0:
112112
await RisingEdge(irq)
113113

@@ -129,7 +129,7 @@ async def rx_agent(tb, data_transfers):
129129
assert err_stat == 0, "Unexpected error detected"
130130

131131
# Wait for the interrupt signal to go low
132-
irq = tb.dut.xi3c_wrapper.gen_target_config.i3c.irq_o
132+
irq = resolve_path(tb.dut.xi3c_wrapper, "gen_target_config.i3c.irq_o")
133133
if irq.value != 0:
134134
await FallingEdge(irq)
135135

0 commit comments

Comments
 (0)