ultraembedded / biriscv

32-bit Superscalar RISC-V CPU
Apache License 2.0
838 stars 146 forks source link
artix-7 asic branch-prediction coremark cpu fpga in-order linux pipelined-processors risc-v riscv-linux rv32i rv32im superscalar verilator verilog xilinx

biRISC-V - 32-bit dual issue RISC-V CPU

Github: http://github.com/ultraembedded/biriscv

biRISC-V

Features

A sequence showing execution of 2 instructions per cycle; Dual-Issue

Documentation

Similar Cores

Project Aims

Booting the stock Linux 5.0.0-rc8 kernel built for RV32IMA to userspace on a Digilent Arty Artix 7 with biRISC-V (with atomic instructions emulated in the bootloader); Linux-Boot

Prior Work

Based on my previous work;

Getting Started

Cloning

To clone this project and its dependencies;

git clone --recursive https://github.com/ultraembedded/biriscv.git

Running Helloworld

To run a simple test image on the core RTL using Icarus Verilog;

# Install Icarus Verilog (Debian / Ubuntu / Linux Mint)
sudo apt-get install iverilog

# [or] Install Icarus Verilog (Redhat / Centos)
#sudo yum install iverilog

# Run a simple test image (test.elf)
cd tb/tb_core_icarus
make

The expected output is;

Starting bench
VCD info: dumpfile waveform.vcd opened for output.

Test:
1. Initialised data
2. Multiply
3. Divide
4. Shift left
5. Shift right
6. Shift right arithmetic
7. Signed comparision
8. Word access
9. Byte access
10. Comparision

Configuration

Param Name Valid Range Description
SUPPORT_SUPER 1/0 Enable supervisor / user privilege levels.
SUPPORT_MMU 1/0 Enable basic memory management unit.
SUPPORT_MULDIV 1/0 Enable HW multiply / divide (RV-M).
SUPPORT_DUAL_ISSUE 1/0 Support superscalar operation.
SUPPORT_LOAD_BYPASS 1/0 Support load result bypass paths.
SUPPORT_MUL_BYPASS 1/0 Support multiply result bypass paths.
SUPPORT_REGFILE_XILINX 1/0 Support Xilinx optimised register file.
SUPPORT_BRANCH_PREDICTION 1/0 Enable branch prediction structures.
NUM_BTB_ENTRIES 2 - Number of branch target buffer entries.
NUM_BTB_ENTRIES_W 1 - Set to log2(NUM_BTB_ENTRIES).
NUM_BHT_ENTRIES 2 - Number of branch history table entries.
NUM_BHT_ENTRIES_W 1 - Set to log2(NUM_BHT_ENTRIES_W).
BHT_ENABLE 1/0 Enable branch history table based prediction.
GSHARE_ENABLE 1/0 Enable GSHARE branch prediction algorithm.
RAS_ENABLE 1/0 Enable return address stack prediction.
NUM_RAS_ENTRIES 2 - Number of return stack addresses supported.
NUM_RAS_ENTRIES_W 1 - Set to log2(NUM_RAS_ENTRIES_W).
EXTRA_DECODE_STAGE 1/0 Extra decode pipe stage for improved timing.
MEM_CACHE_ADDR_MIN 32'h0 - 32'hffffffff Lowest cacheable memory address.
MEM_CACHE_ADDR_MAX 32'h0 - 32'hffffffff Highest cacheable memory address.