Docsity

Pipeline and Cache Performance - Homework Five | CDA 3101, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
CDA 3101 Introduction to Computer
Organization Summer 2007
Homework #5 โ€“ Pipeline & Cache
Performance
Due: at the start of lecture on Tuesday 07 August 2007
This homework covers pipeline and cache memory performance issues discussed in class.
Please check the relevant sections of the Web pages (e.g., Section 5 for pipeline, Section
6 for memory) that contain the performance equations you need to use for this
homework. Also, please show all work to get full credit.
Part I โ€“ Regular Problems
1. (15 pts) Assume we have a pipelined datapath having N > 4 segments (or stages),
with a program of M > N instructions, and 23 percent of those instructions are branches.
Please calculate the CPI of this pipeline using three different strategies for branch
handling that we discussed in class, namely:
o No Intervention โ€“ Branch Target Address calculated in Stage 2, branch taken or
not taken in Stage 3 of the pipeline;
o Branch Prediction as Branch-Not-Taken, where we assume that the next
instruction following the branch is the one that will be executed as a result of the
branch; and
o Branch Delay Slot, where we assume that an independent instruction can be
taken out of the program and placed in the pipeline after the branch, with a
probability of 0 < fBDS < 1.
Assuming that there are no other effects that decrease pipeline performance (e.g., no
stalls or exceptions), the pipeline CPI should be calculated using the following two cases
(5 pts each):
(a) Case 1: N = 5; M = 12,365; fraction of branches mispredicted fBE = 0.46; and
fBDS = 0.53
(b) Case 2: N = 22; M = 12,365; fBE = 0.46; and fBDS = 0.37
pf3

Partial preview of the text

Download Pipeline and Cache Performance - Homework Five | CDA 3101 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

CDA 3101

Introduction to Computer

Organization

Summer 2007

Homework #5 โ€“ Pipeline & Cache

Performance

Due: at the start of lecture on Tuesday 07 August 2007

This homework covers pipeline and cache memory performance issues discussed in class. Please check the relevant sections of the Web pages (e.g., Section 5 for pipeline, Section 6 for memory) that contain the performance equations you need to use for this homework. Also, please show all work to get full credit.

Part I โ€“ Regular Problems

1. (15 pts) Assume we have a pipelined datapath having N > 4 segments (or stages),

with a program of M > N instructions, and 23 percent of those instructions are branches. Please calculate the CPI of this pipeline using three different strategies for branch handling that we discussed in class, namely:

o No Intervention โ€“ Branch Target Address calculated in Stage 2, branch taken or not taken in Stage 3 of the pipeline; o Branch Prediction as Branch-Not-Taken , where we assume that the next instruction following the branch is the one that will be executed as a result of the branch; and o Branch Delay Slot , where we assume that an independent instruction can be taken out of the program and placed in the pipeline after the branch, with a probability of 0 < fBDS < 1.

Assuming that there are no other effects that decrease pipeline performance (e.g., no stalls or exceptions), the pipeline CPI should be calculated using the following two cases (5 pts each):

(a) Case 1 : N = 5; M = 12,365; fraction of branches mispredicted fBE = 0.46; and fBDS = 0.

(b) Case 2 : N = 22; M = 12,365; fBE = 0.46; and fBDS = 0.

For an additional 5 points, compare and contrast the results of Case 1 versus Case 2, focusing on the effect of the branch delay slot versus the pipeline depth (i.e., number of pipeline stages).

2. (15 pts) Consider a 7-segment pipeline with possible exceptions thrown by the EXE stage at Stage 4, and I/O exceptions that can be thrown by the MEM stage at Stage 5_._ Given a program with M = 1,429 instructions, and the following parameters:

o Fraction of instructions that are branches fBR = 0. o Fraction of branches mispredicted fBE = 0. o How are branches dealt with? Branch Delay Slot o Fraction of instructions able to be put in BDS fBDS = 0. o Fraction of instructions that are exceptions in EXE fEXE = 0. o Fraction of instructions that are exceptions in MEM fEXM = 0. o Cost of handling an EXE-stage exception HE = 2 cycles o Cost of handling a MEM-stage exception HM = 15 cycles o Cost of flushing the pipeline for any exception F = 1 cycle

Please calculate the following:

(a) pipeline CPI adjusted for control hazards resulting from branches only; (b) pipeline CPI adjusted for control hazards resulting from exceptions (MEM and EXE) only; and (c) pipeline CPI adjusted for all control hazards in a) and b), above. (Parts a-c 5 pts each).

3. (20 pts) Assume that a cache memory that stores ND = 2Mbytes with L = 32 words/block is between the CPU and the main memory, and that the main memory has an address of width M = 32 bits. Please answer the following questions (5 pts each), also show all your work and reasoning:

(a) For direct-mapped cache, calculate the width NT of the tag field in bits; (b) Calculate the cache address size in Problem 3a, above, assuming one valid bit. (c) For an eight-way set associative cache, calculate the width of the index, tag, and offset fields in the cache address; (d) Given the parameters ND, L, and M stated at the beginning of this question, as well as memory address time tA = 1 cycle, memory access time tM = 10 cycles per word, and data transmission time tD = 1 cycle / word, compute miss penalty Cmiss (in cycles) for the direct-mapped cache in 3a, above.

Part II โ€“ Extra-Credit Problem