Victim cache supporting drain of write miss entry

A dual sub-cache caching system with write miss data handling and eviction control improves cache performance and reliability in multi-core systems, addressing data corruption issues in fault-tolerant environments.

JP2024170552AActive Publication Date: 2024-12-10TEXAS INSTRUMENTS JAPAN LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2024153306
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2020-05-22
Filing Date
2024-09-05
Publication Date
2024-12-10
Estimated Expiration
2040-05-26

AI Technical Summary

Technical Problem

Memory caches in multi-core coherent systems are susceptible to data corruption from electronic or magnetic interference, such as cosmic rays, which is exacerbated in fault-tolerant systems like self-driving vehicles, and implementing error correcting codes (ECC) in high-speed caches introduces timing overhead, necessitating improved cache performance techniques.

Method used

A caching system with a first and second sub-cache parallel to each other, where the second sub-cache stores write miss data and flushes it based on a line type bit, and an eviction controller manages cache lines to optimize performance.

Benefits of technology

The solution reduces cache miss rates and improves performance by efficiently handling write misses without stalling processors, enhancing fault-tolerant systems' reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024170552000001_ABST
    Figure 2024170552000001_ABST
Patent Text Reader

Abstract

To provide a method for improving cache performance of a fault resistance cache, a caching system, and a device.SOLUTION: A caching system (victim cache pipeline 700) includes a first sub-cache and a second sub-cache parallel to the first sub-cache. The second sub-cache includes a cache line set, a line type bit 708 which stores the instruction that the corresponding cache line in the cache line set stores write miss data, and an eviction controller 714 which flashes the write miss data stored on the basis of the line type bit 708.SELECTED DRAWING: Figure 7
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] In a multi-core coherent system, multiple processors and system components share the same memory resources, such as on-chip and off-chip memory. A memory cache (e.g., cache) may provide an amount of high-speed memory that is operationally closer (e.g., proximate) to the processor compared to the main memory. In general, the closer the cache is to the processor, the lower the latency, i.e., fewer processor clock cycles are used to satisfy a memory request. Generally, the cache memory closest to the processor includes a level 1 (L1) cache, which often resides directly on the die with the processor. Many processors also include a larger level 2 (L2) cache. This L2 cache is generally slower than the L1 cache, but may still reside on the die with the processor cores. The L2 cache may be a per-processor core cache or may be shared across multiple cores. Often, a processor core also has available a larger, slower L3 cache that resides on the die as a separate component or in another part of the system-on-chip (SoC).

[0002] Memory systems such as caches may be susceptible to data corruption due to electronic or magnetic interference, for example, from cosmic rays, solar particles, or malicious memory access. As processors are increasingly used in critical systems and / or other fault-intolerant systems, such as self-driving vehicles and autonomous systems, techniques to protect memory systems from data corruption are increasingly being applied to memory systems. One such technique is the use of error-correcting codes (ECC) to detect and correct memory corruption. Implementing ECC in high-speed cache memories is troublesome because ECC can introduce additional timing overhead that must be considered. For example, a high-speed cache memory system may have a five-stage memory pipeline to determine whether a memory address is accessed in the cache and to retrieve the contents of the cache memory. Each stage may take one clock cycle, which is approximately one nanosecond at 1 GHz. Checking the contents of the cache memory for errors may take substantially a full clock cycle. Techniques are needed to improve the cache performance of fault-tolerant caches. Summary of the Invention

[0003] The present description relates to a caching system. More specifically, some aspects of the present description relate to a caching system including a first sub-cache and a second sub-cache parallel to the first sub-cache, the second sub-cache including a set of cache lines, line type bits configured to store an indication that a corresponding cache line of the set of cache lines is configured to store write miss data, and an eviction controller configured to flush the stored write miss data based on the line type bits.

[0004] Another aspect of the present specification relates to a method for caching data, the method including receiving, by a caching system, a write memory request for a memory address; determining, by a first sub-cache of the caching system, that the memory address is not cached in the first sub-cache; determining, by a second sub-cache of the caching system, that the memory address is not cached in the second sub-cache; storing data associated with the write memory request in the second sub-cache; storing an indication in line type bits of the second sub-cache that the stored data corresponds to a write miss; and flushing the stored data based on the indication.

[0005] Another aspect of the present description relates to a device including a first sub-cache and a second sub-cache parallel to the first sub-cache, the second sub-cache including a set of cache lines, line type bits configured to store an indication that a corresponding cache line of the set of cache lines is configured to store write miss data, and an eviction controller configured to flush the stored write miss data based on the line type bits.

[0006] Another aspect of the present description relates to a caching system including a first sub-cache and a second sub-cache parallel to the first sub-cache, the second sub-cache including a set of cache lines, line type bits configured to store an indication that a corresponding line of the set of cache lines is configured to store write miss data, and an eviction controller configured to evict a cache line of the second sub-cache that stores the write miss data based on the indication that the cache line is completely written.

[0007] Another aspect of the present description relates to a method for caching data, including receiving, by a caching system, a write memory request for a memory address; determining, by a first sub-cache of the caching system, that the memory address is not cached in the first sub-cache; determining, by a second sub-cache of the caching system, that the memory address is not cached in the second sub-cache; storing data associated with the write memory request in the second sub-cache; storing an indication in line type bits of the second sub-cache that the stored data corresponds to a write miss; and evicting a cache line of the second sub-cache that stores the write miss based on the indication that the cache line is completely written.

[0008] Another aspect of the present description relates to a device including a processor, a first sub-cache, and a second sub-cache parallel to the first sub-cache, the second sub-cache including a set of cache lines, line type bits configured to store an indication that a corresponding line of the set of cache lines is configured to store write miss data, and an eviction controller configured to evict a cache line of the second sub-cache that stores the write miss data based on the indication that the cache line is completely written.

[0009] Another aspect of the present description relates to a caching system including a first sub-cache and a second sub-cache coupled in parallel to the first cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, the second sub-cache including color tag bits configured to store an indication that a corresponding cache line of the second sub-cache that stores the write miss data is associated with a color tag, and an eviction controller configured to evict cache lines of the second sub-cache that store the write miss data based on the color tag associated with the cache lines.

[0010] Another aspect of the present description relates to a method for caching data, the method including receiving, by a caching system, a write memory command for a memory address; determining, by a first sub-cache of the caching system, that the memory address is not cached in the first sub-cache; determining, by a second sub-cache of the caching system, that the memory address is not cached in the second sub-cache, the second sub-cache being configured to store cache data evicted from the first sub-cache and the write memory command not cached in the first sub-cache in parallel with the first sub-cache; storing data associated with the write memory command in the second sub-cache; storing color tag bits associated with the data in the second sub-cache; and evicting the stored data based on the color tag bits.

[0011] Another aspect of the present description relates to a device including a processor, a first sub-cache, and a second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, the second sub-cache including color tag bits configured to store an indication that a corresponding cache line of the second sub-cache that stores the write miss data is associated with a color tag, and an eviction controller configured to evict cache lines of the second sub-cache that store the write miss data based on the color tag associated with the cache lines.

[0012] Another aspect of the present description relates to a technique for caching data by a caching system, the caching system including a first sub-cache and a second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, the second sub-cache including color tag bits configured to store an indication that a corresponding line of the second sub-cache is associated with a color tag, and an eviction controller configured to evict cache lines of the second sub-cache that store memory write data based on a color tag associated with the line, The cache is further configured to receive a first write memory command for the memory address, the write memory command associated with a first color tag, store first data associated with the first write memory command in a cache line of the second sub-cache, store the first color tag in the second sub-cache, receive a second write memory command for the cache line, the write memory command associated with a second color tag, merge the second color tag with the first color tag, store the merged color tag, and evict the cache line based on the merged color tag.

[0013] Another aspect of the present description relates to a method for caching data, the method including receiving, by a caching system, a write memory command for a memory address, the write memory command being associated with a first color tag; determining, by a first sub-cache of the caching system, that the memory address is not to be cached in the first sub-cache; and determining, by a second sub-cache of the caching system, that the memory address is not to be cached in the second sub-cache, the second sub-cache caching data that has been evicted from the first sub-cache in parallel with the first sub-cache. The method includes determining whether to store data and an uncached write memory command in the first sub-cache, storing first data associated with the first write memory command in a cache line of the second sub-cache, storing a first color tag in the second sub-cache, receiving a second write memory command for the cache line, the write memory command being associated with the second color tag, receiving, merging the second color tag with the first color tag, storing the merged color tag, and evicting the cache line based on the merged color tag.

[0014] Another aspect of the present description relates to a device including a processor, a first sub-cache, and a second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, the second sub-cache including color tag bits configured to store an indication that a corresponding line of the second sub-cache is associated with a color tag, and an eviction controller configured to evict cache lines of the second sub-cache that store memory write data based on the color tag associated with the line, the second sub-cache further including: the first sub-cache; receiving a first write memory command for the cache line, the write memory command associated with a first color tag; storing first data associated with the first write memory command in a cache line of the second sub-cache; storing the first color tag in the second sub-cache; receiving a second write memory command for the cache line, the write memory command associated with a second color tag; merging the second color tag with the first color tag; storing the merged color tag; and evicting the cache line based on the merged color tag.

[0015] Another aspect of the present description relates to a caching system including a first sub-cache and a second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, the second sub-cache including a privilege bit configured to store an indication that a corresponding cache line of the second sub-cache is associated with a level of privilege, the second sub-cache further receiving a first write memory command for a memory address, the first write memory command being associated with the first level of privilege. the first sub-cache is configured to receive a cache line associated with the first sub-cache; store first data associated with the first write memory command in a cache line of the second sub-cache; store a level of privilege associated with the cache line in the second sub-cache; and receive a second write memory command for the cache line, the second write memory command being associated with a second level of privilege; receive, merge the first level of privilege with the second level of privilege, store the merged privilege level, and output the merged privilege level with the cache line.

[0016] Another aspect of the present disclosure includes receiving, by a caching system, a write memory command for a memory address, where a first write memory command is associated with a first privilege level; determining, by a first sub-cache of the caching system, that the memory address is not cached in the first sub-cache; and determining, by a second sub-cache of the caching system, that the memory address is not cached in the second sub-cache, where the second sub-cache concurrently caches cache data evicted from the first sub-cache and cached data in the first sub-cache. the first sub-cache is configured to receive a cache line that is associated with a second level of privilege, the second sub-cache being configured to receive a cache line that is associated with a second level of privilege, the first sub-cache being configured to receive a cache line that is associated with a second level of privilege, the second ... first sub-c

[0017] Another aspect of the present description relates to a device including a processor, a first sub-cache, and a second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, the second sub-cache including a privilege bit configured to store an indication that a corresponding cache line of the second sub-cache is associated with a level of privilege, the second sub-cache further receiving a first write memory command for a memory address, the first write memory command being associated with the level of privilege. the first sub-cache is configured to receive a write memory command associated with a level of privilege associated with the cache line, storing first data associated with the first write memory command in a cache line of the second sub-cache, storing a level of privilege associated with the cache line in the second sub-cache, receiving a second write memory command for the cache line, the second write memory command being associated with the second level of privilege, receiving, merging the first level of privilege with the second level of privilege, storing the merged privilege level, and outputting the merged privilege level with the cache line.

[0018] Another aspect of the present description relates to a caching system including a first sub-cache and a second sub-cache coupled in parallel to the first sub-cache, the second sub-cache including a line type bit configured to store an indication that a corresponding line of the second sub-cache is configured to store write miss data.

[0019] Another aspect of the present description relates to a method for caching data, the method including receiving, by a caching system, a write memory request for a memory address; determining, by a first sub-cache of the caching system, that the memory address is not cached in the first sub-cache; determining, by a second sub-cache of the caching system, that the memory address is not cached in the second sub-cache, the second sub-cache being coupled in parallel to the first sub-cache; storing data associated with the write memory request in the second sub-cache; and storing an indication in line type bits of the second sub-cache that the stored data corresponds to a write miss.

[0020] Another aspect of the present description relates to a device including a processor, a first sub-cache, and a second sub-cache coupled in parallel to the first sub-cache, wherein the second sub-cache includes a line type bit configured to store an indication that a corresponding line of the second sub-cache is configured to store write miss data.

[0021] Another aspect of the present description relates to a caching system including a first sub-cache, a second sub-cache coupled in parallel to the first cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, and a cache controller, wherein the cache controller is configured to receive two or more cache commands, determine that a conflict exists between the two or more received cache commands, determine a conflict resolution between the two or more received cache commands, and send the two or more cache commands to the first sub-cache and the second sub-cache.

[0022] Another aspect of the present description relates to a method for caching data, the method including receiving two or more cache commands, determining that a conflict exists between the two or more cache commands, determining a conflict resolution between the received two or more cache commands, and sending the two or more cache commands to a first sub-cache and a second sub-cache, the second sub-cache configured to store, in parallel with the first sub-cache, cache data evicted from the first sub-cache and write memory commands that are not cached in the first sub-cache.

[0023] Another aspect of the present description relates to a device including a processor, a first sub-cache, a second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, and a cache controller, wherein the cache controller is configured to receive two or more cache commands, determine that a conflict exists between the two or more cache commands, determine a conflict resolution between the received two or more cache commands, and send the two or more cache commands to the first sub-cache and the second sub-cache.

[0024] Reference will now be made to the accompanying drawings for a detailed description of various examples. [Brief description of the drawings]

[0025] [Figure 1] FIG. 1 is a block diagram of a computer system.

[0026] [Diagram 2] FIG. 2 is a block diagram illustrating a simplified cache memory pipeline for processing a read request.

[0027] [Diagram 3]FIG. 2 is a block diagram of a cache memory pipeline with a store queue in accordance with an aspect of the present description.

[0028] [Figure 4] FIG. 2 is a block diagram illustrating a cache architecture including a victim cache.

[0029] [Diagram 5] 1 is a block diagram illustrating a cache architecture including a parallel victim cache in accordance with an aspect of the present disclosure.

[0030] [Figure 6] FIG. 2 is a block diagram illustrating a victim cache memory pipeline in accordance with an aspect of the present disclosure.

[0031] [Figure 7] 2 is a block diagram illustrating a victim cache pipeline including a write miss buffer in accordance with an aspect of the present disclosure.

[0032] [Figure 8] 1 is a block diagram of a MESI RAM in accordance with an embodiment of the present disclosure.

[0033] [Figure 9] 1 is an architectural block diagram of a cache system including a write miss buffer in accordance with an aspect of the present disclosure.

[0034] [Figure 10] 1 is a flowchart illustrating a technique for caching data in accordance with an aspect of the present description. [Figure 11] 1 is a flowchart illustrating a technique for caching data in accordance with an aspect of the present description. [Figure 12] 1 is a flowchart illustrating a technique for caching data in accordance with an aspect of the present description. [Figure 13] 1 is a flowchart illustrating a technique for caching data in accordance with an aspect of the present description. [Figure 14] 1 is a flowchart illustrating a technique for caching data in accordance with an aspect of the present description. [Figure 15] 1 is a flowchart illustrating a technique for caching data in accordance with an aspect of the present description. [Figure 16] 1 is a flowchart illustrating a technique for caching data in accordance with an aspect of the present description. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0035] 1 is a block diagram of a computer system 100. The computer system 100 includes a data cache 102, such as a level 1 (L1) data cache. The data cache 102 stores a subset of the system's data to reduce the time required to access (e.g., for reads and / or writes) the cached subset. By effectively caching the most commonly used data, the data cache 102 can significantly improve system performance.

[0036] The data cache 102 may be coupled to one or more processing resources 104 (e.g., processor cores) and to an extended memory 106. The extended memory 106 may include other levels of the memory hierarchy, such as an L2 cache, storage devices, etc. The data cache 102 may be incorporated on the same die as the processing resources 104 (e.g., an on-die cache) or may be on a separate die. In either case, the cache 102 is coupled to each processing resource 104 by one or more interfaces used to exchange data between the cache 102 and the processing resource. In this example, the cache 102 is coupled to each processing resource 104 by a scalar interface and a vector interface. In examples with multiple interfaces, if one interface is busy, the command may be processed using the other interface. For example, when a scalar read command is received by the cache via the scalar interface, the associated data may be provided to the processing resource 104 via the vector interface based on interface utilization, data size, and / or other considerations. Similarly, the cache 102 may also be coupled to the extended memory 106 by one or more interfaces. If multiple interfaces exist, the interface may be selected based on utilization, data size, and / or other considerations.

[0037] Each interface may have any suitable width. The widths of the interfaces may differ from one another, but in many examples are integer multiples of the narrowest interface. In one such example, the scalar interface is 64 bits wide, the vector interface is 512 bits wide, and the extended memory interface is 1024 bits wide.

[0038] An interface may be bidirectional or unidirectional. A bidirectional interface may include two independent unidirectional interfaces so that data can be sent and received simultaneously. In one such example, the vector interface includes two 512-bit unidirectional buses, one for receiving data and operations from the processing resources 104 and one for sending data to the processing resources 104.

[0039] The data cache 102 may include several pipelines for processing operations received through these interfaces. FIG. 2 is a block diagram illustrating a simplified cache memory pipeline 200 for processing a read request. As shown in the cache memory pipeline 200, the processor 202 sends a memory request to the cache memory 204. Although the cache memory 204 is described in the context of an L1 cache, the concepts described herein are applicable to any type of cache memory. Although not shown, in some cases, the memory request may be sent through a cache or memory controller. In this example, the cache memory pipeline includes five stages E1, E2, E3, E4, and E5. Each cache memory pipeline stage may be assigned a certain number of clock cycles to complete, and in some examples, each stage is assigned one clock cycle so that the cached data may be returned to the processor 202 after the E5 memory pipeline stage in five clock cycles. At the E1 memory pipeline stage, the memory request is received by the cache memory 204. The memory request includes a memory address of the data to be retrieved. In the E2 pipe stage, a tag random access memory (RAM) 206 is read to determine which memory addresses are currently stored in the cache memory. The tag RAM 206 stores a table that records which entries in memory 208 correspond to which memory addresses in the extended memory. The tag RAM may be a bank or part of the memory used to hold the table of memory addresses. In some cases, the cache may be an N-way associative cache where each cache set can hold N lines of memory addresses. As N increases, the number of addresses searched also increases, which increases the amount of time required to determine if the requested memory address is in the tag RAM. In the E3 memory pipeline stage, the received memory address is compared to the memory addresses read and stored from the tag RAM to determine if there is a cache hit or miss.A cache hit occurs when data associated with the requested memory address is stored in the cache, and a cache miss occurs when data associated with the requested memory address is not stored in the cache. In the E4 memory pipeline stage, a portion of memory 208 associated with the requested memory address is read, and in the E5 memory pipeline stage, the requested memory address is provided to the processor 202. The memory 208 can be any type of memory suitable for cache memory, such as dynamic random access memory (DRAM), static random access memory (SRAM), registers, etc. The pipeline stages show how the memory pipeline can be configured and therefore, certain sub-steps and features can be omitted. In a particular implementation, the stages at which a particular activity, such as a memory access, occurs may vary.

[0040] 3 is a block diagram illustrating a cache pipeline 300 supporting read-modify-write with an error-correcting code store queue in accordance with an embodiment of the present disclosure. Pipeline 300 includes a read path (including read path latches 302, tag RAM 306, memory 308, etc.) and a write path (including path latches 304, store queue 314, etc.).

[0041] For the read path, pipeline 300 includes a tag RAM 306 and a memory 308 (e.g., DRAM or other suitable memory). The cache may have any degree of associativity, and in one example, the cache is a direct-mapped cache, ensuring that each extended memory address corresponds to one entry in cache memory 308.

[0042] In some cases, the cache pipeline 300 may include support for ECC, and the memory 308 may be coupled to an error detection and correction circuit 310. In an ECC example, the memory 308 stores data in blocks along with a set of ECC syndrome bits corresponding to the blocks. When a read operation is received, the memory 308 may provide the stored data block and the corresponding ECC syndrome bits to the error detection and correction circuit 310. The error detection and correction circuit 310 may regenerate the ECC syndrome bits based on the data block read from the memory 208 and compare the regenerated ECC syndrome bits to those previously stored. Any discrepancies may indicate that the data block was read incorrectly, and the ECC syndrome bits may be used to correct the errors in the data block. The ability to detect and correct errors makes the cache suitable for mission-critical applications.

[0043] An arbitration unit 312 may be coupled to the memory 308 to arbitrate between competing accesses of the memory 308. When multiple operations attempt to access the memory 308 in the same cycle, the arbitration unit 312 may select which operation is granted access to the memory 308 according to a priority scheme. Many different priority schemes may be used. As one example of a priority scheme, arbitration prioritizes read operations over write operations because write data that is in the pipeline 300 may be used by subsequent operations, for example, via a data transfer multiplexer 318 in the store queue 314, even before it is written to the memory 308, as described in more detail below. Thus, there is minimal performance impact in allowing the write data to wait in the pipeline 300. However, as the pipeline 300 fills with write data that has not yet been written back, the priority of the write operation may increase until it has priority over competing read operations.

[0044] The read path may be parallel to the store queue 314. Because a read operation may point to data in a write operation that may not yet be completed, the pipeline 300 may include a write forwarding function that allows the read path to obtain data from the store queue 314 that has not yet been written back to the memory 308. In one example, the pipeline 300 includes a pending store address table 316 that records the addresses of operations in each stage of the store queue 314, a data forwarding multiplexer 318 to select data for forwarding from one of the stages of the store queue 314, and a store queue hit multiplexer 320 that selects between the output of the memory 308 and the store queue 314 data forwarded from the data forwarding multiplexer 318.

[0045] An example flow of a read operation through the pipeline 300 will now be described. In the first cycle, indicated by stage E1, the cache retrieves a record associated with the address of the read operation from the tag RAM 306 to determine if the data is stored in the cache's memory 308. In a direct-mapped example, the cache does not need to wait for a tag RAM comparison before requesting the data from memory 308, and therefore there is no need for the tag RAM comparison between the address of the read operation and the cached address record to extend into the second (E2) or third (E3) cycles.

[0046] In the second cycle, stage E2, if arbitration unit 312 grants, the cache may request data and ECC syndrome bits from memory 308. In this cycle, the cache may also determine whether newer data is available in store queue 314 by comparing the read address with pending store address table 316. If so, data transfer multiplexer 318 is set to transfer the appropriate data from store queue 314.

[0047] The data and ECC syndrome bits may be provided by memory 308 in the third cycle in stage E3. However, because a cache can assign multiple extended memory addresses to the same entry in its memory 308, this data may or may not correspond to the memory address specified by the read operation. Thus, in the third cycle, the cache determines whether the provided data and ECC from memory 308 correspond to the memory address in the read operation (e.g., a cache hit) based on a comparison of the tag RAM records. In the event of a cache hit, the data and ECC bits are received by error detection and correction circuitry 310, which corrects any errors in the data in the fourth cycle in stage E4.

[0048] As mentioned above, newer data that has not yet been written to memory 308 may be present in store queue 314 and may be forwarded from store queue 314 by data forward multiplexer 318. In that case, store queue hit multiplexer 320 selects the data forwarded over the corrected data from memory 308.

[0049] Either the corrected data from memory 308 or the forwarded data from store queue 314 is provided to the requesting processor in the fifth cycle in stage E5. In this manner, the exemplary cache can provide data to the processor with a full ECC check and correction in the event of a cache hit in approximately five cycles.

[0050] If the data and ECC bits are not present in memory 308 (e.g., a cache miss), the pipeline 300 may stall until the data can be retrieved from expanded memory, at which point the data may be written to memory 308 and the tag RAM 306 may be updated so that a subsequent read of the data will hit in the cache.

[0051] The cache may also support some operations that read data from the cache and modify the data before rewriting it. For example, the cache may support a read-modify-write (RMW) operation. The RMW operation reads existing data, modifies at least a portion of the data, and overwrites that portion of the data. In an ECC embodiment, the RMW operation may be performed for writes that are less than full bank width. If the write is not full bank width, performing an ECC operation on only a portion of the data being written may result in an inaccurate ECC syndrome. Therefore, the read function of RWM is used because the portion of data in the bank that is not overwritten still contributes to the ECC syndrome bits.

[0052] The RMW operations may be separated into write and read operations, and the pipeline 300 may be structured such that the read operations in the read path remain synchronized with the write operations in the store queue 314. The read and write operations remain synchronized until the read modify write merge circuit 322 overwrites at least a portion of the read data with the write data to create merged data. The merged data may be provided to an ECC generation circuit 324, which generates new ECC syndrome bits for the merged data, after which the merged data and ECC syndrome bits may be provided to the arbitration unit 312 for storage in the memory 308.

[0053] An example flow of an RMW operation through the pipeline 300 will now be described. The read portion of the operation proceeds substantially as described above in stages E1-E4, where the cache compares the address of the read operation to the record in the tag RAM 306, and the cache requests the data and ECC syndrome bits from the memory 308 and / or the store queue 314. Because the RMW operation modifies the data, in an example that tracks the MESI (modified, exclusive, shared, and invalid) state of entries in the memory 308, a cache hit that is neither modified nor exclusive may be considered a cache miss. When the data has been obtained in the proper state and any errors have been corrected, it is provided to the read modify write merge circuit 322 in cycle E4 (or in the case of a subsequent cache miss). In this same cycle, the read modify write merge circuit 322 may overwrite at least a portion of the corrected data with the write data to create merged data. The ECC generation circuit 324 generates new ECC syndrome bits for the merged data in stage E5 (or in the case of a subsequent cache miss). The merged data and ECC syndrome bits are provided to arbitration unit 312 for writing to cache memory 308 .

[0054] In some examples, sequential RMW operations pointing to the same address are received. Rather than waiting for merged data from previous RMW operations to be written to memory 308, store queue 314 may include an address comparator for write forwarding 326 that can feed back merged data to a previous stage of store queue 314 for use by a subsequent RMW operation. This is referred to as "piggybacking." Data can be fed back before or after ECC generation circuit 324. The feedback effectively merges the RMW operations so that the final RMW operation has a complete set of data and ECC syndrome bits. Thus, RMW operations earlier in time can be cancelled before they are written back to memory 308. This can avoid stalling other operations by writing obsolete data.

[0055] In some cases, memory 308 may represent an entire data cache. By way of example only, in such an embodiment, the data cache (which may be an L1 data cache) is associated with a single store queue structure 314. By way of example, the data cache may include 256 rows, each row having 1024 bits (1 Kb) per row.

[0056] In other examples, the cache may be divided into multiple independently addressable banks, with each individual bank having its own respective store queue structure 314. For example, consider an embodiment in which the data cache described above has 256 rows, each with a line width of 1024 bits, but is divided into 16 banks with 64 bits per row in a given bank. In such an embodiment, there would be 16 store queues, one for each bank of the data cache. Thus, read and write operations may be sent to the banks in parallel, with each bank arbitrating its own process in response to read and / or write operations. By allowing each bank of a multi-bank cache to operate independently, the operation of the cache is more efficient since an entire cache line is not locked up when a request is received. Rather, only the portion of the cache line that is assigned to the bank that received such a request will be locked. Of course, the cache sizes described above are merely examples, and the description is not limited to any particular cache line width, number of banks or rows, etc.

[0057] The above example is also useful for writing and / or reading vector data. For example, the vector data may be 512 bits wide. In the case of a multi-bank cache, a write request containing the vector data that hits in the cache may be processed as eight parallel writes to eight banks (e.g., 8 x 64 bits = 512 bits). Similarly, a read request to such a multi-bank cache may be implemented as eight parallel reads from the eight banks.

[0058] Another feature that may be present in contemplated embodiments of the cache system is support for in-flight forwarding and invalidation. For example, in one example, the cache is assumed to be a two-way set associative cache. In a two-way set associative implementation, each cache line in the cache may be mapped to two different addresses in a higher level of memory (e.g., an L2 cache or main system memory).

[0059] Consider the situation where a given cache line, in this example called "Line 1," is a cache line in a two-way set associative cache that maps to two different addresses in memory, called "Address A" and "Address B." Now assume that the cache receives a first request that is a partial write (e.g., a write to less than a full cache line), followed by a read request, as follows:

[0060] write(address A):data1 / / Write data 1 to the cache line corresponding to address A

[0061] read(address B) / / / / Reads the data contained in the cache line corresponding to address B

[0062] In this example, let's assume that the write request is a hit, meaning that there is a cache line in the cache that corresponds to address A, which in this example will be assumed to be line 1. In response, the cache system will begin the process of writing data 1 to line 1.

[0063] Following this, assume that the read request is a miss. In other words, line 1 could be mapped to either address A or address B in this two-way set associative cache, but in this case is currently mapped to address A. Thus, address B is not found in tag RAM 306, so a miss occurs. In response to the miss, the cache system handles the miss by attempting to retrieve the data from a higher level of memory, such as the L2 cache, and when the data, referred to in this example as "data 2," is returned, the data currently in line 1 will be evicted to store data 2. This may occur before the previous write has completed. In this case, there is no need to complete the write operation since line 1 would have been evicted anyway. Thus, the write can be invalidated before its completion, referred to as "inflight."

[0064] An atomic operation, such as an atomic compare and exchange, is a further example of a memory operation that includes a read. An atomic compare and exchange operation can provide a set of an address, a key value, and new data to write. The current data at the address is compared to the key, and if they match, the current data at the address is overwritten with the new data. Thus, in some examples, the pipeline 300 includes an atomic compare and exchange circuit 328 to perform a comparison and transfer of the new data for a write if the current data matches the key value. The atomic compare and exchange circuit 328 can be coupled in parallel with the read modify write merge circuit 322, and a function multiplexer 330 can be used to determine which output is provided to the ECC generation circuit 324.

[0065] An example flow of an atomic compare and exchange operation through pipeline 300 will now be described. The read portion of the operation proceeds substantially as described above in stages E1-E4, with the cache comparing the address of the read operation to the record in tag RAM 306, and the cache requesting data and ECC syndrome bits from memory 308 and / or store queue 314. Because the atomic compare and exchange operation may modify the data, in an example that tracks the MESI state of entries in memory 308, a cache hit that is not in either the modified or exclusive state may be considered a cache miss. When the data is obtained in the appropriate state, it is provided to atomic compare and exchange circuit 328 in stage E4 (or in the case of a subsequent cache miss). During these cycles, new data and key may be stored in write-path latch 304. During stage E4, atomic compare and exchange circuit 328 may receive the corrected read data, key, and new data. If the corrected read data matches the key, atomic compare and exchange circuit 328 provides the new data to ECC generation circuit 324. The atomic compare and exchange circuit 328 may also change the state of the new data to modified if the read data matches the key. The ECC generation circuit 324 generates new ECC syndrome bits for the new data in stage E5 (or in the event of a subsequent cache miss). The new data and ECC syndrome bits are provided to the arbitration unit 312 for writing to the cache memory 308.

[0066] The pipeline 300 may also perform write forwarding using the address comparator 326 when a sequential atomic compare and exchange operation is received, similar to that described in the context of the RMW operation.

[0067] Further examples of memory operations that read existing data include histogram operations. A histogram operation may specify a value to add to or subtract from the existing data. To support histogram operations, the pipeline 300 may include an arithmetic unit 332 coupled in parallel with the read modify write merge circuit 322 and / or the atomic compare and exchange circuit 328. The arithmetic unit 332 may support operands of any size, and in one such example, the arithmetic unit 332 supports addition and subtraction of 16-bit values ​​from a 64-bit bank. A multiplexer 330 may be used to select between the arithmetic unit 332, the read modify write merge circuit 322, and the atomic compare and exchange circuit 328.

[0068] An example flow of a histogram operation through pipeline 300 will now be described. The read portion of the operation proceeds substantially as described in stages E1-E4 above, with the cache comparing the address of the read operation to the records in tag RAM 306, and the cache requesting data and ECC syndrome bits from memory 308 and / or store queue 314. Because the histogram operation modifies data, in an example that tracks the MESI state of entries in memory 308, a cache hit that is neither in the modified nor exclusive state may be considered a cache miss. When the data is obtained in the appropriate state, it is provided to the arithmetic unit 332 in stage E4 (or in the case of a subsequent cache miss). During these cycles, a value to be added to the corrected data may be stored in write path latch 304. During stage E4, arithmetic unit 332 may receive the corrected read data and a value to be added to or subtracted from the read data. The arithmetic unit 332 performs the specified addition or subtraction and provides the new data to ECC generation circuit 324. ECC generation circuit 324 generates new ECC syndrome bits for the new data in stage E5 (or in the event of a subsequent cache miss). The new data and ECC syndrome bits are provided to arbitration unit 312 for writing to cache memory 308.

[0069] The pipeline 300 may also perform write forwarding using the address comparator 326 when a sequential histogram operation is received, similar to that described in the context of the RMW operation.

[0070] 3 shows a single pipeline 300 with a single instance of store queue 314, latches 302 and 304, error detection and correction circuitry 310, etc. However, as previously mentioned, memory 308 may be arranged to support multiple independent copies of pipeline 300. Thus, pipeline 300 may be regenerated multiple times. In one such example, entries in memory 308 are 1024-bit blocks based on the width of the extended memory interface, and memory 308 is arranged in 16 parallel banks, with each 1024-bit block including 64 bits in each of the 16 banks. In this particular example, each of the 16 banks has its own independent pipeline 300. A read or write operation from the processor is split into several bank-level operations, each provided to its respective pipeline 300 so that they may be processed simultaneously. For example, a read operation of a 512-bit vector may be split into eight 64-bit read operations and provided to the eight independent pipelines 300 to be processed in parallel. At the same time, other operations are received through the scalar interface or the vector interface of another processor and are split into operations that are provided to the remaining pipelines 300. Thus, the data cache can handle multiple independent operations simultaneously, with each operation being assigned a subset of the pipelines 300.

[0071] In some cases, cache pipeline 300 may be coupled with a victim cache. The victim cache may help improve cache miss rates, such as those due to conflicting misses. In some cases, the victim cache may have an impact on cache performance similar to increasing the number of N-way associatives (e.g., cache associativity). This benefit may be more evident when a victim cache is added to a direct-mapped cache, since direct-mapped caches often have the highest conflict miss rates. The addition of a victim cache may help improve the overall cache hit rate.

[0072] 4 is a block diagram illustrating a cache architecture 400 including a victim cache, where the cache architecture 400 includes a main cache 404 coupled to a victim cache 402 that is after the main cache 404. When a line of data is evicted from the main cache 404, rather than moving the line of data to the next level cache (e.g., L2), the line of data is moved to the victim cache 402 and held there until there is a reason to evict it, such as due to capacity or other reasons. In such a cache architecture 400, in the event of a cache miss from the main cache 404, the victim cache 402 can process the miss and return the line to the processor 414, reducing the overall latency experienced for a read miss.

[0073] As an example, assume that a processor 414 attempts to access address A in the main cache 404 and victim cache 402, causing a cache miss. The main cache 404 may then evict address B from the main cache 404 and create a victim cache (address B) line in the victim cache 402. The read miss for address A then goes 406 to a higher level of memory 412 to be serviced, such as an L2 cache, another cache, and / or other memory. Once address A is accessed, the contents of address A may be returned 410 and stored in the main cache 404.

[0074] When a subsequent access attempt to address B is issued, the main cache 404 is checked to see if address B is cached, resulting in a cache miss. The victim cache 402 is then checked 408, returning a hit if address B was stored in the victim cache 402 after being evicted from the main cache 404. Address B may then be restored to the main cache 404 and consequently returned to the processor 414. Read latency in such a system is faster than if the address had to be fetched from a higher level of memory 414 (e.g., an L2 cache, main memory, etc.), but is still greater than the latency when there is a cache hit in the main cache 404.

[0075] To help address the latency experienced in cache architectures that place a victim cache behind a main cache, in some cases the victim cache can be placed in parallel with the main cache. FIG. 5 is a block diagram illustrating a cache architecture 500 including a parallel victim cache in accordance with an embodiment of the present disclosure. The cache architecture 500 can be thought of as having multiple sub-caches in parallel. Each of the main cache 502 and the victim cache 504 can have their own independent associativity, and the overall cache system 500 can have the appearance of a hybrid cache system. In some cases, either the main cache 502 or the victim cache 504 can be n-way associative and the other cache can be fully associative. In this example, the main cache 502 can be a direct-mapped (1-way associative) cache and the victim cache 504 can be fully associative.

[0076] In this example, if the processor 514 issues a read to address A that misses in the main cache 502, the miss request goes to the higher level cache 512 for processing and the victim line, now address B, is moved to the victim cache 504. Now assume that the processor 514 wants to read address B. In this example, the address of the read is checked against both the main cache 502 and the victim cache 504 in parallel. This results in a read miss in the main cache 504 but a hit in the victim cache 502. The read result for address B can then be returned directly from the victim cache 504 to the processor 514. Because both caches are checked in parallel, the read latency remains the same as if the read request had been a hit in the main cache 502. The overall effect of having a victim cache in parallel to the main cache is to get the benefit of reduced cache miss rates without impacting the latency of subsequent CPU accesses that hit the victim cache.

[0077] FIG. 6 is a block diagram illustrating a victim cache memory pipeline 600 according to an embodiment of the present disclosure. As previously described, the victim cache may be a fully associative cache, meaning that there is no mapping address and cache line. Rather, any address may be stored in any cache line of the victim cache. Thus, for an address received in block 602 in the E1 stage, the address received in the E2 stage is checked against the addresses stored in each location in the victim cache tag RAM 604. In some cases, these locations in the victim cache tag RAM 604 correspond to lines of the victim cache 606. For example, if address A is received in block 602, address A is compared against the addresses in the victim cache tag RAM 604 to see if there is a match. For example, if location 5 in the victim cache tag RAM 604 corresponds to address A, then the data corresponding to address A is stored at address 5 in the victim cache 606. This data is ultimately returned to the processor in block 608.

[0078] When a victim cache operates in parallel with a main cache, it may be desirable for the victim cache to support certain features of the main cache, such as ECC and RMW operations. In some cases, the victim cache may also include a store queue 610 structure to help support RMW and ECC operations, in a manner similar to the store queue 314 described in connection with FIG.

[0079] In some cases, a cache may include a write miss buffer. A write miss can occur when a memory write is issued to a cache for a memory address that is not in the cache. A memory write may be an atomic operation, and the processor that issued the memory write may stall until a memory write completion message is returned to the processor. Rather than stalling the processor until the write to the higher level memory is completed, the cache may store the memory write in a write miss buffer and return an indication that the memory write is complete. The write miss buffer then outputs (e.g., drains) the memory write to the target memory address. Once the memory write output to the target memory address is complete, the memory write is removed from the write miss buffer. To output a memory write, the write miss buffer may contain three pieces of information for each memory write: the memory address for the write, the corresponding data, and a byte enable (byten) mask for the memory write. Typically, the byte enable logic or mask defines the portion of the memory line to be written to. Often, the write miss buffer is implemented using dedicated buffer circuitry as a first-in-first-out (FIFO) buffer. However, FIFO write miss buffers are configured to drain more or less continuously to higher levels of memory and often do not support features such as write merging. In some cases, write miss buffers may be allocated in a cache system using a victim cache.

[0080] FIG. 7 is a block diagram illustrating a victim cache pipeline 700 including a write miss buffer in accordance with aspects of the present description. As previously described, the write miss buffer may store a memory address for a write, data to be written, and byten logic. In this example victim cache pipeline 700, the memory address for the write miss buffer entry may be stored in the victim cache tag RAM 704, and the corresponding data may be stored in the victim cache RAM 706. A byte enable memory 702 may also be added to the victim cache to store byten logic associated with the write miss buffer line. In some cases, the MESI RAM 732 may be modified to include an additional bit indicating a line type 708 associated with an entry in the victim cache RAM 706. The line type 708 indicates whether a particular line of the victim cache RAM 706 is a cache line or a write miss buffer line. In some cases, the line type 708 may be added to another memory, such as the victim cache tag RAM 704, rather than the MESI RAM 718.

[0081] The victim cache system may also be configured as a write miss buffer by adding control logic in the read and write miss state machines to handle allocation of write miss entries within the victim cache, as described in connection with Figure 6, for example, and logic to support handling of various address hazards, such as reads to the same line as a write miss entry within the victim cache (selective write miss flushing), and logic to support resolution of same address loads / stores in the victim cache data path. A storage queue 710 structure may also be provided to enable support for RMW and ECC support for write misses. In some cases, the storage queue 710 may be used to enable support for RMW and ECC support for write miss operations as well as cache operations.

[0082] As an example of implementing a write miss buffer operation in a cache, when a write is received at block 712, the address of the write is checked against the memory addresses stored in each location in the victim cache tag RAM 704. A write miss occurs when the address of the write is not found in the victim cache tag RAM 704. When operating as a write miss cache, a determination is made where in the victim cache to store the write miss. In some cases, this determination may be made based on an entry in the victim cache tag RAM 704. If there is a free location in the victim cache tag RAM 704, the address of the write miss is stored in the victim cache tag RAM 704 at the free location. If there is no free location, the line may be evicted based on an eviction scheme to allocate write miss buffer space. Otherwise, the line may have previously been used as a write miss buffer or a cache line. The line type 708 corresponding to the location in the victim cache tag RAM 704 of the write miss may be updated to indicate that the location is being used as a write miss buffer. For example, a 0 in line type 708 may indicate that the corresponding line is a cache entry, and a 1 in line type 708 may indicate that the corresponding line is a write miss buffer entry. In some cases, line type 708 may be stored in another memory location, such as MESI RAM 732, or in a dedicated memory space, such as a set of registers. Write miss data is stored in a line of victim cache RAM 706 that corresponds to the victim cache tag RAM 704 being used. Byte enable logic may be stored in a corresponding slot of byte enable memory 702. In some cases, byte enable memory 702 may include bits that indicate which locations of byte enable memory 702 are valid. The line type bits help allow write miss entries to be stored in a line of victim cache RAM 706 without having to dedicate a portion of victim cache RAM 706 to the write buffer.

[0083] According to aspects of the present description, victim cache eviction logic, for example in eviction controller 714, may be updated to handle write miss entries stored in the victim cache to prioritize eviction of write miss entries in favor of store cache entries. Also, the control logic for the read and write state machines of victim cache controller 734 may be configured to determine that an incoming read request is likely to hit a cache line of the victim cache configured to store a write miss. In such a case, victim cache controller 734 may be configured to treat the read hit like a read miss and send the read miss to the higher level memory after evicting the stored write miss command to the higher level memory. Also, cache systems are often configured to stall on misses, but write miss buffers often do not stall the processor because the processor buffers the write miss. To help address this discrepancy, victim cache controller 734 may be configured to allocate write miss entries to the victim cache without stalling the CPU by speculatively reading the incoming write data so that the data can be stored directly in the victim cache even on a write miss without stalling the victim cache.

[0084] In some cases, by placing write misses in the cache system, the write misses may remain cached until there is a requirement to evict them to a higher level of memory. In some cases, write misses stored in a victim cache may remain in the cache system until a defined condition is met, a fence operation is required, or an address / hardware conflict exists that requires the particular write miss entry to be evicted.

[0085] Maintaining the write miss buffer until an explicit fence operation is requested may be problematic if no fence operation occurs at the end of the operation, and any write misses stored in the victim cache may become stuck in the victim cache. Also, there may be latency issues from the fence operation, since flushing out (e.g., all eviction) of the write miss buffer store in response to a fence operation alone may cause delays as the cache must wait for an acknowledgment to return after draining the stored write misses to the appropriate memory. In some cases, an automatic flush or drain of the write miss entries stored in the victim cache may be provided. An automatic flush may be implemented to aid in draining the write miss entries from the victim cache while reducing potential latency that may be incurred in the drain process. In some cases, the eviction controller 714 may monitor activity on the processor interface. If the eviction controller 714 detects idle activity on the processor interface, the eviction controller 714 proceeds to begin draining the write miss entries from the victim cache. For example, if the eviction controller 714 detects that the processor has not issued any commands for N clock cycles, the eviction controller 714 may internally initiate an auto-flush process to begin draining stores cached within the victim cache. In some cases, N may be determined in advance. In other cases, N may be configurable. In some cases, the auto-flush process may go through (e.g., examine in order) the VTagRAM looking for write miss entries and flushing entries corresponding to the write miss entries. In other cases, the auto-flush process may include logic to flush entries based on a FIFO, least recently used (LRU), random, or other.

[0086] In an automatic flush of a write miss entry, the eviction controller 714 may send an eviction trigger request to the victim cache controller 734 for the selected write buffer cache line. The victim cache controller 734 checks the store queue to see if there are any entries in the store queue that correspond to the write buffer cache to be flushed. If there are corresponding entries in the store queue, the victim cache controller 734 may wait for the store queue to complete. Once the store queue is empty, the victim cache controller 734 may evict the selected cache line. The victim cache controller 734 sets up the creation of store miss packets to be sent to a higher level cache or other memory. These store miss packets may include the corresponding memory address stored in the victim cache tag RAM 704, the byte enable logic in the byte enable memory 702, and the data in the victim cache RAM 706. The victim cache may then send the store miss packets to, for example, a cache controller of a higher level cache or other memory. When flushing a write miss entry, a write miss packet may be sent to the other memory to invalidate the corresponding entries in the victim cache RAM 706, the victim cache tag RAM 704, and the byte enable memory 702. The write miss packet may be temporarily placed in the drain buffer 716 until the write miss packet is accepted (e.g., acknowledged) by the other memory. Once the write miss buffer cache line is invalidated, the eviction controller 714 may select the next write miss buffer cache line for eviction and proceed to evict the next write miss buffer cache line. This automatic flush operation may then be cancelled if activity is detected on the processor interface.By doing so, the victim cache can avoid taking advantage of idle periods to impact processor performance by attempting to drain write miss buffer entries when there is activity on the interface.

[0087] In some cases, write misses stored in a victim cache may be evicted based on the state of the write miss line that stores the particular write miss, rather than in a FIFO, LRU, random, or other manner based on the order in which the cache lines are allocated. When a cache is configured to merge data in the cache, a cache write from a processor to a memory line does not imply that the processor needs to read from other portions of the memory line. Furthermore, if a processor is writing out a large portion of a memory line, such as half a memory line or an entire memory line, the processor is less likely to need to access that portion of the memory line again (e.g., to merge additional data) than if the processor is writing out only a small portion of the memory line. Because a processor is less likely to need to access a given write miss cache line after writing out a half or full write miss cache line, the write miss cache line may be evicted with less potential impact to performance. Thus, a full or half-full cache line may be evicted once the write miss cache line is fully written or half written and a write is initiated at the next entry in the victim cache on another write miss cache line. This helps address cases where a processor is issuing a stream of cache write misses that are collectively larger than the victim cache. Aggressively evicting full or half-full write miss cache lines also helps avoid performance problems that can occur when multiple write miss items stored in the victim cache are flushed all at once due to an end-of-operation fence operation.

[0088] To help support removal of full or half-full write miss cache lines, byte enable memory 702 may include two status bits: half-full line status bit 718 and full line status bit 720. Each line of byte enable memory 702 corresponds to a cache line in victim cache RAM 706, and each line of byte enable memory 702 may include half-full line status bit 718 and full line status bit 720. These status bits may be updated with each write cycle in which a bit is written into a cache line configured as a write miss buffer, and the status bits may be calculated based on the bits already stored in the corresponding line of victim cache RAM 706 as well as the bits written to victim cache RAM 706 in a write cycle. In some cases, this update may be performed for each cache line of byte enable memory 702 for each cycle, or the update may be omitted if there is no write cycle. As previously mentioned, each line of byte enable memory 702 may include a bit mask indicating which locations (e.g., bytes) of byte enable memory 702 are valid (e.g., written to). Determining which lines are full or half-full can be performed using an XOR over corresponding portions of the bit mask. A half-full line status bit 718 may be set when half of a given cache line is written, either to the least significant bits or to the most significant bits. Similarly, a full line status bit 720 may be set when an entire cache line is written. The cache lines may then be stepped through (e.g., examined in sequence) to determine which addresses have full or half-full cache lines to return. In some cases, addresses corresponding to full cache lines are selected first, and addresses corresponding to half-full cache lines are returned if there are no full cache lines. If multiple cache lines are full (or half-full if there are no full cache lines), the first cache line found to be full (or half-full) when stepping through the cache lines may be selected.If there are no full or half-full cache lines, the write miss cache line may be selected based on FIFO, LRU, or other logic that may be used to determine which cache line to select when multiple lines are available.

[0089] Eviction of a write miss entry may operate similarly to an auto-flush, except that the store queue is not checked to see if there is an entry corresponding to the full or half-full write miss cache line being evicted, because this operation is initiated by a read or write miss and is performed after the line is written. When a full or half-full write miss cache line is selected for eviction, the eviction controller 714 indicates to the victim cache controller 734 to evict the selected cache line. The victim cache controller 734 sets up the creation of store miss packets to be sent to a higher level cache or other memory. These store miss packets may include the corresponding memory address stored in the victim cache tag RAM 704, the byte enable logic in the byte enable memory 702, and the data in the victim cache RAM 706. The store miss packets may be sent, for example, to a cache controller of the higher level cache or other memory to invalidate the corresponding entries in the victim cache RAM 706, the victim cache tag RAM 704, and the byte enable memory 702. The store miss packet may be temporarily placed in the drain buffer 716 until the store miss packet is accepted (eg, acknowledged) by other memories.

[0090] When a write miss cache line is invalidated, the address of the cache line may be sent to the replacement policy logic 722 on each write cycle. An available cache line address may be provided in the mux 724 in the replacement address lines 726. The address generation lines 728 may include the address allocated to the received write command. If the hit / miss logic 730 determines that the address of the received write command is a hit, the address is already stored in the line of the victim cache, and the data from the write command is merged into the line. If the hit / miss logic 730 determines that the address of the received write command is a miss, the address from the replacement address lines 726 may be used to write the write miss command to the victim cache / write miss buffer. If there is no empty cache line in the victim cache / write miss buffer to allocate the write miss, an eviction process may be triggered. In the eviction process, the aggregation controller may detect that a write miss has been received that needs to be stored in the victim cache. The aggregation controller may instruct the victim cache controller 734 to ensure that there is an available cache line. This cache line may be based on a location provided by either replacement address 726 or address generation 728. If there is already a write miss stored in the identified location, the write miss may be evicted.

[0091] FIG. 8 is a block diagram of a MESI RAM 800 according to an embodiment of the present disclosure. The MESI RAM 800 may be a memory (e.g., SRAM) or a set of registers (e.g., a register file) used to track the MESI status of a corresponding cache line. As an example, the victim cache may track the MESI status in MESI status bits 802 in the MESI RAM 800 for a cache entry as part of the write data. In some cases, the MESI RAM 800 includes a line corresponding to each line of the corresponding cache, here the victim cache. The main cache may include a corresponding MESI RAM. In some cases, a single MESI RAM may be shared by both the main cache and the victim cache. The MESI RAM 800 may have a set of bits to track the MESI status of each cache line stored in the victim cache. In some cases, the MESI RAM 800 may be expanded with additional bits to track other states of the cache lines in the victim cache. The MESI RAM 800 may be expanded to track additional states by including additional columns for the additional states. In this example, the MESI RAM is extended to include status bits within bit fields to track for each cache line the privilege level 804, the red tag 806, the blue tag 808, whether the line is valid 810, and whether the line is a write miss buffer or victim cache line 812. Note that while shown as part of the MESI RAM, the status bits may be located in other memories in other embodiments, such as the tag RAM 704, or in separate memories entirely. The MESI RAM may be configured to track additional states not shown here.

[0092] In some cases, it may be useful to flush all write miss buffer entries of a certain type stored in the victim cache. As described below, entries in the write miss buffer may be associated with a "color" tag. This color tag may be represented by one or more bits, such that when the bit is set for the write miss buffer entry, the color associated with the write miss buffer entry may be "blue," and when the bit is not set or another bit is set, the write miss buffer entry may be "red." Tagging helps enable a particular write miss buffer entry to be associated with a particular process executing on the processor, while other write miss buffer entries may be associated with another process executing on the processor. In some cases, a processor may wish to flush all write miss buffer entries associated with a particular process (e.g., a selective fencing operation) but not flush write miss buffer entries associated with another process.

[0093] To perform a selective fence operation, the processor may assert a drain signal. With the asserted drain signal, the processor may provide an indication that a particular tag should be prioritized for draining either red or blue tags. Returning to FIG. 7, the drain signal is passed to the eviction controller 714. The eviction controller 714 may check the availability of a higher level cache or memory to see if it is busy. If the higher level cache or memory is unavailable, the eviction controller 714 may stall the processor. If the higher level cache or memory is available, the eviction controller 714 may send an eviction trigger request to the victim cache controller 734 indicating the priority tag. The victim cache controller 734 may then check the store queue to see if there are any outstanding entries in the store queue for any bank of the victim cache RAM 706. The victim cache controller 734 may also indicate to the store queue 710 to increase the priority of draining the store queue. For example, if there is data in the store queue that is not yet stored in the victim cache, the eviction controller 714 may wait for the store queue 710 to complete. Once the store queue 710 is empty, the eviction controller 714 indicates to the victim cache controller to evict the selected cache line. The victim cache controller 734 sets up the creation of store miss packets to be sent to a higher level cache or other memory. These store miss packets may include the corresponding memory address stored in the victim cache tag RAM 704, the byte enable logic in the byte enable memory 702, and the data in the victim cache RAM 706. The victim cache can then send the store miss packets to, for example, a cache controller of a higher level cache or other memory.When flushing a write miss entry, a write miss packet may be sent to the other memory and the corresponding entries in the victim cache RAM 706, victim cache tag RAM 704, and byte enable memory 702 may be invalidated. The write miss packet may be temporarily placed in the drain buffer 716 until the write miss packet is accepted (e.g., acknowledged) by the other memory. This flushing continues until the processor stops asserting the drain signal. If the processor stops asserting the drain signal before all write miss buffer entries of the indicated color have been drained, the draining of the write miss buffer will stop no matter where the victim cache is in the draining process when the drain signal stops asserting. Once all write miss buffer entries of the indicated color tag have been drained, an idle signal is asserted back to the processor. If the processor continues to assert the drain signal, other write miss buffer entries associated with other color tags may be drained.

[0094] Placing write misses in the cache system helps give the write misses an opportunity to merge additional write misses with those already in the cache system. Because write misses stay in the cache longer, the cache has an opportunity to merge any future write misses with those already in the cache system, and therefore write miss traffic to higher levels of memory is reduced. Reducing write misses sent to higher levels of memory can reduce pressure on those memories and help improve overall performance.

[0095] Write merging may occur when the processor issues a second store or write command to a particular address in block 712. If the victim cache is fully associative, the address of the second write may be checked by the hit / miss logic 730 against the set of memory addresses stored at each location in the victim cache tag RAM 704. In parallel, in the case of a write miss, the replacement policy 722 logic determines the location within the victim cache where the write transaction may be allocated. Generally, when a write miss is stored in the victim cache, the write miss is allocated to an entire cache line even if the data in the write miss does not require an entire cache line. Thus, a set of memory addresses may be associated with each write miss stored in the victim cache, including the memory address in the write miss as well as the set of memory addresses either before, after, or both before and after the memory address in the write miss. If the address of the second write is determined to be within the set of memory addresses associated with the write miss stored in the victim cache, a cache hit is detected and the hit / miss logic returns the location in the victim cache where the write miss is currently stored. In the E3 pipe stage, the color type and privilege level associated with the second write are merged, e.g., by victim cache controller 734, with the currently stored color type and privilege level, and MESI RAM 732 is updated. In some cases, merging the privilege levels may be performed in conjunction with a privilege merge table 736. The data of the second write is also merged, e.g., by victim cache controller 734, with the corresponding line of victim cache RAM 706 and the corresponding entry of byte enable memory 702, which have been updated based on the byte enable logic associated with the second write. In some cases, store queue 710 may also include write merging functionality.For example, when consecutive writes are issued to the same address, the store queue 710 may merge them internally, helping to minimize the number of writes issued to the victim cache RAM 706.

[0096] In some cases, write merging may be performed across privilege levels. Privilege level merging may be performed when performing a write merge. For example, a first write miss stored in the victim cache may be associated with a first privilege level. A second write associated with a second privilege level may be merged with the stored first write miss. To perform the merge, the privilege levels should also be merged. In some cases, privilege levels may be merged by merging a privilege level with a lower privilege level. For example, in one embodiment, a write operation may be associated with a two-part privilege level, such as root / guest-user / supervisor. A first write miss may be received with a privilege level of root-user. This first write miss may be written to a write miss buffer in the victim cache. A second write with a privilege level of guest-supervisor may be received, and the second write is directed to an address within the set of addresses associated with the first write miss. When merging the privilege levels of two writes, the lower privilege level may be used, resulting in a merged privilege level of guest-user. In some cases, the merging of privilege levels may operate in the same manner as when merging is performed for multiple data paths. In some cases, the merging of privilege levels may be encoded in a privilege merge table 736 that indicates how different privilege levels may be merged. In some cases, the privilege merge table 736 may be predefined. An example of a predefined privilege merge table 736 is shown in Table 1. In some cases, the privilege merge table 736 may be configurable. TIFF2024170552000002.tif131153

[0097] In some cases, write merging may be performed on color tags. For example, a first write miss stored in the victim cache may be associated with a first color tag, such as red. With reference to FIG. 8, the first write miss may be associated with an entry in MESI RAM 800 with a bit set in bit field red tag 806. A second write associated with a second color tag may be merged with the stored first write miss. To perform the merge, the color tags should also be merged. In some cases, color tags may be merged by combining the color tags of the writes. For example, if both writes are tagged red, the merged write remains tagged red. Similarly, if both writes are tagged blue, the merged write will be tagged blue. If one write is tagged red and the other write is tagged blue, the merged write will be tagged both red and blue. Thus, if a second write to be merged is associated with a blue tag, the merged write may have a bit set in bit field red tag 806 and a bit set in bit field blue tag 808. In some cases, if a drain operation is then performed on, for example, the blue tag, the merged write will be drained. Similarly, if a drain operation is performed on the red tag, the merged write will also be drained because it is tagged as both red and blue.

[0098] FIG. 9 is an architectural block diagram of a cache system 900 including a write miss buffer in accordance with aspects of the present description. As shown, a cache 902 may receive cache requests from a processor 904 via a processor interface 906. In some cases, the cache 902 may be configured to handle either scalar or vector data, or both. The cache 902 is logically divided into parallel sub-caches, including a main cache 908 and a victim cache 910. Although a single main cache 908 and victim cache 910 are shown, certain embodiments may include multiple main cache 908 and victim cache 910 pairs. In some cases, there may be a different number of main caches 908 and victim caches 910. In association with the main cache 908, a main cache tag RAM access controller 912 accesses a main cache tag RAM 914 and checks against a memory address included in a cache request to determine if the memory address is stored in the main cache 908. A main cache controller 916 directs and handles appropriate allocation, eviction, arbitration, merging, etc., and reads / writes into the main cache memory 918. A main cache store queue structure 920 provides functionality such as RMW, ECC, write merging, etc., as described in connection with FIG.

[0099] The overall architecture of the victim cache 910 is similar to that of the main cache 908. For example, for an incoming memory request, a victim cache tag RAM access controller 922 accesses a victim cache tag RAM 924 and checks against the memory address included in the cache request to determine if the memory address is stored in the victim cache 910. A victim cache controller 926 similarly directs, processes, and reads / writes appropriate allocation, eviction, arbitration, merging, etc. into the victim cache memory 928. A victim cache store queue 930 provides RMW, ECC, and other features as described in connection with FIG. 3. A victim cache logic 932 helps coordinate operations between the victim cache 910 and the main cache 908. Although the victim cache logic 932 is shown separately, the victim cache logic 932 may be integrated into or part of other elements, such as the victim cache controller 926. In some cases, the victim cache 910 includes certain elements that help the victim cache 910 support write miss buffer functionality. For example, the auto-flush logic 934 may monitor the processor interface 906 and may direct a portion of the victim cache memory 928 allocated for write miss buffering to be drained to higher levels of cache and memory, e.g., via one or more memory interfaces 936. As another example, the MESI RAM 938 or victim cache tag RAM may be configured to include one or more bit fields for storing state information regarding write miss buffer entries stored in the victim cache 910.

[0100] In some cases, the victim cache and the main cache are configured as parallel caches that appear as a single cache to the processor, but may include multiple data paths. Each data path is configured to handle certain commands in parallel with the other data paths. For example, the first data path 940 may handle read commands to the main cache, while the second data path 942 handles write misses to the victim cache. In one embodiment with two data paths for the victim cache, there may be four combinations of cache commands for the first data path 940 and the second data path 942: read / read, read / write, write / read, and write / write. Additionally, each command combination may result in a cache hit / hit, hit / miss, miss / hit, or miss / miss. Additionally, the two commands may be addressed to the same memory address, potentially with varying privilege levels and color tags. In some cases, to facilitate control of the parallel caches, an aggregation controller 944 may help coordinate the handling of read and write requests as between the main cache 908 and the victim cache 910. In some cases, the aggregation controller 944 may be configured to handle coordination between the main cache 908 and the victim cache 910, as well as handoff tasks of the main cache 908 and the victim cache 910 to the main cache controller 916 and the victim cache controller 926, respectively. The aggregation controller 944 may also detect and handle potential conflicts. For example, when a read request is received from a processor, the aggregation controller 944 may check the main cache 908 and the victim cache 910 to determine that the addressed memory location of the read request is not stored in either the main cache 908 or the victim cache 910, and thus is a read miss. The aggregation controller 944 may also check the victim cache 910 to determine that the addressed memory location is not stored in the victim cache 910 or has been flushed from the victim cache 910 as a write miss.If the addressed memory location is stored in the victim cache 910 as a write miss, the aggregation controller 944 may stall the read request to flush the addressed memory location. The aggregation controller 944 may then issue a request to a higher level cache or memory for the addressed memory location.

[0101] In some cases, if a read or write request is a hit in the main cache 908, the victim cache 910 result may be ignored. When the main cache 908 is configured as a one-way associative cache, cache request conflicts are straightforward, as are multiple data paths. Cache request conflicts from multiple data paths may be an issue in the victim cache 910, which is fully associative and can store write miss entries as well as cache entries. Cache request conflicts for two data paths may be handled as described in the examples below. In particular, in the examples below, cache operations are described in the context of specific data paths. However, these examples are directed to specific combinations of cache operations, and it does not matter which data path a particular cache operation is on.

[0102] In a first example, there is a cache read miss for the first data path that includes two different memory addresses, and a cache write hit for the second data path. If the victim cache 910 is fully associative, the cache request may proceed to any location in the victim cache 910. Referring to FIG. 7, the address generation 728 for a location in the victim cache occurs in the E2 pipe stage along with the address lookup in the victim cache tag RAM 704, so the address generation 728 for a location in the victim cache is performed before it is known whether the address of the cache request is a hit or a miss. When the aggregation controller 944 determines that there is a read miss on the main cache 908, a request is issued to a higher level cache or memory to obtain the memory address of the read request. If the main cache 908 is one-way associative, the memory address of the read request of the first data path maps to a single location in the main cache 908. If there is already cached data in the single location, the already cached data is evicted from the main cache 908 to the victim cache 910 to a pre-generated location in the victim cache 910. If this pre-generated location is the same as the location where the second data path cache write is a hit, a conflict occurs. This conflict may be detected by aggregation controller 944. As described above, address generation for a location in victim cache 910 occurs before it is known whether the address of the cache request is a hit or a miss, and thus there is an address generated for a second location in victim cache 910 for the second data path cache write before the cache write is determined to be a hit. Based on the detection of the conflict, this second location in the victim cache may be used to store data that is evicted from main cache 908 due to a read miss.

[0103] In another example, there may be a cache read miss for the first data path and a cache write hit for the second data path, similar to the first example, but in this example there is also a cache read miss in the main cache and a cache write hit in the main cache. In some cases, the main cache is a one-way associative cache (e.g., a direct-mapped cache), where a particular memory address is mapped to a particular location in the main cache. In this example with a direct-mapped cache, the cache read and the cache write are mapped to the same location in the main cache. In this example, the read miss causes a request to be issued to a higher level cache or memory to obtain the memory address of the read request, and the already cached data is evicted from the main cache 908 to the victim cache 910, to a pre-generated location in the victim cache 910, here location A. In this example, the cache write of the second data path hits the same location in the main cache that is evicted. One possible solution to such a conflict is to directly load the requested read miss from the higher level cache or memory to the victim cache at another location. Another solution to the contention is for the aggregation controller 944 to stall read misses so that already cached data is not evicted to the victim cache 910 after the second data path cache write to location A in the main cache completes and until location A has been evicted to the victim cache. In some cases, stalls can occur while waiting for memory writes and evictions to complete.

[0104] As another example, a first cache write may be received on a first data path for the victim cache 910, and a second cache write may also be received on a second data path for the victim cache 910. If the first cache write and the second cache write are addressed to different memory addresses, then both cache writes may proceed in parallel to the victim cache 910. If the first cache write and the second cache write are both addressed to the same memory address and are both cache misses, then the victim cache controller 926 allocates a single location in the victim cache write miss memory 928 and merges the first cache write and the second cache write into the victim cache store queue 930. The merged data may then be written to the victim cache write miss memory 928 along with the merged byte enable, privilege, and color tag information. If the first cache write and the second cache write are both addressed to the same memory address and are both cache hits, then both the first cache write and the second cache write are merged into the cache at the hit location.

[0105] As another example, a cache read may be received on a first data path for the victim cache 910, and a cache write may be received on a second data path for the victim cache 910. If the cache read is a hit and the cache write is a hit for different locations in the victim cache 910, the cache read and cache write proceed in parallel without contention. If the cache read is a hit and the cache write is a miss for different locations in the victim cache 910, the cache read and cache write also proceed in parallel without contention. If the cache read is a miss and the cache write is a hit for different locations in the victim cache 910, the cache read may use an address generated for a location in the victim cache 910 for the cache write, as described above. If the cache read is a miss and the cache write is a miss for different locations in the victim cache 910, the cache read and cache write both use an address generated for a location in the victim cache 910.

[0106] In another example, a cache read may be received on a first data path for the main cache 908 and a cache write may be received on a second data path for the main cache 908. In some cases, the cache read may be a hit for a location (e.g., a cache line or slot) in the main cache 908. The cache write may also be a hit for the same location in the main cache 908. In such cases, the cache read and the cache write may proceed in parallel without contention because the cache read may be performed relatively quickly and may complete before the cache write needs to access the main cache location as it progresses through the store queue. In other cases, the cache read may be a hit for a location in the main cache 908. The cache write may be a miss for the same location in the main cache 908. In such cases, the cache commands typically proceed in parallel because the cache read may complete before the cache write needs to access the cache location. In other cases, the cache read may be a miss for a location in the main cache 908. The cache write may be a hit for the same location in the main cache 910. In such a case, similar to before, the cache read may be stalled after the second data path cache write to a location in main cache 908 completes, until it is evicted to victim cache 910. The cache read then proceeds to read the set of addresses from a higher level cache or memory into main cache 908. In another case, the cache read may be a miss for a first location in main cache 908. The cache write may also be a miss for the same location in main cache 908. In such a case, the cache read and cache write may proceed in parallel without contention.

[0107] In another example, a cache read may be received on a first data path for the victim cache 910 and a cache write may be received on a second data path for the victim cache 910. In some cases, the cache read may be a hit for an address stored in the victim cache 910. The cache write may also be a hit for the same address stored in the victim cache 910. In such a case, the cache read may proceed first and the cache write may be stalled until after the cache read is completed. Alternatively, the order of the cache write and cache read may be based on the data path on which the cache write and cache read are received, with the cache command arriving on the lower (or higher) numbered data path completing before the other cache command. In some cases, the cache read may be a miss for an address stored in the victim cache 910. The cache write may also be a miss for the same address stored in the victim cache 910. In such a case, the cache write command may be forwarded to a higher level cache or memory, and then the cache read may obtain the data from the higher level cache or memory after the cache write command for storage in the victim cache 910 is completed.

[0108] In another example, a first cache read may be received on a first data path for the victim cache 910, and a second cache read may be received on a second data path for the victim cache 910. If the first cache read and the second cache read are for different memory addresses, there is no contention for either a hit or a miss. In some cases, the first cache read may be a miss for a first address of the set of addresses. The second cache read may also be a miss for a second address of the same set of addresses. If the first cache read and the second cache read have different priority levels, a higher level cache or memory is accessed based on the higher level of the different priority levels. Otherwise, a higher level cache or memory is accessed and a set of memory addresses is obtained for storage in the victim cache 910. If the first cache read and the second cache read are for the same address, they are treated equally.

[0109] FIG. 10 is a flow chart illustrating a technique 1000 for caching data according to aspects of the present description. At block 1002, a caching system receives a write memory request for a memory address. For example, a caching system, such as an L1 cache, may receive the write request from a processor via a processor interface. At block 1004, a first sub-cache of the caching system determines that the memory address is not cached in the first sub-cache. For example, the caching system may include two parallel caches, a main cache and a victim cache. The memory address of the cache request may be checked against both the main cache and the victim cache in parallel. When a write request is received for a memory address that is not included in the caching system, a write miss occurs. At block 1006, a second sub-cache of the caching system determines that the memory address is not cached in the second sub-cache. At block 1008, data associated with the write memory request is stored in the second sub-cache. For example, the data of the write memory request may be stored in the victim cache. An address associated with the write memory request may also be stored in the victim cache's tag RAM, and byte enable logic associated with the write memory request may be stored in the victim cache's byte enable memory. At block 1010, an indication that the stored data corresponds to a write miss is stored in the line type bits of the second sub-cache. For example, the victim cache includes line type bits associated with a line of the victim cache. A bit may be set in the line type bits that indicates that a particular line of the victim cache contains a write miss. At block 1012, the stored data may be flushed based on the indication. For example, a stored write miss may be flushed from the victim cache to a higher level memory by checking the line type bits of the cache line and flushing the line associated with the write miss.

[0110] FIG. 11 is a flow chart illustrating a technique 1100 for caching data according to aspects of the present description. At block 1102, a caching system receives a write memory request for a memory address. For example, a caching system, such as an L1 cache, may receive the write request from a processor via a processor interface. At block 1104, a first sub-cache of the caching system determines that the memory address is not cached in the first sub-cache. For example, the caching system may include two parallel caches, a main cache and a victim cache. The memory address of the cache request may be checked against both the main cache and the victim cache in parallel. When a write request is received for a memory address that is not included in the caching system, a write miss occurs. At block 1106, a second sub-cache of the caching system determines that the memory address is not cached in the second sub-cache. At block 1108, data associated with the write memory request is stored in the second sub-cache. For example, the data of the write memory request may be stored in the victim cache. An address associated with the write memory request may also be stored in the victim cache's tag RAM, and byte enable logic associated with the write memory request may be stored in the victim cache's byte enable memory. At block 1110, an indication that the stored data corresponds to a write miss is stored in the line type bits of the second sub-cache. For example, the victim cache includes line type bits associated with the lines of the victim cache. A bit may be set in the line type bits to indicate that the particular line of the victim cache includes a write miss. At block 1112, the line of the second sub-cache that stores the write miss is evicted based on the indication that the line is completely written. For example, a bit may be calculated based on byte enable logic that indicates whether all or half of the bytes of the cache line are filled with write data.Full or half-full cache lines can be evicted from the victim cache based on the bit.

[0111] FIG. 12 is a flow chart illustrating a technique 1200 for caching data according to aspects of the present description. At block 1202, a caching system receives a write memory command for a memory address, the write memory command being associated with a first privilege level. For example, a caching system, such as an L1 cache, may receive a write request from a processor via a processor interface. At block 1204, a first sub-cache of the caching system determines that the memory address is not cached in the first sub-cache. For example, the caching system may include two parallel caches, a main cache and a victim cache. The memory address of the cache request may be checked against both the main cache and the victim cache in parallel. A write miss occurs when a write request is received for a memory address that is not included in either the main cache or the victim cache. In block 1206, a second sub-cache of the caching system determines that the memory address is not cached in the second sub-cache, and the second sub-cache is configured to store cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache in parallel with the first sub-cache. In block 1208, data associated with the write memory command is stored in the second sub-cache. In block 1210, color tag bits associated with the data are stored in the second sub-cache. For example, the color tag bits may be stored in a bit field of a memory of the second sub-cache, such as a MESI RAM. In block 1212, the stored data is evicted based on the color tag bits. For example, cache lines storing write miss data associated with a particular color tag bit may be evicted while the processor asserts a drain signal and a color tag priority indication. After all cache lines with a particular color tag bit have been drained, the caching system may assert an idle signal.If the processor continues to assert the drain signal, other cache lines storing write miss data associated with other color tags may also be evicted.

[0112] FIG. 13 is a flow chart illustrating a technique 1300 for caching data according to an aspect of the present description. At block 1302, a caching system receives a write memory command for a memory address, the write memory command being associated with a first color tag. For example, a caching system, such as an L1 cache, may receive a write request from a processor via a processor interface. The write request may include an indication of a color tag associated with the write request. At block 1304, a first sub-cache of the caching system determines that the memory address is not cached in the first sub-cache. For example, the caching system may include two parallel caches, a main cache and a victim cache. The memory address of the cache request may be checked against both the main cache and the victim cache in parallel. When a write request is received for a memory address not included in the caching system, a write miss occurs. At block 1306, a second sub-cache of the caching system determines that the memory address is not cached in the second sub-cache. At block 1308, data associated with the write memory command is stored in a cache line of the second sub-cache. For example, data of the write request may be stored in a cache line of the victim cache. Also, an address associated with the write memory request may be stored in a tag RAM of the victim cache, and byte enable logic associated with the write memory request may be stored in a byte enable memory of the victim cache. At block 1310, a first color tag is stored in the second sub-cache. For example, the color tag may be stored using two bits in a bit field of a memory of the second sub-cache, such as a MESI RAM. At block 1312, a second write memory command for the cache line is received, the write memory command being associated with the second color tag. For example, a second write request to a memory address targeting the same cache line as the first write request may be received.The second write request is associated with a second color tag. The second color tag may be the same or different from the first color tag. At block 1314, the second color tag is merged with the first color tag. For example, if the first color tag and the second color tag represent the same color, merging the two tags continues to set that color tag. If the two color tags are different, merging may set both color tags. At block 1316, the merged color tag is stored. At block 1318, the cache line may be evicted based on the merged color tag. For example, if the first color tag and the second color tag represent the same color, eviction may be based on that color tag. If the two color tags are different, eviction may be based on either color tag.

[0113] FIG. 14 is a flow chart illustrating a technique 1400 for caching data according to an aspect of the present description. At block 1402, a caching system receives a first write memory command for a memory address, the first write memory command being associated with a first privilege level. For example, a caching system, such as an L1 cache, may receive a write request from a processor via a processor interface. At block 1404, a first sub-cache of the caching system determines that the memory address is not cached in the first sub-cache. For example, the caching system may include two parallel caches, a main cache and a victim cache. The memory address of the cache request may be checked against both the main cache and the victim cache in parallel. A write miss occurs when a write request is received for a memory address that is not included in either the main cache or the victim cache. At block 1406, a second sub-cache of the caching system determines that the memory address is not cached in the second sub-cache, and the second sub-cache is configured to store cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache in parallel with the first sub-cache. At block 1408, first data associated with the first write memory command is stored in a cache line of the second sub-cache. At block 1410, a first privilege level is stored in the second sub-cache. For example, the first privilege level may comprise a two-part privilege level, such as root / guest-user / supervisor. The two-part privilege level may be stored using two bits in a bit field of a memory of the second sub-cache, such as a MESI RAM. At block 1412, a second write memory command for the cache line is received, the second write memory command being associated with a second privilege level. For example, a second write request may be received to a memory address that targets the same cache line as the first write request.The second write request is associated with a second privilege level, which may be the same or different from the first write request. At block 1414, the first privilege level is merged with the second privilege level. For example, the privilege levels may be merged based on a privilege merge table or may be merged by selecting a lower privilege level among the privilege levels to be merged. At block 1416, the merged privilege level is stored. At block 1418, the merged privilege level is output with the cache line. For example, the cache line including the merged first and second write requests may be evicted to a higher level cache or memory in a store miss packet including the merged privilege level.

[0114] FIG. 15 is a flow chart illustrating a technique 1500 for caching data according to aspects of the present description. At block 1502, a caching system receives a write memory request for a memory address. For example, a caching system, such as an L1 cache, may receive the write request from a processor via a processor interface. At block 1504, a first sub-cache of the caching system determines that the memory address is not cached in the first sub-cache. For example, the caching system may include two parallel caches, a main cache and a victim cache. The memory address of the cache request may be checked against both the main cache and the victim cache in parallel. When a write request is received for a memory address that is not included in the caching system, a write miss occurs. At block 1506, a second sub-cache of the caching system determines that the memory address is not cached in the second sub-cache. At block 1508, data associated with the write memory request is stored in the second sub-cache. For example, the data of the write memory request may be stored in the victim cache. An address associated with the write memory request may also be stored in the victim cache's tag RAM, and byte enable logic associated with the write memory request may be stored in the victim cache's byte enable memory. At block 1510, an indication that the stored data corresponds to a write miss is stored in the line type bits of the second sub-cache. For example, the victim cache includes line type bits associated with the lines of the victim cache. A bit may be set in the line type bits to indicate that a particular line of the victim cache contains a write miss.

[0115] FIG. 16 is a flow chart illustrating a technique 1600 for caching data according to an aspect of the present description. At block 1602, a caching system receives two or more cache commands. For example, a caching system, such as an L1 cache, may receive multiple cache commands via a processor interface, for example, using two or more data paths. At block 1604, a conflict exists between the two or more cache commands is determined. For example, a cache controller may determine that a cache conflict exists between two cache commands. A conflict may occur when the two cache commands cause conflicting changes to the same cache location. At block 1606, a conflict resolution is determined between the two or more received cache commands. At block 1608, the two or more cache commands are sent to a first sub-cache and a second sub-cache, where the second sub-cache is configured to store cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache in parallel with the first sub-cache.

[0116] example

[0117] Further exemplary embodiments are provided in the following sections.

[0118] Example 1 includes a caching system including a first sub-cache and a second sub-cache parallel to the first sub-cache, the second sub-cache including a set of cache lines, line type bits configured to store an indication that a corresponding cache line of the set of cache lines is configured to store write miss data, and an eviction controller configured to flush the stored write miss data based on the line type bits.

[0119] Example 2 includes the caching system of Example 1, wherein the second sub-cache further includes a tag random access memory (RAM) configured to store a memory address associated with the stored write miss data and a byte enable memory configured to store byte enable logic associated with the stored write miss data, and the eviction controller is configured to flush the stored write miss data by transmitting a write memory request to a higher level memory based on the stored memory address and the stored byte enable logic.

[0120] Example 3 includes the caching system of example 1, the caching system further including a processor interface, the eviction controller further configured to monitor activity on the processor interface and to flush the stored write miss data based on the monitored activity.

[0121] Example 4 includes the caching system of example 3, where monitoring activity on the processor interface includes detecting idle activity on the processor interface.

[0122] Example 5 includes the caching system of example 4, wherein detecting idle activity includes determining whether a memory request has been received for a predetermined number of clock cycles.

[0123] Example 6 includes the caching system of example 4, wherein the eviction controller is further configured to determine when activity resumes on the processor interface and to cancel flushing of the stored write miss data.

[0124] Example 7 includes the caching system of example 6, wherein determining that activity has resumed on the processor interface includes detecting receipt of a cache request from the processor.

[0125] Example 8 includes a method for caching data including receiving, by a caching system, a write memory request for a memory address; determining, by a first sub-cache of the caching system, that the memory address is not cached in the first sub-cache; determining, by a second sub-cache of the caching system, that the memory address is not cached in the second sub-cache; storing data associated with the write memory request in the second sub-cache; storing an indication in line type bits of the second sub-cache that the stored data corresponds to a write miss; and flushing the stored data based on the indication.

[0126] Example 9 includes the method of example 8, wherein flushing the stored data includes transmitting the write memory request to a higher level memory by the second sub-cache.

[0127] Example 10 includes the method of example 8, further including monitoring activity on the processor interface, and flushing the stored data is further based on the monitored activity.

[0128] Example 11 includes the method of example 10, in which monitoring activity on the processor interface includes detecting idle activity on the processor interface.

[0129] Example 12 includes the method of example 11, where detecting idle activity includes determining that a memory request has not been received for a predetermined number of clock cycles.

[0130] Example 13 includes the method of example 11, further including determining that activity has resumed on the processor interface and canceling the flushing of the stored write miss data.

[0131] Example 14 includes the method of example 13, wherein determining that activity has resumed on the processor interface includes detecting a cache request receipt.

[0132] Example 15 includes a device including a processor, a first sub-cache, and a second sub-cache parallel to the first sub-cache, the second sub-cache including a set of cache lines, line type bits configured to store an indication that a corresponding cache line of the set of cache lines is configured to store write miss data, and an eviction controller configured to flush the stored write miss data based on the line type bits.

[0133] Example 16 includes the device of Example 15, wherein the second sub-cache further includes a tag random access memory (RAM) configured to store a memory address associated with the stored write miss data and a byte enable memory configured to store byte enable logic associated with the stored write miss data, and the eviction controller is configured to flush the stored write miss data by transmitting a write memory request to a higher level memory based on the stored memory address and the stored enable logic.

[0134] Example 17 includes the device of example 15, wherein the caching system further includes a processor interface, and the eviction controller is further configured to monitor activity on the processor interface and to flush the stored write miss data based on the monitored activity.

[0135] Example 18 includes the device of example 17, in which monitoring activity on the processor interface includes detecting idle activity on the processor interface.

[0136] Example 19 includes the device of example 18, in which detecting idle activity includes determining whether a memory request has been received for a predetermined number of clock cycles.

[0137] Example 20 includes the device of example 18, wherein the eviction controller is further configured to determine that activity has resumed on the processor interface and to cancel the flushing of the stored write miss data.

[0138] Example 21 includes a caching system including a first sub-cache and a second sub-cache coupled in parallel to the first cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, the second sub-cache including color tag bits configured to store an indication that a corresponding cache line of the second sub-cache that stores the write miss data is associated with a color tag, and an eviction controller configured to evict cache lines of the second sub-cache that store the write miss data based on a color tag associated with the cache lines.

[0139] Example 22 includes the caching system of example 21, wherein the second sub-cache includes a bit field configured to store a state of the color tag.

[0140] Example 23 includes the caching system of example 22, where the bit field includes a bit that stores a state for each color tag.

[0141] Example 24 includes the caching system of example 23, wherein a bit field is stored in the memory that tracks modified, exclusive, shared, and invalid (MESI) states of entries in the second sub-cache.

[0142] Example 25 includes the caching system of example 24, wherein the MESI memory is configured to store an indication that the corresponding cache line of the second sub-cache stores the write miss data.

[0143] Example 26 includes the caching system of Example 21, further including a processor interface, and the eviction controller is further configured to receive a color tag priority indication on the processor interface and evict cache lines of the second sub-cache that store the write miss data based on the received color tag priority indication.

[0144] Example 27 includes the caching system of Example 26, wherein the eviction controller is further configured to assert an idle signal on the processor interface after all cache lines of the second sub-cache that store write miss data including color tag bits corresponding to the color tag priority indication have been evicted.

[0145] Example 28 includes a method for caching data, the method including receiving a write memory command for a memory address by a caching system; determining by a first sub-cache of the caching system that the memory address is not cached in the first sub-cache; determining by a second sub-cache of the caching system that the memory address is not cached in the second sub-cache, the second sub-cache being configured to store cache data evicted from the first sub-cache and the write memory command not cached in the first sub-cache in parallel with the first sub-cache; storing data associated with the write memory command in the second sub-cache; storing color tag bits associated with the data in the second sub-cache; and evicting the stored data based on the color tag bits.

[0146] Example 29 includes the method of example 28, further including receiving a color tag priority indication from the processor and receiving a drain signal from the processor, wherein the evicting of the stored data is based on the received color tag priority indication.

[0147] Example 30 includes the method of example 29, further including asserting an idle signal after all cache lines of the second sub-cache that store the write miss data including color tag bits corresponding to the color tag priority indication have been evicted.

[0148] Example 31 includes the method of example 30, further including continuing to receive a drain signal from the processor and evicting the stored data including the color tag bits that do not correspond to the color tag priority indication.

[0149] Example 32 includes the method of example 29, further including determining that storing the data is not completed and waiting until the data is stored.

[0150] Example 33 includes the method of example 28, further including storing the color tag bits in a bit field associated with the corresponding color tag bits.

[0151] Example 34 includes a device including a processor, a first sub-cache, and a second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands that are not cached in the first sub-cache, the second sub-cache including color tag bits configured to store an indication that a corresponding cache line of the second sub-cache that stores the write miss data is associated with a color tag, and an eviction controller configured to evict a cache line of the second sub-cache that stores the write miss data based on the color tag associated with the cache line.

[0152] Example 35 includes the device of example 34, wherein the second sub-cache includes a bit field configured to store a state of the color tag.

[0153] Example 36 includes the device of example 35, where the bit field includes a bit that stores a state for each color tag.

[0154] Example 37 includes the device of example 36, wherein a bit field is stored in the memory that tracks modified, exclusive, shared, and invalid (MESI) states of entries in the second sub-cache.

[0155] Example 38 includes the device of example 37, wherein the MESI memory is configured to store an indication that the corresponding cache line of the second sub-cache stores the write miss data.

[0156] Example 39 includes the device of example 34, wherein the caching system further includes a processor interface, and the eviction controller is further configured to receive a color tag priority indication on the processor interface, and to evict cache lines of the second sub-cache that stores the write miss data based on the received color tag priority indication.

[0157] Example 40 includes the device of example 39, wherein the eviction controller is further configured to assert an idle signal on the processor interface after all cache lines of the second sub-cache that store the write miss data including color tag bits corresponding to the color tag priority indication have been evicted.

[0158] Example 41 includes a caching system, the caching system including a first sub-cache and a second sub-cache, the second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, the second sub-cache including color tag bits configured to store an indication that a corresponding line of the second sub-cache is associated with a color tag, and an eviction controller configured to evict a cache line of the second sub-cache that stores memory write data based on the color tag associated with the line, the second sub-cache further including an eviction controller configured to evict a cache line of the second sub-cache that stores memory write data based on the color tag associated with the line, the second sub-cache further including a first write command for the memory address, the first sub-cache; receiving a first write memory command, the write memory command associated with a first color tag, storing first data associated with the first write memory command in a cache line of the second sub-cache, storing the first color tag in the second sub-cache; receiving a second write memory command for the cache line, the write memory command associated with a second color tag, merging the second color tag with the first color tag, storing the merged color tag, and evicting the cache line based on the merged color tag.

[0159] Example 42 includes the caching system of example 41, wherein the first color tag and the second color tag represent the same color tag.

[0160] Example 43 includes the caching system of Example 41, wherein the first color tag and the second color tag represent different color tags, and the merged color tag includes a first bit representing the first color tag and a second bit representing the second color tag.

[0161] Example 44 includes the caching system of example 43, wherein the second sub-cache is further configured to evict cache lines based on the first color tag.

[0162] Example 45 includes the caching system of example 44, wherein the second sub-cache is further configured to evict cache lines based on the second color tag.

[0163] Example 46 includes the caching system of example 41, wherein the first color tag and the second color tag are stored in a bit field in a memory that tracks modified, exclusive, shared, and invalid (MESI) states of entries in the second sub-cache data.

[0164] Example 47 includes the caching system of example 46, where the bit field includes a bit that stores a state for each color tag.

[0165] Example 48 includes a method for caching data, the method including: receiving, by a caching system, a write memory command for a memory address, the write memory command being associated with a first color tag; determining, by a first sub-cache of the caching system, that the memory address is not cached in the first sub-cache; and determining, by a second sub-cache of the caching system, that the memory address is not cached in the second sub-cache, the second sub-cache caching, in parallel with the first sub-cache, cache data evicted from the first sub-cache; the cache line is configured to store an uncached write memory command in the first sub-cache, the cache line including: determining, storing first data associated with the first write memory command in a cache line of the second sub-cache, storing first color tag bits in the second sub-cache, receiving a second write memory command for the cache line, the write memory command being associated with a second color tag, merging the second color tag with the first color tag, storing the merged color tag, and evicting the cache line based on the merged color tag.

[0166] Example 49 includes the method of example 48, wherein the first color tag and the second color tag represent the same color tag.

[0167] Example 50 includes the method of example 48, wherein the first color tag and the second color tag represent different color tags, and the merged color tag includes a first bit representing the first color tag and a second bit representing the second color tag.

[0168] Example 51 includes the method of example 50, wherein the expelling is based on the first color tag.

[0169] Example 52 includes the method of example 51, wherein the expelling is based on a second color tag.

[0170] Example 53 includes the method of example 48, wherein the first color tag and the second color tag are stored in a bit field in a memory that tracks modified, exclusive, shared, and invalid (MESI) states of entries in the second sub-cache data.

[0171] Example 54 includes the method of example 53, wherein the bit field includes a bit that stores a state for each color tag.

[0172] Example 55 includes a device, the device including a processor, a first sub-cache, and a second sub-cache, the second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, the second sub-cache including color tag bits configured to store an indication that a corresponding line of the second sub-cache is associated with a color tag, and an eviction controller configured to evict a cache line of the second sub-cache that stores memory write data based on the color tag associated with the line, the second sub-cache further including a first write memory address for the memory address, and an eviction controller configured to evict a cache line of the second sub-cache that stores memory write data based on the color tag associated with the line, the first sub-cache; receiving a first write memory command for the cache line, the write memory command associated with a first color tag, storing first data associated with the first write memory command in a cache line of the second sub-cache, storing the first color tag in the second sub-cache; receiving a second write memory command for the cache line, the write memory command associated with a second color tag, merging the second color tag with the first color tag, storing the merged color tag, and evicting the cache line based on the merged color tag.

[0173] Example 56 includes the device of example 55, wherein the first color tag and the second color tag represent the same color tag.

[0174] Example 57 includes the device of example 55, wherein the first color tag and the second color tag represent different color tags, and the merged color tag includes a first bit representing the first color tag and a second bit representing the second color tag.

[0175] Example 58 includes the device of example 57, wherein the second sub-cache is further configured to evict cache lines based on the first color tag.

[0176] Example 59 includes the device of example 58, wherein the second sub-cache is further configured to evict cache lines based on the second color tag.

[0177] Example 60 includes the device of example 55, wherein the first color tag and the second color tag are stored in a bit field in a memory that tracks modified, exclusive, shared, and invalid (MESI) states of entries in the second subcache data.

[0178] Example 61 includes a caching system, the caching system including a first sub-cache and a second sub-cache, the second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, the second sub-cache including a privilege bit configured to store an indication that a corresponding cache line of the second sub-cache is associated with a privilege level, the second sub-cache further configured to receive a first write memory command for a memory address, the first write memory command being associated with the first privilege level. the first sub-cache is configured to receive a first write memory command for the cache line, storing first data associated with the first write memory command in a cache line of the second sub-cache, storing a privilege level associated with the cache line in the second sub-cache, receiving a second write memory command for the cache line, where the second write memory command is associated with the second privilege level, merging the first privilege level with the second privilege level, storing the merged privilege level, and outputting the merged privilege level with the cache line.

[0179] Example 62 includes the caching system of example 61, wherein the privilege level information is stored in a bit field in a memory that tracks the modified, exclusive, shared, and invalid (MESI) state of entries in the second sub-cache data.

[0180] Example 63 includes the caching system of example 62, wherein the privilege level includes a two-part privilege level.

[0181] Example 64 includes the caching system of example 63, where the bit field includes two bits for storing the privilege level.

[0182] Example 65 includes the caching system of example 61, where the second sub-cache includes a privilege merge table that indicates how different privilege levels are merged.

[0183] Example 66 includes the caching system of Example 65, where the privilege merge table is predefined.

[0184] Example 67 includes the caching system of example 61, wherein merging the first privilege level with the second privilege level includes selecting a lower privilege level.

[0185] Example 68 includes a method for caching data, the method including receiving, by a caching system, a first write memory command for a memory address, the first write memory command being associated with a first privilege level; determining, by a first sub-cache of the caching system, that the memory address is not to be cached in the first sub-cache; and determining, by a second sub-cache of the caching system, that the memory address is not to be cached in the second sub-cache, the second sub-cache caching cache data evicted from the first sub-cache in parallel with the first sub-cache. the first sub-cache is configured to store in the first sub-cache first data associated with the first write memory command in a cache line of the second sub-cache; storing the first privilege level in the second sub-cache; receiving a second write memory command for the cache line, the second write memory command being associated with the second privilege level; merging the first privilege level with the second privilege level; storing the merged privilege level; and outputting the merged privilege level with the cache line.

[0186] Example 69 includes the method of example 67, wherein the privilege level includes a two-part privilege level.

[0187] Example 70 includes the method of example 69, wherein the second sub-cache includes two bits in the bit field for storing the privilege level.

[0188] Example 71 includes the method of example 68, where the merging is based on a privilege merge table that indicates how different privilege levels are merged.

[0189] Example 72 includes the method of example 71, where the privilege merge table is predefined.

[0190] Example 73 includes the method of example 68, wherein merging the first privilege level with the second privilege level includes selecting a lower privilege level.

[0191] Example 74 includes a device, the device including a processor, a first sub-cache, and a second sub-cache, the second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands not cached in the first sub-cache, the second sub-cache including a privilege bit configured to store an indication that a corresponding cache line of the second sub-cache is associated with a privilege level, the second sub-cache further configured to receive a first write memory command for a memory address, the first write memory command being associated with the first privilege level. the first sub-cache being associated with a first privilege level; storing first data associated with the first write memory command in a cache line of the second sub-cache; storing a privilege level associated with the cache line in the second sub-cache; receiving a second write memory command for the cache line, the second write memory command being associated with the second privilege level; merging the first privilege level with the second privilege level; storing the merged privilege level; and outputting the merged privilege level with the cache line.

[0192] Example 75 includes the device of example 74, wherein the privilege level information is stored in a bit field in the memory that tracks modified, exclusive, shared, and invalid (MESI) states of entries in the second sub-cache data.

[0193] Example 76 includes the device of example 75, wherein the privilege level includes a two-part privilege level.

[0194] Example 77 includes the device of example 76, wherein the bit field includes two bits for storing the privilege level.

[0195] Example 78 includes the device of example 75, wherein the second sub-cache includes a privilege merge table, the privilege merge table indicating how different privilege levels are merged.

[0196] Example 79 includes the device of example 78, where the privilege merge table is predefined.

[0197] Example 80 includes the device of example 75, wherein merging the first privilege level with the second privilege level includes selecting a lower privilege level.

[0198] Example 81 includes a caching system, the caching system including a first sub-cache and a second sub-cache coupled in parallel to the first sub-cache, the second sub-cache including a line type bit configured to store an indication that a corresponding line of the second sub-cache is configured to store write miss data.

[0199] Example 82 includes the caching system of example 81, wherein the second sub-cache further includes a tag random access memory (RAM) configured to store memory addresses associated with the stored write miss data.

[0200] Example 83 includes the caching system of example 81, wherein the second sub-cache further includes a byte enable memory configured to store byte enable logic associated with the stored write miss data.

[0201] Example 84 includes the caching system of example 83, wherein the byte enable memory includes memory locations corresponding to each cache line of the second sub-cache.

[0202] Example 85 includes the caching system of example 81, wherein the stored indication indicates whether the corresponding cache line of the second sub-cache stores a write miss entry or a cache entry.

[0203] Example 86 includes the caching system of example 81, wherein the line type bits are stored in a memory that tracks the modified, exclusive, shared, and invalid (MESI) states of entries in the second sub-cache.

[0204] Example 87 includes the caching system of example 81, wherein the first sub-cache is an n-way set associative cache and the second sub-cache is a fully associative cache.

[0205] Example 88 includes a method for caching data, the method including receiving, by a caching system, a write memory request for a memory address; determining, by a first sub-cache of the caching system, that the memory address is not cached in the first sub-cache; determining, by a second sub-cache of the caching system, that the memory address is not cached in the second sub-cache, the second sub-cache being coupled in parallel to the first sub-cache; storing data associated with the write memory request in the second sub-cache; and storing an indication in line type bits of the second sub-cache that the stored data corresponds to a write miss.

[0206] Example 89 includes the method of example 88, further including storing a memory address associated with the stored write miss data in a tag random access memory (RAM).

[0207] Example 90 includes the method of example 88, further including storing byte enable logic associated with the stored write miss data in the byte enable memory.

[0208] Example 91 includes the method of example 88, wherein the line type bits are stored in a memory that tracks modified, exclusive, shared, and invalid (MESI) states of entries in the second sub-cache.

[0209] Example 92 includes the method of example 88, further including evicting a cache entry from the line of the second sub-cache, and storing the data associated with the write memory request includes storing the data in the line.

[0210] Example 93 includes the method of example 88, wherein the stored indication indicates whether the corresponding cache line of the second sub-cache stores a write miss entry or a cache entry.

[0211] Example 94. A device includes a processor, a first sub-cache, and a second sub-cache coupled in parallel to the first sub-cache, the second sub-cache including a line type bit configured to store an indication that a corresponding line of the second sub-cache is configured to store write miss data.

[0212] Example 95 includes the device of example 94, wherein the second sub-cache further includes a tag random access memory (RAM) configured to store memory addresses associated with the stored write miss data.

[0213] Example 96 includes the device of example 94, wherein the second sub-cache further includes a byte enable memory configured to store byte enable logic associated with the stored write miss data.

[0214] Example 97 includes the device of example 96, wherein the byte enable memory includes memory locations corresponding to each cache line of the second sub-cache.

[0215] Example 98 includes the device of example 94, wherein the stored indication indicates whether the corresponding cache line of the second sub-cache stores a write miss entry or a cache entry.

[0216] Example 99 includes the device of example 94, wherein the line type bits are stored in a memory that tracks modified, exclusive, shared, and invalid (MESI) states of entries in the second sub-cache.

[0217] Example 100 includes the device of example 94, wherein the first sub-cache is an n-way set associative cache and the second sub-cache is a fully associative cache.

[0218] Example 101 includes a caching system, the caching system including a first sub-cache and a second sub-cache parallel to the first sub-cache, the second sub-cache including a set of cache lines, line type bits configured to store an indication that a corresponding cache line of the set of cache lines is configured to store write miss data, and an eviction controller configured to evict a cache line of the second sub-cache that stores the write miss data based on the indication that the cache line is fully written.

[0219] Example 102 includes the caching system of example 101, wherein the eviction controller is further configured to evict a cache line of the second sub-cache that stores the write miss data based on the indication that the cache line is half written.

[0220] Example 103 includes the caching system of example 102, wherein the eviction controller is configured to determine that there is no fully written cache line of the second sub-cache that stores the write miss data before evicting the cache line based on the indication that the cache line is half written.

[0221] Example 104 includes the caching system of example 102, wherein the second sub-cache further includes a byte enable memory configured to store byte enable logic associated with the stored write miss data, the byte enable memory including a first bit that stores an indication that the cache line is completely written.

[0222] Example 105 includes the caching system of example 104, where the byte enable memory includes a second bit that stores an indication that the cache line is half written.

[0223] Example 106 includes the caching system of example 105, wherein the first and second bits are determined based on byte enable logic associated with the stored write miss data.

[0224] Example 107 includes the caching system of example 106, wherein the first and second bits are determined based on the byte enable logic each time the write miss data is stored in the second sub-cache.

[0225] Example 108 includes a method for caching data, the method including receiving, by a caching system, a write memory request for a memory address; determining, by a first sub-cache of the caching system, that the memory address is not cached in the first sub-cache; determining, by a second sub-cache of the caching system, that the memory address is not cached in the second sub-cache; storing data associated with the write memory request in the second sub-cache; storing an indication in line type bits of the second sub-cache that the stored data corresponds to a write miss; and evicting a cache line of the second sub-cache that stores the write miss based on the indication that the cache line is completely written.

[0226] Example 109 includes the method of example 108, further including evicting a cache line of the second sub-cache that stores the write miss data based on the indication that the cache line is half written.

[0227] Example 110 includes the method of example 109, further including determining that there is no fully written cache line of the second sub-cache to store the write miss data before evicting the cache line based on the indication that the cache line is half written.

[0228] Example 111 includes the method of example 109, further including storing a first bit indicating that the cache line is completely written into the byte enable memory of the second sub-cache.

[0229] Example 112 includes the method of example 111, further including storing a second bit indicating that the cache line is half-written in the byte enable memory of the second sub-cache.

[0230] Example 113 includes the method of example 112, wherein the first and second bits are determined based on byte enable logic associated with the stored write miss data.

[0231] Example 114 includes the method of example 113, wherein the first and second bits are determined based on the byte enable logic each time the write miss data is stored in the second sub-cache.

[0232] Example 115 includes a device including a processor, a first sub-cache, and a second sub-cache parallel to the first sub-cache, the second sub-cache including a set of cache lines and line type bits configured to store an indication that a corresponding cache line of the set of cache lines is configured to store write miss data, and an eviction controller configured to evict a cache line of the second sub-cache that stores the write miss data based on the indication that the cache line is completely written.

[0233] Example 116 includes the device of example 115, wherein the eviction controller is further configured to evict a cache line of the second sub-cache that stores the write miss data based on the indication that the cache line is half written.

[0234] Example 117 includes the device of example 116, wherein the eviction controller is configured to determine that there is no fully written cache line of the second sub-cache that stores the write miss data before evicting the cache line based on the indication that the cache line is half written.

[0235] Example 118 includes the device of example 117, wherein the second sub-cache further includes a byte enable memory configured to store byte enable logic associated with the stored write miss data, the byte enable memory including a first bit that stores an indication that the cache line is completely written.

[0236] Example 119 includes the device of example 118, wherein the byte enable memory includes a second bit that stores an indication that the cache line is half written.

[0237] Example 120 includes the device of example 119, wherein the first and second bits are determined based on byte enable logic associated with the stored write miss data.

[0238] Example 121 includes a caching system including a first sub-cache, a second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands that are not cached in the first sub-cache, and a cache controller configured to receive two or more cache commands, determine that a conflict exists between the two or more received cache commands, determine a conflict resolution between the two or more received cache commands, and send the two or more cache commands to the first sub-cache and the second sub-cache.

[0239] Example 122 includes the caching system of Example 121, wherein the cache command is a read command, and the cache controller is further configured to: determine, based on a memory address of the read command, that the memory address is not cached in the first sub-cache; determine, based on the memory address, that the memory address is stored in the second sub-cache as a write memory command; and stall the read command until the write memory command is drained from the second sub-cache.

[0240] Example 123 includes the caching system of example 121, wherein the cache controller is further configured to receive two or more cache commands in parallel.

[0241] Example 124 includes the caching system of Example 123, wherein the two or more cache commands include a read command and a write command, and the cache controller is further configured to determine a first cache location in the first sub-cache based on a first memory address of the read command, determine that the first memory address is not cached in the first sub-cache at the first cache location, receive a second cache location in the second sub-cache associated with the read command, determine that the second memory address is stored in the second sub-cache at the second cache location based on the second memory address of the write command as a write memory command, receive a third cache location in the second sub-cache associated with the write command, and evict the cached memory item from the first cache location in the first sub-cache to the third cache location in the second sub-cache.

[0242] Example 125 includes the caching system of Example 123, wherein the two or more cache commands include a read command and a write command, and the cache controller is further configured to determine a first cache location in the first sub-cache based on a first memory address of the read command, determine that the first memory address is not cached in the first sub-cache at the first cache location, determine that the second memory address is stored at the first location in the first sub-cache based on a second memory address of the write command, stall the read command, implement the write command, evict the implemented write command to the second sub-cache, and resume the read command after the eviction.

[0243] Example 126 includes the caching system of Example 123, wherein the two or more cache commands include a first write command and a second write command, and the cache controller is further configured to determine that a first memory address of the first write command is not cached in the first sub-cache, determine that a second memory address of the second write command is not cached in the first sub-cache, determine that the first memory address and the second memory address match, merge the first write command and the second write command, and store the merged command in the second sub-cache.

[0244] Example 127 includes the caching system of Example 123, wherein the two or more cache commands include a read command and a write command, and the cache controller is further configured to determine that a first memory address of the read command is cached in the first sub-cache, determine that a second memory address of the write command is cached in the first sub-cache, determine that the first memory address and the second memory address match, stall the write command until the read command is completed, and resume the write command.

[0245] Example 128 includes a method for caching data, the method including receiving two or more cache commands, determining that a conflict exists between the two or more cache commands, determining a conflict resolution between the received two or more cache commands, and sending the two or more cache commands to a first sub-cache and a second sub-cache, where the second sub-cache is configured to store, in parallel with the first sub-cache, cache data evicted from the first sub-cache and write memory commands that are not cached in the first sub-cache.

[0246] Example 129 includes the method of example 128, wherein the cache command is a read command, and the method further includes determining, based on a memory address of the read command, that the memory address is not cached in the first sub-cache; determining, based on the memory address, that the memory address is stored in the second sub-cache as a write memory command; and stalling the read command until the write memory command is drained from the second sub-cache.

[0247] Example 130 includes the method of example 128, wherein two or more cache commands are received in parallel.

[0248] Example 131 includes the method of example 130, wherein the two or more cache commands include a read command and a write command, the method further including determining a first cache location in the first sub-cache based on a first memory address of the read command, determining that the first memory address is not cached in the first sub-cache at the first cache location, receiving a second cache location in the second sub-cache associated with the read command, determining based on a second memory address of the write command that the second memory address is stored in the second sub-cache at the second cache location as a write memory command, receiving a third cache location in the second sub-cache associated with the write command, and evicting the cached memory item from the first cache location in the first sub-cache to the third cache location in the second sub-cache.

[0249] Example 132 includes the method of example 130, where the two or more cache commands include a read command and a write command, and the method further includes determining a first cache location in the first sub-cache based on a first memory address of the read command, determining that the first memory address is not cached in the first sub-cache at the first cache location, determining that the second memory address is stored at the first location in the first sub-cache based on a second memory address of the write command, stalling the read command, implementing the write command, flushing the implemented write command to the second sub-cache, and resuming the read command after the flushing.

[0250] Example 133 includes the method of example 130, where the two or more cache commands include a first write command and a second write command, the method further including determining that a first memory address of the first write command is not cached in the first sub-cache, determining that a second memory address of the second write command is not cached in the first sub-cache, determining that the first memory address and the second memory address match, merging the first write command and the second write command, and storing the merged command in the second sub-cache.

[0251] Example 134 includes the method of example 130, where the two or more cache commands include a read command and a write command, and the method further includes determining that a first memory address of the read command is cached in the first sub-cache, determining that a second memory address of the write command is cached in the first sub-cache, determining that the first memory address and the second memory address match, stalling the write command until the read command is completed, and resuming the write command.

[0252] Example 135 includes a device including a processor, a first sub-cache, a second sub-cache coupled in parallel to the first sub-cache for storing cache data evicted from the first sub-cache and write memory commands that are not cached in the first sub-cache, and a cache controller configured to receive two or more cache commands, determine that a conflict exists between the two or more received cache commands, determine a conflict resolution between the two or more received cache commands, and send the two or more cache commands to the first sub-cache and the second sub-cache.

[0253] Example 136 includes the device of example 135, wherein the cache command is a read command, and the cache controller is further configured to determine, based on a memory address of the read command, that the memory address is not cached in the first sub-cache, and based on the memory address, determine that the memory address is stored in the second sub-cache as a write memory command, and stall the read command until the write memory command is drained from the second sub-cache.

[0254] Example 137 includes the device of example 135, wherein the cache controller is further configured to receive two or more cache commands in parallel.

[0255] Example 138 includes the device of example 137, wherein the two or more cache commands include a read command and a write command, and the cache controller is further configured to: determine a first cache location in the first sub-cache based on a first memory address of the read command; determine that the first memory address is not cached in the first sub-cache at the first cache location; receive a second cache location in the second sub-cache associated with the read command; determine based on the second memory address of the write command that the second memory address is stored in the second sub-cache at the second cache location as a write memory command; receive a third cache location in the second sub-cache associated with the write command; and evict the cached memory item from the first cache location in the first sub-cache to the third cache location in the second sub-cache.

[0256] Example 139 includes the device of example 137, wherein the two or more cache commands include a read command and a write command, and the cache controller is further configured to determine a first cache location in the first sub-cache based on a first memory address of the read command, determine that the first memory address is not cached in the first sub-cache at the first cache location, determine based on a second memory address of the write command that the second memory address is stored at the first location in the first sub-cache, stall the read command, implement the write command, evict the implemented write command to the second sub-cache, and resume the read command after the eviction.

[0257] Example 140 includes the device of example 137, wherein the two or more cache commands include a first write command and a second write command, and the cache controller is further configured to determine that a first memory address of the first write command is not cached in the first sub-cache, determine that a second memory address of the second write command is not cached in the first sub-cache, determine that the first memory address and the second memory address match, merge the first write command and the second write command, and store the merged command in the second sub-cache.

[0258] The term "couple" is used throughout this specification. The term may encompass a connection, communication, or signal path that allows for a functional relationship consistent with the description of this description. For example, in a first example, device A is coupled to device B when device A generates a signal to control device B to perform a certain action, or in a second example, device A is coupled to device B via an intervening component C such that device B is controlled by device A via a control signal generated by device A when the intervening component C does not substantially change the functional relationship between device A and device B.

[0259] Modifications in the described embodiments are possible, and other embodiments are possible, within the scope of the claims.

Claims

1. A caching system comprising: a first sub-cache; a second sub-cache parallel to the first sub-cache; and wherein the second sub-cache comprises: a set of cache lines; a line type bit configured to store an indication that a corresponding cache line of the set of cache lines is configured to store write miss data; an eviction controller configured to flush stored write miss data based on the line type bits; A caching system, including

2. 2. The caching system of claim 1, The second sub-cache further comprises: a tag random access memory (RAM) configured to store a memory address associated with the stored write miss data; a byte enable memory configured to store byte enable logic associated with the stored write miss data; Including, 11. A caching system according to claim 10, wherein the eviction controller is configured to flush stored write miss data by transmitting memory write requests to a higher level memory based on the stored memory address and stored byte enable logic.

3. 2. The caching system of claim 1, The caching system further includes a processor interface, and the eviction controller further includes: monitoring activity on the processor interface; and flushing stored write miss data based on the monitored activity. A caching system is configured.

4. 4. The caching system of claim 3, A caching system, wherein monitoring activity on the processor interface includes detecting idle activity on the processor interface.

5. 5. The caching system of claim 4, A caching system in which detecting idle activity includes determining whether a memory request has been received for a predetermined number of clock cycles.

6. 5. The caching system of claim 4, The eviction controller further comprises: determining that activity on the processor interface has resumed; and canceling the flushing of the stored write miss data; A caching system is configured.

7. 7. The caching system of claim 6, A caching system, wherein determining that activity on the processor interface has resumed includes detecting receipt of a cache request from the processor.

8. 1. A method for caching data, comprising: receiving, by a caching system, a write memory request for a memory address; determining, by a first sub-cache of the caching system, that the memory address is not cached within the first sub-cache; determining, by a second sub-cache of the caching system, that the memory address is not cached within the second sub-cache; storing data associated with the write memory request in the second sub-cache; storing an indication in line type bits of the second sub-cache that the stored data corresponds to a write miss; flushing said stored data based on said instructions; A method comprising:

9. 9. The method of claim 8, The method, wherein flushing the stored data includes transmitting, by the second sub-cache, a memory write request to a higher level memory.

10. 9. The method of claim 8, further comprising:

11. A method comprising: monitoring activity on a processor interface, wherein flushing the stored data is further based on the monitored activity.

11. 11. The method of claim 10, The method, wherein monitoring activity on the processor interface includes detecting idle activity on the processor interface.

12. 12. The method of claim 11, The method, wherein detecting idle activity includes determining that a memory request has not been received for a predetermined number of clock cycles.

13. 12. The method of claim 11 further comprising: determining that activity has resumed on the processor interface; canceling the flush of the stored write miss data; and A method comprising:

14. 14. The method of claim 13, The method, wherein determining that activity has resumed on the processor interface includes detecting a cache request receipt.

15. A device, comprising: A processor; a first sub-cache; a second sub-cache parallel to the first sub-cache; and wherein the second sub-cache comprises: a set of cache lines; a line type bit configured to store an indication that a corresponding cache line of the set of cache lines is configured to store write miss data; an eviction controller configured to flush stored write miss data based on the line type bits; Including, the device.

16. 16. The device of claim 15, The second sub-cache further comprises: a tag random access memory (RAM) configured to store a memory address associated with the stored write miss data; a byte enable memory configured to store byte enable logic associated with the stored write miss data; Including, the eviction controller is configured to flush the stored write miss data by transmitting a write memory request to a higher level memory based on the stored memory address and stored byte enable logic.

17. 16. The device of claim 15, The caching system further includes a processor interface, and the eviction controller further includes: monitoring activity on the processor interface; and flushing the stored write miss data based on the monitored activity. Configure the device.

18. 20. The device of claim 17, A device, wherein monitoring activity on the processor interface includes detecting idle activity on the processor interface.

19. 20. The device of claim 18, A device, wherein detecting idle activity includes determining whether a memory request has been received for a predetermined number of clock cycles.

20. 20. The device of claim 18, The eviction controller further comprises: determining that activity has resumed on the processor interface; and canceling the flushing of the stored write miss data; Configure the device.

Citation Information

Patent Citations

  • Microcomputer and data processor

    JP2002108702A

  • Write-back device of cache memory

    JP2006091995A

  • Limiting the number of dirty entries in a computer cache

    US20030084250A1