I walked through stalls, forwarding, and the load-use edge case and felt pretty good until they asked me to compare hardware cost versus throughput across all of them.
Start by defining the read-after-write (RAW) hazard in a classic 5-stage pipeline, then systematically explain the primary solutions: forwarding (bypassing) and stalling, with a brief mention of register file write-then-read in the same cycle. Compare their trade-offs in terms of performance, hardware complexity, and critical path, and conclude with how ARM processors typically balance these factors.
Pro tip: Mention that forwarding paths can increase the critical path and power consumption, and that some ARM cores use a hybrid approach with limited forwarding and compiler scheduling to reduce stalls. This shows awareness of real-world design constraints beyond textbook solutions.
Explain that a RAW hazard occurs when an instruction needs a register value that a previous instruction hasn't yet written back. In a 5-stage pipeline, this typically happens between the EX and WB stages.
Detail how forwarding paths from the EX/MEM and MEM/WB pipeline registers to the EX stage can supply the needed value without stalling. Mention that this resolves most RAW hazards with minimal performance loss.
Describe how the pipeline can stall (insert bubbles) when forwarding cannot resolve the hazard, such as a load-use hazard. Note that stalling reduces performance but requires simpler hardware.
Mention that if the register file writes in the first half and reads in the second half of a cycle, a WB in the same cycle as an ID can be handled without forwarding or stalling for that specific case.
Analyze trade-offs: forwarding improves performance but adds multiplexers, control logic, and longer critical paths; stalling is simpler but costs cycles; write-then-read is cheap but only helps one case. Conclude with how ARM cores often combine these techniques.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.