OpenCores
URL https://opencores.org/ocsvn/or2k/or2k/trunk

Subversion Repositories or2k

[/] [or2k/] [trunk/] [analysis-bin/] [opcodeanalysis/] [README] - Rev 13

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.

It takes input from a file, and generates output to stdout via printf.

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.

Two output formats are possible - switchable by the #define DISPLAY options in 
the C source.
1) Human readable output, enabled by uncommenting the DISPLAY_STRING define
2) CSV output, enabled by uncommenting the DISPLAY_CSV define

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, in one of
the two formats described above.

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
* Provide an option to perform register analysis, also.


Julius Baxter
15 July, 2010

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.