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

Uploaded Source

Built Distributions

yasimavr-0.0.4-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11 Windows x86-64

yasimavr-0.0.4-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10 Windows x86-64

yasimavr-0.0.4-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9 Windows x86-64

yasimavr-0.0.4-cp38-cp38-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8 Windows x86-64

yasimavr-0.0.4-cp37-cp37m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.7m Windows x86-64

File details

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

File metadata

  • Download URL: yasimavr-0.0.4.tar.gz
  • Upload date:
  • Size: 258.8 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.4.tar.gz
Algorithm Hash digest
SHA256 f1547b4dd5a40d6272c7f10b6e02691b7a29b049f35fb2df19e7ee329d3fa2e6
MD5 0ed4fd295553e05cc3437b5db1039b98
BLAKE2b-256 b6a5800a4b8d59a926fcde16dd05d42de85e2c2e0987f1905ef16bf3f55b1158

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yasimavr-0.0.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fd1f6295816394a9f4d7729bbb2a0255dfd8287a6fc4ade5776280c14b88aca3
MD5 b4f95f3d62fb0b6ee8c554453023f76c
BLAKE2b-256 207ebea2128748b7c729327a993cb9ab833555a72882d679848a5d1c02ee3dcd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yasimavr-0.0.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7baa31b751b29235dd039356d77ed1bee61fcbb4f04dc3c25bdcc9e684172471
MD5 78c82c45afcdd0691fe8f605a63bac47
BLAKE2b-256 03fb4c133ffb40d23883359e88d0974591c73eb070b8ab1aa23761a8c4c93603

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yasimavr-0.0.4-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

Hashes for yasimavr-0.0.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 397900fa405756b26c5c1e8cf8c92ae38169d723521aa92862aaea4871692689
MD5 952344318bad919d17b7c49bd8c9b6c7
BLAKE2b-256 b0cb7bcea1dc205a6cdd05068ad59c571f4e7e592b2968e89d34b7aa49bb1053

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yasimavr-0.0.4-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

Hashes for yasimavr-0.0.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0dde7aea409b01b4b6e383389f2293a9b95be6fbad52b381865840d6fcec1e18
MD5 ab97c83268fce3c1c6070acd895cfda1
BLAKE2b-256 2e297787a8124720a7be2beb4d190dcad98f6ae63e686ab31e5e389ecf59e018

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yasimavr-0.0.4-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

Hashes for yasimavr-0.0.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 75cb2a92e2ee0b05e2c64cf76d583119f77b986f5c240e740cdce66beb5ac349
MD5 52dbe8ea1e154a83134d93df5bad037e
BLAKE2b-256 47d3b9a450b4b4ea6ec06d6230cfac572d950d471254e773df3d1474e8b016ff

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