[prim] Add stub flops to remove lint warnings
- for prim_mubi_sync/sender modules, when the AsynOn option is 0, the clk/rst_n inputs are used only for assertions.
- this causes the lint tools to throw a CLOCK_USE error as there are no valid loads on the clock.
- this commit adds unused stub logic that makes use of the clock and removes the lint error without having to add to individual waiver files.
Signed-off-by: Timothy Chen <timothytim@google.com>
diff --git a/hw/ip/prim/rtl/prim_mubi8_sync.sv b/hw/ip/prim/rtl/prim_mubi8_sync.sv
index 8a85e7e..bb543a8 100644
--- a/hw/ip/prim/rtl/prim_mubi8_sync.sv
+++ b/hw/ip/prim/rtl/prim_mubi8_sync.sv
@@ -105,10 +105,19 @@
assign mubi = mubi_sync;
end
end else begin : gen_no_flops
- logic unused_clk;
- logic unused_rst;
- assign unused_clk = clk_i;
- assign unused_rst = rst_ni;
+
+ // This unused companion logic helps remove lint errors
+ // for modules where clock and reset are used for assertions only
+ // This logic will be removed for synthesis since it is unloaded.
+ mubi8_t unused_logic;
+ always_ff @(posedge clk_i or negedge rst_ni) begin
+ if (!rst_ni) begin
+ unused_logic <= MuBi8False;
+ end else begin
+ unused_logic <= mubi_i;
+ end
+ end
+
assign mubi = MuBi8Width'(mubi_i);
end