Learn with SHAKTI

Debugging a ASM Program with spike


Interactive Debugging Mode


Let us debug example.elf present inside spiking folder.

make command is used to generate the executables for all the C and Assembly Programs hosted inside the spiking folder,

To invoke interactive debug mode, launch spike with -d:

Note : Press Enter key, to advance by one instruction.


Commands


To see the contents of an integer register (0 is for core 0):

To see the contents of a floating point register as Single precision:

To see the contents of a floating point register as Double precision:

To see the contents of a memory location (physical address in hex):

To see the contents of memory with a virtual address (0 for core 0):

You can execute till the desired instruction using the UNTIL command:

Note: Use objdump to find the address of the required instruction


Debugging


At any point during execution (even without -d), you can enter the interactive debug mode with <control>-<c>.

To end the simulation from the debug prompt, press <control>-<c> or