Closed Rahul-Kande closed 4 years ago
@Rahul-Kande :
Did you setup the RISC-V toolchain per the instructions in the README.md file? Including setting of the RISCV environment variable...
Our co-simulation environment (v2.3) currently assumes that the RISCV toolchain is installed in /opt/RISCV... so I would put it there for now.
Yes, I did. I dont think that is the issue. Because, if I write a normal C program in my test function, it runs successfully. It only throws an error when I have asm instructions in the test function.
For RISC-V inline assembly, surround your code with the following:
asm volatile ("addi x0, x0, 0");
Otherwise, the cosim build process will try to compile the code for both BFM and baremetal modes which are x86 and RISC-V respectively. If the assembly isn't valid for BOTH instruction sets, you'll have an issue. The valid mode defines are: BARE_MODE LINUX_MODE BFM_MODE
that worked!
Thank you very much :)
Hello,
I am trying to add my custom bare-metal test to cosim. But, if I use asm instructions in my test function, the 'make' command is throwing the following error.
I think it is trying to compile my test function with the x86 g++ instead of riscv-g++ and hence is not able to recognize the riscv asm instructions. I don't understand why the test has to be compiled with the x86 g++. Is there a way I can bypass this and compile only with riscv-g++ ?
Please help me resolve the issue.
Thanking you in advance