Sample Project Report
Sample Project Report
December 2020
Design and Simulation of Reduced Instruction Set Computer
(RISC) Processor in VerilogHDL
by
Senior Design Project submitted to the Department of Electrical Engineering, College of Engineering, King
Khalid University in partial fulfilment of the requirements for the graduation degree of Bachelor of Science
in Electrical Engineering
This document describes work undertaken as part of a programme of study at College of Engineering,
King Khalid University. All views and opinions expressed therein remain the sole responsibility of the
author, and do not necessarily represent those of the institute.
Abstract
In modern day processors architectures, Reduced Instruction Set Computer (RISC) is an efficient and basic
design architecture among Complex Instruction Set Computer (CISC) and RISC as it uses simple commands
that can be divided into several instructions which achieves low-level operations with a single clock cycle.
Compared with CISC which takes a complex time to execute the instructions was reducing the performance
of computing where the speed was drowning when CPU contacts the data memory. In this project work we
have designed the 16-bit RISC processor components in VerilogHDL. The RISC processor are used in
today’s RISC CPUs (and microcontrollers) and represent the vast majority of all CPUs in use. In this work,
the VerilogHDL Coding has been performed for RISC Processor components such as register, ALU, Control
unit, Instruction memory, and data memory for their functional performance and device utilization. It is
found in the synthesis that the Register, ALU, Control Unit, Instruction Memory, and data memory have
number IOBs (Input/Output Block to implement I/O functions) 25%, 21%, 6%, 8%, and 7%. Here, the
memory registers are occupying 25% area whereas control unit has lowest 6%. By improving the
VerilogHDL synthesizable constructs, the area efficiency may be achieved by lowering the IOBs in future.
i
Acknowledgements
First, we thank Almighty Allah for completing our project with all success and competence.
We would specially thank to Chairman of Electrical Engineering Department Dr. Saad Fahd Al-Qahtani for
constantly motivating us to work harder and giving us great support.
We would like to express our special thanks to our Project Supervisor Dr. Neeraj Kumar Shukla for
providing his invaluable guidance, comments, and suggestions throughout the course of the project. and who
gave us the golden opportunity to do this wonderful project on the topic Design and Simulation of Reduced
Instruction Set Computer (RISC) Processor in VerilogHDL, which also helped us in doing a lot of Research
and we came to know about so many new things we are really thankful to him.
Also, we are grateful to our project assessment board Prof. Fazle Azeem, Dr. Mohammed Zubair, and Dr.
Fakher Aldiyn for their encouragement, insightful comments.
Last but not the least, we would like to thank our family members and staff members of our Institution King
Khalid University for their kind cooperation and moral boost-ups that helped us to overcome each small and
big hurdle during the entire process of project development.
ii
Table of contents
Acknowledgement
Abstract
1. Introduction 7
1.1 Objective and Goals 7
1.1.1 Primary Objectives 7
1.2 Outline of the Thesis 8
2. Literature Review 9
2.1. The RISC Processor 9
2.2 RISC vs. CISC 10
2.2.1 CISC Design 10
2.3 The bridge toward RISC (Historical factors) 10
2.4. Why RISC? 11
2.4.1 Pre-fetching 11
2.4.2 Pipelining 11
2.4.3 Superscalar operation 11
2.5 Architecture Description 11
2.6 RISC Processor 13
2.7 Description of Functional Modules 13
2.7.1 Program Counter Unit (PCU) 13
2.7.2 Instruction Memory 14
2.7.3 Control Unit 14
2.7.4 Data Memory 14
2.7.5 ALU Unit 14
2.7.6 Accumulator 15
2.7.7 Register set 15
2.7.8 Interrupt module 15
2.7.9 1/0 Module 15
3. Methodology 16
3.1 Hardware Description Language 16
3.1.1 What is Verilog HDL? 16
3.1.2 Module Syntax 16
3.1.3 Example: Simple ALU Design at Xilinx ISE 14.7 17
5. Results Analysis 45
5.1 Study of Device Utilization 45
5.2 Results and Analysis 46
8. References 49
Appendix 50
iv
List of figures
Figure 2.1 (a) RISC Architecture (b) Architecture of 16-bit RISC Processor 12
Figure 3.1 ALU Design at Xilinx ISE 14.7 Platform. (a) VerilogHDL Code (b) 18
RTL View-Top Level (c) RTL Schematic-Block Level (d)
Technology Schematic (e) Simulation Waveforms (f) XPower
Analysis
Figure 4.1 (a) Register Module-Top level View (b) Register Module-Block level 21
View (c) Register Module-Technology View (d) Register Module –
Simulation Waveforms
Figure 4.2 (a) ALU Module-Top level View (b) ALU Module-Block level View 24
(c) ALU Module-Technology View (d) ALU Module – Simulation
Waveforms
Figure 4.3 (a) ALU Control Logic Module-Top level View (b) ALU Control 27
Logic Module-Block level View (c) ALU Control Logic Module-
Technology View (d) ALU Control Logic Module – Simulation
Waveforms
Figure 4.4 (a) Control Unit Logic Module-Top level View (b) Control Unit 33
Logic Module-Block level View (c) Control Unit Logic Module-
Technology View (d) Control Unit Logic Module – Simulation
Waveforms
Figure 4.5 (a) Instruction Memory Unit Logic Module-Top level View (b) 36
Instruction Memory Unit Logic Module-Block level View (c)
Instruction Memory Unit Logic Module-Technology View (d)
Instruction Memory Unit Logic Module – Simulation Waveforms
Figure 4.6 (a) Data Memory Unit Logic Module-Top level View (b) Data 40
Memory Unit Logic Module-Block level View (c) Data Memory
Unit Logic Module-Technology View (d) Data Memory Unit Logic
Module – Simulation Waveforms
v
List of tables
Table 4.1 Register Module: Device Utilization Summary and IOB Report 23
Table 4.2 ALU Module: Device Utilization Summary and IOB Report 26
Table 4.3 ALU Control Unit: Device Utilization Summary and IOB Report 29
Table 4.4 Control Module: Device Utilization Summary and IOB Report 35
Table 4.5 Instruction Memory Module: Device Utilization Summary and IOB 39
Report
Table 4.6 Instruction Memory Module: Device Utilization Summary and IOB 42
Report
vi
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
1. Introduction
The Reduced Instruction Set Computer (RISC) is a microprocessor CPU design philosophy that favours a
smaller and simpler set of instructions that all take about the same amount of time to execute. The most
common RISC microprocessors are ARM, DEC Alpha, PA-RISC, SPARC, MIPS, and IBM's PowerPC.
The idea was inspired by the discovery that many of the features that were included in traditional CPU
designs to facilitate coding were being ignored by the programs that were running on them. Also these more
complex features took several processor cycles to be performed. Additionally, the performance gap between
the processor and main memory was increasing. This led to a number of techniques to streamline processing
within the CPU, while at the same time attempting to reduce the total number of memory accesses.
When the controller design become more complex in CISC and the performance was also not up to
expectations, people started looking on some other alternatives. It had been found that when a processor talks
to the memory the speed gets killed. So the one improvement on CPI was to keep the instruction set very
simple. Simple in not the way it works but the way it looks. That’s why we have very few instructions in any
typical RISC architecture where processor asks data from memory probably not other than Load and Store.
We avoid keeping such addressing modes. The complexity of controller design has been overcome with the
help of operands and Opcode bits fixed in instruction register. At the end the pipelining added a new
dimension in the speed just with the help of some additional registers. Now what pipeline does is it increases
throughput by reducing CPI. The instruction can be executed effectively in one clock cycle. The pipelining
in any kind of architecture took birth from the inherent parallelism and the idle states of components. The
pipelined architecture could be further enhanced with the concepts known as super-scaling. There we provide
more than one execution unit. The time when one unit is busy with the current execution task, the fetch unit
can probably fetch the next instruction which would be executed with the help of some other execution unit
present in system.
Simple addressing modes (complex addressing modes are replaced by sequences of simple arithmetic
instructions). Few data types supported in hardware (for example, some CISC machines had instructions for
dealing with byte strings. Others had support for polynomials and complex numbers. Such instructions are
unlikely to be found on a RISC machine). Over many years, RISC instruction sets have tended to grow in
size. Thus, some have started using the term "load-store" to describe RISC processors, since this is the key
element of all such designs. Instead of the CPU itself handling many addressing modes, load-store
architecture uses a separate unit dedicated to handling very simple forms of load and store operations. CISC
processors are then termed "register-memory" or "memory-memory".
The Software Implementation of RISC processor components using RTL design methodologies.
7
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
This thesis is organized as follows, The Chapter 1 provides a brief introduction and review on the design and
implementation of RISC processor and it’s components for a general purpose processor as a primary
objectives of the project. The Chapter 2 provides a literature survey on the RISC processor and its
implementation methodologies. Chapter 3 starts with the review on the detailed explanation regarding the
design components of the system. This chapter is the core of the project. It explains the proposed system
model and technique used in this project, which is the RTL design and synthesis. The Chapter 4 presents the
implementation method, results and associated discussions and Chapter 5 concludes the thesis followed by
the references and appendix.
8
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
2. Literature Review
The central unit of all smart devices are Processors, whether they be electronic devices or
otherwise. Their smartness comes as a direct result of the decisions and controls that processor
makes. The existing commercial microprocessors are provided as black box units; with which users
are unable to monitor internal signals and operation process, neither can they modify the original
structure. In order to solve this problem 16-bit fully functional single cycle processor is designed in
terms of its architecture and its functional capabilities. The procedure of design and verification for
a 16-bit processor is introduced in this paper. The key architecture elements are being described, as
well as the hardware block diagram and internal structure. The summary of instruction set is
presented. This processor is modify as a VERILOG Hardware Description Language
(VERILOGHDL) and gives access to every internal signal. In order to consume fewer resources,
the design of arithmetic logical unit (ALU) is optimized. The RTL views and verified simulation
results of processor are shown in this paper. The synthesis report of the design is also described.
The design architecture is written in VERILOG Hardware Description Language (VERILOGHDL)
code using Xilinx ISE tool for synthesis and simulation [1].
In [2] the Reduced Instruction Set Computer (RISC) processor for better performance has been
presented. The designed processor was simulated and synthesized using Xilinx 14.7 ISE design
suite. The processor executes each and every instruction in more than one cycle that's why the term
multi-cycle. Each instruction is divided into three main states namely the Fetch state, the Decode
state and the Execution state. The first two sates remain the same for all the instruction the last state,
however depends on the type of operation performed in that instruction.
Shraddha M. Bhagat, etal, presented a design of 16-bit RISC processor in [3] using the
VerilogHDL. The RISC processor comprises of the blocks mainly ALU, Controller, Register files,
and Data memory unit. The proposed processor carried out with the help of von Neumann
architecture, having only one shared memory for instruction and data. The proposed RISC
processor which can be very, simple and clean to investigate contains 15 instructions. ModelSim is
used for logical verification. The proposed RISC processor is analyzed using Xilinx ISE tool.
According to the authors in [4], RISC is a design philosophy to reduce the complexity of instruction
set that in turn reduces the amount of space, cycle time, and cost, power consumption taken into
account during the implementation of the design. The existing system is an Arithmetic and Logical
Unit which performs only Arithmetic operations such as ADD, SUB, MUL, DIV and logical
operations such as AND, OR, NAND, NOR, NOT, XOR, XNOR operations and consumes more
power .The execution delay is also high. To overcome the above mentioned problems, 16-bit RISC
9
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
processor is proposed. 16-bit low power RISC processor consists of the blocks mainly ALU,
Universal shift register and Barrel Shifter. This system consumes less power and the execution
delay is also less. The processor is designed using XILINX ISE Design suit 14.3 & the total power
estimation is done by the X Power analyzer.
As more and more capabilities were added to the processors, it was found increasingly difficult to
support higher clock speeds that would otherwise have been possible. Complex instructions and
addressing modes worked against higher clock speeds, because of the greater number of
microscopic actions that had to be performed per instruction. Moreover, RAM prices dropped
sufficiently so that the pressure on system designers was less to design instructions that did more
that it was to design systems that were faster. It was also becoming cost-effective to employ small
amounts of higher-speed cache memory to reduce memory latency i.e. the writing time between
when a memory is made and when it has been satisfied. The comparison of CISC and RISC
Architectures is presented in Table 2.1.
CISC RISC
10
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
2.4.1 Pre-fetching: The process of fetching next instruction or instructions into an event queue
before the current instruction is complete is called pre-fetching. The earliest 16-bit
microprocessor, the Intel 8086/8, pre-fetches into a non-board queue up to six bytes following
the byte currently being executed thereby making them immediately available for decoding and
execution, without latency.
2.4.2 Pipelining: Pipelining instructions means starting or issuing an instruction prior to the
completion of the currently executing one. The current generation of machines carries this to a
considerable extent. The PowerPC 601 has 20 separate pipeline stages in which various portions
of various instructions are executing simultaneously.
2.4.3 Superscalar operation: Superscalar operation refers to a processor that can issue more
than one instruction simultaneously. The PPC 601 has independent integer, floating-point and
branch units, each of which can be executing an instruction simultaneously.
CISC machine designers incorporated pre-fetching, pipelining and superscalar operation in their
designs but with instructions that were long and complex and operand access depending on complex
address arithmetic, it was difficult to make efficient use of these new speed-up techniques.
Furthermore, complex instructions and addressing modes hold down clock speed compared to
simple instructions. RISC machines were designed to efficiently exploit the caching, pre-fetching,
pipelining and superscalar methods that were invented in the days of CISC machines.
11
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
has been selected then hardware description languages (HDLs) are used for modeling the system
which serves as a descriptive medium that can be used by a synthesis tool.
The internal architecture of a RISC Processor is shown in Figure. The processor consists of
arithmetic logic unit (ALU), a controller, register set, internal buses and multiplexers. Program to be
executed on the processor and data are stored in the external memory. Instructions are fetched
synchronously from memory, decoded, and executed by the processor.
Processor performs the following operations according to the instructions fetched from the memory.
(1) operate on data within the arithmetic and logic unit (ALU)
(2) change the contents of storage registers
(3) change the contents of the program counter (PC) instruction register (IR) and the address
register (Add_Reg)
(4) change the contents of memory
(5) retrieve data and instructions from memory
(6) control the movement of data on the system busses.
The instruction register contains the instruction that is currently being executed; the program
counter contains the address of the next instruction to be executed; and the address register
(Add_Reg), holds the address of the memory location that will be addressed next by a read or write
operation.
12
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
13
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
that contains the address (location) of the instruction being executed at the current time. As each
instruction is fetched, the program counter increases its stored value by one. In fetch cycle, an 18-
bit address bus known as IM ADDRBUS transfers Program Counter content to Instruction Memory
(IM) when the corresponding control signal is enabled. The Program Counter Save (PCS) stores (l8-
bit), Program Counter incremented by two value, when SA V PC instruction is executed. A
Program Counter Register (PCR) is used to store address of the instruction, when a jump instruction
is executed. ST ACKPC is used to store the current PC value during the execution of interrupt
service routine.
2.7.6 Accumulator
14
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
Accumulator is an 8-bit wide register, integral part of the proposed processor, as data transfer, ALU
operations and 1/0 operations takes place through it. Accumulator also contains increment,
decrement, and compliment, rotate right and rotate left operations.
15
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
3. Methodology
The VerilogHDL (Verify Logic Hardware Description Language)
IEEE Std. 1364-2001 & 2005
Verilog digital logic simulator tools allow to perform the following tasks in the design process
without building a hardware prototype.
Number Representation
<size><base format><number>
549 // decimal number
'h 8FF // hex number
'o765 // octal number
16
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
17
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
18
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
Figure 3: ALU Design at Xilinx ISE 14.7 Platform. (a) VerilogHDL Code (b) RTL View-Top Level (c)
RTL Schematic-Block Level (d) Technology Schematic (e) Simulation Waveforms (f) XPower Analysis
19
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
20
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
C. Technology Schematic
21
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
4.1.2 Simulation
The simulation waveform of Register module is presented in Figure 6.
Figure 4: (a) Register Module-Top level View (b) Register Module-Block level View (c) Register
Module-Technology View (d) Register Module – Simulation Waveforms
4.1.3 Device Utilization Report
22
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
The device utilization summary (estimated values) and IOB report is presented in Table 4.1. The
number of IOBs is 25%.
Table 4.1: Register Module: Device Utilization Summary and IOB Report
23
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
Figure 4.2(a)
Figure 4.2(b)
C. Technology Schematic
24
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
Figure 4.2(c)
4.2.2 Simulation
Figure 4.2(d)
Figure 4.2: (a) ALU Module-Top level View (b) ALU Module-Block level View (c) ALU Module-
Technology View (d) ALU Module – Simulation Waveforms
25
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
The device utilization summary (estimated values) and IOB report is presented in Table 4.2. The
number of IOBs is 21%.
Table 4.2: ALU Module: Device Utilization Summary and IOB Report
26
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
The Register Transfer Level (RTL) schematic of Register Module is shown in Figure 4.3 Register
Module-Top level View, Register Module-Block level View, and Register Module-Technology
View.
27
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
4.3.2 Simulation
Figure 4.3: (a) ALU Control Logic Module-Top level View (b) ALU Control Logic Module-Block
level View (c) ALU Control Logic Module-Technology View (d) ALU Control Logic Module –
Simulation Waveforms
28
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
The device utilization summary (estimated values) and IOB report is presented in Table 4.3. The
number of IOBs is 3%.
Table 4.3: ALU Control Unit: Device Utilization Summary and IOB Report
29
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
mem_read = 1'b0;
mem_write = 1'b1;
beq = 1'b0;
bne = 1'b0;
alu_op = 2'b10;
jump = 1'b0;
end
4'b0010: // data_processing
begin
reg_dst = 1'b1;
alu_src = 1'b0;
mem_to_reg = 1'b0;
reg_write = 1'b1;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b0;
bne = 1'b0;
alu_op = 2'b00;
jump = 1'b0;
end
4'b0011: // data_processing
begin
reg_dst = 1'b1;
alu_src = 1'b0;
mem_to_reg = 1'b0;
reg_write = 1'b1;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b0;
bne = 1'b0;
alu_op = 2'b00;
jump = 1'b0;
end
4'b0100: // data_processing
begin
reg_dst = 1'b1;
alu_src = 1'b0;
mem_to_reg = 1'b0;
reg_write = 1'b1;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b0;
bne = 1'b0;
alu_op = 2'b00;
jump = 1'b0;
end
4'b0101: // data_processing
begin
reg_dst = 1'b1;
alu_src = 1'b0;
30
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
mem_to_reg = 1'b0;
reg_write = 1'b1;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b0;
bne = 1'b0;
alu_op = 2'b00;
jump = 1'b0;
end
4'b0110: // data_processing
begin
reg_dst = 1'b1;
alu_src = 1'b0;
mem_to_reg = 1'b0;
reg_write = 1'b1;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b0;
bne = 1'b0;
alu_op = 2'b00;
jump = 1'b0;
end
4'b0111: // data_processing
begin
reg_dst = 1'b1;
alu_src = 1'b0;
mem_to_reg = 1'b0;
reg_write = 1'b1;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b0;
bne = 1'b0;
alu_op = 2'b00;
jump = 1'b0;
end
4'b1000: // data_processing
begin
reg_dst = 1'b1;
alu_src = 1'b0;
mem_to_reg = 1'b0;
reg_write = 1'b1;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b0;
bne = 1'b0;
alu_op = 2'b00;
jump = 1'b0;
end
4'b1001: // data_processing
begin
31
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
reg_dst = 1'b1;
alu_src = 1'b0;
mem_to_reg = 1'b0;
reg_write = 1'b1;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b0;
bne = 1'b0;
alu_op = 2'b00;
jump = 1'b0;
end
4'b1011: // BEQ
begin
reg_dst = 1'b0;
alu_src = 1'b0;
mem_to_reg = 1'b0;
reg_write = 1'b0;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b1;
bne = 1'b0;
alu_op = 2'b01;
jump = 1'b0;
end
4'b1100: // BNE
begin
reg_dst = 1'b0;
alu_src = 1'b0;
mem_to_reg = 1'b0;
reg_write = 1'b0;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b0;
bne = 1'b1;
alu_op = 2'b01;
jump = 1'b0;
end
4'b1101: // J
begin
reg_dst = 1'b0;
alu_src = 1'b0;
mem_to_reg = 1'b0;
reg_write = 1'b0;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b0;
bne = 1'b0;
alu_op = 2'b00;
jump = 1'b1;
end
32
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
default: begin
reg_dst = 1'b1;
alu_src = 1'b0;
mem_to_reg = 1'b0;
reg_write = 1'b1;
mem_read = 1'b0;
mem_write = 1'b0;
beq = 1'b0;
bne = 1'b0;
alu_op = 2'b00;
jump = 1'b0;
end
endcase
end
endmodule
33
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
C. Technology Schematic
4.4.2 Simulation
34
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
Figure 4.4: (a) Control Unit Logic Module-Top level View (b) Control Unit Logic Module-Block
level View (c) Control Unit Logic Module-Technology View (d) Control Unit Logic Module –
Simulation Waveforms
Table 4.4: Control Module: Device Utilization Summary and IOB Report
35
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
36
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
C. Technology Schematic
37
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
4.5.2 Simulation
Figure 4.5: (a) Instruction Memory Unit Logic Module-Top level View (b) Instruction Memory
Unit Logic Module-Block level View (c) Instruction Memory Unit Logic Module-Technology
View (d) Instruction Memory Unit Logic Module – Simulation Waveforms
38
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
The device utilization summary (estimated values) and IOB report is presented in Table 4.5. The
number of IOBs is 8%.
Table 4.5: Instruction Memory Module: Device Utilization Summary and IOB Report
39
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
The Register Transfer Level (RTL) schematic of Register Module is shown in Figure 4.6 Register
Module-Top level View, Register Module-Block level View and Register Module-Technology
View.
C. Technology Schematic
40
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
4.6.2 Simulation
Figure 4.6: (a) Data Memory Unit Logic Module-Top level View (b) Data Memory Unit Logic
Module-Block level View (c) Data Memory Unit Logic Module-Technology View (d) Data
Memory Unit Logic Module – Simulation Waveforms
4.6.3 Device Utilization Report
41
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
The device utilization summary (estimated values) and IOB report is presented in Table 4.6. The
number of IOBs is 25%.
Table 4.6: Data Memory Module: Device Utilization Summary and IOB Report
42
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
// instruction memory
Instruction_Memory im(.pc(pc_current),.instruction(instr));
// jump shift left 2
assign jump_shift = {instr[11:0],1'b0};
// multiplexer regdest
assign reg_write_dest = (reg_dst==1'b1) ? instr[5:3] :instr[8:6];
// register file
assign reg_read_addr_1 = instr[11:9];
assign reg_read_addr_2 = instr[8:6];
43
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
(
.clk(clk),
.mem_access_addr(ALU_out),
.mem_write_data(reg_read_data_2),
.mem_write_en(mem_write),
.mem_read(mem_read),
.mem_read_data(mem_read_data)
);
// write back
assign reg_write_data = (mem_to_reg == 1'b1)? mem_read_data: ALU_out;
// output to control unit
assign opcode = instr[15:12];
endmodule
44
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
5. Results Analysis
45
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
25%
25%
20% 21%
15%
10%
8%
5% 7%
6%
3%
0%
Register ALU ALU CU Control Unit Instruction Data Memory
Memory
Device Utilization
Figure 5.1: Simulation Waveforms with IOB Summary of Different Logic Blocks
46
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
47
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
7.1 Standards
The following list includes the IEEE strandards and constraints used in the project
7.2 Constraints
Time: Important constraint was the time and learning a new and state of the art Hardware
Description Language, the VerilogHDL. Through continuous meeting, the language learning,
project design and implementation criterion were discussed and decided. It took at least three to
four months to do literature survey, analysis, design the RISC processors compnents for general
purpose applications, also to analyze performance of RISC processor.
For the project: The Software implementation of RISC Processor components using HDL was
finished within 4 months. The language learning and coding part took much time and then it was
simulated and verified for it performance and contraints anlysis.
Teamwork: We have spitted the task among us and managed it to complete in time.
Ethics: We have maintained the ethics throughout the project.
48
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
8. References
1. M. Zaid and P. Mustajab, "Design and application of RISC processor," 2017 International
Conference on Multimedia, Signal Processing and Communication Technologies (IMPACT),
Aligarh, 2017, pp. 242-246, doi: 10.1109/MSPCT.2017.8364013.
2. Manoj Barfa, Deepak Sharma, “Implementation of 16 bit RISC Processor by FSM,” International
Journal Of Innovative Research In Technology, Vol. 4, Issue 12, May 2018, ISSN: 2349-6002
3. S. M. Bhagat and S. U. Bhandari, "Design and Analysis of 16-bit RISC Processor," 2018 Fourth
International Conference on Computing Communication Control and Automation (ICCUBEA),
Pune, India, 2018, pp. 1-4, doi: 10.1109/ICCUBEA.2018.8697859.
4. P Brundavani, Dupakuntla Vishnu Vardhan, P Mahesh, and Raja Suresh, “Design And Analysis
Of 16-Bit Risc Processor Using Low Power Pipeline,” in the Proc. National Conference on
Emerging trends in Information, management and Engineering sciences, “NC’ea-TIMES#1.0”-
2018, At: Rajampeta, June 2019
Appendix
49
DESIGN AND SIMULATION OF REDUCED INSTRUCTION SET COMPUTER (RISC) PROCESSOR IN VERILOGHDL
50