SlideShare a Scribd company logo
1 of 33
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
1
of
4
CMPEN
331
–
Computer
Organization
and
Design,
Lab
6
Due
Wednesday
April
26,
2017
at
7:00
am
(Drop
box
on
Canvas)
This lab introduces the idea of the pipelining technique for
building a fast CPU. The students will obtain
experience with the design implementation and testing of the
first four stages (Instruction Fetch, Instruction
Decode, Instruction Execute, Memory) of the five-stage
pipelined CPU using the Xilinx design package for
FPGAs. It is assumed that students are familiar with the
operation of the Xilinx design package for Field
Programmable Gate Arrays (FPGAs) through the Xilinix tutorial
available in the class website.
1. Pipelining
As described in lab 4
2. Circuits of the Instruction Fetch Stage
As described in lab 4
3. Circuits of the Instruction Decode Stage
As described in lab 4
4. Circuits of the Execution Stage
As described in lab 5
5. Circuits of the Memory Access Stage
As described in lab 5
6. Circuits of the Write Back Stage
Referring to Figure 1, in the fifth cycle the first instruction
entered the WB stage. The memory data is selected
and will be written into the register file at the end of the cycle.
All the control signal have a prefix “w”. The
second instruction entered the MEM stage; the third instruction
entered the EXE stage; the fourth instruction is
being decoded in the ID stage; and the fifth instruction is being
fetched in the IF stage. All the six pipeline
registers are updated at the end of the cycle (the destination
register is considered as the six pipeline register).
Then the first instruction is committed. In each of the forth
coming clock cycles, an instruction will be commited
and a new instruction will enter the pipeline. We use the
structure shown in Figure 1 as a baseline for the design
of our pipelined CPU.
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
2
of
4
Figure 1 Pipeline write back (WB) stage
7. Table 1 lists the names and usages of the 32 registers in the
register file.
Table 1 MIPS general purpose register
$zero 0 Constant 0
$at 1 Reserved for assembler
$v0, $v1 2, 3 Function return values
$a0 - $a3 4 – 7 Function argument values
$t0 - $t7 8 – 15 Temporary (caller saved)
$s0 - $s7 16 – 23 Temporary (callee saved)
$t8, $t9 24, 25 Temporary (caller saved)
$k0, $k1 26, 27 Reserved for OS Kernel
$gp 28 Pointer to Global Area
$sp 29 Stack Pointer
$fp 30 Frame Pointer
$ra 31 Return Address
8. Table 2 lists some MIPS instructions that will be
implemented in our CPU
Table 2 MIPS integration instruction
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
3
of
4
9. Initialize the first 10 words of the Data memory with the
following HEX values:
A00000AA
10000011
20000022
30000033
40000044
50000055
60000066
70000077
80000088
90000099
10. Write a Verilog code that implement the following
instructions using the design shown in Figure 2. Write a
Verilog test bench to verify your code: (You have to show all
the signals written into and out from the MEM/WB
register and the inputs to the Regfile block in your simulation
outputs)
instruction comment
add $6, $2, $10
Assume that the register $1 has the value of 0
11. Write a report that contains the following:
a. Your Verilog design code. Use:
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
4
of
4
i. Device: XC7Z010- -1CLG400C
b. Your Verilog® Test Bench design code. Add “`timescale
1ns/1ps” as the first line of your test bench file.
c. The waveforms resulting from the verification of your
design with ModelSim showing all the signals
written in and out from the MEM/WB register and the inputs to
the Regfile block.
d. The design schematics from the Xilinx synthesis of your
design. Do not use any area constraints.
e. Snapshot of the I/O Planning and
f. Snapshot of the floor planning
12. REPORT FORMAT: Free form, but it must be:
g. One report per student.
h. Have a cover sheet with identification: Title, Class, Your
Name, etc.
i. Using Microsoft word and it should be uploaded in word
format not PDF. If you know LaTex, you should
upload the Tex file in addition to the PDF file.
j. Double spaced
13. You have to upload the whole project design file zipped
with the word file.
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
1
of
4
CMPEN
331
–
Computer
Organization
and
Design,
Lab
5
Due
Monday
April
17,
2017
at
7:00
am
(Drop
box
on
Canvas)
This lab introduces the idea of the pipelining technique for
building a fast CPU. The students will obtain
experience with the design implementation and testing of the
first four stages (Instruction Fetch, Instruction
Decode, Instruction Execute, Memory) of the five-stage
pipelined CPU using the Xilinx design package for
FPGAs. It is assumed that students are familiar with the
operation of the Xilinx design package for Field
Programmable Gate Arrays (FPGAs) through the Xilinix tutorial
available in the class website.
1. Pipelining
As described in lab 4
2. Circuits of the Instruction Fetch Stage
As described in lab 4
3. Circuits of the Instruction Decode Stage
As described in lab 4
4. Circuits of the Execution Stage
Referring to Figure 1, (8.5) in the third cycle the first
instruction entered the EXE stage. The ALU performs
addition, and the multiplexer selects the immediate. A letter “e”
is prefixed to each control signal in order to
distinguish it from that in the ID stage. The second instruction
is being decoded in the ID stage and the third
instruction is being fetched in the IF stage. All the four pipeline
registers are updated at the end of the cycle.
5. Circuits of the Memory Access Stage
Referring to Figure 2, (8.6) in the fourth cycle of the first
instruction entered the MEM stage. The only task in this
stage is to read data memory. All the control signals have a
prefix “m”. The second instruction entered the EXE
stage; the third instruction is being decoded in the ID stage; and
the fourth instruction is being fetched in the IF
stage. All the five pipeline registers are updated at the end of
the cycle.
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
2
of
4
Figure 1 Pipeline execution (EXE) stage
Figure 2 Pipeline memory access (MEM) stage
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
3
of
4
6. Table 1 lists the names and usages of the 32 registers in the
register file.
Table 1 MIPS general purpose register
$zero 0 Constant 0
$at 1 Reserved for assembler
$v0, $v1 2, 3 Function return values
$a0 - $a3 4 – 7 Function argument values
$t0 - $t7 8 – 15 Temporary (caller saved)
$s0 - $s7 16 – 23 Temporary (callee saved)
$t8, $t9 24, 25 Temporary (caller saved)
$k0, $k1 26, 27 Reserved for OS Kernel
$gp 28 Pointer to Global Area
$sp 29 Stack Pointer
$fp 30 Frame Pointer
$ra 31 Return Address
7. Table 2 lists some MIPS instructions that will be
implemented in our CPU
Table 2 MIPS integration instruction
8. Initialize the first 10 words of the Data memory with the
following HEX values:
A00000AA
10000011
20000022
30000033
40000044
50000055
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
4
of
4
60000066
70000077
80000088
90000099
9. Write a Verilog code that implement the following
instructions using the design shown in Figure 2. Write a
Verilog test bench to verify your code: (You have to show all
the signals written into the MEM/WB register and
output from EX/MEM register in your simulation outputs)
instruction comment
oad x[0]
Assume that the register $1 has the value of 0
10. Write a report that contains the following:
a. Your Verilog design code. Use:
i. Device: XC7Z010- -1CLG400C
b. Your Verilog® Test Bench design code. Add “`timescale
1ns/1ps” as the first line of your test bench file.
c. The waveforms resulting from the verification of your
design with ModelSim showing all the signals
written into the MEM/WB register and output from EX/MEM
register.
d. The design schematics from the Xilinx synthesis of your
design. Do not use any area constraints.
e. Snapshot of the I/O Planning and
f. Snapshot of the floor planning
11. REPORT FORMAT: Free form, but it must be:
g. One report per student.
h. Have a cover sheet with identification: Title, Class, Your
Name, etc.
i. Using Microsoft word and it should be uploaded in word
format not PDF. If you know LaTex, you should
upload the Tex file in addition to the PDF file.
j. Double spaced
12. You have to upload the whole project design file zipped
with the word file.
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
1
of
5
CMPEN
331
–
Computer
Organization
and
Design,
Lab
4
Due
Wednesday
April
5,
2017
at
7:0
am
(Drop
box
on
Canvas)
This lab introduces the idea of the pipelining technique for
building a fast CPU. The students will obtain
experience with the design implementation and testing of the
first two stages (Instruction Fetch, Instruction
Decode) of the five-stage pipelined CPU using the Xilinx design
package for FPGAs. It is assumed that students
are familiar with the operation of the Xilinx design package for
Field Programmable Gate Arrays (FPGAs)
through the Xilinix tutorial available in the class website.
1. Pipelining
Pipelining is an implementation technique in which multiple
instructions are overlapped in execution. The five-
stage pipelined CPU allows overlapping execution of multiple
instructions. Although an instruction takes five
clock cycle to pass through the pipeline, a new instruction can
enter the pipeline during every clock cycle. Under
ideal circumstances, the pipelined CPU can produce a result in
every clock cycle. Because in a pipelined CPU
there are multiple operations in each clock cycle, we must save
the temporary results in each pipeline stage into
pipeline registers for use in the follow-up stages. We have five
stages: IF, ID, EXE, MEM, and WB. The PC can
be considered as the first pipeline register at the beginning of
the first stage. We name the other pipeline registers
as IF/ID, ID/EXE, EXE/MEM, and MEM/WB in sequence. In
order to understand in depth how the pipelined
CPU works, we will show the circuits that are required in each
pipeline stage of a baseline CPU.
2. Circuits of the Instruction Fetch Stage
The circuit in the IF stage are shown in Figure 2. Also, looking
at the first clock cycle in Figure 1(b), the first lw
instruction is being fetched. In the IF stage, there is an
instruction memory module and an adder between two
pipeline registers. The left most pipeline register is the PC; it
holds 100. In the end of the first cycle (at the rising
edge of clk), the instruction fetched from instruction memory is
written into the IF/ID register. Meanwhile, the
output of the adder (PC + 4, the next PC) is written into PC.
3. Circuits of the Instruction Decode Stage
Referring to Figure 3, in the second cycle, the first instruction
entered the ID stage. There are two jobs in the
second cycle: to decode the first instruction in the ID stage, and
to fetch the second instruction in the IF stage. The
two instructions are shown on the top of the figures: the first
instruction is in the ID stage, and the second
instruction is in the IF stage. The first instruction in the ID
stage comes from the IF/ID register. Two operands are
read from the register file (Regfile in the figure) based on rs
and rt, although the lw instruction does not use the
operand in the register rt. The immediate (imm) is sign-
extended into 32 bits. The regrt signal is used in the ID
stage that selects the destination register number; all others
must be written into the ID/EXE register for later use.
At the end of the second cycle, all the data and control signals,
except for regrt, in the ID stage are written into the
ID/EXE register. At the same time, the PC and the IF/ID
register are also updated.
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
2
of
5
Figure 1 Timing chart comparison between two types of CPUs
Figure 2 Pipeline instruction fetch (IF) stage
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
3
of
5
Figure 2 Pipeline instruction decode (ID) stage
4. Table 1 lists the names and usages of the 32 registers in the
register file.
Table 1 MIPS general purpose register
$zero 0 Constant 0
$at 1 Reserved for assembler
$v0, $v1 2, 3 Function return values
$a0 - $a3 4 – 7 Function argument values
$t0 - $t7 8 – 15 Temporary (caller saved)
$s0 - $s7 16 – 23 Temporary (callee saved)
$t8, $t9 24, 25 Temporary (caller saved)
$k0, $k1 26, 27 Reserved for OS Kernel
$gp 28 Pointer to Global Area
$sp 29 Stack Pointer
$fp 30 Frame Pointer
$ra 31 Return Address
5. Table 2 lists some MIPS instructions that will be
implemented in our CPU
Table 2 MIPS integration instruction
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
4
of
5
6. Initialize the first 10 words of the Data memory with the
following HEX values:
A00000AA
10000011
20000022
30000033
40000044
50000055
60000066
70000077
80000088
90000099
7. Write a Verilog code that implement the following
instructions using the design shown in Figure 2 and Figure 3.
Write a Verilog test bench to verify your code: (You have to
show all the signals written into the IF/ID register
and the ID/EXE register in your simulation outputs)
# address instruction comment
load x[0]
Assume that the register $at has the value of 0
8. Write a report that contains the following:
a. Your Verilog design code. Use:
i. Device: XC7Z010- -1CLG400C
b. Your Verilog® Test Bench design code. Add “`timescale
1ns/1ps” as the first line of your test bench file.
Penn
State
University
School
of
Electrical
Engineering
and
Computer
Science
Page
5
of
5
c. The waveforms resulting from the verification of your
design with ModelSim showing all the signals
written into the IF/ID register and the ID/EXE register.
d. The design schematics from the Xilinx synthesis of your
design. Do not use any area constraints.
e. Snapshot of the I/O Planning and
f. Snapshot of the floor planning
9. REPORT FORMAT: Free form, but it must be:
g. One report per student.
h. Have a cover sheet with identification: Title, Class, Your
Name, etc.
i. Using Microsoft word and it should be uploaded in word
format not PDF. If you know LaTex, you should
upload the Tex file in addition to the PDF file.
j. Double spaced
10. You have to upload the whole project design file zipped
with the word file.
Penn  State  University            School  of.docx

More Related Content

Similar to Penn  State  University          School  of.docx

Track A-Compilation guiding and adjusting - IBM
Track A-Compilation guiding and adjusting - IBMTrack A-Compilation guiding and adjusting - IBM
Track A-Compilation guiding and adjusting - IBMchiportal
 
f37-book-intarch-pres-pt2.ppt
f37-book-intarch-pres-pt2.pptf37-book-intarch-pres-pt2.ppt
f37-book-intarch-pres-pt2.pptssuserf06014
 
f37-book-intarch-pres-pt2.ppt
f37-book-intarch-pres-pt2.pptf37-book-intarch-pres-pt2.ppt
f37-book-intarch-pres-pt2.pptVhhvf
 
An integrated approach for designing and testing specific processors
An integrated approach for designing and testing specific processorsAn integrated approach for designing and testing specific processors
An integrated approach for designing and testing specific processorsVLSICS Design
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manualAnil Bishnoi
 
Pipelining and co processor.
Pipelining and co processor.Pipelining and co processor.
Pipelining and co processor.Piyush Rochwani
 
Micrcontroller iv sem lab manual
Micrcontroller iv sem lab manualMicrcontroller iv sem lab manual
Micrcontroller iv sem lab manualRohiniHM2
 
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSORDESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSORVLSICS Design
 
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSORDESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSORVLSICS Design
 
Design and Analysis of A 32-bit Pipelined MIPS Risc Processor
Design and Analysis of A 32-bit Pipelined MIPS Risc ProcessorDesign and Analysis of A 32-bit Pipelined MIPS Risc Processor
Design and Analysis of A 32-bit Pipelined MIPS Risc ProcessorVLSICS Design
 
Digital Electronics & Computer Oraganisation
Digital Electronics & Computer OraganisationDigital Electronics & Computer Oraganisation
Digital Electronics & Computer Oraganisationamitymbaassignment
 
Solution manual for modern processor design by john paul shen and mikko h. li...
Solution manual for modern processor design by john paul shen and mikko h. li...Solution manual for modern processor design by john paul shen and mikko h. li...
Solution manual for modern processor design by john paul shen and mikko h. li...neeraj7svp
 
Full solution manual for modern processor design by john paul shen and mikko ...
Full solution manual for modern processor design by john paul shen and mikko ...Full solution manual for modern processor design by john paul shen and mikko ...
Full solution manual for modern processor design by john paul shen and mikko ...neeraj7svp
 
27.1.5 lab convert data into a universal format
27.1.5 lab   convert data into a universal format27.1.5 lab   convert data into a universal format
27.1.5 lab convert data into a universal formatFreddy Buenaño
 
Chapter 4 the processor
Chapter 4 the processorChapter 4 the processor
Chapter 4 the processors9007912
 
Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...
Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...
Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...Intel® Software
 
VLSI lab manual Part A, VTU 7the sem KIT-tiptur
VLSI lab manual Part A, VTU 7the sem KIT-tipturVLSI lab manual Part A, VTU 7the sem KIT-tiptur
VLSI lab manual Part A, VTU 7the sem KIT-tipturPramod Kumar S
 
cscript_controller.pdf
cscript_controller.pdfcscript_controller.pdf
cscript_controller.pdfVcTrn1
 

Similar to Penn  State  University          School  of.docx (20)

Track A-Compilation guiding and adjusting - IBM
Track A-Compilation guiding and adjusting - IBMTrack A-Compilation guiding and adjusting - IBM
Track A-Compilation guiding and adjusting - IBM
 
f37-book-intarch-pres-pt2.ppt
f37-book-intarch-pres-pt2.pptf37-book-intarch-pres-pt2.ppt
f37-book-intarch-pres-pt2.ppt
 
f37-book-intarch-pres-pt2.ppt
f37-book-intarch-pres-pt2.pptf37-book-intarch-pres-pt2.ppt
f37-book-intarch-pres-pt2.ppt
 
An integrated approach for designing and testing specific processors
An integrated approach for designing and testing specific processorsAn integrated approach for designing and testing specific processors
An integrated approach for designing and testing specific processors
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manual
 
Pipelining and co processor.
Pipelining and co processor.Pipelining and co processor.
Pipelining and co processor.
 
slides5.ppt
slides5.pptslides5.ppt
slides5.ppt
 
Micrcontroller iv sem lab manual
Micrcontroller iv sem lab manualMicrcontroller iv sem lab manual
Micrcontroller iv sem lab manual
 
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSORDESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
 
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSORDESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
 
Design and Analysis of A 32-bit Pipelined MIPS Risc Processor
Design and Analysis of A 32-bit Pipelined MIPS Risc ProcessorDesign and Analysis of A 32-bit Pipelined MIPS Risc Processor
Design and Analysis of A 32-bit Pipelined MIPS Risc Processor
 
Digital Electronics & Computer Oraganisation
Digital Electronics & Computer OraganisationDigital Electronics & Computer Oraganisation
Digital Electronics & Computer Oraganisation
 
Solution manual for modern processor design by john paul shen and mikko h. li...
Solution manual for modern processor design by john paul shen and mikko h. li...Solution manual for modern processor design by john paul shen and mikko h. li...
Solution manual for modern processor design by john paul shen and mikko h. li...
 
Full solution manual for modern processor design by john paul shen and mikko ...
Full solution manual for modern processor design by john paul shen and mikko ...Full solution manual for modern processor design by john paul shen and mikko ...
Full solution manual for modern processor design by john paul shen and mikko ...
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
 
27.1.5 lab convert data into a universal format
27.1.5 lab   convert data into a universal format27.1.5 lab   convert data into a universal format
27.1.5 lab convert data into a universal format
 
Chapter 4 the processor
Chapter 4 the processorChapter 4 the processor
Chapter 4 the processor
 
Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...
Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...
Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...
 
VLSI lab manual Part A, VTU 7the sem KIT-tiptur
VLSI lab manual Part A, VTU 7the sem KIT-tipturVLSI lab manual Part A, VTU 7the sem KIT-tiptur
VLSI lab manual Part A, VTU 7the sem KIT-tiptur
 
cscript_controller.pdf
cscript_controller.pdfcscript_controller.pdf
cscript_controller.pdf
 

More from danhaley45372

Your initial post should be 2-3 paragraphs in length.Inclu.docx
Your initial post should be 2-3 paragraphs in length.Inclu.docxYour initial post should be 2-3 paragraphs in length.Inclu.docx
Your initial post should be 2-3 paragraphs in length.Inclu.docxdanhaley45372
 
Your initial post should be made during Unit 2,  January 21st at 4.docx
Your initial post should be made during Unit 2,  January 21st at 4.docxYour initial post should be made during Unit 2,  January 21st at 4.docx
Your initial post should be made during Unit 2,  January 21st at 4.docxdanhaley45372
 
Your initial post should be at least 450+ words and in APA forma.docx
Your initial post should be at least 450+ words and in APA forma.docxYour initial post should be at least 450+ words and in APA forma.docx
Your initial post should be at least 450+ words and in APA forma.docxdanhaley45372
 
Your initial post should be made during Unit 2, january 21st at 4.docx
Your initial post should be made during Unit 2, january 21st at 4.docxYour initial post should be made during Unit 2, january 21st at 4.docx
Your initial post should be made during Unit 2, january 21st at 4.docxdanhaley45372
 
Your initial post should be made during, Submissions after this time.docx
Your initial post should be made during, Submissions after this time.docxYour initial post should be made during, Submissions after this time.docx
Your initial post should be made during, Submissions after this time.docxdanhaley45372
 
Your essay should address the following.(a) How  is the biologic.docx
Your essay should address the following.(a) How  is the biologic.docxYour essay should address the following.(a) How  is the biologic.docx
Your essay should address the following.(a) How  is the biologic.docxdanhaley45372
 
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docx
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docxYour initial post is due by midnight (1159 PM) on Thursday. You mus.docx
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docxdanhaley45372
 
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docx
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docxYour individual sub-topic written (MIN of 1, MAX 3 pages)You.docx
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docxdanhaley45372
 
Your HR project to develop a centralized model of deliveri.docx
Your HR project to develop a centralized model of deliveri.docxYour HR project to develop a centralized model of deliveri.docx
Your HR project to develop a centralized model of deliveri.docxdanhaley45372
 
Your Immersion Project for this course is essentially ethnographic r.docx
Your Immersion Project for this course is essentially ethnographic r.docxYour Immersion Project for this course is essentially ethnographic r.docx
Your Immersion Project for this course is essentially ethnographic r.docxdanhaley45372
 
Your country just overthrew its dictator, and you are the newly .docx
Your country just overthrew its dictator, and you are the newly .docxYour country just overthrew its dictator, and you are the newly .docx
Your country just overthrew its dictator, and you are the newly .docxdanhaley45372
 
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docx
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docxYour have been contracted by HealthFirst Hospital Foundation (HHF),.docx
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docxdanhaley45372
 
Your group presentationWhat you need to do.docx
Your group presentationWhat you need to do.docxYour group presentationWhat you need to do.docx
Your group presentationWhat you need to do.docxdanhaley45372
 
Your contribution(s) must add significant information to the dis.docx
Your contribution(s) must add significant information to the dis.docxYour contribution(s) must add significant information to the dis.docx
Your contribution(s) must add significant information to the dis.docxdanhaley45372
 
Your good friends have just adopted a four-year-old child. At th.docx
Your good friends have just adopted a four-year-old child. At th.docxYour good friends have just adopted a four-year-old child. At th.docx
Your good friends have just adopted a four-year-old child. At th.docxdanhaley45372
 
Your good friends have just adopted a four-year-old child. At this p.docx
Your good friends have just adopted a four-year-old child. At this p.docxYour good friends have just adopted a four-year-old child. At this p.docx
Your good friends have just adopted a four-year-old child. At this p.docxdanhaley45372
 
Your goals as the IT architect and IT security specialist are to.docx
Your goals as the IT architect and IT security specialist are to.docxYour goals as the IT architect and IT security specialist are to.docx
Your goals as the IT architect and IT security specialist are to.docxdanhaley45372
 
Your essay should address the following problem.(a) What is .docx
Your essay should address the following problem.(a) What is .docxYour essay should address the following problem.(a) What is .docx
Your essay should address the following problem.(a) What is .docxdanhaley45372
 
Your future financial needs will be based on the income you can reas.docx
Your future financial needs will be based on the income you can reas.docxYour future financial needs will be based on the income you can reas.docx
Your future financial needs will be based on the income you can reas.docxdanhaley45372
 
Your friend Lydia is having difficulty taking in the informati.docx
Your friend Lydia is having difficulty taking in the informati.docxYour friend Lydia is having difficulty taking in the informati.docx
Your friend Lydia is having difficulty taking in the informati.docxdanhaley45372
 

More from danhaley45372 (20)

Your initial post should be 2-3 paragraphs in length.Inclu.docx
Your initial post should be 2-3 paragraphs in length.Inclu.docxYour initial post should be 2-3 paragraphs in length.Inclu.docx
Your initial post should be 2-3 paragraphs in length.Inclu.docx
 
Your initial post should be made during Unit 2,  January 21st at 4.docx
Your initial post should be made during Unit 2,  January 21st at 4.docxYour initial post should be made during Unit 2,  January 21st at 4.docx
Your initial post should be made during Unit 2,  January 21st at 4.docx
 
Your initial post should be at least 450+ words and in APA forma.docx
Your initial post should be at least 450+ words and in APA forma.docxYour initial post should be at least 450+ words and in APA forma.docx
Your initial post should be at least 450+ words and in APA forma.docx
 
Your initial post should be made during Unit 2, january 21st at 4.docx
Your initial post should be made during Unit 2, january 21st at 4.docxYour initial post should be made during Unit 2, january 21st at 4.docx
Your initial post should be made during Unit 2, january 21st at 4.docx
 
Your initial post should be made during, Submissions after this time.docx
Your initial post should be made during, Submissions after this time.docxYour initial post should be made during, Submissions after this time.docx
Your initial post should be made during, Submissions after this time.docx
 
Your essay should address the following.(a) How  is the biologic.docx
Your essay should address the following.(a) How  is the biologic.docxYour essay should address the following.(a) How  is the biologic.docx
Your essay should address the following.(a) How  is the biologic.docx
 
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docx
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docxYour initial post is due by midnight (1159 PM) on Thursday. You mus.docx
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docx
 
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docx
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docxYour individual sub-topic written (MIN of 1, MAX 3 pages)You.docx
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docx
 
Your HR project to develop a centralized model of deliveri.docx
Your HR project to develop a centralized model of deliveri.docxYour HR project to develop a centralized model of deliveri.docx
Your HR project to develop a centralized model of deliveri.docx
 
Your Immersion Project for this course is essentially ethnographic r.docx
Your Immersion Project for this course is essentially ethnographic r.docxYour Immersion Project for this course is essentially ethnographic r.docx
Your Immersion Project for this course is essentially ethnographic r.docx
 
Your country just overthrew its dictator, and you are the newly .docx
Your country just overthrew its dictator, and you are the newly .docxYour country just overthrew its dictator, and you are the newly .docx
Your country just overthrew its dictator, and you are the newly .docx
 
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docx
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docxYour have been contracted by HealthFirst Hospital Foundation (HHF),.docx
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docx
 
Your group presentationWhat you need to do.docx
Your group presentationWhat you need to do.docxYour group presentationWhat you need to do.docx
Your group presentationWhat you need to do.docx
 
Your contribution(s) must add significant information to the dis.docx
Your contribution(s) must add significant information to the dis.docxYour contribution(s) must add significant information to the dis.docx
Your contribution(s) must add significant information to the dis.docx
 
Your good friends have just adopted a four-year-old child. At th.docx
Your good friends have just adopted a four-year-old child. At th.docxYour good friends have just adopted a four-year-old child. At th.docx
Your good friends have just adopted a four-year-old child. At th.docx
 
Your good friends have just adopted a four-year-old child. At this p.docx
Your good friends have just adopted a four-year-old child. At this p.docxYour good friends have just adopted a four-year-old child. At this p.docx
Your good friends have just adopted a four-year-old child. At this p.docx
 
Your goals as the IT architect and IT security specialist are to.docx
Your goals as the IT architect and IT security specialist are to.docxYour goals as the IT architect and IT security specialist are to.docx
Your goals as the IT architect and IT security specialist are to.docx
 
Your essay should address the following problem.(a) What is .docx
Your essay should address the following problem.(a) What is .docxYour essay should address the following problem.(a) What is .docx
Your essay should address the following problem.(a) What is .docx
 
Your future financial needs will be based on the income you can reas.docx
Your future financial needs will be based on the income you can reas.docxYour future financial needs will be based on the income you can reas.docx
Your future financial needs will be based on the income you can reas.docx
 
Your friend Lydia is having difficulty taking in the informati.docx
Your friend Lydia is having difficulty taking in the informati.docxYour friend Lydia is having difficulty taking in the informati.docx
Your friend Lydia is having difficulty taking in the informati.docx
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Penn  State  University          School  of.docx

  • 3. This lab introduces the idea of the pipelining technique for building a fast CPU. The students will obtain experience with the design implementation and testing of the first four stages (Instruction Fetch, Instruction Decode, Instruction Execute, Memory) of the five-stage pipelined CPU using the Xilinx design package for FPGAs. It is assumed that students are familiar with the operation of the Xilinx design package for Field Programmable Gate Arrays (FPGAs) through the Xilinix tutorial available in the class website. 1. Pipelining As described in lab 4 2. Circuits of the Instruction Fetch Stage As described in lab 4 3. Circuits of the Instruction Decode Stage As described in lab 4 4. Circuits of the Execution Stage As described in lab 5 5. Circuits of the Memory Access Stage
  • 4. As described in lab 5 6. Circuits of the Write Back Stage Referring to Figure 1, in the fifth cycle the first instruction entered the WB stage. The memory data is selected and will be written into the register file at the end of the cycle. All the control signal have a prefix “w”. The second instruction entered the MEM stage; the third instruction entered the EXE stage; the fourth instruction is being decoded in the ID stage; and the fifth instruction is being fetched in the IF stage. All the six pipeline registers are updated at the end of the cycle (the destination register is considered as the six pipeline register). Then the first instruction is committed. In each of the forth coming clock cycles, an instruction will be commited and a new instruction will enter the pipeline. We use the structure shown in Figure 1 as a baseline for the design of our pipelined CPU. Penn State University School of Electrical
  • 5. Engineering and Computer Science Page 2 of 4 Figure 1 Pipeline write back (WB) stage 7. Table 1 lists the names and usages of the 32 registers in the register file.
  • 6. Table 1 MIPS general purpose register $zero 0 Constant 0 $at 1 Reserved for assembler $v0, $v1 2, 3 Function return values $a0 - $a3 4 – 7 Function argument values $t0 - $t7 8 – 15 Temporary (caller saved) $s0 - $s7 16 – 23 Temporary (callee saved) $t8, $t9 24, 25 Temporary (caller saved) $k0, $k1 26, 27 Reserved for OS Kernel $gp 28 Pointer to Global Area $sp 29 Stack Pointer $fp 30 Frame Pointer $ra 31 Return Address 8. Table 2 lists some MIPS instructions that will be implemented in our CPU Table 2 MIPS integration instruction Penn State University
  • 8. following HEX values: A00000AA 10000011 20000022 30000033 40000044 50000055 60000066 70000077 80000088 90000099 10. Write a Verilog code that implement the following instructions using the design shown in Figure 2. Write a Verilog test bench to verify your code: (You have to show all the signals written into and out from the MEM/WB register and the inputs to the Regfile block in your simulation outputs) instruction comment add $6, $2, $10 Assume that the register $1 has the value of 0
  • 9. 11. Write a report that contains the following: a. Your Verilog design code. Use: Penn State University School of Electrical Engineering and Computer Science
  • 10. Page 4 of 4 i. Device: XC7Z010- -1CLG400C b. Your Verilog® Test Bench design code. Add “`timescale 1ns/1ps” as the first line of your test bench file. c. The waveforms resulting from the verification of your design with ModelSim showing all the signals written in and out from the MEM/WB register and the inputs to the Regfile block. d. The design schematics from the Xilinx synthesis of your design. Do not use any area constraints. e. Snapshot of the I/O Planning and f. Snapshot of the floor planning 12. REPORT FORMAT: Free form, but it must be: g. One report per student. h. Have a cover sheet with identification: Title, Class, Your Name, etc. i. Using Microsoft word and it should be uploaded in word format not PDF. If you know LaTex, you should upload the Tex file in addition to the PDF file. j. Double spaced
  • 11. 13. You have to upload the whole project design file zipped with the word file. Penn State University School of Electrical Engineering and Computer Science
  • 13. on Canvas) This lab introduces the idea of the pipelining technique for building a fast CPU. The students will obtain experience with the design implementation and testing of the first four stages (Instruction Fetch, Instruction Decode, Instruction Execute, Memory) of the five-stage pipelined CPU using the Xilinx design package for FPGAs. It is assumed that students are familiar with the operation of the Xilinx design package for Field Programmable Gate Arrays (FPGAs) through the Xilinix tutorial available in the class website. 1. Pipelining As described in lab 4 2. Circuits of the Instruction Fetch Stage As described in lab 4 3. Circuits of the Instruction Decode Stage As described in lab 4 4. Circuits of the Execution Stage Referring to Figure 1, (8.5) in the third cycle the first
  • 14. instruction entered the EXE stage. The ALU performs addition, and the multiplexer selects the immediate. A letter “e” is prefixed to each control signal in order to distinguish it from that in the ID stage. The second instruction is being decoded in the ID stage and the third instruction is being fetched in the IF stage. All the four pipeline registers are updated at the end of the cycle. 5. Circuits of the Memory Access Stage Referring to Figure 2, (8.6) in the fourth cycle of the first instruction entered the MEM stage. The only task in this stage is to read data memory. All the control signals have a prefix “m”. The second instruction entered the EXE stage; the third instruction is being decoded in the ID stage; and the fourth instruction is being fetched in the IF stage. All the five pipeline registers are updated at the end of the cycle. Penn State University School of Electrical Engineering
  • 15. and Computer Science Page 2 of 4 Figure 1 Pipeline execution (EXE) stage Figure 2 Pipeline memory access (MEM) stage
  • 17. Page 3 of 4 6. Table 1 lists the names and usages of the 32 registers in the register file. Table 1 MIPS general purpose register $zero 0 Constant 0 $at 1 Reserved for assembler $v0, $v1 2, 3 Function return values $a0 - $a3 4 – 7 Function argument values $t0 - $t7 8 – 15 Temporary (caller saved) $s0 - $s7 16 – 23 Temporary (callee saved) $t8, $t9 24, 25 Temporary (caller saved) $k0, $k1 26, 27 Reserved for OS Kernel $gp 28 Pointer to Global Area $sp 29 Stack Pointer $fp 30 Frame Pointer $ra 31 Return Address 7. Table 2 lists some MIPS instructions that will be implemented in our CPU Table 2 MIPS integration instruction
  • 18. 8. Initialize the first 10 words of the Data memory with the following HEX values: A00000AA 10000011 20000022 30000033 40000044 50000055 Penn State University School of Electrical Engineering and Computer Science
  • 19. Page 4 of 4 60000066 70000077 80000088 90000099 9. Write a Verilog code that implement the following instructions using the design shown in Figure 2. Write a Verilog test bench to verify your code: (You have to show all the signals written into the MEM/WB register and output from EX/MEM register in your simulation outputs) instruction comment oad x[0]
  • 20. Assume that the register $1 has the value of 0 10. Write a report that contains the following: a. Your Verilog design code. Use: i. Device: XC7Z010- -1CLG400C b. Your Verilog® Test Bench design code. Add “`timescale 1ns/1ps” as the first line of your test bench file. c. The waveforms resulting from the verification of your design with ModelSim showing all the signals written into the MEM/WB register and output from EX/MEM register. d. The design schematics from the Xilinx synthesis of your design. Do not use any area constraints. e. Snapshot of the I/O Planning and f. Snapshot of the floor planning 11. REPORT FORMAT: Free form, but it must be: g. One report per student. h. Have a cover sheet with identification: Title, Class, Your Name, etc. i. Using Microsoft word and it should be uploaded in word format not PDF. If you know LaTex, you should
  • 21. upload the Tex file in addition to the PDF file. j. Double spaced 12. You have to upload the whole project design file zipped with the word file. Penn State University School of Electrical Engineering and Computer Science
  • 23. 7:0 am (Drop box on Canvas) This lab introduces the idea of the pipelining technique for building a fast CPU. The students will obtain experience with the design implementation and testing of the first two stages (Instruction Fetch, Instruction Decode) of the five-stage pipelined CPU using the Xilinx design package for FPGAs. It is assumed that students are familiar with the operation of the Xilinx design package for Field Programmable Gate Arrays (FPGAs) through the Xilinix tutorial available in the class website. 1. Pipelining Pipelining is an implementation technique in which multiple instructions are overlapped in execution. The five- stage pipelined CPU allows overlapping execution of multiple instructions. Although an instruction takes five clock cycle to pass through the pipeline, a new instruction can enter the pipeline during every clock cycle. Under ideal circumstances, the pipelined CPU can produce a result in every clock cycle. Because in a pipelined CPU there are multiple operations in each clock cycle, we must save the temporary results in each pipeline stage into pipeline registers for use in the follow-up stages. We have five stages: IF, ID, EXE, MEM, and WB. The PC can be considered as the first pipeline register at the beginning of
  • 24. the first stage. We name the other pipeline registers as IF/ID, ID/EXE, EXE/MEM, and MEM/WB in sequence. In order to understand in depth how the pipelined CPU works, we will show the circuits that are required in each pipeline stage of a baseline CPU. 2. Circuits of the Instruction Fetch Stage The circuit in the IF stage are shown in Figure 2. Also, looking at the first clock cycle in Figure 1(b), the first lw instruction is being fetched. In the IF stage, there is an instruction memory module and an adder between two pipeline registers. The left most pipeline register is the PC; it holds 100. In the end of the first cycle (at the rising edge of clk), the instruction fetched from instruction memory is written into the IF/ID register. Meanwhile, the output of the adder (PC + 4, the next PC) is written into PC. 3. Circuits of the Instruction Decode Stage Referring to Figure 3, in the second cycle, the first instruction entered the ID stage. There are two jobs in the second cycle: to decode the first instruction in the ID stage, and to fetch the second instruction in the IF stage. The two instructions are shown on the top of the figures: the first instruction is in the ID stage, and the second instruction is in the IF stage. The first instruction in the ID stage comes from the IF/ID register. Two operands are read from the register file (Regfile in the figure) based on rs and rt, although the lw instruction does not use the operand in the register rt. The immediate (imm) is sign- extended into 32 bits. The regrt signal is used in the ID stage that selects the destination register number; all others must be written into the ID/EXE register for later use.
  • 25. At the end of the second cycle, all the data and control signals, except for regrt, in the ID stage are written into the ID/EXE register. At the same time, the PC and the IF/ID register are also updated. Penn State University School of Electrical Engineering and Computer Science
  • 26. Page 2 of 5 Figure 1 Timing chart comparison between two types of CPUs Figure 2 Pipeline instruction fetch (IF) stage Penn State University
  • 28. 4. Table 1 lists the names and usages of the 32 registers in the register file. Table 1 MIPS general purpose register $zero 0 Constant 0 $at 1 Reserved for assembler $v0, $v1 2, 3 Function return values $a0 - $a3 4 – 7 Function argument values $t0 - $t7 8 – 15 Temporary (caller saved) $s0 - $s7 16 – 23 Temporary (callee saved) $t8, $t9 24, 25 Temporary (caller saved) $k0, $k1 26, 27 Reserved for OS Kernel $gp 28 Pointer to Global Area $sp 29 Stack Pointer $fp 30 Frame Pointer $ra 31 Return Address 5. Table 2 lists some MIPS instructions that will be implemented in our CPU Table 2 MIPS integration instruction Penn State
  • 30. 6. Initialize the first 10 words of the Data memory with the following HEX values: A00000AA 10000011 20000022 30000033 40000044 50000055 60000066 70000077 80000088 90000099 7. Write a Verilog code that implement the following instructions using the design shown in Figure 2 and Figure 3. Write a Verilog test bench to verify your code: (You have to show all the signals written into the IF/ID register and the ID/EXE register in your simulation outputs) # address instruction comment load x[0] Assume that the register $at has the value of 0 8. Write a report that contains the following: a. Your Verilog design code. Use:
  • 31. i. Device: XC7Z010- -1CLG400C b. Your Verilog® Test Bench design code. Add “`timescale 1ns/1ps” as the first line of your test bench file. Penn State University School of Electrical Engineering and Computer Science
  • 32. Page 5 of 5 c. The waveforms resulting from the verification of your design with ModelSim showing all the signals written into the IF/ID register and the ID/EXE register. d. The design schematics from the Xilinx synthesis of your design. Do not use any area constraints. e. Snapshot of the I/O Planning and f. Snapshot of the floor planning 9. REPORT FORMAT: Free form, but it must be: g. One report per student. h. Have a cover sheet with identification: Title, Class, Your Name, etc. i. Using Microsoft word and it should be uploaded in word format not PDF. If you know LaTex, you should upload the Tex file in addition to the PDF file. j. Double spaced 10. You have to upload the whole project design file zipped with the word file.