[clkmgr] De-couple idle count from mubi
- Address issue brought up in #12274
Signed-off-by: Timothy Chen <timothytim@google.com>
diff --git a/hw/ip/clkmgr/rtl/clkmgr_trans.sv b/hw/ip/clkmgr/rtl/clkmgr_trans.sv
index 0201f9c..75a6703 100644
--- a/hw/ip/clkmgr/rtl/clkmgr_trans.sv
+++ b/hw/ip/clkmgr/rtl/clkmgr_trans.sv
@@ -28,13 +28,16 @@
import prim_mubi_pkg::mubi4_test_true_strict;
import prim_mubi_pkg::mubi4_test_false_loose;
- localparam int TransIdleCnt = int'(MuBi4True);
+ // Note this value is specifically chosen.
+ // The binary value is 1010, which is a balanced 4-bit value
+ // that should in theory be resistant to all 0 or all 1 attacks.
+ localparam int TransIdleCnt = 10;
localparam int IdleCntWidth = $clog2(TransIdleCnt + 1);
logic [IdleCntWidth-1:0] idle_cnt;
logic idle_valid;
logic sw_hint_synced;
- assign idle_valid = (idle_cnt == MuBi4True);
+ assign idle_valid = (idle_cnt == TransIdleCnt);
assign clk_en_o = sw_hint_synced | ~idle_valid;
prim_flop_2sync #(