Home / Learn Verilog / How to Use the Built-in Simulator (Run, Edit, Waveform, Errors)

How to Use the Built-in Simulator (Run, Edit, Waveform, Errors)

Read the output panel: console, waveform, cursor, radix and error messages.

The short versionRead the output panel: console, waveform, cursor, radix and error messages.

Theory in plain words

Reading the resultRunconsole from $displaywaveform of signalshover to read valueschange code, run again
Reading the result

In plain terms

Every example has a Verilog editor and a result panel. Press Run (or Ctrl+Enter). The panel shows the top module, simulated time, console text from $display and a waveform of the signals.

Why we use it

You learn Verilog by changing code and watching what happens. Knowing how to read the output makes that fast.

Under the hood

The simulator picks the top module: a module named tb or test, otherwise the one nobody instantiates. Time starts at 0 and runs until $finish or until nothing is left to do.

Real-world use

  • Every example in this course
  • Quick experiments
  • Teaching and demos

Try it: a counter and its waveform

Counter you can changeVerilog: edit and run

Try: change "q + 1" to "q + 2", change the radix to binary, press Zoom +, move the mouse over the waveform.

What the controls do

ControlMeaning
Show as hex/binary/decimalhow bus values are written
Zoom + / Zoom -stretch the time axis
sub-module signalsalso show signals inside instances (like c.q)
integersshow integer loop variables
Mouse over waveformshows the value of every signal at that time
Reset buttonrestores the original example code

Errors are your friend

Remove a semicolon in the example above and press Run. The panel shows the line number and what the parser expected. Fix it and run again.

Tip:x (red) in a waveform means unknown. It usually means a signal was never assigned or a reset is missing.

Quick quiz

1. x in a waveform means...

2. How do you stop a simulation in code?