Professional Documents
Culture Documents
Abstract— RISC-V is an open source instruction set stages namely – Instruction Fetching, Instruction Decoding,
architecture (ISA) based on the principles of Reduced Executing, Memory Access, Writing Back. Each stage is
Instruction Set Computation (RISC).In this paper; a 32-bit designed in such a way that a new instruction should start at
pipelined RISC-V Instruction set architecture has been every cock cycle and each stage must finish its execution
designed. The design is implemented in such a way that at within one clock cycle. Finally, a reusable verification
every clock cycle a new instruction is started and each stage platform is built using System Verilog to perform functional
finishes its execution within one clock cycle. The hazards in verification and to collect coverage.
pipeline like structural, data and control hazards are removed.
Furthermore, the Universal Verification Methodology (UVM)
is used to build the verification platform to verify the RTL II. RISC-V ISA DESIGN
code, then by using functional coverage it is verified that all the
DUT features have been verified and have measured the A. Instruction formats
quality of verification. The synthesized RTL code is reliable The RISC V instruction are classified into seven formats.
and fully verified. They are
Keywords—RISC-V, Verilog, System Verilog, UVM, U-type : It is used for instructions that use a 20-bit
Functional Coverage, EDA tools. immediate operand and an rd destination register.
J-type : The J-type instruction format is used to encode
I. INTRODUCTION the jal instruction with an immediate value that determines
Up till 1980s most realization of ISA i.e., CPU got more the jump target address. It is similar to the U-type, but the
and more complicated because of using CISC (Complex bits in the immediate operand are arranged in a different
Instruction Set Computing). As CISC instructions took order.
several clock cycle to execute a single instruction,
R-type : The R-type instructions are used for operations
implementation of pipeling is complex, this results in slower that set a destination register rd to the result of an arithmetic,
speed and slow memory access. In early 1980s the IBM logical or shift operation applied to source registers rs1 and
researcher John Cocke and his team created the first rs2.
prototype computer employing a reduced instruction set
computer (RISC) architecture. Then Prof. Krste Asanović I type : The I-type instruction format is used to encode
and graduate students Yunsup Lee and Andrew Waterman instructions with a signed 12-bit immediate operand with a
started the RISC-V instruction set in May 2010 as part of the range of [−2048..2047], an rd register, and an rs1 register.
Parallel Computing Laboratory (Par Lab) at UC Berkeley, of
which Prof. David Patterson was Director[2]. RISC-V is a S-type : The S-type instruction format is used to encode
new instruction set architecture (ISA) designed to support instructions with a signed 12-bit immediate operand with a
computer architecture research and education[1].The main range of [−2048..2047], an rs1 register, and an rs2 register.
idea of RISC V is on each clock cycle an instruction gets B-type : The B-type instruction format is used for branch
executed and the memory is fixed size which allows to instructions that require an even immediate value that is used
decode the instruction easy. The RISC V is defined as a set to determine the branch target address as an offset from the
of modules – BASE and EXTENSION module. This allows current instruction’s address.
any implanter to select which features to incorporate into a
CPU design. For any RISC V implementation, one of BASE
module and zero or more of EXTENSION module is
provided. RV32I refers to the 32-bit base integer instruction Funct3 Instruction Opcode
set. Standard RISC-V extensions are defined as M for 000 beq 1100011
multiplication and division, F for floating-point instructions, 001 bne 1100011
D for double-point precision instructions, and A for atomic
instructions. In addition, RV32G is a general-purpose 32-bit 100 blt 1100011
instruction set that includes all instructions from the M, F, D, 101 Bge 1100011
and A extensions. There also exist the 64-bit and 128-bit 110 Bltu 1100011
variants of these instruction sets. This paper is focused on
111 Bgeu 1100011
RV32I base module.
000 lb 0000011
In this paper, the 32-bit RISC V ISA processor is
designed with Verilog Language, mainly in five pipelined 010 lw 0000011
000 sb 0100011 Clock 1 2 3 4 5 6
010 sw 0100011 Iteration
000 addi 0010011 i IF ID EXE MEM WB
100 xori 0010011 i+1 IF ID EXE MEMWB
110 ori 0010011 i+2 IF ID EXE MEM
111 andi 0010011 i+3 IF ID EXE
000 add 0110011 Fig. 2 Five stage pipelined cycle.