[dv/otp_ctrl] enable error code check in lc sequence
This PR enables error code check in lc_sequence.
Signed-off-by: Cindy Chen <chencindy@google.com>
diff --git a/hw/ip/otp_ctrl/dv/env/otp_ctrl_scoreboard.sv b/hw/ip/otp_ctrl/dv/env/otp_ctrl_scoreboard.sv
index 8f1b1e7..5e96e38 100644
--- a/hw/ip/otp_ctrl/dv/env/otp_ctrl_scoreboard.sv
+++ b/hw/ip/otp_ctrl/dv/env/otp_ctrl_scoreboard.sv
@@ -920,7 +920,7 @@
`uvm_error(`gfn, $sformatf("please set status error: %0s error code", status_err_idx.name))
end
ral.err_code.get_dv_base_reg_fields(err_code_flds);
- void'(err_code_flds[status_err_idx].predict(err_code));
+ void'(err_code_flds[status_err_idx].predict(.value(err_code), .kind(UVM_PREDICT_READ)));
end
endfunction
diff --git a/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_parallel_lc_req_vseq.sv b/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_parallel_lc_req_vseq.sv
index 31e7d7c..a479e0a 100644
--- a/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_parallel_lc_req_vseq.sv
+++ b/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_parallel_lc_req_vseq.sv
@@ -21,51 +21,41 @@
do_req_keys == 0;
}
- // disable err_code check because cannot accurately predict when LC error is detected
- constraint no_err_code_c {
- check_err_code == 0;
- }
-
virtual task run_parallel_seq(ref bit base_vseq_done);
- forever
- begin
- if (base_vseq_done) return;
+ forever begin
+ if (base_vseq_done) return;
- fork
- begin
- if ($urandom_range(0, 1)) begin
- wait_clk_or_reset($urandom_range(0, 500));
- if (!base_vseq_done && !cfg.under_reset) req_lc_transition();
- end
- end
- begin
- // req lc token request
- if ($urandom_range(0, 1)) begin
- wait_clk_or_reset($urandom_range(0, 500));
- if (!base_vseq_done && !cfg.under_reset) req_lc_token();
- end
- end
- begin
- // req lc token request
- if ($urandom_range(0, 1)) begin
- wait_clk_or_reset($urandom_range(0, 500));
- if (!base_vseq_done && !cfg.under_reset) begin
- // TODO: random drive any values instead of just on and off
- cfg.otp_ctrl_vif.drive_lc_escalate_en(lc_ctrl_pkg::On);
- // TODO: check with designer if we can take away this asssertoff
- $assertoff(0, "tb.dut.u_otp_arb");
- // Turn off reset because if issuing lc_escalation_en during otp program, scb cannot
- // predict if the OTP memory is programmed or not.
- do_reset_in_seq = 0;
- end
- end
- end
- join
+ fork begin
+ if ($urandom_range(0, 1)) begin
+ wait_clk_or_reset($urandom_range(0, 500));
+ if (!base_vseq_done && !cfg.under_reset) req_lc_transition();
+ end
end
+ begin
+ // req lc token request
+ if ($urandom_range(0, 1)) begin
+ wait_clk_or_reset($urandom_range(0, 500));
+ if (!base_vseq_done && !cfg.under_reset) req_lc_token();
+ end
+ end
+ begin
+ // req lc token request
+ if ($urandom_range(0, 1)) begin
+ wait_clk_or_reset($urandom_range(0, 500));
+ if (!base_vseq_done && !cfg.under_reset) begin
+ // TODO: random drive any values instead of just on and off
+ cfg.otp_ctrl_vif.drive_lc_escalate_en(lc_ctrl_pkg::On);
+ // Turn off reset because if issuing lc_escalation_en during otp program, scb cannot
+ // predict if the OTP memory is programmed or not.
+ do_reset_in_seq = 0;
+ end
+ end
+ end join
+ end
endtask
- // Use reset to clear lc interrupt error
virtual task post_start();
+ // Use reset to clear lc interrupt error
if (do_apply_reset) begin
apply_reset();
cfg.otp_ctrl_vif.drive_lc_escalate_en(lc_ctrl_pkg::Off);
diff --git a/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_smoke_vseq.sv b/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_smoke_vseq.sv
index a0ec771..9805f7e 100644
--- a/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_smoke_vseq.sv
+++ b/hw/ip/otp_ctrl/dv/env/seq_lib/otp_ctrl_smoke_vseq.sv
@@ -14,7 +14,7 @@
bit collect_used_addr = 1;
bit do_reset_in_seq = 1;
- rand bit do_req_keys, do_lc_trans, check_err_code;
+ rand bit do_req_keys, do_lc_trans;
rand bit access_locked_parts;
rand bit [TL_AW-1:0] dai_addr;
rand bit [TL_DW-1:0] wdata0, wdata1;
@@ -137,13 +137,13 @@
if ($urandom_range(0, 1)) csr_rd(.ptr(ral.direct_access_regwen), .value(tlul_val));
if ($urandom_range(0, 1)) csr_rd(.ptr(ral.status), .value(tlul_val));
- if (check_err_code) csr_rd(.ptr(ral.err_code), .value(tlul_val));
+ if (cfg.otp_ctrl_vif.lc_prog_req == 0) csr_rd(.ptr(ral.err_code), .value(tlul_val));
end
if (do_lc_trans) begin
req_lc_transition(do_lc_trans);
req_lc_token();
- if (check_err_code) csr_rd(.ptr(ral.err_code), .value(tlul_val));
+ if (cfg.otp_ctrl_vif.lc_prog_req == 0) csr_rd(.ptr(ral.err_code), .value(tlul_val));
end
// lock digests
@@ -154,7 +154,7 @@
if ($urandom_range(0, 1)) csr_rd(.ptr(ral.status), .value(tlul_val));
write_sw_rd_locks();
- if (check_err_code) csr_rd(.ptr(ral.err_code), .value(tlul_val));
+ if (cfg.otp_ctrl_vif.lc_prog_req == 0) csr_rd(.ptr(ral.err_code), .value(tlul_val));
if ($urandom_range(0, 1)) rd_digests();
dut_init();