Yet Another SIMulator for AVR
Project description
Yet another simulator for Microchip AVR microcontrollers, inspired from simavr
_yasimavr_ is a simulator for AVR 8-bits microcontrollers. It is mainly aimed at the Mega0 and Mega1 series (ATmega80x-160x-320x-480x and others) with a possibility to work with the “classic” series. (ATMega48/88/168/328 and others)
It is composed of 2 layers:
a C++ layer for the core API and the various peripheral simulation models
a Python layer to handle the configuration, utilities, data recording, and external components
Installation
Prerequisites:
Python (version >=3.7) and PIP
For Ubuntu, libelf is required: sudo apt-get install libelf-dev
Install:
execute: pip install yasimavr
The python bindings for the C++ librairies are built with the SIP tool from RiverbankComputing (https://www.riverbankcomputing.com)
Thanks
Quite a few ideas in this software - and even big chunks of code - originate from simavr. (https://github.com/buserror/simavr) Big thanks to the simavr authors for this great tool !
Supported IOs
GPIO
SPI
TWI
USART
Supported Cores
The package includes a predefined set of MCU models:
ATMegaxx8 series (ATMega48/88/168/328)
ATMega 0-series (ATMega808/809/1608/1609/3208/3209/4808/4809)
Other device models can be easily simulated by creating a YAML config file. A template is provided, and the example _atgiga4809_ shows how to load and use a customised device configuration. New simulation models for peripherals can be created in Python or C++ using the provided API.
Features
Real-time/Fast mode : yasimavr can try to sync the simulated time with system time or run as fast as possible
AVR-GDB integration : yasimavr can acts as a GDB backend stub, with support for breakpoints and watchpoints
VCD export : yasimavr can export traces of pin states, GPIO ports, interrupt vectors, memory locations or generic signals in Value Change Dump (VCD) files
MCU dump : at any point of the simulation, yasimavr can create a snapshot of the state of the MCU model, including all registers and memories and save it in a text file.
“Zombie” mode : yasimavr can directly interact with simulated peripherals by acting as the CPU. This is useful to verify customised peripheral models or a test script.
Probing : yasimavr can read/write CPU registers or memories on-the-fly. This is useful to force the firmware into certain branches for example, improving test coverage.
How to use
_yasimavr_ can be used as a Python package to run a prepared simulation script. (See the examples for how it looks like)
It also supports direct command line use:
python -m yasimavr [options] [firmware]
For the list of command line options, execute python -m yasimavr -h
Some simple script examples are available here: https://github.com/clesav/yasimavr/tree/main/examples
Documentation
The documentation is still a work in progress but will be progressively completed. The online version, including an API reference, can be read on the Read the Docs:
[Development documentation] http://yasimavr.readthedocs.io/en/latest/
[Stable documentation] http://yasimavr.readthedocs.io/en/stable/
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for yasimavr-0.1.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5a1e655c469af3c9fcce8e4f31e622a570c966231024225abc2bd5a74a06767 |
|
MD5 | 49ce5f3bcbd6d9e84a7cf9bc1c439203 |
|
BLAKE2b-256 | 7ea85b38fe6b17dfd4e095158d42c74068e9177afaedea6c9821a1ba20a4c004 |
Hashes for yasimavr-0.1.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8e8986aab9a7dfbdcd65ed03a03d4e83d2808b57465b2ae970ed89837d46f90 |
|
MD5 | 9c29c27de3b2a99ad74a275dae84f426 |
|
BLAKE2b-256 | 7bba750b3ef9bf5a5395992e19b8d270bd04f022eacb697fa7cd8c59563f8153 |
Hashes for yasimavr-0.1.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 736ca6412e3b746432a63b02d5c86aed5132598448fa22e57ef04d6063cfa637 |
|
MD5 | 55463722b214a4c96de9b15e9b93a52e |
|
BLAKE2b-256 | 7a9c9f30dd901d12a408ce190911bebef53847bd7787c64ff6c0f381044d5508 |
Hashes for yasimavr-0.1.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35c1ffeff2470d2187beb90ee56e719f287fba289aff813b0ab78caa4084b67b |
|
MD5 | a720da992dd3bcc956d5a0bb9a6958ae |
|
BLAKE2b-256 | bd031216dca5957073f9dbd0efe474259031a08958923727fa091ee27cf17641 |
Hashes for yasimavr-0.1.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 712bb0870331cacf26a1abac46ba5c1f92ddf11a5d8139467b2ce71a35fbd5d5 |
|
MD5 | bec7abba5850df4fcd3701fa3055739b |
|
BLAKE2b-256 | e2add6fa744d13fc5f5cf9644dbbb51b409a54f5918593f5669484b0bc82eaa2 |
Hashes for yasimavr-0.1.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41a3fdcb5a9071de5162260548b855d138c9e01c45e6cd446c696d641c2ec4ad |
|
MD5 | d49af17f6379517a74a4097e84427be5 |
|
BLAKE2b-256 | 97caa4bcfa4498dfd80a007a8e0abf4912284e4672894672620e07c3b341d716 |