SlideShare a Scribd company logo
1 of 15
Download to read offline
Amirkabir University of Technology
Final Project
SAYEH Extension
(Cache Controller / Pipelined SAYEH)
Farzan Dehbashi
Parham Alvani
supervised by
Dr. Saeid Shiri Gheydari
June 19, 2017
Contents
1 Overview 2
2 Cache Module 3
2.1 Data Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Miss-Hit Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Tag-Valid Array . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 Cache Replacement Policy . . . . . . . . . . . . . . . . . . . . . . 5
2.5 Cache Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Pipelined Controller 7
3.1 Von Neumann Architecture . . . . . . . . . . . . . . . . . . . . . 7
3.2 What is Pipeline? . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3 What is Pipeline Stall (Bubble)? . . . . . . . . . . . . . . . . . . 9
3.4 Pipeline in MIPS Processor . . . . . . . . . . . . . . . . . . . . . 10
3.5 What is Hazards? . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.5.1 Data Hazard . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.5.2 Structural hazards . . . . . . . . . . . . . . . . . . . . . . 11
3.5.3 Control hazards . . . . . . . . . . . . . . . . . . . . . . . . 11
3.6 Let’s eliminate hazards . . . . . . . . . . . . . . . . . . . . . . . . 12
3.7 What you should do ? . . . . . . . . . . . . . . . . . . . . . . . . 12
4 Handin Instructions 13
1
Chapter 1
Overview
This project is an extension to your previous project (SAYEH Basic Computer)
which makes it capable of caching data in a separated module between the
Memory and the Processor.
2
Chapter 2
Cache Module
Figure1 shows a 2 way set associative cache. In such memory each set has
64 rows and each row only has a single 16-bit word.
In this structure we don’t need any offset (why?). As you have learnt,
Index is used to select desired row in cache. after selection, input tag would be
compared with the existing tag of the selected row and in case of accommodation
cache declares hit and miss elsewhere. if hit occurs desired data would form the
output.
SAYEH uses cached data for both Instruction and Data purposes. Data
Array module has already been implemented and can be found here.
Main cache components are as the following:
• Data Array: Responsible for retention of each way.
• Miss-Hit Logic: Checks occurrence of accommodation.
• Most Recently Used (MRU) Array: Selects the desired row, to be
replaced.
• Tag-Valid Array: Stores Tag and Valid section of each cache’s row.
2.1 Data Array
It is designed to maintain Data section of each row.
In this array Address signal, selects the row which is going to be written in
or read from. read data would be written to output by Data signal. Obviously
writing process is synchronous. as WriteEnable signal become ”one” (active),
input data (defined by WriteData signal) would be written in the specified
address.
3
Figure 2.1: Cache structure
2.2 Miss-Hit Logic
As the title discloses, this module is designed for determination of accommoda-
tion. in case of any accommodation, this module determines the set accommo-
dation has happened in.
Write0 contains of Valid and Tag signals of the first set and also Write1
contains the second’s (refer to figure1).Tag signal is the tag we are searching
for.
To clarify this module’s functionality this example looks useful.
Example. Assume that we are searching for A, it’s tag = 4(0100) and index =
20. So we check 20th row of cache, assume that cache contains of a piece of data
with these features in way-0: tag = 7, valid = 1 and in way-1: tag = 4, valid =
1. then Write0 signal would become 10111 means and Write1 signal would be
10100. As in this case desired data has been found in way-1, outputs would be
hit = 1, write1 valid = 1 and write0 valid = 0.
4
Figure 2.2: Data Array Module
Figure 2.3: Miss-Hit Array
2.3 Tag-Valid Array
Figure 2.4: Tag-Valid Array
This module is about to save 4-bit Tag and 1-bit Valid.
Writing and also reading process in this module is like Data Array module,
there are only two differences, WriteData and Invalidate.WriteData contains of
4-bit input Tag and Invalidate signal is to declare any alternation of Valid bit in
this array, if Invalidate is one, Valid bit in the row specified by Address signal
would become zero.
2.4 Cache Replacement Policy
As you know there is a policy declares the suitable transference time from
Memory to Cache, it also declares where to place the data just came from
Memory. For simplicity in SAYEH we use MRU(Most Recently Used) policy,
in such a policy we select the row which has been used the most recently.
This Module is about to know about the row which is currently replacing
and if one has been replaced this module would update the row which has been
used the most in recent time.
This module’s output is a single bit declares weather we should replace way1
or way2.
5
2.5 Cache Controller
Cache controller first checks that given address is in cache or not, if it cached
the given address and it returns that address and if not it gets the address from
the memory and caches it.
6
Chapter 3
Pipelined Controller
3.1 Von Neumann Architecture
This architecture narrates that there are 4 steps needed to perform a complete
action to an instruction:
• Fetch: In this step processor attempts to fetch the instruction from
Main Memory into the processor.
• Decode: In this step processor decodes the instruction to get to know
the job desired to do.
• Execute: This step’s functionality is to do the desired job, which now
is known according to the former step. note that all instructions need to
be executed.
• Write-back: Finally, processor would write back the data produced in
the previous step into the Main Memory.
3.2 What is Pipeline?
Let’s take an example: the following figure is a generic pipeline with four stages:
fetch, decode, execute and write-back. The top gray box is the list of instructions
waiting to be executed, the bottom gray box is the list of instructions that have
had their execution completed, and the middle white box is the pipeline.
7
Figure 3.1: Generic 4-stage pipeline; the colored boxes represent instructions
independent of each other
Execution will go on like the folloing:
• Time= 0: Four instructions are waiting to be executed.
• Time= 1: The green instruction is fetched from memory
• Time= 2:
– The green instruction is decoded
– The purple instruction is fetched from memory
• Time= 3:
– The green instruction is executed (actual operation is performed)
– The purple instruction is decoded
– The blue instruction is fetched
• Time= 4:
8
– The green instruction’s results are written back to the register file or
memory
– The purple instruction is executed
– The blue instruction is decoded
– The red instruction is fetched
• Time= 5:
– The execution of green instruction is completed
– The purple instruction is written back
– The blue instruction is executed
– The red instruction is decoded
• Time= 6:
– The execution of purple instruction is completed
– The blue instruction is written back
– The red instruction is executed
• Time= 7:
– The execution of blue instruction is completed
– The red instruction is written back
• Time= 8:
– The execution of red instruction is completed
• Time= 9:
– The execution of all four instructions is completed
3.3 What is Pipeline Stall (Bubble)?
In computing, a bubble or pipeline stall is a delay in execution of an instruction
in an instruction pipeline in order to resolve a hazard.
During the decoding stage, the control unit will determine if the decoded
instruction reads from a register that the instruction currently in the execution
stage writes to. If this condition holds, the control unit will stall the instruction
by one clock cycle. It also stalls the instruction in the fetch stage, to prevent
the instruction in that stage from being overwritten by the next instruction in
the program.
To prevent new instructions from being fetched when an instruction in the
decoding stage has been stalled, the value in the PC register and the instruction
in the fetch stage are preserved to prevent changes. The values are preserved
until the bubble has passed through the execution stage.
9
The execution stage of the pipeline must always be performing an action. A
bubble is represented in the execution stage as a NOP instruction, which has
no effect other than to stall the instructions being executed in the pipeline.
3.4 Pipeline in MIPS Processor
In this processor we have 5 stage for each instruction:
• IFetch: Fetch Instruction, Increment PC
• Decode: Instruction, Read Registers
• Execute: Calculate Address & Perform Operation
• Memory: Save & Load
• Writeback
and as you learn in class, if we want to create pipeline for this processor we use
following diagram:
Figure 3.2: MIPS 5-stage pipeline
In this project we want you to draw a SAYEH computer with pipeline.
3.5 What is Hazards?
In the domain of central processing unit (CPU) design, hazards are problems
with the instruction pipeline in CPU micro-architectures when the next in-
struction cannot execute in the following clock cycle, and can potentially lead
to incorrect computation results.
Hazard types are described in the following sections.
10
3.5.1 Data Hazard
Data hazards occur when instructions that exhibit data dependence modify data
in different stages of a pipeline.
• read after write (RAW), a true dependency
• write after read (WAR), an anti-dependency
• write after write (WAW), an output dependency
Read after write (RAW)
A read after write (RAW) data hazard refers to a situation where an instruction
refers to a result that has not yet been calculated or retrieved.
i1. R2 <- R1 + R3
i2. R4 <- R2 + R3
Write after read (WAR)
A write after read (WAR) data hazard represents a problem with concurrent
execution.
i1. R4 <- R1 + R5
i2. R5 <- R1 + R2
Write after write (WAW)
A write after write (WAW) data hazard may occur in a concurrent execution
environment.
i1. R2 <- R4 + R7
i2. R2 <- R1 + R3
3.5.2 Structural hazards
A structural hazard occurs when a part of the processor’s hardware is needed
by two or more instructions at the same time.
3.5.3 Control hazards
Branching hazards (also termed control hazards) occur with branches.
11
3.6 Let’s eliminate hazards
In this project we want you to create hazard control unit like one that you see
in MIPS in class for SAYEH computer.
3.7 What you should do ?
Do these items in paper (no VHDL !)
1. Draw SAYEH computer pipeline.
2. How many registers do you add for creating pipeline ?
3. Which type of Hazards we have in SAYEH computer pipeline ?
4. Design a hazard controller unit for these hazards.
12
Chapter 4
Handin Instructions
1. All your project should be implemented by VHDL not Verilog or. . .
2. About 10% of your score would be devoted to the report you deliver within
your projects code. In this report you would explain the whole job and
anything special you have done. (note that it shouldn’t be shorter than
this document and should be typed!)
3. Cache Controller should be designed by an Finite State Machine (FSM)
and this FSM should be mentioned in your project report.
4. In addition to bonus sections mentioned beforehand, implementation of
this project on Altera DE2 FPGA boards will result in extra mark as
well.
5. You can simulate your code with softwares like: Modelsim, Altera Quar-
tus, GHDL, Xilinx ISE, Active HDL, Xilinx Vivado Design Suite,. . . (note
that Modelsim and Quartus has got free versions and GHDL is totally
free so it’s better to obey Copyright) but the TA’s laptop is only equipped
with Modelsim and in case of delivery you should be able of running your
code in that environment.
6. All questions would be answered by the course’s email: computerarchitec-
ture95@gmail.com.
7. Place all your modules and report into a .zip file named as ”FirstName
LastName StudentID” before upload. if any other module is used in your
implementation but hasn’t been mentioned in this document place it in
it’s proper place next to modules within the same hierarchy.
8. Deadline of the project is up to the last day of exams (14 Tir 1395, 23:55),
for any change contact the mentioned email.
9. In case of delivery, your code will be downloaded by the responsible TA
from Moodle, so the only way to convey your code is Moodle and in if you
13
need to reform your code please upload it when possible to be used in the
due date.
10. Cheating Alert!
(a) All your codes would be processed, both manually and automatically
and in case of any similarity by any means, both of individuals in-
volved, would be fined by getting -35 percent of the project’s score
(note that if pushing your code to Github or any other VCS, expos-
ing your code to a friend or . . . results in unexpected similarities of
others, you ALL, are responsible!).
(b) Any cooperation beyond members of the group is forbidden!
(c) The only source you are allowed to copy form, is AUT/CEIT/Arch101
repo which has been devoted to this course, copying any other source
from the Internet,. . . would be consider just like from another class-
mate.
(d) By the way, in case of any similarity with any of the previous students
of this course, you blame the same.
11. Remember that, any HDL(Hardware Design Language) is a piece of art :)
and could be really enjoyable, if you try your best to understand what’s
going on instead of just doing it to make it end.
Good Luck
14

More Related Content

What's hot

What's hot (20)

Parallel Processors (SIMD)
Parallel Processors (SIMD) Parallel Processors (SIMD)
Parallel Processors (SIMD)
 
Complex Test Pattern Generation for high speed fault diagnosis in FPGA based ...
Complex Test Pattern Generation for high speed fault diagnosis in FPGA based ...Complex Test Pattern Generation for high speed fault diagnosis in FPGA based ...
Complex Test Pattern Generation for high speed fault diagnosis in FPGA based ...
 
Computer arithmetic in computer architecture
Computer arithmetic in computer architectureComputer arithmetic in computer architecture
Computer arithmetic in computer architecture
 
Oversimplified CA
Oversimplified CAOversimplified CA
Oversimplified CA
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Array Processor
Array ProcessorArray Processor
Array Processor
 
Chapter 7 cpu struktur dan fungsi
Chapter 7 cpu struktur dan fungsiChapter 7 cpu struktur dan fungsi
Chapter 7 cpu struktur dan fungsi
 
VTU 4TH SEM CSE MICROPROCESSORS SOLVED PAPERS OF JUNE-2014 & JUNE-2015
VTU 4TH SEM CSE MICROPROCESSORS SOLVED PAPERS OF JUNE-2014 & JUNE-2015VTU 4TH SEM CSE MICROPROCESSORS SOLVED PAPERS OF JUNE-2014 & JUNE-2015
VTU 4TH SEM CSE MICROPROCESSORS SOLVED PAPERS OF JUNE-2014 & JUNE-2015
 
Esl basics
Esl basicsEsl basics
Esl basics
 
Unit iii
Unit iiiUnit iii
Unit iii
 
Malab tutorial
Malab tutorialMalab tutorial
Malab tutorial
 
CO Module 5
CO Module 5CO Module 5
CO Module 5
 
Like 2014214
Like 2014214Like 2014214
Like 2014214
 
Real time-embedded-system-lec-06
Real time-embedded-system-lec-06Real time-embedded-system-lec-06
Real time-embedded-system-lec-06
 
Chapter05 new
Chapter05 newChapter05 new
Chapter05 new
 
Ch2 embedded processors-i
Ch2 embedded processors-iCh2 embedded processors-i
Ch2 embedded processors-i
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Pipeline Mechanism
Pipeline MechanismPipeline Mechanism
Pipeline Mechanism
 
Adaptive bank management[1]
Adaptive bank management[1]Adaptive bank management[1]
Adaptive bank management[1]
 
Real time-embedded-system-lec-03
Real time-embedded-system-lec-03Real time-embedded-system-lec-03
Real time-embedded-system-lec-03
 

Similar to Sayeh extension(v23)

Ali.Kamali-MSc.Thesis-SFU
Ali.Kamali-MSc.Thesis-SFUAli.Kamali-MSc.Thesis-SFU
Ali.Kamali-MSc.Thesis-SFUAli Kamali
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Lab 1 reference manual
Lab 1 reference manualLab 1 reference manual
Lab 1 reference manualtrayyoo
 
ECECS 472572 Final Exam ProjectRemember to check the errat.docx
ECECS 472572 Final Exam ProjectRemember to check the errat.docxECECS 472572 Final Exam ProjectRemember to check the errat.docx
ECECS 472572 Final Exam ProjectRemember to check the errat.docxtidwellveronique
 
ECECS 472572 Final Exam ProjectRemember to check the err.docx
ECECS 472572 Final Exam ProjectRemember to check the err.docxECECS 472572 Final Exam ProjectRemember to check the err.docx
ECECS 472572 Final Exam ProjectRemember to check the err.docxtidwellveronique
 
Please do ECE572 requirementECECS 472572 Final Exam Project (W.docx
Please do ECE572 requirementECECS 472572 Final Exam Project (W.docxPlease do ECE572 requirementECECS 472572 Final Exam Project (W.docx
Please do ECE572 requirementECECS 472572 Final Exam Project (W.docxARIV4
 
ECECS 472572 Final Exam ProjectRemember to check the errata
ECECS 472572 Final Exam ProjectRemember to check the errata ECECS 472572 Final Exam ProjectRemember to check the errata
ECECS 472572 Final Exam ProjectRemember to check the errata EvonCanales257
 
Percona XtraDB 集群文档
Percona XtraDB 集群文档Percona XtraDB 集群文档
Percona XtraDB 集群文档YUCHENG HU
 
C++ Memory Management
C++ Memory ManagementC++ Memory Management
C++ Memory ManagementRahul Jamwal
 
Understand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ ProcessorsUnderstand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ ProcessorsIntel® Software
 
8085 micro processor
8085 micro processor8085 micro processor
8085 micro processorArun Umrao
 
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...ssuserd6b1fd
 
Computer organization and architectures chapter8
Computer organization and architectures chapter8Computer organization and architectures chapter8
Computer organization and architectures chapter8binakasehun2026
 
Chap6 procedures &amp; macros
Chap6 procedures &amp; macrosChap6 procedures &amp; macros
Chap6 procedures &amp; macrosHarshitParkar6677
 

Similar to Sayeh extension(v23) (20)

Ali.Kamali-MSc.Thesis-SFU
Ali.Kamali-MSc.Thesis-SFUAli.Kamali-MSc.Thesis-SFU
Ali.Kamali-MSc.Thesis-SFU
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Lab Manual.pdf
Lab Manual.pdfLab Manual.pdf
Lab Manual.pdf
 
3.3
3.33.3
3.3
 
Lab 1 reference manual
Lab 1 reference manualLab 1 reference manual
Lab 1 reference manual
 
ECECS 472572 Final Exam ProjectRemember to check the errat.docx
ECECS 472572 Final Exam ProjectRemember to check the errat.docxECECS 472572 Final Exam ProjectRemember to check the errat.docx
ECECS 472572 Final Exam ProjectRemember to check the errat.docx
 
ECECS 472572 Final Exam ProjectRemember to check the err.docx
ECECS 472572 Final Exam ProjectRemember to check the err.docxECECS 472572 Final Exam ProjectRemember to check the err.docx
ECECS 472572 Final Exam ProjectRemember to check the err.docx
 
Assembly p1
Assembly p1Assembly p1
Assembly p1
 
Please do ECE572 requirementECECS 472572 Final Exam Project (W.docx
Please do ECE572 requirementECECS 472572 Final Exam Project (W.docxPlease do ECE572 requirementECECS 472572 Final Exam Project (W.docx
Please do ECE572 requirementECECS 472572 Final Exam Project (W.docx
 
ECECS 472572 Final Exam ProjectRemember to check the errata
ECECS 472572 Final Exam ProjectRemember to check the errata ECECS 472572 Final Exam ProjectRemember to check the errata
ECECS 472572 Final Exam ProjectRemember to check the errata
 
Percona XtraDB 集群文档
Percona XtraDB 集群文档Percona XtraDB 集群文档
Percona XtraDB 集群文档
 
Operating System Engineering
Operating System EngineeringOperating System Engineering
Operating System Engineering
 
Bc0040
Bc0040Bc0040
Bc0040
 
C++ Memory Management
C++ Memory ManagementC++ Memory Management
C++ Memory Management
 
Understand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ ProcessorsUnderstand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ Processors
 
8085 micro processor
8085 micro processor8085 micro processor
8085 micro processor
 
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...
 
thesis-shai
thesis-shaithesis-shai
thesis-shai
 
Computer organization and architectures chapter8
Computer organization and architectures chapter8Computer organization and architectures chapter8
Computer organization and architectures chapter8
 
Chap6 procedures &amp; macros
Chap6 procedures &amp; macrosChap6 procedures &amp; macros
Chap6 procedures &amp; macros
 

More from Farzan Dehbashi (17)

afghanistan_history.pptx
afghanistan_history.pptxafghanistan_history.pptx
afghanistan_history.pptx
 
Afghanistan
AfghanistanAfghanistan
Afghanistan
 
Quantum computing
Quantum computingQuantum computing
Quantum computing
 
C compiler(final)
C compiler(final)C compiler(final)
C compiler(final)
 
Sayeh basic computer
Sayeh basic computerSayeh basic computer
Sayeh basic computer
 
An introductiontoquantumcomputing
An introductiontoquantumcomputingAn introductiontoquantumcomputing
An introductiontoquantumcomputing
 
Smart parking
Smart parkingSmart parking
Smart parking
 
Oled
OledOled
Oled
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
 
Combinational Circuits
Combinational CircuitsCombinational Circuits
Combinational Circuits
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Tabobao Reinventing (E-)Commerce
Tabobao Reinventing (E-)CommerceTabobao Reinventing (E-)Commerce
Tabobao Reinventing (E-)Commerce
 
LEGO Reinventing (E-)Commerce (business model change)
LEGO Reinventing (E-)Commerce (business model change)LEGO Reinventing (E-)Commerce (business model change)
LEGO Reinventing (E-)Commerce (business model change)
 
OLED
OLEDOLED
OLED
 
An intro to VHDL
An intro to VHDLAn intro to VHDL
An intro to VHDL
 
Graphene farzan
Graphene farzanGraphene farzan
Graphene farzan
 
quantum computing
quantum computingquantum computing
quantum computing
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 

Recently uploaded (20)

9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 

Sayeh extension(v23)

  • 1. Amirkabir University of Technology Final Project SAYEH Extension (Cache Controller / Pipelined SAYEH) Farzan Dehbashi Parham Alvani supervised by Dr. Saeid Shiri Gheydari June 19, 2017
  • 2. Contents 1 Overview 2 2 Cache Module 3 2.1 Data Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2 Miss-Hit Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.3 Tag-Valid Array . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.4 Cache Replacement Policy . . . . . . . . . . . . . . . . . . . . . . 5 2.5 Cache Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3 Pipelined Controller 7 3.1 Von Neumann Architecture . . . . . . . . . . . . . . . . . . . . . 7 3.2 What is Pipeline? . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.3 What is Pipeline Stall (Bubble)? . . . . . . . . . . . . . . . . . . 9 3.4 Pipeline in MIPS Processor . . . . . . . . . . . . . . . . . . . . . 10 3.5 What is Hazards? . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.5.1 Data Hazard . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.5.2 Structural hazards . . . . . . . . . . . . . . . . . . . . . . 11 3.5.3 Control hazards . . . . . . . . . . . . . . . . . . . . . . . . 11 3.6 Let’s eliminate hazards . . . . . . . . . . . . . . . . . . . . . . . . 12 3.7 What you should do ? . . . . . . . . . . . . . . . . . . . . . . . . 12 4 Handin Instructions 13 1
  • 3. Chapter 1 Overview This project is an extension to your previous project (SAYEH Basic Computer) which makes it capable of caching data in a separated module between the Memory and the Processor. 2
  • 4. Chapter 2 Cache Module Figure1 shows a 2 way set associative cache. In such memory each set has 64 rows and each row only has a single 16-bit word. In this structure we don’t need any offset (why?). As you have learnt, Index is used to select desired row in cache. after selection, input tag would be compared with the existing tag of the selected row and in case of accommodation cache declares hit and miss elsewhere. if hit occurs desired data would form the output. SAYEH uses cached data for both Instruction and Data purposes. Data Array module has already been implemented and can be found here. Main cache components are as the following: • Data Array: Responsible for retention of each way. • Miss-Hit Logic: Checks occurrence of accommodation. • Most Recently Used (MRU) Array: Selects the desired row, to be replaced. • Tag-Valid Array: Stores Tag and Valid section of each cache’s row. 2.1 Data Array It is designed to maintain Data section of each row. In this array Address signal, selects the row which is going to be written in or read from. read data would be written to output by Data signal. Obviously writing process is synchronous. as WriteEnable signal become ”one” (active), input data (defined by WriteData signal) would be written in the specified address. 3
  • 5. Figure 2.1: Cache structure 2.2 Miss-Hit Logic As the title discloses, this module is designed for determination of accommoda- tion. in case of any accommodation, this module determines the set accommo- dation has happened in. Write0 contains of Valid and Tag signals of the first set and also Write1 contains the second’s (refer to figure1).Tag signal is the tag we are searching for. To clarify this module’s functionality this example looks useful. Example. Assume that we are searching for A, it’s tag = 4(0100) and index = 20. So we check 20th row of cache, assume that cache contains of a piece of data with these features in way-0: tag = 7, valid = 1 and in way-1: tag = 4, valid = 1. then Write0 signal would become 10111 means and Write1 signal would be 10100. As in this case desired data has been found in way-1, outputs would be hit = 1, write1 valid = 1 and write0 valid = 0. 4
  • 6. Figure 2.2: Data Array Module Figure 2.3: Miss-Hit Array 2.3 Tag-Valid Array Figure 2.4: Tag-Valid Array This module is about to save 4-bit Tag and 1-bit Valid. Writing and also reading process in this module is like Data Array module, there are only two differences, WriteData and Invalidate.WriteData contains of 4-bit input Tag and Invalidate signal is to declare any alternation of Valid bit in this array, if Invalidate is one, Valid bit in the row specified by Address signal would become zero. 2.4 Cache Replacement Policy As you know there is a policy declares the suitable transference time from Memory to Cache, it also declares where to place the data just came from Memory. For simplicity in SAYEH we use MRU(Most Recently Used) policy, in such a policy we select the row which has been used the most recently. This Module is about to know about the row which is currently replacing and if one has been replaced this module would update the row which has been used the most in recent time. This module’s output is a single bit declares weather we should replace way1 or way2. 5
  • 7. 2.5 Cache Controller Cache controller first checks that given address is in cache or not, if it cached the given address and it returns that address and if not it gets the address from the memory and caches it. 6
  • 8. Chapter 3 Pipelined Controller 3.1 Von Neumann Architecture This architecture narrates that there are 4 steps needed to perform a complete action to an instruction: • Fetch: In this step processor attempts to fetch the instruction from Main Memory into the processor. • Decode: In this step processor decodes the instruction to get to know the job desired to do. • Execute: This step’s functionality is to do the desired job, which now is known according to the former step. note that all instructions need to be executed. • Write-back: Finally, processor would write back the data produced in the previous step into the Main Memory. 3.2 What is Pipeline? Let’s take an example: the following figure is a generic pipeline with four stages: fetch, decode, execute and write-back. The top gray box is the list of instructions waiting to be executed, the bottom gray box is the list of instructions that have had their execution completed, and the middle white box is the pipeline. 7
  • 9. Figure 3.1: Generic 4-stage pipeline; the colored boxes represent instructions independent of each other Execution will go on like the folloing: • Time= 0: Four instructions are waiting to be executed. • Time= 1: The green instruction is fetched from memory • Time= 2: – The green instruction is decoded – The purple instruction is fetched from memory • Time= 3: – The green instruction is executed (actual operation is performed) – The purple instruction is decoded – The blue instruction is fetched • Time= 4: 8
  • 10. – The green instruction’s results are written back to the register file or memory – The purple instruction is executed – The blue instruction is decoded – The red instruction is fetched • Time= 5: – The execution of green instruction is completed – The purple instruction is written back – The blue instruction is executed – The red instruction is decoded • Time= 6: – The execution of purple instruction is completed – The blue instruction is written back – The red instruction is executed • Time= 7: – The execution of blue instruction is completed – The red instruction is written back • Time= 8: – The execution of red instruction is completed • Time= 9: – The execution of all four instructions is completed 3.3 What is Pipeline Stall (Bubble)? In computing, a bubble or pipeline stall is a delay in execution of an instruction in an instruction pipeline in order to resolve a hazard. During the decoding stage, the control unit will determine if the decoded instruction reads from a register that the instruction currently in the execution stage writes to. If this condition holds, the control unit will stall the instruction by one clock cycle. It also stalls the instruction in the fetch stage, to prevent the instruction in that stage from being overwritten by the next instruction in the program. To prevent new instructions from being fetched when an instruction in the decoding stage has been stalled, the value in the PC register and the instruction in the fetch stage are preserved to prevent changes. The values are preserved until the bubble has passed through the execution stage. 9
  • 11. The execution stage of the pipeline must always be performing an action. A bubble is represented in the execution stage as a NOP instruction, which has no effect other than to stall the instructions being executed in the pipeline. 3.4 Pipeline in MIPS Processor In this processor we have 5 stage for each instruction: • IFetch: Fetch Instruction, Increment PC • Decode: Instruction, Read Registers • Execute: Calculate Address & Perform Operation • Memory: Save & Load • Writeback and as you learn in class, if we want to create pipeline for this processor we use following diagram: Figure 3.2: MIPS 5-stage pipeline In this project we want you to draw a SAYEH computer with pipeline. 3.5 What is Hazards? In the domain of central processing unit (CPU) design, hazards are problems with the instruction pipeline in CPU micro-architectures when the next in- struction cannot execute in the following clock cycle, and can potentially lead to incorrect computation results. Hazard types are described in the following sections. 10
  • 12. 3.5.1 Data Hazard Data hazards occur when instructions that exhibit data dependence modify data in different stages of a pipeline. • read after write (RAW), a true dependency • write after read (WAR), an anti-dependency • write after write (WAW), an output dependency Read after write (RAW) A read after write (RAW) data hazard refers to a situation where an instruction refers to a result that has not yet been calculated or retrieved. i1. R2 <- R1 + R3 i2. R4 <- R2 + R3 Write after read (WAR) A write after read (WAR) data hazard represents a problem with concurrent execution. i1. R4 <- R1 + R5 i2. R5 <- R1 + R2 Write after write (WAW) A write after write (WAW) data hazard may occur in a concurrent execution environment. i1. R2 <- R4 + R7 i2. R2 <- R1 + R3 3.5.2 Structural hazards A structural hazard occurs when a part of the processor’s hardware is needed by two or more instructions at the same time. 3.5.3 Control hazards Branching hazards (also termed control hazards) occur with branches. 11
  • 13. 3.6 Let’s eliminate hazards In this project we want you to create hazard control unit like one that you see in MIPS in class for SAYEH computer. 3.7 What you should do ? Do these items in paper (no VHDL !) 1. Draw SAYEH computer pipeline. 2. How many registers do you add for creating pipeline ? 3. Which type of Hazards we have in SAYEH computer pipeline ? 4. Design a hazard controller unit for these hazards. 12
  • 14. Chapter 4 Handin Instructions 1. All your project should be implemented by VHDL not Verilog or. . . 2. About 10% of your score would be devoted to the report you deliver within your projects code. In this report you would explain the whole job and anything special you have done. (note that it shouldn’t be shorter than this document and should be typed!) 3. Cache Controller should be designed by an Finite State Machine (FSM) and this FSM should be mentioned in your project report. 4. In addition to bonus sections mentioned beforehand, implementation of this project on Altera DE2 FPGA boards will result in extra mark as well. 5. You can simulate your code with softwares like: Modelsim, Altera Quar- tus, GHDL, Xilinx ISE, Active HDL, Xilinx Vivado Design Suite,. . . (note that Modelsim and Quartus has got free versions and GHDL is totally free so it’s better to obey Copyright) but the TA’s laptop is only equipped with Modelsim and in case of delivery you should be able of running your code in that environment. 6. All questions would be answered by the course’s email: computerarchitec- ture95@gmail.com. 7. Place all your modules and report into a .zip file named as ”FirstName LastName StudentID” before upload. if any other module is used in your implementation but hasn’t been mentioned in this document place it in it’s proper place next to modules within the same hierarchy. 8. Deadline of the project is up to the last day of exams (14 Tir 1395, 23:55), for any change contact the mentioned email. 9. In case of delivery, your code will be downloaded by the responsible TA from Moodle, so the only way to convey your code is Moodle and in if you 13
  • 15. need to reform your code please upload it when possible to be used in the due date. 10. Cheating Alert! (a) All your codes would be processed, both manually and automatically and in case of any similarity by any means, both of individuals in- volved, would be fined by getting -35 percent of the project’s score (note that if pushing your code to Github or any other VCS, expos- ing your code to a friend or . . . results in unexpected similarities of others, you ALL, are responsible!). (b) Any cooperation beyond members of the group is forbidden! (c) The only source you are allowed to copy form, is AUT/CEIT/Arch101 repo which has been devoted to this course, copying any other source from the Internet,. . . would be consider just like from another class- mate. (d) By the way, in case of any similarity with any of the previous students of this course, you blame the same. 11. Remember that, any HDL(Hardware Design Language) is a piece of art :) and could be really enjoyable, if you try your best to understand what’s going on instead of just doing it to make it end. Good Luck 14