Chapter 7 Microarchitecture

Slides:



Advertisements
Similar presentations
The Processor: Datapath & Control
Advertisements

1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and Control.
Computer ArchitectureFall 2007 © October 3rd, 2007 Majd F. Sakr CS-447– Computer Architecture.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
Chapter Five The Processor: Datapath and Control.
Shift Instructions (1/4)
Copyright 1998 Morgan Kaufmann Publishers, Inc. All rights reserved. Digital Architectures1 Machine instructions execution steps (1) FETCH = Read the instruction.
Processor I CPSC 321 Andreas Klappenecker. Midterm 1 Thursday, October 7, during the regular class time Covers all material up to that point History MIPS.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Processor: Datapath and Control
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
1 COMP541 Multicycle MIPS Montek Singh Apr 4, 2012.
COMP541 Multicycle MIPS Montek Singh Apr 8, 2015.
1 CS/COE0447 Computer Organization & Assembly Language Multi-Cycle Execution.
ECE 445 – Computer Organization
CDA 3101 Fall 2013 Introduction to Computer Organization
CS2100 Computer Organisation The Processor: Datapath (AY2015/6) Semester 1.
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.
COMP541 Multicycle MIPS Montek Singh Mar 25, 2010.
D ATA P ATH OF A PROCESSOR (MIPS) Module 1.1 : Elements of computer system UNIT 1.
Microarchitecture. Outline Architecture vs. Microarchitecture Components MIPS Datapath 1.
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.
MIPS Processor.
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
CS161 – Design and Architecture of Computer Systems
Single-Cycle Datapath and Control
COMP541 Datapaths I Montek Singh Mar 28, 2012.
Morgan Kaufmann Publishers
IT 251 Computer Organization and Architecture
/ Computer Architecture and Design
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
Processor Architecture: Introduction to RISC Datapath (MIPS and Nios II) CSCE 230.
Morgan Kaufmann Publishers The Processor
Processor (I).
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for Single-Cycle Instruction Execution
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Designing MIPS Processor (Single-Cycle) Presentation G
CSCI206 - Computer Organization & Programming
Single-Cycle CPU DataPath.
Computer Organization “Central” Processing Unit (CPU)
Design of the Control Unit for One-cycle Instruction Execution
CS/COE0447 Computer Organization & Assembly Language
Systems Architecture II
MIPS Processor.
Morgan Kaufmann Publishers The Processor
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
The Processor Lecture 3.2: Building a Datapath with Control
Guest Lecturer TA: Shreyas Chand
Topic 5: Processor Architecture
Systems Architecture I
MIPS Microarchitecture Multicycle Processor
COMS 361 Computer Organization
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Lecture 14: Single Cycle MIPS Processor
Processor: Multi-Cycle Datapath & Control
COMP541 Datapaths I Montek Singh Mar 18, 2010.
Computer Architecture Processor: Datapath
Computer Architecture
Chapter 7 Microarchitecture
The Processor: Datapath & Control.
COMS 361 Computer Organization
MIPS Processor.
Processor: Datapath and Control
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

Chapter 7 Microarchitecture Dr. Anilkumar K.G

Textbook and References Textbook(s): Digital Design and Computer Architecture, 2nd Edition, David M.H and Sarah L.H, Morgan Kaufmann, Elsevier, 2013 (ISBN: 978-0-12-394424-5) Computer Architecture: A Quantitative Approach 4th Edition, David A. Patterson and John L. Hennessy, Morgan Kaufmann Publishers, 2005. (ISBN: 0-12-370490-1) Reference(s): Computer Architecture and Implementation, Harvey G. Cragon, Cambridge University Press, 2000 (ISBN: 0-52-165168-9) Simulator: Tasm (Turbo Assembler) Link: https://en.wikipedia.org/wiki/MIPS_instruction_set Dr. Anilkumar K.G

Objective(s) One of the objectives of this study is to make each student to familiar with the internal structure of a commercial Microprocessor (such as a MIPS system) including its single cycle, multi-cycle and pipelined hardware architectures. Once the students gain the knowledge of the hardware details of a microprocessor, then it is possible for them to apply that into any microprocessor related design fields. Finally, the students will get the knowledge of the complete operation of a Microprocessor. Dr. Anilkumar K.G

Architectural State and Instruction Set of MIPS A computer architecture is defined by its instruction set and architectural state. The architectural state of the MIPS 32-bit system consists of the program counter and the 32 registers. Any MIPS micro-architecture must contain all of this state. Based on the current architectural state, the processor executes a particular instruction with a particular set of data to produce a new architectural state. Dr. Anilkumar K.G

Architectural State and Instruction Set of MIPS To keep the micro-architectures easy to understand, we just need to consider only a subset of the MIPS instruction set. Specifically, we handle the following instructions: ▶ R-type arithmetic/logic instructions: add, sub, and, or, etc ▶ Memory instructions: lw, sw ▶ Branches: beq After building the micro-architectures with these instructions, we extend them to handle addi (add Immediate) and j (jump) instructions. These particular instructions were chosen because they are sufficient to write many interesting programs. Dr. Anilkumar K.G

Design Process The design process divide the micro-architectures into two interacting parts: the datapath and the control unit. The datapath: The datapath operates on words of data. It contains structures such as memories, registers, ALUs, and multiplexers. In our study, MIPS is a 32-bit architecture, hence it has a 32-bit datapath. The Control unit: The control unit receives the current instruction from the datapath and tells the datapath how to execute that instruction. Specifically, the control unit produces multiplexer select, register enable, and memory write signals to control the operation of the datapath. Dr. Anilkumar K.G

Design Process Figure 7.1 shows a block diagram with the four state elements of a MIPS system: program counter, register file, instruction memory and data memory In Figure 7.1: Heavy lines are used to indicate 32-bit data busses. Medium lines are used to indicate narrower busses, such as the 5-bit address busses on the register file (why?) . Narrow blue lines are used to indicate control signals, such as the register file write/read enable. Dr. Anilkumar K.G

Design Process Dr. Anilkumar K.G

Design Process Program counter (PC): Instruction memory: Data memory: The program counter is an ordinary 32-bit register. Its output, PC (Figure 7.1), points to the current instruction. Its input, PC′, indicates the address of the next instruction. Instruction memory: The instruction memory has a single read port. It takes a 32-bit instruction address input, A, and reads the 32-bit data (i.e., instruction) from that address onto the read data output (RD). Data memory: The data memory has a single read/write port. If the write enable, WE, is 1, it writes data WD into address A on the rising edge of the clock (write operation). If the write enable is 0, it reads address A onto RD (read operation). Dr. Anilkumar K.G

Design Process Register file: The 32-element  32-bit register file has two read ports and one write port. The read ports take 5-bit address inputs, A1 and A2, each specifying one of 25 = 32 registers as source operands. They read the 32-bit register values onto read data outputs RD1 and RD2, respectively. The write port takes a 5-bit address input, A3; a 32-bit write data input, WD; a write enable input, WE3; and a clock. If the write enable (WE) is 1, the register file writes the data into the specified register on the rising edge of the clock. Dr. Anilkumar K.G

Single Cycle MIPS Micro-architecture The single cycle micro-architecture executes an entire instruction in one cycle. It is easy to explain the single cycle micro architecture and it has a simple control unit. Because it completes the operation in one cycle, It does not need any non-architectural registers to hold intermediate results. However, the cycle time is limited by the slowest instruction. Dr. Anilkumar K.G

Multicycle MIPS Micro-architecture The multi-cycle micro-architecture executes instructions in a series of various shorter cycles. Simpler instructions execute in fewer cycles than complicated ones. Moreover, the multi-cycle micro-architecture reduces the hardware cost by reusing expensive hardware blocks such as adders and memories. For example, the adder may be used on several different cycles for several purposes while carrying out a single instruction. The multi-cycle microprocessor accomplishes this by adding several non-architectural registers to hold intermediate results. The multicycle processor executes only one instruction at a time, but each instruction takes multiple clock cycles. Dr. Anilkumar K.G

MIPS Pipelined Micro-architecture The pipelined micro-architecture applies pipelining to the single-cycle micro-architecture. It therefore can execute several instructions simultaneously, improving the throughput significantly. Pipelining must add logic to handle dependencies between simultaneously executing instructions. It also requires non-architectural pipeline registers. All commercial high-performance microprocessors (CPUs) use pipelining today. Dr. Anilkumar K.G

Single Cycle Datapath We first discuss a MIPS microarchitecture that executes instructions in a single cycle. We begin constructing the datapath by connecting the four state elements from Figure 7.1 with combinational logic that can execute the various instructions. Control signals determine which specific instruction is carried out by the datapath at any given time. Means an instruction fetch indicates its execution The control unit contains combinational logic and its Micro ISA that generates the appropriate control signals based on the user instructions (Macro ISA). Dr. Anilkumar K.G

Single Cycle Datapath The program counter (PC) register contains the address of the instruction to execute. The first step is to read the instruction (which is pointed by the PC) from instruction memory. Figure 7.2 shows that the PC is simply connected to the address input of the instruction memory. The instruction memory reads out, or fetches, the 32-bit instruction, labeled Instr. The processor’s actions depend on the specific instruction that was fetched. First we will work out the datapath connections for the lw (load word) instruction. Dr. Anilkumar K.G

Single Cycle Datapath Dr. Anilkumar K.G

Single Cycle Datapath For a lw instruction, the next step is to read the source register containing the base address. The source register is specified in the rs field of the instruction, Instr25:21. These bits of the instruction are connected to the address input of one of the register file read ports, A1, as shown in Figure 7.3. The register file reads the register value onto RD1. Dr. Anilkumar K.G

Single Cycle Datapath Dr. Anilkumar K.G

Single Cycle Datapath The lw instruction also requires an offset. The offset is stored in the immediate field of the instruction, Instr15:0. Because the 16-bit immediate (MIPS immediate field supports only 16-bit immediate value) might be either positive or negative, it must be sign-extended to 32 bits, as shown in Figure 7.4. The 32-bit sign-extended value is called SignImm. Sign extension simply copies the sign bit (most significant bit) of a short input into all of the upper bits of the longer output. Specifically, SignImm15:0 = Instr15:0 and SignImm31:16 = Instr15. Dr. Anilkumar K.G

Single Cycle Datapath Dr. Anilkumar K.G

Single Cycle Datapath The processor must add the base address to the offset to find the real memory address to read the data memory. Figure 7.5 introduces an ALU to perform this addition. The ALU receives two operands, SrcA (base register value) and SrcB (sign extended offset value). The 3-bit ALUControl signal specifies the ALU operation. The ALU generates a 32-bit ALUResult and a Zero flag, that indicates whether ALUResult is zero or not. For a lw instruction, the ALUControl signal should be set to 010 to add the base address and offset. ALUResult is sent to the data memory as the memory address for the load operation, as shown in Figure 7.5. Dr. Anilkumar K.G

Single Cycle Datapath Dr. Anilkumar K.G

Single Cycle Datapath The data is read from the data memory onto the ReadData bus, then written back to the destination register in the register file at the end of the cycle, as shown in Figure 7.6. Port 3 of the register file is the write port. Dr. Anilkumar K.G

Single Cycle Datapath Dr. Anilkumar K.G

Single Cycle Datapath The control unit computes the control signals based on the opcode and funct fields of the instruction, Instr31:26 and Instr5:0. Figure 7.11 shows the entire single-cycle MIPS processor with the control unit attached to the datapath. Dr. Anilkumar K.G

Single Cycle Datapath Dr. Anilkumar K.G

Pipelined MIPS Processor Pipelining is a powerful way to improve the throughput of a digital system. Design a pipelined processor by subdividing the single-cycle processor into five pipeline stages. Thus, five instructions can execute simultaneously, one in each stage. Hence, the latency of each instruction is ideally unchanged, but the throughput is ideally five times better. Microprocessors execute millions or billions of instructions per second, so throughput is more important than latency. Pipelining introduces some overhead, so the throughput will not be quite as high as we might ideally desire. All modern high-performance microprocessors are pipelined. Dr. Anilkumar K.G