im-tomu / fomu-toolchain

A collection of tools for developing for Fomu
78 stars 11 forks source link

Support for building toolchain to run on ARM (Raspberry Pi) #29

Open jdimpson opened 2 years ago

jdimpson commented 2 years ago

Feature Request: I'd love it if the toolchain could be built/run on a Raspberry Pi. Then I'd have a a mini build environment for a micro FPGA. I'm going to dig into what this entails, but one question I already ahve is, where does the RISC-V cross compiler come from? I see that build.sh has a URL to download a precompiled x86_64-hosted GCC from "static.dev.sifive.com" but I don't know where that project is to be found. Thanks!

xobs commented 2 years ago

I built it on a Novena ages ago because it was faster than a Raspberry Pi. With recent versions of the Pi that is no longer the case, so I'm glad you're revisiting this.

The toolchains here come from sifive, which are built using https://github.com/sifive/freedom-tools . If you build using those scripts, be very aware that you must build using multilib. By default they build riscv64 only, which won't give you the libc for riscv32.

Alternately, the xpack builds are rather nice: https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack

umarcor commented 2 years ago

@jdimpson the examples in fomu-workshop do not require this specific toolchain. It is provided for convenience, so that less experienced users can just extract a tarball/zipfile and have "everything ready to use". In workshops, a USB might be provided to reduce bandwidth usage.

Nevertheless, you can install the tools as you wish. CI in fomu-workshop shows 4 different approaches:

In fact, fomu-toolchain is based on fpga-toolchain, which seems to be superseeded by oss-cad-suite-build (includes arm and arm64 releases). You can find other packaging solutions in hdl/packages.

As long as you have the tools available in the PATH, the makefiles/scripts in fomu-workshop should work.