Project Description

Software engineers should be proficient in their area of expertise and also have overview of adjacent abstraction layers to understand the world in better context. Despite SUSE is not a hardware company, this project aims at implementing a simple RISC-V processor on a hobby FPGA board.

More details are in project repo's README.

Goal for this Hackweek

  • Get familiar with FPGA tools
  • Peek into HDL (hardware definition languages)
  • Design the CPU using SystemVerilog
  • Create a demo program to run on the CPU
  • Run the circuit in a simulator and eventually on the FPGA too
  • Implement some non-trivial features like pipelining or some instruction set extension

Resources

Looking for hackers with the skills:

risc-v fpga clang verilog

This project is part of:

Hack Week 23

Activity

  • about 1 year ago: PPavlu joined this project.
  • about 1 year ago: mkoutny added keyword "risc-v" to this project.
  • about 1 year ago: mkoutny added keyword "fpga" to this project.
  • about 1 year ago: mkoutny added keyword "clang" to this project.
  • about 1 year ago: mkoutny added keyword "verilog" to this project.
  • about 1 year ago: mkoutny started this project.
  • about 1 year ago: mkoutny originated this project.

  • Comments

    • mkoutny
      about 1 year ago by mkoutny | Reply

      We implemented several blocks of the circuitry:

      • control (roughly fetch/decode),
      • register file,
      • ALU,
      • block RAM,
      • memory control (for unaligned access).

      We also implemented memory mapped IO (using serial over USB block provided by TinyFPGA's library).

      Additionally, we made a simple demo program and tooling to cross-compile it on non-RISC-V machine and prepare it to "load" it to FPGA board's memory.

      Every circuit block is accompanied with (simulator) testsuite and they pass \o/ We didn't manage to run the circuit on FPGA, probably because of memory data preloading or cumbersome IO. That will need more debugging in the future. (Hence we also didn't get down to any of the non-trivial features.)

    Similar Projects

    Create openSUSE images for Arm/RISC-V boards by avicenzi

    Project Description

    Create openSUSE images (or test generic EFI images) for Arm and/or RISC-V boards that are not yet supported.

    Goal for this Hackweek

    Create bootable images of Tumbleweed for SBCs that currently have no images available or are untested.

    Consider generic EFI images where possible, as some boards can hold a bootloader.

    Document in the openSUSE Wiki how to flash and use the image for a given board.

    Boards that I have around and there are no images:

    • Rock 3B
    • Nano PC T3 Plus
    • Lichee RV D1
    • StartFive VisionFive (has some image needs testing)

    Hack Week 22

    Hack Week 21

    Resources


    RISC-V emulator in GLSL capable of running Linux by favogt

    Description

    There are already numerous ways to run Linux and some programs through emulation in a web browser (e.g. x86 and riscv64 on https://bellard.org/jslinux/), but none use WebGL/WebGPU to run the emulation on the GPU.

    I already made a PoC of an AArch64 (64-bit Arm) emulator in OpenCL which is unfortunately hindered by a multitude of OpenCL compiler bugs on all platforms (Intel with beignet or the new compute runtime and AMD with Mesa Clover and rusticl). With more widespread and thus less broken GLSL vs. OpenCL and the less complex implementation requirements for RV32 (especially 32bit integers instead of 64bit), that should not be a major problem anymore.

    Goals

    Write an RISC-V system emulator in GLSL that is capable of booting Linux and run some userspace programs interactively. Ideally it is small enough to work on online test platforms like Shaderoo with a custom texture that contains bootstrap code, kernel and initrd.

    Minimum:

    riscv32 without FPU (RV32 IMA) and MMU (µClinux), running Linux in M-mode and userspace in U-mode.

    Stretch goals:

    FPU support, S-Mode support with MMU, SMP. Custom web frontend with more possibilities for I/O (disk image, network?).

    Resources

    RISC-V ISA Specifications
    Shaderoo
    OpenGL 4.5 Quick Reference Card

    Result as of Hackweek 2024

    WebGL turned out to be insufficient, it only supports OpenGL ES 3.0 but imageLoad/imageStore needs ES 3.1. So we switched directions and had to write a native C++ host for the shaders.

    As of Hackweek Friday, the kernel attempts to boot and outputs messages, but panics due to missing memory regions.

    Since then, some bugs were fixed and enough hardware emulation implemented, so that now Linux boots with framebuffer support and it's possible to log in and run programs!

    The repo with a demo video is available at https://github.com/Vogtinator/risky-v


    Tumbleweed on Mars-CM (RISC-V board) by ph03nix

    RISC-V is awesome, Tumbleweed is awesome, chocolate cake is awesome. I'm planning to combine all of them in one project.

    Project Description

    I recently purchased a MILK-V Mars CM and managed to setup it up already using Debian Linux. My project for this Hackweek is to see how far I can get to run Tumbleweed on this compute module board.

    Goal for this Hackweek

    • Run Tumbleweed on the Compute Module

    Resources

    • http://milkv.io/mars-cm
    • https://en.opensuse.org/HCL:VisionFive2


    FizzBuzz OS by mssola

    Project Description

    FizzBuzz OS (or just fbos) is an idea I've had in order to better grasp the fundamentals of the low level of a RISC-V machine. In practice, I'd like to build a small Operating System kernel that is able to launch three processes: one that simply prints "Fizz", another that prints "Buzz", and the third which prints "FizzBuzz". These processes are unaware of each other and it's up to the kernel to schedule them by using the timer interrupts as given on openSBI (fizz on % 3 seconds, buzz on % 5 seconds, and fizzbuzz on % 15 seconds).

    This kernel provides just one system call, write, which allows any program to pass the string to be written into stdout.

    This project is free software and you can find it here.

    Goal for this Hackweek

    • Better understand the RISC-V SBI interface.
    • Better understand RISC-V in privileged mode.
    • Have fun.

    Resources

    Results

    The project was a resounding success add-emoji Lots of learning, and the initial target was met.


    Explore Microchip PIC64GX1000 Curiosity board (riscv64) by a_faerber

    Description

    The Microchip PIC64 family of RISC-V chipsets was announced this summer, with PIC64GX as first subfamily (with SiFive U54 CPU cores, same as Microchip PolarFire). Later families (PIC64-HPSC and PIC64HX) were announced to feature the long-awaited RISC-V Hypervisor Extension.

    My pre-ordered PIC64GX1000 Curiosity board arrived the week before Hackweek 24.

    Goals

    I intend to investigate enabling openSUSE Tumbleweed riscv64 on this new chipset and board.

    Resources

    Progress

    • Created udev rules for Curiosity board's FTDI based debug UARTs on USB-C - UART B has output from HSS / OpenSBI, UART C has output from U-Boot and kernel
    • Modified the image https://download.opensuse.org/ports/riscv/tumbleweed/images/openSUSE-Tumbleweed-RISC-V-JeOS-efi.riscv64-2024.11.10-Build1.13.raw.xz (20241118) with gdisk to prepend a bootloader partition (copying the binary bootloader from the vendor-supplied microSD, ignoring excess partition size) and added the microchip/pic64gx-curiosity-kit.dtb file to the EFI System Partition (again from the vendor-supplied microSD)
    • This boots into Tumbleweed! with ttyS1 by default (UART C)

    Stretch goals

    Investigate also the Microchip PolarFire SoC Discovery board.

    Progress

    The Microchip PolarFire Icicle board and BeagleV-Fire board had previously already been enabled by Torsten Duwe.

    • Additional udev rules needed to be created for its FTDI UART bridge chip.
    • The board ships with a "FIR filter" demo pre-flashed, not exposing any bootloader, only some demo output on UART C. The board will need to be flashed with a Microchip reference design for Linux.
    • The board has an on-board Flash Pro Express JTAG debugger on USB-C. Proprietary Programming and Debug tools software is available from Microchip to download, requiring an account. This should then be able to flash the .job file.
    • An in-progress patchset for OpenOCD is available in Gerrit, not yet in the openSUSE package. Presumably OpenOCD would not support Microchip's .job file format.