RTL Studio Open IDE

Counters

Sticky Overflow Counter 8-bit — L1 Upgrade — L2 Upgrade

An 8-bit counter with load enable, match-based IRQ, and sticky overflow detection for L1/L2 upgrades.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Sticky Overflow Counter 8-bit — L1 Upgrade — L2 Upgrade is a Verilog reference block in the Counters catalog. Up/down, modulo, and loadable binary counters with enable logic. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

This IP implements an 8-bit counter with load enable, match-based IRQ, and sticky overflow detection. It is designed for L1 and L2 upgrade scenarios requiring precise event counting and status tracking. The module supports synchronous reset, parallel load, and continuous counting modes.

This IP provides a robust 8-bit counting solution with advanced status flags for system monitoring. It integrates seamlessly into L1 and L2 upgrade paths for legacy counter replacements. The design is fully verified and ready for synthesis and integration.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Sticky Overflow Counter 8-bit — L1 Upgrade — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: An 8-bit counter with load enable, match-based IRQ, and sticky overflow detection for L1/L2 upgrades.
  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

The counter increments on every active clock edge when count enable is asserted. A parallel load operation overrides the count function when load enable is high. The sticky overflow flag remains set once the counter wraps from 0xFF to 0x00. An IRQ match signal asserts when the counter value equals the configured match value. Loading a new value clears both the sticky overflow and IRQ match flags.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low synchronous reset
load_enInput1Load enable signal
count_enInput1Count enable signal
load_valueInput8Parallel load data input
match_valueInput8IRQ match threshold value
irq_matchOutput1IRQ match flag
sticky_overflowOutput1Sticky overflow flag

Verification

The testbench validates reset behavior, load functionality, counting sequence, match IRQ, and sticky overflow. All test cases passed successfully in the Icarus Verilog simulation environment.

Test CaseDescriptionResult
TC1Reset clears counter, sticky overflow, and IRQ matchPASS
TC2Load specific value and verify IRQ is not assertedPASS
TC3Count to match value and verify IRQ assertion/clearingPASS
TC4Count to overflow and verify sticky overflow flagPASS
TC5Load new value and verify sticky overflow is clearedPASS

More in Counters

All Counters blocks