RTL Studio Open IDE

Counters

8-Bit Binary Up Counter — L1 Upgrade — L2 Upgrade

8-Bit Binary Up Counter with load enable and match interrupt request generation.

About this block

Simulate it in the Verilog IDE

Easyverilogsimsyn

8-Bit Binary Up Counter — L1 Upgrade — L2 Upgrade is a Verilog reference block in the Counters catalog. Up/down, modulo, and loadable binary counters with enable logic. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.

This IP core implements an 8-bit binary up-counter with synchronous load, enable control, and a match-based interrupt request (IRQ) signal. It is designed for applications requiring precise timing, event counting, or periodic interrupt generation in digital systems.

This 8-bit binary up counter provides a robust, verified solution for counting and interrupt generation.

It supports flexible control via synchronous load and enable signals, making it suitable for applications requiring precise timing and event detection.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for 8-Bit Binary Up Counter — L1 Upgrade — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: 8-Bit Binary Up Counter with load enable and match interrupt request generation.
  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

  • 8-Bit Counting: Counts from 0x00 to 0xFF.
  • Synchronous Load: Allows presetting the counter value via load_value when load is asserted.
  • Enable Control: Counting occurs only when en is high.
  • Match IRQ: Asserts irq high when count equals match_value.
  • Asynchronous Reset: Active-low rst_n resets the counter to 0 immediately.
  • Verified: Fully verified with Icarus Verilog simulation.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low asynchronous reset
enInput1Count enable (high = count)
loadInput1Load control (high = load load_value)
load_valueInput8Data to load into counter
match_valueInput8Threshold value for IRQ assertion
countOutput8Current counter value
irqOutput1Interrupt request (high when count == match_value)

Verification

The provided testbench (tb/tb_binary_up_counter_load_enable_8bit_match_irq_load.v) verifies the following behaviors:

Test CaseDescriptionResult
TC1Reset behaviorPASS
TC2Count enable and freezePASS
TC3Load functionalityPASS
TC4Match IRQ assertionPASS
TC5IRQ deassertion after matchPASS

### Running the Simulation

To run the simulation:

### Expected Output

More in Counters

All Counters blocks