URL
https://opencores.org/ocsvn/or2k/or2k/trunk
Subversion Repositories or2k
[/] [or2k/] [trunk/] [analysis-bin/] [opcodeanalysis/] [README] - Rev 9
Go to most recent revision | Compare with Previous | Blame | View Log
Opcode analysis program
This program is designed to help look at the frequency of opcodes, and the
occurance of groups of opcodes together.
This can also be done on the command line, but it was felt, at the time a C
program might be a quicker way. 3 hours later, it's not the author's intention
to now try doing this with sed, awk and sort.
The list of instructions/opcodes should be one per line, with a newline at the
end. There is no capability to look at register numbers. An example of
generating suitable input to the program is given below.
At the moment this program only analyses up to quadruples, and is not codeded
in such a way that makes an arbitrary number of instruction groups easily
testable. Fix this if you like.
There are no options when running the program. It will simply spit out a list
of individual opcodes, then list of pairs, triples and quadruples.
Compile the program with
$ make all
Generate a list of opcodes from a large set of code, with the following:
Disassemble an application with:
$ or32-elf-objdump -d app.elf > app.dis
The generate a list of opcodes with
$ grep "l\." app.dis | cut -d '.' -f 2 | cut -d ' ' -f 1 > opcodes
Call the program and pass the file with the list of opcodes as the first
argument. It's best to pipe the output it generates to a file:
$ opcodeanalysis opcodes > opcodes.analsys
Things that might be good:
* Actually verifying the pair/triple/quadruple results are correct/true
* Limiting the output of set results to the first 5/10/20
* Provide an option to perform register analysis, also.
* Generate CSV formatted output
Julius Baxter
14 July, 2010
Go to most recent revision | Compare with Previous | Blame | View Log