Single-Cycle Processor Design CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof. Milos.

Slides:



Advertisements
Similar presentations
CS/COE1541: Introduction to Computer Architecture Datapath and Control Review Sangyeun Cho Computer Science Department University of Pittsburgh.
Advertisements

Chapter 1. Basic Structure of Computers
Basic Pipelining CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof. Milos Prvulovic.
Adding the Jump Instruction
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 13 - A Verilog.
Pipeline Example: cycle 1 lw R10,9(R1) sub R11,R2, R3 and R12,R4, R5 or R13,R6, R7.
Cs 152 L1 Intro.1 Patterson Fall 97 ©UCB ECE 366 Computer Architecture Lecture 3 Shantanu Dutt ( Decomposition of Computer.
COE 405 Design and Synthesis of DataPath Controllers Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals.
Mary Jane Irwin ( ) [Adapted from Computer Organization and Design,
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
Lec 8: Pipelining Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University.
Lecture 16: Basic CPU Design
CS 161, Spring 2006 Test 2 Answers. Q1(a) +10 = in 2’s complement. And in sign-extended -12 = in 2’s comp And.
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Fall 2006 © UCB Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Spring 2010 © UCB inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures.
A Tour of A Five-Stage Processor CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof.
Computer Organization CS224 Fall 2012 Lesson 26. Summary of Control Signals addsuborilwswbeqj RegDst ALUSrc MemtoReg RegWrite MemWrite Branch Jump ExtOp.
Processor: Datapath and Control
CSE 340 Computer Architecture Summer 2014 Basic MIPS Pipelining Review.
CS.305 Computer Architecture Enhancing Performance with Pipelining Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from.
1 Designing a Pipelined Processor In this Chapter, we will study 1. Pipelined datapath 2. Pipelined control 3. Data Hazards 4. Forwarding 5. Branch Hazards.
CDA 3101 Fall 2013 Introduction to Computer Organization Multicycle Datapath 9 October 2013.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
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.
CSIE30300 Computer Architecture Unit 04: Basic MIPS Pipelining Hsin-Chou Chi [Adapted from material by and
A Simplified MIPS Processor in Verilog
Branch Prediction CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof. Milos Prvulovic.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
PC Instruction Memory Address Instr. [31-0] 4 Fig 4.6 p 309 Instruction Fetch.
Elements of Datapath for the fetch and increment The first element we need: a memory unit to store the instructions of a program and supply instructions.
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.
Circuit Optimization CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof. Milos Prvulovic.
A Simplified MIPS Processor in Verilog. Data Memory module DM(MemRead, MemWrite, ABUS, DIN, DATABUS); – MemWrite: Nothing happens if 0. If 1, the memory.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
EECS 370 Discussion 1 Sample Exam Questions. EECS 370 Discussion 2 Not Really… xkcd.com.
MIPS processor continued. Performance Assume that – Memory access: 200ps – ALU and adders: 100 ps – Register file read: 50ps – Register file write: 10ps.
1 Chapter 5: Datapath and Control (Part 2) CS 447 Jason Bakos.
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
Advanced Computer Architecture CS 704 Advanced Computer Architecture Lecture 10 Computer Hardware Design (Pipeline Datapath and Control Design) Prof. Dr.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Access the Instruction from Memory
Exam-like questions.
STUDY OF PIC MICROCONTROLLERS.. Design Flow C CODE Hex File Assembly Code Compiler Assembler Chip Programming.
Problem with Single Cycle Processor Design
Computer Organization
Prof. Sirer CS 316 Cornell University
Single Cycle Processor
MIPS processor continued
A Simplified MIPS Processor in Verilog
Single-Cycle CPU DataPath.
CSCI206 - Computer Organization & Programming
Systems Architecture II
The Processor Lecture 3.6: Control Hazards
Levels in Processor Design
The Processor Lecture 3.1: Introduction & Logic Design Conventions
April 3 Fun with MUXes Implementing arbitrary logical functions
Enhancing Data Path M 4-bit Reg X A L U
Storing Control A L U We need a memory to store control
A register design with parallel load input
Systems Architecture I
Levels in Processor Design
Prof. Sirer CS 316 Cornell University
Levels in Processor Design
Review Fig 4.15 page 320 / Fig page 322
Control Unit for Multiple Cycle Implementation
MIPS processor continued
Levels in Processor Design
Control Unit for Multiple Cycle Implementation
Processor: Datapath and Control
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

Single-Cycle Processor Design CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof. Milos Prvulovic

Single-Cycle Approach Entire instruction done in only one cycle Data-moving takes only time it really needs (wires) – E.g. dedicated wire to take reg output to ALU input Control takes only as much time as it really needs – Figure out all control signals right after inst read from imem – Takes only part of one cycle, because one is all we have All major units get used in every cycle – Unless the unit is not needed for a specific instruction But…“enhancements” become “necessities” – Example: Branch uses ALU to compare, need separate PC+4+4*imm – Each cycle, need to read two registers read and writte one – Etc. And… longest-to-do instruction determines clock – Usually a load, so all other insts will have slack for memory read 2

Single-cycle 3 Instr Mem Instr Mem PCPC PCPC RF Control Supported: ADD

Look at that register file! module RegFile(RADDR1,DOUT1,RADDR2,DOUT2,WADDR,DIN,WE,CLK); parameter DBITS; // Number of data bits parameter ABITS; // Number of address bits parameter WORDS = (1<<ABITS); parameter MFILE = ""; reg [(DBITS-1):0] mem[(WORDS-1):0]; input [(ABITS-1):0] RADDR1,RADDR2,WADDR; input [(DBITS-1):0] DIN; output wire [(DBITS-1):0] DOUT1,DOUT2; input CLK,WE; CLK) if(WE) mem[WADDR]=DIN; assign DOUT1=mem[RADDR1]; assign DOUT2=mem[RADDR2]; endmodule 4 Three separate accesses Two reads One write Each with it own address!

Wire it up wire [3:0] rregno1=rs, rregno2=rt; wire [(DBITS-1):0] regout1,regout2; wire [3:0] wregno=rd; // This comes from decoding logic // (reg becomes wire in non-edge always block) reg wrreg; reg [(DBITS-1):0] wregval; // Now instantiate the register file module RegFile #(.DBITS(DBITS),.ABITS(5), regFile(.RADDR1(rregno1),.DOUT1(regout1),.RADDR2(rregno2),.DOUT2(regout2),.WADDR(wregno),.DIN(wregval),.WE(wrreg),.CLK(clk)); 5

Wire it up - ALU // ALU input 1 is always the first source register wire [(DBITS-1):0] aluin1=regout1; // ALU input 2 is decided by control logic // (either regout2 or immediate) reg [(DBITS-1):0] aluin2; // Decided by control logic reg [4:0] alufunc; // Output of the ALU (becomes wire b/c of always block below) reg [(DBITS-1):0] aluout; or aluin1 or aluin2) case(alufunc) OP2_AND: aluout=aluin1&aluin2;... // Same as in Project 2... // but uses aluin1 and aluin2 instead of A and B // Used by control logic for conditional branches wire cond=aluout[0]; 6

Control Logic or opcode2 or ry or rz) begin {aluimm,alufunc,isbranch,isjump,wrmem}= { 1'bX, 5'hXX, 1'b0, 1'b0, 1'b0}; {selaluout,selmemout,selpcplus,wrreg}= { 1'bX, 1'bX, 1'bX, 1'b0}; case(opcode1) OP1_ALUR: {aluimm, alufunc, selaluout,selmemout,selpcplus,wrreg}= { 1'b0,{1’b0,op2_i}, 1'b1, 1'b0, 1'b0, 1'b1}; OP1_ALUI: {aluimm, alufunc, selaluout,selmemout,selpcplus,wrreg}= { 1'b1,{1’b0,op2_t}, 1'b1, 1'b0, 1'b0, 1'b1}; … 7

Single-cycle 8 Instr Mem Instr Mem PCPC PCPC RF 4 4 Control Supported: ADD, ADDI SE MXMX MXMX

Single-cycle 9 Instr Mem Instr Mem PCPC PCPC RF 4 4 Control Supported: All ALUR, ALUI insts SE MXMX MXMX

Single-cycle 10 Instr Mem Instr Mem PCPC PCPC RF 4 4 Control Supported: ALUR, ALUI LW SE MXMX MXMX Data Mem Data Mem MXMX MXMX A

Single-cycle 11 Instr Mem Instr Mem PCPC PCPC RF 4 Control Supported: ALUR, ALUI LW, SW SE MXMX MXMX Data Mem Data Mem MXMX MXMX D A

Single-cycle 12 Instr Mem Instr Mem PCPC PCPC MXMX MXMX RF Data Mem Data Mem MXMX MXMX MXMX MXMX SE 4 A D Control Supported: ALUR, ALUI LW, SW BCOND aluout[0]

And it’s not done yet! 13 Instr Mem Instr Mem PCPC PCPC MXMX MXMX RF Data Mem Data Mem MXMX MXMX MXMX MXMX SE 4 A D Control Supported: ALUR, ALUI, LW, SW, BCOND JAL

How do we do all this? The only real “state” is the PC, Regs, and Mem – The rest is just wires and combinatorial logic Central control takes opcode, generates all signals for the entire instruction! But can have other small pieces of control – E.g. decide if PC+4 or PC+4+Offs loaded into PC on a conditional branch instruction, or to load a register for the JAL instruction 14