[rtl] Fix Gift cipher lint errors

- Import::* may pollute global namespace
- Signal width is different
- Signal is not used
- Signal unoptimizable: Feedback to clock or circular logic
This commit is contained in:
Yuichi Sugiyama 2020-07-02 20:53:26 +09:00 committed by Pirmin Vogel
parent 719801b938
commit 505c9daec1
3 changed files with 16 additions and 3 deletions

View file

@ -162,3 +162,9 @@ lint_off -rule UNOPTFLAT -file "*/rtl/ibex_cs_registers.sv" -match "*ibex_core.c
// Temporary waivers until OpenTitan primitives are lint-clean
// https://github.com/lowRISC/opentitan/issues/2313
lint_off -file "*/lowrisc_prim_*/rtl/*.sv"
// Signal unoptimizable: Feedback to clock or circular logic:
// We use 2D packed arrays to hold data and keys for multpile cipher iterations:
// data_states[i][:] is used to generate data_states[i+1][:] but there is no cicular logic.
lint_off -rule UNOPTFLAT -file "*/rtl/gift_middle_rounds.sv" -match "*ibex_core.g_pa.pointer_authentication_i.gift_i.gift_middle_rounds_i.data_states*"
lint_off -rule UNOPTFLAT -file "*/rtl/gift_middle_rounds.sv" -match "*ibex_core.g_pa.pointer_authentication_i.gift_i.gift_middle_rounds_i.key_states*"

View file

@ -2,8 +2,6 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
import gift_pkg::*;
module gift_middle_rounds (
// Data and key coming directly from the cipher input
@ -14,12 +12,13 @@ module gift_middle_rounds (
input logic [63:0] state_data_i,
input logic [127:0] state_key_i,
input round_index_e round_base_i,
input gift_pkg::round_index_e round_base_i,
output logic [63:0] data_o,
output logic [127:0] key_o
);
import gift_pkg::*;
// Internal signals

View file

@ -17,6 +17,10 @@ module gift_round (
logic [63:0] data_after_permut;
logic [63:0] data_after_key;
// Avoid lint warning
logic [63:0] unused_data_after_permut;
logic [63:0] unused_data_after_key;
gift_update_key i_gift_update_key (
.key_i(key_i),
.key_o(key_o)
@ -59,4 +63,8 @@ module gift_round (
assign data_o = data_state;
// Avoid lint warning
assign unused_data_after_permut = data_after_permut;
assign unused_data_after_key = data_after_key;
endmodule