Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Profiling Instructions in Spike

82 views
Skip to first unread message

riscv21

unread,
Jan 31, 2024, 11:59:16 PM1/31/24
to RISC-V SW Dev

Hi everyone,

I'm running an executable file on RISCV Linux using the Spike. I'm trying to figure out how many instructions are in that specific executable (excluding Linux itself, just the executable). Unfortunately, I haven't found a straightforward solution yet. If anyone has experience with profiling instructions in Spike, I'd appreciate any advice or recommendations!

Thank you!

Swapnil Agrawal

unread,
May 10, 2024, 4:30:32 AM5/10/24
to RISC-V SW Dev, riscv21
You can use riscv-unknown-elf-objdump to generate the disassembly for the executable. It will have the instructions present in the executable. No need to run the executable in spike to know the instructions present in it.

David Castells Rufas

unread,
Jul 14, 2024, 5:10:32 AM7/14/24
to RISC-V SW Dev, riscv21
Do you mean 1) number of instructions in the executable or 2) executed instructions ?
For the first case , the agarwal answer applies.

For the second case you should be able to do it with CSR counters (INSTRET, etc...)

Reply all
Reply to author
Forward
0 new messages