@@ -136,44 +136,51 @@ DecoupledBPUWithBTB::tick()
136136 return ;
137137 }
138138
139- // 1. Request new prediction if FSQ not full and we are idle
140- if (bpuState == BpuState::IDLE && !streamQueueFull ()) {
141- if (blockPredictionPending) {
142- DPRINTF (Override, " Prediction blocked to prioritize resolve update\n " );
143- dbpBtbStats.predictionBlockedForUpdate ++;
144- blockPredictionPending = false ;
145- } else {
146- requestNewPrediction ();
147- bpuState = BpuState::PREDICTOR_DONE;
139+ int predsRemainsToBeMade = enableTwoTaken ? 2 : 1 ;
140+ unsigned tempNumOverrideBubbles = 0 ;
141+
142+ while (predsRemainsToBeMade > 0 ) {
143+ // 1. Request new prediction if FSQ not full and we are idle
144+ if (bpuState == BpuState::IDLE && !streamQueueFull ()) {
145+ if (blockPredictionPending) {
146+ DPRINTF (Override, " Prediction blocked to prioritize resolve update\n " );
147+ dbpBtbStats.predictionBlockedForUpdate ++;
148+ blockPredictionPending = false ;
149+ } else {
150+ requestNewPrediction ();
151+ bpuState = BpuState::PREDICTOR_DONE;
152+ }
148153 }
149- }
150154
151- // 2. Handle pending prediction if available
152- if (bpuState == BpuState::PREDICTOR_DONE) {
153- DPRINTF (Override, " Generating final prediction for PC %#lx\n " , s0PC);
154- numOverrideBubbles = generateFinalPredAndCreateBubbles ();
155- bpuState = BpuState::PREDICTION_OUTSTANDING;
155+ // 2. Handle pending prediction if available
156+ if (bpuState == BpuState::PREDICTOR_DONE) {
157+ DPRINTF (Override, " Generating final prediction for PC %#lx\n " , s0PC);
158+ numOverrideBubbles = generateFinalPredAndCreateBubbles ();
159+ bpuState = BpuState::PREDICTION_OUTSTANDING;
156160
157- // Clear each predictor's output
158- for (int i = 0 ; i < numStages; i++) {
159- predsOfEachStage[i].btbEntries .clear ();
161+ // Clear each predictor's output
162+ for (int i = 0 ; i < numStages; i++) {
163+ predsOfEachStage[i].btbEntries .clear ();
164+ }
160165 }
161- }
162166
163- if (bpuState == BpuState::PREDICTION_OUTSTANDING && numOverrideBubbles > 0 ) {
164- tage->dryRunCycle (s0PC);
165- }
167+ if (bpuState == BpuState::PREDICTION_OUTSTANDING && numOverrideBubbles > 0 ) {
168+ tage->dryRunCycle (s0PC);
169+ }
166170
167- // check if:
168- // 1. FSQ has space
169- // 2. there's no bubble
170- // 3. PREDICTION_OUTSTANDING
171- if (validateFSQEnqueue ()) {
172- // Create new FSQ entry with the current prediction
173- processNewPrediction ();
171+ // check if:
172+ // 1. FSQ has space
173+ // 2. there's no bubble
174+ // 3. PREDICTION_OUTSTANDING
175+ if (validateFSQEnqueue ()) {
176+ // Create new FSQ entry with the current prediction
177+ processNewPrediction ();
174178
175- DPRINTF (Override, " FSQ entry enqueued, prediction state reset\n " );
176- bpuState = BpuState::IDLE;
179+ DPRINTF (Override, " FSQ entry enqueued, prediction state reset\n " );
180+ bpuState = BpuState::IDLE;
181+ }
182+
183+ predsRemainsToBeMade--;
177184 }
178185
179186 // Decrement override bubbles counter
0 commit comments