Skip to main content

Yet Another SIMulator for AVR

Project description

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

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

Uploaded Source

Built Distributions

yasimavr-0.0.3-cp311-cp311-win_amd64.whl (795.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

yasimavr-0.0.3-cp310-cp310-win_amd64.whl (795.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

yasimavr-0.0.3-cp39-cp39-win_amd64.whl (795.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

yasimavr-0.0.3-cp38-cp38-win_amd64.whl (793.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

yasimavr-0.0.3-cp37-cp37m-win_amd64.whl (793.2 kB view details)

Uploaded CPython 3.7m Windows x86-64

File details

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

File metadata

  • Download URL: yasimavr-0.0.3.tar.gz
  • Upload date:
  • Size: 246.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for yasimavr-0.0.3.tar.gz
Algorithm Hash digest
SHA256 fb60a13b990e4c2ba416e06ebb0c176efceb1bc728f2e32d90366f180822c681
MD5 255d3947bbbabe5421eb39c21e32da69
BLAKE2b-256 29e6b3a5b704798b601f0e02083db3167f0de6d578c547df2c19bca166e0e992

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yasimavr-0.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0110427f8e0c18f163d57cd5330678194baefe91ae80f4364a16ddcb8cc33278
MD5 b039543ebe63e143e99674c106966f66
BLAKE2b-256 aac5e1f35b5ef3b39e85da5ac26f9cc670d43ba585e1fbfe197f25cf1ec1cf5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yasimavr-0.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3a6fe89715ae8412f5713b38c664c503f6efeb15d558a1096ac5f5c2d2702db7
MD5 56f849df38f9615ca83a0a177998ce62
BLAKE2b-256 a6d3a9c3bffa92055f1fa54e199a14b7ad04e453bbfcf43856cc13b675cf30a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yasimavr-0.0.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 795.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for yasimavr-0.0.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 3c6a9f3db1cc01f79817c84e82ea57e786b0699e8afe2021675b5316399cedf7
MD5 7ba8a9826fcbd2890b6ca97234e908f5
BLAKE2b-256 025feee47645c2fb05f72f367003883f8faca5413bad5b65b143e6cf347c7ec5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yasimavr-0.0.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 793.8 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for yasimavr-0.0.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c4950ee058462269613a00d85c7c4955cec071b759cf9a72304da628833a5442
MD5 1528340afb55b50fb9302baf943cd112
BLAKE2b-256 d8786e32890cb766144c8acb7d1033a654165d96267beeb83de9ffac3e1ebdc8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yasimavr-0.0.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 793.2 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for yasimavr-0.0.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 0c0810249f66be3d80f3be214787b84d9627a6695320d599766a17b3b1cefd03
MD5 71d56a8cc822f0f8c660f621f07e94dc
BLAKE2b-256 d68dbc4553e7454e09fbe50fcd19390d74d496d3e2cbb881b10df35289aa34eb

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