Edge, Debounce & Pulse
Edge-Triggered Single-Cycle Pulse Generator — L1 Upgrade — L2 Upgrade
Edge-Triggered Single-Cycle Pulse Generator with configurable window width and sticky flag.
About this block
Simulate it in the Verilog IDE
Edge-Triggered Single-Cycle Pulse Generator — 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 a single pulse of configurable width upon a trigger event.
It supports both rising and falling edge detection (via external logic or input conditioning) and maintains a sticky flag to indicate that a trigger event has occurred.
The module is designed for L1 and L2 upgrade scenarios requiring precise timing control and event tracking.
- Choose Open in IDE. RTL Studio loads the packaged workspace for Edge-Triggered Single-Cycle Pulse Generator — L1 Upgrade — L2 Upgrade.
- Read the Verilog module in the editor. The catalog line for this block: Edge-Triggered Single-Cycle Pulse Generator with configurable window width and sticky flag.
- 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-Triggered: Detects trigger events to initiate pulse generation.
- Configurable Width: Pulse duration is defined by the
window_widthinput (0-15 cycles). - Sticky Flag: A status bit (
sticky_flag) latches the occurrence of a trigger event. - Explicit Clear: The sticky flag can be reset synchronously via
clear_sticky. - Zero-Width Support: Handles
window_width = 0gracefully (pulse expires immediately). - Asynchronous Reset: Supports active-low asynchronous reset for system initialization.
Ports
| Port Name | Direction | Width | Description |
|---|---|---|---|
clk | Input | 1 | System clock input |
rst_n | Input | 1 | Active-low asynchronous reset |
trigger | Input | 1 | Trigger signal. Pulse generation starts on assertion. |
clear_sticky | Input | 1 | Active-high synchronous clear for sticky_flag |
window_width | Input | 4 | Pulse width in clock cycles (0-15) |
pulse_out | Output | 1 | Active-high pulse output |
sticky_flag | Output | 1 | Latched indicator that a trigger event occurred |
Architecture
The module uses a synchronous down-counter to manage the pulse duration.
- Sticky Logic: The
sticky_flagis set to1whenevertriggeris asserted. It is cleared to0only whenclear_stickyis asserted. This logic is independent of the pulse generation state. - Pulse Logic: When
triggeris asserted,pulse_activeis set to1andwindow_cntis loaded withwindow_width. - Counting: On subsequent clock cycles, if
pulse_activeis high,window_cntdecrements. Whenwindow_cntreaches 0,pulse_activeis cleared, ending the pulse.
### Block Diagram
Verification
The provided testbench (tb_pulse_gen_1shot_edge_hold_both_window_sticky.v) covers:
- Basic triggering with various window widths.
- Sticky flag setting and clearing.
- Edge cases (window_width = 0, 1, 15).
- Reset behavior.
### Running Simulation
- Ensure you have a Verilog simulator installed (e.g., Icarus Verilog, ModelSim).
- Run the simulation:
- Check the log for
INFO: PASS.
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
- 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
- Single-Cycle Pulse Generator with Enable Gating — L1 Upgrade — L2 Upgrade