1 / 27

Chapter 7 Microarchitecture

Chapter 7 Microarchitecture. Textbook and References. Textbook(s): Digital Design and Computer Architecture, 2 nd Edition, David M.H and Sarah L.H, Morgan Kaufmann, Elsevier, 2013 (ISBN: 978-0-12-394424-5)

cherylperez
Download Presentation

Chapter 7 Microarchitecture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 7Microarchitecture Dr. Anilkumar K.G

  2. 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

  3. 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

  4. 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 32registers. • Any MIPS micro-architecturemust 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

  5. 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

  6. 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 datapathhow 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

  7. Design Process • Figure 7.1 shows a block diagram with the four state elements of a MIPS system: • program counter, • register file, • instructionmemory and • data memory • In Figure 7.1: • Heavy linesare 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 linesare used to indicate control signals, such as the register file write/read enable. Dr. Anilkumar K.G

  8. Design Process Dr. Anilkumar K.G

  9. Design Process • Program counter (PC): • 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

  10. 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

  11. 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

  12. 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-cyclemicroprocessor accomplishes this by adding several non-architecturalregisters 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

  13. MIPS Pipelined Micro-architecture • The pipelined micro-architecture applies pipelining to the single-cyclemicro-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

  14. 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

  15. 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

  16. Single Cycle Datapath Dr. Anilkumar K.G

  17. 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

  18. Single Cycle Datapath Dr. Anilkumar K.G

  19. 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:0and SignImm31:16 = Instr15. Dr. Anilkumar K.G

  20. Single Cycle Datapath Dr. Anilkumar K.G

  21. 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 ALUResultis 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

  22. Single Cycle Datapath Dr. Anilkumar K.G

  23. 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

  24. Single Cycle Datapath Dr. Anilkumar K.G

  25. 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

  26. Single Cycle Datapath Dr. Anilkumar K.G

  27. 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

More Related