Skip to main content

DigSim - Interactive Digital Logic Simulator

Python Version from PEP 621 TOML PyPI - Version PyPI - Downloads

The DigSim Application

Introduction

DigSim is a python based framework for digital circuit simulation. The main purpose of the software is to, in an educational way, play around with digital logic (simple gates and verilog designs).

When working with block design in Verilog/VHDL the simulation tools are normally fed with test stimuli (a very non-interactive way of working...) A block design can be synthesized and tested on an FPGA (where there are possibilities for interactivity if buttons and LED/Hex digits are available), but that often has a great cost in time (and sometimes money) leading to long turnaround time.

I started developing DigSim to make it easy to implement and visualize the functionality of simple verlog modules. During development I tried to synthesize larger verilog designs, such as the classic 6502 CPU, and even if it is slower than many other simulators it is not entirely useless.

Features

  • Create and simulate a circuit using python code
  • Create and simulate a circuit interactively using the GUI
  • Create new components using synthesized verilog code
  • Save simulation results in VCD files, which can be opened in for example GTKWave.

Quickstart

Install from PyPi (Option 1)

pip3 install digsim-logic-simulator

Install from GitHub (Option 2)

> git clone https://github.com/freand76/digsim.git
> cd digsim
> python3 -m pip install .

Start Interactive GUI

Prerequisites: Install by using Option 1 or Option 2 above.

> python3 -m digsim.app

or

> digsim-logic-simulator

Start using uv

Prerequisites: Download and install uv

> uvx digsim-logic-simulator

Note: Ubuntu

If your Ubuntu installation gives the folloing error message:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: vnc, wayland, wayland-egl, eglfs, offscreen, xcb, minimal, linuxfb, vkkhrdisplay, minimalegl.

Then the following package must be installed:

> apt install libxcb-cursor0

Start with example circuit (example circuits are available in the github repository)

> python3 -m digsim.app --load example_circuits/counter_yosys_netlist.circuit

Run example (examples are available in the github repository)

> python3 examples/example_sr.py

Look at waveforms

> python3 examples/example_sr.py
> gtkwave sr.vcd

Examples of writing pytest/python test benches for synthesized verilog code

> pytest examples/pytest_tb

Yosys synthesis helper tool

> python3 -m digsim.synth synth -i <verilog file 1> <optional verilog file 2> -o <output_file.json> -t <verilog top_module>

Documentation

Documentation on GitHub

Star History

Star History Chart

Metadata

Release files for digsim-logic-simulator 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for digsim-logic-simulator 1.1.0
File Size Uploaded
digsim_logic_simulator-1.1.0.tar.gz 253.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for digsim-logic-simulator 1.1.0
File Interpreter ABI Platform
digsim_logic_simulator-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 540.8 kB

Release files / digsim_logic_simulator-1.1.0.tar.gz

Download URL digsim_logic_simulator-1.1.0.tar.gz
Size 253.1 kB
Tags Source
SHA-256 checksum
How to use checksums
40d5259ee0dddfadc4928e12f19db1a9b6da28fd00199d2bb4d233c14b06287d
BLAKE2b-256 checksum
How to use checksums
2debfac66e80c4c46fbddf9a36739e8dd695ad25c9fc999b8cdd09d77f41cc14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / digsim_logic_simulator-1.1.0-py3-none-any.whl

Download URL digsim_logic_simulator-1.1.0-py3-none-any.whl
Size 287.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed1ef531c503673f1655c6df42585b4352966225a09fb5e12b6c858c6224c92f
BLAKE2b-256 checksum
How to use checksums
76fabf87afc01b79e02194b8b7872bbe4ef78ba2c8157599f7375a7992596b20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.16.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

1 release file

0.5.0

1 release file

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page