Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rom_ctrl,dv] Use DV_CHECK around some calls to uvm_hdl_read #21336

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ class rom_ctrl_corrupt_sig_fatal_chk_vseq extends rom_ctrl_base_vseq;
// set the external 'done' signal for pwrmgr to continue boot. To test this start_checker_q
// signal from rom_ctrl_fsm is asserted randomly.
CompareCtrlFlowConsistency: begin
string start_chk_path = "tb.dut.gen_fsm_scramble_enabled.u_checker_fsm.start_checker_q";
bit rdata;
pick_err_inj_point();
do begin
uvm_hdl_read("tb.dut.gen_fsm_scramble_enabled.u_checker_fsm.start_checker_q", rdata);
`DV_CHECK(uvm_hdl_read(start_chk_path, rdata))
@(posedge cfg.clk_rst_vif.clk);
end while (rdata != 0);
force_sig("tb.dut.gen_fsm_scramble_enabled.u_checker_fsm.start_checker_q", 1'b1);
force_sig(start_chk_path, 1'b1);
check_for_alert();
chk_fsm_state();
end
Expand Down Expand Up @@ -262,22 +263,25 @@ class rom_ctrl_corrupt_sig_fatal_chk_vseq extends rom_ctrl_base_vseq;
endtask: force_sig

task chk_fsm_state();
string alert_o_path = "tb.dut.gen_fsm_scramble_enabled.u_checker_fsm.alert_o";
string state_q_path = "tb.dut.gen_fsm_scramble_enabled.u_checker_fsm.state_q";
bit rdata_alert;
bit [$bits(rom_ctrl_pkg::fsm_state_e)-1:0] rdata_state;
uvm_hdl_read("tb.dut.gen_fsm_scramble_enabled.u_checker_fsm.alert_o", rdata_alert);
`DV_CHECK(uvm_hdl_read(alert_o_path, rdata_alert))
`DV_CHECK_EQ(rdata_alert, 1)
uvm_hdl_read("tb.dut.gen_fsm_scramble_enabled.u_checker_fsm.state_q", rdata_state);
`DV_CHECK(uvm_hdl_read(state_q_path, rdata_state))
`DV_CHECK_EQ(rdata_state, rom_ctrl_pkg::Invalid)
endtask: chk_fsm_state

// Wait until FSM state has progressed to a state within the list.
// The task removes all previous states including the one that has been reached afterwards.
// Note that this assumes no loops and linear progression through the state enum entries.
task wait_for_fsm_state_inside(ref rom_ctrl_pkg::fsm_state_e states_to_visit[$]);
string state_q_path = "tb.dut.gen_fsm_scramble_enabled.u_checker_fsm.state_q";
bit [$bits(rom_ctrl_pkg::fsm_state_e)-1:0] rdata_state;
do begin
@(negedge cfg.clk_rst_vif.clk);
uvm_hdl_read("tb.dut.gen_fsm_scramble_enabled.u_checker_fsm.state_q", rdata_state);
`DV_CHECK(uvm_hdl_read(state_q_path, rdata_state))
end while (!(rdata_state inside {states_to_visit}));
`uvm_info(`gfn, $sformatf("reached FSM state %x", rdata_state), UVM_LOW)
// Remove previous states from queue, including the one that has been reached.
Expand Down
Loading