From b003fc057fe20b7dcea1290d538ca903fd17598b Mon Sep 17 00:00:00 2001 From: FallenSigh Date: Wed, 8 Jul 2026 03:36:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(mlkem):=20verilator=20lint=20fixes=20?= =?UTF-8?q?=E2=80=94=20BLKLOOPINIT=20and=20UNUSEDSIGNAL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ntt_core.v / poly_mul_sync.v: <= → = in array for loops mlkem_top.v / sha3_top.v: UNUSEDSIGNAL → UNUSED Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- rtl/ip/mlkem/ntt/ntt_core.v | 2 +- rtl/ip/mlkem/poly_mul/poly_mul_sync.v | 4 ++-- rtl/ip/mlkem/sha3/sha3_top.v | 4 ++-- rtl/ip/mlkem/top/mlkem_top.v | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rtl/ip/mlkem/ntt/ntt_core.v b/rtl/ip/mlkem/ntt/ntt_core.v index a326990..676583a 100644 --- a/rtl/ip/mlkem/ntt/ntt_core.v +++ b/rtl/ip/mlkem/ntt/ntt_core.v @@ -147,7 +147,7 @@ module ntt_core ( valid_o_r <= 1'b0; scale_valid_i <= 1'b0; scale_a_i <= 12'd0; - for (ci = 0; ci < N; ci = ci + 1) cr[ci] <= 12'd0; + for (ci = 0; ci < N; ci = ci + 1) cr[ci] = 12'd0; end else begin state <= next_state; scale_valid_i <= 1'b0; diff --git a/rtl/ip/mlkem/poly_mul/poly_mul_sync.v b/rtl/ip/mlkem/poly_mul/poly_mul_sync.v index 29a28d4..61f8f99 100644 --- a/rtl/ip/mlkem/poly_mul/poly_mul_sync.v +++ b/rtl/ip/mlkem/poly_mul/poly_mul_sync.v @@ -136,8 +136,8 @@ module poly_mul_sync ( c0_reg <= 12'd0; c1_reg <= 12'd0; for (i = 0; i < 256; i = i + 1) begin - mem_A[i] <= 12'd0; - mem_B[i] <= 12'd0; + mem_A[i] = 12'd0; + mem_B[i] = 12'd0; end end else begin state <= next_state; diff --git a/rtl/ip/mlkem/sha3/sha3_top.v b/rtl/ip/mlkem/sha3/sha3_top.v index 8d22b47..e9218ea 100644 --- a/rtl/ip/mlkem/sha3/sha3_top.v +++ b/rtl/ip/mlkem/sha3/sha3_top.v @@ -104,10 +104,10 @@ module sha3_top ( // Keccak core // ================================================================ wire kc_valid_i; - /* verilator lint_off UNUSEDSIGNAL */ + /* verilator lint_off UNUSED */ wire [1599:0] kc_state_o; wire kc_ready_o; - /* verilator lint_on UNUSEDSIGNAL */ + /* verilator lint_on UNUSED */ wire kc_valid_o; // XOR the incoming block into the low 1088 bits (rate) of the state. diff --git a/rtl/ip/mlkem/top/mlkem_top.v b/rtl/ip/mlkem/top/mlkem_top.v index 356940c..293188d 100644 --- a/rtl/ip/mlkem/top/mlkem_top.v +++ b/rtl/ip/mlkem/top/mlkem_top.v @@ -563,9 +563,9 @@ module mlkem_top #( // per-consumer drives toward the core wire [1599:0] sha3_kc_state_i, snt_kc_state_i, cbd_kc_state_i; wire sha3_kc_valid_i, snt_kc_valid_i, cbd_kc_valid_i; - /* verilator lint_off UNUSEDSIGNAL */ + /* verilator lint_off UNUSED */ wire sha3_kc_ready_i, snt_kc_ready_i, cbd_kc_ready_i; // all 1'b1 - /* verilator lint_on UNUSEDSIGNAL */ + /* verilator lint_on UNUSED */ // phase selects (mutually exclusive). Encaps adds ST_ENC_H/G (sha3), // ST_ENC_A (snt), ST_ENC_C (cbd).