Usage

avrcycles.py temp.avra

Example output:

Total number of cycles: 6
Total number of instructions: 4

Detailed Usage

  • generate disassembly from the .elf file

    avr-objdump -h -S board.elf > board.avra
    
    • -h: list space used by each section
    • -S: output the binary (assembly code) with source code (C code)
  • paste the snippet of assembly to analyze into a file

    • example assembly snippet:

    Note

    I usually call this snippet file temp.avra so I know it’s safe to delete later

    • in the above example, only the four high-lighted lines of code are analyzed

      • the parser in avrcycles.py ignores the first two lines because they are not assembly
      • non-assembly lines are included in the .avra because of the -S flag
  • run avrcycles.py from the command line (e.g., from bash)

    avrcycles.py temp.avra
    
  • example output:

    Total number of cycles: 6
    Total number of instructions: 4