You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I posted this issue on the riscv-gnu-toolchain, but it probably is better to post it here since it resolves around a possible problem in spike issue on riscv-gnu-toolchain
I'm running into problems with Spike reporting "Bad or missing arguments for command str", which I don't know how to resolve or why this is occurring in a simple hello world program.
The riscv-gnu-toolchain is cleanly build. The RISCV and PATH variable is set in the USER environment only (so using sudo -E). The environment variable are set RISCV=/opt/riscv and PATH includes $RISCV/bin. Compiling is done on Ubuntu 24.04.1 LTS
Getting & Building riscv-gnu-toolchain is done by;
git clone https://github.com/riscv/riscv-gnu-toolchain
cd riscv-gnu-toolchain/
./configure --prefix=/opt/riscv --enable-multilib
sudo -E make
Which results in the riscv64-unknown-elf compiiler/tools in /opt/riscv.
I build pk from the riscv-gnu-toolchain directory with; sudo -E SIM=spike make build-sim
Which results with the spike binaries in /opt/riscv/bin (spike, spike-dasm, spike-log-parser etc.) and pk32, pk64 in /opt/riscv/riscv64-unknown-elf/bin
The sample program;
#include <stdio.h>
int main() {
printf("Hello World!\n");
}
The compile commando for the example program (with intermediate files enabled);
riscv64-unknown-elf-gcc --save-temps -o example example.c
The following command starts the example in spike;
spike -d pk64 example
In spike I run to the address of the jal instruction, display the contents of the a0 register (which should point to the string "hello world" and try to display it. The following is the result;
(spike) until pc 0 101e2
bbl loader
(spike) reg 0 a0
0x0000000000012618
(spike) str 0 12618
Bad or missing arguments for command str
Omitting the core parameter for str commando has the same result. Trying the mem commando to dump the content hexidecimal gives; "0xBad or missing arguments for command mem"
What am I missing/doing wrong or not understanding?
A suggestion was using 0x but that resulted into the same error;
(spike) until pc 0 0x101e2
bbl loader
(spike) reg 0 a0
0x0000000000012618
(spike) str 0 0x12618
Bad or missing arguments for command str
(spike)
The text was updated successfully, but these errors were encountered:
I posted this issue on the riscv-gnu-toolchain, but it probably is better to post it here since it resolves around a possible problem in spike issue on riscv-gnu-toolchain
I'm running into problems with Spike reporting "Bad or missing arguments for command str", which I don't know how to resolve or why this is occurring in a simple hello world program.
The riscv-gnu-toolchain is cleanly build. The RISCV and PATH variable is set in the USER environment only (so using sudo -E). The environment variable are set RISCV=/opt/riscv and PATH includes $RISCV/bin. Compiling is done on Ubuntu 24.04.1 LTS
Getting & Building riscv-gnu-toolchain is done by;
Which results in the riscv64-unknown-elf compiiler/tools in /opt/riscv.
I build pk from the riscv-gnu-toolchain directory with;
sudo -E SIM=spike make build-sim
Which results with the spike binaries in /opt/riscv/bin (spike, spike-dasm, spike-log-parser etc.) and pk32, pk64 in /opt/riscv/riscv64-unknown-elf/bin
The sample program;
The compile commando for the example program (with intermediate files enabled);
riscv64-unknown-elf-gcc --save-temps -o example example.c
The generated assembly;
The disassembly of the executable with riscv64-unknown-elf-objdump --disassemble=main example;
The following command starts the example in spike;
spike -d pk64 example
In spike I run to the address of the jal instruction, display the contents of the a0 register (which should point to the string "hello world" and try to display it. The following is the result;
Omitting the core parameter for str commando has the same result. Trying the mem commando to dump the content hexidecimal gives; "0xBad or missing arguments for command mem"
What am I missing/doing wrong or not understanding?
A suggestion was using 0x but that resulted into the same error;
The text was updated successfully, but these errors were encountered: