Skip to content

Commit 3fe7815

Browse files
committed
when get_rand_instr is called with include_category, return null if no match. Simulation should fail as it is likely due to improper configuration
1 parent f0c570d commit 3fe7815

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/isa/riscv_instr.sv

+6-2
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,12 @@ class riscv_instr extends uvm_object;
215215
idx = $urandom_range(0, allowed_instr.size()-1);
216216
name = allowed_instr[idx];
217217
end else begin
218-
idx = $urandom_range(0, instr_names.size()-1);
219-
name = instr_names[idx];
218+
if ( include_category.size() > 0 ) begin
219+
return null;
220+
end else begin
221+
idx = $urandom_range(0, instr_names.size()-1);
222+
name = instr_names[idx];
223+
end
220224
end
221225
end else begin
222226
if (!std::randomize(name) with {

0 commit comments

Comments
 (0)