Question

2. (20 pts) Given the following sequence of instructions to be executed on a 5-stage pipelined datapath as descripted in our textbook: I1 add $8, $12,$10 12 SW $9,0 ($8) 13 lw $8,4($9) I4. and $12,$12,$8 15 SW $8,0($9) a. List true dependencies in the given sequence in the format of (register involved producer instruction, consumer instruction). Use labels to indicate instructions For example: ($0, I10, I11) means a true dependence between instruction I10 and I11: value of register $0 is generated by I10 and used by I11. Do NOT list output or anti-dependences. b. If there is no forwarding or hazard detection, no reordering allowed, insert nops to ensure correct execution. c. Repeat b. but allow instruction reordering nops should be inserted only when a hazard cannot be avoided by reordering instructions Hint: You could use $1 for register renaming if needed to help reordering instructions; but you must ensure the same values are stored in the relevant memory locations before and after the reordering. d. If there is full forwarding support, draw multiple-cycled pipeline diagram to show the execution of the original sequence (NOT the reordered version). Use arrows to mark forwardings clearly in your diagram. Each arrow should point from instruction/stage that generates the data instruction/stage that consumes the data. Also mark the necessary pipeline stalls

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)Dependencies list:-

I1: $12,$10
I2: [$8]
I3: [$9]+(4*4)
I4: $12,$8
I5: [$9]

b)
I1: add $8,$12,$10
nop
I2:sw $9,0($8)
nop
nop
nop
lw $8,4($9)
nop
and $12,$12,$8
nop
sw $8,0($9)

Add a comment
Know the answer?
Add Answer to:
Given the following sequence of instructions to be executed on a 5-stage pipelined datapath as decrypted...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (60 points) The following instructions are executed on the 5-stage MIPS pipelined datapath. add r...

    Computer architecture help: (60 points) The following instructions are executed on the 5-stage MIPS pipelined datapath. add r5,r2, r1 lw r3, 4(r5) lw r2, 0(r2) or r3, r5, r3 sw r3, 0(r5) (a) (20 points) List the data hazards in the above code. For each data hazard identified, clearly mark the source and the destination. For example you can say, there is a data hazard from instruction X to instruction Y on register Z. (b) (20 points) Assume there is...

  • 1. Given the following instruction sequence for the MIPS processor with the standard 5 stage pipeline $10, S0. 4 addi lw S2.0(S10) add sw S2,4(510) $2, $2, $2 Show the data dependences between th...

    1. Given the following instruction sequence for the MIPS processor with the standard 5 stage pipeline $10, S0. 4 addi lw S2.0(S10) add sw S2,4(510) $2, $2, $2 Show the data dependences between the instructions above by drawing arrows between dependent instructions (only show true/data dependencies). a. Assuming forwarding support, in what cycle would the store instruction write back to memory? Show the cycle by cycle execution of the instructions as they execute in the pipeline. Also, show any stalls...

  • In this exercise, we examine how data dependences affect execution in the basic 5-stage pipeline described...

    In this exercise, we examine how data dependences affect execution in the basic 5-stage pipeline described in Section 4.5. Problems in this exercise refer to th following sequence of instructions: addi $2,$2,22 SW $3,20($2) OR $4,$2,$3 Also, assume the following cycle times for each of the options related to forwarding: Without Forwarding With Full Forwarding 300ps With ALU-ALU Forwarding Only 250ps 290ps 4.9.1 [10] <4.5> Indicate dependences and their type. 4.9.2 [10] <S4.5> Assume there is no forwarding in this...

  • Q4. (20 points) Consider the following sequence of instructions being processed on the 5-stage RISC-V pipelined...

    Q4. (20 points) Consider the following sequence of instructions being processed on the 5-stage RISC-V pipelined processor: lw r4, 100 (r2) add r5, r2, r3 sub r6, r4, r5 and r7, r2, r5 I. Identify all the data dependencies in the above instruction sequence. For each dependency, indicate the two instructions and the register that causes the dependency. I Assume that the pipelined uses full forwarding. Draw a pipelined diagram that represents the flow of instructions through the pipeline during...

  • 2 This exercise is intended to help you understand the relationship between forwarding hazard detection, and...

    2 This exercise is intended to help you understand the relationship between forwarding hazard detection, and ISA design. Problems in this exercise refer to the following sequence of instructions, and assume that it is executed on a 5-stage pipelined datapath: w r5,4(r5) add r5,r2,r5 w r3,0(r5) or r3,r5,r3 sw r4,0(r5) 2.1 If there is no forwarding or hazard detection, how many nops needed to be inserted to ensure correct execution, and how many cycles needed to execute the codes? 2.2...

  • Question 1: Problems in this exercise refer to the following sequence of instructions : LW $5,...

    Question 1: Problems in this exercise refer to the following sequence of instructions : LW $5, -16($5) SW $5, -16($5) ADD $5, $5, $5 A) Indicate dependences and their type. (40 Points) B) Assume there is not forwarding in this pipeline processor, indicate hazards and add NOP instructions to eliminate them. C) Assume there is full forwarding, indicate hazards and add NOP instructions to eliminate unresolved cases. The remaining problem in this exercise assumes the following clock cycle times: Without...

  • Using graphical representation, show the pipeline execution of the following instructions on the 5-stage pipeline with...

    Using graphical representation, show the pipeline execution of the following instructions on the 5-stage pipeline with hazard detection and forwarding as implemented in Lecture 6. Clearly indicate the forwarding path(s) and stall(s). Note: highlight the forwarding path and use bubbles (or O) for stalls. Lw R20, 0x0100(R18) Add R14, R20, R16 Sw R18, 0x0110(R16) Or R12, R14, R20 Lw R18, 0x0100(R12) instr CC1 CC2 CC3 lw

  • Given the following sequence of instructions: lw $s2, 0($s1) //1 lw $s1, 40($s3) //2 sub $s3,...

    Given the following sequence of instructions: lw $s2, 0($s1) //1 lw $s1, 40($s3) //2 sub $s3, $s1, $s2 //3 add $s3, $s2, $s2 //4 or $s4, $s3, $zero //5 sw $s3, 50($s1) //6 a. List the read after write (current instruction is reading certain registers which haven’t been written back yet) data dependencies. As an example , 3 on 1 ($s2) shows instruction 3 has data dependency on instruction 1 since it is reading register $s2. b. Assume the 5...

  • 2 This exercise is intended to help you understand the relationship between forwarding hazard detection, and...

    2 This exercise is intended to help you understand the relationship between forwarding hazard detection, and ISA design. Problems in this exercise refer to the following sequence of instructions, and assume that it is executed on a 5-stage pipelined datapath: lw r5,4(r5) add r5,r2,r5 Iw r3,0(r5) or r3,r5,r3 sw r4,0(r5) 2.1 If there is no forwarding or hazard detection, how many nops needed to be inserted to ensure correct execution, and how many cycles needed to execute the codes? 2.2...

  • The datapath for 5-stage MIPS pipelined architecture is given below. VAD IDEX EXMEM MEMWI Add Add...

    The datapath for 5-stage MIPS pipelined architecture is given below. VAD IDEX EXMEM MEMWI Add Add Ads Shit wef2 Address Read Read register Road Zero Instruction memory w gier rond Address data register Write data 0 memory w extend Choose all the components that generate a useful result during the execution of the following instruction: LW R1, B(R2) 1. Program Counter 2. Adder in IF stage 3. Instruction Memory 4. Register File Choose all the components that generate a useful...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT