6.004 – Fall 200210/29/0L15 – Building a Beta 1 Building the Beta.

Slides:



Advertisements
Similar presentations
Processor Data Path and Control Diana Palsetia UPenn
Advertisements

1 Lecture 3: MIPS Instruction Set Today’s topic:  More MIPS instructions  Procedure call/return Reminder: Assignment 1 is on the class web-page (due.
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
ISA Issues; Performance Considerations. Testing / System Verilog: ECE385.
Arithmetic Logic Unit (ALU)
CIS 314 Fall 2005 MIPS Datapath (Single Cycle and Multi-Cycle)
ELEN 468 Advanced Logic Design
Pipeline Issues This pipeline stuff makes my head hurt! Maybe it’s that dumb hat.
L14 – Control & Execution 1 Comp 411 – Fall /04/09 Control & Execution Finite State Machines for Control MIPS Execution.
Levels in Processor Design
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
CS61C L25 CPU Design : Designing a Single-Cycle CPU (1) Garcia, Fall 2006 © UCB T-Mobile’s Wi-Fi / Cell phone  T-mobile just announced a new phone that.
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Fall 2006 © UCB Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
The Processor Data Path & Control Chapter 5 Part 4 – Exception Handling N. Guydosh 3/1/04+
L16- Building a Computer 1 Comp 411 – Spring /27/08 Building a Computer I wonder where this goes? Instruction Memory A D 0 1 MIPS Kit ALU AB.
The Processor Data Path & Control Chapter 5 Part 1 - Introduction and Single Clock Cycle Design N. Guydosh 2/29/04.
What are Exception and Interrupts? MIPS terminology Exception: any unexpected change in the internal control flow – Invoking an operating system service.
CS3350B Computer Architecture Winter 2015 Lecture 5.6: Single-Cycle CPU: Datapath Control (Part 1) Marc Moreno Maza [Adapted.
1 Pipelining Reconsider the data path we just did Each instruction takes from 3 to 5 clock cycles However, there are parts of hardware that are idle many.
Pipelining the Beta bet·ta ('be-t&) n. Any of various species
1 Instruction Set Architecture (ISA) Alexander Titov 10/20/2012.
Introduction to Computer Engineering CS/ECE 252, Fall 2009 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin – Madison.
Computer Organization and Design Building a Computer!
CDA 3101 Fall 2013 Introduction to Computer Organization
IT253: Computer Organization Lecture 9: Making a Processor: Single-Cycle Processor Design Tonga Institute of Higher Education.
Exceptional Control Flow Topics Exceptions except1.ppt CS 105 “Tour of the Black Holes of Computing”
1 A single-cycle MIPS processor  An instruction set architecture is an interface that defines the hardware operations which are available to software.
Computer Organization Rabie A. Ramadan Lecture 3.
Our programmer needs to do this !
How Computers Work Lecture 3 Page 1 How Computers Work Lecture 3 A Direct Execution RISC Processor: The Unpipelined BETA.
CSE431 L06 Basic MIPS Pipelining.1Irwin, PSU, 2005 MIPS Pipeline Datapath Modifications  What do we need to add/modify in our MIPS datapath? l State registers.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
Computer Organization and Design Building a Computer! Montek Singh Nov 18-20, 2015 Lecture 14.
MIPS Processor.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
CDA 3101 Spring 2016 Introduction to Computer Organization Microprogramming and Exceptions 08 March 2016.
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
CS161 – Design and Architecture of Computer Systems
CS161 – Design and Architecture of Computer Systems
Computer Organization
Computer Organization CS224
Basic Processor Structure/design
ELEN 468 Advanced Logic Design
Introduction to Computer Engineering
Computer Organization and Design Building a Computer!
Decode and Operand Read
Processor (I).
CSCE 212 Chapter 5 The Processor: Datapath and Control
Building a Computer I wonder where this goes? MIPS Kit ALU 1
The processor: Pipelining and Branching
Building a Computer I wonder where this goes? MIPS Kit ALU 1
MIPS Processor.
Levels in Processor Design
Morgan Kaufmann Publishers The Processor
Rocky K. C. Chang 6 November 2017
Computer Organization
Systems Architecture I
COMS 361 Computer Organization
Computer Organization and Design Building a Computer!
Building a Computer! Don Porter Lecture 14.
Chapter Four The Processor: Datapath and Control
Computer Organization and Design Building a Computer!
Chapter 11 Processor Structure and function
Control Unit (single cycle implementation)
The Processor: Datapath & Control.
Introduction to Computer Engineering
What You Will Learn In Next Few Sets of Lectures
Processor: Datapath and Control
Presentation transcript:

6.004 – Fall /29/0L15 – Building a Beta 1 Building the Beta

6.004 – Fall /29/0L15 – Building a Beta 2 CPU Design Tradeoffs Maximum Performance: measured by the numbers of instructions executed per second Minimum Cost : measured by the size of the circuit. Best Performance/Price: measured by the ratio of MIPS to size. In power-sensitive applications MIPS/Watt is important too.

6.004 – Fall /29/0L15 – Building a Beta 3 Performance Measure PUSHING PERFORMANCE... TODAY: 1 cycle/inst. NEXT TIME: more MHz via pipelining NEXT NEXT TIME: fixing various pipelining issues Millions of Instructions per Second Clocks per instruction

6.004 – Fall /29/0L15 – Building a Beta 4 The Beta ISA Instruction classes distinguished by OPCODE: OP OPC MEM Transfer of Control Operate class: Reg[Rc] ← Reg[Ra] op Reg[Rb] Operate class: Reg[Rc] ← Reg[Ra] op SXT(C) Opcodes, both formats: ADDSUBMUL* DIV* *optional CMPEQCMPLECMPLT ANDORXOR SHLSHRSRA

6.004 – Fall /29/0L15 – Building a Beta 5 Approach: Incremental Featurism Each instruction class can be implemented using a simple component repertoire. We’ll try implementing data paths for each class individually, and merge them (using MUXes, etc). Steps: 1. Operate instructions 2. Load & Store Instructions 3. Jump & Branch instructions 4. Exceptions 5. Merge data paths Memories Registers Muxes “Black box” ALU Our Bag of Components:

6.004 – Fall /29/0L15 – Building a Beta 6 Multi-Port Register Files 2 combinational READ ports*, 1 clocked WRITE port *internal logic ensures Reg[31] reads as 0 (independent Read addresses)

6.004 – Fall /29/0L15 – Building a Beta 7 Register File Timing 2 combinational READ ports, 1 clocked WRITE port What if (say) WA=RA1??? RD1 reads “old” value of Reg[RA1] until next clock edge!

6.004 – Fall /29/0L15 – Building a Beta 8 Starting point: ALU Ops 32-bit (4-byte) ADD instruction: Means, to BETA, Reg[R4] ← Reg[R2] + Reg[R3] First, we’ll need hardware to: Read next 32-bit instruction DECODE instruction: ADD, SUB, XOR, etc READ operands (Ra, Rb) from Register File; PERFORM indicated operation; WRITE result back into Register File (Rc).

6.004 – Fall /29/0L15 – Building a Beta 9 Instruction Fetch/Decode Use a counter to FETCH the next instruction: PROGRAM COUNTER (PC) use PC as memory address add 4 to PC, load new value at end of cycle fetch instruction from memory o use some instruction fields directly (register numbers, 16-bit constant) o use bits to generate controls INSTRUCTION WORD FIELDS CONTROL SIGNALS

6.004 – Fall /29/0L15 – Building a Beta 10 ALU Op Data Path OP: Reg[Rc] ← Reg[Ra] op Reg[Rb]

6.004 – Fall /29/0L15 – Building a Beta 11 ALU Operations (w/constant) OPC: Reg[Rc] ← Reg[Ra] op SXT(C)

6.004 – Fall /29/0L15 – Building a Beta 12 Load Instruction LD: Reg[Rc] ← Mem[Reg[Ra]+SXT(C)]

6.004 – Fall /29/0L15 – Building a Beta 13 Store Instruction ST: Mem[Reg[Ra]+SXT(C)] ← Reg[Rc]

6.004 – Fall /29/0L15 – Building a Beta 14 JMP Instruction JMP: Reg[Rc] ← PC+4; PC ← Reg[Ra]

6.004 – Fall /29/0L15 – Building a Beta 15 BEQ/BNE Instructions BEQ: Reg[Rc] ← PC+4; if Reg[Ra]=0 then PC ← PC+4+4*SXT(C) BNE: Reg[Rc] ← PC+4; if Reg[Ra]≠0 then PC ← PC+4+4*SXT(C)

6.004 – Fall /29/0L15 – Building a Beta 16 Load Relative Instruction Hey, WAIT A MINUTE. What’s Load Relative good for anyway??? I thought Code is “PURE”, i.e. READ-ONLY; and stored in a “PROGRAM” region of memory; Data is READ-WRITE, and stored either On the STACK (local); or In some GLOBAL VARIABLE region; or In a global storage HEAP. So why an instruction designed to load data that’s “near” the instruction??? Addresses & other large constants LDR: Reg[Rc] ← Mem[PC *SXT(C)]

6.004 – Fall /29/0L15 – Building a Beta 17 LDR Instruction LDR: Reg[Rc] ← Mem[PC *SXT(C)]

6.004 – Fall /29/0L15 – Building a Beta 18 Exception Processing Plan: Interrupt running program Invoke exception handler (like a procedure call) Return to continue execution. We’d like RECOVERABLE INTERRUPTS for Synchronous events, generated by CPU or system FAULTS (eg, Illegal Instruction, divide-by-0, illegal mem address) TRAPS & system calls (eg, read-a-character) Asynchronous events, generated by I/O (eg, key struck, packet received, disk transfer complete) KEY: TRANSPARENCY to interrupted program. Most difficult for asynchronous interrupts

6.004 – Fall /29/0L15 – Building a Beta 19 Implementation… How exceptions work: Don’t execute current instruction Instead fake a “forced” procedure call save current PC (actually current PC + 4) load PC with exception vector 0x4 for synch. exception, 0x8 for asynch. exceptions Question: where to save current PC + 4? Our approach: reserve a register (R30, aka XP) Prohibit user programs from using XP. Why? Example: DIV unimplemented LD(R31,A,R0) LD(R31,B,R1) DIV(R0,R1,R2) ST(R2,C,R31) IllOp: PUSH(XP) Fetch inst. at Mem[Reg[XP]–4] check for DIV opcode, get reg numbers perform operation in SW, fill result reg POP(XP) JMP(XP) Forced by hardware

6.004 – Fall /29/0L15 – Building a Beta 20 Exceptions Bad Opcode: Reg[XP] ← PC+4; PC ← “IllOp” Other: Reg[XP] ← PC+4; PC ←“Xadr”

6.004 – Fall /29/0L15 – Building a Beta 21 Control Logic Implementation choices: ROM indexed by opcode, external branch & trap logic PLA “random” logic (eg, standard cell gates)

6.004 – Fall /29/0L15 – Building a Beta 22 Beta: Our “Final Answer”

6.004 – Fall /29/0L15 – Building a Beta 23 Next Time: Pipelined Betas Hey, building a computer is not really all that difficult So let’s run down to the lab and put Intel out of business!