Skip to content
/ sweetRV Public

sweetRV 🧁 is a SoC with a minimal RISC-V processor with firmware for IceSugar-Nano FPGA

Notifications You must be signed in to change notification settings

Archfx/sweetRV

Repository files navigation

sweetRV 🧁

This is a fork of femtorv which is directly ported to work on IceSugar-nano FPGA boards. Kudos to the original authors.

docker

Summary

This repository contains RISCV processor that can be packed withing 1200LUTs with rv32i tool chain. There are bunch of firmware examples to try. You can use the docker enronment direclty without installing any dependancies.

Get Started

Docker Image

Sublime's custom image

Follow the steps to build usign the docker environemt. (You should have the docker deamon installed on your system)

  1. Clone the repository
git clone https://github.com/Archfx/sweetRV
  1. Pull the docker image from docker-hub
docker pull archfx/ice40tools
  1. Set the expected location to mount with the container
export LOC=/sweetRV
  1. Run the Docker image
docker run -t -p 6080:6080 -v "${PWD}/:/$LOC" -w /$LOC --name ice40tools archfx/ice40tools
  1. Connect to the docker image
docker exec -it ice40tools /bin/bash

Build the hex file generating tool

g++ -I../../LIBFEMTORV32/ ../../LIBFEMTORV32/femto_elf.c firmware_words.cpp -o firmware_words -fpermissive -DSTANDALONE_FEMTOELF

Build the Binary

Now the environment is ready. Next, we need to compile the firmware. This step will take the assembly files/ c source files and generate a hex file that is the firmware for our processor.

$ cd FIRMWARE/EXAMPLES
$ make hello.hex

This will generate the hex file of the firmware. Next we need to build the hardware with inbuilt firmware. For that follow the below steps from the main folder.

$ make ICESUGAR_NANO

This will produce the file femtosoc.bin at the home folder. You can directly upload this to the FPGA by drag and drop.

Terminal of RV32

Firmware contains different example applications which you can run on your FPGA. In order to talk with processor using UART you need to install a terminal emulator application (screen/picocom).

Below are the steps for the screen terminal to talk with your processor. Use command + a + \ to exit.

  • on Mac
brew  install screen 
/opt/homebrew/Cellar/screen/4.9.0_1/bin/screen /dev/tty.usbmodem102 115200
  • on Ubuntu
apt-get install screen 
screen /dev/ttyUSB1 115200

About

sweetRV 🧁 is a SoC with a minimal RISC-V processor with firmware for IceSugar-Nano FPGA

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published