-
Notifications
You must be signed in to change notification settings - Fork 103
en test how to compile and run your program
Susumu Mashimo edited this page Feb 4, 2020
·
8 revisions
- Make sure RSD is correctly compiled by
make -f Makefile.verilator.mk
.- Tested environment
- Verilator 4.026 2020-01-11 rev v4.026-2-g0c6c83e
- GCC 6.5.0 (x86-64)
- GCC 8.1.0 (RISC-V)
- Tested environment
1. Open Verification/TestCode/Makefile.inc and update the version number of gcc to the version you are using.
- example (I'm using 8.1.0):
LIBGCC = \ -L$(RSD_GCC_NATIVE)/../lib/gcc/riscv32-unknown-elf/8.1.0 \ -lgcc \ -lgcov \ -L$(RSD_GCC_NATIVE)/../riscv32-unknown-elf/lib \ -lm
- This step is required for now but we will fix it soon.
- Note that the YourTest directory must be in Verification/TestCode/C.
- Note that RSD does not support printf at this time.
- See Verification/TestCode/C/HelloWorld/code.c to learn how RSD currently outputs characters.
4. Modify Verification/TestCode/C/YourTest/serial.ref.txt so that this file has the expected output of your test code.
5. If you add any source code file except for code.c, add them in the SRCS variable in Verification/TestCode/C/YourTest/Makefile.
cd Verification/TestCode/C/YourTest
make
- This command will compile YourTest and generate code.hex in Verification/TestCode/C/YourTest.
8. Go back to $RSD_ROOT/Processor/Src, open Makefile.verilator.mk, and modify the TEST_CODE variable as below.
TEST_CODE = Verification/TestCode/C/YourTest
make -f Makefile.verilator.mk run