Skip to content

Commit

Permalink
[rom_ctrl,dv] Tweak randomisation of bad mubi4_t values
Browse files Browse the repository at this point in the history
The code in rom_ctrl_corrupt_sig_fatal_chk_vseq.sv was not quite
right: it ignored the return value of mubi4_test_invalid, and never
actually assigned anything to rand_var.

This change switches things to do what I think was originally
intended.

Signed-off-by: Rupert Swarbrick <[email protected]>
  • Loading branch information
rswarbrick committed Feb 13, 2024
1 parent 53b98dc commit a39bf7d
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,13 @@ class rom_ctrl_corrupt_sig_fatal_chk_vseq extends rom_ctrl_base_vseq;
// module. To test this rom_select_bus_o is forced with any value other than MuBi4True and
// MuBi4False.
MuxMubi: begin
bit [3:0] rand_var;
pick_err_inj_point();
mubi4_test_invalid(prim_mubi_pkg::mubi4_t'(rand_var));
force_sig("tb.dut.gen_fsm_scramble_enabled.u_checker_fsm.rom_select_bus_o", rand_var);
force_sig("tb.dut.gen_fsm_scramble_enabled.u_checker_fsm.rom_select_bus_o",
get_invalid_mubi4());
check_for_alert();
dut_init();
pick_err_inj_point();
mubi4_test_invalid(prim_mubi_pkg::mubi4_t'(rand_var));
force_sig("tb.dut.u_mux.sel_bus_q", rand_var);
force_sig("tb.dut.u_mux.sel_bus_q", get_invalid_mubi4());
check_for_alert();
end
// The mux that arbitrates between the checker and the bus gives access to the checker at
Expand Down Expand Up @@ -299,4 +297,10 @@ class rom_ctrl_corrupt_sig_fatal_chk_vseq extends rom_ctrl_base_vseq;
wait_with_bound(wait_clks);
endtask

function prim_mubi_pkg::mubi4_t get_invalid_mubi4();
logic [3:0] val;
`DV_CHECK_STD_RANDOMIZE_WITH_FATAL(val, mubi4_test_invalid(mubi4_t'(val));)
return mubi4_t'(val);
endfunction

endclass : rom_ctrl_corrupt_sig_fatal_chk_vseq

0 comments on commit a39bf7d

Please sign in to comment.