Trace Cache Transition on Label Boundaries

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Superscalar microprocessors face challenges in determining cache hits due to the prohibitive hardware requirements for matching instruction addresses with trace cache starting addresses, leading to inefficiencies in instruction fetching, especially when branch predictions are mispredicted or instructions are executed out of order.

Innovation Solution

Implementing a microprocessor with a trace cache that transitions fetching from the instruction cache to the trace cache only on label boundaries, using a prefetch unit, branch prediction unit, and trace generator to construct and manage traces, allowing for efficient execution of instructions stored in execution order.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If the microprocessor uses a trace cache to store instructions in execution order, then instruction fetch bandwidth is improved and branch misprediction penalty is reduced, but the hardware complexity for matching addresses between instruction cache and trace cache becomes prohibitive

Engineering Contradiction:
Improveinstruction fetch bandwidthVSAvoidhardware complexity for address matching
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent extracts the address matching function from the trace cache hit determination process. Instead of requiring complex hardware to match instruction cache addresses with trace cache starting addresses, the system uses a simpler approach where the trace cache is searched using only the branch target address, and the trace generator creates traces that align with label boundaries to simplify the matching process.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent segments the instruction fetch process into two distinct phases: first fetching instructions from the instruction cache in compiled order, then transitioning to trace cache fetching when a branch is taken. The trace generator creates segmented traces based on label boundaries, allowing the prefetch unit to efficiently switch between these two fetching modes without requiring complex unified address matching hardware.

Inventive Principle:
Principle #1Segmentation

2Measurement precision

If the microprocessor attempts to determine cache hits by matching all instruction addresses with trace cache starting addresses, then cache hit accuracy is improved, but the difficulty of detecting and measuring cache hits increases

Engineering Contradiction:
Improvecache hit accuracyVSAvoiddifficulty of determining cache hit
Core Design Contradiction:
Measurement precisionVSDifficulty of detecting and measuring

Solution Approach 1:

The patent applies local quality by making the trace cache search operation simpler and more localized. Instead of matching all instruction addresses, the system only needs to match the branch target address against trace cache entries. The trace generator ensures that traces are created with their starting addresses aligned to label boundaries, creating a localized matching problem that is easier to detect and measure.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent introduces the trace generator as an intermediary component that creates traces based on label boundaries and provides the prefetch unit with the necessary information to efficiently search the trace cache. This intermediary simplifies the detection process by pre-processing the address matching logic and providing structured trace data that aligns with the instruction cache fetching process.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If the microprocessor fetches instructions from the instruction cache in contiguous blocks, then memory access efficiency is improved, but the ability to access instructions in execution order when branches are taken is reduced

Engineering Contradiction:
Improvememory access efficiencyVSAvoidease of accessing instructions in execution order
Core Design Contradiction:
ProductivityVSEase of operation

Solution Approach 1:

The patent implements dynamics by making the instruction fetch process adaptive and configurable. The prefetch unit can dynamically switch between fetching from the instruction cache (for sequential execution) and fetching from the trace cache (for branch targets). This dynamic switching allows the system to optimize memory access efficiency for sequential code while maintaining the ability to quickly access instructions in execution order when branches are taken.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent applies preliminary action by having the trace generator pre-create traces based on label boundaries before execution occurs. The trace cache is populated with traces that are already organized in execution order, so when a branch is taken, the prefetch unit can immediately search for the corresponding trace without needing to reorganize or re-fetch instructions. This preliminary preparation maintains memory access efficiency while enabling easy execution-order access.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS8069336B2Transitioning from instruction cache to trace cache on label boundaries
Publication Date: 2011.11.29 MEDIATEK INC
  • US8069336B2 patent drawing
  • US8069336B2 patent drawing
  • US8069336B2 patent drawing

AI summary

Various embodiments of methods and systems for implementing a microprocessor that includes a trace cache and attempts to transition fetching from instruction cache to trace cache only on label boundaries are disclosed. In one embodiment, a microprocessor may include an instruction cache, a branch prediction unit, and a trace cache. The prefetch unit may fetch instructions from the instruction cache until the branch prediction unit outputs a predicted target address for a branch instruction. When the branch prediction unit outputs a predicted target address, the prefetch unit may check for an entry matching the predicted target address in the trace cache. If a match is found, the prefetch unit may fetch one or more traces from the trace cache in lieu of fetching instructions from the instruction cache.