-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
risv-gnu-toolchain spike module "Bad or missing arguments for command str" #1597
Comments
The error message is saying that there's something wrong with the arguments passed to the What if you do This part of the Spike sources shows how it parses the Note that it uses this line to convert the string representation of an address to an integer value: And this is where that error is generated if something goes wrong: You might be better asking about this on the Spike repo where people there may know more about this tool and its internal implementation. By the way - shouldn't the first command be |
From what I know, is that the hex address values for these commands str/mem/until etc don't have to be pre formatted with 0x.
Which gives the same result. Indeed a good idea to be asking it on the spike repo. I was assuming that since certain submodules are specifically tagged from their respective repo's that there would be more assurance or testing of the tooling within riscv-gnu-toolchain as a whole. |
Ah, sorry - you are correct -
No - most submodule projects such as Spike/pk are simply taken from upstream as-is. The only difference would be the fact that the DejaGnu based GCC test suite is sometimes run on the actual toolchains. In general, specific questions about such submodule projects are better asked upstream. Questions about how |
Thank you for pointing this out. I did not know this. I have opened up the issue on the correct repo issue on spike repo |
Does it make any difference if you do |
No, in the first message I wrote that omitting the core parameter doesn’t make a difference, so in this case leaving out the ‘0’. |
What if you use Spike's |
I also tried that, see the initial message. |
If both |
I'm digging a bit more into the problem. If the example program is ran without the debug it works and it's able to address the string pointer. However in debug (-d with spike) I now get a "Received trap: trap_load_page_fault" with the newly bumped spike. |
OK - probably better to pursue these issues here (and maybe in additional issues) given that they seem to touch on the minutiae of how Spike operates: |
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?
The text was updated successfully, but these errors were encountered: