Verilog Simulator user guide
Verilog Simulator edits multiple Verilog sources (testbench, DUTs, `include headers) in the browser (no install), runs Icarus Verilog WASM, and views VCD waves in the embedded Surfer viewer. There is no heuristic / fake waveform: Surfer and the workspace update only when the simulator actually produces a VCD.
👉 Open the tool: Open Verilog Simulator
Quick workflow
- Pick a workspace in the top bar — Sample (default simulation demo) or Lint Sample Eg (intentional multiple issues for combined Slang + Yosys lint), or New workspace.
- Open files from the Explorer and edit in Monaco.
- Press Run (play) to simulate, or the Lint icon to run combined Slang WASM + YoWASP Yosys (first Yosys run may download a large WASM from the CDN).
- Read the Terminal log and use the right-hand tabs: Surfer · Waveform or Lint. The Lint tab shows the merged
lint_report.md; clickfile.v:linelinks to jump the editor to that line. - After a successful run, a
.vcdfile named in$dumpfile(defaultwave.vcd) appears in the Explorer; open it as plain text in the editor.
What you can do
- Sample workspace — tb.v, define.vh, dut_cnt.v, dut_rsync.v. Change
`defineCNT_WIDTH or CLK_HALF_NS to see real waves and$displayoutput change together. - Multiple workspaces — keep labs or projects separate; Run and Lint use the active workspace only. Two built-in presets: Sample and Lint Sample Eg.
- Import / export — Upload files, Import ZIP (adds a workspace), Export ZIP (download the active workspace).
- VCD files — simulation output is written into the workspace as
.vcdtext after a successful Run (there is usually nowave.vcdin the tree until then). - Combined lint (Slang + Yosys) — Slang WASM: Button Lint uses
checkSystemVerilogAdvanced(source, optionsJson)withstd,warningOptions,defaultNettypeNone,errorLimit, etc.; live editor squiggles still usecheckSystemVerilogonly. Older wasm falls back todefault_nettype nonesource injection + the basic API.lint_report.mdincludes a sampleoptionsJson. YoWASP Yosys skipstb.v, reads the rest, then runshierarchy -check; proc; checkonce permodulein non-tb.vfiles (multiple DUTs →design -reset, repeat). The summary table countsWarning:/ERROR:lines (includingfile:line:forms).
Suited for small modules and testbenches in courses or portfolios. It does not replace vendor FPGA flows, timing sign-off, or UVM-class verification.
UI layout (VS Code–style)
Top workspace bar
| Control | Role |
|---|---|
| Workspace dropdown | Choose the active workspace used by Run |
| Rename | Change the label of the current workspace |
| New workspace | New set with tb.v only (includes default $dumpfile("wave.vcd") / $dumpvars) |
| Close workspace | Remove from the list (cannot close the last one) |
| New file | Prompt for a .v / .vh / .vcd name |
| Delete file | Delete the currently active file (confirm). Cannot delete the last file |
| Upload | Multi-file pick (allowed names only) |
| Import ZIP | Unzip into a new workspace |
| Export ZIP | Download the active workspace |
File names: ASCII letters, digits, ., _, - only; extensions .v, .vh, .vcd.
Left activity bar
| Icon | Role |
|---|---|
| Files | Show/hide Explorer |
| Magnifier | Find in editor (Monaco) |
| Play | Run simulation |
| Lint (checkmark) | Combined lint (Slang + Yosys) → lint_report.md · right Lint tab |
| Four blocks | Bottom panel (Terminal, Output, Problems) |
Explorer and editor tabs
- Click a file in the tree to open a tab.
- × on a tab closes the tab only; the file stays in the Explorer.
- Drag the tab title to reorder; drop on the empty strip on the right to move a tab to the end.
.vcdopens as plaintext in Monaco.
Right panel (Surfer · Lint)
- Surfer · Waveform — A VCD is sent to Surfer only when the simulator produced one. If Surfer is still loading, waves may look empty — try Run again.
- Lint — After combined lint, read the Markdown report here; click
file.v:lineto jump the editor.
Bottom panel
- TERMINAL — Run log (steps, success/failure, Surfer notice).
- OUTPUT — Short summary for the last Run (e.g. WASM VCD, or no VCD).
- PROBLEMS — Error text (e.g. from the simulation API).
Status bar
Shows Icarus WASM, Sim API, or No VCD according to the last Run.
Terminal flow after a successful Run
Rough order:
- Run start and active workspace name.
- If Icarus WASM finishes with a VCD: “VCD generated”,
engine: icarus-wasm, etc. - Simulation and VCD generation completed successfully.
- A line that the VCD was saved into the workspace under the
$dumpfilename (defaultwave.vcd). - postMessage to Surfer notice.
If WASM finishes but the VCD string is empty, the terminal explains that no dump was detected — check $dumpfile / $dumpvars in the testbench.
If a simulation API is configured, it may run after WASM. If no VCD is produced at all, Surfer is not updated and the terminal states that.
What goes to the simulator vs .vcd in the workspace
- Run sends only
.vand.vhinto the simulator (MEMFS). .vcdfiles you keep in the workspace are not fed as HDL input; they are for reference, editing, and ZIP.- After a successful run, the generated VCD is written under the name from
$dumpfileintb.v(falls back towave.vcdif parsing fails). That file opens in the editor.
How simulation runs (technical summary)
- In-browser Icarus WASM — When the bundle is present, ivlpp.wasm (one Web Worker per
.v) → ivl → vvp runs on your device. Ordinary SGDH hosting does not simulate your HDL on our servers. - Optional remote sim API — If the operator sets an API URL, that host may run iverilog + vvp.
- No VCD — If neither path yields a VCD, Surfer is not refreshed with synthetic data.
Details (ivlpp, lib/, -F flags) matter mainly for deployment; for everyday use, the Terminal log is enough.
Coding tips
- Default top-level module name is tb.
- For Surfer and workspace VCD, add
$dumpfileand$dumpvarsto the testbench. New workspace tb.v already includes awave.vcdexample. - Share constants across
.vfiles with`include. - In the sample, tweak CNT_WIDTH / CLK_HALF_NS and Run to see waves and
$displaychange together.
Privacy and load (short)
- By default, simulation is meant to run in your browser.
- Remote sim API is the exception when enabled.
- See the site privacy policy for full policy text.
FAQ
Q. Waves are empty.
A. Surfer may still be loading — press Run again. If the terminal shows VCD errors or Output says no VCD was sent, fix $dumpfile / $dumpvars and confirm simulation succeeded.
Q. There was no wave.vcd until after Run.
A. Expected. The .vcd appears in the Explorer and editor after a successful simulation.
Q. Is this the same as silicon?
A. No — think learning / quick checks, not tape-out sign-off.
Q. Fully offline?
A. The page needs the browser, CDN assets, and (when used) WASM/Surfer resources; fully offline use is not guaranteed.