[aes/rtl] Cause lint errors if Sec parameters get non-default values
We want to avoid that the features controlled by these parameters get
accidentally enabled in the final design.
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
diff --git a/hw/ip/aes/rtl/aes_control.sv b/hw/ip/aes/rtl/aes_control.sv
index da40da9..38aa64f 100644
--- a/hw/ip/aes/rtl/aes_control.sv
+++ b/hw/ip/aes/rtl/aes_control.sv
@@ -224,6 +224,11 @@
count_q <= count_d;
end
end
+
+ // Create a lint error to reduce the risk of accidentally enabling this feature.
+ logic sec_start_trigger_delay;
+ assign sec_start_trigger_delay = count_q[0];
+
end else begin : gen_no_start_delay
// Directly forward the manual start trigger input.
assign start_trigger = start_i;
diff --git a/hw/ip/aes/rtl/aes_prng_clearing.sv b/hw/ip/aes/rtl/aes_prng_clearing.sv
index 046105e..1d1fb0f 100644
--- a/hw/ip/aes/rtl/aes_prng_clearing.sv
+++ b/hw/ip/aes/rtl/aes_prng_clearing.sv
@@ -50,6 +50,11 @@
// the SecSkipPRNGReseeding parameter is set. Performing the reseeding without proper entropy
// provided from CSRNG would result in quickly repeating, fully deterministic PRNG output,
// which prevents meaningful SCA resistance evaluations.
+ if (SecSkipPRNGReseeding) begin : gen_skip_prng_reseeding
+ // Create a lint error to reduce the risk of accidentally enabling this feature.
+ logic sec_skip_prng_reseeding;
+ assign sec_skip_prng_reseeding = SecSkipPRNGReseeding;
+ end
// LFSR control
assign lfsr_en = data_req_i & data_ack_o;
diff --git a/hw/ip/aes/rtl/aes_prng_masking.sv b/hw/ip/aes/rtl/aes_prng_masking.sv
index 5554e56..79c53e8 100644
--- a/hw/ip/aes/rtl/aes_prng_masking.sv
+++ b/hw/ip/aes/rtl/aes_prng_masking.sv
@@ -77,6 +77,11 @@
// the SecSkipPRNGReseeding parameter is set. Performing the reseeding without proper entropy
// provided from CSRNG would result in quickly repeating, fully deterministic PRNG output,
// which prevents meaningful SCA resistance evaluations.
+ if (SecSkipPRNGReseeding) begin : gen_skip_prng_reseeding
+ // Create a lint error to reduce the risk of accidentally enabling this feature.
+ logic sec_skip_prng_reseeding;
+ assign sec_skip_prng_reseeding = SecSkipPRNGReseeding;
+ end
// PRNG control
assign prng_en = data_update_i;
@@ -186,7 +191,12 @@
(SecAllowForcingMasks && force_zero_masks_i) ? '0 :
phase_q ? {perm[0], perm[NumChunks-1:1]} : perm;
- if (!SecAllowForcingMasks) begin : gen_unused_force_masks
+ // Create a lint error to reduce the risk of accidentally enabling this feature.
+ if (SecAllowForcingMasks) begin : gen_allow_forcing_masks
+ logic sec_allow_forcing_masks;
+ assign sec_allow_forcing_masks = force_zero_masks_i;
+
+ end else begin : gen_unused_force_masks
logic unused_force_zero_masks;
assign unused_force_zero_masks = force_zero_masks_i;
end