[alerts] Fully connect alert async on parameters
Signed-off-by: Michael Schaffner <msf@opentitan.org>
diff --git a/hw/ip/aes/data/aes.hjson b/hw/ip/aes/data/aes.hjson
index 18db831..4dc6496 100644
--- a/hw/ip/aes/data/aes.hjson
+++ b/hw/ip/aes/data/aes.hjson
@@ -78,15 +78,6 @@
local: "false",
expose: "true"
},
- { name: "AlertAsyncOn",
- type: "logic [aes_reg_pkg::NumAlerts-1:0]",
- default: "{aes_reg_pkg::NumAlerts{1'b1}}",
- desc: '''
- One bit per alert specifying whether the corresponding sender in the AES module and the receiver in the alert handler are in the same clock domain (0) or whether there is an asynchronous boundary in between (1).
- '''
- local: "false",
- expose: "false"
- },
# Random netlist constants
{ name: "RndCnstClearingLfsrSeed",
type: "aes_pkg::clearing_lfsr_seed_t",
diff --git a/hw/top_earlgrey/data/autogen/top_earlgrey.gen.hjson b/hw/top_earlgrey/data/autogen/top_earlgrey.gen.hjson
index 572284c..27814ff 100644
--- a/hw/top_earlgrey/data/autogen/top_earlgrey.gen.hjson
+++ b/hw/top_earlgrey/data/autogen/top_earlgrey.gen.hjson
@@ -3520,14 +3520,6 @@
name_top: SecAesSkipPRNGReseeding
}
{
- name: AlertAsyncOn
- desc: One bit per alert specifying whether the corresponding sender in the AES module and the receiver in the alert handler are in the same clock domain (0) or whether there is an asynchronous boundary in between (1).
- type: logic [aes_reg_pkg::NumAlerts-1:0]
- default: "{aes_reg_pkg::NumAlerts{1'b1}}"
- expose: "false"
- name_top: AesAlertAsyncOn
- }
- {
name: RndCnstClearingLfsrSeed
desc: Default seed of the PRNG used for register clearing.
type: aes_pkg::clearing_lfsr_seed_t
diff --git a/hw/top_earlgrey/data/top_earlgrey.sv.tpl b/hw/top_earlgrey/data/top_earlgrey.sv.tpl
index 6477ee4..1cdddf8 100644
--- a/hw/top_earlgrey/data/top_earlgrey.sv.tpl
+++ b/hw/top_earlgrey/data/top_earlgrey.sv.tpl
@@ -566,8 +566,15 @@
max_intrwidth = (max(len(x.name) for x in block.interrupts)
if block.interrupts else 0)
%>\
- % if m["param_list"]:
+ % if m["param_list"] or block.alerts:
${m["type"]} #(
+ % if block.alerts:
+<%
+w = len(block.alerts)
+slice = str(alert_idx+w-1) + ":" + str(alert_idx)
+%>\
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[${slice}])${"," if m["param_list"] else ""}
+ % endif
% for i in m["param_list"]:
.${i["name"]}(${i["name_top" if i.get("expose") == "true" or i.get("randtype", "none") != "none" else "default"]})${"," if not loop.last else ""}
% endfor
@@ -598,10 +605,6 @@
.${lib.ljust("intr_"+intr.name+"_o",max_intrwidth+7)} (intr_${m["name"]}_${intr.name}),
% endfor
% if block.alerts:
-<%
-w = len(block.alerts)
-slice = str(alert_idx+w-1) + ":" + str(alert_idx)
-%>
% for alert in block.alerts:
// [${alert_idx}]: ${alert.name}<% alert_idx += 1 %>
% endfor
diff --git a/hw/top_earlgrey/ip/sensor_ctrl/rtl/sensor_ctrl.sv b/hw/top_earlgrey/ip/sensor_ctrl/rtl/sensor_ctrl.sv
index 0e071aa..d600c5d 100644
--- a/hw/top_earlgrey/ip/sensor_ctrl/rtl/sensor_ctrl.sv
+++ b/hw/top_earlgrey/ip/sensor_ctrl/rtl/sensor_ctrl.sv
@@ -7,7 +7,7 @@
`include "prim_assert.sv"
module sensor_ctrl import sensor_ctrl_pkg::*; #(
- parameter logic AsyncOn = 1'b0
+ parameter logic AlertAsyncOn = 1'b1
) (
// Primary module clocks
input clk_i,
@@ -105,7 +105,7 @@
assign alert_req = sw_ack_mode[i] ? reg2hw.alert_state[i].q : valid_alert;
prim_alert_sender #(
- .AsyncOn(AsyncOn),
+ .AsyncOn(AlertAsyncOn),
.IsFatal(0)
) u_prim_alert_sender (
.clk_i,
diff --git a/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv b/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv
index e3d1dea..9c68b2b 100644
--- a/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv
+++ b/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv
@@ -1425,6 +1425,7 @@
);
otp_ctrl #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[1:0]),
.MemInitFile(OtpCtrlMemInitFile),
.RndCnstLfsrSeed(RndCnstOtpCtrlLfsrSeed),
.RndCnstLfsrPerm(RndCnstOtpCtrlLfsrPerm)
@@ -1433,7 +1434,6 @@
// Interrupt
.intr_otp_operation_done_o (intr_otp_ctrl_otp_operation_done),
.intr_otp_error_o (intr_otp_ctrl_otp_error),
-
// [0]: fatal_macro_error
// [1]: fatal_check_error
.alert_tx_o ( alert_tx[1:0] ),
@@ -1475,11 +1475,11 @@
);
lc_ctrl #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[3:2]),
.RndCnstLcKeymgrDivInvalid(RndCnstLcCtrlLcKeymgrDivInvalid),
.RndCnstLcKeymgrDivTestDevRma(RndCnstLcCtrlLcKeymgrDivTestDevRma),
.RndCnstLcKeymgrDivProduction(RndCnstLcCtrlLcKeymgrDivProduction)
) u_lc_ctrl (
-
// [2]: fatal_prog_error
// [3]: fatal_state_error
.alert_tx_o ( alert_tx[3:2] ),
@@ -1720,7 +1720,9 @@
.rst_aon_ni (rstmgr_aon_resets.rst_sys_aon_n[rstmgr_pkg::DomainAonSel])
);
- sensor_ctrl u_sensor_ctrl_aon (
+ sensor_ctrl #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[10:4])
+ ) u_sensor_ctrl_aon (
// Input
.cio_ast_debug_in_i (cio_sensor_ctrl_aon_ast_debug_in_p2d),
@@ -1728,7 +1730,6 @@
// Output
.cio_ast_debug_out_o (cio_sensor_ctrl_aon_ast_debug_out_d2p),
.cio_ast_debug_out_en_o (cio_sensor_ctrl_aon_ast_debug_out_en_d2p),
-
// [4]: recov_as
// [5]: recov_cg
// [6]: recov_gd
@@ -1754,11 +1755,11 @@
);
sram_ctrl #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[12:11]),
.RndCnstSramKey(RndCnstSramCtrlRetAonSramKey),
.RndCnstSramNonce(RndCnstSramCtrlRetAonSramNonce),
.InstrExec(SramCtrlRetAonInstrExec)
) u_sram_ctrl_ret_aon (
-
// [11]: fatal_intg_error
// [12]: fatal_parity_error
.alert_tx_o ( alert_tx[12:11] ),
@@ -1785,6 +1786,7 @@
);
flash_ctrl #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[15:13]),
.RndCnstAddrKey(RndCnstFlashCtrlAddrKey),
.RndCnstDataKey(RndCnstFlashCtrlDataKey),
.RndCnstLfsrSeed(RndCnstFlashCtrlLfsrSeed),
@@ -1806,7 +1808,6 @@
.intr_rd_full_o (intr_flash_ctrl_rd_full),
.intr_rd_lvl_o (intr_flash_ctrl_rd_lvl),
.intr_op_done_o (intr_flash_ctrl_op_done),
-
// [13]: recov_err
// [14]: recov_mp_err
// [15]: recov_ecc_err
@@ -1856,19 +1857,18 @@
);
aes #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[17:16]),
.AES192Enable(1'b1),
.Masking(AesMasking),
.SBoxImpl(AesSBoxImpl),
.SecStartTriggerDelay(SecAesStartTriggerDelay),
.SecAllowForcingMasks(SecAesAllowForcingMasks),
.SecSkipPRNGReseeding(SecAesSkipPRNGReseeding),
- .AlertAsyncOn({aes_reg_pkg::NumAlerts{1'b1}}),
.RndCnstClearingLfsrSeed(RndCnstAesClearingLfsrSeed),
.RndCnstClearingLfsrPerm(RndCnstAesClearingLfsrPerm),
.RndCnstMaskingLfsrSeed(RndCnstAesMaskingLfsrSeed),
.RndCnstMskgChunkLfsrPerm(RndCnstAesMskgChunkLfsrPerm)
) u_aes (
-
// [16]: recov_ctrl_update_err
// [17]: fatal_fault
.alert_tx_o ( alert_tx[17:16] ),
@@ -1934,6 +1934,7 @@
);
keymgr #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[19:18]),
.RndCnstLfsrSeed(RndCnstKeymgrLfsrSeed),
.RndCnstLfsrPerm(RndCnstKeymgrLfsrPerm),
.RndCnstRandPerm(RndCnstKeymgrRandPerm),
@@ -1951,7 +1952,6 @@
// Interrupt
.intr_op_done_o (intr_keymgr_op_done),
-
// [18]: fatal_fault_err
// [19]: recov_operation_err
.alert_tx_o ( alert_tx[19:18] ),
@@ -1981,6 +1981,7 @@
);
csrng #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[20:20]),
.SBoxImpl(CsrngSBoxImpl)
) u_csrng (
@@ -1989,7 +1990,6 @@
.intr_cs_entropy_req_o (intr_csrng_cs_entropy_req),
.intr_cs_hw_inst_exc_o (intr_csrng_cs_hw_inst_exc),
.intr_cs_fatal_err_o (intr_csrng_cs_fatal_err),
-
// [20]: fatal_alert
.alert_tx_o ( alert_tx[20:20] ),
.alert_rx_i ( alert_rx[20:20] ),
@@ -2009,13 +2009,14 @@
.rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel])
);
- entropy_src u_entropy_src (
+ entropy_src #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[22:21])
+ ) u_entropy_src (
// Interrupt
.intr_es_entropy_valid_o (intr_entropy_src_es_entropy_valid),
.intr_es_health_test_failed_o (intr_entropy_src_es_health_test_failed),
.intr_es_fatal_err_o (intr_entropy_src_es_fatal_err),
-
// [21]: recov_alert
// [22]: fatal_alert
.alert_tx_o ( alert_tx[22:21] ),
@@ -2037,12 +2038,13 @@
.rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel])
);
- edn u_edn0 (
+ edn #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[23:23])
+ ) u_edn0 (
// Interrupt
.intr_edn_cmd_req_done_o (intr_edn0_edn_cmd_req_done),
.intr_edn_fatal_err_o (intr_edn0_edn_fatal_err),
-
// [23]: fatal_alert
.alert_tx_o ( alert_tx[23:23] ),
.alert_rx_i ( alert_rx[23:23] ),
@@ -2060,12 +2062,13 @@
.rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel])
);
- edn u_edn1 (
+ edn #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[24:24])
+ ) u_edn1 (
// Interrupt
.intr_edn_cmd_req_done_o (intr_edn1_edn_cmd_req_done),
.intr_edn_fatal_err_o (intr_edn1_edn_fatal_err),
-
// [24]: fatal_alert
.alert_tx_o ( alert_tx[24:24] ),
.alert_rx_i ( alert_rx[24:24] ),
@@ -2084,11 +2087,11 @@
);
sram_ctrl #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[26:25]),
.RndCnstSramKey(RndCnstSramCtrlMainSramKey),
.RndCnstSramNonce(RndCnstSramCtrlMainSramNonce),
.InstrExec(SramCtrlMainInstrExec)
) u_sram_ctrl_main (
-
// [25]: fatal_intg_error
// [26]: fatal_parity_error
.alert_tx_o ( alert_tx[26:25] ),
@@ -2115,12 +2118,12 @@
);
otbn #(
+ .AlertAsyncOn(alert_handler_reg_pkg::AsyncOn[28:27]),
.RegFile(OtbnRegFile)
) u_otbn (
// Interrupt
.intr_done_o (intr_otbn_done),
-
// [27]: fatal
// [28]: recov
.alert_tx_o ( alert_tx[28:27] ),