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

Subversion Repositories or2k

[/] [or2k/] [trunk/] [analysis-bin/] [opcodeanalysis/] [README] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 julius
                        Opcode analysis program
2
 
3
This program is designed to help look at the frequency of opcodes, and the
4
occurance of groups of opcodes together.
5
 
6 13 julius
It takes input from a file, and generates output to stdout via printf.
7 9 julius
 
8
The list of instructions/opcodes should be one per line, with a newline at the
9
end. There is no capability to look at register numbers. An example of
10
generating suitable input to the program is given below.
11
 
12 13 julius
Two output formats are possible - switchable by the #define DISPLAY options in
13
the C source.
14
1) Human readable output, enabled by uncommenting the DISPLAY_STRING define
15
2) CSV output, enabled by uncommenting the DISPLAY_CSV define
16
 
17 9 julius
At the moment this program only analyses up to quadruples, and is not codeded
18
in such a way that makes an arbitrary number of instruction groups easily
19
testable. Fix this if you like.
20
 
21
There are no options when running the program. It will simply spit out a list
22 13 julius
of individual opcodes, then list of pairs, triples and quadruples, in one of
23
the two formats described above.
24 9 julius
 
25
Compile the program with
26
$ make all
27
 
28
Generate a list of opcodes from a large set of code, with the following:
29
 
30
Disassemble an application with:
31
$ or32-elf-objdump -d app.elf > app.dis
32
 
33
The generate a list of opcodes with
34
$ grep "l\." app.dis | cut -d '.' -f 2 | cut -d ' ' -f 1 > opcodes
35
 
36
Call the program and pass the file with the list of opcodes as the first
37
argument. It's best to pipe the output it generates to a file:
38
$ opcodeanalysis opcodes > opcodes.analsys
39
 
40
Things that might be good:
41
* Actually verifying the pair/triple/quadruple results are correct/true
42
* Provide an option to perform register analysis, also.
43
 
44
 
45
Julius Baxter
46 13 julius
15 July, 2010

powered by: WebSVN 2.1.0

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