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
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
1019
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
1020
1030
end
1021
-
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
1022
1036
if (has_pending_trap_due2_dbg) begin// e.g exception event intercept with debug step
1023
1037
assert (!dcsr_cause_t'(cv32e40p_rvvi_vif.csr_dcsr_cause) !=STEP); // this is not mean for step debug
1024
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
1025
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
1026
1040
end
1027
-
if (has_trap_due2_dbg_match_trig) begin// e.g exception event intercept with debug trigger
1028
-
has_trap_due2_dbg_match_trig =0;
1029
-
end
1030
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;
1031
1043
`CHECK_N_SAMPLE_CSR_HWLOOP(main);
1032
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
1033
1048
if (is_ebreak || is_ecall || is_illegal) enter_hwloop_sub =1;
0 commit comments