All Projects → panda5mt → KyogenRV

panda5mt / KyogenRV

Licence: Apache-2.0 license
The Simple 5-staged pipeline RISC-V written in chisel3 for intel FPGA.

Programming Languages

scala
5932 projects
SystemVerilog
227 projects
tcl
693 projects
python
139335 projects - #7 most used programming language
assembly
5116 projects
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to KyogenRV

Neorv32
A small and customizable full-scale 32-bit RISC-V soft-core CPU and SoC written in platform-independent VHDL.
Stars: ✭ 106 (+186.49%)
Mutual labels:  fpga, intel, riscv, risc-v
Quasar
Quasar 2.0: Chisel equivalent of SweRV-EL2
Stars: ✭ 19 (-48.65%)
Mutual labels:  chisel, riscv, chisel3
Fuxi
Fuxi (伏羲) is a 32-bit pipelined RISC-V processor written in Chisel3.
Stars: ✭ 68 (+83.78%)
Mutual labels:  fpga, chisel, riscv
spu32
Small Processing Unit 32: A compact RV32I CPU written in Verilog
Stars: ✭ 51 (+37.84%)
Mutual labels:  fpga, risc-v, rv32i
Cores Swerv El2
SweRV EL2 Core
Stars: ✭ 79 (+113.51%)
Mutual labels:  fpga, riscv, risc-v
Cores Swerv
SweRV EH1 core
Stars: ✭ 406 (+997.3%)
Mutual labels:  fpga, riscv, risc-v
HPS2FPGAmapping
SoCFPGA: Mapping HPS Peripherals, like I²C or CAN, over the FPGA fabric to FPGA I/O and using embedded Linux to control them (Intel Cyclone V)
Stars: ✭ 27 (-27.03%)
Mutual labels:  fpga, intel, altera
Darkriscv
opensouce RISC-V cpu core implemented in Verilog from scratch in one night!
Stars: ✭ 1,062 (+2770.27%)
Mutual labels:  fpga, riscv, risc-v
Ustc Rvsoc
FPGA-based RISC-V CPU+SoC.
Stars: ✭ 77 (+108.11%)
Mutual labels:  fpga, riscv, risc-v
yatcpu
Yet another toy CPU.
Stars: ✭ 42 (+13.51%)
Mutual labels:  riscv, chisel3, risc-v
yarvi
Yet Another RISC-V Implementation
Stars: ✭ 59 (+59.46%)
Mutual labels:  fpga, riscv, risc-v
tree-core-ide
The next generation integrated development environment for processor design and verification. It has multi-hardware language support, open source IP management and easy-to-use rtl simulation toolset.
Stars: ✭ 79 (+113.51%)
Mutual labels:  riscv, chisel3
FPGAmp
720p FPGA Media Player (RISC-V + Motion JPEG + SD + HDMI on an Artix 7)
Stars: ✭ 190 (+413.51%)
Mutual labels:  fpga, risc-v
riscv-meta
RISC-V Instruction Set Metadata
Stars: ✭ 33 (-10.81%)
Mutual labels:  riscv, risc-v
drec-fpga-intro
Materials for "Introduction to FPGA and Verilog" at MIPT DREC
Stars: ✭ 66 (+78.38%)
Mutual labels:  fpga, risc-v
kianRiscV
KianRISC-V! No RISC-V, no fun! RISC-V CPU with strong design rules and unittested! CPU you can trust! kianv rv32im risc-v a hdmi soc with harris computer architecture in verilog: multicycle, singlecycle and 5-stage pipelining Processor. Multicycle Soc with firmware that runs raytracer, mandelbrot, 3d hdmi gfx, dma controller, etc.....
Stars: ✭ 167 (+351.35%)
Mutual labels:  fpga, riscv
tree-core-cpu
A series of RISC-V soft core processor written from scratch. Now, we're using all open-source toolchain( chisel, mill, verilator, NEMU, AM and difftest framework, etc) to design and verify.
Stars: ✭ 22 (-40.54%)
Mutual labels:  chisel, riscv
ravel
A RISC-V simulator
Stars: ✭ 24 (-35.14%)
Mutual labels:  riscv, risc-v
platform-shakti
Shakti: development platform for PlatformIO
Stars: ✭ 26 (-29.73%)
Mutual labels:  riscv, risc-v
quasiSoC
No-MMU Linux capable RISC-V SoC designed to be useful.
Stars: ✭ 29 (-21.62%)
Mutual labels:  fpga, risc-v

KyogenRV(響玄RV):The Simple RISC-V for intel FPGA

日本語のREADMEはこちら

  • Arch:RV32I
  • Privilege : only M-mode
    • User-Level ISA Version 2.2
    • Privileged ISA Version 1.11
  • Interrupt:External
  • CPU Bus: Intel Avalon-MM Interface
  • Pipelines: 5-stage(IF/ID/EX/MEM/WB)
  • Written: in Chisel-lang v.3.4 + Makefile

I.Usage

0.using with intel FPGA

The standard environment assumption is using Cyclone10LP(10CL025YU256C8G).

Recommended development environment
  • Cross development environment: Environment that satisfies all of the following conditions
    • An environment running Windows 10/WSL2
    • Running Quartus Prime Lite v.20.1.1 or higher
    • A scala/sbt environment must be available.
    • Pyhton 3.7 or higher is required.
  • FPGA requirements: Devices that satisfied one of the following requirements
    • Cyclone 10LP (device with 10CL010 or more logic elements)
    • An intel FPGA with at least 1-block PLL, at least 7000 LEs of logic elements, and at least 1-KiB of On-Chip RAM
Preparing the riscv-toolchain
git clone https://github.com/riscv/riscv-gnu-toolchain
cd riscv-gnu-toolchain
./configure --prefix=/opt/riscv --with-arch=rv32i 
sudo make
Install KyogenRV and rebuild FPGA logic related
cd -
git clone http://github.com/panda5mt/KyogenRV  
cd KyogenRV/
make sdk
Starting Quartus Prime

You can choose between GUI or CUI, the CUI method is useful when using a cloud or on-premises Windows PC.

Compiling with GUI

Run Quartus Prime and open the fpga/kyogenrv_fpga_top.qpf project. Menu -> Processing -> Start Compilation to start compilation.

Compiling with CUI

Open the build script build_sdk.sh with an editor and set the Quartus Prime installation folder, KyogenRV directory, etc. After confirming that everything PATH is correct, just run the following at the root of the project.

./build_sdk.sh

Regardless of which method CUI or GUI you use above, make sure that there are no build errors before modifying the project to fit your board environment using Pin Planner or Platform Designer. The following files will be generated in the fpga folder.

  • kyogenrv_fpga_top.sof

If you use CUI, the following file will also be generated.

  • kyogenrv_fpga_top.svf
Modify the sample code(led.c as exam)

You may find it helpful to know how does this RISC-V CPU and its project works to modify src/sw/main.c. If the code consists of multiple files or the file names are changed, please rewrite src/sw/common2.mk to Makefile build all fixed and modified files.

Rebuild the project
Rebuild with GUI

After saving the file, run

make c_all
./mk_intel_hex.py

to compile project and re-generate the intel hex files. If you are build all FPGA project, you can run,

make sdk

Start compiling by going to Menu -> Processing -> Start Compilation. The generated *.sof file is used to configure the FPGA via Quartus Programmer.

Rebuild with CUI

Compared with GUI, the procedure is simple. just run following to rebuild.

./build_sdk.sh

Configure the FPGA using *.sof or *.svf.

The following is the procedure for PC-based simulation; it is not necessary when using the FPGA hardware.

1.Simulation

git clone http://github.com/panda5mt/KyogenRV  
cd KyogenRV/
make clean
make test

to generate your *.hex files from your *.s, put your *.s file to src/sw/ and then execute below

./build_asm.py        # generate *.hex file from *.s
./mk_intel_hex.py     # generate intel hex files

2.Simulating with riscv-tests (need python 3.7 or later)

git clone http://github.com/panda5mt/KyogenRV  

clone from riscv-tests

git clone https://github.com/riscv/riscv-tests
cd riscv-tests
git submodule update --init --recursive

then modify linker script

nano env/p/link.ld

change start address of '.text' section to start 0x00000000

SECTIONS
{
  . = 0x00000000;   # -> change this 
  .text.init : { *(.text.init) }
  . = ALIGN(0x1000);
  .tohost : { *(.tohost) }
  . = ALIGN(0x1000);
  .text : { *(.text) }
  . = ALIGN(0x1000);
  .data : { *(.data) }
  .bss : { *(.bss) }
  _end = .;
}

save link.ld and make riscv-tests

autoconf
./configure --prefix=<your-kyogenRVs-root-dir>/tests/
make
make install
cd ../
cd KyogenRV/
make clean
make riscv-tests

3.Generate Verilog

git clone http://github.com/panda5mt/KyogenRV  
cd KyogenRV/
make clean
make hdl

II.Basically Logic

The following instructions is written for who want to explore this "KyogenRV" RV32I design step by step. Otherwise, please clone the latest from GitHub.

1.Instruction Fetch Stage(IF)

git clone http://github.com/panda5mt/KyogenRV -b 0.0.2 --depth 1 
cd KyogenRV/
make test

2.Instruction Decode Stage(ID) and Integer ALU

git clone http://github.com/panda5mt/KyogenRV -b 0.0.9 --depth 1 
cd KyogenRV/
make test

3.Branch (PC update)

git clone http://github.com/panda5mt/KyogenRV -b 0.0.10.3 --depth 1 
cd KyogenRV/

write asm file and save to src/sw/test.s then build as follows

make asm

you'll get src/sw/test.hex then build test module in chisel project as follows

make test

4.Multi-staged pipeline (5-staged-pipeline)

git clone http://github.com/panda5mt/KyogenRV -b 0.0.10.10 --depth 1 
cd KyogenRV/

write asm file and save to src/sw/test.s then build as follows

make clean
make asm

you'll get src/sw/test.hex then build test module in chisel project as follows

make test

when you modified src/sw/test.s, just type as follows

make test

so makefile scan test.hex is changed and re-assemble then build chisel project.

5. Added Stage-Stall and Stage-fowardings

git clone http://github.com/panda5mt/KyogenRV -b 0.0.10.15 --depth 1 
cd KyogenRV/

write asm file and save to src/sw/test.s then build as follows

make clean
make asm

you'll get src/sw/test.hex then build test module in chisel project as follows

make test

when you modified src/sw/test.hex, just type as follows

make test

so makefile scan test.hex is changed and re-assemble then build chisel project.

6. Added Exception and External Interrupt

please git clone latest one.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].