New Fetch Operation
This code assumes that hit in BTAC forces a predict-taken (overrides the 2-bit predictor). Also that EUMAX = 4.
If (inc_pc = 1) then if (Hit in BTAC using PC) then save next sequential PC (pc+4) as mis-predict PC recovery value send Branch instruction + 3 NOPs to DRR next_pc := BTA; else ( (if Miss in BTAC using PC) and (slot 0 instr = BRANCH) ) then compute new BTA from branch, send 4 NOPS to DRR, wait a clock cycle if (BHT = Predict Taken) then save next sequential PC (pc+4) as mis-predict PC recovery value send Branch instruction + 3 NOPs to DRR next_pc := BTA else predict not taken, save BTA as mis-predict PC recovery value send IBUF contents to DRR next_pc := pc + 4 end if; else next_pc := pc + 4 send current instructions in IBUF to DRR end if; pc := next_pc IBUF = IMEM(PC); -- fetch next 4 instructionsend if;