[dv] Be explicit about the target priv_mode in wait_ret test

The previous code contained

    wait (dut_vif.dut_cb.priv_mode === select_mode())

and VCS warns that this wait block will only trigger on changes to
explicit arguments. That is, if the in_nested_trap field changes, so
the return value of the select_mode() method would change to match
priv_mode, the wait statement won't finish.

This patch explicitly stores a snapshot of the value of select_mode()
just before the wait line. I think this is the intended behaviour, and
will no longer trigger warnings from VCS.
This commit is contained in:
Rupert Swarbrick 2021-01-27 12:27:38 +00:00 committed by Rupert Swarbrick
parent 6ab3e4a993
commit 8d43b854ab

View file

@ -328,6 +328,7 @@ class core_ibex_debug_intr_basic_test extends core_ibex_base_test;
run.raise_objection(this); run.raise_objection(this);
fork fork
begin begin
priv_lvl_e tgt_mode;
case (ret) case (ret)
"dret": begin "dret": begin
wait (dut_vif.dut_cb.dret === 1'b1); wait (dut_vif.dut_cb.dret === 1'b1);
@ -339,7 +340,8 @@ class core_ibex_debug_intr_basic_test extends core_ibex_base_test;
`uvm_fatal(`gfn, $sformatf("Invalid xRET instruction %0s", ret)) `uvm_fatal(`gfn, $sformatf("Invalid xRET instruction %0s", ret))
end end
endcase endcase
wait (dut_vif.dut_cb.priv_mode === select_mode()); tgt_mode = select_mode();
wait (dut_vif.dut_cb.priv_mode === tgt_mode);
end end
begin : ret_timeout begin : ret_timeout
clk_vif.wait_clks(timeout); clk_vif.wait_clks(timeout);