Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1) Pipelining and data hazards a) Assume a 7 stage, scalar (1-wide) in-order MIPS pipeline with stages: FT, FA, D, E, MT, MA, W. [Aside:
1) Pipelining and data hazards a) Assume a 7 stage, scalar (1-wide) in-order MIPS pipeline with stages: FT, FA, D, E, MT, MA, W. [Aside: while not germane to this problem, assume that each memory stage has been split in two for serialized tag check and data access in the land D caches) Assume full forwarding and bypass networks. Indicate stalled instruction occupancy in a pipeline stage with a lower case letter (ft,fa,d,e,mt,ma,w). Assume that all hazard detection and bubble insertion logic is in decode (D). Indicate, by drawing a vertical arrow when a value is bypassed from one instruction to another in the cycle that the forwarding occurs. For simplicity, elide WHD bypassing arrows. Assume that all loads and stores are hits and that there are no exceptions. Assume that there are zero branch delay slots and perfect branch prediction. Consider the following sequence of instructions (you may assume them to be the inner body of a FOR loop with the initialization code elided) scheduled on the above pipeline, if the next dynamic instance of the instruction at label I will be a taken branch. lw A: lw $2, 40 ($6) B: lw $2, O ($2). C: lw $3, 40 ($7) lw $3, 0 ($3) add $3, $3, $2 F: SW $3, 0 ($2) addi $6, $6, -64 addi $7, $7, -64 beq $6, $5, A G: H: Build a table where there is one row for each dynamic instruction and one column for each cycle, starting with the tag check on the fetch of the instruction at label A. Fill in the table with the stage currently occupied by the instruction in that row in that cycle until the instruction beq instruction reaches the writeback stage. b) Assuming that all registers other than 0 (fixed), 1 (reserved), 5 (input), 6 (input), and 7(input) and 31(reserved) are freely available for use and that the above sequence can be unrolled by 2x, unroll the above loop and schedule 2 iterations on the same pipeline. What is the improvement in cycles/iteration? 1) Pipelining and data hazards a) Assume a 7 stage, scalar (1-wide) in-order MIPS pipeline with stages: FT, FA, D, E, MT, MA, W. [Aside: while not germane to this problem, assume that each memory stage has been split in two for serialized tag check and data access in the land D caches) Assume full forwarding and bypass networks. Indicate stalled instruction occupancy in a pipeline stage with a lower case letter (ft,fa,d,e,mt,ma,w). Assume that all hazard detection and bubble insertion logic is in decode (D). Indicate, by drawing a vertical arrow when a value is bypassed from one instruction to another in the cycle that the forwarding occurs. For simplicity, elide WHD bypassing arrows. Assume that all loads and stores are hits and that there are no exceptions. Assume that there are zero branch delay slots and perfect branch prediction. Consider the following sequence of instructions (you may assume them to be the inner body of a FOR loop with the initialization code elided) scheduled on the above pipeline, if the next dynamic instance of the instruction at label I will be a taken branch. lw A: lw $2, 40 ($6) B: lw $2, O ($2). C: lw $3, 40 ($7) lw $3, 0 ($3) add $3, $3, $2 F: SW $3, 0 ($2) addi $6, $6, -64 addi $7, $7, -64 beq $6, $5, A G: H: Build a table where there is one row for each dynamic instruction and one column for each cycle, starting with the tag check on the fetch of the instruction at label A. Fill in the table with the stage currently occupied by the instruction in that row in that cycle until the instruction beq instruction reaches the writeback stage. b) Assuming that all registers other than 0 (fixed), 1 (reserved), 5 (input), 6 (input), and 7(input) and 31(reserved) are freely available for use and that the above sequence can be unrolled by 2x, unroll the above loop and schedule 2 iterations on the same pipeline. What is the improvement in cycles/iteration
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started