Usage¶
avrcycles.py temp.avra
Example output:
Total number of cycles: 6 Total number of instructions: 4
Detailed Usage¶
generate disassembly from the
.elffileavr-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.avraso I know it’s safe to delete laterin the above example, only the four high-lighted lines of code are analyzed
- the parser in
avrcycles.pyignores the first two lines because they are not assembly - non-assembly lines are included in the
.avrabecause of the-Sflag
- the parser in
run
avrcycles.pyfrom the command line (e.g., from bash)avrcycles.py temp.avra
example output:
Total number of cycles: 6 Total number of instructions: 4