IEEE Conference Template 1
IEEE Conference Template 1
Abstract—This abstract aims at the design and physical im- [2.]The design and implementation of a 32-bit single-
plementation of a 32-bit single-cycle RISC-V processor using cycle RISC-V processor in Verilog is a sophisticated and
open-source tools, with demonstration of end-to-end digital VLSI elaborate process that aims to create a functioning processor
design flow from RTL to GDSII. The processor is implemented in
Verilog HDL and supports the RV32I instruction set. Functional architecture that adheres to the RISC-V instruction set. To
verification is accomplished using GTKWave for waveform anal- execute instructions in a single clock cycle, this research work
ysis and simulation validation. After RTL validation, the design requires the synthesis of components such as the program
is synthesized and mapped with Yosys, placed with GrayWolf, counter, register file, arithmetic logic unit (ALU), and memory
and routed with Qrouter, all under the Qflow toolchain. The modules. The Verilog-based implementation includes RISC-V
flow produces a DRC-clean GDSII layout, an entire physical
chip layout ready for manufacturing. The single-cycle design instructions such as arithmetic, memory access, and control
executes each instruction in one clock cycle, providing a balance flow instructions. The design prioritizes simplicity and clarity,
of performance and simplicity that is appropriate for educational laying the groundwork for educational study and the eventual
and prototyping applications. The project proves the viability development of more advanced processing functionality.
of using purely open source EDA tools in processor design, [3.]RISC-V is a very novel ISA(instruction-set architecture)
verification, and layout, and thus is a good practice for students
and researchers in the domain of VLSI and digital systems. recently launched features such as low power consumption,
Index Terms—RISC-V, GTKWave, Qflow, Verilog HDL, Open- low cost, and scalability. In the future, IoT(Internet of
source EDA, Processor Design, RTL-to-GDSII Things) devices will be developed in a large amount, and the
characteristics of RISC-V are exactly what IoT devices need.
I. I NTRODUCTION single-cycle processor completes each instruction in one clock
In recent years, the open-source hardware movement has cycle, providing simplicity in control logic and predictability
gained great momentum, with RISC-V leading the way as in timing. The processor is designed using Verilog HDL,
an open and extensible instruction set architecture (ISA). simulated and debugged with GTKWave, and synthesized to
This project entails the design, verification, and physical GDSII layout using the Qflow toolchain. This end-to-end flow
implementation of a 32-bit single-cycle RISC-V processor provides hands-on experience in digital design, bridging the
with the aid of open-source tools. [1.] The RISC-V ISA gap between theoretical computer architecture and practical
is becoming one of the leading instruction sets for the VLSI design.
Internet-of-Things and System-on-Chip applications. Due
to its strong security features and open-source nature, it is
becoming a competitor to the popular ARM architecture. This
paper describes the design of a light weight, open-source The project intends to present a contemporary, cost-effective
implementation of a RISCV processor using modern hardware way of understanding processor design by applying a RISC-
design teclmiques, the implementation of the design onto a V processor with the help of open source tools. This helps
Field Programmable Gate Array (FPGA), and its testing. We improve students’ performance and rectifies the shortcomings
wanted to create a RISC-V processor that is easy for beginners of conventional methods, i.e., outdated documentation-based
to learn from and lightweight enough to be implemented on methodologies and the lack of hands-on access to proprietary
even small FPGAs. tools.
II. M ETHODOLOGY
A. RISC-V ISA Design and Instruction set choice
The RISC-V RV32I ISA in this processor design is a 32-bit
basic instruction set that is simple but efficient for operations.
The ISA includes four main instruction types: R-type, I-
type, S-type, and SB-type, each performing different functions
within the processor.
R-type instructions are used for register-to-register opera-
tions like ADD, SUB, AND, and OR. These instructions have
a structure with fields named funct7, rs2, rs1, funct3, rd, and
opcode. This setup allows for precise ALU operations that
take two source registers and produce a result in a destination
register.
I-type instructions, such as ADDI and LW, use an immediate
value instead of a second source register. This setup allows for
Fig. 2. Single cycle RISC-V Architecture
tasks like constant arithmetic and memory loads. The fields in
this type are a 12-bit immediate, rs1, funct3, rd, and opcode.
S-type instructions are for SW (store word) operations,
2) Instruction Memory: Instruction Memory is a read-only
where data is written to memory. The immediate value is split
memory (ROM) module that stores the RISC-V machine
over two fields ([11:5] and [4:0]) for encoding.
instructions. The address fed to this memory is from the PC,
SB-type instructions, like BEQ (branch if equal), are for
and the output is a 32-bit instruction. This instruction gets
conditional branching. They feature a divided immediate field
decoded to infer the operation type, register operands, and
that enables jumps based on relative offsets to change control
immediate values.
flow.
The regular and straightforward format structure makes
the decoder hardware relatively easy, which saves space in 3) Control Unit: The Control Unit is responsible for
Verilog implementation. By using only these basic formats, understanding the opcode field of the instruction. It uses
the processor achieves high flexibility without needing very this opcode to create proper control signals that direct the
complex hardware. Additionally, the fixed 32-bit instruction operation of the datapath units. These control signals dictate
length allows for consistent fetch and decode phases, ideal what the ALU should perform, whether the register file or
for a single-cycle design. The use of RV32I ensures that data memory must be read, and which data paths should be
even a minimal processor core can perform a wide range taken using multiplexers.
of computations, memory access instructions, and branching,
making it a strong platform for education, prototyping, and 4) Register File: The Register File holds 32 general-
open-source VLSI design. purpose 32-bit registers utilized in RISC-V. It supports two
registers being read at the same time depending on source
register addresses from the instruction. If the instruction is
to write out a result (such as arithmetic operations or load
instructions), it supports writing into the destination register
of the instruction.
Fig. 5. Placement
Fig. 6. Routing 10) GDS (Final Output): The last step in Qflow is
creating the GDSII file, the mask generation and fabrication
5) Routing: Routing refers to the creation of metal industry standard. Magic will be employed to save the verified
interconnections among the placed cells to finish the circuits. layout to a .gds file. This GDS file has all the geometry and
Qflow employs Qrouter to execute detailed routing from the layer data required for fabrication of the chip and is the final
DEF file placement. The objective is to reduce delay and product to be delivered to the foundry.
prevent design rule violations. It also considers routing layers,
C. Discussion D. Figures and Tables
a) Positioning Figures and Tables: Figure and table
The proper implementation of all RV32I base instructions in
placement complies with IEEE requirements. Example wave-
a single clock cycle highly supports the correctness of the RTL
forms and layouts were inserted to showcase processor func-
(Register Transfer Level) design, especially the control logic
tionality.
and datapath of the processor. As RV32I is the basic instruction
set of the RISC-V architecture, including arithmetic, logical,
load/store, branch, and control instructions, this ensures that
the processor works as expected for a wide variety of opera-
tions. Single-cycle execution means every instruction, whether
data or control, finishes the whole decode, execution, memory,
and write-back in a single clock cycle, requiring very accurate
control signal generation and highly synchronized submodules.
The module-based Verilog design methodology significantly
eased design readability and debugging. With the processor
divided into clearly defined, self-contained submodules like
the Arithmetic Logic Unit (ALU), Control Unit, Register File,
and Data/Instruction Memory, each module’s behavior could
be independently validated by designers. Through modularity, Fig. 8. Modules used in risc-V processor
signal tracing and identification of problems while functional
simulation was made simpler, and bugs and performance The architecture of the processor is partitioned into various
hotspots could be attacked systematically. modules in a modular fashion, each having distinct functions
Simulation was instrumental in verifying the processor. to perform in the instruction cycle. The following is an
Programs such as GTKWave were employed in combination outline of the principal modules used by the single-cycle
with waveform dump files (e.g., .vcd) in order to view signal RISC-V processor:
changes over time. GTKWave permitted the examination of
internal signals such as ALU inputs/outputs, control signals, Program Counter (PC): Program Counter stores the address
register contents, program counter updates, and memory of the instruction being processed. After every instruction, it
access activity. This ensured the processor processed each is incremented (or conditionally modified) to point to the next
instruction properly at every step and showed the effect of instruction. It has an important role in instruction sequencing.
control signals on data paths while executing.
Instruction Memory: It is read-only memory that keeps
Application of Qflow, an open-source digital ASIC design RISC-V instruction set as machine code. When given an
flow, demonstrated that it can definitely be used to synthesize, address by the Program Counter, it delivers the 32-bit
place, route, and generate a layout from the RTL Verilog instruction to be decoded and executed. It contains 32
description of a RISC-V processor. Applications such as general-purpose registers that are 32 bits wide. Two registers
Yosys (synthesis), GrayWolf (placement), Qrouter (routing), are read at one time and one is written in each cycle. The
Netgen (LVS), Magic (DRC and layout visualization), and Register File is used for fast data access and is the core for
OpenSTA (timing analysis) were utilized in combination to instruction execution.
implement a complete ASIC backend flow. This proved that
high-quality digital designs can be constructed completely Arithmetic Logic Unit (ALU): The ALU executes all the
using free and open-source EDA tools, which makes this arithmetic and logical operations like addition, subtraction,
method very useful for academic and prototyping purposes. AND, OR, etc., depending upon the control signals obtained
from the instruction. It is the heart of the processor’s
As a whole, the project successfully applied a full open- computational engine.
source RTL-to-GDSII flow to a single-cycle 32-bit RISC-V
processor. This provides a good basis for future extensions. Control Unit: The Control Unit interprets the opcode of
Possible upgrades include the addition of instruction pipelin- the instruction fetched and produces valid control signals to
ing, where more than one instruction would be executed in synchronize the operation of other modules. These signals
parallel for better throughput. Other future directions could be are like ALU operation selection, memory read/write, register
the introduction of other RISC-V extensions such as RV32M write enable, etc.
for division and multiplication, or interfacing the processor
to external memory modules or peripherals using standard Data Memory: Employed in LW (load word) and SW (store
buses, allowing real-world embedded applications and system word) instructions, the data memory enables the processor
integration. to communicate with temporary storage devices. It provides
support for both read and write operations of 32-bit data. [6.]D. A. Patterson and J. L. Hennessy, Computer
Organization and Design: The Hardware/Software Interface,
Immediate Generator: This module takes immediate values 5th ed., Morgan Kaufmann, 2013.
from instruction fields and sign-extends them to 32 bits. It
provides support for various RISC-V formats like I-type, [7.]M. J. Flynn and W. Luk, Computer System Design:
S-type, and B-type, enabling correct address and operand System-on-Chip, Wiley, 2011.
calculations.
[8.]GTKWave, ”GTKWave - Analyzing simulation wave-
Multiplexers (MUXes): MUXes are used to select between forms,” [Online]. Available: [Link]
multiple data sources in the datapath. They are controlled
by signals from the Control Unit and play a critical role in [9.]T. Becker, ”Qflow: A VLSI Flow Based
routing operands to the ALU and determining destination on Open-Source Tools,” [Online]. Available:
addresses for data. [Link]
IV. ACKNOWLEDGMENT
The authors gratefully acknowledge the support provided
by the Department of Electronics and Communication En-
gineering, Gokaraju Rangaraju Institute of Engineering and
Technology, Hyderabad, India, for the support they received.
This work could not have been achieved without the technical
resources, lab facilities, and academic advice from the depart-
ment. We also appreciate the sincere thanks of the faculty
members for their fruitful suggestions during the design, sim-
ulation, and verification process. Their support and comments
made a big contribution to the successful completion of the
implementation of the RISC-V processor using open-source
tools.
V. R EFERENCES
[1.]L. Poli, S. Saha, X. Zhai and K. D. Mcdonald-Maier,
”Design and Implementation of a RISC V Processor on
FPGA,” 2021 17th International Conference on Mobility,
Sensing and Networking (MSN), Exeter, United Kingdom,
2021.
[3.]J. -Y. Lai, C. -A. Chen, S. -L. Chen and C. -Y. Su,
”Implement 32-bit RISC-V Architecture Processor using
Verilog HDL,” 2021 International Symposium on Intelligent
Signal Processing and Communication Systems (ISPACS),
Hualien City, Taiwan, 2021.