Skip to content

Commit ea50978

Browse files
committed
[dv] Adapt the riscv_rf_intg_test test
Fix the port name and wait LockstepOffset cycles before reading the alert. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
1 parent 2ae1ca3 commit ea50978

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dv/uvm/core_ibex/tests/core_ibex_test_lib.sv

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,15 @@ class core_ibex_rf_intg_test extends core_ibex_base_test;
132132
int rnd_delay;
133133
bit port_idx;
134134
string port_name;
135+
int unsigned lockstep_delay;
135136

136137
vseq.start(env.vseqr);
137138

138139
// Pick port to corrupt.
139140
port_idx = $urandom_range(1);
140-
port_name = port_idx ? "rf_rdata_b_ecc" : "rf_rdata_a_ecc";
141+
port_name = port_idx ? "rf_rdata_b" : "rf_rdata_a";
142+
143+
lockstep_delay = read_data("gen_lockstep.u_ibex_lockstep.LockstepOffset");
141144

142145
`DV_CHECK_STD_RANDOMIZE_WITH_FATAL(rnd_delay, rnd_delay > 1000; rnd_delay < 10_000;)
143146
clk_vif.wait_n_clks(rnd_delay);
@@ -182,8 +185,8 @@ class core_ibex_rf_intg_test extends core_ibex_base_test;
182185
// Determine whether an alert is expected: if the instruction is valid.
183186
exp_alert = read_data("u_ibex_core.instr_valid_id");
184187

185-
// Schedule a simulation step so the DUT can react.
186-
#1step;
188+
// Wait LockstepOffset cycles before reading the error.
189+
clk_vif.wait_n_clks(lockstep_delay);
187190

188191
// Check if the major alert matches our expectation.
189192
alert_major_internal = read_data("alert_major_internal_o");

0 commit comments

Comments
 (0)