RTL Studio Open IDE

Edge, Debounce & Pulse

Double-Pulse Rejector

Passes first pulse, rejects subsequent pulses within N cycles.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Double-Pulse Rejector 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.

The Double-Pulse Rejector is a Verilog module that filters input pulse trains. It passes the first pulse of a sequence and rejects subsequent pulses within a configurable refractory period. This IP is useful for debouncing sensors or preventing rapid trigger events.

This IP provides a robust solution for double-pulse rejection. It is easy to integrate and configure via the N parameter. The design is fully verified with a standard testbench.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Double-Pulse Rejector.
  2. Read the Verilog module in the editor. The catalog line for this block: Passes first pulse, rejects subsequent pulses within N cycles.
  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

  • Passes the initial rising edge of an input pulse.
  • Rejects any additional pulses occurring within N clock cycles.
  • Configurable refractory period via the N parameter.
  • Synchronous reset with active-low polarity.
  • Simple synchronous state machine implementation.
  • Includes a comprehensive testbench with four verification cases.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input.
rst_nInput1Active-low synchronous reset.
pulse_inInput1Input pulse signal.
pulse_outOutput1Output pulse signal.

Architecture

The module uses a two-state finite state machine to manage pulse detection. The states are IDLE and ACTIVE (refractory). A 32-bit counter tracks the remaining cycles in the refractory period. Rising edge detection is performed using a two-stage flip-flop chain.

Verification

The testbench verifies the following scenarios:

Test CaseDescriptionExpected Result
TC1Single pulse inputpulse_out is high for one cycle.
TC2Double pulse inputFirst pulse passed, second rejected.
TC3Pulse after refractoryPulse passed after N cycles.
TC4Three spaced pulsesAll three pulses passed.

All test cases passed successfully in the simulation log.

More in Edge, Debounce & Pulse

All Edge, Debounce & Pulse blocks