URL
https://opencores.org/ocsvn/or2k/or2k/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
| Line No. |
Rev |
Author |
Line |
| 1 |
17 |
julius |
Instruction analysis program
|
| 2 |
|
|
|
| 3 |
|
|
This application reads in a binary list of instructions, and analyses it with a
|
| 4 |
|
|
set of functions looking at various parameters in each instruction.
|
| 5 |
|
|
|
| 6 |
|
|
It has been designed so a different instruction set support can be added.
|
| 7 |
|
|
|
| 8 |
|
|
Right now it's not so user friendly. Everything is hardcoded, and only support
|
| 9 |
|
|
for the OR1K instruction set exists.
|
| 10 |
|
|
|
| 11 |
|
|
Compile the program with:
|
| 12 |
|
|
|
| 13 |
|
|
$ make all
|
| 14 |
|
|
|
| 15 |
|
|
And run a test (it needs the or32-elf- toolchain) with:
|
| 16 |
|
|
|
| 17 |
|
|
$ make test
|
| 18 |
|
|
|
| 19 |
|
|
To run the program itself, just give it a binary blob of instructions (usually
|
| 20 |
|
|
the output of objcopy -O binary).
|
| 21 |
|
|
|
| 22 |
|
|
For instance the Linux kernel ELF can be prepared with the following command:
|
| 23 |
|
|
|
| 24 |
|
|
$ or32-elf-objcopy -O binary -j .text -S vmlinux vmlinux.text.bin
|
| 25 |
|
|
|
| 26 |
|
|
Run it in the program with
|
| 27 |
|
|
|
| 28 |
|
|
$ ./insnanalysis vmlinux.text.bin > vmlinux.insnanalysis
|
| 29 |
|
|
|
| 30 |
|
|
Currently the program will output all appropriate information for each
|
| 31 |
|
|
instruction (ie. only ones with rA, or immediate fields in the instructions will
|
| 32 |
|
|
have reports on those fields.)
|
| 33 |
|
|
|
| 34 |
|
|
|
| 35 |
|
|
|
| 36 |
|
|
TODO:
|
| 37 |
|
|
o Add an easy way to switch between human readable and CSV output
|
| 38 |
|
|
o Figure out how to tack this thing onto a simulator (or1ksim maybe) to give
|
| 39 |
|
|
results of execution when that finishes executing, or just how to get the
|
| 40 |
|
|
simulator to output a binary dump of executed instructions to be fed through
|
| 41 |
|
|
this
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.