buserror/simavr logo

buserror/simavr

Free

simavr is a lean, mean and hackable AVR simulator for linux & OSX

FreeFree tier
Type
Open Source

About buserror/simavr

simavr is a lean, mean and hackable AVR simulator designed for Linux and OSX, but usable on any platform with avr-gcc. It loads ELF files directly and supports multipart HEX files. The core is stable for AVR parts with up to 128KB flash, with preliminary support for larger devices. simavr emulates a wide range of I/O peripherals including EEPROM, watchdog, IO ports, timers (8 and 16-bit), UART with TX/RX interrupts, SPI (master/slave), I2C (master/slave), external interrupts, ADC, and self-programming (bootloaders). It includes many emulated cores such as ATmega2560, AT90USB162, ATmega1281, ATmega1280, ATmega128, ATtiny series, and more. Extras include fully working GDB support, VCD (Value Change Dump) output for waveform analysis with gtkwave, and the ability to source VCD files from external tools. It supports running real-life firmware examples with OpenGL rendering and has Arduino support (no IDE integration). Installation is available via Homebrew on OSX and apt on Ubuntu, or by building from source with make.

Key Features

Loads ELF files directly and supports multipart HEX files
Stable AVR core for parts up to 128KB flash with preliminary larger support
Emulates EEPROM, watchdog, IO ports, timers (8/16-bit), UART, SPI, I2C, external interrupts, ADC, and self-programming
Emulated cores include ATmega2560, AT90USB162, ATtiny series, and many more
Fully working GDB support with passive modes
VCD (Value Change Dump) output for waveform analysis with gtkwave
Can source VCD files from external tools for feeding into simulation
Arduino support (no IDE integration)
Installable via Homebrew (OSX) and apt (Ubuntu), or build from source

Pros & Cons

Pros
  • Lean and hackable codebase, easy to extend or customize
  • Supports a wide range of AVR microcontrollers
  • GDB integration enables powerful debugging capabilities
  • VCD output allows precise timing analysis with gtkwave
  • Command-line interface works well in automated workflows
  • Free and open source (MIT license)
  • Active community with patches welcome via GitHub pull requests
Cons
  • No built-in graphical IDE or Arduino IDE integration
  • Stable only for parts with 128KB flash; larger parts have preliminary support
  • Documentation is primarily the README and wiki, may require self-study
  • Primarily developed for Linux and OSX; Windows support depends on avr-gcc toolchain
  • No official release package for all platforms (e.g., Windows)
  • Provided 'AS IS' with limited formal support

Best For

Prototyping and testing AVR firmware without physical hardwareDebugging AVR applications with GDB integrationAnalyzing timing and behavior with waveform output (VCD)Running complex firmware examples like OpenGL display renderingSimulating bootloaders and self-programming scenariosEducational use for learning AVR microcontroller internals

FAQ

What file formats does simavr support for firmware?
It loads ELF files directly and supports multipart HEX files.
Can simavr be used for debugging?
Yes, it includes fully working GDB support with passive modes for debugging.
How can I visualize simulation data?
simavr can output VCD (Value Change Dump) files that can be plotted with tools like gtkwave.
Is there Arduino support?
Yes, simavr supports running Arduino firmware, but there is no IDE integration.
How do I install simavr?
On OSX via Homebrew (brew install --HEAD simavr), on Ubuntu via apt (apt-get install simavr), or by building from source with make.
Which microcontrollers are emulated?
Many AVR cores are emulated including ATmega2560, AT90USB162, ATtiny13/25/45/85, and more; adding new ones is easy.