C API for riscv32-unknown-elf-gcc


#1

This device is amazing and has so many possibilities.
What I have not yet found is a description of the API used for the firmware.
For example in picosoc that leverages Cliff’s picorv32.
In other words how much of the C language (API) is supported.
Of course it has to then translate into the RISCV processor so I need the API for
riscv32-unknown-elf-gcc.

Thanks
Laurence


#2

Not sure what you mean by “the firmware”. The closest thing that the TinyFPGA BX has to firmware is the bootloader and that is implemented in verilog and has no API.

The PicoSoc example that is included in the TinyFPGA BX repository is built without any of the C run time library, so has essentially none of the C API. That is also true of the variants of PicoSoC we used for the FPGC games console project. This means that a lot of multiply and divide operations are not supported as they use the RTL.

However, it is possible to support a lot more of the C API. For example, icoSoC is compiled with the C RTL and supports a lot more of the C API. It includes a minimal implementation of syscalls.c .

That could be ported to TinyFPGA. It needs a different ld script file.

I think that is pretty complete implementation of C and the Newlib C run time library, so that is nor the limiting factor.

So I believe what limits the API is:

  • What Newlib supports
  • How complete an implementation of syscalls.c you provide
  • Whether your ld script file supports the C standard library
  • Whether you compile with -nostdlib or not

#3

Great explanation
Thank you