Datapath Design I Topics Sequential instruction execution cycle Instruction mapping to hardware Instruction decoding Systems I.

Slides:



Advertisements
Similar presentations
University of Amsterdam Computer Systems – the processor architecture Arnoud Visser 1 Computer Systems The processor architecture.
Advertisements

Real-World Pipelines: Car Washes Idea  Divide process into independent stages  Move objects through stages in sequence  At any instant, multiple objects.
1 Seoul National University Logic Design. 2 Overview of Logic Design Seoul National University Fundamental Hardware Requirements  Computation  Storage.
David O’Hallaron Carnegie Mellon University Processor Architecture Logic Design Processor Architecture Logic Design
1 RISC Pipeline Han Wang CS3410, Spring 2010 Computer Science Cornell University See: P&H Chapter 4.6.
Randal E. Bryant Carnegie Mellon University CS:APP2e CS:APP Chapter 4 Computer Architecture SequentialImplementation CS:APP Chapter 4 Computer Architecture.
PipelinedImplementation Part I CSC 333. – 2 – Overview General Principles of Pipelining Goal Difficulties Creating a Pipelined Y86 Processor Rearranging.
CS:APP CS:APP Chapter 4 Computer Architecture Control Logic and Hardware Control Language CS:APP Chapter 4 Computer Architecture Control Logic and Hardware.
Randal E. Bryant CS:APP Chapter 4 Computer Architecture SequentialImplementation CS:APP Chapter 4 Computer Architecture SequentialImplementation Slides.
Computer Organization Chapter 4
Datapath Design II Topics Control flow instructions Hardware for sequential machine (SEQ) Systems I.
Y86 Processor State Program Registers
Processor Architecture: The Y86 Instruction Set Architecture
1 Seoul National University Pipelined Implementation : Part I.
1 Seoul National University Logic Design. 2 Overview of Logic Design Seoul National University Fundamental Hardware Requirements  Computation  Storage.
Chapter 4: Processor Architecture How does the hardware execute the instructions? We’ll see by studying an example system  Based on simple instruction.
1 Naïve Pipelined Implementation. 2 Outline General Principles of Pipelining –Goal –Difficulties Naïve PIPE Implementation Suggested Reading 4.4, 4.5.
Instructor: Erol Sahin
Randal E. Bryant Carnegie Mellon University CS:APP CS:APP Chapter 4 Computer Architecture SequentialImplementation CS:APP Chapter 4 Computer Architecture.
Randal E. Bryant adapted by Jason Fritts CS:APP2e CS:APP Chapter 4 Computer Architecture SequentialImplementation CS:APP Chapter 4 Computer Architecture.
Based on slides by Patrice Belleville CPSC 121: Models of Computation Unit 10: A Working Computer.
Architecture (I) Processor Architecture. – 2 – Processor Goal Understand basic computer organization Instruction set architecture Deeply explore the CPU.
Computer Architecture Carnegie Mellon University
CSC 2405 Computer Systems II Advanced Topics. Instruction Set Architecture.
Computer Architecture I: Outline and Instruction Set Architecture
1 Sequential CPU Implementation. 2 Outline Logic design Organizing Processing into Stages SEQ timing Suggested Reading 4.2,4.3.1 ~
CS:APP3e CS:APP Chapter 4 Computer Architecture Logic Design CS:APP Chapter 4 Computer Architecture Logic Design CENG331 - Computer Organization Murat.
1 Processor Architecture. 2 Topics Write Y86 code Basic Logic design Hardware Control Language HCL Suggested Reading: 4.1, 4.2.
1 Processor Architecture. Coverage Our Approach –Work through designs for particular instruction set Y86---a simplified version of the Intel IA32 (a.k.a.
1 SEQ CPU Implementation. 2 Outline SEQ Implementation Suggested Reading 4.3.1,
Sequential Hardware “God created the integers, all else is the work of man” Leopold Kronecker (He believed in the reduction of all mathematics to arguments.
Rabi Mahapatra CS:APP3e Slides are from Authors: Bryant and O Hallaron.
Sequential CPU Implementation Implementation. – 2 – Processor Suggested Reading - Chap 4.3.
1 Seoul National University Sequential Implementation.
CPSC 121: Models of Computation
Real-World Pipelines Idea Divide process into independent stages
CPSC 121: Models of Computation
Samira Khan University of Virginia Feb 9, 2017
Lecture 13 Y86-64: SEQ – sequential implementation
Lecture 14 Y86-64: PIPE – pipelined implementation
Module 10: A Working Computer
Lecture 12 Logic Design Review & HCL & Bomb Lab
Seoul National University
Course Outline Background Sequential Implementation Pipelining
Sequential Implementation
Ch. 2 Two’s Complement Boolean vs. Logical Floating Point
Samira Khan University of Virginia Feb 14, 2017
Computer Architecture adapted by Jason Fritts then by David Ferry
Y86 Processor State Program Registers
Pipelined Implementation : Part I
Seoul National University
Instruction Decoding Optional icode ifun valC Instruction Format
Pipelined Implementation : Part II
Systems I Pipelining III
Computer Architecture adapted by Jason Fritts
Systems I Pipelining II
Pipelined Implementation : Part I
Sequential CPU Implementation
Pipeline Architecture I Slides from: Bryant & O’ Hallaron
Pipelined Implementation : Part I
Recap: Performance Comparison
Computer Architecture
Systems I Pipelining II
Chapter 4 Processor Architecture
Systems I Pipelining II
Disassembly תרגול 7 ניתוח קוד.
Real-World Pipelines: Car Washes
Sequential CPU Implementation
CS-447– Computer Architecture M,W 10-11:20am Lecture 5 Instruction Set Architecture Sep 12th, 2007 Majd F. Sakr
Sequential Design תרגול 10.
Presentation transcript:

Datapath Design I Topics Sequential instruction execution cycle Instruction mapping to hardware Instruction decoding Systems I

2 Overview How do we build a digital computer? Hardware building blocks: digital logic primitives Instruction set architecture: what HW must implement Principled approach Hardware designed to implement one instruction at a time Plus connect to next instruction Decompose each instruction into a series of steps Expect that most steps will be common to many instructions Extend design from there Overlap execution of multiple instructions (pipelining) Later in this course Parallel execution of many instructions In more advanced computer architecture course

3 Y86 Instruction Set Byte pushl rA A0 rA 8 jXX Dest 7 fn Dest popl rA B0 rA 8 call Dest 80 Dest rrmovl rA, rB 20 rArB irmovl V, rB 308 rB V rmmovl rA, D ( rB ) 40 rArB D mrmovl D ( rB ), rA 50 rArB D OPl rA, rB 6 fnrArB ret 90 nop 00 halt 10 addl 60 subl 61 andl 62 xorl 63 jmp 70 jle 71 jl 72 je 73 jne 74 jge 75 jg 76

4 Building Blocks Combinational Logic Compute Boolean functions of inputs Continuously respond to input changes Operate on data and implement control Storage Elements Store bits Addressable memories Non-addressable registers Loaded only as clock rises Register file Register file A B W dstW srcA valA srcB valB valW Clock ALUALU fun A B MUX 0 1 = Clock

5 Hardware Control Language Very simple hardware description language Can only express limited aspects of hardware operation Parts we want to explore and modify Data Types bool : Boolean a, b, c, … int : words A, B, C, … Does not specify word size---bytes, 32-bit words, …Statements bool a = bool-expr ; int A = int-expr ;

6 HCL Operations Classify by type of value returned Boolean Expressions Logic Operations a && b, a || b, !a Word Comparisons A == B, A != B, A = B, A > B Set Membership A in { B, C, D } »Same as A == B || A == C || A == D Word Expressions Case expressions [ a : A; b : B; c : C ] Evaluate test expressions a, b, c, … in sequence Return word expression A, B, C, … for first successful test

7 An Abstract Processor What does a processor do? Consider a processor that only executes nops. void be_a_processor(unsigned int pc, unsigned char* mem){ while(1) { char opcode = mem[pc]; assert(opcode == NOP); pc = pc + 1; } } Fetch Decode Execute

8 An Abstract Processor Executes nops and absolute jumps void be_a_processor(unsigned int pc, unsigned char* mem){ while(1) { char opcode = mem[pc]; switch (opcode) { case NOP: pc++; case JMP: pc = *(int*)&mem[(pc+1)]; Missing execute and memory access

9 SEQ Hardware Structure State Program counter register (PC) Condition code register (CC) Register File Memories Access same memory space Data: for reading/writing program data Instruction: for reading instructions Instruction Flow Read instruction at address specified by PC Process through stages Update program counter Instruction memory Instruction memory PC increment PC increment CC ALU Data memory Data memory Fetch Decode Execute Memory Write back icodeifun rA,rB valC Register file Register file AB M E Register file Register file AB M E PC valP srcA,srcB dstA,dstB valA,valB aluA,aluB Bch valE Addr, Data valM PC valE,valM newPC

10 SEQ Stages Fetch Read instruction from instruction memoryDecode Read program registersExecute Compute value or addressMemory Read or write data Write Back Write program registersPC Update program counter Instruction memory Instruction memory PC increment PC increment CC ALU Data memory Data memory Fetch Decode Execute Memory Write back icodeifun rA,rB valC Register file Register file AB M E Register file Register file AB M E PC valP srcA,srcB dstA,dstB valA,valB aluA,aluB Bch valE Addr, Data valM PC valE,valM newPC

11 Instruction Decoding Instruction Format Instruction byteicode:ifun Optional register byterA:rB Optional constant wordvalC 50 rArB D icode ifun rA rB valC Optional

12 Executing Arith./Logical Operation Fetch Read 2 bytesDecode Read operand registersExecute Perform operation Set condition codesMemory Do nothing Write back Update register PC Update Increment PC by 2 Why? OPl rA, rB 6 fn rArB

13 Stage Computation: Arith/Log. Ops Formulate instruction execution as sequence of simple steps Use same general form for all instructions OPl rA, rB icode:ifun  M 1 [PC] rA:rB  M 1 [PC+1] valP  PC+2 Fetch Read instruction byte Read register byte Compute next PC valA  R[rA] valB  R[rB] Decode Read operand A Read operand B valE  valB OP valA Set CC Execute Perform ALU operation Set condition code register Memory R[rB]  valE Write back Write back result PC  valP PC update Update PC

14 Executing rmmovl Fetch Read 6 bytesDecode Read operand registersExecute Compute effective addressMemory Write to memory Write back Do nothing PC Update Increment PC by 6 rmmovl rA, D ( rB) 40 rA rB D

15 Stage Computation: rmmovl Use ALU for address computation rmmovl rA, D(rB) icode:ifun  M 1 [PC] rA:rB  M 1 [PC+1] valC  M 4 [PC+2] valP  PC+6 Fetch Read instruction byte Read register byte Read displacement D Compute next PC valA  R[rA] valB  R[rB] Decode Read operand A Read operand B valE  valB + valC Execute Compute effective address M 4 [valE]  valA Memory Write value to memory Write back PC  valP PC update Update PC

16 Executing popl Fetch Read 2 bytesDecode Read stack pointerExecute Increment stack pointer by 4Memory Read from old stack pointer Write back Update stack pointer Write result to register PC Update Increment PC by 2 popl rA b0 rA 8

17 Stage Computation: popl Use ALU to increment stack pointer Must update two registers Popped value New stack pointer popl rA icode:ifun  M 1 [PC] rA:rB  M 1 [PC+1] valP  PC+2 Fetch Read instruction byte Read register byte Compute next PC valA  R[ %esp ] valB  R [ %esp ] Decode Read stack pointer valE  valB + 4 Execute Increment stack pointer valM  M 4 [valA] Memory Read from stack R[ %esp ]  valE R[rA]  valM Write back Update stack pointer Write back result PC  valP PC update Update PC

18 Summary Today Sequential instruction execution cycle Instruction mapping to hardware Instruction decoding Next time Control flow instructions Hardware for sequential machine (SEQ)