Edge, Debounce & Pulse
Single-Cycle Pulse Generator with Enable Gating — L1 Upgrade — L2 Upgrade
A single-cycle pulse generator that detects both positive and negative edges, gated by an enable signal and constrained by a configurable window duration. Includes a sticky flag for event latching.
About this block
Simulate it in the Verilog IDE
Single-Cycle Pulse Generator with Enable Gating — L1 Upgrade — L2 Upgrade is a Verilog reference block in the Edge, Debounce & Pulse catalog. Edge detectors, debouncers, pulse stretchers, and one-shot generators. Marked Medium: more state or a wider datapath, still one workspace in the IDE.
This IP core generates single-cycle pulses on both positive and negative edges of an input signal.
It features a configurable window duration to control pulse width and enable gating for conditional pulse generation.
A sticky flag records any pulse activity until cleared.
- Choose Open in IDE. RTL Studio loads the packaged workspace for Single-Cycle Pulse Generator with Enable Gating — L1 Upgrade — L2 Upgrade.
- Read the Verilog module in the editor. The catalog line for this block: A single-cycle pulse generator that detects both positive and negative edges, gated by an enable signal and constrained by a configurable window duration. Includes a sticky flag for event latching.
- Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
- 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
- Edge Detection: Detects both positive and negative transitions on the input signal.
- Enable Gating: Output pulses are generated only when the
ensignal is active. - Configurable Window: The
wininput defines the duration of the output pulse in clock cycles. - Sticky Flag: A latched flag (
sticky_flag) indicates that a pulse event has occurred, remaining set until cleared. - Asynchronous Reset: Clears all internal state and outputs immediately upon reset assertion.
Ports
| Port Name | Direction | Width | Description |
|---|---|---|---|
clk | Input | 1 | Clock input |
rst_n | Input | 1 | Active-low asynchronous reset |
en | Input | 1 | Enable signal for pulse generation |
clr | Input | 1 | Synchronous clear for sticky flag and counter |
win | Input | 4 | Window width in clock cycles (0-15) |
in_pulse | Input | 1 | Input signal for edge detection |
out_pulse | Output | 1 | Generated output pulse |
sticky_flag | Output | 1 | Latched pulse activity flag |
Verification
The testbench validates seven key scenarios to ensure robust operation:
- Basic Positive Edge: Detects positive edge within window.
- Basic Negative Edge: Detects negative edge within window.
- Zero Window: Pulse generation is suppressed if
winis 0. - Sticky Set:
sticky_flagsets correctly upon pulse generation. - Sticky Clear:
sticky_flagclears correctly uponclrassertion. - Enable Gating: Pulses are suppressed when
enis low. - Reset Behavior: All outputs initialize to zero on
rst_ndeassertion.
More in Edge, Debounce & Pulse
- 2-Bit Edge Detector with Edge Type Selection — L1 Upgrade — L2 Upgrade
- 8-Bit Sticky OR Accumulator — L1 Upgrade — L2 Upgrade
- Both-Edge Detector — L1 Upgrade
- Configurable Minimum Pulse Stretcher
- Double-Pulse Rejector
- Edge Count Window 8-bit — L1 Upgrade — L2 Upgrade
- Edge-Triggered Single-Cycle Pulse Generator — L1 Upgrade — L2 Upgrade
- Falling-Edge Hold for N Cycles — L1 Upgrade
- Level-Change Sticky Flag — L1 Upgrade — L2 Upgrade
- Level-to-Pulse Enable — L1 Upgrade — L2 Upgrade
- Min-Width Pulse Filter N
- Pulse Gap Detector 8-bit
- Pulse Width Monitor
- Quadrature Decoder x4 — L2 Upgrade
- Rising-Edge Event Counter 8-Bit — L1 Upgrade — L2 Upgrade
- Rising-Edge Hold for N Cycles — L1 Upgrade — L2 Upgrade