This introduces data and control hazards. Data hazards occur when the pipeline changes the order of read/ write accesses to operands so that the order differs from the order seen by sequentially executing instructions on the unpipelined machine.
Data Hazards CC 1 CC 2 CC 3 CC 4 CC 5 CC 6 Time ( in clock cycles) R1, R2, R3 Reg DM DM DM ADD SUB R4, R1, R5 AND R6, R1, R7 OR R8, R1, R9 XOR R10, R1, R11 Reg Reg Reg IM Reg IM IM IM IM Reg ALU ALU ALU ALU Program execution order ( in instructions) Reg CSE 240A Dean Tullsen Data Hazard lw R8, 10000( R3) add R6, R2, R1 addi R3, R1, # 35 Data memory ALU ˜ ˜ Sign extend˜ PC Instruction memory. data hazards but the loads, still need to, wait, or the instructions dependent on loads still need to wait, because you don' t know, the results of the value, until, you come out of here.
Data Dependences • A data dependence occurs whenever one instruction needs a value produced by another. • Register values ( for now) • Also memory accesses ( more on this later).Pipeline Hazards. There are situations, called hazards, that prevent the next instruction in the instruction stream from being executing during its designated clock cycle.
They arise from resource conflicts when the hardware cannot support all troduction • Pipelining up. • We call a data dependence a hazard when an instruction tries to read a register in stage 2 ( ID) and this register will be written by a previous instruction that has not yet completed stage 5 ( WB).
• This is sometimes called a read- after- write hazard.