cva6
cva6 copied to clipboard
Problems when simulating multiple .c files
I want to simulate an XTS-AES implementation in C on the CV32A65X. I followed the entire tutorial and used the supplied commands to build the RISC-V toolchain. Everything worked without any problems. I can successfully simulate the 'hello_world' test. Now, I want to simulate a test case spread over multiple .c files, where 'mainTest.c' is the main file. How do I do that? Below is my best attempt, along with the error message that I received, which suggests that I made a mistake in the command: python3 cva6.py -v --target cv32a65x --iss $DV_SIMULATORS --iss_yaml cva6.yaml --c_tests ../tests/custom/C_Code/mainTest.c --linker ../../config/gen_from_riscv_config/linker/link.ld --gcc_opts="-static -mcmodel=medium -fvisibility=hidden -nostdlib -Wno-incompatible-pointer-types -Wno-implicit-function-declaration -nostartfiles -g ../tests/custom/common/crt.S -lgcc -I..tests/custom/common -I..tests/custom/env -I..tests/custom/C_Code". `
[output_file.txt] (https://github.com/user-attachments/files/20409533/output_file.txt).
Thanks in advance for any assistance!
Take a look at dhrystone.sh It is a multiple file benchmarks.
Thank you! That seems very promising. However, I'm still having problems that I can't resolve or understand.
I wrote a custom script based on the link you provided:
xts-sim.txt (https://github.com/user-attachments/files/20440554/xts-sim.txt).
After much trial and error, I am getting the following output (for instance, I allowed the standard library, etc.). [output.txt] (https://github.com/user-attachments/files/20440535/output.txt).
There might be an obvious solution, but I'm way out of my depth since I'm new to cross-compiling, etc. Any further hints would be much appreciated!
Your output.txt file suggests that your RISC-V compiler is installed at "/path/to/riscv-toolchain/bin/" . Please confirm if you really have the toolchain installed there.
Once that is sorted, take a step back. Try a simple program with just two C files and a header : test1.c , test2.c and test.h
test2.c : Define a demo() function that does some simple arithmetic or printf operation. Include test.h
test.h : Declare the demo() function you have defined above.
test1.c : This is your main file. Put the main function here and call demo() inside it. Include test.h.
Try running this example first. You may encounter issues with optimizations, linking and other stuff that needs to be resolved with this basic example before moving to more complex programs.
👋 Hi there!
This issue seems inactive. Need more help? Feel free to update us. If there are no updates within the next few days, we'll go ahead and close this issue. 😊