defaultGenerateGatedClock static method

Logic defaultGenerateGatedClock(
  1. ClockGateControlInterface intf,
  2. Logic clk,
  3. Logic enable
)

A default implementation for clock gating, effectively just an AND of the clock and the enable signal, with an optional enableOverride.

Implementation

static Logic defaultGenerateGatedClock(
  ClockGateControlInterface intf,
  Logic clk,
  Logic enable,
) =>
    clk &
    flop(
        ~clk,
        [
          enable,
          if (intf.hasEnableOverride) intf.enableOverride!,
        ].swizzle().or());