The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
562 views
add \$so,\$to,\$t1

sub \$t2,\$S0,\$t3  

Num of stall cyles i am getting 2 stall but the books says 3

1.No data data forwarding

2.Write to register file in first half and read from second half in clock cycle  my timing dig goes like this

add  IF ID EX MEM WB     

             NOP        

                   NOP           

                            IF ID  EXE .....
asked in CO & Architecture by (209 points)
retagged by | 562 views

1 Answer

0 votes

This will be the timing diagram. Three stall cycles are needed to ensure WB is completed before the ID stage of the SUB instruction. This assumes Register File read is performed during the ID stage of the pipeline.

  Clk1 Clk2 Clk3 Clk4 Clk5 Clk6 Clk7 Clk8 Clk9
ADD IF ID EX MEM WB        
SUB   IF Stall Stall Stall ID EX MEM WB


        

answered by Boss (18.3k points)
0
But why cant wb and id stage be in same cycle h&p does this all the time because it says reg file is written in the first half clk cycle and read in the second half clk cylcle read during second half and this example is from h&p
0
In that case, there will be only 2 stall cycles. But unless that is specified in the question, we cannot assume that.
0
yes 2 stalls


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

40,903 questions
47,558 answers
146,290 comments
62,306 users