DesignandImplementationofRISC-VISARV32IM
DesignandImplementationofRISC-VISARV32IM
net/publication/372385945
CITATION READS
1 3,068
5 authors, including:
Pushpalatha K N
Sai Vidya Institute of Technology
19 PUBLICATIONS 82 CITATIONS
SEE PROFILE
All content following this page was uploaded by Pushpalatha K N on 18 July 2023.
Original Article
Received: 29 April 2023 Revised: 05 June 2023 Accepted: 20 June 2023 Published: 06 July 2023
Abstract - RISC-V, an open-source Instruction Set Architecture, originated from the collaborative efforts of researchers at the
University of California, Berkeley, in 2010. It is a basic Load and Store type architecture based on traditional principles of
RISC whilst providing flexibility in terms of extensions to the base Integer Set such as multiply, floating point and atomic
instructions. This paper details the Design and Implementation of 5 stages pipelined RV32IM (base integer set with multiply
extension). The design also incorporates a 2-bit branch predictor for increased throughput. Analysis and Verification have
been performed for proper decoding, pipelined operation, branch prediction, stalling, memory access, and overall
functionality. Verilog HDL on Intel QuestaSim has been used to design the core and simulation. DE 10 Lite board with Max
10 family of FPGA has been used for hardware synthesis and analysis of the design.
Keywords - RISC-V, Instruction Set Architecture, RV32IM, 5-stage pipeline, DE10 Lite FPGA.
The fetch, decode and control logic block is responsible is then processed and broken down into its constituent parts
for fetching the instruction from the instruction memory, to determine the operation to be performed, the operands
decoding the instruction, and generating the control signals. involved, and any additional information needed for
It is also responsible for resolving jump and branch target execution.
addresses. The RV32I architecture includes various
components such as the program counter, target address 3.3. Execute Stage
selection logic, instruction memory controller, instruction The Execute stage is responsible for carrying out the
decoder, and a control unit. Furthermore, it incorporates a actual computations in a processor. Usually, this stage
dedicated adder responsible for incrementing the program incorporates an Arithmetic Logic Unit (ALU). In addition to
counter in each cycle. The control unit is purely the ALU, it may also include a multiple-cycle multiplier and
combinatorial, with all the control signals generated in the divider for more complex mathematical operations. The ALU
same cycle. is responsible for performing Boolean operations (and, or,
not, nand, nor, xor, xnor) and also for performing integer
A comparison of synthesis and implementation has been addition and subtraction. The bit shifter is responsible for
conducted on two Virtex family boards, considering shifts and rotations.
utilization reports and power reports as the evaluation criteria
[3]. 3.4. Memory Stage
If data memory needs to be accessed, it is done in this
3. Materials and Methods stage. It is responsible for performing memory-related
Once we have designed and optimized each sub- operations, such as loading data from memory or storing data
component, we must integrate them in a way that enables in memory.
them to collaborate effectively and deliver the expected
output for each instruction. Achieving this often requires 3.5. Writeback
making specific modifications to the design of each sub- During this stage, both single-cycle and two-cycle
component to ensure smooth integration with the others. instructions store their results in the register file. It is
Pipeline stages are made by adding registers to store the important to note that two different stages access the register
result from each stage so that another instruction can be file simultaneously. The decode stage reads two source
processed after the first instruction. SDC file is added to registers, while the writeback stage writes the destination
provide constraints for the design so that we can find the register of a previous instruction. This situation can lead to a
maximum operating frequency. hazard on actual silicon (more on hazards below). A hazard
arises when there is a conflict between the source registers
Before uploading the design to the FPGA, we convert being read in the decode stage and the destination register
the desired C code that we want to execute on the RISC-V being written in the writeback stage. In such cases, the same
core we covert into a hex file. This is because our digital memory cells in the register file are read and written
design cannot understand high-level code. Therefore, we simultaneously. The block diagram of the design is shown
need to convert these instructions to hex values that can be below.
read by our design. The path of this hex file is then provided
to the design via Platform Designer (formerly known as 3.6. Block Diagram
Qsys). The design is then compiled and uploaded to the
ALU Register
FPGA. While it's possible to use our own design for the File
PC Decoder Ext.
register file during simulations, when implementing it on the Memory
FPGA, we'll need to rely on the internal memory blocks of Register
the FPGA instead. File
Multiplier
The different functions of the pipeline stages are Instr. RS1
Memory Staller Register
mentioned below [11]:
Divider
Ext.
3.1. Instruction Fetch RS2 Memory
The instructions reside in memory that takes one cycle to Register
read. This memory can be dedicated to SRAM or an
Decoder
Instruction Cache. During the Instruction Fetch stage, a 32- Fig. 1 Block Diagram
bit instruction is fetched from the instruction memory.
4. Results
3.2. Instruction Decode The following results are from the simulation of the
During the instruction decodes stage, the core receives RV32IM core on Intel QuestaSim. The results shown are for
the instruction from the previous fetch stage. The instruction basic operations taking place within the core
18
Anmol Singh et al./ IJVSP, 10(2), 17-21, 2023
19
Anmol Singh et al./ IJVSP, 10(2), 17-21, 2023
20
Anmol Singh et al./ IJVSP, 10(2), 17-21, 2023
The paper also demonstrates the design's 5-stage Additionally, the paper aims to explore advanced
pipeline and branch prediction capabilities whilst illustrating features and their integration within the RISC-V framework,
its functionality through simulation and hardware results. like the 5-stage pipeline and branch prediction, all combined,
Further, the paper also aims to showcase the development of forming a large hardware and software ecosystem.
the architecture core on the DE10 Lite board.
References
[1] Akshay Birari et al., “A RISC-V ISA Compatible Processor IP,” 24th International Symposium on VLSI Design and Test, pp. 1-6, 2020.
[CrossRef] [Google Scholar] [Publisher Link]
[2] Aneesh Raveendran et al., “A RISC-V Instruction Set Processor Microarchitecture Design and Analysis,” International Conference on
VLSI Systems, Architectures, Technology and Applications, pp. 1-7, 2016. [CrossRef] [Google Scholar] [Publisher Link]
[3] Aslesa Singh et al., “Design and Implementation of a 32-bit ISA RISC-V Processor Core using Virtex-7 and Virtex-UltraScale,” IEEE,
5th International Conference on Computing Communication and Automation, pp. 126-130, 2020. [CrossRef] [Google Scholar]
[Publisher Link]
[4] Sudhir Dagar, and Geeta Nijhawan, “Area Efficient Moving Object Detection using Spatial and Temporal Method in
FPGA,” International Journal of Engineering Trends and Technology, vol. 70, no. 9, pp. 138-147, 2022. [CrossRef] [Publisher Link]
[5] I. Kuroda et al., “A 16-bit Parallel MAC Architecture for a Multimedia RISC Processor,” IEEE, Workshop on Signal Processing
Systems, SIPS 98, Design and Implementation, pp. 103-112, 1998. [CrossRef] [Google Scholar] [Publisher Link]
[6] Shofiqul Islam et al., “Design of High-Speed-Pipelined Execution Unit of 32-bit RISC Processor,” Annual IEEE India Conference, pp.
1-5, 2006. [CrossRef] [Google Scholar] [Publisher Link]
[7] Adrian Oleksiak et al., “Design and Verification Environment for RISC-V Processor Cores,” MIXDES - 26th International Conference
‘Mixed Design of Integrated Circuits and Systems’, pp. 206-209, 2019. [CrossRef] [Google Scholar] [Publisher Link]
[8] Don Kurian Dennis et al., “Single Cycle RISC-V Micro Architecture Processor and its FPGA Prototype,” 7th International Symposium
on Embedded Computing and System Design, pp. 1-5, 2017. [CrossRef] [Google Scholar] [Publisher Link]
[9] Yang Jing et al., “Electrical Diagnosis of Temperature-Dependent Global Clock Failures Using Probeless Isolation and Pattern
Commonality Analysis,” 19th IEEE International Symposium on the Physical and Failure Analysis of Integrated Circuits, pp. 1-6, 2012.
[CrossRef] [Google Scholar] [Publisher Link]
[10] Ludovico Poli et al., “Design and Implementation of a RISC V Processor on FPGA,” 17th International Conference on Mobility,
Sensing and Networking, pp. 161-166, 2021. [CrossRef] [Google Scholar] [Publisher Link]
[11] David A. Patterson, and John L. Hennessy, Computer Organization and Design RISC-V Edition: The Hardware Software Interface,
Morgan Kaufmann Publisher, Elsevier, 2017. [Google Scholar] [Publisher Link]
[12] Andrew Waterman et al., The RISC-V Instruction Set Manual, EECS Department, University of California, 2016. [Google Scholar]
[Publisher Link]
[13] Reinhold P. Weicker, “Dhrystone: a Synthetic Systems Programming Benchmark,” Communications of the ACM, vol. 27, no. 10, pp.
1013-1030, 1984. [CrossRef] [Google Scholar] [Publisher Link]
[14] Jan Andersson, “Development of a NOEL-V RISC-V SoC Targeting Space Applications,” 50th Annual IEEE/IFIP International
Conference on Dependable Systems and Networks Workshops, pp. 66-67, 2020. [CrossRef] [Google Scholar] [Publisher Link]
[15] Jaewon Lee et al., “RISC-V FPGA Platform toward ROS-Based Robotics Application,” 30th International Conference on Field-
Programmable Logic and Applications, pp. 370-370, 2020. [CrossRef] [Google Scholar] [Publisher Link]
[16] RISC-V Specifications, 2021. [Online]. Available: https://riscv.org/technical/specifications
[17] Pierre Maillard et al., “Test Methodology & Neutron Characterization of Xilinx 16nm Zynq® UltraScale+™ Multi-Processor System-
on-Chip (MPSoC),” IEEE Radiation Effects Data Workshop (REDW), pp. 1-4, 2018. [CrossRef] [Google Scholar] [Publisher Link]
21