All Projects → hsoft → Icemu

hsoft / Icemu

Licence: lgpl-3.0
Emulate Integrated Circuits at the logic level

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Icemu

List of robot electronics
A curated list of awesome open source electronic resources for robotics
Stars: ✭ 106 (-6.19%)
Mutual labels:  electronics, embedded
gdbstub
An ergonomic and easy-to-integrate implementation of the GDB Remote Serial Protocol in Rust, with full no_std support.
Stars: ✭ 158 (+39.82%)
Mutual labels:  embedded, emulation
oic
Open Instrument Control
Stars: ✭ 40 (-64.6%)
Mutual labels:  embedded, electronics
Routersploit
Exploitation Framework for Embedded Devices
Stars: ✭ 9,866 (+8630.97%)
Mutual labels:  embedded
Cargo Embed
a cargo extension for working with microcontrollers
Stars: ✭ 100 (-11.5%)
Mutual labels:  embedded
Embedos
EmbedOS - Embedded security testing virtual machine
Stars: ✭ 108 (-4.42%)
Mutual labels:  embedded
Rinside
Seamless embedding of R in C++ programs
Stars: ✭ 112 (-0.88%)
Mutual labels:  embedded
Slowpoke
Low-level key/value store in pure Go.
Stars: ✭ 98 (-13.27%)
Mutual labels:  embedded
Wolfboot
wolfBoot is a portable, OS-agnostic, secure bootloader for microcontrollers, supporting firmware authentication and firmware update mechanisms.
Stars: ✭ 110 (-2.65%)
Mutual labels:  embedded
Unqlite
An Embedded NoSQL, Transactional Database Engine
Stars: ✭ 1,583 (+1300.88%)
Mutual labels:  embedded
Espway
Segway-like robot implemented on ESP8266
Stars: ✭ 109 (-3.54%)
Mutual labels:  electronics
Susi linux
Hardware for SUSI AI https://susi.ai
Stars: ✭ 1,527 (+1251.33%)
Mutual labels:  embedded
Embassy
Rust Embedded async executor and HALs
Stars: ✭ 100 (-11.5%)
Mutual labels:  embedded
Mjs
Embedded JavaScript engine for C/C++
Stars: ✭ 1,547 (+1269.03%)
Mutual labels:  embedded
Mfixedpoint
MFixedPoint is a header-only fixed-point C++ library suitable for fast arithmetic operations on systems which don't have a FPU (e.g. embedded systems).. Suitable for performing computationally intensive operations on a computing platform that does not have a floating-point unit (like most smaller embedded systems, such as Cortex-M3, CortexM0, ATmega, PSoC 5, PSoC 5 LP, PSoC 4, Arduino platforms e.t.c). Common applications include BLDC motor control and image processing. Best performance on a 32-bit or higher architecture (although 8-bit architectures should still be fine).
Stars: ✭ 100 (-11.5%)
Mutual labels:  embedded
Button2
Arduino Library to simplify working with buttons. It allows you to use callback functions to track single, double, triple and long clicks. It also takes care of debouncing.
Stars: ✭ 109 (-3.54%)
Mutual labels:  embedded
Libreelec.tv
Just enough OS for KODI
Stars: ✭ 1,358 (+1101.77%)
Mutual labels:  embedded
Linux Embedded Hal
Implementation of the `embedded-hal` traits for Linux devices
Stars: ✭ 105 (-7.08%)
Mutual labels:  embedded
Sod
An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)
Stars: ✭ 1,460 (+1192.04%)
Mutual labels:  embedded
Neat Genetic Mario
Update of Seth Bling's MarI/O
Stars: ✭ 112 (-0.88%)
Mutual labels:  emulation

ICemu - Emulate Integrated Circuits

icemu is a C library that emulates integrated circuits at the logic level. Its goal is to facilitate the debugging of software being written for microcontrollers being plugged into the emulated circuit.

Yup, that's it! With a few shims, you can take the code that targets your MCU and run the exact same code in an emulated circuit, on your computer. In the simulation, you can:

  • See the state of every pin in the circuit.
  • Pause the simulation.
  • Slow the simulation down.
  • Advance time "step by step".
  • Add triggers on some pins and make the simulation stop when the pin state change.
  • Run multiple programs on multiple MCUs in the same simulation.
  • Wire simulated pins to FTDI devices (see examples).

By testing the soundness of your software before sending it to the MCU, you can save significant setup time and do introspection that you couldn't do on your hardware. Of course, the simulation will always be an approximation, but it's still a good first step to weed out oubvious bugs before debugging the really hairy stuff.

See it in action

Here's a little video of the simulated seg7 example (see examples folder):

asciinema

and here is the video of the exact same code running in real life!

vimeo

Comparison with Verilog/VHDL

Being new to the world of electronics, I don't know much about full blown simulation solutions. However, from what I read about Verilog and VHDL, these tools seem to be about helping to design circuits.

ICemu's goal is not that! Its goal is to help you debug the software you're going to flash on your MCU. You can, with a little abstraction layer, directly run your code on the simulator and debug it there.

What I've read about simulations on Verilog/VHDL simulators is that you supply it with a series of inputs you want to send to your circuits. That's insufficient! What I want to do is run my whole, complex software and have it supply the inputs and react to the outputs of my simulated circuit.

There's a possibility that my newbie-ness made me create a tool that already exists, however, and if that happened, please tell me so I can stop working on useless tools.

Where's the Python implementation?

icemu was initially written in Python. I underestimated how quickly speed would become an issue and, soon enough, it was. I rewrote the whole thing in C. The old python implementation is still available in the python branch of the repo.

Requirements

  • C compiler
  • GNU autoconf
  • GNU make
  • pkg-config
  • ncurses
  • CUnit for tests
  • libftdi for an FTDI interface (optional)

How to use

For now, the API is not stable so it's not a library meant to be installed. What you're going to do is to add icemu as a subrepo and build it along with your project. You can look at the examples folder for example, or at my seg7-multiplex for a real-world integration example.

To build, run:

$ autoreconf
$ ./configure
$ make

Then, you need to recreate your prototype's logic along with IO shims in a small C program that uses icemu and configure it with your program's runloop. Again, look at examples.

Once ./configure has run, you can build all examples by cding into examples and run make.

Examples

There are examples in the examples folder. Follow instructions in the README file of each example.

Documentation

Documentation is in the header files of the source. sim.h, pin.h and chip.h are good starting point after having looked at the examples.

License

LGPLv3, Copyright 2018 Virgil Dupras

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].