Close

Data hazards

A project log for FPGA Game Console

This is my graduation project for B.Sc. in Electrical and Electricity Engineering.

StanislavStanislav 2 days ago0 Comments

In pipeline architecture sometimes happens situation when one of the operand don't yet updated, but you need to use it already. For this situations may be 3 solutions.

1. Stall the pipeline until we get the new value.

2. Forwarding new value to stage that we need.

3. (Sofware) Enter NOP commands between the operations.

I went for 1 and 2. The main idea is to sign every command with 3 additional bits in control unit that will notice the pipe what register is source and another is destination, if opcode is using it.

We have 8 registers, so we can use another register of 6 bits(3 for destination and 3 for source) to mark and every latch of the stage we sending to data hazards control which doing comparisons of all stages and check if there is source/destination dependnces. If we have dependence between WB and one of the other stages, then we just forward the value, but if we still didn't get the new value from the ALU l, then we will stall the pipe until we got it.

Discussions