# US 2021/0286724 A1 · Data cache with hybrid writeback and writethrough

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

- Number: US 2021/0286724 A1
- Document ID: US20210286724A1
- Status: Published application
- Kind: A1
- Application number: 17/332,286
- Filed: 2021-05-27
- Published: 2021-09-16
- Earliest claimed: 2020-02-21
- Assignees: SiFive, Inc.
- Applicants: SiFive, Inc.
- Inventors: John Ingalls; Wesley Waylon Terpstra; Henry Cook
- Web page: https://patentgrep.com/patent/US20210286724A1

## CPC

- G06F 12/0804: with main memory updating (G06F12/0806 takes precedence)
- G06F 12/0837: with software control, e.g. non-cacheable data
- G06F 12/0833: {in combination with broadcast means (e.g. for invalidation or updating)}
- G06F 12/128: adapted to multidimensional cache systems, e.g. set-associative, multicache, multiset or multilevel
- G06F 2212/1008: Correctness of operation, e.g. memory ordering
- G06F 2212/1024: Latency reduction
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Described is a data cache implementing hybrid writebacks and writethroughs. A processing system includes a memory, a memory controller, and a processor. The processor includes a data cache including cache lines, a write buffer, and a store queue. The store queue writes data to a hit cache line and an allocated entry in the write buffer when the hit cache line is initially in at least a shared coherence state, resulting in the hit cache line being in a shared coherence state with data and the allocated entry being in a modified coherence state with data. The write buffer requests and the memory controller upgrades the hit cache line to a modified coherence state with data based on tracked coherence states. The write buffer retires the data upon upgrade. The data cache writebacks the data to memory for a defined event.

## Claims

### Claim 1

A processing system comprising:
a backing structure including a controller; and
a processor connected to the backing structure, the processor comprising:
a data cache including a plurality of cache lines;
a write buffer configured to track the data cache;
a store queue configured to write data to a hit cache line and an allocated entry in the write buffer when the hit cache line is initially in a starting coherence state;
the write buffer configured to retire the data upon confirmation by the controller of an upgrade of the hit cache line to a modified coherence state with data; and
the data cache configured to perform a writeback of the data in the hit cache line to the backing structure for a defined event.

### Claim 2 (depends on 1)

The processing system of claim 1, further comprising:
the processor configured to receive a downgrade to invalid coherence probe from one of an entity not local to the processor or the controller prior to upgrading the coherence state of the hit cache line;
the data cache configured to downgrade the hit cache line to an invalid coherence state and delete the data in response to the downgrade to invalid coherence probe; and
the write buffer configured to downgrade the allocated entry to an invalid coherence state and perform a writethrough of the data to the backing structure.

### Claim 3 (depends on 1)

The processing system of claim 1, further comprising:
the processor configured to receive a downgrade to invalid coherence probe from one of an entity not local to the processor or the controller prior to writing the data to the backing structure;
the data cache configured to downgrade the hit cache line to an invalid coherence state and delete the data; and
the write buffer configured to downgrade the allocated entry to an invalid coherence state and perform a writethrough of the data to the backing structure.

### Claim 4 (depends on 1)

The processing system of claim 1, further comprising:
the processor configured to receive a downgrade to shared coherence probe from one of an entity not local to the processor or the controller prior to upgrading the coherence state of the hit cache line;
the hit cache line configured to remain in the starting coherence state; and
the write buffer configured to downgrade the allocated entry to a shared coherence state with data and perform a writethrough of the data to the backing structure.

### Claim 5 (depends on 1)

The processing system of claim 1, further comprising:
the processor configured to receive a downgrade to shared coherence probe from one of an entity not local to the processor or the controller prior to writing the data to the backing structure;
the hit cache line configured to remain in the starting coherence state; and
the write buffer configured to downgrade the allocated entry to the shared coherence state with data and perform a writethrough of the data to the backing structure.

### Claim 6 (depends on 1)

The processing system of claim 1, wherein the starting coherence state is one of a shared coherence state or an exclusive coherence state.

### Claim 7 (depends on 1)

The processing system of claim 1, wherein the write buffer is a miss status handling register.

### Claim 8 (depends on 1)

The processing system of claim 1, wherein entities or processes local to the processor can access the data stored in the hit cache line.

### Claim 9 (depends on 1)

The processing system of claim 1, wherein entities or processes local to the processor can read the data stored in the hit cache line.

### Claim 10 (depends on 1)

The processing system of claim 1, wherein the hit cache line in the modified coherence state with data is globally visible to entities or processes not local to the processor.

### Claim 11

A method for performing hybrid writeback and writethrough, the method comprising:
writing data from a retired store queue entry to a hit cache line in a data cache, wherein the hit cache line is initially in a starting coherence state;
writing the data to an allocated entry in a write buffer when the hit cache line is in the starting coherence state;
retiring the data upon confirmation by a backing structure controller of upgrading the hit cache line to a modified coherence state with data; and
performing a writeback of the data in the hit cache line to a backing structure for a defined event.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
receiving a downgrade to invalid coherence probe from one of an entity not local to a processor associated with the data cache or the backing structure controller prior to one of upgrading the coherence state of the hit cache line or writing the data to the backing structure;
downgrading the hit cache line to an invalid coherence state;
deleting the data in hit cache line;
downgrading the allocated entry to an invalid coherence state; and
performing, by the write buffer, a writethrough of the data to the backing structure.

### Claim 13 (depends on 11)

The method of claim 11, further comprising:
receiving a downgrade to shared coherence probe from one of an entity not local to a processor associated with the data cache or the backing structure controller prior to one of upgrading the coherence state of the hit cache line or writing the data to the backing structure;
remaining, by the hit cache line, in the starting coherence state;
downgrading the allocated entry to a shared coherence state with data; and
performing, by the write buffer, a writethrough of the data to the backing structure.

### Claim 14 (depends on 11)

The method of claim 11, wherein the starting coherence state is one of a shared coherence state or an exclusive coherence state.

### Claim 15 (depends on 11)

The method of claim 11, wherein entities or processes local to the processor can access the data stored in the hit cache line.

### Claim 16 (depends on 11)

The method of claim 11, further comprising:
tracking cache coherence states of the data cache by the write buffer.

### Claim 17

A method for performing hybrid writeback and writethrough, the method comprising:
writing data to a hit cache line in a data cache from a store queue, wherein the hit cache line is initially in a starting coherence state;
writing the data to an allocated entry in a write buffer when the hit cache line is in the starting coherence state, wherein the allocated entry is in a modified coherence state with data after writing of the data;
tracking cache coherence states of the data cache by the write buffer;
prior to receiving a probe from a non-local entity:
retiring the data in the allocated entry upon confirmation of an upgrade of the hit cache line to the modified coherence state with data based on tracked cache coherence states; and
performing a writeback of the data in the hit cache line to memory for a defined event.

### Claim 18 (depends on 17)

The method of claim 17, the method further comprising:
responsive to receiving a downgrade to invalid coherence probe from the non-local entity:
downgrading the hit cache line to an invalid coherence state;
deleting the data in hit cache line;
downgrading the allocated entry to an invalid coherence state; and
performing, by the write buffer, a writethrough of the data to the memory.

### Claim 19 (depends on 17)

The method of claim 17, the method further comprising:
responsive to receiving a downgrade to shared coherence probe from the non-local entity:
remaining, by the hit cache line, in the starting coherence state;
downgrading the allocated entry to the shared coherence state with data; and
performing, by the write buffer, a writethrough of the data to the memory.

### Claim 20 (depends on 17)

The method of claim 17, wherein the starting coherence state is one of a shared coherence state or an exclusive coherence state.
