diff --git a/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_base_vseq.sv b/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_base_vseq.sv index cdb9ed2c51faa..d74614c4723d0 100644 --- a/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_base_vseq.sv +++ b/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_base_vseq.sv @@ -36,7 +36,7 @@ class otp_ctrl_base_vseq extends cip_base_vseq #( // when LC error bit is set. bit default_req_blocking = 1; bit lc_prog_blocking = 1; - + bit dai_wr_inprogress = 0; uint32_t op_done_spinwait_timeout_ns = 20_000_000; // Collect current lc_state and lc_cnt. This is used to create next lc_state and lc_cnt without @@ -146,9 +146,11 @@ class otp_ctrl_base_vseq extends cip_base_vseq #( bit [TL_DW-1:0] wdata0, bit [TL_DW-1:0] wdata1 = 0); bit [TL_DW-1:0] val; + dai_wr_inprogress = 1; if (write_unused_addr) begin if (used_dai_addrs.exists(addr[OTP_ADDR_WIDTH - 1 : 0])) begin `uvm_info(`gfn, $sformatf("addr %0h is already written!", addr), UVM_MEDIUM) + dai_wr_inprogress = 0; return; end else begin used_dai_addrs[addr] = 1; @@ -177,6 +179,7 @@ class otp_ctrl_base_vseq extends cip_base_vseq #( end wait_dai_op_done(); rd_and_clear_intrs(); + dai_wr_inprogress = 0; endtask : dai_wr // This task triggers an OTP readout sequence via the DAI interface diff --git a/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_parallel_lc_esc_vseq.sv b/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_parallel_lc_esc_vseq.sv index fab1efaa651fa..61f8234f0e7d5 100644 --- a/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_parallel_lc_esc_vseq.sv +++ b/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_parallel_lc_esc_vseq.sv @@ -71,6 +71,7 @@ class otp_ctrl_parallel_lc_esc_vseq extends otp_ctrl_dai_lock_vseq; endcase wait_no_outstanding_access(); + wait (dai_wr_inprogress == 0); endtask virtual task set_lc_esc_and_check();