GATE / CS ARCHIVE

GATE CSE 2009 / QUESTION 28

Variable-stage pipeline schedule

Computer Organization & Architecture · Pipelining & Hazards · Full GATE CSE 2009 paper

GATE 2009, Q28 2 marks · MCQ
Report issue

Pipelining & Hazards

Question 28, GATE 2009: Four pipeline stages S1–S4 require cycles per instruction: I1=(2, 1, 1, 1), I2=(1, 3, 2, 2), I3=(2, 1, 1, 3), I4=(1, 2, 2, 2). Execute two iterations of I1, I2, I3, I4. Find total cycles under overlapping buffered-stage execution, ignoring loop-control overhead: A 16; B 23; C 28; D 30.
Tap to enlarge
Your answer
Answer & solution

Answer: B under continuous overlapped execution (no official key was published)

Ignoring loop-control overhead and allowing the eight instructions from two iterations to overlap, each stage starts after both its instruction’s previous stage and the previous instruction’s same stage finish. The four stage-completion times are(2, 3, 4, 5), (3, 6, 8, 10), (5, 7, 9, 13), (6, 9, 11, 15), (8, 10, 12, 16), (9, 13, 15, 18), (11, 14, 16, 21), (12, 16, 18, 23). Thus completion is at cycle 23, B. This recurrence uses buffered stage outputs; it does not charge an additional loop branch or force a pipeline drain between iterations. Such implementation choices are not explicitly specified by the prompt.

Construct a completion-time grid. A cell cannot start until the same instruction finishes its prior stage and the previous instruction releases this stage. Thus completion(i, j)=max(completion(i−1, j), completion(i, j−1))+duration(i, j). Applying it to the eight instruction rows yields final completion 23; the full row table is given above. Simply summing durations would ignore overlap, while assuming every stage takes one cycle ignores the supplied table. Pipeline draining or stage blocking without buffers changes the model, so those assumptions remain explicit.

Original paper, page 6