Branch Target Cache Access Ahead of Instruction Fetch

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing data processing systems face inefficiencies due to latency in branch prediction, leading to increased power consumption and instruction fetch latency, particularly when dealing with multiple branches and two-cycle latency in accessing branch target caches (BTACs) and instruction caches.

Innovation Solution

A data processing apparatus with a branch target cache and a data store that decouples BTAC logic from memory logic, allowing advanced BTAC accesses to reduce unnecessary cache accesses and fetch latency by storing and retrieving branch prediction information efficiently, using two program counters and a split data store to manage instruction flow and prediction data.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If BTAC is accessed in parallel with instruction cache using two program counters, then branch prediction accuracy is improved, but fetch latency increases due to two-cycle latency in BTAC access

Engineering Contradiction:
Improvebranch prediction accuracyVSAvoidfetch latency
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent performs BTAC accesses in advance of instruction cache accesses by using two program counters (PC1 for BTAC, PC2 for instruction cache). PC1 is incremented by 2 while PC2 is incremented by 1, allowing the branch target cache to be queried ahead of time so that branch prediction results are ready before the actual instruction fetch completes, eliminating the two-cycle latency penalty.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediate buffer that stores branch prediction results from the BTAC before they are needed by the instruction fetch pipeline. This buffer acts as a mediator that decouples the BTAC access timing from the instruction cache access timing, allowing the two operations to proceed at different rates without blocking each other.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If buffers are used to store fetched instructions and branch predictions, then pipeline bubbles are hidden, but device complexity increases

Engineering Contradiction:
Improveinstruction flow continuityVSAvoidbuffer structure complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent segments the buffer structure into multiple independent buffers, each handling specific stages of the instruction fetch pipeline. Instead of one large complex buffer, the system uses several smaller buffers (such as a first buffer for branch predictions and a second buffer for fetched instructions) that can be managed independently, reducing overall complexity while maintaining continuous instruction flow.

Inventive Principle:
Principle #1Segmentation

3Loss of energy

If BTAC access is performed two cycles in advance, then unnecessary cache accesses are reduced, but instruction fetch latency increases due to waiting for instruction return

Engineering Contradiction:
Improvepower consumptionVSAvoidinstruction fetch latency
Core Design Contradiction:
Loss of energyVSLoss of time

Solution Approach 1:

The patent performs BTAC accesses two cycles in advance of instruction cache accesses, allowing branch prediction to be completed before the actual instruction fetch. This preliminary action identifies which instructions will be needed, enabling the system to avoid fetching instructions that won't be executed, thereby reducing power consumption without significantly impacting overall fetch latency.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system uses the branch prediction information to self-regulate the instruction fetch process. When a branch is predicted to be taken, the fetch unit automatically adjusts to fetch from the branch target address instead of the sequential next instruction, eliminating the need for subsequent fetch corrections and reducing unnecessary memory access power consumption.

Inventive Principle:
Principle #25Self-service

4Speed

If more instructions are accessed in BTAC than prefetched from memory, then advance in instruction stream is achieved, but data store complexity increases

Engineering Contradiction:
Improveinstruction stream advance speedVSAvoiddata store structure complexity
Core Design Contradiction:
SpeedVSDevice complexity

Solution Approach 1:

The data store is segmented into multiple fields or entries, each corresponding to specific instruction addresses or branch targets. Instead of a single large associative memory, the system divides the storage into manageable segments that can be independently accessed and managed, reducing the complexity of the overall data store while maintaining the ability to advance the instruction stream efficiently.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a second program counter dimension (PC1 for BTAC, PC2 for instruction cache) to manage the data store accesses. This additional dimensional approach allows the system to track and access branch prediction data independently from the main instruction fetch sequence, enabling faster instruction stream advancement without proportionally increasing data store complexity.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Data Source

PatentUS7783869B2Accessing branch predictions ahead of instruction fetching
Publication Date: 2010.08.24 ARM LTD
  • US7783869B2 patent drawing
  • US7783869B2 patent drawing
  • US7783869B2 patent drawing

AI summary

A data processing apparatus is disclosed that comprises: a processor for processing a stream of decoded instructions; a prefetch unit for fetching instructions within a stream of instructions from a memory prior to sending said stream of instructions to said processor; branch prediction logic operable to predict a behaviour of a branch instruction; a branch target cache for storing predetermined information about branch operations executed by said processor, said predetermined information comprising: identification data for an instruction specifying a branch operation and data relating to whether said branch is taken or not; wherein said data processing apparatus is operable to access said branch target cache and to determine if there is data corresponding to instructions within said stream of instructions stored within said branch target cache and if there is to output said data; said data processing apparatus further comprising: a data store operable to store data indicative of a behaviour of a branch instruction; and said data processing apparatus is operable over a period of time to access predetermined information corresponding to more instructions within said branch target cache than instructions it prefetches from said memory such that said accesses to said branch target cache develop an advance in said instruction stream with respect to accesses to said memory; and said prefetch unit is operable to access said data store and to determine if there is data corresponding to an instruction within said data store that indicates that said instruction specifies a branch operation that will be taken and will cause a change in instruction flow.