Slide 17 of 30
Notes:
Let me explain now how this faster lookahead PC is used to issue prefetches.
On the left, we see a short sequence of instructions. Im only showing branch and load instructions, because we dont care about the rest. As indicated, the lookahead PC points at branch A and is subsequently directly advanced to branch E. Before advancing it to E, however, we must find all intermediate load instructions to issue prefetches.
The reference prediction table holds the information about the memory instructions needed to issue prefetches. Previously we have indexed this table using the lookahead PC as it pointed to the actual memory instructions.
In Tango, the lookahead PC never actual points at memory instructions, but we can add additional tag entries to the reference prediction table to allow us to do a fully associative search using the lookahead PC. These tag fields are enclosed in the red box. The search finds all memory instructions that reside in between the two branches A and E. The tag entry is therefore the BTB entry of the immediately preceding branch. Because a branch can take two paths, we must also add a field to identify if the memory instructions lies on the taken or not-taken path. To limit the number of prefetches, a third field enumerates the memory instructions.
In summary, in the first cycle Tango issues prefetches for the memory instruction B and C. In the second cycle it issues a prefetch for D. In the third cycle it advances the lookahead PC to E. This process repeats.