Control & Timers
1 MHz Tick Generator — L1 Upgrade — L2 Upgrade
Configurable tick generator with sticky interrupt capture and enable control.
About this block
Simulate it in the Verilog IDE
1 MHz Tick Generator — L1 Upgrade — 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 provides a robust, configurable tick generator with sticky interrupt handling. It is fully verified against all functional requirements and is ready for integration into larger control systems. The design ensures precise timing intervals and reliable interrupt signaling through its sticky flag mechanism.
The module generates periodic tick signals based on an input clock (clk) and a 16-bit period value (period). It includes a sticky interrupt flag (irq_sticky) that persists until explicitly cleared by the irq_clear signal. This IP is suitable for timing-critical applications requiring precise interval detection and interrupt handling.
This IP provides a robust, configurable tick generator with sticky interrupt handling. It is fully verified against all functional requirements and is ready for integration into larger control systems. The design ensures precise timing intervals and reliable interrupt signaling through its sticky flag mechanism.
- Choose Open in IDE. RTL Studio loads the packaged workspace for 1 MHz Tick Generator — L1 Upgrade — L2 Upgrade.
- Read the Verilog module in the editor. The catalog line for this block: Configurable tick generator with sticky interrupt capture and enable control.
- 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
- Configurable Period: 16-bit programmable period value allows for flexible timing intervals.
- Sticky Interrupt: The
irq_stickyflag remains set until cleared, ensuring no interrupt is missed. - Synchronous Reset: Active-low synchronous reset for safe initialization.
- Enable Control: Optional enable signal to pause tick generation without resetting state.
Ports
| Port Name | Direction | Width | Description |
|---|---|---|---|
clk | Input | 1 | System clock input |
rst_n | Input | 1 | Active-low synchronous reset |
enable | Input | 1 | Enable counter and tick generation (high = active) |
irq_clear | Input | 1 | Active-high clear for sticky IRQ (pulse to clear) |
period | Input | [15:0] | Counter period value for tick generation |
tick | Output | 1 | Single-cycle pulse when counter matches period |
irq_sticky | Output | 1 | Sticky interrupt flag set on tick |
Verification
The testbench verifies the following functionalities:
- Reset behavior (counter and IRQ state).
- Tick generation when enabled.
- Sticky IRQ capture on tick events.
- IRQ clearing via
irq_clearsignal. - Behavior when disabled (counter holds, no ticks).
- Resumption of tick generation after re-enable.
- Persistence of sticky IRQ until cleared.
- Dynamic period changes.
All eight test cases passed successfully in the simulation log. The simulation was run using Icarus Verilog with a 10ns clock period (100MHz).
More in Control & Timers
- 16-Bit Down Timer (Match on Load-Zero Too) — L2 Upgrade
- 16-Bit Programmable Prescaler — L1 Upgrade — L2 Upgrade
- 16-bit Programmable Timer with Interrupt — L2 Upgrade
- 16-Bit Pulse Width Modulator (PWM) Controller
- 32-Bit Interval Timer with IRQ
- 32-Bit Kick Watchdog with Configurable Timeout and Reset Pulse
- 8-Bit Down Timer (Pulse Match on Zero) — L2 Upgrade
- 8-Bit Programmable Digital Deglitch Filter — L1 Upgrade — L2 Upgrade
- 8-Bit Window Comparator — L1 Upgrade — L2 Upgrade
- 8-Channel 16-Bit PWM Controller
- Activity Timeout Flag 8-bit — L2 Upgrade
- Bang-Bang Thermostat 8-bit
- Complementary PWM Dead-Time Inserter — L2 Upgrade
- Duty-Cycle Measurement 8-Bit — L2 Upgrade
- Edge Rate Limiter 8-bit — L2 Upgrade
- Enable-Gated Set/Reset Flag