Top Related Projects
SonicBOOM: The Berkeley Out-of-Order Machine
Ibex is a small 32 bit RISC-V CPU core, previously known as zero-riscy.
Rocket Chip Generator
A FPGA friendly 32 bit RISC-V CPU implementation
An Agile RISC-V SoC Design Framework with in-order cores, out-of-order cores, accelerators, and more
GNU toolchain for RISC-V, including GCC
Quick Overview
The SiFive Freedom repository is an open-source project that provides a complete system-on-chip (SoC) design based on the RISC-V instruction set architecture. It includes RTL designs, development tools, and documentation for building custom RISC-V processors and SoCs. The project aims to accelerate the adoption of RISC-V and enable customization for various applications.
Pros
- Open-source and customizable RISC-V-based SoC designs
- Comprehensive set of tools and documentation for development
- Supports various RISC-V configurations and extensions
- Backed by SiFive, a leading RISC-V company
Cons
- Steep learning curve for those new to RISC-V or hardware design
- Limited community support compared to more established architectures
- May require significant resources for implementation and testing
- Documentation can be complex and sometimes outdated
Getting Started
To get started with the SiFive Freedom project:
-
Clone the repository:
git clone https://github.com/sifive/freedom.git cd freedom
-
Install dependencies (Ubuntu example):
sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
-
Build the toolchain:
make toolchain
-
Choose a configuration and build:
make CONFIGURATION=freedom-e300-hifive1 -f Makefile.sdboot
-
For more detailed instructions and specific configurations, refer to the project's README and documentation.
Competitor Comparisons
SonicBOOM: The Berkeley Out-of-Order Machine
Pros of riscv-boom
- More advanced and higher-performance RISC-V core implementation
- Focuses on out-of-order execution and superscalar design
- Highly configurable and parameterizable for different use cases
Cons of riscv-boom
- More complex and potentially harder to understand for beginners
- May require more resources to synthesize and implement in hardware
- Less comprehensive ecosystem compared to Freedom
Code Comparison
RISC-V BOOM (simplified pipeline stage):
class Execute(implicit p: Parameters) extends BoomModule()(p) {
val io = IO(new Bundle {
val req = Flipped(Decoupled(new ExeUnitReq))
val resp = Decoupled(new ExeUnitResp)
})
// ... (execution logic)
}
Freedom (simplified core instantiation):
class FreedomU500VC707DevKit(implicit p: Parameters) extends LazyModule {
val core = LazyModule(new RocketTile(
RocketTileParams(hartId = 0)
))
// ... (peripheral and memory connections)
}
Both projects implement RISC-V cores, but RISC-V BOOM focuses on advanced microarchitectural features, while Freedom provides a more comprehensive SoC solution with various peripherals and development kit support.
Ibex is a small 32 bit RISC-V CPU core, previously known as zero-riscy.
Pros of Ibex
- Simpler, more compact core design focused on embedded applications
- More extensive documentation and user guides
- Active community development with regular updates and contributions
Cons of Ibex
- Limited to 32-bit RISC-V architecture, while Freedom supports 64-bit
- Fewer advanced features compared to Freedom's more comprehensive SoC offerings
- Less mature ecosystem and toolchain support
Code Comparison
Ibex (RISC-V control status register definition):
`define CSR_MSTATUS_MIE_BIT 3
`define CSR_MSTATUS_MPIE_BIT 7
`define CSR_MSTATUS_MPP_BIT_LOW 11
`define CSR_MSTATUS_MPP_BIT_HIGH 12
Freedom (RISC-V control status register definition):
class MStatus extends Bundle {
val sd = Bool()
val zero2 = UInt(23.W)
val mpv = Bool()
val gva = Bool()
val mbe = Bool()
val sbe = Bool()
// ... (additional fields)
}
The code snippets show different approaches to defining control status registers. Ibex uses Verilog with simple bit definitions, while Freedom employs Scala with a more structured, object-oriented approach.
Rocket Chip Generator
Pros of rocket-chip
- More comprehensive and flexible RISC-V core generator
- Wider community support and contributions
- More extensive documentation and resources
Cons of rocket-chip
- Steeper learning curve for newcomers
- Less focus on specific SoC implementations
- Requires more configuration and customization
Code Comparison
rocket-chip:
class RocketTile(
params: RocketTileParams,
crossing: RocketCrossingParams
)(implicit p: Parameters) extends BaseTile(params, crossing)(p)
with HasRocketCore
with HasICacheFrontend
with HasTileInputConstants
with CanHaveNonBlockingL1Cache
freedom:
class FreedomU500VC707DevKit(implicit p: Parameters) extends ChipTop
with HasPeripheryBootROM
with HasPeripheryDDR3
with HasPeripheryUART
with HasPeripherySPI
with HasPeripheryGPIO
The code snippets show that rocket-chip focuses on core generation and customization, while freedom emphasizes SoC integration with specific peripherals.
A FPGA friendly 32 bit RISC-V CPU implementation
Pros of VexRiscv
- Written in SpinalHDL, allowing for more flexible and modular design
- Highly configurable, supporting various optional features and extensions
- Better documentation and examples for customization
Cons of VexRiscv
- Less industry adoption compared to Freedom
- May require learning SpinalHDL for deep customization
- Potentially less mature ecosystem and toolchain support
Code Comparison
Freedom (Chisel):
class RocketTile(
rocketParams: RocketTileParams,
crossing: RocketCrossingParams
)(implicit p: Parameters) extends BaseTile(rocketParams, crossing)(p)
with HasRocketTile {
// ... (additional code)
}
VexRiscv (SpinalHDL):
class VexRiscv(config : VexRiscvConfig) extends Component {
val io = new Bundle {
val iBus = master(IBusSimplified(config.iCacheInfo.memDataWidth, config.iCacheInfo.addressWidth))
val dBus = master(DBusSimplified())
// ... (additional IO)
}
// ... (additional code)
}
Both projects implement RISC-V processors, but use different hardware description languages and design approaches. Freedom uses Chisel and follows a more traditional RTL design, while VexRiscv leverages SpinalHDL for a more flexible and modular architecture.
An Agile RISC-V SoC Design Framework with in-order cores, out-of-order cores, accelerators, and more
Pros of Chipyard
- More comprehensive and flexible SoC design framework
- Better integration with modern RISC-V tools and ecosystems
- Actively maintained with frequent updates and community support
Cons of Chipyard
- Steeper learning curve due to its complexity
- Requires more computational resources for simulation and synthesis
- May be overkill for simpler RISC-V projects
Code Comparison
Freedom:
class FreedomPlatform(implicit p: Parameters) extends RocketSystem
with HasPeripheryBootROM
with HasPeripheryDTIM
with HasPeripheryDebug
Chipyard:
class ChipyardSystem(implicit p: Parameters) extends ChipyardSubsystem
with HasTiles
with CanHaveMasterAXI4MemPort
with CanHaveMasterAXI4MMIOPort
with HasPeripheryBootROM
Summary
Chipyard offers a more comprehensive and flexible SoC design framework compared to Freedom, with better integration of modern RISC-V tools. However, it comes with a steeper learning curve and higher resource requirements. Freedom may be more suitable for simpler RISC-V projects, while Chipyard excels in complex, customizable designs. The code comparison shows that both use Scala for configuration, but Chipyard's structure allows for more extensive customization and modularity.
GNU toolchain for RISC-V, including GCC
Pros of riscv-gnu-toolchain
- Focused specifically on RISC-V toolchain development
- More frequently updated and maintained
- Broader community support and contributions
Cons of riscv-gnu-toolchain
- Limited to toolchain development, not a full SoC platform
- May require additional components for a complete development environment
- Less integrated with specific hardware implementations
Code Comparison
riscv-gnu-toolchain:
./configure --prefix=/opt/riscv
make
freedom:
class FreedomPlatform extends Config(
new WithNBigCores(1) ++
new BaseConfig
)
The code snippets highlight the different focus areas of the two projects. riscv-gnu-toolchain shows a typical build process for the toolchain, while freedom demonstrates configuration for a RISC-V based SoC platform.
riscv-gnu-toolchain is primarily focused on providing a comprehensive toolchain for RISC-V development, including compilers, assemblers, and debuggers. It's regularly updated and widely used in the RISC-V community.
freedom, on the other hand, is a more complete SoC development platform that includes both hardware and software components. It's specifically tailored for SiFive's RISC-V implementations and provides a more integrated development experience for their hardware.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
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.
Top Related Projects
SonicBOOM: The Berkeley Out-of-Order Machine
Ibex is a small 32 bit RISC-V CPU core, previously known as zero-riscy.
Rocket Chip Generator
A FPGA friendly 32 bit RISC-V CPU implementation
An Agile RISC-V SoC Design Framework with in-order cores, out-of-order cores, accelerators, and more
GNU toolchain for RISC-V, including GCC
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot