RTL Studio Open IDE

Clock Generators

4-Phase Clock-Enable Sequencer — L1 Upgrade — L2 Upgrade

Glitch-free 4-phase clock-enable sequencer with configurable M/N division counters.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

4-Phase Clock-Enable Sequencer — L1 Upgrade — L2 Upgrade is a Verilog reference block in the Clock Generators catalog. Clock dividers, gating, and clock distribution helpers. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

This IP implements a glitch-free 4-phase clock-enable sequencer with configurable M/N division ratios.

It generates a clean enable pulse (ce_out) and a divided clock pulse (div_out).

The sequencer ensures glitch-free transitions by synchronizing phase changes to the M-counter match signal.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for 4-Phase Clock-Enable Sequencer — L1 Upgrade — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Glitch-free 4-phase clock-enable sequencer with configurable M/N division counters.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.

RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.

Features

  • Glitch-Free Operation: Outputs are latched on M-counter match events to prevent transition glitches.
  • Configurable Division: Supports 8-bit M and N configuration for flexible division ratios.
  • 4-Phase Sequence: Generates a 4-phase sequence (00, 01, 10, 11) driven by the M-counter.
  • Divided Pulse: Outputs a single-cycle pulse on div_out every N+1 cycles.
  • Asynchronous Reset: Active-low reset (rst_n) initializes all counters and phases.

Ports

PortDirectionWidthDescription
clkInput1System clock
rst_nInput1Asynchronous active-low reset
ce_inInput1Clock enable input (gates counters)
mInput[7:0]M counter modulus (divides by M+1)
nInput[7:0]N counter modulus (divides by N+1)
ce_outOutput1Glitch-free 4-phase enable output
div_outOutput1Divided clock pulse output

Architecture

The design consists of two independent counters and a state sequencer:

  1. M-Counter: Divides the input enable rate to drive the phase sequencer. It resets when it matches the m input.
  2. N-Counter: Divides the input clock to generate the div_out pulse. It resets when it matches the n input.
  3. Phase Sequencer: Updates its state only when the M-counter matches the target value (m_match). This synchronization prevents glitches during phase transitions.

Verification

The testbench verifies reset behavior, division ratios, and enable gating. All tests passed in the Icarus Verilog simulation.

Test CaseDescriptionResult
TC1Reset BehaviorPASS
TC2M=1, N=1 DivisionPASS
TC3M=3, N=3 DivisionPASS
TC4ce_in Low GatingPASS
TC5M=0, N=0 Max FreqPASS

Expected Log Output:

  • TC1 PASS
  • TC2 PASS div_out is active
  • TC3 PASS div_out is active
  • TC4 PASS
  • TC5 PASS div_out is active
  • Simulation ends with INFO: PASS.

Constraints

  • Clock Domain: Synchronous to clk.
  • Reset: Asynchronous active-low reset.
  • Frequency: No specific maximum frequency constraint defined; depends on target technology.
  • Power: Low power mode enabled via ce_in gating.

More in Clock Generators

All Clock Generators blocks