RTL Studio Open IDE

3.2 · SOC CLASS

Clock enables & gating intro

Generate a clock enable signal from an idle indication to reduce power consumption.

Video coming soon. This lesson page stays at the same URL when the lecture publishes.

What you practice

Clock enables & gating intro (3.2). Generate a clock enable signal from an idle indication to reduce power consumption. It is in Clock Enables — Part 3 · System Control of the SoC Masterclass. Sequence reset, clock enables, boot vector, and watchdog into a sysctrl block.

SoC lessons simulate the fabric and the peripheral together in the IDE. Verilator is the simulator; the waveform is where address and response show up.

What you will learn

Today you will learn how to generate a clock enable signal from an idle indication. This technique reduces power by disabling logic when the system is not active. You will implement the gating logic in a dedicated IP module.

Learning objectives

  • Understand the purpose of clock enables in power management.
  • Implement combinational logic to gate a clock signal.
  • Verify the gating behavior using a testbench with idle and active states.
  • Inspect waveforms to confirm the enable signal timing.

Theory

A clock enable signal allows the design to pause state updates when no work is pending. This is a common technique for reducing dynamic power consumption in synchronous designs. The enable signal is typically a single bit that is asserted high when the system is active. When the enable is low, flip-flops hold their previous values even if the clock toggles. This lesson focuses on generating this enable signal based on an idle status flag. The logic should assert clk_en when the system is not idle and the reset is deasserted. A force_on input can be used to override the idle condition for testing or specific modes. The implementation uses simple combinational logic to combine these inputs.

SignalDirectionDescription
clkInputSystem clock signal.
rst_nInputActive-low asynchronous reset.
idleInputIndicates the system is in an idle state.
force_onInputForces the clock enable high regardless of idle.
clk_enOutputGenerated clock enable signal.

Practice

Open this chapter in RtlStudio to load the workspace automatically. Navigate to the Explore panel to find the student files. Open student/rtl/ip/soc/clock_en_gen.sv and implement the clk_en assignment. The logic must assert enable when reset is deasserted and the system is not idle or forced on. Open student/tb/tb_top.sv to run the simulation. The testbench checks the enable signal during idle and active phases. Run Simulation from the sidebar and check the Log panel for results. Use the Waveform tab to visualize the signals if needed.

Summary

You implemented combinational logic to generate a clock enable signal based on reset, force-on, and idle status inputs. This exercise demonstrated how clock gating reduces dynamic power by masking clock edges when the system is idle. The testbench verified that the enable signal correctly asserts after reset release, confirming the design's functional correctness.

© 2026 RtlStudio. Licensed under CC BY-NC-ND 4.0. Commercial use and modifications by third parties are not permitted.

Run it in the Verilog IDE

  1. Open the lesson workspace in the IDE. The fabric and the peripheral are one simulation.
  2. Run Verilator and follow the address, write data, and read response on the waveform.
  3. A passing log is not enough when decode or an IRQ line is the point of the lesson — those show up on the VCD.
  4. Run Yosys on the RTL island you just integrated when you want the mapped cells.

The lesson is done when the simulation matches Clock enables & gating intro. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.