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

Subversion Repositories or2k

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

Go to most recent revision | 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
This can also be done on the command line, but it was felt, at the time a C
7
program might be a quicker way. 3 hours later, it's not the author's intention
8
to now try doing this with sed, awk and sort.
9
 
10
The list of instructions/opcodes should be one per line, with a newline at the
11
end. There is no capability to look at register numbers. An example of
12
generating suitable input to the program is given below.
13
 
14
At the moment this program only analyses up to quadruples, and is not codeded
15
in such a way that makes an arbitrary number of instruction groups easily
16
testable. Fix this if you like.
17
 
18
There are no options when running the program. It will simply spit out a list
19
of individual opcodes, then list of pairs, triples and quadruples.
20
 
21
Compile the program with
22
$ make all
23
 
24
Generate a list of opcodes from a large set of code, with the following:
25
 
26
Disassemble an application with:
27
$ or32-elf-objdump -d app.elf > app.dis
28
 
29
The generate a list of opcodes with
30
$ grep "l\." app.dis | cut -d '.' -f 2 | cut -d ' ' -f 1 > opcodes
31
 
32
Call the program and pass the file with the list of opcodes as the first
33
argument. It's best to pipe the output it generates to a file:
34
$ opcodeanalysis opcodes > opcodes.analsys
35
 
36
Things that might be good:
37
* Actually verifying the pair/triple/quadruple results are correct/true
38
* Limiting the output of set results to the first 5/10/20
39
* Provide an option to perform register analysis, also.
40
* Generate CSV formatted output
41
 
42
 
43
Julius Baxter
44
14 July, 2010

powered by: WebSVN 2.1.0

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