Skip to content

Commit 8cb25a6

Browse files
committed
[rv_dm,dv] Connect mon_jtag_if to internal signals
This won't have much effect on the enable/disable events, but it *does* change the timing because the decision about whether to connect some of the signals goes through a prim_lc_sync or a prim_clock_mux2, which injects a few extra cycles of delay. Rather than trying to guess the exact timing, let's cheat and tell the jtag monitor to use the version that's actually making it through to the internals of the block. Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
1 parent a76b261 commit 8cb25a6

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

hw/ip/rv_dm/dv/tb.sv

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,14 @@ module tb;
6464
.jtag_o ({jtag_if.tdo, jtag_tdo_oe})
6565
);
6666

67-
// Mirror the muxing that we expect in rv_dm, where the JTAG interface that actually connects to
68-
// the debug module has direct clock/reset in scan mode, and is disabled if debug is not enabled.
69-
logic is_scanmode, dbg_enabled;
70-
assign is_scanmode = prim_mubi_pkg::mubi4_test_true_strict(rv_dm_if.scanmode);
71-
assign dbg_enabled = lc_ctrl_pkg::lc_tx_test_true_strict(rv_dm_if.pinmux_hw_debug_en);
72-
67+
// Apply the muxing that we get in rv_dm, where the JTAG interface that actually connects to the
68+
// debug module has direct clock/reset in scan mode, and is disabled if debug is not enabled.
7369
jtag_mon_if mon_jtag_if ();
74-
assign mon_jtag_if.tck = !is_scanmode ? jtag_if.tck : clk;
75-
assign mon_jtag_if.trst_n = !is_scanmode ? jtag_if.trst_n : rv_dm_if.scan_rst_n;
76-
assign mon_jtag_if.tms = dbg_enabled ? jtag_if.tms : 1'b0;
77-
assign mon_jtag_if.tdi = dbg_enabled ? jtag_if.tdi : 1'b0;
78-
assign mon_jtag_if.tdo = dbg_enabled ? jtag_if.tdo : 1'b0;
70+
assign mon_jtag_if.tck = dut.dap.tck_i;
71+
assign mon_jtag_if.trst_n = dut.dap.trst_ni;
72+
assign mon_jtag_if.tms = dut.dap.tms_i;
73+
assign mon_jtag_if.tdi = dut.dap.td_i;
74+
assign mon_jtag_if.tdo = dut.dap.td_o;
7975

8076
initial begin
8177
clk_rst_if.set_active();

0 commit comments

Comments
 (0)