[aes] Fix AscentLint errors Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
diff --git a/hw/ip/aes/lint/aes.waiver b/hw/ip/aes/lint/aes.waiver index 6186704..52820b5 100644 --- a/hw/ip/aes/lint/aes.waiver +++ b/hw/ip/aes/lint/aes.waiver
@@ -68,6 +68,3 @@ waive -rules {ONE_BRANCH} -location {aes_sel_buf_chk.sv} -regexp {unique case statement has only one branch} \ -comment "check for legal combinations only, assert error signal otherwise" - -waive -rules {MIXED_SIGN} -location {aes_control_fsm.sv} -regexp {Signed operand '(prng_reseed_rate_i == PER_1 ? BlockCtrWidth'(0) : prng_reseed_rate_i == PER_64 ? BlockCtrWidth'(63) : prng_reseed_rate_i == PER_8K ? BlockCtrWidth'(8191) : BlockCtrWidth'(0))' and unsigned operand 'block_ctr_decr ? gen_block_ctr.block_ctr_q - BlockCtrWidth'(1) : gen_block_ctr.block_ctr_q' encountered in a conditional expression} \ - -comment "In line with our style guide, BlockCtrWidth'(x) results in a signed operand"
diff --git a/hw/ip/aes/rtl/aes_control_fsm.sv b/hw/ip/aes/rtl/aes_control_fsm.sv index fefae18..7758f06 100644 --- a/hw/ip/aes/rtl/aes_control_fsm.sv +++ b/hw/ip/aes/rtl/aes_control_fsm.sv
@@ -833,16 +833,19 @@ if (Masking) begin : gen_block_ctr logic block_ctr_set; logic [BlockCtrWidth-1:0] block_ctr_d, block_ctr_q; + logic [BlockCtrWidth-1:0] block_ctr_set_val, block_ctr_decr_val; assign block_ctr_expr = block_ctr_q == '0; assign block_ctr_set = ctrl_we_q | (block_ctr_decr & (block_ctr_expr | cipher_prng_reseed_i)); - assign block_ctr_d = - block_ctr_set ? - (prng_reseed_rate_i == PER_1 ? BlockCtrWidth'(0) : - prng_reseed_rate_i == PER_64 ? BlockCtrWidth'(63) : - prng_reseed_rate_i == PER_8K ? BlockCtrWidth'(8191) : BlockCtrWidth'(0)) : - block_ctr_decr ? block_ctr_q - BlockCtrWidth'(1) : block_ctr_q; + assign block_ctr_set_val = prng_reseed_rate_i == PER_1 ? '0 : + prng_reseed_rate_i == PER_64 ? BlockCtrWidth'(63) : + prng_reseed_rate_i == PER_8K ? BlockCtrWidth'(8191) : '0; + + assign block_ctr_decr_val = block_ctr_q - BlockCtrWidth'(1); + + assign block_ctr_d = block_ctr_set ? block_ctr_set_val : + block_ctr_decr ? block_ctr_decr_val : block_ctr_q; always_ff @(posedge clk_i or negedge rst_ni) begin : reg_block_ctr if (!rst_ni) begin
diff --git a/hw/ip/aes/rtl/aes_core.sv b/hw/ip/aes/rtl/aes_core.sv index bc35076..04771b3 100644 --- a/hw/ip/aes/rtl/aes_core.sv +++ b/hw/ip/aes/rtl/aes_core.sv
@@ -927,6 +927,10 @@ logic unused_alert_signals; assign unused_alert_signals = ^reg2hw.alert_test; + // Unused inputs + logic unused_idle; + assign unused_idle = reg2hw.status.idle.q; + //////////////// // Assertions // ////////////////