Skip to main content

yasimavr

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 later XT series (ATmega80x-160x-320x-480x and others) with a possibility to work with older 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 (>=3.9) and PIP

  • For Linux distributions, libelf is required: (for example: 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)

  • ATTinyx4 series (ATTiny24/44/84)

  • ATMega 0-series (ATMega808/809/1608/1609/3208/3209/4808/4809)

  • ATTiny 0-series (ATTiny202/204/402/404/406/804/806/807/1604/1606/1607)

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:

Metadata

Release files for yasimavr 0.1.6

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

Source distribution (sdist)

Source distribution for yasimavr 0.1.6
File Size Uploaded
yasimavr-0.1.6.tar.gz 348.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for yasimavr 0.1.6
File
yasimavr-0.1.6-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
yasimavr-0.1.6-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
yasimavr-0.1.6-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
yasimavr-0.1.6-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
yasimavr-0.1.6-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
yasimavr-0.1.6-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details

Total release size: 11.4 MB

Release files / yasimavr-0.1.6.tar.gz

Download URL yasimavr-0.1.6.tar.gz
Size 348.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3742dae364a8d65ff7d4180d00b40c0901656dafcea6e53e94db1127b7ec6285
BLAKE2b-256 checksum
How to use checksums
5341409b649fc8e01d6cff4bb7acefc8e09b4ff7ccfaf48d1f6a032e5a6f4c11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / yasimavr-0.1.6-cp314-cp314-win_amd64.whl

Download URL yasimavr-0.1.6-cp314-cp314-win_amd64.whl
Size 1.9 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
c434966cf319873fec2c4f9dd33f06f8744ed87cbb3f1c9bea678662a7a4446b
BLAKE2b-256 checksum
How to use checksums
a9305550788de664dca24495c757d89aa18ad9b272cd009b13e66a3cda502da4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / yasimavr-0.1.6-cp313-cp313-win_amd64.whl

Download URL yasimavr-0.1.6-cp313-cp313-win_amd64.whl
Size 1.8 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
5234d6bce5e01d0720d475309a42c764b7ac986cd89eabdb77663bbf1dedcad9
BLAKE2b-256 checksum
How to use checksums
7cd46515047fe5521671c38fcfd4350afdb6f7f860a3a1d2f78652855ac4b1dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / yasimavr-0.1.6-cp312-cp312-win_amd64.whl

Download URL yasimavr-0.1.6-cp312-cp312-win_amd64.whl
Size 1.8 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
2daec3be67afa5442d220b196bccf562a3253442053c901931415c7f9cb74015
BLAKE2b-256 checksum
How to use checksums
c866dad093326c8ccbdea5080a1362c5966ae68018c2bf37f078960efe769c95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / yasimavr-0.1.6-cp311-cp311-win_amd64.whl

Download URL yasimavr-0.1.6-cp311-cp311-win_amd64.whl
Size 1.8 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
a964964a7f7a7b01c40fdf113ac3ffc29be16188bfc4acc5f3bfe8610b9c27b0
BLAKE2b-256 checksum
How to use checksums
dfec30ed866a9fe79cebba87ef2807ddfba62142857af45675fea49368753d30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / yasimavr-0.1.6-cp310-cp310-win_amd64.whl

Download URL yasimavr-0.1.6-cp310-cp310-win_amd64.whl
Size 1.8 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
a1800228d0179aed4d46689877075d51498b59a5b55a029479bdb49bf30e1f44
BLAKE2b-256 checksum
How to use checksums
9ab5ba0cdabe16b100b6cc5f2f6267a00f27cd39d8d98f5c21a67a29c6398113
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / yasimavr-0.1.6-cp39-cp39-win_amd64.whl

Download URL yasimavr-0.1.6-cp39-cp39-win_amd64.whl
Size 1.8 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
66b0c95416f3d485297d83bafca77e55d48734721a672b9595b6e8bd11e94dbf
BLAKE2b-256 checksum
How to use checksums
464b627f68981c34a8a11d0991a272a78dc39f502be9de05b4ff353a3393242c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.6 This release

7 release files

0.1.5

8 release files

0.1.4

8 release files

0.1.3

8 release files

0.1.2

7 release files

0.1.1

7 release files

0.1.0

7 release files

0.0.4

6 release files

0.0.3

6 release files

0.0.2

1 release file

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