Docsity

Homework II Problems - Computer System Organization | CS 433, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
CS333: Computer Architecture – Spring 2008
Homework 2
Total Points: 38 Points (undergrad), 46 Points (graduate)
Due Date: Feb. 14, 2008 by 2:00 pm (See course information handout for more
details on late submissions)
Directions:
•Please read the course information handout for information on groups and
collaboration and other homework policies.
•On top of the first page of your homework solutions, please write your name
and NETID, your partner’s name and NETID, and whether you are a 3-hour
or 4-hour student. On each successive page, write your NETID.
•Please show all work that you used to arrive at your answer. Answers
without justification will not receive credit.
•On Campus Students: please submit the homework in class.
•I2CS Students: please submit the homework to [email protected]. Please
write your name, NETID, your partner’s name and NETID on the first page
of your homework solutions.
Problem 1 [14 Points]
Tomasulo and Hardware Speculation
For this problem, we will consider the specification for Tomasulo’s algorithm in
homework 1, but this time with speculation and multiple issue. So consider the following
architecture specifications:
Functional Unit Type Cycles in EX Number of Functional Units
Integer 1 1
FP Divider 15 1
•Assume you have unlimited reservation stations.
•Memory accesses use the integer functional unit to perform effective address
calculation during the EX stage. For stores, memory is accessed during the
commit stage. All loads access memory during EX stage.
pf3
pf4
pf5

Partial preview of the text

Download Homework II Problems - Computer System Organization | CS 433 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

CS333: Computer Architecture – Spring 2008 Homework 2 Total Points: 38 Points (undergrad), 46 Points (graduate) Due Date: Feb. 14, 2008 by 2:00 pm (See course information handout for more details on late submissions) Directions:

  • Please read the course information handout for information on groups and collaboration and other homework policies.
  • On top of the first page of your homework solutions, please write your name and NETID, your partner’s name and NETID, and whether you are a 3 hour or 4 hour student. On each successive page, write your NETID.
  • Please show all work that you used to arrive at your answer. Answers without justification will not receive credit.
  • On Campus Students: please submit the homework in class.
  • I2CS Students: please submit the homework to [email protected]. Please write your name, NETID, your partner’s name and NETID on the first page of your homework solutions. Problem 1 [14 Points] Tomasulo and Hardware Speculation For this problem, we will consider the specification for Tomasulo’s algorithm in homework 1, but this time with speculation and multiple issue. So consider the following architecture specifications: Functional Unit Type Cycles in EX Number of Functional Units Integer 1 1 FP Divider 15 1
  • Assume you have unlimited reservation stations.
  • Memory accesses use the integer functional unit to perform effective address calculation during the EX stage. For stores, memory is accessed during the commit stage. All loads access memory during EX stage.
  • Loads and stores stay in EX for 1 cycle.
  • Functional units are not pipelined.
  • If an instruction moves to its WB stage in cycle x, then an instruction that is waiting on the same functional unit (due to a structural hazard) can start executing in cycle x.
  • An instruction waiting for data on the CDB can move to its EX stage in the cycle after the CDB broadcast.
  • Only one instruction can write to the CDB in one clock cycle. Branches and stores do not need the CDB.
  • Whenever there is a conflict for a functional unit or the CDB, assume that the oldest (by program order) of the conflicting instructions gets access, while others are stalled.
  • Assume that BNEQZ occupies the integer functional unit for its computation and spends one cycle in EX.
  • Assume that the result from the integer functional unit is also broadcast on the CDB and forwarded to dependent instructions through the CDB (just like any floating point instruction). Complete the following table using Tomasulo’s algorithm, but this time, assume hardware speculation and dual issue. That is, assume that an instruction can issue even before the branch has completed (or started) its execution (as with perfect branch and target prediction). However, assume that an instruction after a branch cannot issue in the same cycle as the branch; the earliest it can issue is in the cycle immediately after the branch (to give time to access the branch history table and/or buffer). Any other pair of instructions can issue in the same cycle (assuming all necessary dependences are satisfied). Additionally, assume that you have as large a reorder buffer as you need. Further, two instructions can commit each cycle. Recall also that stores only calculate target addresses in EX and perform memory accesses during the Commit stage, and do nothing during the WB stage. Fill in the cycle numbers in each pipeline stage for each instruction in the first two iterations of the loop, assuming the branch is always taken. The entries for the first instruction of the first iteration are filled in for you. CMT stands for the commit stage.

Branch 1: Step Branch 1 Prediction Actual Branch 1 Action 1 N T 2 3 4 5 6 7 8 Branch 2: Step Branch Prediction Actual Branch 2 Action 1 N T 2 Part B [4 Points] Now assume that 4 bit saturation counters are used. When the processor starts to execute the above code, both counters contain value 7. What is the number of correct predictions? Use the following tables to record the prediction and action of each branch. The first entry is filled in for you. Branch 1: Step Counter Value Branch 1 Prediction Actual Branch 1 Action 1 0111 N T 2 3 4 5 6 7 8

Branch 2: Step Counter Value Branch 2 Prediction Actual Branch 2 Action 1 0111 N T 2 Part C: [4 points] Now assume that 2 level correlating predictors of the form (2,1) are used. When the processor starts to execute the above code, the outcome of the previous two branches is not taken (N). Also assume that the initial state of predictors of all branches is not taken (N). What is the number of correct predictions? Use the following table to record your steps. Record the "New State" of predictors in the form W/X/Y/Z where,

  • W state corresponds to the case where the last branch and the branch before the last are both TAKEN
  • X state corresponds to the case where the last branch is TAKEN and the branch before the last is NOT TAKEN
  • Y state corresponds to the case where the last branch is NOT TAKEN and the branch before the last is TAKEN
  • Z state corresponds to the case where the last branch and the branch before the last are both NOT TAKEN The first entry is filled in for you. Branch 1: Step Branch 1 Prediction Actual Branch 1 Action New State 1 N T N/ N/ N/ T 2 3 4 5 6 7 8

Problem 4 [4 points] Suppose we have a deeply pipelined processor for which we implement a branch target buffer (BTB) for conditional branches. Assume that the misprediction penalty is always 4 cycles and the buffer miss penalty is always 3 cycles. Assume 85% prediction accuracy and 20% frequency of conditional branches. What should the hit rate in the branch target buffer be for this processor to be faster than a processor that has a fixed 2 cycle branch penalty? (assume that the two processors are equivalent in every other respect.) Assume a base CPI of 1 when there are no conditional branch stalls. GRADUATE PROBLEM: Problem 5 (8 points) This problem concerns the implications of the reorder buffer size on performance. Consider a processor implementing Tomasulo’s algorithm with reservation stations and the reorder buffer scheme described in detail in the lecture notes. Assume infinite processor resources unless stated otherwise; e.g., infinite execution units and infinite reservation stations. Assume a perfect branch predictor and assume there are no data dependences in the instruction stream we are considering. Assume the maximum instruction fetch rate is 12 instructions per cycle. (The other stages in the pipeline have no constraints; e.g., the processor can decode an unbounded number of instructions per cycle.) Part (A): (2 points) Suppose all instructions take one cycle to execute and the processor has an infinite reorder buffer. What is the average instructions per cycle rate or IPC for this processor? Part (B): (2 points) Consider the system in part (a) except that now every 48th instruction is a load that misses in the cache and the miss latency is 500 cycles. What is the average instructions per cycle or IPC for this processor? Part (C): (4 points) Consider the system in part (b) except that now the reorder buffer size is 48 entries. What is the average IPC for this processor? If the IPC is less than 12, then what is the smallest reorder buffer size for which the IPC will be 12 again (assume the reorder buffer size can only be a multiple of 12).