1 / 22

COMP 4300 Computer Architecture Review for Final Exam

2. Final Exam Review. Focus on materials after the midterm, includingPipelineExceptionsControl for Pipelined DatapathInstruction Level ParallelismScoreboardTomasula MethodCache

isha
Download Presentation

COMP 4300 Computer Architecture Review for Final Exam

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. 1 COMP 4300 Computer Architecture Review for Final Exam

    2. 2 Final Exam Review Focus on materials after the midterm, including Pipeline Exceptions Control for Pipelined Datapath Instruction Level Parallelism Scoreboard Tomasula Method Cache & Memory Design

    3. 3 Synchronous vs Asynchronous Definition: If the event occurs at the same place every time the program is executed with the same data and memory allocation, the event is synchronous. Otherwise asynchronous. Except for hardware malfunctions, asynchronous events are caused by devices external to the CPU and memory. Which is easy to handle?Which is easy to handle?

    4. 4 Pipeline: Exceptions Exceptions Interrupts Traps Exceptions in five-stage pipeline Exception detection (not covered) Exception handling Stop the offending instruction Flush instructions following the offending instructions Save the address of the offending instruction, and Jump to a prearranged exception handler code

    5. 5 Pipelining in MIPS MIPS architecture was designed to be pipelined Simple instruction format (makes IF, ID easy) Single-word instructions Small number of instruction formats Common fields in same place (e.g., rs, rt) in different formats Memory operations only in lw, sw instructions (simplifies EX) Memory operands aligned in memory (simplifies MEM) Single value for writeback (limits forwarding) Pipelining is harder in CISC architectures

    6. 6 Adding Control Basic approach: build on single-cycle control Place control unit in ID stage Pass control signals to following stages Later: extra features to deal with: Data forwarding Stalls Exceptions

    7. 7 Class Exercise

    8. 8 Class Exercise

    9. 9 Class Exercise

    10. 10 Class Exercise

    11. 11 Forms of Parallelism Process-level How do we exploit it? What are the challenges? Examples? Thread-level How do we exploit it? What are the challenges? Examples? Loop-level What is really loop level parallelism? What percentage of a programs time is spent inside loops? Instruction-level Focus of Chapter 3 & 4

    12. 12 Increasing Instruction-Level Parallelism (ILP) A common way to increase parallelism among instructions is to exploit parallelism among iterations of a loop (i.e Loop Level Parallelism, LLP). This is accomplished by unrolling the loop either statically by the compiler, or dynamically by hardware, which increases the size of the basic block present. This resulting larger basic block provides more instructions that can be scheduled or re-ordered by the compiler to eliminate more stall cycles. In this loop every iteration can overlap with any other iteration. Overlap within each iteration is minimal. for (i=1; i<=1000; i=i+1;) x[i] = x[i] + y[i];

    13. 13 Data Hazard/ Dependence

    14. 14 Control Dependencies Determines the ordering of an instruction with respect to a branch instruction. Example of control dependence in the then part of an if statement:

    15. 15 Dynamic Pipeline Scheduling Dynamic instruction scheduling is accomplished by: Dividing the Instruction Decode ID stage into two stages: Issue: Decode instructions, check for structural hazards. A record of data dependencies is constructed as instructions are issued This creates a dynamically-constructed dependency graph for the window of instructions in-flight (being processed) in the CPU. Read operands: Wait until data hazard conditions, if any, are resolved, then read operands when available (then start execution) (All instructions pass through the issue stage in order but can be stalled or pass each other in the read operands stage). In the instruction fetch stage IF, fetch an additional instruction every cycle into a latch or several instructions into an instruction queue. Increase the number of functional units to meet the demands of the additional instructions in their EX stage. Two approaches to dynamic scheduling: Dynamic scheduling with the Scoreboard used first in CDC6600 (1963) The Tomasulo approach pioneered by the IBM 360/91 (1966)

    16. 16 Tomasulo Algorithm Vs. Scoreboard Control & buffers distributed with Functional Units (FUs) Vs. centralized in Scoreboard: FU buffers are called reservation stations which have pending instructions and operands and other instruction status info (including data dependencies). Reservations stations are sometimes referred to as physical registers or renaming registers as opposed to architecture registers specified by the ISA. ISA Registers in instructions are replaced by either values (if available) or pointers (renamed) to reservation stations (RS) that will supply the value later: This process is called register renaming. Register renaming eliminates WAR, WAW hazards. Allows for a hardware-based version of loop unrolling. More reservation stations than ISA registers are possible, leading to optimizations that compilers cant achieve and prevents the number of ISA registers from becoming a bottleneck. Instruction results go (forwarded) from RSs to RSs , not through registers, over Common Data Bus (CDB) that broadcasts results to all waiting RSs (dependant instructions. Loads and Stores are treated as FUs with RSs as well.

    17. 17 Tomasulo Organization Resolve RAW memory conflict? (address in memory buffers) Integer unit executes in parallel See Fig. 3.2 on page 187 Load buffer: 1. Hold components of effective address until it is computed 2. Track outstanding loads that are waiting on memory 3. Hold the results of completed loads that are waiting for CDB (common data bus) Store buffer: 1. Hold components of effective address until it is computed 2. Hold outstanding stores that are waiting for data value to store 3. Hold address and value to store until the memory unit is available Resolve RAW memory conflict? (address in memory buffers) Integer unit executes in parallel See Fig. 3.2 on page 187 Load buffer: 1. Hold components of effective address until it is computed 2. Track outstanding loads that are waiting on memory 3. Hold the results of completed loads that are waiting for CDB (common data bus) Store buffer: 1. Hold components of effective address until it is computed 2. Hold outstanding stores that are waiting for data value to store 3. Hold address and value to store until the memory unit is available

    18. 18 Memory Hierarchy - the Big Picture Problem: memory is too slow and too small Solution: memory hierarchy

    19. 19 Fundamental Cache Questions

    20. 20 Set Associative Cache Design Key idea: Divide cache into sets Allow block anywhere in a set Advantages: Better hit rate Disadvantage: More tag bits More hardware Higher access time

    21. 21

    22. 22 Cache Performance

More Related