Guidance on how to start

(Ty) #1

I’m super excited about a fully open platform but I’m a little lost and very new to the embedded development workflow. I have been looking through the Risc V and SiFive websites trying to work out how to start with writing system code for the HiFive Unleashed. I want to start with the 2nd stage boot loader and work up to a simple operating system. Funds are a big constraint - this is a learning journey for me, not a job. Although the experience I gain may change that in the long run.

I want to work on a multi-core 64 bit platform. The U540 and HiFive Unleashed look fantastic. Unfortunately, the $1000USD price tag of the HiFive Unleashed and the much higher price of the FPGA development board mean they aren’t an option. I have access to some reasonably well spec’s computers so I’m hoping software simulation is viable.

Is anyone successfully doing software simulation to write this kind of software? I don’t mind if it runs at 10% of the speed of the real thing; as long as it accurately simulates the real thing.

When I look at the Risc V website it has a long list of simulators. However, only Imperes/OVPSim and QEmu call out support for SiFive specifically. What software actually works well in practice and has good getting started information/community?

OR am I just a bit naive and I can’t really do what I want to without hardware?


(Jim Wilson) #2

qemu can boot linux kernels, and get you to user mode where you can do application work. qemu is faster than spike, but can be harder to debug because it uses a jit to get speed.

spike, aka riscv-isa-sim, can also boot a linux kernel, but doesn’t support devices, so it isn’t useful for application level work. It is OK for low level OS work though, slower than qemu, but you can get instruction traces from may be helpful.

As for OS work, that is a complex topic. You might want to try looking at any of the many OS ports, there are linux and BSD ports, and also multiple RTOS ports like Zephyr and FreeRTOS.

There is also riscv-tests which is meant to be used with spike. Since these tests run directly without an OS, they have source code showing how to initialize a processor so you can run code.

SiFive has freedom-e-sdk which is for embedded development, and also shows how to run code directly on hardware without an OS.

(Ty) #3

Thanks for the great advice. I appreciate the help.

I went through the OVPsim website content and videos and it looks like a nice integrated environment. I am also reading the risc v ISA documents and the Berkeley Boot Loader source.

I think I’ll also have a look at the bootloaders for the ports you mentioned as well.