שלבי ביצוע הוראת מכונה (1) FETCH = קרא הוראה מהזיכרון ע " פ הכתובת שמכיל ה -PC. (2) DECODE = פענח את הפקודה וקרא את האוגרים הנחוצים ( אחד או שניים ). (3)

Slides:



Advertisements
Similar presentations
Pipeline Example: cycle 1 lw R10,9(R1) sub R11,R2, R3 and R12,R4, R5 or R13,R6, R7.
Advertisements

1 MIPS תיאור מפושט של מעבד החיבורים המתוארים תומכים בכל שלבי פקודות R-type ו- I-type אנו נתמוך בפקודות: add, sub, or, xor, and, slt, lw, sw, beq, j כמובן.
The Processor: Datapath & Control
CMPUT Computer Organization and Architecture II1 CMPUT229 - Fall 2003 TopicE: Building a Data Path and a Control Path for a Microprocessor José Nelson.
1 The single cycle CPU. 2 Performance of Single-Cycle Machines Memory Unit 2 ns ALU and Adders 2 ns Register file (Read or Write) 1 ns Class Fetch Decode.
331 Lec 14.1Fall 2002 Review: Abstract Implementation View  Split memory (Harvard) model - single cycle operation  Simplified to contain only the instructions:
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
Computer Structure - Datapath and Control Goal: Design a Datapath  We will design the datapath of a processor that includes a subset of the MIPS instruction.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 TopicH: Building a Data Path and a Control Path for a Microprocessor José Nelson.
1 השעון Hertz=1/sec מחשב פנטיום במהירות של פירושו שהוא מבצע 8^10 *2 מחזורי שעון בשניה. כל מחזור שעון לוקח 200MHZ 5*10^-9=5nanosecond כמה לוקחת פקודה בימינו?
1 שלבי ביצוע הוראת מכונה (1) FETCH = קרא הוראה מהזיכרון ע " פ הכתובת שמכיל ה -PC. (2) DECODE = פענח את הפקודה וקרא את האוגרים הנחוצים ( אחד או שניים ).
Copyright 1998 Morgan Kaufmann Publishers, Inc. All rights reserved. Digital Architectures1 Machine instructions execution steps (1) FETCH = Read the instruction.
The Datapath Andreas Klappenecker CPSC321 Computer Architecture.
1 ׃1998 Morgan Kaufmann Publishers פקודת ה- jump 4 bits 26 bits 2 bits 00 : כתובת קפיצה במילים : כתובת קפיצה בבתים … …
The Processor: Datapath & Control. Implementing Instructions Simplified instruction set memory-reference instructions: lw, sw arithmetic-logical instructions:
Chapter 4 Sections 4.1 – 4.4 Appendix D.1 and D.2 Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Processor: Datapath and Control
CS2100 Computer Organisation The Processor: Datapath (AY2015/6) Semester 1.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
1 A single-cycle MIPS processor  An instruction set architecture is an interface that defines the hardware operations which are available to software.
1. Building A CPU  We’ve built a small ALU l Add, Subtract, SLT, And, Or l Could figure out Multiply and Divide  What about the rest l How do.
MIPS processor continued. In Class Exercise Question Show the datapath of a processor that supports only R-type and jr reg instructions.
ECE-C355 Computer Structures Winter 2008 The MIPS Datapath Slides have been adapted from Prof. Mary Jane Irwin ( )
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
PC Instruction Memory Address Instr. [31-0] 4 Fig 4.6 p 309 Instruction Fetch.
MIPS processor continued
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
1 Chapter 5: Datapath and Control (Part 2) CS 447 Jason Bakos.
1 MIPS תיאור מפושט של מעבד החיבורים המתוארים תומכים בכל שלבי פקודות R-type ו- I-type אנו נתמוך בפקודות: add, sub, or, xor, and, slt, lw, sw, beq, j כמובן.
Lecture 9. MIPS Processor Design – Single-Cycle Processor Design Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
Lecture 5. MIPS Processor Design
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Single-cycle CPU Control
Access the Instruction from Memory
EE204 Computer Architecture
MIPS Microarchitecture Single-Cycle Processor Control
Single Cycle CPU - Control
Single Cycle CPU.
Computer Architecture
Multi-Cycle CPU.
Multi-Cycle CPU.
MIPS processor continued
Designing MIPS Processor (Single-Cycle) Presentation G
CSCI206 - Computer Organization & Programming
CS/COE0447 Computer Organization & Assembly Language
Single-Cycle CPU DataPath.
CS/COE0447 Computer Organization & Assembly Language
CSCI206 - Computer Organization & Programming
Datapath & Control MIPS
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
Composing the Elements
Composing the Elements
The Processor Lecture 3.3: Single-cycle Implementation
The Processor Lecture 3.2: Building a Datapath with Control
Topic 5: Processor Architecture
Lecture 9. MIPS Processor Design – Decoding and Execution
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
MIPS processor continued
CS/COE0447 Computer Organization & Assembly Language
The Processor: Datapath & Control.
COMS 361 Computer Organization
CPU Design use pipeline
MIPS Processor.
Processor: Datapath and Control
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

שלבי ביצוע הוראת מכונה (1) FETCH = קרא הוראה מהזיכרון ע " פ הכתובת שמכיל ה -PC. (2) DECODE = פענח את הפקודה וקרא את האוגרים הנחוצים ( אחד או שניים ). (3) EXECUTE = בעזרת ה -ALU חשב את התוצאה, או כתובת רצויה. (4) MEMORY = השתמש בתוצאה לבצע במידת הצורך : או טעינה לזיכרון (Store) או קריאה מהזיכרון (Load). (5) WRITE BACK = בצע במידת הצורך טעינה לאוגר.

במשך כל מחזור השעון קוראים בסוף השעון כותבים cycle time rising edge falling edge קווי הבקרה - מיוצרים על פי השעון, כל עליית שעון תשנה בעקבותיה את קווי הבקרה (אם נדרש)

MIPS תיאור מפושט של מעבד החיבורים המתוארים תומכים בכל שלבי פקודות R-type ו- I-type אנו נתמוך בפקודות: add, sub, or, xor, and, slt, lw, sw, beq, j כמובן שנצטרך לדעת כיצד מוסיפים פקודות נוספות כמו למשל: bne, addi, jal, jr

עוד שלושה שבועות

חלקים בסיסים של המחשב הדרושים לשלב ה -fetch: Instruction Address Instruction Memory Add Sum כמובן שדרוש זיכרון פקודות, רגיסטר לשמירת הכתובת וכן adder לחשוב הכתובת הבאה

FETCH - שלב ה Add 4 PC Read address Instruction memory 4

A CPU capable of R-type instructions only 5 [25:21]=Rs 5 [20:16]=Rt 5 [15:11]=Rd Instruction Memory PC Adde r 4 ck 6 [31:26] 6 [5:0]= funct

יחידת הרגיסטרים. יחידה זו דרושה לשלב ה -decode ( ולשלב ה -write back) Read register 1 Registers Read register 2 Write register Write Data Read data1 Read data2 מספרי האוגרים Data

Arithmetic Logic operation Read register1 Registers Read register2 Write register Write Data Read data1 Read data2 ALU Zero ALU operation ALU result Instruction ALU result ALU operation הפעולה הבסיסית שנדגים הנה פקודת R-type

A CPU capable of R-type instructions only 5 [25:21]=Rs 5 [20:16]=Rt 5 [15:11]=Rd Reg File Instruction Memory PCALU Adde r 4 ck 6 [31:26] 6 [5:0]= funct

A CPU capable of R-type instructions only 5 [25:21]=Rs 5 [20:16]=Rt 5 [15:11]=Rd Reg File Instruction Memory PCALU Adde r 4 ck 6 [31:26] 6 [5:0]= funct

The internal structure of the Register File 32 Read data 2 write data Read data Rd reg 2 (= Rt) Rd reg 1 (= Rs) RegWrite Wr reg (= Rd) 32 E קוראים משתי היציאות בוזמנית ערכים של שני רגיסטרים שונים כותבים לאחד הרגיסטרים האחרים (בעליית השעון הבאה)

A CPU capable of R-type instructions only 5 [25:21]=Rs 5 [20:16]=Rt 5 [15:11]=Rd Reg File Instruction Memory PCALU Adde r 4 ck 6 [31:26] RegWrite

A CPU capable of R-type instructions only 5 [25:21]=Rs 5 [20:16]=Rt 5 [15:11]=Rd Reg File Instruction Memory PCALU ck

A CPU capable of R-type instructions only 5 [25:21]=Rs 5 [20:16]=Rt 5 [15:11]=Rd Reg File Instruction Memory PCPC ALU ck 4

A CPU capable of R-type instructions only 5 [25:21]=Rs 5 [20:16]=Rt 5 [15:11]=Rd Reg File Instruction Memory PCALU Adde r 4 ck 6 [31:26] RegWrite 6 [5:0]=funct ALU control

Load,Store בניית פעולות Read address Data memory Write address Write data Read data Write Read כאן נדרש זיכרון ל- data ממנו נקרא ואליו נכתוב כמו כן יש לבצע sign extension של ה- imm שהוא רק 16bit

A CPU capable of lw instructions only 5 [25:21]=Rs 5 [20:16]=Rt Reg File Instruction Memory PCALU Adde r 4 ck 6 [31:26] RegWrite=1 16 [15:0] 5 add Sext 16->32 Data Memory Address D. Out

A CPU capable of lw instructions only 5 [25:21]=Rs 5 [20:16]=Rt Reg File Instruction Memory PCALU Adde r 4 ck 6 [31:26] RegWrite=1 16 [15:0] 5 add Sext 16->32 Data Memory Address D. Out

A CPU capable of lw instructions only 5 [25:21]=Rs 5 [20:16]=Rt Reg File Instruction Memory PCALU Adde r 4 ck 6 [31:26] RegWrite=1 16 [15:0] 5 add Sext 16->32 Data Memory Address D. Out

A CPU capable of lw & sw instructions only 5 [25:21]=Rs 5 [20:16]=Rt Reg File Instruction Memory PCALU Adde r 4 ck 6 [31:26] RegWrite=0 16 [15:0] 5 add Sext 16->32 Data Memory D.In Address MeWrite=1

A CPU capable of R-type & lw instructions (principle) 5 [25:21]=Rs 5 [20:16]=Rt Reg File Instruction Memory PCALU Adde r 4 ck 6 [31:26] RegWrite 16 [15:0] 5 add Sext 16->32 Data Memory 5 [25:21]=Rs 6 [5:0]=funct ALU control 5 [15:11]=Rd Address

A CPU capable of R-type & lw instructions 5 [25:21]=Rs 5 [20:16]=Rt Reg File Instruction Memory PCALU Adde r 4 ck 6 [31:26] RegWrite 16 [15:0] 5 add Sext 16->32 Data Memory 5 [25:21]=Rs 6 [5:0]=funct ALU control Rd Address D. Out

A CPU capable of R-type & lw/sw instructions 5 [25:21]=Rs 5 [20:16]=Rt Reg File Instruction Memory PCALU Adde r 4 ck 6 [31:26] RegWrite 16 [15:0] 5 add Sext 16->32 Data Memory 5 [25:21]=Rs 6 [5:0]=funct ALU control Rd Address D.In D. Out MemWrite

:Branch אלמנטים דרושים להוספת ALU Zero Read register1 Registers Read register2 Write register Write Data Read data1 Read data2 Instruction Adder Sum Shift left2 Sigh Extend Branch Target מועבר ליחידת הבקרה כתוצאה הלוגית של ההשוואה 1632 PC+4 משלב ה- Fetch In addresses, we always shift left by two bits

שילוב כל הפקודות Read register1 Registers Read register2 Write register Write Data Read data1 Read data2 Zero ALU result Data Sign extend 32 Read address memory Write address Write data Read data Write Read 16 Add 4 PC M u x Read address Instruction memory ADD ALU result Shift left2 M u x M u x

איפה ה - CPU? CPU Instruction Memory Data Memory PC

קווי בקרה PC Instruction memory Read address Instruction Add M u x Registers Write register Write data Read data 1 Read data 2 Read register 1 Read register 2 4 M u x ALU operation 3 RegWrite MemRead MemWrite PCSrc ALUSrc MemtoReg ALU result Zero ALU Data memory Address Write data Read data M u x Sign extend Add ALU result Shift left 2

Control PC Instruction memory Read address Instruction [31–0] Instruction [20–16] Instruction [25–21] Add Instruction [5–0] MemtoReg ALUOp MemWrite RegWrite MemRead Branch R register 2 Sign extend Shift left 2 M u x 1 ALU result Zero Data memory Write data Rea d dat a M u x 1 Instruction [15–11] ALU control ALU Address

ALU control ALU control output 000 AND 001OR 010add 110subtract 111set-on-less-than (sign of rs-rt -> rd) 00 = lw, sw 01 = beq, 10 = arithmetic ALUop

פקודת ה - jump 4 bits 26 bits 2 bits 00 : כתובת קפיצה במילים : כתובת קפיצה בבתים … … : הקפיצה הסופית : תוספת 4 ביטים אחרונים פירוש הפקודה: J 101 … הפקודה הבאה נמצאת בכתובת …1001

Jump Shift left 2 PC Instruction memory Read address Instruction [31–0] Data memory Read data Write data Registers Write register Write data Read data 1 Read data 2 Read register 1 Read register 2 Instruction [15–11] Instruction [20–16] Instruction [25–21] Add ALU result Zero Instruction [5–0] MemtoReg ALUOp MemWrite RegWrite MemRead Branch Jump RegDst ALUSrc I sult M u x 0 10 ALU Shift left Address