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 (>=3.7) 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)

  • 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:

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.5.tar.gz (347.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

yasimavr-0.1.5-cp313-cp313-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.13Windows x86-64

yasimavr-0.1.5-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

yasimavr-0.1.5-cp311-cp311-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.11Windows x86-64

yasimavr-0.1.5-cp310-cp310-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.10Windows x86-64

yasimavr-0.1.5-cp39-cp39-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.9Windows x86-64

yasimavr-0.1.5-cp38-cp38-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.8Windows x86-64

yasimavr-0.1.5-cp37-cp37m-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.7mWindows x86-64

File details

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

File metadata

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

File hashes

Hashes for yasimavr-0.1.5.tar.gz
Algorithm Hash digest
SHA256 f42fb74007990504cf69ca90c89eb8f286e498f9d14cff362cf8115a0ec247d5
MD5 67e89871b4458b9b9ee5e7d450d90aa5
BLAKE2b-256 d0be7cf754b2f711b450e29b68dcc554ab93d76eb6696e4924a75dd9feeb4230

See more details on using hashes here.

File details

Details for the file yasimavr-0.1.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: yasimavr-0.1.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for yasimavr-0.1.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4f3b800e0c6d15355e7eb7db05f9f1e95c36161beff571010ff19f71e3635cf7
MD5 c2878921451653984bf9408c46e3bb50
BLAKE2b-256 dbd07b50b9173cc2321b9c8d6bf2a2fc6bac52b7cb9eed679f03b2be1a2c5c67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yasimavr-0.1.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for yasimavr-0.1.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3ce0492c34b58dc5f7bad0be630867059215a12917cfbe5337f402d3b2c79744
MD5 1fdfb5c1148dc339124737fedafa2254
BLAKE2b-256 41ad659bd78b218fe6b746ec5ceb98d7f3ba9548b1a99466e5ff953dd0f97b3d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yasimavr-0.1.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for yasimavr-0.1.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 31e8b510048a7bc10cbac235d41044dedc53e42da6197b7e1cc6b7bfd471a8d8
MD5 615c9554ac8f8f23f09795ed1312d5c8
BLAKE2b-256 b337d50bebcec3b88a6f1734591be4475027aacaee89a9705313f3d312a39036

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yasimavr-0.1.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for yasimavr-0.1.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 124cb2dde02c287a8d92770eea36a9f11f7aa244b6bd32f808d5055e1a0653b2
MD5 c3b22cb05b0447a9ed5c551b110b4224
BLAKE2b-256 d4cae5a14adb45fd41bfd6894476e0a97c944a3101dc76d04926f372a8b985a2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for yasimavr-0.1.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 39c987d1f7be36615345c8f07193008a6cb11b2307bcbc22d7b13fd11bb6c40c
MD5 501e156a26cbd7e8cc8230b6eb81be74
BLAKE2b-256 fec15671c3a0a485489a74c8e07c6f7291bdda09fc63050cab985ee6664422cb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for yasimavr-0.1.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2351b4d51c30c806839332ece8a1b36e7584b6cf98ceb544d13f273a9be12e44
MD5 99da116142899e41892fa9ded13f8722
BLAKE2b-256 be28fe28387ff93b29d122ae7dbeee3252f548ddcba56dac445cb174c5563b55

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for yasimavr-0.1.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 84e4059503965328e5eb3e2acda71b75b4921894e578f92634e92087a97f9b49
MD5 6d8b163388e99096552d0a97a50d7387
BLAKE2b-256 9395f661cd17067a77511290cf626c93f7bbad577f1422776badf4893a2705db

See more details on using hashes here.

Supported by

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