Control & Timers
Edge Rate Limiter 8-bit — L2 Upgrade
Edge Rate Limiter 8-bit with sticky IRQ capture and configurable threshold.
About this block
Simulate it in the Verilog IDE
Edge Rate Limiter 8-bit — 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 synchronous edge rate limiter with sticky interrupt request (IRQ) capture.
It counts rising edges on the edge_in signal using an 8-bit counter.
When the count reaches a configurable THRESHOLD, the edge_out signal is asserted.
- Choose Open in IDE. RTL Studio loads the packaged workspace for Edge Rate Limiter 8-bit — L2 Upgrade.
- Read the Verilog module in the editor. The catalog line for this block: Edge Rate Limiter 8-bit with sticky IRQ capture and configurable threshold.
- 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 Threshold: Adjustable edge count threshold via
THRESHOLDparameter. - Sticky IRQ Capture:
irq_stickyflag persists until explicitly cleared viairq_clear. - 8-bit Counter: Supports up to 256 edges before threshold assertion.
- Synchronous Reset: Clean reset behavior for all internal states via
rst_n. - Asynchronous Clear: Immediate clearing of the sticky IRQ flag via
irq_clear.
Architecture
The module operates on the positive edge of clk. The logic flow is as follows:
- Edge Detection: An edge is detected when
edge_intransitions from low to high. This is determined by comparing the currentedge_inwith a delayed version of the internal state (edge_out_d). - Counting: The internal
countregister increments on each detected edge. - Threshold Check: If
count >= THRESHOLD,edge_outis asserted. - IRQ Handling: On any edge detection,
irq_stickyis set. It can be cleared by assertingirq_clear.
Interface
| Signal Name | Direction | Width | Description |
|---|---|---|---|
| clk | Input | 1 | Clock input |
| rst_n | Input | 1 | Active-low synchronous reset |
| edge_in | Input | 1 | Input signal to monitor for edges |
| irq_clear | Input | 1 | Asynchronous clear for sticky IRQ |
| edge_out | Output | 1 | Asserted when edge count >= THRESHOLD |
| irq_sticky | Output | 1 | Sticky flag set on any edge detection |
Parameters
| Parameter | Default | Description |
|---|---|---|
| THRESHOLD | 8 | Edge count threshold to assert edge_out |
Verification
The testbench (tb_edge_rate_limiter_8bit_sticky_irq_capture.v) verifies the following scenarios:
- TC1: Reset state initialization.
- TC2: Edge counting up to the threshold.
- TC3: Sticky IRQ clear functionality.
- TC4: Sustained edge output behavior.
- TC5: Full reset behavior.
All test cases passed in the provided simulation environment.
More in Control & Timers
- 1 MHz Tick Generator — L1 Upgrade — L2 Upgrade
- 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
- Enable-Gated Set/Reset Flag