Skip to main content

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:

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

yasimavr-0.1.2.tar.gz (307.3 kB view details)

Uploaded Source

Built Distributions

yasimavr-0.1.2-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12 Windows x86-64

yasimavr-0.1.2-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11 Windows x86-64

yasimavr-0.1.2-cp310-cp310-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10 Windows x86-64

yasimavr-0.1.2-cp39-cp39-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9 Windows x86-64

yasimavr-0.1.2-cp38-cp38-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.8 Windows x86-64

yasimavr-0.1.2-cp37-cp37m-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.7m Windows x86-64

File details

Details for the file yasimavr-0.1.2.tar.gz.

File metadata

  • Download URL: yasimavr-0.1.2.tar.gz
  • Upload date:
  • Size: 307.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for yasimavr-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1f0e88a3dbe5ca3298fa709dfd6b1843218651612b44de93a0a968dcd873b86d
MD5 b53e7f41dee32464abdb5451a1530bec
BLAKE2b-256 33ac8620ebc359a4cf946a779f19eede67a2ee2641b856b9f3837769c904ef89

See more details on using hashes here.

File details

Details for the file yasimavr-0.1.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for yasimavr-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f47a7c00adbece6fdc4e30948544cb141acbafd07de56f2e77913efa2696b714
MD5 3c292e39580ce9d73b108b3f5ee7cc5f
BLAKE2b-256 c9c28a858aec009996992525fc20b8efc94ed1d7b02762f94a2c0633fedb25d6

See more details on using hashes here.

File details

Details for the file yasimavr-0.1.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for yasimavr-0.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 af516f09b5b20419705dc71e07ec4f0a406721aef6e77ed8eb16c713477bfad1
MD5 2df0d70ad0e01a4d6a2f55d498534de3
BLAKE2b-256 d108f102dbabcd3b624f1337dbabfc6133ad8282f9ea60ce457f136844f617db

See more details on using hashes here.

File details

Details for the file yasimavr-0.1.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for yasimavr-0.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d8a871a89ac7d7ccbf222a10dbc4f53e1e3d4ee75cc6df5905931adf2d8c49b8
MD5 733c850c6013ef266a3588c20ec86493
BLAKE2b-256 0abe6e898cceeb7dda96fbc2c5d98b0bb24df9ff90c2859381e3506eb6d0151f

See more details on using hashes here.

File details

Details for the file yasimavr-0.1.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: yasimavr-0.1.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for yasimavr-0.1.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e78af8a511b96eaf2cb29ca402e9d9b1e61f768e0c97274fbe1713a413433ba2
MD5 c220c9c6208347a0e5c899cfc1e2425e
BLAKE2b-256 540ce583ea9a6194b89c5b08b72c6949f9a462d2b84682f857b79f2089a99cb5

See more details on using hashes here.

File details

Details for the file yasimavr-0.1.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: yasimavr-0.1.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for yasimavr-0.1.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 921a9b9c7ae9dcc2b31b83acf7d0ba1ab765f27f5d939ca9734bdc7a6fe7e978
MD5 bd21e9e9ec49de5ccf494ac2a8386c3e
BLAKE2b-256 cef3dcb14db9da798a47175e6aa0918b2905692c48ad021a49e517ee14f65d0e

See more details on using hashes here.

File details

Details for the file yasimavr-0.1.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: yasimavr-0.1.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for yasimavr-0.1.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 fe4adb25db806ddd18ce84c2d9815a2bdbe027da591dd4ccf44f20a36b88b124
MD5 75f7564404092b8d9bc374b75a42bad6
BLAKE2b-256 2654491ca864fa994fd690b06df9f2aaff22a4aebd7de9d5b4f51e9464724156

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page