Pipeline and Vector processing - Study Problems | CS 433, Exams of Computer Architecture and Organization

Material Type: Exam; Class: Computer System Organization; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Spring 2006;

Typology: Exams

Pre 2010

Uploaded on 03/10/2009

koofers-user-76p
koofers-user-76p 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS433: Computer System Organization – Spring 2006
Problems for Chapter 4
Due Date: None (Practice only)
Problem 1
Consider a loop that implements the vector computation Y = aX + Y (commonly known
as DAXPY). Here is the code:
foo:
L.D F2, 0(R1) ; load X(i)
MULT.D F4, F2, F0 ; multiply a*X(i)
L.D F6, 0(R2) ; load Y(i)
ADD.D F6, F4, F6 ; add a*X(i) + Y(i)
S.D 0(R2), F6 ; store Y(i)
DADDUI R1, R1, #8 ; increment Y index
DADDUI R2, R2, #8 ; increment X index
DSGTUI R3, R1, #800 ; set if greater than (test if done)
BEQZ R3, foo ; loop if not done
Consider a VLIW processor and make the following assumptions:
All integer operations, all loads, and all stores spend 1 cycle in EX
All FP operations spend 4 cycles in EX. The FP units are fully pipelined.
Ignore branch delay.
Assume data forwarding as necessary.
The VLIW processor can issue one integer (or branch) operation, two memory
operations, and two FP operations every cycle.
For load and store operations, both effective address calculation and memory
access occur in the EX stage (i.e. the data is written in the EX stage). Therefore,
the pipeline is IF/ID/EX/WB).
You are required to unroll the above loop body four times and then schedule the unrolled
loop for the above VLIW processor, eliminating as many stalls as possible. Show the
unrolled loop as part of your solution. For the final answer, indicate which operation will
issue (to its execution unit) in each clock cycle by filling in the table given below.
Calculate the CPI for the four iterations.
pf3

Partial preview of the text

Download Pipeline and Vector processing - Study Problems | CS 433 and more Exams Computer Architecture and Organization in PDF only on Docsity!

CS433: Computer System Organization – Spring 2006

Problems for Chapter 4

Due Date: None (Practice only)

Problem 1

Consider a loop that implements the vector computation Y = aX + Y (commonly known as DAXPY). Here is the code:

foo: L.D F2, 0(R1) ; load X(i) MULT.D F4, F2, F0 ; multiply aX(i) L.D F6, 0(R2) ; load Y(i) ADD.D F6, F4, F6 ; add aX(i) + Y(i) S.D 0(R2), F6 ; store Y(i) DADDUI R1, R1, #8 ; increment Y index DADDUI R2, R2, #8 ; increment X index DSGTUI R3, R1, #800 ; set if greater than (test if done) BEQZ R3, foo ; loop if not done

Consider a VLIW processor and make the following assumptions:

  • All integer operations, all loads, and all stores spend 1 cycle in EX
  • All FP operations spend 4 cycles in EX. The FP units are fully pipelined.
  • Ignore branch delay.
  • Assume data forwarding as necessary.
  • The VLIW processor can issue one integer (or branch) operation, two memory operations, and two FP operations every cycle.
  • For load and store operations, both effective address calculation and memory access occur in the EX stage (i.e. the data is written in the EX stage). Therefore, the pipeline is IF/ID/EX/WB).

You are required to unroll the above loop body four times and then schedule the unrolled loop for the above VLIW processor, eliminating as many stalls as possible. Show the unrolled loop as part of your solution. For the final answer, indicate which operation will issue (to its execution unit) in each clock cycle by filling in the table given below. Calculate the CPI for the four iterations.

Issue Cycle Memory reference 1

Memory reference 2

FP operation 1

FP operation 2

Integer op/branch 1 2 3 4 5 6 7 8 9

Problem 2

Consider the following four code fragments, each containing two instructions: i. ADD R1, R1 # LW R2, 7(R1) ii. ADD R3, R1, R SW 7(R1), R iii. SW 7(R1), R SD 200(R7), F iv. BEZ R1, place SW 7(R1), R

  • For each code fragment (i) to (iv), list each type of data dependence that a compiler would find (a fragment may have no dependences).