RTL++ explaining a failing counter test: the source line, the trace of why count is 0 at 100 ns, and the waveform

RTL++

Verilog in the browser, two simulators, and a debugger that tells you why a test failed.

RTL++ waveform of the counter test, failing at 100 ns

RTL++ is a browser workspace for digital logic. You write Verilog or SystemVerilog, run every test in two simulators, and build for iCE40 and ECP5 FPGAs.

Role
Product, design, and engineering
When
2026
Stack
TypeScript, Verilog, WebAssembly, FPGA toolchains
50klines of TypeScript
2simulators on every test
2FPGA families
93commits in two days

Every value has a reason

A real RTL++ run at the moment a test fails: the line that caused it, the chain of causes and the waveform. Edit the counter and run it again; Icarus Verilog simulates it in this tab.

tb_counterFailed at 100 nsAfter 9 cycles count is 0, expected 9

counter.sv

Why is count 0 at 100 ns?

  1. count0expected 9at 95 ns

    16count <= (count == MAX - 1) ? '0 : count + 1'b1;

    if (rst) was false; if (en) was true; rst 0, en 1, count 8

  2. count1 to 8over 8 edges, 15 ns to 85 ns

    16count <= (count == MAX - 1) ? '0 : count + 1'b1;

    if (rst) was false; if (en) was true; rst 0, en 1, count 7

  3. rst0at 15 ns

    7input logic rst,

rst is a primary input, set by the testbench.

020 ns40 ns60 ns80 ns100 nsclkrstencount0123456780

Recorded from a real run: the Counter design with line 16 changed to (count == MAX - 1) ? '0 : count + 1'b1. Edit counter.sv and press Run to simulate it here with Icarus Verilog.

The problem

Hardware tools are heavy installs, and when a test fails they show a waveform and leave you to work out why.

The approach

When a test fails, RTL++ traces the wrong value back through the waveform to the line of code that set it, and shows each step of that chain next to the source.

Results

  • Verilog and SystemVerilog, tested in two simulators
  • Traces any value back to the line that made it
  • Builds for iCE40 and ECP5 FPGAs
AiroFind results for San Francisco to New York, November 10 to 24

AiroFind

Next project

AiroFind results for San Francisco to New York, November 10 to 24