Computer Systems Structure - CPU Hazards
52 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What action is taken if the instruction is identified as a non-branch instruction?

  • Enter the instruction into the branch-target buffer
  • Continue execution normally (correct)
  • Initiate a misprediction process
  • Jump to the predicted address
  • What happens when a mispredicted branch occurs?

  • The branch-target buffer is not updated
  • The processor delays the execution to resolve the prediction
  • The fetched instructions are retained for future use
  • The execution is restarted at the correctly predicted address (correct)
  • What is the function of the branch-target buffer in this context?

  • To track the execution of non-branch instructions
  • To hold all executed instructions
  • To store the address of predicted branch targets (correct)
  • To ensure no branches are taken during execution
  • During the instruction decoding phase (ID), what determines if the next action involves a branch?

    <p>The type of instruction being processed (B)</p> Signup and view all the answers

    What does the system do if there is an entry found in the branch-target buffer and the instruction is a taken branch?

    <p>Fetch the instruction at the predicted address (D)</p> Signup and view all the answers

    What is the primary purpose of the scoreboard method in CPU architecture?

    <p>To dynamically schedule a pipeline allowing out-of-order execution when there are no hazards. (B)</p> Signup and view all the answers

    Which stage of instruction processing involves checking for structural and write-after-write (WAW) hazards?

    <p>Issue (B)</p> Signup and view all the answers

    In the scoreboard structure, what does the 'Busy' status indicate?

    <p>The functional unit is currently in use. (D)</p> Signup and view all the answers

    What must occur before an instruction can proceed to the Read operands stage?

    <p>No read-after-write (RAW) hazards are present. (A)</p> Signup and view all the answers

    How does the scoreboard handle stalled instructions?

    <p>It monitors execution flow until dependencies are resolved before issuing the stalled instruction. (A)</p> Signup and view all the answers

    Which hazard type is checked during the Write result stage of instruction processing?

    <p>Write-after-read (WAR) (B)</p> Signup and view all the answers

    What aspect does the 'Register result status' of the scoreboard indicate?

    <p>Which functional unit will write to each register, if applicable. (A)</p> Signup and view all the answers

    In which computer was the scoreboard method first used?

    <p>CDC 6600 (A)</p> Signup and view all the answers

    What is the role of a Tournament predictor in branch prediction?

    <p>To combine both global and local predictors with a selector. (B)</p> Signup and view all the answers

    How does the 2-bit local predictor perform when dealing with significant branches?

    <p>It fails on important branches unless adjusted. (A)</p> Signup and view all the answers

    What is included in the Branch Target Buffer (BTB)?

    <p>Targets of taken branches stored in associative memory. (B)</p> Signup and view all the answers

    What is the size of memory used for 1024 entries in a local and global prediction (2,2) BHT?

    <p>8 kbits (B)</p> Signup and view all the answers

    What phenomenon occurs when comparing the misprediction rates of different predictors?

    <p>Misprediction statistics vary significantly among different prediction strategies. (D)</p> Signup and view all the answers

    What is a primary benefit of Tomasulo’s algorithm compared to the Scoreboard method?

    <p>It resolves WAR and WAW dependencies. (B)</p> Signup and view all the answers

    What is a significant limitation of the Scoreboard method?

    <p>It introduces stall phases when required functional units are busy. (A)</p> Signup and view all the answers

    Which distinctive feature does Tomasulo’s algorithm employ to manage data dependencies?

    <p>Register renaming. (A)</p> Signup and view all the answers

    What hardware component is primarily increased in quantity when implementing the Scoreboard method?

    <p>Data buses. (B)</p> Signup and view all the answers

    What are reservation stations used for in Tomasulo’s algorithm?

    <p>To fetch and store instruction operands. (A)</p> Signup and view all the answers

    Which is NOT a feature of Tomasulo’s algorithm?

    <p>Utilizing control hazards. (B)</p> Signup and view all the answers

    What role do redundant functional units serve in Tomasulo's algorithm?

    <p>Prevent structural hazards. (C)</p> Signup and view all the answers

    Which functional unit is not typically referenced in the context of the P6 architecture?

    <p>Graphical Processing Unit. (A)</p> Signup and view all the answers

    When is an instruction issued in Tomasulo’s algorithm?

    <p>Only if the required functional unit and all operands are available. (B)</p> Signup and view all the answers

    In which stage of Tomasulo's algorithm is the instruction's result written back to the destination register?

    <p>Write result. (D)</p> Signup and view all the answers

    What role does the Re-order Buffer (ROB) serve in a processor's architecture?

    <p>It holds data regarding instructions in their original order. (B)</p> Signup and view all the answers

    What is the primary benefit of dynamic branch prediction over static branch prediction?

    <p>It accounts for historical execution patterns of branches. (A)</p> Signup and view all the answers

    Which statement accurately describes the commit stage in Tomasulo’s algorithm?

    <p>It transfers data from the re-order buffer to registers or memory. (D)</p> Signup and view all the answers

    What is a major drawback of static branch prediction?

    <p>It fails in the presence of many conditional jumps. (B)</p> Signup and view all the answers

    Which of the following correctly describes the saturating counters used in dynamic branch prediction?

    <p>They are binary storage systems with four distinct states. (B)</p> Signup and view all the answers

    What occurs when a branch is taken during pipeline execution?

    <p>The pipeline must be flushed and reinitialized. (A)</p> Signup and view all the answers

    In the context of Netburst architecture, what advantage does scheduling all functional units in advance provide?

    <p>It enables functional units to operate with minimal stalling. (D)</p> Signup and view all the answers

    How does the branch history table (BHT) aid in dynamic branch prediction?

    <p>It keeps a log of all executed branch instructions for future reference. (D)</p> Signup and view all the answers

    What type of branches does static prediction identify as always taken?

    <p>Unconditional jumps (D)</p> Signup and view all the answers

    What is a likely consequence of a branch prediction mismatch?

    <p>Reduced processor performance. (C)</p> Signup and view all the answers

    What does a two-level adaptive predictor utilize to make predictions?

    <p>A pattern of taken and not taken branches (B)</p> Signup and view all the answers

    What is the main drawback of a global branch predictor?

    <p>It performs poorly with uncorrelated branches. (B)</p> Signup and view all the answers

    Which predictors concatenate local and global branch histories?

    <p>Hybrid predictor (C)</p> Signup and view all the answers

    In a gshare predictor, how is the index in the prediction history table determined?

    <p>By XORing the global history buffer with the jump address. (A)</p> Signup and view all the answers

    What is the function of local branch prediction?

    <p>Storing separate history buffers for each jump instruction. (D)</p> Signup and view all the answers

    What type of predictor is used to detect loops in conditional jumps?

    <p>Loop predictor (B)</p> Signup and view all the answers

    What method does the Agree predictor utilize?

    <p>It applies a XOR operation to combine local and global predictors. (A)</p> Signup and view all the answers

    What information does the global branch predictor primarily use?

    <p>Shared history across all conditional jumps. (D)</p> Signup and view all the answers

    What is the primary purpose of the prediction history buffer?

    <p>To remember previous branch targets. (D)</p> Signup and view all the answers

    What is the role of a pattern history table in branch prediction?

    <p>To store the patterns of taken and not taken branches. (D)</p> Signup and view all the answers

    Which branch predictor type is characterized by individual history buffers?

    <p>Local predictor (C)</p> Signup and view all the answers

    Which architecture was noted for using local branch predictors with 4-bit history?

    <p>Pentium II and III (B)</p> Signup and view all the answers

    What is the influence of a two-bit counter in branch prediction?

    <p>It represents the state of each branch prediction. (D)</p> Signup and view all the answers

    What is one drawback of using a global branch predictor over a local branch predictor?

    <p>It may yield poorer results with uncorrelated jumps. (C)</p> Signup and view all the answers

    Study Notes

    Computer Systems Structure - Central Processing Unit (CPU)

    • The central processing unit (CPU) is a core component of computer systems.

    Hazard Cases and Solutions

    • Solutions for hazard cases in CPU pipelines involve techniques like scoreboard methods, Tomasulo's method, and branch prediction.

    Scoreboard Method

    • Used initially in the CDC 6600 computer (1966).
    • Dynamically schedules instructions in a pipeline to avoid conflicts, enabling out-of-order execution if hardware is available, and no structural hazards.
    • Logs data dependencies for each instruction.
    • Releases instructions only when the scoreboard confirms no conflicts with previously issued, incomplete instructions.
    • If an instruction stalls due to dependencies, the scoreboard monitors the pipeline to resolve those dependencies before continuing the stalled instruction.
    • Instructions progress through four stages (Issue, Decode, Read Operands, Execution, Write result) before completion.
    • Stages include operations like checking for structural and WAW hazards, and waiting for RAW hazards resolution.
    • Scoreboard hardware has a similar cost to an FPU but could be more demanding on buses in modern processors.
    • Important to note, this method does not handle forwarding.
    • Stalls occur when required functional units are busy, affecting subsequent instructions.

    Tomasulo's Algorithm

    • Avoids structural hazards and resolves WAR and WAW hazards using register renaming and a Common Data Bus (CDB).
    • Used first in IBM 360/91 computer (1969).
    • Employs register renaming to create multiple copies of physical registers, minimizing dependencies.
    • Real data dependencies cause no problems, unlike the limited number of registers causing a bottleneck.
    • Data is placed on a CDB, and made available promptly, avoiding unnecessary delays in execution until the data is written into the destination register.
    • Instructions proceed through issue, execute, write stages, carefully managing RAW dependencies and utilizing virtual values until real ones become available.
    • Crucial to note this addresses issues not resolved by the scoreboard method.

    Reservation Stations

    • Buffers that acquire and store instruction operands for immediate availability.
    • Reservation stations keep the data and result of an instruction.
    • Points to registers (data is available) or other reservation stations containing necessary data before writing back to a register.
    • Stores the result of an instruction execution and releases functional units once instruction execution completes.
    • This release then makes results available for other reservation stations, avoiding delays.

    Branch Prediction

    • A method for mitigating control hazards caused by conditional jumps, by predicting the correct branch path.
    • Static prediction is based on analyzing the branch instruction itself, to determine if it will take the branch or not. Common cases like procedure calls and unconditional jumps are analyzed to predict the decision.
    • Dynamic prediction incorporates history of previous branch executions, to predict future behavior.
    • Methods include next line prediction, and saturating counters.

    Branch Prediction Methods (Dynamic)

    • Next line predictor - Method stores the address of the next instruction(s) after the jump, along with the branch target address.
    • Saturating counters - Use one or two bits to keep track of the decision taken in past executions. States such as Strongly not taken, weakly not taken, weakly taken, and strongly taken are used.
    • Various prediction methods and modifications such as Two-level adaptive prediction, are described.

    Branch Target Buffer (BTB)

    • A dedicated structure containing target addresses for taken branches from past calculations, enabling faster future evaluation. -Contains jump instruction address, target address, and prediction state.

    Tournament Predictor

    • A powerful prediction method that combines local and global information using a selector to determine the ideal prediction based on a given branch.

    Correlated Prediction - Overview

    • This method combines aspects of local and global prediction, to improve accuracy.
    • It considers a history table where each entry is assigned four predictors.

    Misprediction Statistics/General

    • Statistics about misprediction rates from simulations of the different architectures.
    • Various configurations can be evaluated (number of entries, or bits per history table entry).

    Commit Stage (Tomasulo's Algorithm)

    • An additional stage in Tomasulo's algorithm, ROB (Reorder Buffer) assists in committing instructions in the correct order, even if their execution was out of order.
    • Results are written to the ROB (Reorder Buffer) and not directly into the final destinations to allow for later reordering and avoiding pipeline stalls.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Description

    This quiz focuses on the central processing unit (CPU) in computer systems, particularly addressing the techniques used to solve hazard cases in CPU pipelines. Topics include the scoreboard method and various solutions for optimizing instruction scheduling in modern CPUs.

    More Like This

    Understanding CPU Pipeline Stages and Hazards
    12 questions

    HandierConnemara618 avatar
    HandierConnemara618
    Hazards in Pipelined Processing
    41 questions

    Hazards in Pipelined Processing

    IllustriousSuccess3527 avatar
    IllustriousSuccess3527
    Use Quizgecko on...
    Browser
    Browser