Adding New Program Loaders

Microcontroller programs come in a variety of formats. For example, if the program is written in assembly language, Avrora can load these programs directly without first assembling them to machine code. For programs in higher level languages such as C, they can be compiled to a variety of formats, including ELF, COFF, SREC. In order to support these various input formats, Avrora has a class ProgramReader. Extensions of this class support various formats for loading the program and produce an internal representation of the program that is more suitable for simulation and analysis.

Avrora supports three types of program formats:

  1. The Atmel assembler syntax. Files that end with the .asm extension are assumed to be in this format. Files in this format can be loaded directly by Avrora.
  2. The GNU assembler (GAS) syntax. Files that end with the .s extension are assumed to be in this format.
  3. The output of the avr-objdump utility. Files that end with the .od extension are assumed to be in this format. Avrora cannot directly load ELF or SREC images, therefore binary programs in those formats must be converted to a textual format with avr-objdump. For more information, see the page on objdump.

The -input option selects from the available input formats. The default value is auto, which in itself is simply a program reader that inspects the extension of the filename and choose one of the other loaders. This option also can accept a fully qualified classname as a program loader. For example, -input=mypackage.MyLoader will load and instantiate the mypackage.MyLoader class and pass the rest of the command line arguments.

For more information see avrora.core.ProgramReader in the JavaDOC API.