# US 2023/0067307 A1 · Dynamic Allocation of Cache Memory as RAM

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

- Number: US 2023/0067307 A1
- Document ID: US20230067307A1
- Status: Published application
- Kind: A1
- Application number: 17/462,777
- Filed: 2021-08-31
- Published: 2023-03-02
- Earliest claimed: 2021-08-31
- Assignees: Apple Inc.
- Applicants: Apple Inc.
- Inventors: Rohit Natarajan; Jurgen M. Schulz; Christopher D. Shuler; Rohit K. Gupta; Thomas T. Zou; Srinivasa Rangan Sridharan
- Web page: https://patentgrep.com/patent/US20230067307A1

## CPC

- G06F 12/0802: Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F 12/0864: using pseudo-associative means, e.g. set-associative or hashing
- G06F 12/0804: with main memory updating (G06F12/0806 takes precedence)
- G06F 12/0895: of parts of caches, e.g. directory or tag array
- G06F 12/126: with special data handling, e.g. priority of data or instructions, handling errors or pinning
- G06F 12/1441: {for a range}
- G06F 12/1483: {using an access-table, e.g. matrix or list}
- G06F 12/0888: using selective caching, e.g. bypass
- G06F 2212/1024: Latency reduction
- G06F 2212/1052: Security improvement
- G06F 2212/60: Details of cache memory
- G06F 2212/601: Reconfiguration of cache memory
- G06F 2212/6082: Way prediction in set-associative cache
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An apparatus includes a cache controller circuit and a cache memory circuit that further includes cache memory having a plurality of cache lines. The cache controller circuit may be configured to receive a request to reallocate a portion of the cache memory circuit that is currently in use. This request may identify an address region corresponding to one or more of the cache lines. The cache controller circuit may be further configured, in response to the request, to convert the one or more cache lines to directly-addressable, random-access memory (RAM) by excluding the one or more cache lines from cache operations.

## Claims

### Claim 1

An apparatus, comprising:
a cache memory circuit including cache memory having a plurality of cache lines; and
a cache controller circuit configured to:
receive a request to reallocate a portion of the cache memory circuit that is currently in use, wherein the request identifies an address region corresponding to one or more of the plurality of cache lines; and
in response to the request, convert the one or more cache lines to directly-addressable, random-access memory (RAM) by excluding the one or more cache lines from cache operations.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the cache controller circuit is further configured to:
support a real-time virtual channel for memory transactions in the identified address region; and
prioritize a memory transaction received via the real-time virtual channel over a memory transaction received via a bulk virtual channel.

### Claim 3 (depends on 1)

The apparatus of claim 1, wherein the cache controller circuit is further configured to:
determine that the address region is included in a secure-access region; and
in response to the determination, ignore a memory transaction in the address region from an agent that is unauthorized to access the secure-access region.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the cache controller circuit is further configured to flush the one or more cache lines before converting the one or more cache lines to the directly-addressable RAM.

### Claim 5 (depends on 1)

The apparatus of claim 1, wherein the cache controller circuit is further configured to:
in response to data in a valid cache line being written, issue a write-back request for the valid cache line; and
exclude the one or more cache lines from write-back requests.

### Claim 6 (depends on 1)

The apparatus of claim 1, wherein the cache controller circuit is further configured to:
receive a different request to deallocate the portion of the cache memory from the directly-addressable RAM; and
in response to the different request, include the one or more cache lines in cache operations without copying data stored in the directly-addressable RAM while the one or more cache lines were reallocated.

### Claim 7 (depends on 6)

The apparatus of claim 6, wherein the cache controller circuit is further configured, in response to a memory transaction in the directly-addressable RAM received after deallocating the portion of the cache memory, to generate an error.

### Claim 8

A method, comprising:
receiving, by a cache controller circuit, a request to reallocate a portion of a cache memory circuit, that is currently in use, to a directly-addressable address region, wherein the request identifies an inactive address region;
based on the identified address region, selecting one or more cache lines of the cache memory circuit to convert; and
setting, by the cache controller circuit, a respective indication for ones of the selected cache lines to exclude the selected cache lines from further cache operations.

### Claim 9 (depends on 8)

The method of claim 8, wherein setting the respective indication includes setting, by the cache controller circuit, a real-time memory indicator, wherein the real-time memory indicator denotes that the selected cache lines are associated with real-time transactions with higher priorities than bulk transactions.

### Claim 10 (depends on 8)

The method of claim 8, further comprising, in response to determining that the identified address region is part of a secure access region, ignoring, by the cache controller circuit, a memory transaction for the identified address region from an agent that is unauthorized to access the secure access region.

### Claim 11 (depends on 8)

The method of claim 8, further comprising flushing, by the cache controller circuit, the selected cache lines prior to setting the respective indications.

### Claim 12 (depends on 8)

The method of claim 8, wherein data written to a particular address that is currently cached in the cache memory circuit is written-back to the particular address in a system memory; and
wherein data written to a different address that is in the identified address region is not written-back to the system memory.

### Claim 13 (depends on 8)

The method of claim 8, further comprising:
receiving, by the cache controller circuit, a different request to deallocate the portion of the cache memory circuit from the directly-addressable address region; and
in response to the different request, including the selected cache lines in cache operations, wherein data stored in the directly-addressable address region while the selected cache lines were reallocated is overwritten without a write-back to a system memory circuit.

### Claim 14 (depends on 13)

The method of claim 13, is further comprising returning, by the cache controller circuit, a default value in response to a read request for an address in the directly-addressable address region received after deallocating the portion of the cache memory circuit.

### Claim 15

A system, comprising:
a cache memory circuit including cache memory having a plurality of ways;
a processor configured to issue memory requests using an address map that includes active and inactive address regions; and
a cache controller circuit configured to:
receive a request from the processor to reallocate a portion of the cache memory as directly-addressable memory, wherein the request identifies an inactive address region;
based on the request, select a portion of the ways to convert; and
map the selected portion of ways for use in the identified address region.

### Claim 16 (depends on 15)

The system of claim 15, wherein to convert the selected portion of ways, the cache controller circuit is configured to set respective indications in cache tags corresponding to particular cache lines included in the selected portion of ways, wherein the respective indications remove the particular cache lines from use as cache memory.

### Claim 17 (depends on 16)

The system of claim 16, wherein the cache controller circuit is further configured to set respective real-time indicators in the cache tags corresponding to the particular cache lines, wherein the real-time indicators denote that the particular cache lines are associated with real-time transactions with higher priorities than bulk transactions.

### Claim 18 (depends on 15)

The system of claim 15, wherein the cache controller circuit is further configured, in response to receiving a request to deallocate the directly-addressable memory, to include the selected portion of ways in cache operations, wherein data stored in the directly-addressable memory while the selected portion of ways were reallocated is not relocated in response to the request to deallocate the directly-addressable memory.

### Claim 19 (depends on 15)

The system of claim 15, wherein the cache controller circuit is further configured to flush cache lines in the selected portion of ways prior to mapping the selected portion of ways for use in the identified address region.

### Claim 20 (depends on 15)

The system of claim 15, wherein the portion of the ways is one-half of a particular way.
