• This repository has been archived on 02/Mar/2021
  • Stars
    star
    1,058
  • Rank 43,617 (Top 0.9 %)
  • Language
    Scala
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Source files for SiFive's Freedom platforms

Freedom

Attention - As of March 1 2021, SiFive is archiving the freedom repository. The code here is not being actively maintained, and we can't continue to provide updates while the fpga boards, software ecosystems and other dependencies change.

This repository contains the RTL created by SiFive for its Freedom E300 and U500 platforms. The Freedom E310 Arty FPGA Dev Kit implements the Freedom E300 Platform and is designed to be mapped onto an Arty FPGA Evaluation Kit. The Freedom U500 VC707 FPGA Dev Kit implements the Freedom U500 Platform and is designed to be mapped onto a VC707 FPGA Evaluation Kit. Both systems boot autonomously and can be controlled via an external debugger.

Run the following commands to clone the repository and get started:

$ git clone https://github.com/sifive/freedom.git
$ cd freedom

#Run this command to update subrepositories used by freedom
$ git submodule update --init --recursive

Next, read the section corresponding to the kit you are interested in for instructions on how to use this repo.

Software Requirement

After installing Ubuntu/Debian

Do not forget updating all packages.

sudo apt update
sudo apt upgrade

Install required additional packages.

sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev python wget

sudo apt-get install default-jre

Install sbt, varilator and scala which are required for building from Chisel

Build and install sbt.

echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
sudo apt-get update
sudo apt-get install sbt

Build and install varilator.

sudo apt-get install git make autoconf g++ flex bison
git clone http://git.veripool.org/git/verilator
cd verilator
git checkout -b verilator_3_922 verilator_3_922
unset VERILATOR_ROOT # For bash, unsetenv for csh
autoconf # To create ./configure script
./configure
make -j `nproc`
sudo make install

Install scala

sudo apt install scala

Toolchain

To compile the bootloaders for both Freedom E300 Arty and U500 VC707 FPGA dev kits, the RISC-V software toolchain must be installed locally and set the $(RISCV) environment variable to point to the location of where the RISC-V toolchains are installed. You can build the toolchain from scratch or download the tools here: https://www.sifive.com/products/tools/

After installing toolchain and vivado, you must set the environment variables.

If you have installed toolchain to /home/riscv/riscv64-elf-tc/bin/riscv64-unknown-elf-gcc then run the following command. Do not include /bin at the end of the string.

$ export RISCV=/home/riscv/riscv64-elf-tc

In order to run the mcs target in the next step, you need to have the vivado executable on your PATH.

If vivado is installed to /tools/Xilinx/Vivado/2016.4/bin, you can set the PATH with the following command.

$ export PATH=${PATH}:/tools/Xilinx/Vivado/2016.4/bin

Change the line above if the vivado is installed to /opt/Xilinx/Vivado/2016.4/bin accordingly.

Vivado license

Please acquire vivado license and install if you are using vc707 or vcu118 from logging in to Xilinx website with your account.

Type $ ifconfig -a to make sure that the network interface name is eth0. If not, the Vivado cannot recognize the license from the NIC interface when it is similar to enp0s25.

Must follow the bellow to rename the network interface:

$ sudo vi /etc/default/grub

Then add this line beneath those GRUB... lines:

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

Then update the grub:

$ sudo grub-mkconfig -o /boot/grub/grub.cfg
$ sudo update-grub

And reboot the machine. Check with ifconfig again if eth0 is shown or not.

Freedom E300 Arty FPGA Dev Kit

The Freedom E300 Arty FPGA Dev Kit implements a Freedom E300 chip.

How to build

The Makefile corresponding to the Freedom E300 Arty FPGA Dev Kit is Makefile.e300artydevkit and it consists of two main targets:

  • verilog: to compile the Chisel source files and generate the Verilog files.
  • mcs: to create a Configuration Memory File (.mcs) that can be programmed onto an Arty FPGA board.

To execute these targets, you can run the following commands:

$ make -f Makefile.e300artydevkit verilog
$ make -f Makefile.e300artydevkit mcs

Note: This flow requires Vivado 2017.1. Old versions are known to fail.

These will place the files under builds/e300artydevkit/obj.

Bootrom

The default bootrom consists of a program that immediately jumps to address 0x20400000, which is 0x00400000 bytes into the SPI flash memory on the Arty board.

Using the generated MCS Image

For instructions for getting the generated image onto an FPGA and programming it with software using the Freedom E SDK, please see the Freedom E310 Arty FPGA Dev Kit Getting Started Guide.

Freedom U500 VC707 FPGA Dev Kit

The Freedom U500 VC707 FPGA Dev Kit implements the Freedom U500 platform.

How to build

The Makefile corresponding to the Freedom U500 VC707 FPGA Dev Kit is Makefile.vc707-u500devkit and it consists of two main targets:

  • verilog: to compile the Chisel source files and generate the Verilog files.
  • mcs: to create a Configuration Memory File (.mcs) that can be programmed onto an VC707 FPGA board.

To execute these targets, you can run the following commands:

$ make -f Makefile.vc707-u500devkit verilog
$ make -f Makefile.vc707-u500devkit mcs

If you do not have PCI Express Gen1/2/3 FMC Module run following commands:

$ make MODEL=VC707BaseShell -f Makefile.vc707-u500devkit verilog
$ make MODEL=VC707BaseShell -f Makefile.vc707-u500devkit mcs

Note: This flow requires Vivado 2016.4. Newer versions are known to fail.

These will place the files under builds/vc707-u500devkit/obj.

Bootrom

The default bootrom consists of a bootloader that loads a program off the SD card slot on the VC707 board.

Linux boot Image

The bootable Linux image for vc707 is able to build from the link SD boot image.

More Repositories

1

freedom-e-sdk

Open Source Software for Developing on the Freedom E Platform
C
567
star
2

freedom-u-sdk

Freedom U Software Development Kit (FUSDK)
BitBake
275
star
3

freedom-tools

Tools for SiFive's Freedom Platform
Makefile
197
star
4

Kami

Kami - a DSL for designing Hardware in Coq, and the associated semantics and theorems for proving its correctness. Kami is inspired by Bluespec. It is actually a complete rewrite of an older version from MIT
Coq
188
star
5

sifive-blocks

Common RTL blocks used in SiFive's projects
Scala
179
star
6

freedom-metal

Bare Metal Compatibility Library for the Freedom Platform
C
153
star
7

fpga-shells

Scala
126
star
8

wake

The SiFive wake build tool
C++
86
star
9

elf2hex

Converts ELF files to HEX files that are suitable for Verilog's readmemh.
Shell
81
star
10

freedom-u540-c000-bootloader

Freedom U540-C000 Bootloader Code
C
77
star
11

benchmark-dhrystone

"DHRYSTONE" Benchmark Program by Reinhold P. Weicker
C
73
star
12

RiscvSpecFormal

The RiscvSpecKami package provides SiFive's RISC-V processor model. Built using Coq, this processor model can be used for simulation, model checking, and semantics analysis. The RISC-V processor model can be output as Verilog and simulated/synthesized using standard Verilog tools.
Haskell
73
star
13

duh

๐Ÿ‘พ Design โˆช Hardware
JavaScript
72
star
14

block-inclusivecache-sifive

Scala
72
star
15

riscv-llvm

SiFive's LLVM working tree
C++
69
star
16

chisel-circt

Library to compile Chisel circuits using LLVM/MLIR (CIRCT)
Scala
69
star
17

meta-sifive

SiFive OpenEmbedded / Yocto BSP Layer
BitBake
49
star
18

block-nvdla-sifive

Verilog
40
star
19

freedom-devicetree-tools

A linker script generator for SiFive's Freedom platform
C++
32
star
20

cinco

Port of Arduino environment for Freedom E 300 Dev Kit & HiFive Board
C++
31
star
21

last-week-in-risc-v

Weekly RISC-V Newsletter
Shell
28
star
22

ProcKami

Kami based processor implementations and specifications
Coq
24
star
23

pydevicetree

Python Library for Parsing Devicetree Source v1
Python
23
star
24

verilator

Fork of Verilator with prebuilt Ubuntu binaries (https://www.veripool.org/wiki/verilator)
C++
22
star
25

wit

Workspace Integration Tool
Python
22
star
26

riscv-vector-intrinsic-fuzzing

A random fuzz generator for the RISC-V vector extension intrinsics
C
17
star
27

freedom-studio

IDE for SiFive's Freedom Platform
16
star
28

FreeRTOS-metal

C
14
star
29

berkeley-hardfloat-chisel3

Hardfloat using chisel3
Scala
12
star
30

block-pio-sifive

An example of on-boarding a PIO block in with duh and wake
Scala
12
star
31

api-generator-sifive

Wake build descriptions of hardware generators
Python
12
star
32

soc-testsocket-sifive

A simple SoC for testing IP blocks
Scala
11
star
33

soc-freedom-sifive

e300 and u500 devkits
Scala
10
star
34

hifive1-revb-pendulum

An LED Ring and Accelerometer Pendulum Demo for HiFive1 Rev B
C
10
star
35

benchmark-mem-latency

simple cache latency test
C
9
star
36

devicetree-overlay-generator

Generates Devicetree overlays which encode the assumptions and/or sane defaults
Python
9
star
37

cmsis-svd-generator

Generates CMSIS-SVD xml files from DTS info and Register templates
Python
9
star
38

chisel-circt-demo

Demonstration of a project using sifive/chisel-circt
Scala
9
star
39

ldscript-generator

Freedom Metal Linker Script Generator
Python
8
star
40

Amazon-FreeRTOS

C
8
star
41

FpuKami

Coq
7
star
42

duh-scala

โ›๏ธ DUH component export to Scala
JavaScript
7
star
43

sifive-libc

Assembly
6
star
44

duh-ipxact

โŒ DUH IP-XACT import / export package
JavaScript
6
star
45

duh-schema

๐Ÿ“ DUH Schema
JavaScript
6
star
46

StdLibKami

Standard Library of Kami Modules
Coq
5
star
47

block-ark

๐ŸŒŠ๐Ÿ›ณ๏ธ๐Ÿ˜๐Ÿ˜๐Ÿ…๐Ÿˆ๐Ÿช๐Ÿซ๐Ÿ‘๐Ÿ๐Ÿ€๐Ÿ๐ŸŒ๐ŸŒ block with all sorts of bus interfaces
5
star
48

example-hpm

Demonstrates usage of the RISC-V hardware performance counter APIs.
C
5
star
49

scl-metal

C
5
star
50

duh-core

๐ŸŒฐ DUH core
JavaScript
4
star
51

debug-mechanism-comparison

Comparison of 2 proposed debug mechanisms.
HTML
4
star
52

example-pmp-baremetal

Example on how to program Physical Memory Protection Regions
C
4
star
53

example-cflush

An example demonstrating how to use cflush (CFLUSH.D.L1) and use FENCE to ensure flush complete
C
4
star
54

example-return-pass

A simple example for RTL run return pass
Makefile
3
star
55

xc3sprog

Imported from svn://svn.code.sf.net/p/xc3sprog/code/trunk
C++
3
star
56

soscl

SiFive Open Source Cryptographic Library
HTML
3
star
57

api-scala-sifive

Package for building Scala projects with wake
Python
3
star
58

example-pmp

C
3
star
59

freedom-gcc-metal

Bare Metal GCC for SiFive's Freedom Platform
Makefile
3
star
60

example-gpio

C
3
star
61

duhportinf

๐Ÿ‰ DUH port inference package
Python
3
star
62

freedom-qemu

QEMU System Emulator for SiFive's Freedom Platform
C
3
star
63

example-return-fail

A simple example for RTL run return fail
Makefile
3
star
64

freedom-elf2hex

Converts ELF files to HEX files that are suitable for Verilog's readmemh.
C
3
star
65

upf

upf tools
JavaScript
3
star
66

zephyr-sifive-freedom-template

Board template for building Zephyr RTOS for SiFive Freedom E-Series products
C
2
star
67

example-buserror

Freedom Metal Example for the SiFive Bus Error Unit
C
2
star
68

openocdcfg-generator

OpenOCD Configuration Generator for Freedom Metal
Python
2
star
69

example-chisel-wake

Example For Wake to run a Chisel design and unit test.
Scala
2
star
70

freedom-metal-docs

HTML
2
star
71

example-freertos-blinky-systemview

C
2
star
72

plic-baremetal

Low level setup for PLIC interrupt controller
C
2
star
73

duh-verilog

๐Ÿ‡ปVerilog import / export package
JavaScript
2
star
74

example-l2pm

Example code to demonstrate usage of Sifive L2 performance monitor counters to capture L2 cache event logs.
C
2
star
75

Segger_SystemView-metal

C
2
star
76

example-user-mode

C
2
star
77

trace-decoder-tests

Tests for SiFive trace decoder
Assembly
2
star
78

rocket-chip-wake

Wake build description for rocket-chip
2
star
79

riscv-fsf-gdb

C
2
star
80

example-firrtl-wake

Example Chisel modules and Chisel -> Verilog Wake flow
Scala
2
star
81

environment-blockci-sifive

Docker image and Wake environment for hardware development
Dockerfile
2
star
82

example-freertos-blinky

Standard Blinky freertos example
C
1
star
83

chisel-bootcamp-india

This is a trimmed down version of chisel bootcamp targeted for Indian undergraduate students. The Exercises here are sourced from different public chisel materials
Scala
1
star
84

testenv-metal

Test environment for freedom-metal
C
1
star
85

test-wfi-multicore

C
1
star
86

duh-svd

DUH to SVD converter
JavaScript
1
star
87

example-multicore-hello

C
1
star
88

environment-example-sifive

An example environment package
1
star
89

duh-bus

๐ŸšŒ Bus definition DUH documents
JavaScript
1
star
90

spdk-multithread

C
1
star
91

prepare-riscv-toolchain-qemu

Shell
1
star
92

example-freertos-minimal

C
1
star
93

duh-mem

โ“‚๏ธ DUH memory package
JavaScript
1
star
94

soc-iofpga-sifive

An IOFPGA SoC
Scala
1
star
95

firesim-ci-image

CI Image with LLVM and RISC-V utilities
Shell
1
star
96

freedom-gdb-metal

Bare Metal GDB for SiFive's Freedom Platform
Makefile
1
star
97

example-clic-nested-interrupts

A simple example demonstrating how to use CLIC preemptive (level and priority) nested interrupts
C
1
star
98

example-l2pf

Example code to demonstrate usage of Sifive L2 hardware prefetcher.
C
1
star
99

tree-sitter-wake

Wake grammar for tree-sitter
JavaScript
1
star
100

example-gpio-testbench

Exercises a GPIO connected to an RTL Testbench
C
1
star