Skip to content

Commit 1e052a1

Browse files
committed
Fix issue found in random tests
Signed-off-by: dd-baoshan <[email protected]>
1 parent e4e265a commit 1e052a1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

cv32e40p/env/corev-dv/instr_lib/cv32e40p_instr_for_func_cvg_lib.sv

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,15 @@ class cv32e40p_xpulp_single_hwloop_stream_directed extends cv32e40p_xpulp_hwloop
207207
}
208208

209209
constraint no_imm_hwloop_setup_instr_c {
210-
use_loop_counti_inst[0] == 0;
211-
use_loop_counti_inst[1] == 0;
212-
use_loop_setupi_inst[0] == 0;
213-
use_loop_setupi_inst[1] == 0;
210+
foreach (use_loop_counti_inst[i]) {
211+
use_loop_counti_inst[i] == 0;
212+
use_loop_setupi_inst[i] == 0;
213+
}
214214
}
215215

216216
constraint num_hwloop_instr_c {
217217
solve use_loop_endi_inst before num_hwloop_instr;
218+
solve num_hwloop_instr before num_fill_instr_loop_ctrl_to_loop_start;
218219
foreach (num_hwloop_instr[i]) {
219220
// the max setting of Uimm[11:0] is 4092 however the the hwloop start label is not immediately following after cv.endi,
220221
// there is randomize numberof instr inserted between cv.endi and hwloop start label we need to keep some buffer from
@@ -224,7 +225,11 @@ class cv32e40p_xpulp_single_hwloop_stream_directed extends cv32e40p_xpulp_hwloop
224225
} else {
225226
num_hwloop_instr[i] dist { 3 := 1, 3074 := 5, 4092 := 1 };
226227
}
227-
num_fill_instr_loop_ctrl_to_loop_start[i] inside {[0:7]};
228+
if (num_hwloop_instr[i] > 4080) {
229+
num_fill_instr_loop_ctrl_to_loop_start[i] == 0;
230+
} else {
231+
num_fill_instr_loop_ctrl_to_loop_start[i] inside {[0:7]};
232+
}
228233
}
229234
num_fill_instr_in_loop1_till_loop0_setup == 0;
230235
}

0 commit comments

Comments
 (0)