Missing SOFTCORE/PICO_RISCV/firmware directory and firmware.c in BeagleV-Fire gateware repository

Subject: Missing SOFTCORE/PICO_RISCV/firmware directory and firmware.c in BeagleV-Fire gateware repository

Hello,

I am following the official documentation on How to use PicoRV Softcore on BeagleV-Fire and ran into a discrepancy between the guide and the current main branch of the gateware repository.

In Section 1 (Boot the softcore with firmware) – Step 1, the documentation instructs:

```

Navigate to sources/FPGA-design/script_support/components/SOFTCORE/PICO_RISCV/firmware in the BeagleV-Fire repository.

```

However, in the current beaglev-fire/gateware repository, that path does not seem to exist. Instead, I only see sources/FPGA-design/script_support/components/APU/PICO_RV, and I cannot locate firmware.c, firmware.h, or generatehex.sh inside it.

Could someone clarify:

1. Where firmware.c and the PicoRV32 firmware build scripts have been moved in the current repository structure?

2. How to proceed with compiling and loading custom C firmware for the APU/PICO_RV component?

Thank you for your help!

I could build the bitstream for PicoRV32 softcore. I runned the Microchips toolchain locally. I am not using the GitLab CI to build it.

./build-options/picorv-softcore.yaml is located inside the GSoC 2024 riscv-io-core fork on OpenBeagle, rather than the default main branch of the main BeagleV-Fire gateware repository. [1]

1. Where the Repositories Are Located

  • Repository containing picorv-softcore.yaml and SOFTCORE/PICO_RISCV/firmware: Look in the gsoc/2024/riscv-io-core repository on OpenBeagle (https://openbeagle.org), specifically on the rv32e-test branch (or check its build-options/ folder on main). Because the BeagleBoard PicoRV Softcore Documentation was written around that GSoC 2024 project, its relative path ./build-options/picorv-softcore.yaml sits right in the root of that cloned repository. [1]

  • Official Mainline Gateware Repository (APU/PICO_RV): The mainline BeagleV-Fire Gateware Repository (and its Bitstream Builder wrapper) uses a newer folder structure (APU/PICO_RV) and ships with build-options/default.yaml. [1, 2]

2. How to Clone and Run It Locally

  1. Clone the GSoC riscv-io-core repository (switch to the rv32e-test branch if picorv-softcore.yaml is not on main):
git clone -b rv32e-test https://openbeagle.org/gsoc/2024/riscv-io-core.git

cd riscv-io-core
  1. Verify build-options/ in the root directory:
ls -la build-options/

I could not see picorv-softcore.yaml listed inside build-options/ alongside build-bitstream.py in the current root directory.

But I could find a build option which uses the PicoRB32 softcore:

./custom-fpga-design/my_custom_fpga_design.yaml
---
HSS:
    type: git
    link: https://openbeagle.org/beaglev-fire/hart-software-services.git
    branch: main-beaglev-fire
    board: bvf
gateware:
    type: sources
    build-args: "M2_OPTION:DEFAULT CAPE_OPTION:DEFAULT SOFTCORE_OPTION:PICO_RISCV"

There is the option SOFTCORE_OPTION:PICO_RISCV

The softcore is located on:

./sources/FPGA-design/script_support/components/SOFTCORE/PICO_RISCV/

The firmware is on:

./sources/FPGA-design/script_support/components/SOFTCORE/PICO_RISCV/firmware

where I could edit and compile the firmware.c and main.c to hex using the script generatehex.sh.

3. Run the bitstream build from that root directory: [1]

python3 build-bitstream.py ../custom-fpga-design/my_custom_fpga_design.yaml

The bitstream was built on

./bitstream/LinuxProgramming/

and I could change the gateware (bitstream) in the BagleV-Fire board via the embedded Ubuntu change-gateware.sh script:

sudo /usr/share/beagleboard/gateware/change-gateware.sh ./my_custom_fpga_design

Your recipe is a bit more involved than it could have been,
but you’re right, an SDK for the PicoRV really isn’t in scope for the Gateware project.

The recipe to use is: ./build-options/picorv-apu.yaml.
That will build the exact same thing, but using the current state-of-affairs.

While we appreciate you taking the time to type up a solution,
a better way would have been to amend the current documentation with a PR.

Speaking from experience, no one searches this forum,
so your solution will be all but forgotten in a month or two…

Thanks for your response! I did the PR on the current documentation. Can someone review it?