RTL Studio Open IDE

Control & Timers

32-Bit Interval Timer with IRQ

A 32-bit down-counter interval timer that generates an interrupt request upon expiration, supporting preload, enable, and acknowledge signals.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

32-Bit Interval Timer with IRQ 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 module implements a simple 32-bit down-counter interval timer. It supports loading a preload value, enabling/disabling counting, and generating an interrupt request (IRQ) when the counter expires. The IRQ is cleared upon acknowledgment.

The system consists of a 32-bit counter, a preload register, and an IRQ generation logic. The counter decrements on each clock cycle when enabled. An interrupt is generated when the counter reaches zero. The interrupt is cleared by an acknowledge signal.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for 32-Bit Interval Timer with IRQ.
  2. Read the Verilog module in the editor. The catalog line for this block: A 32-bit down-counter interval timer that generates an interrupt request upon expiration, supporting preload, enable, and acknowledge signals.
  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.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low asynchronous reset
loadInput1Load preload value into counter
enableInput1Enable counting (down)
preloadInput3232-bit preload value
irqOutput1Interrupt request output (active high)
irq_ackInput1Interrupt acknowledge input (active high, pulse)

Verification

The testbench covers reset behavior, counting, IRQ assertion, acknowledgment, and re-triggering. All five test cases pass successfully in the simulation log.

Test CaseDescriptionResult
TC1Reset clears IRQ and CounterPASS
TC2Count down and IRQ assertionPASS
TC3IRQ clear on ACKPASS
TC4Reload and countPASS
TC5Disable timerPASS

More in Control & Timers

All Control & Timers blocks