[prim] Fix lint warnings, replace inline AscentLint waivers
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
diff --git a/hw/ip/edn/lint/edn.waiver b/hw/ip/edn/lint/edn.waiver
index 4525057..5fbf6e0 100644
--- a/hw/ip/edn/lint/edn.waiver
+++ b/hw/ip/edn/lint/edn.waiver
@@ -3,7 +3,3 @@
# SPDX-License-Identifier: Apache-2.0
#
# waiver file for edn
-
-waive -rules INPUT_NOT_READ -location {prim_arbiter_ppc.sv} \
- -regexp {Input port 'data_i' is not read from, instance*} \
- -comment "Because the parameter EnDataPort is not set, the data input is not used"
diff --git a/hw/ip/prim/lint/prim.vlt b/hw/ip/prim/lint/prim.vlt
index d3093a0..bff544e 100644
--- a/hw/ip/prim/lint/prim.vlt
+++ b/hw/ip/prim/lint/prim.vlt
@@ -4,6 +4,10 @@
`verilator_config
+// prim_arbiter_ppc
+// ppc_out[i] depends on ppc_out[i-1]
+lint_off -rule ALWCOMBORDER -file "*/rtl/prim_arbiter_ppc.sv" -match "*ppc_out*"
+
// prim_lfsr
// lfsr_perm_test is just used for an SVA
lint_off -rule UNUSED -file "*/rtl/prim_lfsr.sv" -match "*lfsr_perm_test*"
diff --git a/hw/ip/prim/lint/prim.waiver b/hw/ip/prim/lint/prim.waiver
index 281a3cb..bdcc365 100644
--- a/hw/ip/prim/lint/prim.waiver
+++ b/hw/ip/prim/lint/prim.waiver
@@ -16,6 +16,10 @@
waive -rules INTEGER -location {prim_packer.sv} -msg {'i' of type int used as a non-constant value} \
-comment "This assigns int i (signed) to a multibit logic variable (unsigned), which is fine"
+# prim_packer_fifo
+waive -rules {ZERO_REP} -location {prim_packer_fifo.sv} -regexp {Replication count is zero in .*DepthW.*} \
+ -comment "If InW equals OutW, DepthW is zero"
+
# TL-UL fifo
waive -rules {HIER_BRANCH_NOT_READ} -location {tlul_fifo_sync.sv} -regexp {Connected net '(clk_i|rst_ni)' at prim_fifo_sync.sv:.* is not read from in module 'prim_fifo_sync'} \
-comment "In passthrough mode, clk and reset are not read form within this module"
diff --git a/hw/ip/prim/rtl/prim_arbiter_ppc.sv b/hw/ip/prim/rtl/prim_arbiter_ppc.sv
index 152015e..86bef1e 100644
--- a/hw/ip/prim/rtl/prim_arbiter_ppc.sv
+++ b/hw/ip/prim/rtl/prim_arbiter_ppc.sv
@@ -113,7 +113,9 @@
end
end else begin: gen_nodatapath
assign data_o = '1;
- // TODO: waive data_i from NOT_READ error
+ // The following signal is used to avoid possible lint errors.
+ logic [DW-1:0] unused_data [N];
+ assign unused_data = data_i;
end
always_comb begin
diff --git a/hw/ip/prim/rtl/prim_packer_fifo.sv b/hw/ip/prim/rtl/prim_packer_fifo.sv
index 0b82c59..2b6e491 100644
--- a/hw/ip/prim/rtl/prim_packer_fifo.sv
+++ b/hw/ip/prim/rtl/prim_packer_fifo.sv
@@ -113,7 +113,7 @@
assign rvalid_o = (depth_q == FullDepth) && !clr_q;
end else begin : gen_unpack_mode
- logic [MaxW-1:0] rdata_shifted; // ri lint_check_waive NOT_READ
+ logic [MaxW-1:0] rdata_shifted;
logic pull_data;
logic [DepthW:0] ptr_q, ptr_d;
logic [DepthW:0] lsb_is_one;
@@ -127,7 +127,7 @@
end
end
- assign lsb_is_one = {{DepthW{1'b0}},1'b1}; // ri lint_check_waive ZERO_REP
+ assign lsb_is_one = {{DepthW{1'b0}},1'b1};
assign max_value = FullDepth;
assign rdata_shifted = data_q >> ptr_q*OutW;
assign clear_data = (rready_i && (depth_q == lsb_is_one)) || clr_q;
@@ -152,6 +152,11 @@
assign rdata_o = rdata_shifted[OutW-1:0];
assign rvalid_o = !(depth_q == '0) && !clr_q;
+ // Avoid possible lint errors in case InW > OutW.
+ if (InW > OutW) begin : gen_unused
+ logic [MaxW-MinW-1:0] unused_rdata_shifted;
+ assign unused_rdata_shifted = rdata_shifted[MaxW-1:MinW];
+ end
end