RTL Studio Open IDE

Edge, Debounce & Pulse

Level-to-Pulse Enable — L1 Upgrade — L2 Upgrade

Converts a level signal to a pulse with a configurable hold window and sticky edge flag.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Level-to-Pulse Enable — 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 converts a continuous level signal into a pulse with a configurable hold window.

It detects both rising and falling edges on the input signal to trigger the pulse output.

A sticky flag latches the occurrence of any edge until explicitly cleared.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Level-to-Pulse Enable — L1 Upgrade — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Converts a level signal to a pulse with a configurable hold window and sticky edge flag.
  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

  • Edge Detection: Detects both rising and falling edges on the input level signal.
  • Configurable Hold Window: Generates a pulse output that stays high for a configurable number of clock cycles (WINDOW_WIDTH).
  • Sticky Flag: The sticky_flag output remains set after any edge event until cleared via clr_sticky.
  • Window Extension: New edges detected while the window is active reset the counter, extending the pulse duration.
  • Control Signals: Supports synchronous enable (en) and active-low asynchronous reset (rst_n).

Ports

Port NameDirectionWidthDescription
clkinput1Clock input
rst_ninput1Active-low asynchronous reset
eninput1Synchronous enable
clr_stickyinput1Synchronous clear for sticky flag
level_ininput1Input level signal
pulse_outoutput1Pulse output during window
sticky_flagoutput1Latched edge indicator

Parameters

ParameterDefaultDescription
WINDOW_WIDTH4Number of clock cycles the pulse remains high after an edge detection.

Verification

The testbench verifies the following behaviors:

  1. Reset Behavior: Ensures all outputs and internal states are initialized correctly.
  2. Edge Detection: Confirms detection of both rising and falling edges.
  3. Window Logic: Validates that the pulse remains high for the configured window width.
  4. Window Extension: Checks that new edges reset the window counter and extend the pulse.
  5. Sticky Flag: Verifies that the flag latches on any edge and clears only on clr_sticky.
  6. Enable Control: Ensures operations are suspended when en is low.

### Test Cases

Test CaseDescriptionResult
TC1Reset CheckPASS
TC2Basic Rise Edge DetectionPASS
TC3Fall Edge DetectionPASS
TC4Sticky Flag ClearPASS
TC5Hold Both EdgesPASS
TC6Disable BehaviorPASS
TC7Window Reset on New EdgePASS

All test cases passed successfully in the Icarus Verilog simulation environment.

More in Edge, Debounce & Pulse

All Edge, Debounce & Pulse blocks