Code Monkey home page Code Monkey logo

digsim's Introduction

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

pip3 install digsim-logic-simulator

Install from GitHub

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

Start Interactive GUI

> python3 -m digsim.app

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

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

digsim's People

Contributors

freand76 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

digsim's Issues

AttributeError when trying to delete objects

When trying to delete an object (button, switch, etc) using right click->delete I get this error:
Traceback (most recent call last): File "/home/malin/.local/lib/python3.10/site-packages/digsim/app/gui_objects/_component_context_menu.py", line 61, in _delete self._component_object.select(True) AttributeError: 'ButtonObject' object has no attribute 'select'. Did you mean: 'selected'?
and the object is not deleted.

Highlighting the object and pressing the trashcan icon works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.