HW5 - Generating Simulator Data Files

We will be using real AVR assembly language for our simulator project. In order to generate files we can load into our simulators memory, we need to set up the tools for building those files.

STep 1: Install the AVR tools

In your virtual machine, you will need to install these tools:

$ sudo apt-get install -y gcc-avr iverilog gtkwave

Those last two tools will be needed in future assignments.

Now, download this test file:

Now, use this command to generate a file we could load into a real chip, or into our simulator:

$ avr-gcc -c -mmcu=attiny85 -o sum.o sum.S
$ avr-gcc -mmcu=attiny85 -nostartfiles -o sum.elf sum.o
$ avr-objcopy -O ihex -R .eeprom sum.elf sum.hex

This will produce a hex file we can use to load the simulator instruction memory

Note

We will teach our modular make system to run these commands later.