RTL Studio Open IDE

Clock Generators

Clock-Enable Divider (CE Pulse) — L1 Upgrade — L2 Upgrade

Glitch-free clock enable divider with M/N inputs. Generates a pulse on ce_out when counter reaches M-1. Counter resets when reaching N-1. M must be <= N.

About this block

Simulate it in the Verilog IDE

Easyverilogsimsyn

Clock-Enable Divider (CE Pulse) — L1 Upgrade — L2 Upgrade is a Verilog reference block in the Clock Generators catalog. Clock dividers, gating, and clock distribution helpers. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.

A glitch-free, configurable clock-enable pulse generator. This IP generates a single-cycle enable pulse (ce_out) based on two configurable parameters, M and N, synchronized to the input clock clk.

This IP provides a robust, glitch-free clock-enable divider with dynamic M/N control.

It is suitable for power gating or clock gating applications requiring precise pulse timing.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Clock-Enable Divider (CE Pulse) — L1 Upgrade — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Glitch-free clock enable divider with M/N inputs. Generates a pulse on ce_out when counter reaches M-1. Counter resets when reaching N-1. M must be <= N.
  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 Output: The output ce_out is derived from registered counter values, ensuring no glitches occur during state transitions.
  • Configurable Division: Supports dynamic configuration of the division ratio via m (pulse position) and n (modulus) inputs.
  • Synchronous Enable: The counter only increments when the input enable ce_in is high.
  • Asynchronous Reset: Supports active-low asynchronous reset for immediate initialization.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low asynchronous reset
mInput8Pulse position index (0 to N-1)
nInput8Counter modulus (1 to 255)
ce_inInput1Input clock enable
ce_outOutput1Glitch-free clock enable pulse

Architecture

The design uses a single 8-bit counter registered on the positive clock edge. Comparison logic detects when the counter equals m - 1 or n - 1. The ce_out signal is assigned directly from the compare_m wire. Since compare_m is derived from the registered cnt, it is free of combinational glitches relative to the clock domain.

Verification

The testbench verifies reset behavior, pulse generation at various M values, and counter reset at N. It also checks that the counter holds its value when ce_in is de-asserted.

### Test Cases

Test CaseDescriptionResult
TC1Reset checkPASS
TC2Pulse at M=3PASS
TC3Reset at N=8PASS
TC4Disable checkPASS
TC5Pulse at M=3 with N=10PASS
TC6Pulse at M=4 with N=8PASS

### Simulation Results

After running the simulation, the Log panel should show:

  • TC1 PASS reset check
  • TC2 PASS pulse at M=3
  • TC3 PASS reset at N=8
  • TC4 disable check
  • TC5 PASS pulse at M=3
  • TC6 PASS pulse at M=4
  • Simulation ends with INFO: PASS.

More in Clock Generators

All Clock Generators blocks