+ wire waiting_cpsr = use_cpsr & (cpsr_inflight[0] | cpsr_inflight[1]);
+ wire waiting_regs = |(use_regs & (regs_inflight[0] | regs_inflight[1]));
+ wire waiting = waiting_cpsr | waiting_regs;
+ assign outstall = (waiting && !inbubble && !flush) || stall;
+
+ reg delayedflush = 0;
+ always @(posedge clk)
+ if (flush && outstall /* halp! I can't do it now, maybe later? */)
+ delayedflush <= 1;
+ else if (!outstall /* anything has been handled this time around */)
+ delayedflush <= 0;
+