BenchSim is a desktop app (PyQt6 + QScintilla) to edit, compile, and simulate Verilog testbenches with Icarus Verilog (iverilog + vvp) and visualize waveforms in GTKWave.
- Direct project opening for Icestudio designs (
.ice) and generic Verilog testbenches (*_tb.v). - Icestudio workspace generation: BenchSim locates
ice-build/<design>/main.vand creates an editable simulation scenario that survives design re-exports. - Generic Verilog workflow with automatic source and testbench discovery.
- Fast simulation loop:
Save+Simulatewith compile/run logs. - External testbench change detection with reload, local-edit protection, and safe merge support.
- Focused GTKWave view for generated Icestudio scenarios: direct inputs and outputs only, declaration order preserved, and a readable default profile.
- Clickable compile errors (
file:line:col) to jump in the editor. - Verilog-focused editor:
- syntax highlighting,
- autocomplete (keywords + document symbols),
- find/replace,
- adjustable font size (Settings, shortcuts,
Ctrl+Mouse Wheel).
- Recent projects in the top toolbar.
- UI language support (
English,Español). - Built-in update checker via GitHub Releases.
- Python 3.8+
- Icarus Verilog (
iverilog,vvp) - GTKWave
python -m venv .venv
source .venv/bin/activate
pip install -e .
benchsimAlternative run command:
python -m benchsim.main- Build or export the design from Icestudio so it generates
ice-build/<design_name>/main.v. - In BenchSim, open the design's
.icefile withCtrl+Oor the toolbar open button. - BenchSim creates
ice-build/<design_name>/.benchsim/scenario.vhand opens it in the editor. - Write input initialization and stimulus code in
scenario.vh, then select Save and Simulate.
BenchSim generates .benchsim/benchsim_tb.v as an internal wrapper. Do not edit that file: it is regenerated from main.v whenever the Icestudio design is opened. The editable scenario.vh is preserved, including custom initial blocks, clocks, tasks, assertions, loops, $display, $stop, and $finish statements.
The scenario header lists only the design inputs that can be driven and outputs that are shown in GTKWave. Internal Icestudio implementation signals are intentionally hidden from the initial waveform view.
- Put DUT/source
.vfiles and one or more*_tb.vfiles in the same folder. - Open the desired
*_tb.vfile in BenchSim. - Select testbench and run simulation.
When a testbench changes outside BenchSim, the editor asks whether to reload the external file or keep local edits. BenchSim keeps a local baseline to merge non-overlapping changes when possible. Save the resulting testbench after reviewing a merged change.
BenchSim writes a GTKWave save file after each successful simulation. For generated Icestudio scenarios, it displays the direct testbench interface in declaration order, avoiding the internal generated hierarchy. The bundled gtkwave.rc profile improves contrast and opens the complete simulation time range when supported by the installed GTKWave version.
Ctrl+S: SaveCtrl+R: Simulate (auto-save + run)Ctrl+Shift+V: Validate projectCtrl+O: Open an Icestudio design or Verilog testbenchF5: Reload project filesCtrl+,: Open settingsCtrl+F: FindCtrl+H: ReplaceF3/Shift+F3: Find next / previousEsc: Close find/replace barCtrl+Space: Trigger autocompleteCtrl++/Ctrl+=: Increase editor font sizeCtrl+-: Decrease editor font sizeCtrl+0: Reset editor font sizeCtrl+Mouse Wheel: Zoom editor font in/out
source .venv/bin/activate
python -m PyInstaller packaging/pyinstaller/BenchSim.spec --noconfirm --cleanOutput is generated in dist/BenchSim/ (onedir). Distribute the full folder, not only the binary.
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" packaging\windows\BenchSim.issInstaller output:
dist\installer\BenchSim-Setup-<version>.exe
benchsim/: app source codebenchsim/themes/: UI/editor theme filesbenchsim/ice_project.py: Icestudio discovery and generated simulation workspacebenchsim/tb_merge_controller.py: external testbench merge supportbenchsim/stimuli_persistence.py: supported generic stimulus persistencepackaging/pyinstaller/: PyInstaller specpackaging/windows/: Inno Setup installer scriptpackaging/linux/: desktop entry templatesim_icon_package/: icon assetsdocs/screenshots/: README screenshotsCHANGELOG.md: release history
