[otbn,rtl] Use err_bits, not err_bits_q for alerts[AlertFatal]
This fixes a bug introduced by 75885e6 where we'd only generate fatal
alerts when an operation finished. One problem with this is that
secure wipe takes ~100 cycles, so delays the alert. Another (more
serious) problem is that it means alerts are squashed altogether when
OTBN isn't running.
Note that the timing of alerts[AlertFatal] now matches that of the
FATAL_ALERT_CAUSE register, which should make a bit more sense.
Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/hw/ip/otbn/rtl/otbn.sv b/hw/ip/otbn/rtl/otbn.sv
index 15f6ec6..bde0510 100644
--- a/hw/ip/otbn/rtl/otbn.sv
+++ b/hw/ip/otbn/rtl/otbn.sv
@@ -824,14 +824,14 @@
assign alert_test[AlertRecov] = reg2hw.alert_test.recov.q & reg2hw.alert_test.recov.qe;
logic [NumAlerts-1:0] alerts;
- assign alerts[AlertFatal] = |{err_bits_q.fatal_software,
- err_bits_q.lifecycle_escalation,
- err_bits_q.illegal_bus_access,
- err_bits_q.bad_internal_state,
- err_bits_q.bus_intg_violation,
- err_bits_q.reg_intg_violation,
- err_bits_q.dmem_intg_violation,
- err_bits_q.imem_intg_violation};
+ assign alerts[AlertFatal] = |{err_bits.fatal_software,
+ err_bits.lifecycle_escalation,
+ err_bits.illegal_bus_access,
+ err_bits.bad_internal_state,
+ err_bits.bus_intg_violation,
+ err_bits.reg_intg_violation,
+ err_bits.dmem_intg_violation,
+ err_bits.imem_intg_violation};
assign alerts[AlertRecov] = (core_recoverable_err | recoverable_err_q) & done_core;