Open Aravindh-Swaminathan opened 2 years ago
Removing -flto
here seems to be the intermediate fix for the demo to work on Rocket.
While this does work it also breaks some other stuff. The real issue is that the version of the toolchain that you and I were using is broken. Update your toolchain to a more recent on like this and it should work again.
Thanks @developandplay, we can now probably close this issue. @Aravindh-Swaminathan: If you still have troubles, please re-open.
Hi @developandplay , I tried your solutions in the following order. 1) Updated the riscv-gnu-toolchain to the latest one (for ubuntu 20.04 version) and checked. The demo application code did not run after Liftoff 2) Removed the -flto flag from common.mak file and tried again. The demo application code runs perfectly fine.
From this we can say riscv-gnu-toolchain might not be the issue. Kindly advise.
Thanks.
Did you compile both the BIOS and the demo application code with the new toolchain? For me it would only work if both of them use the latest toolchain.
@developandplay Yes! I did compile both BIOS and demo application using latest toolchain only since I did not want to leave anything to chance. Still did not work . However, I will try that once again and post back here if there is any change.
Hi @developandplay , I have reverified from my end.
Just checked again myself. Sorry, I guess I was the one using a demo.bin
without -flto
.
I just edited the Makefile
for the demo.bin
to not use -flto
.
@Aravindh-Swaminathan Could you check that https://github.com/enjoy-digital/litex/pull/1259 works for you?
@enjoy-digital Could removing -flto
from the demo Makefile break something else?
Hi @developandplay , Checked with #1259 as per your suggestion and it works perfectly fine. Thanks!
Generation of bit stream.
litex-boards/litex_boards/targets/xilinx_ac701.py --build --cpu-type rocket --cpu-variant linux4 --sys-clk-freq 50e6 --with-ethernet
--> Bitstream generated successfully --> BIOS running on Hardware successfully. All test cases passed including SDRAM. Generation of demo.bin (baremetal)litex_bare_metal_demo --build-path=./
Issues facedRelocation truncated error
Resolved the above error by adding the following flag here, after line number: 120
flags += "-mcmodel=medany"
undefined referece to plic_init
The above error was resolved by replacing the isr.c file from https://github.com/enjoy-digital/litex/blob/master/litex/soc/software/bios/ to https://github.com/enjoy-digital/litex/blob/master/litex/soc/software/demo/
After the above 2 issues were resolved, demo.bin was generated. Loading demo.bin via lxterm via serial port to AC701 hardware
sudo lxterm /dev/ttyUSB1 --kernel demo.bin --kernel-adr 0x80000000
LogsAfter Liftoff, unable to get any output from demo.bin Kindly help to look into this issue. Note: The demo.bin works perfectly fine in the same hardware for vexriscv cpu. Issue is faced only while using rocket cpu. Thanks in advance