Skip to content

Commit

Permalink
when get_rand_instr is called with include_category, return null if n…
Browse files Browse the repository at this point in the history
…o match. Simulation should fail as it is likely due to improper configuration
  • Loading branch information
Bounti committed Dec 16, 2024
1 parent f0c570d commit 3fe7815
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/isa/riscv_instr.sv
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,12 @@ class riscv_instr extends uvm_object;
idx = $urandom_range(0, allowed_instr.size()-1);
name = allowed_instr[idx];
end else begin
idx = $urandom_range(0, instr_names.size()-1);
name = instr_names[idx];
if ( include_category.size() > 0 ) begin
return null;
end else begin
idx = $urandom_range(0, instr_names.size()-1);
name = instr_names[idx];
end
end
end else begin
if (!std::randomize(name) with {
Expand Down

0 comments on commit 3fe7815

Please sign in to comment.