RTL Studio Open IDE

Control & Timers

Programmable One-Shot with Rearm Gap — L2 Upgrade

Programmable one-shot pulse generator with rearm gap and sticky IRQ capture.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Programmable One-Shot with Rearm Gap — L2 Upgrade is a Verilog reference block in the Control & Timers catalog. FSMs, timers, watchdogs, and control/state sequencing blocks. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

This IP implements a programmable one-shot pulse generator with a rearm gap feature.

It captures a sticky interrupt request (IRQ) upon timeout completion.

The module supports dynamic width configuration via an 8-bit input and allows for early termination of the pulse via a rearm signal, enabling precise gap control between events.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Programmable One-Shot with Rearm Gap — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Programmable one-shot pulse generator with rearm gap and sticky IRQ capture.
  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

  • Programmable Pulse Width: Configurable duration via an 8-bit width input.
  • Sticky IRQ: Generates a sticky high state on irq_o upon timeout, clearable via irq_clear.
  • Rearm Gap: The rearm_n signal allows early termination of the pulse and counter reset, enabling precise gap control between events.
  • Edge Detection: Internal edge detection for trigger_i and rearm_n inputs.
  • Asynchronous Reset: Global reset via rst_n.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low reset
trigger_iInput1Rising-edge trigger input
rearm_nInput1Active-low rearm input
irq_clearInput1Active-high IRQ clear input
widthInput8Pulse width in clock cycles
pulse_oOutput1One-shot pulse output
irq_oOutput1Sticky IRQ output

Verification

The testbench covers five key scenarios:

  • TC1: Basic trigger and pulse width accuracy.
  • TC2: Sticky IRQ capture after timeout.
  • TC3: Asynchronous IRQ clearing.
  • TC4: Rearm gap functionality.
  • TC5: Multiple trigger and rearm sequences.

### Running Simulation

  1. Ensure Icarus Verilog is installed.
  2. Run the simulation script:
  3. Check the Log panel for:

- TC1 PASS through TC5 PASS - INFO: PASS

More in Control & Timers

All Control & Timers blocks