You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add init machine mode handling for irq enablement; Corrected lp track count when debug entry during lpend; Add handle when debug trigger pc same as exception pc; handle case when irq driver deassert valid irq before receiving irq ack from dut
wait (!cv32e40p_rvvi_vif.trap); // bypass and do nothing
825
833
has_trap_due2_dbg_match_trig =1;
834
+
wait (!cv32e40p_rvvi_vif.trap); // bypass and do nothing
826
835
end
827
836
elseif ((cv32e40p_rvvi_vif.csr_dcsr_step ||!pending_irq_ack) &&!is_dbg_mode &&!is_irq) begin// set excep flag only if no pending irq is serving, not in irq and not in dbg mode
828
837
is_trap =1;
@@ -850,7 +859,7 @@ class uvme_rv32x_hwloop_covg # (
850
859
end
851
860
foreverbegin:SET_PENDING_IRQ_ACK
852
861
@(cv32e40p_rvvi_vif.valid_irq);
853
-
if (cv32e40p_rvvi_vif.valid_irq < valid_irq_prev) begin
862
+
if (cv32e40p_rvvi_vif.valid_irq < valid_irq_prev&&!irq_period) begin// currently not cover on nested irq
854
863
pending_irq_ack =1;
855
864
end
856
865
valid_irq_prev = cv32e40p_rvvi_vif.valid_irq;
@@ -888,20 +897,24 @@ class uvme_rv32x_hwloop_covg # (
888
897
is_irq =0;
889
898
end
890
899
end// IRQ_EXIT
891
-
foreverbegin:SIGNALS_CHG_WHEN_IS_IRQ_ASSERT
892
-
@(posedge is_irq);
893
-
if (is_ebreakm) begin// TBD: will ebreakm assert trap?
894
-
for (int j=0; j<HWLOOP_NB; j++) begin
895
-
logic [31:0] discarded_insn;
896
-
if (hwloop_stat_main.execute_instr_in_hwloop[j] && lpend_has_pending_irq_main[j]) begin
if (pc_is_mtvec_addr() || (cv32e40p_rvvi_vif.trap && is_trap)) begin is_trap =1; enter_hwloop_sub =1; has_pending_trap_due2_irq =0; continue; end// if pc is exception related
1020
1029
elsebegin is_ebreak =0; is_ecall =0; is_illegal =0; is_trap =0; enter_hwloop_sub =0; has_pending_trap_due2_irq =0; continue; end// if pc is non-exception related
1021
1030
end
1022
-
if (is_dbg_mode) beginwait (!is_dbg_mode); continue; end
1031
+
if (is_dbg_mode) begin
1032
+
if (prev_is_lpend_main[0] && prev_is_trap &&!is_ebreakm) hwloop_stat_main.track_lp_cnt[0]++;
1033
+
if (prev_is_lpend_main[1] && prev_is_trap &&!is_ebreakm) hwloop_stat_main.track_lp_cnt[1]++;
1034
+
wait (!is_dbg_mode); continue;
1035
+
end
1023
1036
if (has_pending_trap_due2_dbg) begin// e.g exception event intercept with debug step
1024
1037
assert (!dcsr_cause_t'(cv32e40p_rvvi_vif.csr_dcsr_cause) !=STEP); // this is not mean for step debug
1025
1038
if (pc_is_mtvec_addr() || (cv32e40p_rvvi_vif.trap && is_trap)) begin is_trap =1; enter_hwloop_sub =1; has_pending_trap_due2_dbg =0; continue; end// if pc is exception related
1026
1039
elsebegin is_ebreak =0; is_ecall =0; is_illegal =0; is_trap =0; enter_hwloop_sub =0; has_pending_trap_due2_dbg =0; continue; end// if pc is non-exception related
1027
1040
end
1028
-
if (has_trap_due2_dbg_match_trig) begin// e.g exception event intercept with debug trigger
1029
-
has_trap_due2_dbg_match_trig =0;
1030
-
end
1031
1041
if (cv32e40p_rvvi_vif.csr_dcsr_ebreakm && cv32e40p_rvvi_vif.insn ==TB_INSTR_EBREAK) is_ebreakm =1; else is_ebreakm =0;
1042
+
if (cv32e40p_rvvi_vif.trap) prev_is_trap =1; else prev_is_trap =0;
1032
1043
`CHECK_N_SAMPLE_CSR_HWLOOP(main);
1033
1044
`CHECK_N_SAMPLE_HWLOOP(main);
1045
+
if (has_trap_due2_dbg_match_trig) begin// e.g exception event intercept with debug trigger
1046
+
has_trap_due2_dbg_match_trig =0;
1047
+
end
1034
1048
if (is_ebreak || is_ecall || is_illegal) enter_hwloop_sub =1;
0 commit comments