old2
Differences
This shows you the differences between two versions of the page.
old2 [2024/09/22 22:05] – created kise | old2 [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | This old page was copied on May 17, 2020. | ||
- | # RVCore Project, Arch Lab, Tokyo Tech | ||
- | |||
- | The RVCore Project is a research and development project | ||
- | of the RISC-V soft processor highly optimized for FPGAs. | ||
- | |||
- | **RVCoreP** (**R**ISC-**V** **Core** **P**ipelined version) is one of the RISC-V soft processor cores of the RVCore Project. | ||
- | It is an optimized RISC-V soft processor of five-stage pipelining. | ||
- | |||
- | {{: | ||
- | |||
- | ## About RVCoreP | ||
- | |||
- | The main specifications of RVCoreP are shown below: | ||
- | |||
- | - An optimized RISC-V soft processor | ||
- | - Adopt **RV32I** of RISC-V as an instruction set architecture, | ||
- | - Adopt **five-stage pipelining** | ||
- | - Instruction fetch (If) | ||
- | - Instruction decode (Id) | ||
- | - Instruction execution (Ex) | ||
- | - Memory access (Ma) | ||
- | - Write back (Wb) | ||
- | - Apply **three effective optimization methods** to improve the operating frequency | ||
- | - Instruction fetch unit optimization including the pipelined branch prediction mechanism | ||
- | - ALU optimization | ||
- | - Data alignment and sign-extension optimization for data memory output | ||
- | - Implemented in **Verilog HDL** | ||
- | - Run RISC-V programs compiled with RV32I | ||
- | - By Verilog HDL simulation using Icarus Verilog or Verilator | ||
- | - On the FPGA boards including **Xilinx Artix-7 FPGA** | ||
- | |||
- | ## Download source file | ||
- | |||
- | The source code of RVCoreP Ver.0.4.6: {{ : | ||
- | |||
- | This source code is released under the MIT License, see LICENSE.txt. | ||
- | |||
- | ## Recommended environment | ||
- | |||
- | - Ubuntu 18.04 LTS for executing Xilinx Vivado | ||
- | - Windows 10 for serial communication | ||
- | - [[http:// | ||
- | - [[https:// | ||
- | - [[https:// | ||
- | - [[https:// | ||
- | - [[https:// | ||
- | |||
- | |||
- | Install iverilog by the following command. | ||
- | |||
- | ``` | ||
- | $ sudo apt install iverilog | ||
- | ``` | ||
- | |||
- | Install verilator by the following command, the install of verilator is optional. | ||
- | |||
- | ``` | ||
- | $ sudo apt install verilator | ||
- | ``` | ||
- | |||
- | ## Getting started guide | ||
- | |||
- | (1) Download the source code of the RVCoreP | ||
- | |||
- | ``` | ||
- | $ wget http:// | ||
- | ``` | ||
- | |||
- | (2) Extract the downloaded zip file | ||
- | |||
- | ``` | ||
- | $ unzip rvcorep_ver046.zip | ||
- | $ cd rvcorep_ver046 | ||
- | ``` | ||
- | |||
- | ### Verilog HDL simulation using Icarus Verilog | ||
- | |||
- | You execute the following commands on the recommended environment. | ||
- | |||
- | (1) Compile source code written in Verilog HDL using Icarus Verilog | ||
- | |||
- | ``` | ||
- | $ make | ||
- | iverilog -DSERIAL_WCNT=2 -DNO_IP -o simv top.v main.v uart.v debug.v proc.v | ||
- | ``` | ||
- | | ||
- | The executable file `simv` is generated after the compilation is performed. | ||
- | |||
- | (2) Execute the Verilog HDL simulation | ||
- | |||
- | By default, the test benchmark is executed. | ||
- | The memory file of the test benchmark is `test/ | ||
- | |||
- | ``` | ||
- | $ make run | ||
- | ./simv | ||
- | Run test/ | ||
- | Initializing : .......... | ||
- | -------------------------------------------------- | ||
- | ---- nqueen ---- | ||
- | Nqueen : | ||
- | N = 6 | ||
- | The number of solutions = 4 | ||
- | ---------------- | ||
- | |||
- | ---- qsort ---- | ||
- | Sorted Seqence : | ||
- | 59321 | ||
- | A4C86 | ||
- | AC7D3 | ||
- | B210A | ||
- | 142044 | ||
- | 1DEC15 | ||
- | 1EC216 | ||
- | 2536B2 | ||
- | 278BCF | ||
- | 34A2AC | ||
- | ---------------- | ||
- | |||
- | ---- fib ---- | ||
- | Fibonacci Seqence : | ||
- | 1: 1 | ||
- | 2: 1 | ||
- | 3: 2 | ||
- | 4: 3 | ||
- | 5: 5 | ||
- | 6: 8 | ||
- | 7: D | ||
- | 8: 15 | ||
- | 9: 22 | ||
- | A: 37 | ||
- | ---------------- | ||
- | |||
- | ---- acker ---- | ||
- | acker(0,0) = 1 | ||
- | acker(0,1) = 2 | ||
- | acker(0,2) = 3 | ||
- | acker(1,0) = 2 | ||
- | acker(1,1) = 3 | ||
- | acker(1,2) = 4 | ||
- | acker(2,0) = 3 | ||
- | acker(2,1) = 5 | ||
- | acker(2,2) = 7 | ||
- | ---------------- | ||
- | |||
- | == elapsed clock cycles | ||
- | == valid instructions executed : 28934 | ||
- | == IPC : | ||
- | == the num of load-use stall : | ||
- | == branch prediction hit : | ||
- | == branch prediction miss : 1430 | ||
- | == branch prediction total : | ||
- | == branch prediction hit rate : 0.716 | ||
- | == estimated clock cycles | ||
- | == r_cnt : 000088d6 | ||
- | == r_rout | ||
- | ``` | ||
- | You will see the above output. | ||
- | The information such as IPC (Instructions Per Cycle) and branch prediction hit rate is output to the console after running simulation. | ||
- | |||
- | (3) Execute the Dhrystone and Coremark benchmarks by the Verilog HDL simulation | ||
- | |||
- | You compile and execute with Dhrystone benchmark. | ||
- | The memory file is `bench/ | ||
- | |||
- | ``` | ||
- | $ make dhrystone | ||
- | make BENCH=" | ||
- | iverilog -DSERIAL_WCNT=2 -DNO_IP -DMEMFILE=\" | ||
- | $ make run | ||
- | ./simv | ||
- | Run bench/ | ||
- | Initialized. | ||
- | -------------------------------------------------- | ||
- | ............................................................................................ | ||
- | == elapsed clock cycles | ||
- | == valid instructions executed : | ||
- | == IPC : | ||
- | == the num of load-use stall : | ||
- | == branch prediction hit : | ||
- | == branch prediction miss : 16481 | ||
- | == branch prediction total : | ||
- | == branch prediction hit rate : 0.924 | ||
- | == estimated clock cycles | ||
- | == r_cnt : 000ed8fe | ||
- | == r_rout | ||
- | ``` | ||
- | |||
- | You also compile and execute with Coremark benchmark. | ||
- | The memory file is `bench/ | ||
- | |||
- | ``` | ||
- | $ make coremark | ||
- | make BENCH=" | ||
- | iverilog -DSERIAL_WCNT=2 -DNO_IP -DMEMFILE=\" | ||
- | $ make run | ||
- | ./simv | ||
- | Run bench/ | ||
- | Initialized. | ||
- | -------------------------------------------------- | ||
- | ...................................................................................................................................................... | ||
- | ................................. | ||
- | == elapsed clock cycles | ||
- | == valid instructions executed : 1481298 | ||
- | == IPC : | ||
- | == the num of load-use stall : | ||
- | == branch prediction hit : | ||
- | == branch prediction miss : 94534 | ||
- | == branch prediction total : | ||
- | == branch prediction hit rate : 0.793 | ||
- | == estimated clock cycles | ||
- | == r_cnt : 001b7551 | ||
- | == r_rout | ||
- | ``` | ||
- | |||
- | ### Implementation and execution on the Nexys 4 DDR board | ||
- | |||
- | You execute the following process in the directory of the downloaded source code on the recommended environment. | ||
- | |||
- | (1) Open the project file `main.xpr` in Xilinx Vivado | ||
- | |||
- | ``` | ||
- | $ vivado main.xpr | ||
- | ``` | ||
- | |||
- | (2) Perform logic synthesis, placement and routing, and generating bitstream using Xilinx Vivado | ||
- | |||
- | - Click " | ||
- | |||
- | By default, the operating frequency of the processor is set to 170MHz. | ||
- | |||
- | (3) Write the generated bitstream to the FPGA board | ||
- | |||
- | - Click "Open Hardware Manager" | ||
- | |||
- | - Click "Open target" | ||
- | |||
- | - Click " | ||
- | |||
- | - Click " | ||
- | |||
- | When the bitstream data is correctly written to the FPGA board, | ||
- | the DONE LED lights up and " | ||
- | |||
- | (4) Prepare for 5M baud serial communication | ||
- | |||
- | Open a terminal emulator Tera Term that can perform serial communication | ||
- | |||
- | - Click " | ||
- | |||
- | - Select the appropriate USB Serial Port and click " | ||
- | (When using Windows, it seems better to select the larger value of COM[XX] of the serial COM port) | ||
- | |||
- | - Click " | ||
- | |||
- | - Change " | ||
- | |||
- | - Click " | ||
- | |||
- | - Change the Baud rate of Serial port to " | ||
- | |||
- | (5) Send the RISC-V program binary to the FPGA board by serial communication and execute the program | ||
- | |||
- | - Click " | ||
- | |||
- | - Check the " | ||
- | |||
- | - Select `test/ | ||
- | |||
- | - Send the test benchmark to the FPGA board via serial communication and execute the program on the implemented processor | ||
- | |||
- | The following execution result is output via serial communication. | ||
- | |||
- | ``` | ||
- | ---- nqueen ---- | ||
- | Nqueen : | ||
- | N = 6 | ||
- | The number of solutions = 4 | ||
- | ---------------- | ||
- | |||
- | ---- qsort ---- | ||
- | Sorted Seqence : | ||
- | 59321 | ||
- | A4C86 | ||
- | AC7D3 | ||
- | B210A | ||
- | 142044 | ||
- | 1DEC15 | ||
- | 1EC216 | ||
- | 2536B2 | ||
- | 278BCF | ||
- | 34A2AC | ||
- | ---------------- | ||
- | |||
- | ---- fib ---- | ||
- | Fibonacci Seqence : | ||
- | 1: 1 | ||
- | 2: 1 | ||
- | 3: 2 | ||
- | 4: 3 | ||
- | 5: 5 | ||
- | 6: 8 | ||
- | 7: D | ||
- | 8: 15 | ||
- | 9: 22 | ||
- | A: 37 | ||
- | ---------------- | ||
- | |||
- | ---- acker ---- | ||
- | acker(0,0) = 1 | ||
- | acker(0,1) = 2 | ||
- | acker(0,2) = 3 | ||
- | acker(1,0) = 2 | ||
- | acker(1,1) = 3 | ||
- | acker(1,2) = 4 | ||
- | acker(2,0) = 3 | ||
- | acker(2,1) = 5 | ||
- | acker(2,2) = 7 | ||
- | ---------------- | ||
- | ``` | ||
- | |||
- | The 7-segment LED shows the value of the program counter of the processor at the end of execution. | ||
- | If you execute the test benchmark `test/ | ||
- | |||
- | When the button " | ||
- | If you execute the test benchmark `test/ | ||
- | |||
- | If you want to send the binary file of the program to the FPGA board again and execute it, proceed from step (3). | ||
- | |||
- | ## Publication | ||
- | |||
- | This processor RVCoreP is explicated in a preprint paper of arXiv. | ||
- | |||
- | Hiromu Miyazaki, Takuto Kanamori, Md Ashraful Islam, Kenji Kise: | ||
- | RVCoreP : An optimized RISC-V soft processor of five-stage pipelining, | ||
- | [[https:// | ||
- | |||
- | This paper is submitted to the Institute of Electronics, | ||
- | |||
- | ## Contact | ||
- | |||
- | [[http:// | ||
- | |||
- | E-mail: miyazaki (at) arch.cs.titech.ac.jp | ||
- | |||
- | ## Other Project | ||
- | |||
- | - [[http:// | ||
- | |||
- | Copyright (c) 2020 Kise Laboratory, Tokyo Institute of Technology |
old2.1727010349.txt.gz · Last modified: 2024/09/22 22:05 by kise