Skip to content

Commit

Permalink
[flash_ctrl,dv] hardening read path error injection
Browse files Browse the repository at this point in the history
Same issue as #19268 has been observed. Hardening error injection.

Signed-off-by: Jaedon Kim <[email protected]>
  • Loading branch information
jdonjdon committed Aug 18, 2023
1 parent 4ddad09 commit 10f8007
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions hw/ip/flash_ctrl/dv/env/seq_lib/flash_ctrl_rd_path_intg_vseq.sv
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class flash_ctrl_rd_path_intg_vseq extends flash_ctrl_legacy_base_vseq;
`uvm_object_new

task body();
int idx1, idx2;
string path1, path2;
int state_timeout_ns = 100000; // 100us

Expand All @@ -26,17 +25,16 @@ class flash_ctrl_rd_path_intg_vseq extends flash_ctrl_legacy_base_vseq;
// hw/ip/flash_ctrl/rtl/flash_phy_rd.sv;drc=8046c2896fa50aaf3a186a7ce8c0570db9f99eaf;l=481)
// Enable ecc for all regions
flash_otf_region_cfg(.scr_mode(OTFCfgTrue), .ecc_mode(OTFCfgTrue));
idx1 = $urandom_range(0, 63);
idx2 = $urandom_range(0, 63);
// Set path to subset of both upperword [63:32] and lowerword[31:0]
path1 = {"tb.dut.u_eflash.gen_flash_cores[0].u_core",
$sformatf(".u_rd.gen_bufs[0].u_rd_buf.data_i[%0d]", idx1)};
".u_rd.gen_bufs[0].u_rd_buf.data_i[35:28]"};
path2 = {"tb.dut.u_eflash.gen_flash_cores[1].u_core",
$sformatf(".u_rd.gen_bufs[0].u_rd_buf.data_i[%0d]", idx2)};
".u_rd.gen_bufs[0].u_rd_buf.data_i[35:28]"};

cfg.clk_rst_vif.wait_clks(10);
`uvm_info(`gfn, $sformatf("Assert read path err idx1:%0d idx2:%0d", idx1, idx2), UVM_LOW)
`DV_CHECK(uvm_hdl_force(path1, 1'b0))
`DV_CHECK(uvm_hdl_force(path2, 1'b0))

`DV_CHECK(uvm_hdl_force(path1, $urandom()))
`DV_CHECK(uvm_hdl_force(path2, $urandom()))
cfg.scb_h.expected_alert["fatal_err"].expected = 1;
cfg.scb_h.expected_alert["fatal_err"].max_delay = 2000;
cfg.scb_h.exp_alert_contd["fatal_err"] = 10000;
Expand Down

0 comments on commit 10f8007

Please sign in to comment.