# US 7,412,567 B2 · Value-based memory coherence support

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

- Number: US 7,412,567 B2
- Document ID: US7412567B2
- Status: Granted
- Kind: B2
- Application number: 11/413,243
- Filed: 2006-04-28
- Published: 2007-11-01
- Granted: 2008-08-12
- Earliest claimed: 2006-04-28
- Assignees: Sun Microsystems, Inc.
- Inventors: Håkan E. Zeffer; Erik E. Hagersten; Anders Landin; Shailender Chaudhry; Paul N. Loewenstein; Robert E. Cypher; Zoran Radovic
- Web page: https://patentgrep.com/patent/US7412567B2

## CPC

- G06F 12/0815: Cache consistency protocols
- G06F 12/0808: with cache invalidating means (G06F12/0815 takes precedence)
- G06F 12/0822: {Copy directories (local copy tags for implementing a bus snooping protocol G06F12/0831)}
- G06F 12/0897: with two or more cache hierarchy levels (with multilevel cache hierarchies G06F12/0811)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In one embodiment, a processor comprises a coherence trap unit and a trap logic coupled to the coherence trap unit. The coherence trap unit is also coupled to receive data accessed in response to the processor executing a memory operation. The coherence trap unit is configured to detect that the data matches a designated value indicating that a coherence trap is to be initiated to coherently perform the memory operation. The trap logic is configured to trap to a designated software routine responsive to the coherence trap unit detecting the designated value. In some embodiments, a cache tag in a cache may track whether or not the corresponding cache line has the designated value, and the cache tag may be used to trigger a trap in response to an access to the corresponding cache line.

## Claims

### Claim 1

A processor comprising:
a store queue configured to store addresses to be written in response to stores and store data, and wherein the store queue is coupled to a load data path that delivers load data to a destination of the load, the store queue coupled to the load data path to forward store data for a matching load address;
a coherence trap unit coupled to the load data path prior to a point at which the store data from the store queue is merged with other data to receive memory data accessed in response to the processor executing a load memory operation, wherein the coherence trap unit is configured to detect whether the memory data matches a designated value indicating that a coherence trap is to be initiated to coherently perform the memory operation; and
trap logic coupled to the coherence trap unit and configured to trap to a designated software routine responsive to the coherence trap unit detecting the designated value.

### Claim 2 (depends on 1)

The processor as recited in claim 1 wherein the coherence trap unit comprises a register that is programmable with the designated value.

### Claim 3 (depends on 1)

The processor as recited in claim 1 wherein, for a store memory access, the coherence trap unit is configured to detect whether data prior to update by the store is the designated value.

### Claim 4 (depends on 1)

The processor as recited in claim 1 wherein the coherence trap unit is configured to hash the memory data and compare the hash result data to the designated value.

### Claim 5

A cache comprising:
a data memory configured to store a plurality of cache lines of data;
a tag memory configured to store a plurality of cache tags corresponding to the plurality of cache lines, wherein each of the plurality of cache tags comprises an indication of whether or not the corresponding cache line is storing one or more data values that match a designated value, the designated value indicating that an access to the corresponding cache line causes a trap to software to ensure cache coherence; and
a control unit coupled to the data memory and the tag memory, wherein the control unit is configured to detect the indication responsive to a cache access and to signal a processor coupled to the cache to cause the trap.

### Claim 6 (depends on 5)

The cache as recited in claim 5 further comprising a register programmable with the designated value, wherein the register is coupled to a comparator to compare the data during a fill of a cache line to determine the indication for the corresponding cache tag.

### Claim 7 (depends on 5)

The cache as recited in claim 5 further comprising a register programmable to indicate that a given cache line contains the designated value but is not indicating the trap to software.

### Claim 8 (depends on 7)

The cache as recited in claim 7 wherein, during a fill of a given cache line, the control unit is configured not to set the indication in the corresponding cache tag to indicate the trap responsive to the register, even if the data loaded into the cache line includes the designated value.

### Claim 9 (depends on 8)

The cache as recited in claim 8 wherein the register is programmable with a tag address, and wherein the register contents are compared to the address of the access.

### Claim 10 (depends on 5)

The cache as recited in claim 5 further comprising a register programmable to indicate that an access to a given cache line is to cause a trap even if the cache line does not contain the designated value.

### Claim 11 (depends on 10)

The cache as recited in claim 10 wherein, during a fill of a given cache line, the control unit is configured to set the indication in the corresponding cache tag to indicate the trap responsive to the register, even if the data loaded into the cache line does not include the designated value.

### Claim 12 (depends on 11)

The cache as recited in claim 11 wherein the register is programmable with a tag address, and wherein the register contents are compared to the address of the access.

### Claim 13

A method comprising:
detecting that data corresponding to a memory operation has a designated value that indicates a trap to software to ensure coherence is to be performed;
trapping to the software responsive to the detecting; and
programming a register to indicate that a given cache line contains the designated value but is not to cause a trap.

### Claim 14 (depends on 13)

The method as recited in claim 13 further comprising programming the designated value into a register.

### Claim 15 (depends on 13)

The method as recited in claim 13 wherein the detecting comprises comparing data from a load data path to the designated value.

### Claim 16 (depends on 13)

The method as recited in claim 13 further comprising programming a register to indicate that a given cache line is to cause the trap even if the designated value is not detected.

### Claim 17

A processor comprising:
trap detection logic configured to detect whether coherence activity is necessary to obtain a coherent copy of data accessed by a memory operation being performed by the processor, wherein the trap detection logic is configured to detect whether coherence activity is necessary at a granularity that is no larger than a cache line, and wherein the trap detection logic is configured to detect whether coherence activity is necessary responsive to cache tag data corresponding to a cache line that includes the data accessed by the memory operation; and
trap logic coupled to the trap detection logic and configured to trap to a designated software routine responsive to the trap detection logic detecting that the coherence activity is necessary.

### Claim 18 (depends on 17)

The processor as recited in claim 17 wherein the trap detection logic is configured to compare data accessed by the memory operation to a designated value indicating a coherence trap to detect whether coherence activity is necessary.

### Claim 19 (depends on 17)

The processor as recited in claim 17 wherein the cache tag data is generated by comparing the cache data to a designated value indicating a coherence trap to detect whether coherence activity is necessary.
