"Ling-hua Tseng" <[EMAIL PROTECTED]> writes: > The destination operand of the `sub' instruction, d0, will be written > back in the 4th cycle, and the instruction `max' will use it as source > operand (i.e., there is a true data dependency). > > I figured out that the state_transition() returns -1 when I issuing > the `max' instruction, and I figured out it only returns > 0 when > "hardware structural hazard" occured.
Right. state_transition just checks for unit hazards, not data hazards. Instruction dependencies are detected by sched-deps.c and stored in the instructions' LOG_LINKS. insn_latency (in insn-attrtab.c) gives the latency for two dependent instructions. Richard