Cache device and method for storing and managing both cacheable and non-cacheable data

The cache device optimizes caching for both cacheable and non-cacheable data by employing distinct operations, improving memory access performance and reducing latency through dynamic allocation and flush strategies.

US12817785B1Active Publication Date: 2026-12-01NEXTSILICON LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
US19/453973
Authority / Receiving Office
US · United States
Patent Type
Patents(United States)
Current Assignee / Owner
Filing Date
2026-01-20
Publication Date
2026-12-01
Estimated Expiration
2046-01-20

AI Technical Summary

Technical Problem

Non-cacheable memory regions in computing systems result in higher memory latency and resource consumption due to direct access from main memory, as traditional caching mechanisms fail to exploit temporal locality and maintain data coherency.

Method used

A cache device and method that distinguishes between cacheable and non-cacheable data, employing different caching operations such as write-back for cacheable data and write-through for non-cacheable data, along with dynamic allocation and flush strategies to maintain coherency and reduce latency.

Benefits of technology

Enhances memory access performance by optimizing caching for non-cacheable data while ensuring data coherency, reducing latency and resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US12817785-D00000_ABST
    Figure US12817785-D00000_ABST
Patent Text Reader

Abstract

A computing device and method of controlling cache memory may include loading a data element from a main memory module; obtaining an indication of whether the loaded data element comprises cacheable or non-cacheable data; storing the data element in a cache line of a cache memory module; performing at least one first caching operation on the cache line when the data element comprises cacheable data; and performing at least one second caching operation on the cache line when the data element comprises non-cacheable data. The first caching operation may include, for example, write-back operations for cacheable data, while the second caching operation may include, for example, write-through operations for non-cacheable data.
Need to check novelty before this filing date? Find Prior Art

Description

FIELD OF THE INVENTION

[0001] The present invention relates to computer memory systems and cache management architectures, and more particularly to a cache device and method for storing and managing both cacheable and non-cacheable data.BACKGROUND OF THE INVENTION

[0002] Modern computing systems rely on hierarchical memory architectures to balance performance and capacity requirements. These architectures typically include fast but small cache memories positioned between processing cores and larger but slower main memory modules. Cache memories temporarily store frequently accessed data to reduce the latency of memory operations and improve overall system performance.

[0003] Cache coherency protocols such as MESI (Modified, Exclusive, Shared, Invalid) maintain data consistency across multiple cache levels and processing cores in multi-processor systems. These protocols track the state of cached data and coordinate updates to ensure that all processing elements observe a consistent view of memory contents. Traditional caching mechanisms operate under the assumption that data stored in cache memories can be modified locally and synchronized with main memory at a later time.

[0004] However, certain memory regions in computing systems are designated as non-cacheable due to various system requirements. Non-cacheable memory regions may include areas that are shared with external devices such as direct memory access engines or network interface cards, which can modify memory contents without notifying the processor cache system. Additionally, memory regions with specific access patterns, such as write-heavy operations, may be marked as non-cacheable to avoid unnecessary cache traffic and maintain data coherency with external agents.

[0005] When memory regions are marked as non-cacheable, processors typically access these regions directly from main memory for every read or write operation. This approach guarantees data coherency by ensuring that the processor always observes the most recent data written by any external agent. However, this direct access pattern results in higher memory latency since each operation must complete a full round-trip to main memory before the processor can continue execution.

[0006] The performance impact of non-cacheable memory accesses is exacerbated in systems that frequently access such memory regions. Each non-cacheable read operation stalls the processor until the data is retrieved from main memory, and multiple sequential accesses to the same memory region result in repeated external memory transactions. These repeated accesses consume memory bandwidth and processing resources while providing no performance benefit from temporal locality that could otherwise be exploited through caching mechanisms.

[0007] Various approaches have been explored to improve the performance of non-cacheable memory operations while maintaining the data coherency guarantees that make non-cacheable designations necessary. These approaches generally involve providing temporary storage buffers for non-cacheable data to enable features such as combining adjacent memory requests and supporting multiple outstanding memory operations that can execute in parallel.SUMMARY OF THE INVENTION

[0008] Embodiments of the invention may include a computing device, adapted to maintain cacheable, and / or non-cacheable data in cache memory, as elaborated herein. According to some embodiments, the computing device may include, or may be associated with a main memory module, a cache memory module, and a cache controller.

[0009] According to some embodiments, the cache controller may be configured to load a data element from the main memory module, and may be further configured to obtain an indication of whether the loaded data element includes cacheable or non-cacheable data.

[0010] The cache controller may store the data element in a cache line of the cache memory module, and may perform at least one first caching operation on the cache line when the data element includes cacheable data, and perform at least one second, different caching operation on the cache line when the data element includes non-cacheable data.

[0011] Additionally, or alternatively, a cache device may include a cache memory configured to store cacheable, and / or non-cacheable data elements in a cache memory, and a cache controller associated with a local processing core.

[0012] The cache controller may be configured to obtain a data element from a main memory module, and may receive an indication of whether the data element includes cacheable or non-cacheable data. For example, the cache controller may be configured to receive the indication from a memory management unit (MMU) indicating whether the data element includes cacheable or non-cacheable data.

[0013] The cache controller may be configured to store the data element in a respective cache line of the cache memory, and may assign a unique identifier to the respective cache line when the data element includes non-cacheable data.

[0014] As explained herein, the cache controller may be configured to perform at least one first caching operation on the cache line when the data element includes cacheable data, and perform at least one second, different caching operation on the cache line when the data element includes non-cacheable data.

[0015] According to some embodiments, the cache controller may receive a store instruction from the local processing core, wherein the store instruction requires storing an updated version of the data element. When the data element includes cacheable data, the cache controller may be configured to perform, as the at least one first caching operation, a write-back operation, storing the updated version in the cache memory. Additionally, or alternatively, the at least one first caching operation may further include refraining from immediately (e.g., as a response to the store instruction) storing the updated version in the main memory module.

[0016] When the data element includes non-cacheable data, the cache controller may be configured to further perform, as the at least one second caching operation, a write-through operation, storing the updated version in the cache memory and the main memory module.

[0017] Additionally, or alternatively, when the data element includes cacheable data, the cache controller may perform, as the at least one first caching operation, indicating a state of the respective cache line as ‘modified’ in a coherency protocol indicator (e.g., an ‘M’ indication in the Modified, Exclusive, Shared, Invalid (MESI) coherency protocol). Additionally, or alternatively, when the data element includes non-cacheable data, the cache controller may further perform, as the at least one second caching operation, refraining from indicating the state of the respective cache line as ‘modified’ in the coherency protocol indicator.

[0018] Additionally, or alternatively, the cache controller may be further configured to receive a flush instruction from the local processing core, where the flush instruction may require a flush of the cache line. When the data element includes cacheable data, the cache controller may be configured to further perform, as the at least one first caching operation, an eviction operation on the respective cache line, thereby optionally writing the data element into the main memory module. Additionally, or alternatively, when the data element includes non-cacheable data, the cache controller may be configured to further perform, as the at least one second caching operation, invalidation of the respective cache line in the cache memory, and refraining from performing the eviction operation.

[0019] Additionally, or alternatively, the cache controller may be further configured to receive an indication of a software-based serialization operation from the local processing core. The cache controller may subsequently identify cache lines in the cache memory that include non-cacheable data. The cache controller may further perform, as the at least one second caching operation, invalidating the identified cache lines, and refraining from writing data elements of the identified cache lines into the main memory module in response to the serialization operation.

[0020] Additionally, or alternatively, the cache device may further include a flush control hardware component. The cache controller may be further configured to receive, from the flush control hardware component, an indication of a required flush for one or more cache lines in the cache memory. The cache controller may be configured to subsequently identify cache lines in the cache memory that include non-cacheable data. The cache controller may further perform, as the at least one second caching operation, invalidating the identified cache lines, and refraining from writing data elements of the identified cache lines into the main memory module in response to the indication of the required flush.

[0021] According to some embodiments, the flush control hardware component may include one or more software-configurable flush registers, indicating the required flush in corresponding regions or cache lines in the cache memory.

[0022] Additionally, or alternatively, the flush control hardware component may include at least one counter. The flush control hardware component may be configured to generate the indication of a required flush based on a value of the at least one counter.

[0023] According to some embodiments, the at least one counter may be configured to count clock cycles elapsed since a previous flush operation. The flush control hardware component may be configured to generate the indication when the counter reaches a predetermined clock cycle threshold.

[0024] Additionally, or alternatively, the at least one counter may be configured to count a number of cache accesses to non-cacheable data. The flush control hardware component may be configured to generate the indication when the counter reaches a predetermined access count threshold.

[0025] Additionally, or alternatively, the at least one counter may be configured to count a cache occupancy level representing a percentage of the cache memory occupied by non-cacheable data. The flush control hardware component may be configured to generate the indication when the counter reaches a predetermined occupancy threshold.

[0026] According to some embodiments, the cache device may further include one or more allocation registers. The allocation registers may be dynamically configurable e.g., by software via the local processing core. The cache controller may be further configured to allocate portions of the cache memory for storage of cacheable or non-cacheable data, based on values of respective allocation registers of the one or more allocation registers.

[0027] According to some embodiments, the cache device may further include a hardware-based cache usage metric module, configured to aggregate usage telemetry, representing usage of data stored on the cache memory. The cache controller may be further configured to dynamically allocate portions of the cache memory for storage of cacheable or non-cacheable data, based on the usage telemetry.

[0028] Additionally, or alternatively, the cache device may further include a hardware-based Least Recently Used (LRU) module, configured to aggregate LRU telemetry pertaining to cache lines that store non-cacheable data. The cache controller may be further configured to perform, as the at least one second caching operation, (i) identifying a cache line as a candidate for replacement, based on the LRU telemetry, (ii) invalidating the candidate cache line, and (iii) refraining from writing data elements of the candidate cache line into the main memory module.

[0029] According to some embodiments, the cache device may further include a global load queue configured to maintain a registry of pending load operations that have been executed but not yet committed by the local processing core. As explained herein, the cache controller may identify a condition of memory ordering violation based on the registry of pending load operations. When the data element includes cacheable data, the cache controller may be configured to further perform, as the at least one first caching operation: (i) marking a registered entry of a load operation in the global load queue as suspicious of being stale, and (ii) flushing a pipeline of the local processing core responsive to an external snoop operation hitting a cache line associated with the registered entry. When the data element includes non-cacheable data, the cache controller may be configured to further perform, as the at least one second caching operation: (i) marking a registered entry of a load operation in the global load queue as stale responsive to a serialization event, and (ii) flushing the pipeline of the local processing core without waiting for an external snoop operation.

[0030] Embodiments of the invention may include a method of cache storage management. Embodiments of the method may include loading a data element from a main memory module and obtaining an indication of whether the loaded data element includes cacheable or non-cacheable data. Embodiments of the method may further include storing the data element in a cache line of a cache memory module; performing at least one first caching operation on the cache line when the data element includes cacheable data; and performing at least one second, different caching operation on the cache line when the data element includes non-cacheable data.BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The subject matter regarded as the invention is particularly pointed out and distinctly claimed in the concluding portion of the specification. The invention, however, both as to organization and method of operation, together with objects, features, and advantages thereof, may best be understood by reference to the following detailed description when read with the accompanying drawings in which:

[0032] FIG. 1 is a block diagram depicting aspects of a computing device, which may be included in, or associated with an embodiment of the present invention, according to some embodiments.

[0033] FIG. 2A is a block diagram depicting aspects of the computing device in a single-chip configuration, according to some embodiments of the present invention;

[0034] FIG. 2B is a block diagram depicting another example for implementation of the computing device, in a multiple-chip configuration, according to some embodiments of the present invention;

[0035] FIG. 3 is a block diagram depicting a cache device, which may be included in computing device of FIGS. 2A and 2B, according to some embodiments of the invention; and

[0036] FIG. 4 is a flowchart, depicting a method or process for a cache storage management, according to some embodiments of the invention.

[0037] It will be appreciated that for simplicity and clarity of illustration, elements shown in the figures have not necessarily been drawn to scale. For example, the dimensions of some of the elements may be exaggerated relative to other elements for clarity. Further, where considered appropriate, reference numerals may be repeated among the figures to indicate corresponding or analogous elements.DETAILED DESCRIPTION OF THE PRESENT INVENTION

[0038] One skilled in the art will realize the invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The foregoing embodiments are therefore to be considered in all respects illustrative rather than limiting of the invention described herein. Scope of the invention is thus indicated by the appended claims, rather than by the foregoing description, and all changes that come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.

[0039] In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the invention. However, it will be understood by those skilled in the art that the present invention may be practiced without these specific details. In other instances, well-known methods, procedures, and components have not been described in detail so as not to obscure the present invention. Some features or elements described with respect to one embodiment may be combined with features or elements described with respect to other embodiments. For the sake of clarity, discussion of same or similar features or elements may not be repeated.

[0040] Although embodiments of the invention are not limited in this regard, discussions utilizing terms such as, for example, “processing,”“computing,”“calculating,”“determining,”“establishing”, “analyzing”, “checking”, or the like, may refer to operation(s) and / or process(es) of a computer, a computing platform, a computing system, or other electronic computing device, that manipulates and / or transforms data represented as physical (e.g., electronic) quantities within the computer's registers and / or memories into other data similarly represented as physical quantities within the computer's registers and / or memories or other information non-transitory storage medium that may store instructions to perform operations and / or processes.

[0041] Although embodiments of the invention are not limited in this regard, the terms “plurality” and “a plurality” as used herein may include, for example, “multiple” or “two or more”. The terms “plurality” or “a plurality” may be used throughout the specification to describe two or more components, devices, elements, units, parameters, or the like. The term “set” when used herein may include one or more items.

[0042] Reference is now made to FIG. 1, which is a block diagram depicting a computing device 1, which may be included within, or associated with an embodiment of the present invention for managing both cacheable and non-cacheable data, according to some embodiments of the invention.

[0043] Computing device 1 may include a processor or controller 2 that may be, for example, a central processing unit (CPU) processor, a chip or any suitable computing or computational device, an operating system 3, a memory 4, executable code 5, a storage system 6, input devices 7 and output devices 8. Processor 2 (or one or more controllers or processors, possibly across multiple units or devices) may be configured to carry out methods described herein, and / or to execute or act as the various modules, units, etc. More than one computing device 1 may be included in, and one or more computing devices 1 may act as the components of, a system managing both cacheable and non-cacheable data according to embodiments of the invention.

[0044] Operating system 3 may be or may include any code segment (e.g., one similar to executable code 5 described herein) designed and / or configured to perform tasks involving coordination, scheduling, arbitration, supervising, controlling or otherwise managing operation of computing device 1, for example, scheduling execution of software programs or tasks or enabling software programs or other modules or units to communicate. Operating system 3 may be a commercial operating system. It will be noted that an operating system 3 may be an optional component, e.g., in some embodiments, a system may include a computing device 1 that does not require or include an operating system 3.

[0045] Memory 4 may be or may include, for example, a Random-Access Memory (RAM), a read only memory (ROM), a Dynamic RAM (DRAM), a Synchronous DRAM (SD-RAM), a double data rate (DDR) memory chip, a Flash memory, a volatile memory, a non-volatile memory, a cache memory, a buffer, a short term memory unit, a long term memory unit, or other suitable memory units or storage units. Memory 4 may be or may include a plurality of possibly different memory units. Memory 4 may be a computer or processor non-transitory readable medium, or a computer non-transitory storage medium, e.g., a RAM. In one embodiment, a non-transitory storage medium such as memory 4, a hard disk drive, another storage device, etc. may store instructions or code which when executed by a processor may cause the processor to carry out methods as described herein.

[0046] Executable code 5 may be any executable code, e.g., an application, a program, a process, task, or script. Executable code 5 may be executed by processor or controller 2 possibly under control of operating system 3. For example, executable code 5 may be an application that may operate one or more caching devices as further described herein. Although, for the sake of clarity, a single item of executable code 5 is shown in FIG. 1, a system according to some embodiments of the invention may include a plurality of executable code segments similar to executable code 5 that may be loaded into memory 4 and cause processor 2 to carry out methods described herein.

[0047] Storage system 6 may be or may include, for example, a flash memory as known in the art, a memory that is internal to, or embedded in, a micro controller or chip as known in the art, a hard disk drive, a CD-Recordable (CD-R) drive, a Blu-ray disk (BD), a universal serial bus (USB) device or other suitable removable and / or fixed storage unit. Data pertaining to cache devices may be stored in storage system 6 and may be loaded from storage system 6 into memory 4 where it may be processed by processor or controller 2. In some embodiments, some of the components shown in FIG. 1 may be omitted. For example, memory 4 may be a non-volatile memory having the storage capacity of storage system 6. Accordingly, although shown as a separate component, storage system 6 may be embedded or included in memory 4.

[0048] Input devices 7 may be or may include any suitable input devices, components, or systems, e.g., a detachable keyboard or keypad, a mouse and the like. Output devices 8 may include one or more (possibly detachable) displays or monitors, speakers and / or any other suitable output devices. Any applicable input / output (I / O) devices may be connected to Computing device 1 as shown by blocks 7 and 8. For example, a wired or wireless network interface card (NIC), a universal serial bus (USB) device or external hard drive may be included in input devices 7 and / or output devices 8. It will be recognized that any suitable number of input devices 7 and output device 8 may be operatively connected to computing device 1 as shown by blocks 7 and 8.

[0049] A system or device for managing both cacheable and non-cacheable data according to some embodiments of the invention may include components such as, but not limited to, a plurality of central processing units (CPU) or any other suitable multi-purpose or specific processors or controllers (e.g., similar to element 2), a plurality of input units, a plurality of output units, a plurality of memory units, and a plurality of storage units.

[0050] FIG. 2A is a block diagram depicting a computing device 10 for managing both cacheable and non-cacheable data according to some embodiments of the invention.

[0051] In some embodiments, computing device 10 of FIG. 2A may be the same as computing device 1 of FIG. 1. Additionally, or alternatively, computing device 10 of FIG. 2A may include components of computing device 1 as described herein, in relation to FIG. 1, and are not shown in FIG. 2A for the sake of clarity.

[0052] As shown in FIG. 2A, computing device 10 may be implemented in a single-chip configuration to provide enhanced memory access performance for both cacheable and non-cacheable data operations. Computing device 10 may include several interconnected components that may collaborate to manage data storage and retrieval operations efficiently.

[0053] For example, computing device 10 may include one or more (e.g., a plurality) of processing cores 20 which may, for example be, or include one or more processors such as processor 2 of FIG. 1. FIG. 2A illustrates interrelation between processing cores 20 (e.g., core A, core B) with one or more memory devices, according to some embodiments of the present invention.

[0054] Processing cores 20 (e.g., 20-A, 20-B) may serve as central processing units for executing instructions and performing computational operations. Processing cores 20 may generate memory access requests and process data retrieved from various memory sources within the computing device 10.

[0055] Computing device 10 may further include one or more cache devices 100 that may function as intermediate storage layers between the processing core 20 and other memory components, such as a main memory module 400. The cache devices 100 may provide faster access to frequently used data, as known in the art.

[0056] As elaborated herein, embodiments of the present invention may include improvements to currently available caching devices and protocols, allowing cache devices to handle both cacheable and non-cacheable data elements according to different protocols and operations, as further elaborated herein.

[0057] Computing device 10 may include one or more Memory Management Units (MMUs) 30 that may, for example, be incorporated within the one or more (e.g., each) processing core 20. MMUs 30 may be configured to manage memory address translation and access control functions for processing cores 20. For example, as known in the art, MMU 30 may be configured to translate virtual addresses to physical addresses and determine memory access permissions for different memory regions.

[0058] According to some embodiments of the present invention, MMU 30 may further generate indications, referred to herein as “cacheable indications 30CI”, that identify whether specific data elements should be treated as cacheable or non-cacheable based on memory region characteristics and system requirements.

[0059] In the example of FIG. 2A, computing device 10 may include, or may be communicatively connected to a main memory module 400 that may serve as a primary storage repository for data and / or instructions, as known in the art.

[0060] According to some embodiments, main memory 400 may store various types of data elements, including cacheable data elements 410CBL and non-cacheable data elements 410NCBL.

[0061] For example, main memory 400 may include memory regions that are write-heavy-read-light, making these regions suitable for non-cacheable marking with write-combining enabled to reduce unnecessary cache traffic and improve overall system performance.

[0062] In another example, main memory 400 may include regions that are shared with external devices such as DMA engines and network cards that can update memory without going through CPU caches. These shared regions may be designated as non-cacheable to ensure data coherency and prevent stale cache line issues that could arise when external devices modify memory contents without notifying the CPU cache system.

[0063] As elaborated herein, cacheable indication 30CI may provide information to the one or more cache devices 100 regarding the appropriate handling of data elements retrieved from main memory 400. When the cacheable indication 30CI identifies a data element as cacheable, a cache controller associated with a specific cache device 100 of computing device 10 may apply standard caching protocols. When the cacheable indication 30CI identifies a data element as non-cacheable, the cache controller of cache device 100 may apply alternative caching operations, designed to maintain data coherency while providing performance benefits for non-cacheable memory access patterns.

[0064] FIG. 2B is a block diagram depicting another example for implementation of a computing device 10 for managing both cacheable and non-cacheable data according to some embodiments of the invention.

[0065] According to some embodiments, computing device 10 of FIG. 2B may be the same as computing device 1 of FIG. 1 and / or FIG. 2A. Additionally, or alternatively, computing device 10 of FIG. 2B or may include the same components as computing device 1 of FIG. 1 and / or FIG. 2A.

[0066] FIG. 2B illustrates interrelation between processing cores 20 of computing device 10 with one or more memory devices, according to some embodiments of the present invention. As shown in FIG. 2B, computing device 10 may be implemented as a multiple-chip device, where various elements such as processing cores 20 (e.g., processor 2 of FIG. 1) and main memory module 400 may be assembled on separate, communicatively connected physical devices.

[0067] In contrast to the single-chip configuration depicted in FIG. 2A, where elements may be assembled onto a single physical device such as a single Integrated Circuit (IC) chip, FIG. 2B demonstrates a distributed architecture approach. This multi-chip implementation may provide enhanced scalability and modularity for computing systems that may require greater processing power or memory capacity than can be accommodated on a single chip.

[0068] As shown in FIG. 2B, the computing device 10 may include multiple processing cores, such as a processing core A 20-A and a processing core B 20-B, which may be distributed across separate physical devices or chip modules 10C. The processing core A 20-A and the processing core B 20-B may operate independently while sharing access to common memory resources and cache hierarchies within the computing device 10.

[0069] As shown in FIGS. 2A and 2B, the cache hierarchy may be implemented across multiple levels, including an L1 cache device 100-L1, an L2 cache device 100-L2, and an L3 cache device 100-L3. As known in the art, L1 cache device 100-L1 may serve as a Level 1 cache that may be positioned closest to individual processing cores and may provide the fastest access times with relatively smaller storage capacity. The L2 cache device 100-L2 may function as a Level 2 cache that may offer larger storage capacity than the cache device 100-L1 while maintaining faster access times compared to higher-level caches. The L3 cache device 100-L3 may operate as a Level 3 cache that may be shared among multiple processing cores and may provide the largest storage capacity within the cache hierarchy. The term “cache device” as used herein may therefore refer to, and be implemented by, any one of these hierarchical devices.

[0070] As further shown in FIG. 2B, the MMU 30 may be integrated within the multi-chip architecture to provide memory management functions across the distributed processing elements. The MMU 30 may continue to generate the cacheable indication 30CI to identify whether data elements should be treated as cacheable or non-cacheable, regardless of the physical distribution of components across multiple chips.

[0071] The main memory 400 may be implemented as a separate physical module that may communicate with the distributed processing cores and cache devices through high-speed interconnects. This separation may allow for greater memory capacity and may enable memory modules to be upgraded or replaced independently of the processing components within the computing device 10.

[0072] Additional examples for implementation of computing device 10 and cache device 100, e.g., incorporating combinations of FIGS. 2A and 2B may also be possible.

[0073] FIG. 3 is a block diagram illustrating a cache device 100 within the computing system 10, according to some embodiments of the present invention. The cache device 100 of FIG. 3 may be the same as any one of cache devices 100 of FIGS. 2A and 2B. Similarly, processing core 20 of FIG. 3 may be the same as any one of processing cores 20 of FIGS. 2A and 2B.

[0074] As depicted in FIG. 3, cache device 100 may be connected to a corresponding processing core 20 to facilitate data storage and retrieval operations. Additionally, or alternatively, one or more components of the cache device 100 may be integrated into the corresponding processing core 20 as a unified device to provide enhanced performance and reduced latency for memory access operations.

[0075] As shown in FIG. 3, the cache device 100 may include a cache memory 105 that may serve as a primary storage component for temporarily holding data elements retrieved from main memory 400. Cache memory 105 may be organized as a unified storage structure that may accommodate both cacheable and non-cacheable data elements within the same physical memory array, providing flexibility in data management while maintaining efficient hardware utilization.

[0076] According to some embodiments, cache memory 105 may be divided into multiple portions to support different types of data storage operations. For example, cache memory 105 may include one or more cacheable portions that may be dedicated to, or contain one or more cache lines 105CL specifically designated for storing cacheable data elements 410CBL. The terms “cacheable portion” and “cacheable lines”105CL may be used herein interchangeably. According to some embodiments, a cache controller 110 of cache device 100 may operate on cache lines of the cacheable portion 105CL according to standard cache coherency protocols and may support conventional caching operations such as write-back and cache line eviction procedures.

[0077] As further shown in FIG. 3, the cache memory 105 may also include a non-cacheable portion that may contain one or more cache lines 105NCL specifically allocated for storing non-cacheable data elements 410NCBL. The terms “cacheable portion” and “cacheable lines”105CL may be used herein interchangeably. According to some embodiments, cache controller 110 of cache device 100 may operate on cache lines of the non-cacheable portion 105NCL according to alternative caching protocols that may maintain data coherency while providing performance benefits for non-cacheable memory access patterns, such as write-through operations and simplified flush procedures.

[0078] According to some embodiments, cache controller 110 may be configured to coordinate data requests, store operations, and cache management functions for both the cacheable portion 105CL and the non-cacheable portion 105NCL. The cache controller 110 may be integrated into, or interface with processing core 20 to handle memory access requests and may determine appropriate caching operations based on data type classifications received through the cacheable indication 30CI.

[0079] As shown in FIG. 3, cache device 100 may include one or more software-addressable, or software-configurable configuration registers 120 that may store configuration parameters for cache operations. The configuration registers 120 may provide settings that may control how the cache controller 110 manages cacheable and non-cacheable data within the cache memory 105. Configuration registers 120 may be accessible through software interfaces, allowing system administrators or applications to adjust, or force cache behavior, e.g., based on specific workload requirements or performance optimization goals.

[0080] Additionally, or alternatively, cache device 100 may incorporate one or more counters 130 that may track various events related to cache operations. Counters 130 may monitor parameters such as elapsed time since previous flush operations, access counts for non-cacheable data, and the like. Cache controller 110 may obtain such metrics from counters 130, and perform cache management decisions based on this data.

[0081] Cache device 100 may further include one or more hardware-based usage metrics 140 modules that may aggregate data regarding the utilization of the cache memory 105. Usage metrics 140 may provide information about cache performance, hit rates, and occupancy patterns that may be used by the cache controller 110 for optimization purposes. The usage metrics 140 may, for example, enable dynamic adjustment of cache allocation strategies (e.g., to cacheable portions 105CL and non-cacheable portions 105NCL) based on observed usage patterns and performance characteristics.

[0082] Cache device 100 may further include one or more allocation registers 150 that may implement dynamic control of allocation of cache memory resources between cacheable and non-cacheable data. For example, allocation registers 150 may communicate with the cache controller 110 to dynamically adjust partitioning of the cache memory 105 between the cacheable portion 105CL and the non-cacheable portion 105NCL based on current system requirements and performance objectives.

[0083] According to some embodiments, cache memory 105 may include regions that are dedicated to storing only cacheable data, regions dedicated to storing only non-cacheable data, or regions that may store both cacheable and non-cacheable data. In some embodiments, the entire cache memory 105 may be configured as a shared region that accommodates both cacheable and non-cacheable data elements. The type of each region (only cacheable, only non-cacheable, or both cacheable and non-cacheable) may be determined by values stored in allocation registers 150.

[0084] According to some embodiments, the cache device 100 may be implemented as a virtual cache that may store virtual addresses in addition to physical addresses within the cache memory 105. In such implementations, the cache device 100 may include both virtual tag arrays and physical tag arrays to support address translation and cache lookup operations. When non-cacheable data elements are stored within the cache memory 105, an appropriate cacheable indication 30CI may be added to each of the virtual tag arrays and / or physical tag arrays to identify cache lines 105NCL containing non-cacheable data that may require special handling, e.g., during flush operations or serialization events, as explained herein.

[0085] According to some embodiments, cache controller 110 may be configured to obtain a data element 410DE (e.g., cacheable data element 410CBL or non-cacheable data element 410NCBL) from main memory module 400, and receive an indication 30CI signifying whether data element 410DE includes cacheable or non-cacheable data.

[0086] Cache controller 110 may determine the appropriate portion for storage based on the cacheable indication 30CI, and store data element 410DE in a respective cache line of the cache memory 105, where cacheable data elements 410CBL may be stored in cache lines 105CL of the cacheable portion and non-cacheable data elements 410NCBL may be stored in cache lines 105NCL of the non-cacheable portion.

[0087] Cache controller 110 may subsequently perform at least one first caching operation on the cache line 105CL when the data element comprises cacheable data 410CBL, and perform at least one second caching operation on the cache line 105NCL when the data element comprises non-cacheable data.

[0088] According to some embodiments, cache controller 110 may be configured to receive the cacheable indication 30CI from MMU 30. Cacheable indication 30CI may indicate whether the data element 410DE comprises cacheable or non-cacheable data. When the data element comprises non-cacheable data, the cache controller may assign a unique identifier to the respective cache line. According to some embodiments, the cache controller may implement a MESI coherency protocol extended with an additional ‘F’ (Flushable) bit for non-cacheable data identification. The ‘F’ bit may serve as a unique identifier and may be set whenever a non-cacheable data element is filled into the cache memory. The ‘F’ bit may function as a valid indication for a non-cacheable cache line regardless of whether the cache line is read-only, writable, or has been written to (Modified ‘M’).

[0089] According to some embodiments, cache controller 100 may receive a store instruction from the local processing core. Such a store instruction may require storing an updated version of the loaded data element 410DE, as known in the art.

[0090] When the data element 410DE comprises non-cacheable data 410NCBL, cache controller 110 may be configured to perform a first operation: a write-through operation, storing the updated version in the cache memory 105 as well as in the main memory module 400. This write-through operation may ensure that any future load instruction will see the store's updated data while maintaining data coherency with logical agents external to the processing core.

[0091] Conversely, when the data element 410DE comprises cacheable data 410CBL, cache controller 110 may perform a second, different operation: a write-back operation, storing the updated version in cache memory 105, while refraining from immediately storing the updated version in the main memory 400. This write-back approach may allow the cache memory to rely on standard caching protocols, facilitating faster operation by holding data that is more updated than other copies of the data in the system.

[0092] According to some embodiments, cache controller 110 may implement a coherency protocol such as MESI (Modified, Exclusive, Shared, Invalid) to maintain coherency of cacheable data as known in the art. The coherency protocol (e.g., MESI) may use state indicators to track the status of cache lines and coordinate data consistency across multiple cache levels and processing cores within the computing system. For example, cache controller 110 may be configured to indicate a state of a respective cache line as ‘Modified’ (‘M’) in a coherency protocol indicator when the data element comprises cacheable data. When the data element comprises non-cacheable data, cache controller 110 may refrain from indicating the state of the respective cache line as ‘Modified’ (‘M’) in the coherency protocol indicator: Under the write-through implementation for non-cacheable data, the cache memory 105 may never hold data that is more updated than other copies of the data in the system, eliminating the need to mark the cache line with a dedicated state indicating modification.

[0093] Cache controller may be further configured to receive a flush instruction from the local processing core 20, where the flush instruction may require a flush of one or more respective cache lines. As known in the art, flush operations may be required in various scenarios such as when the operating system needs to ensure data consistency before context switches, when device drivers must synchronize cached data with hardware devices that access memory directly, or when software explicitly requests cache invalidation to maintain coherency with external memory-mapped I / O operations. As also known in the art, flush operations may involve multiple steps including checking the cache line's coherency state, writing modified data back to main memory if the line is in a ‘Modified’ state, coordinating with other cache levels in the hierarchy, and finally invalidating the cache line. These conventional flush procedures may require multiple clock cycles to complete and may involve complex state transitions to ensure data consistency across the memory hierarchy. For cacheable data, there may be dedicated instructions that may invalidate or evict cache lines from the cache, or dedicated flush registers that may initiate the invalidation or eviction of all modified cache lines from the cache.

[0094] According to some embodiments, when the data element 410DE comprises cacheable data 410CBL, cache controller 110 may perform a first operation: an eviction operation on the respective cache line 105CL, thereby optionally writing the data element into the main memory module 400 (depending on the cache line's 105CL ‘Modified’ state).

[0095] Conversely, when the data element 410DE comprises non-cacheable data 410NCBL, cache controller 110 may perform a second, different operation: In this case, cache controller 110 may only be required to invalidate the respective cache line 105NCL in the cache memory. This is due to the “write-through” procedure discussed above, by which the data version stored on the main memory module 400 is kept up-to-date. Cache controller 110 may thereby refrain from performing the lengthy eviction operation. In other words, the write-through implementation discussed above may allow flushing of non-cacheable data from the cache memory in a single cycle without additional actions and without data loss, and can be accomplished by merely setting the coherency protocol's invalidity bit (e.g., the MESI ‘T’ bit). For non-cacheable data, the invalidation (without eviction) may be triggered using mechanisms such as a flush register (which may be different from the flush register used for cacheable data), a counter, a serialization operation, and the like.

[0096] As known in the art, serializing instructions may be used by software to synchronize the processing core with other external agents (e.g., other cores, Direct Memory Access (DMA) agents, and the like) that may update the same memory location without notifying the processing core. The local processing core may trigger serialization events through various instruction types such as FENCE instructions and atomic operations with acquire / release attributes. FENCE instructions, for example, may enforce memory ordering by ensuring that all memory operations before the fence complete before any memory operations after the fence begin, thereby maintaining proper synchronization across the system.

[0097] According to some embodiments, serialization operations may ensure the coherency of data by flushing the cache to allow any younger load or store operation to consume or write the most updated data in the main memory. Serialization instructions like FENCE may require cache flushing because they enforce memory ordering guarantees that ensure all previous memory operations are globally visible before any subsequent operations can proceed. When non-cacheable data is stored in the cache, external agents such as other processing cores may have updated the actual memory locations without the cache being aware of these changes. Flushing non-cacheable data from the cache during serialization ensures that subsequent memory accesses will fetch the most current data directly from main memory, preventing the processor from reading stale cached copies and maintaining proper synchronization with external memory updates.

[0098] According to some embodiments, the local processing core may trigger serialization events through various instruction types including FENCE instructions, I / O memory region accesses, and atomic operations with acquire / release attributes, to synchronize the processing core 20 with other external agents that may update the same memory location without notifying the processing core. Cache controller 110 may receive an indication of such a software-based serialization operation (e.g., a FENCE instruction) from the local processing core 20. Cache controller 110 may be configured to subsequently identify cache lines 105NCL in cache memory 105 that hold non-cacheable data 410NCBL. Cache controller 110 may invalidate the identified cache lines 105NCL, e.g., by setting corresponding coherency state bits of the employed coherency protocol (e.g., setting the MESI ‘I’ bit). As explained above, cache controller 110 may exploit the fact that main memory 400 is up to date via the write-through operation, as discussed above, and refrain from writing data elements of the identified cache lines 105NCL into the main memory module 400.

[0099] According to some embodiments, cache controller 110 may also support context switch and page table change events as serialization triggers when implemented as a virtual cache. In other words, when cache device 100 stores virtual addresses in addition to physical addresses, context switches or changes in page tables may trigger serialization events that may cause the cache controller to flush non-cacheable data from the cache memory 105 by invalidation, as explained herein.

[0100] As known in the art, modern computing architectures may allow computing devices (e.g., device 10 of FIG. 1) to execute memory operations out-of-order. For example, out-of-order processors may perform load operations in any order, allowing independent instructions to proceed without waiting for earlier instructions to complete, thereby improving processing speed. However, out-of-order computing devices must abide with memory ordering rules to ensure that data is consumed as if the loads were executed in the original program order.

[0101] For example, a processing core 20 (e.g., 20-A) may be required to execute a sequence of code instructions that includes the following commands: LD(A) . . . →ST(A) . . . →LD(A), where the first LD(A) represents a load instruction from memory address A to a register R1, the second LD(A) represents another load instruction from the same memory address A to a register R2, and ST(A) represents a store operation to the same memory address A. In this sequence, the two load operations should not be reordered because the second load depends on the value at memory address A at the time of its execution. If the second LD(A) were executed before the first LD(A), and the same (e.g., 20-A), or other (e.g., 20-B) processing core were to perform store operation ST(A) to memory address A between the two loads, the reordering would cause the processor to observe an inconsistent view of memory. This inconsistency would be manifested in the values of registers R1 and R2, potentially causing incorrect program behavior.

[0102] As explained herein, cache controller 110 may identify conditions of memory ordering violation, and act upon such conditions according to the underlying data type. In other words, cache controller 110 may perform at least one first operation to handle memory ordering violations in cacheable data elements 410CBL, and perform at least one second, different operation to handle memory ordering violations in non-cacheable data element 410NCBL.

[0103] Embodiments of the invention may maintain coherency of cacheable data through dedicated hardware and / or software operations. For example, when a processing core 20 requests data, it may invoke snoop operations 20SNP on other cores, which may manipulate the cache line state, e.g., by invalidating the cache line, changing its status to ‘Shared’ (e.g., setting its MESI ‘S’ bit), or flushing it.

[0104] In some embodiments, snoop operations 20SNP may access a dedicated structure, such as a Global Load Queue (GLQ) 60, which holds a registry of pending load operations that have been executed, but have not yet been committed by processing cores 20. As known in the art, a load operation may be considered “committed” when its result has been finalized and made architecturally visible, meaning the operation can no longer be rolled back or re-executed.

[0105] For example, a first processing core (e.g., 20-A) may be required to execute a sequence of code instructions that includes the following commands: LD(A)→FENCE→ . . . LD(B), where LD(A) and LD(B) represent load instructions from cache lines A and B respectively, and FENCE represents a fence synchronization instruction. As explained above, the fence synchronization instruction may require processing core 20-A to perform LD(A) before LD(B). However, because processing core 20-A may execute operations out of order, a condition may occur where processing core 20-A executes LD(B) before LD(A).

[0106] According to some embodiments, cache controller 110 (e.g., snoop operation 20SNP) may consult GLQ 60, to identify a condition of memory ordering violation. In this example, cache controller 110 may identify that LD(B) was executed before the fenced LD(A), creating a potential ordering violation.

[0107] According to some embodiments, when cache lines (A) and (B) hold cacheable data, cache controller 110 may mark the registered entry of load operation LD(B) in GLQ 60 as “suspicious” of being stale. The registry entry may only be marked as “suspicious” rather than “stale” because it may be that no harm was done by reordering: If no store action was performed (e.g., by a second processing core 20-B) on the affected cache line (B), the reordering would not have caused incorrect behaviour, and therefore the LD(B) operation need not be immediately invalidated or flushed. Instead, the LD(B) operation and subsequent operations in its pipeline need only be flushed if an external snoop 20SNP actually hits the same cache line (B), confirming that the data may have been modified by the other processing core (e.g., 20-B). As used herein, the term “pipeline” may refer to the sequence of operations queued for execution by the processing core, and “flushing the pipeline” may refer to discarding the affected operations and re-executing them to ensure correct data is used.

[0108] This mechanism of marking operations as “suspicious” rather than immediately “stale,” and only affirming staleness when encountering a corresponding snoop for the same cache line, may boost performance. This is because external snoops may be relatively rare, so pipeline flushes may also be rare, resulting in minimal performance impact for cacheable data operations.

[0109] According to some embodiments of the present invention, cache device 100 may leverage the same memory ordering detection mechanisms (e.g., GLQ 60) and handling procedures (e.g., pipeline flush and restart) for non-cacheable data.

[0110] However, non-cacheable operations may not invoke snoop operations on other cores, as coherency for non-cacheable data may be maintained through software mechanisms such as polling or doorbell signaling. Therefore, when a serialization event occurs (e.g., when a FENCE command is encountered), entries of non-cacheable load commands in GLQ 60 may be marked as “stale” rather than “suspicious as stale” (which would require awaiting a snoop 20SNP operation). In other words, when encountering a synchronization event, cache controller 110 may invoke immediate pipeline flush without waiting for an external snoop.

[0111] While this approach may increase the frequency of pipeline flushes, serialization events may be relatively rare, resulting in minimal performance impact. It may be appreciated that this approach may provide memory ordering support for out-of-order execution of non-cacheable memory operations by leveraging similar behavior to cacheable loads, requiring relatively simple modifications to existing coherency algorithms.

[0112] According to some embodiments, cache device 100 may include a flush control hardware component 160. Cache controller may be further configured to receive, from the flush control hardware component 160, an indication of a required flush for one or more cache lines 105NCL in cache memory 105. Cache controller 110 may subsequently identify cache lines 105NCL in cache memory 105 that maintain non-cacheable data 410NCBL and perform the required flushing by invalidating the identified cache lines 105NCL and refraining from writing data elements of the identified cache lines 105NCL into the main memory module 400, as explained herein.

[0113] For example, the flush control hardware component 160 may be, or may include one or more software-configurable flush registers (e.g., configuration registers 120), indicating the required flush in corresponding cache portions or cache lines 105NCL in cache memory 105. For example, configuration registers 120 may include dedicated Control and Status Register (CSR) bits whose writing (e.g., by software, via processing core 20) may indicate the cache lines 105NCL should be flushed. These software-configurable flush registers may provide implementation-specific mechanisms for triggering flush operations based on system requirements.

[0114] Additionally, or alternatively, the flush control hardware component 160 may include at least one counter 130, and may be configured to generate the indication of a required flush based on a value of the at least one counter (e.g., when traversing a predetermined threshold).

[0115] The at least one counter 130 may, for example, be configured to count clock cycles elapsed since a previous flush operation, and the flush control hardware component may be configured to generate the indication when the counter reaches a predetermined clock cycle threshold. This time-based flushing mechanism may support coherency algorithms such as polling, which may require constant bringing of updated data from external sources.

[0116] In another example, the at least one counter 130 may be configured to count a number of cache accesses to non-cacheable data 410NCBL and generate the indication of required flush when the counter reaches a predetermined access count threshold. This access-based counting approach may provide flush control based on usage patterns of non-cacheable data within the cache memory.

[0117] In a complementary example, the at least one counter 130 may be configured to count a number of cache accesses to cacheable data 410CBL. Cache controller 110 may compare the access count for cacheable data against the access count for non-cacheable data to determine relative usage patterns. When the access count for cacheable data exceeds a predetermined ratio relative to non-cacheable data accesses, cache controller 110 may dynamically allocate additional cache memory resources to the cacheable portion 105CL, thereby optimizing cache utilization based on observed access patterns.

[0118] Additionally, or alternatively, the access count may enable calculation of access frequency by cache controller 110, to generate the indication of required flush when the access frequency falls below a predetermined value.

[0119] In another example, the at least one counter 130 may be configured to count a cache occupancy level representing a percentage of the cache memory occupied by cacheable, and / or non-cacheable data, and the flush control hardware component may be configured to generate the indication when the counter reaches a predetermined occupancy threshold. This occupancy-based approach may help maintain balanced allocation of cache resources between cacheable and non-cacheable data elements.

[0120] According to some embodiments, cache device 100 may further include one or more allocation registers 150. Allocation registers may be dynamically configurable, e.g., by software via the local processing core, and may map specific cache addresses to corresponding data types, e.g., cacheable 410CBL and non-cacheable 410NCBL data.

[0121] Cache controller 110 may be configured to allocate portions of cache memory 105 for storage of cacheable 105CL or non-cacheable 105NCL lines, respectively dedicated to cacheable 410CBL and non-cacheable 410NCBL data, based on values of respective allocation registers of the one or more allocation registers 150.

[0122] Allocation registers may thereby enable dynamic control (e.g., changing over time, subsequent to software-based logic) of cache memory 105 resource allocation, e.g., to prevent non-cacheable data from taking over cache capacity at the expense of cacheable data.

[0123] Additionally, or alternatively, cache device 100 may further include a hardware-based cache usage metric module 140, configured to aggregate usage telemetry 140M, representing usage patterns of data stored on cache memory 105. Cache controller 110 may be configured to dynamically allocate portions of the cache memory for storage of cacheable or non-cacheable data, based on the usage telemetry 140M. In other words, usage telemetry 140M may provide information about cache 100 performance, hit rates, and occupancy patterns that may enable optimization of cache allocation strategies by cache controller 110.

[0124] For example, usage metric module 140 may be, or may include a hardware-based Least Recently Used (LRU) module 140, configured to aggregate LRU telemetry 140M pertaining to cache lines 105NCL that store non-cacheable data. Cache controller 110 may identify a cache line 105NCL as a candidate for replacement based on the LRU telemetry 140M, and subsequently evict the candidate cache line 105NCL. As explained herein, cache controller 110 may do so rapidly, by merely invalidating the candidate cache line (e.g., by setting invalid state indication ‘I’ in the employed coherence protocol), while refraining from writing data elements 410NCBL of the candidate cache line 105NCL into the main memory module 400. This is due to the write-through scheme discussed above. Usage metric module 140 (e.g., LRU module 140) may thereby enable efficient replacement policies for non-cacheable data without requiring write-back operations.

[0125] It may be appreciated that the exploit of cache mechanisms by embodiments of the invention may provide inherent benefits for non-cacheable data management as well.

[0126] For example, and according to some embodiments, cache device 100 may support combining adjacent read requests into single larger transactions for performance enhancement. When multiple read requests target adjacent memory locations within the same cache block, cache controller 110 may merge these requests to reduce external memory 400 access overhead and improve overall system performance.

[0127] In another example, cache device 100 may enable multiple outstanding read requests to function as prefetches for parallel execution. This parallel prefetch capability may allow the cache controller to issue multiple non-cacheable read requests simultaneously, reducing overall latency for non-cacheable memory access patterns while maintaining data coherency through the write-through protocol and flush mechanisms described herein.

[0128] FIG. 4 is a flowchart depicting a cache storage management process or method, implemented by a cache controller (e.g., cache controller 110 of FIG. 3), according to some embodiments of the present invention. The method illustrated in the flowchart presents management of both cacheable and non-cacheable data within a unified cache memory structure (e.g., cache memory 105 of FIG. 3), where different caching operations may be applied based on the data type classification obtained during the process.

[0129] According to some embodiments, an MMU module (e.g., MMU 30 of FIGS. 2A, 2B) may perform virtual-to-physical address translation for load or store operations and, in parallel, determine the memory type (cacheable or non-cacheable) of the data element being accessed. MMU 30 may identify the data type based, for example, on memory region properties and / or access control settings configured within the computing device 10.

[0130] As shown in step S1005, (e.g., following the MMU's address translation and memory type determination), cache controller 110 may load a data element (e.g., 410DE of FIG. 2A) from a main memory module (e.g., main memory 400 of FIG. 2A). Data element 410DE may include either a cacheable data element (410CBL) or a non-cacheable data element (410NCBL).

[0131] The cache storage management process may proceed to step S1010, in which the cache controller 110 may obtain an indication (e.g., 30CI of FIG. 2A), signifying whether the loaded data element 410DE comprises cacheable or non-cacheable data. According to some embodiments, cache controller 110 may receive the cacheable indication 30CI from MMU 30.

[0132] Following this determination, the process may move to a step S1015, where cache controller 110 may store the data element in a cache line of the cache memory 105. When the data element comprises cacheable data, the cache controller 110 may store the cacheable data element 410CBL in a cache line of the cacheable portion 105CL. Conversely, when the data element comprises non-cacheable data, the cache controller 110 may store the non-cacheable data element 410NCBL in a cache line of the non-cacheable portion 105NCL.

[0133] As further shown in FIG. 4, the process may then branch based on the type of data identified in the step S1010. A step S1020 may involve performing at least one first caching operation on the cache line when the data element comprises cacheable data 410CBL. The first caching operations may include standard cache coherency protocol operations such as write-back procedures, eviction operations that may write modified data to the main memory 400, and coherency state management using protocols such as MESI.

[0134] Alternatively, a step S1025 may involve performing at least one second, different caching operation on the cache line when the data element comprises non-cacheable data 410NCBL. The second caching operations may include write-through operations that may simultaneously update both the cache memory 105 and the main memory 400, simplified flush procedures that may invalidate cache lines without write-back operations, and specialized coherency management using extended protocol states such as the ‘F’ (Flushable) bit described herein.

[0135] According to some embodiments, the method of cache storage management may provide performance benefits for non-cacheable memory access patterns while maintaining data coherency across the computing device 10. The method may enable multiple outstanding non-cacheable reads and may prevent multiple external accesses to the same cache block, thereby improving execution performance for non-cacheable data operations within the processing core 20.

[0136] For example, embodiments of the invention may include receiving a store instruction 20INST requiring storing an updated version of the data element. Store instruction 20INST may be generated by the local processing core during program execution when software needs to modify data that has been previously loaded into the cache memory module. When the data element comprises non-cacheable data, embodiments of the method may include performing a write-through operation, storing the updated version into the cache memory module and the main memory module 400. This write-through approach may ensure that both the cached copy and the main memory copy are updated simultaneously, maintaining data coherency with any logical agents external to the processing core that may access the same memory locations. When the data element comprises cacheable data, embodiments of the method may include performing a write-back operation, storing the updated version in the cache memory module, while refraining from immediately storing the updated version in the main memory module.

[0137] The term “immediately” may be used in this sense to indicate that the cache controller does not write the updated data to main memory as a direct consequence of the store instruction. Instead, the updated version may remain only in the cache memory at that point in time. This, however, does not mean the data will never reach main memory: The updated version may be written to main memory at some other time in the future, such as during cache management events like eviction (when the cache line needs to be replaced), explicit flush operations requested by software, or when the coherency protocol requires synchronization with other cache levels or processing cores.

[0138] This write-back approach may allow the cache memory module to hold data that is more updated than copies stored elsewhere in the system, enabling faster write operations by deferring main memory updates until later cache management events such as eviction or explicit flush operations.

[0139] In another example, embodiments of the method of cache storage management may include receiving a flush instruction 20INST requiring a flush of the cache line. Flush instruction 20INST may be issued by the local processing core in response to a software-triggered system call, or in response to various system events such as serialization requirements, context switches, or explicit cache management operations requested by software applications or the operating system. When the data element comprises cacheable data, embodiments of the method may include performing an eviction operation on the cache line, thereby optionally writing the data element into the main memory module. The eviction operation may involve checking the coherency state of the cache line and writing modified data back to the main memory module if the cache line has been marked as modified according to the employed coherency protocol. When the data element comprises non-cacheable data, embodiments of the method may include invalidating the cache line in the cache memory module, and refraining from performing the eviction operation. This simplified flush procedure may be enabled by the write-through operations described above, which may ensure that the main memory module already contains the most current version of the data, eliminating the need for write-back operations during flush events and allowing rapid invalidation of non-cacheable cache lines.

[0140] According to some embodiments, the cache device and method described herein may provide several technical advantages over currently available cache systems by leveraging existing cache infrastructure to handle both cacheable and non-cacheable data within a unified memory structure.

[0141] Embodiments of the present invention may reduce memory access latency for non-cacheable data operations. By storing non-cacheable data in cache memory and applying write-through operations, the cache device may enable multiple outstanding read requests and prevent repeated external accesses to the same memory locations, thereby improving execution performance compared to conventional approaches that access non-cacheable data directly from main memory for every operation.

[0142] The write-through approach for non-cacheable data may simplify flush operations by eliminating the need for write-back procedures during cache line invalidation. Since the main memory module may always contain the most current version of non-cacheable data, flush operations may be accomplished by merely setting the coherency protocol's invalidity bit, allowing rapid invalidation in a single cycle without data loss.

[0143] Embodiments of the present invention may further enable efficient resource allocation between cacheable and non-cacheable data through dynamically configurable allocation registers and hardware-based usage telemetry. This dynamic allocation may prevent non-cacheable data from consuming excessive cache capacity at the expense of cacheable data, while optimizing cache utilization based on observed access patterns.

[0144] The cache device may also leverage existing coherency mechanisms, such as the global load queue, to support memory ordering for out-of-order execution of non-cacheable memory operations. This approach may require relatively simple modifications to existing coherency algorithms while providing memory ordering guarantees for non-cacheable data.

[0145] Unless explicitly stated, the method embodiments described herein are not constrained to a particular order or sequence. Furthermore, all formulas described herein are intended as examples only and other or different formulas may be used. Additionally, some of the described method embodiments or elements thereof may occur or be performed at the same point in time.

[0146] While certain features of the invention have been illustrated and described herein, many modifications, substitutions, changes, and equivalents may occur to those skilled in the art. It is, therefore, to be understood that the appended claims are intended to cover all such modifications and changes as fall within the true spirit of the invention.

[0147] Various embodiments have been presented. Each of these embodiments may of course include features from other embodiments presented, and embodiments not specifically described may include various features described herein.

Claims

1. A computing device comprising a main memory module, a cache memory module, and a cache controller, wherein said cache controller is configured to:load a data element from the main memory module;obtain an indication of whether the loaded data element comprises cacheable or non-cacheable data;store the data element in a cache line of the cache memory module;perform at least one first caching operation on the cache line when the data element comprises cacheable data; andperform at least one second caching operation on the cache line when the data element comprises non-cacheable data,wherein the cache controller is further configured to:when the data element comprises cacheable data, perform, as the at least one first caching operation, indicating a state of the respective cache line as ‘modified’ in a coherency protocol indicator; andwhen the data element comprises non-cacheable data, perform, as the at least one second caching operation, refraining from indicating the state of the respective cache line as ‘modified’ in the coherency protocol indicator.

2. A cache device comprising:a cache memory configured to store data elements; anda cache controller associated with a local processing core, wherein the cache controller is configured to:obtain a data element from a main memory module;receive an indication of whether the data element comprises cacheable or non-cacheable data;store the data element in a respective cache line of the cache memory;perform at least one first caching operation on the cache line when the data element comprises cacheable data; andperform at least one second caching operation on the cache line when the data element comprises non-cacheable data,wherein the cache controller is configured to:receive the indication from a memory management unit (MMU) indicating whether the data element comprises cacheable or non-cacheable data; andassign a unique identifier to the respective cache line when the data element comprises non-cacheable data.

3. The cache device of claim 2, wherein the cache controller is further configured to:receive a store instruction from the local processing core, wherein the store instruction requires storing an updated version of the data element;when the data element comprises non-cacheable data, perform, as the at least one second caching operation, a write-through operation, storing the updated version in the cache memory and the main memory module; andwhen the data element comprises cacheable data, perform, as the at least one first caching operation, a write-back operation, storing the updated version in the cache memory.

4. The cache device of claim 3, wherein the at least one first caching operation further comprises refraining from immediately storing the updated version in the main memory module.

5. The cache device of claim 2, wherein the cache controller is further configured to:receive a flush instruction from the local processing core, wherein the flush instruction requires a flush of the cache line;when the data element comprises cacheable data, perform, as the at least one first caching operation, an eviction operation on the respective cache line, thereby optionally writing the data element into the main memory module; andwhen the data element comprises non-cacheable data, perform, as the at least one second caching operation, invalidation of the respective cache line in the cache memory, and refraining from performing the eviction operation.

6. The cache device of claim 2, further comprising a flush control hardware component, wherein the cache controller is further configured to:receive, from the flush control hardware component, an indication of a required flush for one or more cache lines in the cache memory;subsequently identify cache lines in the cache memory that comprise non-cacheable data; andperform, as the at least one second caching operation: (i) invalidating the identified cache lines; and (ii) refraining from writing data elements of the identified cache lines into the main memory module in response to the indication of the required flush.

7. The cache device of claim 6, wherein the flush control hardware component comprises one or more software-configurable flush registers, indicating the required flush in corresponding regions or cache lines in the cache memory.

8. The cache device of claim 6, wherein the flush control hardware component comprises at least one counter, and wherein the flush control hardware component is configured to generate the indication of a required flush based on a value of the at least one counter.

9. The cache device of claim 8, wherein the at least one counter is configured to count clock cycles elapsed since a previous flush operation, and wherein the flush control hardware component is configured to generate the indication when the counter reaches a predetermined clock cycle threshold.

10. The cache device of claim 8, wherein the at least one counter is configured to count a number of cache accesses to non-cacheable data, and wherein the flush control hardware component is configured to generate the indication when the counter reaches a predetermined access count threshold.

11. The cache device of claim 8, wherein the at least one counter is configured to count a cache occupancy level representing a percentage of the cache memory occupied by non-cacheable data, and wherein the flush control hardware component is configured to generate the indication when the counter reaches a predetermined occupancy threshold.

12. The cache device of claim 3 further comprising one or more allocation registers, wherein the allocation registers are dynamically configurable by software via the local processing core, and wherein the cache controller is further configured to allocate portions of the cache memory for storage of cacheable or non-cacheable data, based on values of respective allocation registers of the one or more allocation registers.

13. The cache device of claim 2 further comprising a hardware-based cache usage metric module, configured to aggregate usage telemetry, representing usage of data stored on the cache memory, and wherein the cache controller is further configured to dynamically allocate portions of the cache memory for storage of cacheable or non-cacheable data, based on the usage telemetry.

14. The cache device of claim 2 further comprising a hardware-based Least Recently Used (LRU) module, configured to aggregate LRU telemetry pertaining to cache lines that store non-cacheable data, and wherein the cache controller is further configured to perform, as the at least one second caching operation:identifying a cache line as a candidate for replacement, based on said LRU telemetry;invalidating the candidate cache line; andrefraining from writing data elements of the candidate cache line into the main memory module.

15. The cache device of claim 2, wherein the cache device further comprises a global load queue configured to maintain a registry of pending load operations that have been executed but not yet committed by the local processing core, and wherein the cache controller is further configured to:identify a condition of memory ordering violation based on the registry of pending load operations;when the data element comprises cacheable data, perform, as the at least one first caching operation: (i) marking a registered entry of a load operation in the global load queue as suspicious of being stale, and (ii) flushing a pipeline of the local processing core responsive to an external snoop operation hitting a cache line associated with the registered entry; andwhen the data element comprises non-cacheable data, perform, as the at least one second caching operation: (i) marking a registered entry of a load operation in the global load queue as stale responsive to a serialization event, and (ii) flushing the pipeline of the local processing core without waiting for an external snoop operation.

16. A cache device comprising:a cache memory configured to store data elements; anda cache controller associated with a local processing core, wherein the cache controller is configured to:obtain a data element from a main memory module;receive an indication of whether the data element comprises cacheable or non-cacheable data;store the data element in a respective cache line of the cache memory;perform at least one first caching operation on the cache line when the data element comprises cacheable data; andperform at least one second caching operation on the cache line when the data element comprises non-cacheable data,wherein the cache controller is further configured to:receive an indication of a software-based serialization operation from the local processing core;subsequently identify cache lines in the cache memory that comprise non-cacheable data; andperform at least one second caching operation: (i) invalidating the identified cache lines, and (ii) refraining from writing data elements of the identified cache lines into the main memory module in response to the serialization operation.

Citation Information

Patent Citations

  • Non-cacheable access handling in processor with virtually-tagged virtually-indexed data cache

    US12061555B1

  • System and method for fetching information in response to hazard indication information

    US20060059312A1

  • Memory Management Unit and Method for Memory Management

    US20070277009A1

  • System and method for fetching an information unit

    US20100325366A1

  • Controlling a processor cache using a real-time attribute

    US20130254491A1