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
File details
Details for the file yasimavr-0.1.0.tar.gz
.
File metadata
- Download URL: yasimavr-0.1.0.tar.gz
- Upload date:
- Size: 263.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3645e5a2771aaa0976e53466fe1cbc70bfea2a528537346408e92fe3a470d3ff |
|
MD5 | dfda9badd53de7637e1fd6b16d1e4fa6 |
|
BLAKE2b-256 | 378e10d4b083352b361332997ab0807f8a6130e7d1ef87b9a3fe93fc8dc05e89 |
File details
Details for the file yasimavr-0.1.0-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: yasimavr-0.1.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38cb2b877237cdebd58922b3940a2bafc49c576c65cf7a13d5b17381fce8ee46 |
|
MD5 | 043d0618a25707a352549381a3d4dc50 |
|
BLAKE2b-256 | 649366edb80cb03affa533a37b426948b1ab80ea88ca9d6578fb4006007562e1 |
File details
Details for the file yasimavr-0.1.0-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: yasimavr-0.1.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dc2bc3dcb2b20eb9a1657d10acd5b8f7fc5a2501923875b47b9700a1e39a5d6 |
|
MD5 | 704c7450ac71532071d1733f4f00d67e |
|
BLAKE2b-256 | 17c7a6e3caa2324a6e8aa2bb420fadf34bf4fc4f5e1c942e076556db95d89ff9 |
File details
Details for the file yasimavr-0.1.0-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: yasimavr-0.1.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09ce798a19e22319efc5cb6a4153c18fdbcb1c62ba1fd88b56b8d49817d40cfd |
|
MD5 | b900a61d576a6c312f4e33cdd0237550 |
|
BLAKE2b-256 | aaea3ac812b0fcc2277d42331bce3d477bea49973aff3da4010a8341627a41d4 |
File details
Details for the file yasimavr-0.1.0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: yasimavr-0.1.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f46e61bb5d06818f6b83ac083074fd30874101cefec576b27ed29abb9e80f5e4 |
|
MD5 | 279973560ae836cd9f02536c40609af3 |
|
BLAKE2b-256 | f901790a1c7c74d902e6c3a4680a264b108148984d27cd40effd59a5481be59a |
File details
Details for the file yasimavr-0.1.0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: yasimavr-0.1.0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0afcb46ac5d819bace37baf8727cd41ede938e3fb7a7cca64459af61a3fa9aa1 |
|
MD5 | 34b9456d9491e0db3910f7143e94864b |
|
BLAKE2b-256 | db06ca89f2697c623b6ee241d0e6d980c31eca41f1b4dc645a112efa3ecd2fdb |
File details
Details for the file yasimavr-0.1.0-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: yasimavr-0.1.0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 629d190519064d3f9e507bb3df34a2f5f0a0b5adb5768caa20870d0687a3c6d4 |
|
MD5 | e39909be7daf47479a4f0a3d16a7a991 |
|
BLAKE2b-256 | 740374d1aeff4ca9f0e39105dbc4c28ccf3d8b5b62df646e7cb4a13cb4d8d2b2 |