DigitalJS Schematic Viewer for VSCodeA VSCode extension that synthesises your Verilog / SystemVerilog files and renders the full interactive circuit simulator directly inside a VSCode panel. Synthesis can run either via the DigitalJS online API or fully offline using local WebAssembly (YoWASP + Yosys bundled in the extension). Why this existsThe published DigitalJS VSCode extension bundles an old, frozen version of This extension supports two synthesis backends:
In both cases, rendering and simulation run locally in the VSCode webview using the DigitalJS library loaded from jsDelivr CDN. Features
Requirements
InstallationFrom the
|
| Mode | Internet required | Speed | Notes |
|---|---|---|---|
| Server Side | Yes (synthesis + CDN) | Fast | Uses digitaljs.tilk.eu API; supports the widest range of constructs |
| WebAssembly | CDN only | Slower on first use (WASM init) | Runs Yosys locally via @yowasp/yosys; fully offline synthesis |
The default quick-synthesis button always uses WebAssembly mode. To use Server Side mode, open the Parameters sidebar and select Server Side from the Synthesis mode dropdown before clicking Synthesize Circuit.
On first use, WebAssembly mode downloads and caches the Yosys WASM binary (~50 MB). Subsequent runs are faster.
Work in Progress
- Simulation Engine / Delay: The options for "Zero combinational propagation delay" and switching "Simulation engines" are visible in the UI but are not currently passed into the active JointJS/DigitalJS rendering engine.
Toolbar reference
| Button | Action |
|---|---|
| ▶ / ⏸ | Start simulation / Pause simulation (single toggle button) |
| ▶ 1 | Step 1 tick |
| ▶ 10 | Step 10 ticks |
| ▶ 100 | Step 100 ticks |
| ▶ 1000 | Step 1000 ticks |
N (tick counter) |
Current simulation tick |
| − / + | Zoom circuit out / in |
| ⊡ | Fit circuit to panel |
Input Controls panel:
| Control | Action |
|---|---|
| Circular lamp + label (start of bar) | Synthesis status: grey/yellow = synthesising, green = ready, red = error |
| ◀ / ▶ (next to panel title) | Collapse / expand the Input Controls bar |
| Toggle switch | Drive a single-bit input high/low |
| Value box | Edit a multi-bit input's value (decimal by default) |
| Lamp | Read-only indicator for an output signal |
[value][▲▼] (clock rows) |
Set the clock's period in ticks |
Waveform toolbar:
| Control | Action |
|---|---|
| + / − | Zoom waveform in / out |
scale N |
Current pixels-per-tick |
| ◀ / ▶ | Scroll waveform left / right |
| Live | Jump to live (latest tick) |
range X – Y |
Currently visible tick range |
How it works
Server Side mode:
VSCode extension host (Node.js)
└─ HTTPS POST → digitaljs.tilk.eu/api/yosys2digitaljs
└─ receives circuit JSON
└─ postMessage → Webview
└─ new digitaljs.Circuit(json) ← CDN library, runs locally
└─ circuit.displayOn($('#paper')) ← JointJS diagram
└─ new digitaljs.MonitorView(…) ← waveform panel
WebAssembly mode:
VSCode extension host (Node.js)
└─ spawns Worker thread (wasm-worker.mjs, ESM)
└─ @yowasp/yosys → runs Yosys WASM locally
└─ yosys2digitaljs/core → converts netlist to circuit JSON
└─ postMessage → extension host
└─ postMessage → Webview
└─ new digitaljs.Circuit(json) ← CDN library, runs locally
└─ circuit.displayOn($('#paper')) ← JointJS diagram
└─ new digitaljs.MonitorView(…) ← waveform panel
The Worker thread is necessary because @yowasp/yosys is an ESM-only package that uses import.meta.url internally to locate its .wasm binaries — this only works in an ESM context, not in the CJS extension host.
Known limitations
- CDN libraries (rendering/simulation) always require an internet connection
- Very large designs may be slow to render (JointJS lays out all gates in the browser)
- WebAssembly mode has a ~50 MB one-time WASM download on first use
- WebAssembly mode uses
hierarchy -auto-top; proc; optinternally, which may produce slightly different results than the server-side synthesis pipeline for complex designs
Credits
- DigitalJS by Marek Materzok (tilk) — the circuit simulator
- yosys2digitaljs — the synthesis backend
- Yosys — the open-source synthesis framework powering it all
- YoWASP — WebAssembly port of Yosys enabling local synthesis
License
MIT — see LICENSE