# US 2013/0254485 A1 · Coordinated prefetching in hierarchically cached processors

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2013/0254485 A1
- Document ID: US20130254485A1
- Status: Published application
- Kind: A1
- Application number: 13/425,123
- Filed: 2012-03-20
- Published: 2013-09-26
- Earliest claimed: 2012-03-20
- Assignees: Apple Inc.
- Inventors: Hari S. Kannan; Brian P. Lilly; Gerard R. Williams, III; Mahnaz Sadoughi-Yarandi; Perumal R. Subramoniam; Pradeep Kanapathipillai
- Web page: https://patentgrep.com/patent/US20130254485A1

## CPC

- G06F 12/0862: with prefetch
- G06F 8/4442: {Reducing the number of cache misses; Data prefetching (cache prefetching G06F12/0862)}
- G06F 9/30047: {Prefetch instructions; cache control instructions}
- G06F 12/0897: with two or more cache hierarchy levels (with multilevel cache hierarchies G06F12/0811)
- G06F 2212/1016: Performance improvement
- G06F 2212/6024: History based prefetching
- G06F 2212/6026: Prefetching based on access pattern detection, e.g. stride based prefetch
- G06F 2212/6028: Prefetching based on hints or prefetch instructions
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Processors and methods for coordinating prefetch units at multiple cache levels. A single, unified training mechanism is utilized for training on streams generated by a processor core. Prefetch requests are sent from the core to lower level caches, and a packet is sent with each prefetch request. The packet identifies the stream ID of the prefetch request and includes relevant training information for the particular stream ID. The lower level caches generate prefetch requests based on the received training information.

## Claims

### Claim 1

A processor comprising:
a cache hierarchy comprising at least two caches arranged in two levels; and
a prefetch training mechanism;
wherein the prefetch training mechanism is configured to generate training information for each of a plurality of streams, wherein the training information is utilized for generating prefetch requests for the plurality of streams at each level of the cache hierarchy.

### Claim 2 (depends on 1)

The processor as recited in claim 1, wherein the prefetch training mechanism is located within a prefetch unit coupled to a first cache in the cache hierarchy, and wherein the prefetch unit is configured to convey training information to a second cache that is at a lower level in the cache hierarchy than the first cache.

### Claim 3 (depends on 2)

The processor as recited in claim 2, wherein the first cache is a level one (L1) cache, and wherein the second cache is a level two (L2) cache.

### Claim 4 (depends on 3)

The processor as recited in claim 3, wherein the prefetch unit is configured to:
maintain an L1 prefetch table comprising a plurality of entries, wherein each entry comprises a stream identifier (ID) and attributes associated with a corresponding stream;
generate a prefetch request for a given stream based on attributes stored in a corresponding entry in the L1 prefetch table; and
convey the prefetch request and a packet to the L2 cache, wherein the packet comprises one or more attributes from the corresponding entry in the L1 prefetch table.

### Claim 5 (depends on 4)

The processor as recited in claim 4, wherein the L1 prefetch unit is further configured to:
detect a page boundary for a given stream; and
convey a new prefetch request and packet to the L2 cache indicating an address of a new page.

### Claim 6 (depends on 5)

The processor as recited in claim 5, further comprising an L2 prefetch unit, wherein the L2 prefetch unit is configured to maintain an L2 prefetch table with an entry for each entry in the L1 prefetch table, and wherein the L2 prefetch table is synchronized with the L1 prefetch table.

### Claim 7 (depends on 1)

The processor as recited in claim 1, wherein the prefetch training mechanism is configured to simultaneously train on the plurality of streams.

### Claim 8

An apparatus comprising:
a prefetch training mechanism; and
a plurality of levels of caches;
wherein the prefetch training mechanism is coupled to a highest level of cache of the plurality of levels of caches and generates training data for a plurality of streams, wherein the training data is utilized for generating prefetch requests at each of the plurality of levels of caches.

### Claim 9 (depends on 8)

The apparatus as recited in claim 8, wherein the plurality of caches comprises at least a level one (L1) and a level two (L2) cache.

### Claim 10 (depends on 8)

The apparatus as recited in claim 8, further comprising a prefetch unit coupled to the highest level of cache, wherein the prefetch unit is configured to:
generate a plurality of prefetch requests based on the training data;
generate a packet for each prefetch request, wherein the packet comprises attributes associated with the prefetch request and a corresponding stream; and
convey the prefetch request and the packet to a lower level cache.

### Claim 11 (depends on 10)

The apparatus as recited in claim 10, wherein each trained stream has an associated stream identifier (ID), and wherein the attributes comprise at least the stream ID.

### Claim 12 (depends on 11)

The apparatus as recited in claim 11, wherein the attributes further comprises a stride of the corresponding stream.

### Claim 13 (depends on 11)

The apparatus as recited in claim 11, wherein the prefetch unit is further configured to assign a load stream and a store stream with a single stream ID, responsive to detecting accesses by the load stream and the store stream to a same address.

### Claim 14

A method comprising:
training on a plurality of streams, wherein the training is performed by a training mechanism coupled to a first cache level;
conveying training information to a second cache level; and
issuing prefetch requests at the second cache level based on the conveyed training information.

### Claim 15 (depends on 14)

The method as recited in claim 14, further comprising:
conveying the training information from the second cache level to a third cache level; and
issuing prefetch requests at the third cache level based on the conveyed training information.

### Claim 16 (depends on 15)

The method as recited in claim 15, further comprising:
storing the training information in a first table at the first cache level; and
storing the training information in a second table at the second cache level, wherein the second table is synchronized with the first table.

### Claim 17 (depends on 16)

The method as recited in claim 16, further comprising:
issuing a prefetch request at the first cache level;
conveying the prefetch request and a packet to the second cache level, wherein the packet comprises attributes associated with the prefetch request.

### Claim 18 (depends on 17)

The method as recited in claim 17, further comprising storing the attributes in a corresponding entry of the second table.

### Claim 19 (depends on 16)

The method as recited in claim 16, further comprising storing the training information in a third table at the third cache level, wherein the third table is synchronized with the second table.

### Claim 20 (depends on 15)

The method as recited in claim 15, wherein the first cache level is a level one (L1) cache, wherein the second cache level is a level two (L2) cache, and wherein the third cache level is a level three (L3) cache.
