Compression of data to be stored in cache memories within a hierarchy of cache memories - Patents.com

A hierarchical cache memory system uses lighter and heavier compression methods tailored to each level's response time, optimizing cache usage and reducing latency, thus enhancing electronic device performance by minimizing access to slower storage.

JP7535048B2Active Publication Date: 2024-08-15ADVANCED MICRO DEVICES INC
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2021535743
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2018-12-26
Filing Date
2019-06-19
Publication Date
2024-08-15
Estimated Expiration
2039-06-19

AI Technical Summary

Technical Problem

Existing cache memory systems face challenges in efficiently utilizing their limited capacity due to the varying performance requirements of different cache levels, leading to difficulties in finding a single compression method that balances storage efficiency with response latency.

Method used

A hierarchical cache memory system employs lighter and heavier compression techniques based on the cache level's response time, using lighter compression for faster cache memories and heavier compression for slower ones, allowing data to be compressed and decompressed efficiently without significant latency impact.

Benefits of technology

This approach maximizes cache memory usage while maintaining low response times, enabling faster data access and improving overall electronic device performance by reducing the need to access slower memory or mass storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007535048000005
    Figure 0007535048000005
  • Figure 0007535048000004
    Figure 0007535048000004
  • Figure 0007535048000003
    Figure 0007535048000003
Patent Text Reader

Abstract

The electronic device includes at least one compression / decompression functional block and a hierarchy of cache memories including a first cache memory and a second cache memory. The at least one compression / decompression functional block receives data in an uncompressed state, compresses the data using either a first compression or a second compression, and provides the compressed data to the first cache memory for storage after it has been compressed. The compression / decompression functional block, when data is read from the first cache memory and stored in the second cache memory and the data is compressed using the first compression, decompresses the data to reverse the effect of the first compression on the data, restoring the data to an uncompressed state, and provides data compressed using the second compression or the uncompressed data to the second cache memory for storage.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] (Government Rights) This invention was made with Government support under Project PathForward awarded by the U.S. Department of Energy (DOE) with Lawrence Livermore National Security (Prime Contract No. DE-AC52-07NA27344, Subcontract No. B620717). The U.S. Government has certain rights in this invention. [Background technology]

[0002] (Related Technology) Some electronic devices include a processor that executes program code to perform various operations. For example, an electronic device may include one or more central processing unit cores (CPU cores) or graphics processing unit cores (GPU cores) that execute program code, such as software applications or operating systems. Many of these electronic devices include one or more cache memories for storing program code and / or data, along with memory (e.g., "main" memory) and mass storage. A cache memory is a fast-access memory used to store copies of program code and / or data locally and enable rapid retrieval by a processor for use in executing the program code or performing other operations. Access to copies of program code and / or data in a cache memory is typically at least an order of magnitude faster than access to the program code and / or data in memory and mass storage.

[0003] A cache memory typically has a limited capacity for storing copies of program code and / or data, and typically has a capacity significantly smaller than memory or mass storage. For example, some electronic devices include a hierarchy of cache memories, with a top or first level cache memory (i.e., "L1" cache) having a capacity of 32-64 kilobytes (kB), a middle or second level cache memory (i.e., "L2" cache) having a capacity of 512-1024 kB, and a bottom or third level cache memory (i.e., "L3" cache) having a capacity of 2-4 megabytes (MB). In such electronic devices, the memory may have a capacity of 32-64 gigabytes (GB) and the mass storage device may have a capacity of 4-8 terabytes (TB). Because the storage capacity of the cache memory is limited, during operation, the processor periodically requires storage of sufficient copies of the program code and / or data to exceed the capacity of the cache memory to simultaneously store copies. Thus, a cache memory may be forced to remove or otherwise discard existing stored copies of the program code and / or data to free up space for storing the incoming copy of the program code and / or data. For example, the cache memory may write copies of modified data back to memory or a lower level cache memory and / or invalidate copies of unmodified data to make space for the incoming copy of the data.

[0004] To better utilize the available storage capacity of a cache memory, designers have proposed a number of techniques to improve the placement of program code and / or data stored in the cache memory. For example, some designers have proposed compressing the program code and / or data so that the program code and / or data can be stored in less space in the cache memory. In this technique, the program code and / or data is compressed to reduce the size of the data before storing the program code and / or data in the cache memory. Then, when the compressed program code and / or data is provided from the cache memory to a requesting processor, the program code and / or data is decompressed, restoring the program code and / or data to its uncompressed state.

[0005] Although compression reduces the size of program code and / or data stored in a cache memory, compression is not necessarily an ideal solution. This is due to the characteristics of the various types of compression used to compress program code and / or data stored in a cache memory. For example, using heavier compression (i.e., compression that performs relatively more, slower, and / or more complex compression operations) may result in higher compression of program code and / or data, but may take longer to compress and decompress. Thus, heavier compression is undesirable for high-level cache memories where response latency is an important consideration. As another example, lighter compression may quickly compress program code and / or data using relatively simple compression operations, but may only compress program code and / or data that contains a limited set of patterns or values. While at least slightly reducing the size of program code and / or data without incurring longer compression latencies, lighter compression may not be able to compress enough data to free up significant space in a larger cache memory. Given the different performance requirements associated with the various cache memories within a hierarchy of cache memories, designers have been unable to find a single compression that works to compress program code and / or data in all cache memories. [Brief description of the drawings]

[0006] [Figure 1] FIG. 1 is a block diagram illustrating an electronic device according to some embodiments. [Diagram 2] FIG. 2 is a block diagram illustrating performing compression and decompression of data as the data is copied up through cache memories in a hierarchy of cache memories, according to some embodiments. [Diagram 3] FIG. 2 is a block diagram illustrating performing compression and decompression of data as the data is copied down through cache memories in a hierarchy of cache memories, according to some embodiments. [Figure 4]5 is a flowchart illustrating a process for compressing and storing data in a cache memory according to some embodiments. [Diagram 5] 5 is a flowchart illustrating a process for compressing and storing data in a cache memory according to some embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0007] Throughout the drawings and the description, like numbers refer to the same drawing elements.

[0008] The following description is presented to enable any person skilled in the art to make and use the described embodiments and is provided in the context of a particular application and its requirements. Various modifications to the described embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments and applications. Thus, the described embodiments are not limited to the embodiments shown but are to be accorded the widest scope consistent with the principles and features disclosed herein.

[0009] (term) In the following description, various terms are used to describe the embodiments. Below, some of these terms are briefly and generally explained. Terms may have important additional aspects that are not described herein for clarity and conciseness. Therefore, it should be noted that the description is not intended to limit the terms.

[0010] Functional Block: A functional block refers to a group, collection, and / or set of one or more interrelated circuit elements, such as integrated circuit elements, discrete circuit elements, etc. The circuit elements are "interrelated" in that they share at least one characteristic. For example, the interrelated circuit elements may be contained in, fabricated on, or otherwise coupled to a particular integrated circuit chip or portion thereof, may participate in the performance of a given function (e.g., a computational or processing function, a memory function, etc.), and may be controlled by a common control element. A functional block may include any number of circuit elements, from a single circuit element (e.g., a single integrated circuit logic gate) to millions or billions of circuit elements (e.g., integrated circuit memory).

[0011] Data: Data refers to information or values ​​that can be stored in a cache memory or memory (e.g., main memory). For example, data can be or include information or values ​​used in or generated by operations such as computational operations, control operations, sensing or monitoring operations, memory access operations, input / output device communications, etc. As another example, data can be or include values ​​(e.g., variable values, constants, etc.) from program code instructions or program code obtained from or directed to a computer-readable storage medium, mass storage device, network interface, memory, etc. As another example, data can be or include information obtained from or directed to a functional block of an input / output device, sensor, human interface device, etc.

[0012] (overview) In the described embodiments, the electronic device includes a hierarchy of cache memories having a first cache memory and a second cache memory. The first cache memory is lower in the hierarchy than the second cache memory and may therefore be slower to access, larger in capacity, and / or located further away from execution circuitry that accesses data in the hierarchy of cache memories compared to the second cache memory. For example, in some embodiments, the first cache memory is a level 3 (L3) cache memory and the second cache memory is a level 2 (L2) cache memory. In the described embodiments, data is compressed and stored in the cache memories (recall that "data," as discussed above, is a general term describing values ​​or information that may be stored in the cache memories) to reduce the size of the data and more efficiently use the available cache memory capacity. Because the cache memories and data accessing entities (e.g., CPU cores, GPU cores, etc.) have different tolerances to delays associated with compressing and decompressing data, the described embodiments use a combination of compression of the data stored in the cache memories. The particular compression(s) used to compress the data in each cache memory are selected to provide the advantage of reducing the size of the data in that cache memory while avoiding decompression operations that would undesirably delay responses to data access requests.

[0013] A second cache memory higher in the hierarchy is expected to respond to an access request in a smaller number of control clock cycles (e.g., 12-15 clock cycles). Thus, adding more than a few clock cycles of delay to the response time of the second cache memory is undesirable. For this reason, in some embodiments, the data in the second cache memory is compressed using a lighter compression, including fewer, simpler, and / or faster compression operations. In these embodiments, because only a lighter compression is used for the data in the second cache memory, the compressed data can be retrieved from the second cache memory, decompressed, and returned to the accessing entity in a relatively short time. A first cache memory lower in the hierarchy is expected to respond quickly to an access request, but access to the first cache memory requires a large number of control clock cycles (e.g., 30-40 clock cycles). Thus, adding a few clock cycles of delay to the response time of the first cache memory has a relatively small impact, and the accessing entity can tolerate the additional latency associated with decompression. Thus, in some embodiments, the data in the first cache memory is compressed using heavier compression, which involves more, more complex, and / or slower compression operations, as compared to the lighter compression. Using heavier compression on the data in the second cache memory may compress more data patterns and / or values ​​than using the lighter compression, but it may take a relatively longer time to compress and decompress the data.

[0014] In some embodiments, data in the first cache memory may be compressed using a heavier compression, but the data in the first cache memory is compressed using either a lighter compression or a heavier compression. In these embodiments, data is preferentially compressed using a lighter compression for storage in the first cache memory, and if the data cannot be compressed using the lighter compression, it is compressed using the heavier compression. In other words, if an attempt to compress the data using the lighter compression fails (e.g., due to data that does not have a pattern or value that can be compressed using the lighter compression), these embodiments attempt to compress the data using the heavier compression. These embodiments preferentially use the lighter compression because data compressed using the lighter compression can be copied from the first cache memory to the second cache memory as is, without intermediate decompression, and therefore more quickly. Furthermore, while the use of the heavier compression requires the data to be decompressed before being stored in the second cache memory, the heavier compression can provide a beneficial size reduction for storing data in the first cache memory that could not be compressed using the lighter compression.

[0015] In some embodiments, the data in the first cache memory is compressed using both a sequence of lighter and heavier compression (and thus a combination thereof). In these embodiments, the data is first compressed using the lighter compression, and then the resulting compressed data is compressed again using the heavier compression. Full decompression of the data output from the sequence of compression is performed using the reverse sequence of heavier decompression followed by lighter decompression. In these embodiments, the data is decompressed before being copied from the first cache memory to the second cache memory, reversing the effect of the heavier compression and leaving the data compressed with the lighter compression for storage in the second cache memory. This is done to take advantage of the beneficial size reduction of the heavier compression of the data in the first cache memory, at the cost of decompressing the data to prepare it for storage in the second cache memory. Note, however, that when copying data from the first cache memory to the second cache memory, the effect of the heavier compression can be reversed by simply decompressing the data, and the resulting decompressed data retains the effect of the lighter compression. This allows data to be copied from the first cache memory to the second cache memory faster than if less compression was performed when storing the copy in the second cache memory.

[0016] By using lighter and heavier compression to compress data in the first and second cache memories as described herein, the described embodiments reduce the size of data stored in the cache memories. Furthermore, by using a designated compression for each cache memory, the latency of data compression and decompression is adjusted between the cache memories, reducing exposure of the accessing entity to unacceptable delays in responding to access requests. Thus, the described embodiments can store more data in the cache memory without resulting in unacceptable delays in responding to data access requests. Storing more data in the cache memory means that the accessing entity can access more data in the cache memory, helping to avoid the need and delay of accessing data in memory or mass storage device. Thus, accessing more data in the cache memory improves the performance of the accessing entity, and therefore improves the overall performance of the electronic device and improves user satisfaction.

[0017] (Electronic Devices) FIG. 1 is a block diagram illustrating an electronic device 100, according to some embodiments. As shown in FIG. 1, the electronic device 100 includes a processor 102 and a memory 104. In general, the processor 102 and the memory 104 are implemented in hardware, i.e., using various circuit elements and devices. For example, the processor 102 and the memory 104 may be fabricated entirely on one or more semiconductor chips, including one or more separate semiconductor chips, may be fabricated from semiconductor chips in combination with discrete circuit elements, or may be fabricated exclusively from discrete circuit elements. As described herein, the processor 102 and the memory 104 perform operations related to compressing data for storage in a cache memory.

[0018] The processor 102 is a functional block that performs calculations and other operations (e.g., control operations, configuration operations, etc.) in the electronic device 100. For example, the processor 102 may be or may include one or more microprocessors, central processing units (CPUs), graphical processing units (GPUs), accelerated processing units (APUs), and / or other processing functional blocks. As shown in FIG. 1, the processor 102 includes cores 106-108, each of which is a functional block, such as a microprocessor core, a graphic processor core, an application specific integrated circuit (ASIC), etc., that performs calculations and other operations. Within the cores 106-108, the execution subsystems 110-112 include functional blocks and circuit elements, such as instruction fetch / decode units, instruction scheduling units, arithmetic logic units (ALUs), floating point units, computation units, programmable gate arrays, etc., that execute program code instructions and perform other operations.

[0019] The processor 102 includes a hierarchy of cache memories, from the lowest level of the hierarchy to the highest level, including level 1 cache memories (L1 caches) 114-116 in each core 106-108, level 2 cache memories (L2 caches) 118-120, and a level 3 cache memory (L3 cache) 122 shared by the cores. Each cache memory is a functional block that includes volatile memory circuitry, such as static random access memory (SRAM) circuitry, for storing copies of data, and control circuitry for handling operations such as accessing the data. At each level of the hierarchy, each cache memory can be characterized at least in part by its capacity for storing copies of data (with smaller cache memories higher in the hierarchy) and its response time for responding to access requests (with cache memories higher in the hierarchy having shorter response times). For example, in some embodiments, the L1 caches 114-116 have a capacity of 32 kB and a response time of 4-8 cycles (of the control clock), the L2 caches 118-120 have a capacity of 512 kB and a response time of 12-15 cycles, and the L3 cache 122 has a capacity of 4 MB and a response time of 35-40 cycles. Thus, at the first level, assuming 64 B cache lines, the L1 caches 114-116 can each simultaneously store up to 512 cache lines and are expected to respond to data access requests in 4-8 cycles of the control clock.

[0020] In the above described embodiments, data is compressed before it is stored in at least some cache memories to reduce the size of the data, thereby increasing the amount of data (e.g., number of cache lines) that can be stored simultaneously in the cache memories. For example, a 64B cache line can be compressed to 48B, 32B, or another value depending on the compression used for a given cache memory. In these embodiments, the cache memories include control mechanisms, lookup mechanisms, etc. that are operable with both compressed and uncompressed data and combinations thereof. For example, these mechanisms store data of different sizes in the cache memories (e.g., 64B uncompressed cache lines and 32B compressed cache lines, etc.), perform lookups of both compressed and uncompressed data, retrieve both compressed and uncompressed data from within the cache memories to be provided to an accessing entity, etc. In general, in the described embodiments, the cache memories are operable with both compressed and uncompressed data and combinations thereof.

[0021] In some embodiments, a different compression is used for cache memories at each level of the hierarchy of cache memories (or for each individual cache memory). In these embodiments, the particular compression available for each cache memory (i.e., the heaviest compression) is selected for each cache memory at each level of the hierarchy (or for each cache memory) based at least in part on the desired response time for accessing requests of those cache memories. In general, the response times of cache memories that are lower in the hierarchy and therefore have longer response times will be less affected by the added latency of decompressing the heavier compression. For example, adding 8 clock cycles for data decompression to a 40 clock cycle response time of a given cache memory will increase the response time by 20%, but the impact on the reduction in response time will be more noticeable. Thus, heavier compression may be used for cache memories lower in the hierarchy. For example, in some embodiments, data in L1 caches 114-116, which are highest in the hierarchy and have the shortest response times, is not compressed, i.e., data is stored in these cache memories in uncompressed form. In these embodiments, data in L2 caches 118-120, which have intermediate response times, may be compressed using only lighter compression, which adds less decompression latency to the response time. In these embodiments, data in the L3 cache 122 that has the longest response times may be compressed using heavier compression (but may not be compressed as described herein) that adds more decompression latency to response times.

[0022] In some embodiments, compression and / or decompression of data is performed local to a cache memory in a hierarchy of cache memories. In these embodiments, some or all of the cache memories may be associated with and located near a compression and decompression functional block. For example, the compression and decompression functional block may be incorporated into or otherwise associated with an interface for a data signal route or bus through which data is received by the cache memory and through which data is provided to other cache memories. In these embodiments, the compression and decompression functional block includes circuitry for performing compression and decompression operations for the compression(s) used on the data in the corresponding cache memory. In the embodiment shown in FIG. 1, the compression and decompression functional block includes compression and decompression (COM-DECOM) functional blocks 124-126 associated with the L2 caches 118-120, respectively, and a compression and decompression functional block 128 associated with the L3 cache 122. In these embodiments, when data is received or provided by the corresponding cache memory, the compression and decompression functional block performs operations to compress the received data for storage in the cache memory or to decompress the data from the cache memory for provision to another cache memory (or other access entity), as appropriate. Continuing with the above example, when uncompressed data is received from the L1 cache 114 and stored by the L2 cache 118 (e.g., as data from the execution subsystem 110 propagates through the hierarchy of cache memories), the compression / decompression functional block 124 compresses the data using a lighter compression and then provides the compressed data to store in the L2 cache 118. Continuing with the example further, when compressed data is requested from the L2 cache 118 by the L1 cache 114, the compression / decompression functional block 124 receives the compressed data from the L2 cache 118, decompresses the data from the lighter compression to an uncompressed state, and then provides the uncompressed data to the L1 cache 114.

[0023] Memory 104 is a functional block that performs memory (e.g., "main" memory) operations for electronic device 100. Memory 104 may include volatile memory circuits, such as fourth generation double data rate synchronous dynamic random access memory (DDR4 SDRAM), and / or other types of memory circuits, to store data and instructions used by the functional blocks within electronic device 100 and control circuitry to handle access to data and instructions stored in the memory circuits and to perform other control or configuration operations.

[0024] In some embodiments, data is compressed for storage in a cache memory in a hierarchy of cache memories as well as compressed for storage in memory 104. In some embodiments, data may be communicated between one or more functional blocks in a compressed state and compressed for communication. In some embodiments, data may remain in a compressed state for communication and be decompressed at the destination cache memory or accessing entity. For example, compressed data retrieved from L2 cache 118 may not be immediately decompressed (i.e., at compression / decompression functional block 124) to remove the effects of the lighter compression described above, but may instead be communicated to L1 cache 114 before decompression. In these embodiments, the placement of the compression / decompression functional block may be different from local compression and / or decompression mechanisms at one or more other locations (e.g., L1 cache 114, etc.) in electronic device 100. For example, data destined for L2 cache 118 from L1 cache 114 may be compressed at L1 cache 114 before being communicated to L2 cache 118, and thus may arrive at L2 cache 118 in a compressed state (with lighter compression already applied).

[0025] Although FIG. 1 illustrates a particular configuration of cache memories, in some embodiments, there are different numbers and / or configurations of cache memories. For example, in some embodiments, each of the L1 caches 114-116 is split into two separate cache memories in each of the cores 106-108, one cache memory for storing program code instructions and one cache memory for storing data. In general, the described embodiments are operable with any configuration of cache memories capable of performing the data compression operations described herein. Additionally, while FIG. 1 illustrates multiple compression and decompression functional blocks, in some embodiments, different configurations of functional blocks are used to perform data compression and decompression as described herein. For example, the cache controllers in some or all of the cache memories may be modified to incorporate circuitry for performing compression and / or decompression.

[0026] Electronic device 100 has been simplified for purposes of explanation. However, in some embodiments, electronic device 100 includes additional or different functional blocks and elements. For example, electronic device 100 may include a display subsystem, a power subsystem, an input / output (I / O) subsystem, etc. Typically, electronic device 100 includes sufficient functional blocks and elements to perform the operations described herein.

[0027] Electronic device 100 may be or may be included in any device that performs computational operations. For example, electronic device 100 may be or may be included in a desktop computer, a laptop computer, a wearable computing device, a tablet computer, a virtual reality or augmented reality device, a smartphone, an artificial intelligence (AI) or machine learning device, a server, a network appliance, a toy, an audiovisual device, a home appliance, a vehicle, and / or combinations thereof.

[0028] (Data Compression) In the described embodiment, data is compressed for storage in a cache memory in a hierarchy of cache memories and decompressed as needed to store the data in the cache memory or to use the data (recall that "data" as used herein refers to any information or value that may be stored in a cache or memory). In general, "compressing" data involves the act of losslessly reducing the size (e.g., number of bits or bytes) of the data for storage, communication of the data via various communication mechanisms, and other operations. Because the data is losslessly compressed, the compressed data can be "decompressed" to fully restore the value of the uncompressed data.

[0029] There are many types of data compression known in the art and various implementations of each type of compression. For example, pattern matching compression, value matching compression, zero-content compression, Lempel-Ziv (LZ) (and variants) compression, Markov compression, and delta compression are some of the many types of compression, and various implementations have been proposed for some or all types of compression. The described embodiments are not limited to a particular type of compression, but instead are operable with any combination of compressions that can be performed on data stored in a cache memory.

[0030] As described herein, in some embodiments, a combination of "lighter" and "heavier" compression is used. In general, the lighter compression is or includes one or more types of compression that are faster (and perhaps much faster) to compress and / or decompress than one or more types of compression of the heavier compression. For example, in some embodiments, the lighter compression may be or include a type of compression that can compress and / or decompress in 1-3 cycles (of a control clock), whereas the heavier compression may be or include a type of compression that can compress and / or decompress in 6-10 cycles. The difference between the lighter and heavier compression may be due to one or more differences in the number of compression operations performed, the complexity of the compression operations, and / or the speed at which the compression operations are performed.

[0031] In some embodiments, an attempt is made to compress data, but compressible patterns, values, etc. may not exist in the data. For example, in some embodiments, leading zeros or ones may be removed for compression, and the data may not have leading zeros or ones. In this case, compression may not work, and thus the data may remain in the initial state that existed before attempting to compress the data (i.e., may have the same number of bits or bytes of the same value). In these embodiments, the data may be stored in some or all of the cache memory in an uncompressed state. For example, continuing with the example above, if lighter compression does not result in a reduction / compression of a given data, then that data may be stored in the L2 cache 118 in an uncompressed state.

[0032] In some embodiments, the compression and decompression functional block may attempt more than one compression on the data in the sequence until the data is compressed or until the last compression in the sequence has been attempted. Continuing with the example above, the compression and decompression functional block 128 may first attempt to compress the given data for storage in the L3 cache 122 using a lighter compression. If the attempt to compress the given data using the lighter compression is successful, the compressed data may be stored in the L3 cache 122 with only the lighter compression applied. In this case, when the compressed given data is provided from the L3 cache 122 to an L2 cache (e.g., the L2 cache 118), the given data may be provided without decompression because the lighter compression is used for the data in the L2 cache. However, if the lighter compression fails (and thus the data remains uncompressed), the compression and decompression functional block 128 may attempt to compress the given data using a heavier compression. The given data, either compressed using the heavier compression or uncompressed (if the heavier compression fails), is then stored in the L3 cache 122. If given data is compressed using heavier compression, the compression / decompression functional block 128 decompresses the given data before providing it to the L2 cache to reverse the effects of the heavier compression.

[0033] In some embodiments, unlike the example of the previous paragraph, the compression and decompression functional block may apply more than one compression to the data in a sequence. Generally, in these embodiments, given data is compressed using a lighter compression, and then the given data (including the effects of the lighter compression) is compressed again using a heavier compression. The combined compression is performed on data stored in a cache memory that can use both the heavier compression and the lighter compression. For example, in some of these embodiments, the combined compression can be used in the L3 cache 122. In these embodiments, the compression and decompression functional block that performs the combined compression may be configured to handle variable length data for each compression. In other words, the lighter compression may or may not compress certain data, so the heavier compression needs to be able to handle both uncompressed data and data compressed using the lighter compression.

[0034] (Compression of data for storage in a cache memory within a hierarchy of cache memories) In the embodiments described above, data is compressed for storage in cache memories in a hierarchy of cache memories (e.g., L1 caches 114-116, L2 caches 118-120, and L3 cache 122). Compression and decompression functional blocks (e.g., compression and decompression functional blocks 124-128) perform operations to compress and decompress data such that when the data is copied from a memory (e.g., memory 104) up through a cache memory in the hierarchy of cache memories, the data is stored in the cache memory using a predefined compression. Additionally, when the data is provided down by a core (e.g., core 106) through a cache memory in the hierarchy of cache memories, the compression and decompression functional blocks perform operations to compress and decompress data such that the data is stored in the cache memory using a predefined compression. FIG. 2 is a block diagram illustrating compression and decompression performed on data when the data is copied up through a cache memory in the hierarchy of cache memories, according to some embodiments. FIG. 3 is a block diagram illustrating compression and decompression performed on data when the data is copied down through a cache memory in the hierarchy of cache memories, according to some embodiments. It should be noted that the operations illustrated in Figures 2-3 are presented as general examples of functions performed by some embodiments, and operations performed by other embodiments may include different operations, operations performed in a different order, and / or operations performed by different entities or functional blocks.

[0035] The examples of Figures 2-3 assume that only one compression is applied to data at a time. As described elsewhere herein, in some embodiments, in a particular cache memory (e.g., L3 cache 122), a sequence of two compressions may be applied to data, such that the data is compressed once using a first compression (e.g., a lighter compression), and then the already compressed data is compressed again using a second compression (e.g., a heavier compression). Although no examples of combinations of compressions are provided, the operation is similar, except that both compressions may be applied to the data in a sequence, and the corresponding decompression operations are used to decompress the data.

[0036] The examples of Figures 2-3 illustrate that various compressions and decompressions are applied to data at given times / within each cache memory as the data is propagated to and from the memory. In some embodiments, some or all of the compression and / or decompression are not applied to the data, and / or the compression and / or decompression are applied to the data in different ways. For example, in some embodiments, for certain types of data accesses (e.g., higher priority data accesses, etc.), uncompressed data is provided directly to the requesting entity (e.g., a core, etc.) without being stored in a cache memory. As another example, in some embodiments, uncompressed data retrieved from memory is bypassed to the requesting entity (so the requesting entity is provided with the data as soon as possible), but a copy is also provided to some or all of the cache memories (possibly in parallel) and compressed before being stored therein.

[0037] The example of FIG. 3 assumes that a copy of the data provided by a data source, such as core 106, to be stored in memory is stored in the cache memories lower through the hierarchy of cache memories (i.e., as in a write-through cache memory). Thus, in this example, as the copy of the data progresses down the hierarchy toward the memory, a copy is stored in each cache memory. In some embodiments, the copy of the data is not propagated lower through the hierarchy in this manner, but instead is first written to the highest cache in the hierarchy (e.g., L1 caches 114-116) and then propagated downwards via evictions from the cache memories (i.e., as in a write-back cache memory). However, the compression and decompression operations described in FIG. 3 are similar in these embodiments and are performed when a copy of the data is stored in each cache memory.

[0038] The operation of FIG. 2 begins when a copy of uncompressed data to be stored in the L3 cache 122 (e.g., a 64B cache line from a specified address in memory) is retrieved from memory 104. Before the data is stored in the L3 cache 122, the compression and decompression functional block 128 first attempts to compress the data using lighter compression 200. For this operation, the compression and decompression functional block 128 performs compression operations such as pattern matching, value substitution, etc. according to the particular lighter compression being used. If the lighter compression is successful, the compression and decompression functional block 128 updates metadata associated with the data to mark the data as having been compressed using lighter compression, and provides the compressed data to the L3 cache 122 for storage (this is indicated by the lines bypassing the heavier compression 202).

[0039] If the attempt to compress the data using lighter compression fails and thus the data remains uncompressed (i.e., the data does not have a pattern, value, etc. to which lighter compression would be applied), the compression / decompression function block 128 attempts to compress the data using heavier compression 202. For this operation, the compression / decompression function block 128 performs compression operations such as pattern matching, value substitution, etc., according to the particular heavier compression being used. If the heavier compression is successful, the compression / decompression function block 128 updates metadata associated with the data to mark the data as having been compressed using heavier compression, and provides the compressed data to the L3 cache 122 for storage. Otherwise, if the attempt to compress the data using heavier compression fails and thus the data remains uncompressed (i.e., the data does not have a pattern, value, etc. to which heavier compression would be applied), the compression / decompression function block 128 updates metadata associated with the data to mark the data as uncompressed, and provides the uncompressed data to the L3 cache 122 for storage.

[0040] Upon receiving a request to provide a copy of the data to the L2 cache 118, if the data is marked as having been compressed using heavier compression, the L3 cache 122 provides the data to the compression / decompression functional block 128. The compression / decompression functional block 128 applies a heavier decompression 204 to reverse the heavier compression on the data, thereby restoring the data to an uncompressed state. The compression / decompression functional block 128 then updates metadata associated with the data to mark the data as uncompressed, and provides the uncompressed data to the L3 cache 122 for forwarding to the L2 cache 118. Otherwise, if the data is marked as having been compressed using lighter compression or is uncompressed, the L3 cache 122 provides the data immediately to the L2 cache 118 (as indicated by the line bypassing the heavier decompression 204) without using the compression / decompression functional block 128. Upon receiving the data in an uncompressed state or data compressed using a lighter compression, the L2 cache 118 stores the data.

[0041] Upon receiving a request to provide a copy of the data to the L1 cache 114, if the data is marked as having been compressed using lighter compression, the L2 cache 118 provides the data to the compression-decompression functional block 124. The compression-decompression functional block 124 applies a lighter decompression 206 to reverse the lighter compression on the data, thereby restoring the data to an uncompressed state. The compression-decompression functional block 124 then updates metadata associated with the data to mark the data as uncompressed, and provides the uncompressed data to the L2 cache 118 for forwarding to the L1 cache 114. Otherwise, if the data is marked as uncompressed, the L2 cache 118 provides the data immediately to the L1 cache 114 (indicated by the line bypassing the lighter decompression 206) without using the compression-decompression functional block 124. Upon receiving the data in an uncompressed state, the L1 cache 114 stores the data. The L1 cache 114 may then provide the data to an accessing entity, such as the core 106, which may generate a request to store a copy of the data in the L1 cache 114.

[0042] 3 begins when a copy of data stored in memory 104 in an uncompressed state is provided to L1 cache 114 from a data source, such as core 106. L1 cache 114 stores the copy of the data in an uncompressed state (e.g., in a 64B cache line that contains the data) in L1 cache 114, where metadata associated with the data set indicates that the data is in an uncompressed state. L1 cache 114 also forwards the copy of the data in an uncompressed state to L2 cache 118 for storage.

[0043] Upon receiving a copy of the data, the L2 cache 118 provides the data to the compression / decompression functional block 124. The compression / decompression functional block 124 attempts to compress the data using the lighter compression 300. For this operation, the compression / decompression functional block 124 performs compression operations such as pattern matching, value substitution, etc., according to the particular lighter compression being used. If the lighter compression is successful, the compression / decompression functional block 124 updates metadata associated with the data to mark the data as having been compressed using the lighter compression, and provides the compressed data to the L2 cache 118 for storage. If the attempt to compress the data using the lighter compression is unsuccessful, and thus the data remains uncompressed (i.e., the data does not have a pattern, value, etc. to which lighter compression would be applied), the compression / decompression functional block 124 provides the uncompressed data to the L2 cache 118 for storage. The L2 cache 118 also forwards a copy of the data, either uncompressed or compressed using the lighter compression, to the L3 cache 122 for storage.

[0044] When the L3 cache 122 receives a copy of the data, it stores the compressed data if the metadata associated with the data indicates that the data has been compressed using a lighter compression (this is indicated by a line that bypasses the heavier compression 302). Otherwise, if the metadata associated with the data indicates that the data is uncompressed, the L3 cache 122 provides the data to the compression and decompression functional block 128, which attempts to compress the data using the heavier compression 302. For this operation, the compression and decompression functional block 128 performs compression operations such as pattern matching, value substitution, etc., according to the particular lighter compression being used. If the heavier compression is successful, the compression and decompression functional block 128 updates the metadata associated with the data to mark the data as having been compressed using a heavier compression, and provides the compressed data to the L3 cache 122 for storage. If an attempt to compress the data using heavier compression fails and therefore the data remains uncompressed (i.e., the data does not contain a pattern, value, etc. to which lighter compression can be applied), the compression / decompression function block 128 provides the uncompressed data to the L3 cache 122 for storage.

[0045] The L3 cache 122 also provides a copy of the data to the memory 104. In some embodiments, the data is stored in the memory 104 in an uncompressed state. In these embodiments, when data using lighter compression is received from the L2 cache 118, the L3 cache 122 provides the data to the compression-decompression functional block 128. The compression-decompression functional block 128 applies a lighter decompression operation 304 to reverse the lighter compression on the data, thereby restoring the data to an uncompressed state. The L3 cache 122 then provides the data to the memory in an uncompressed state. Otherwise, when the L3 cache 122 receives uncompressed data, the L3 cache 122 provides the data immediately to the memory without using the compression-decompression functional block 128 to decompress the data (this is indicated by the lines bypassing the lighter decompression 304). Upon receiving the data in an uncompressed state, the memory stores the data. In some embodiments, the data is stored in the memory in a compressed state. In these embodiments, depending on the particular compression used in the memory, the L3 cache 122 may provide the data to the memory 104 for storage in a compressed state, or the L3 cache 122 may provide the data in an uncompressed state as described, and a compression / decompression mechanism in the memory may compress the data using the corresponding compression before the data is stored in the memory 104.

[0046] (The process of compressing data for storage in cache memory) In the embodiments described above, the electronic device performs operations to compress data using a predefined compression for storage in a cache memory within a hierarchy of cache memories within the electronic device. Figure 4 is a flow chart illustrating a process for compressing data and storing it in a cache memory according to some embodiments. It should be noted that the operations illustrated in Figure 4 are provided as general examples of operations performed by some embodiments. Operations performed by other embodiments include different operations, operations performed in a different order, and / or operations performed by different entities or functional blocks.

[0047] In the example of FIG. 4, a first cache memory (e.g., L3 cache 122) is assumed to be capable of storing (along with uncompressed data) data compressed using either a first compression (e.g., heavier compression) or a second compression (e.g., lighter compression), and thus a corresponding compression-decompression functional block (e.g., compression-decompression functional block 128) is capable of compressing and decompressing data using the first compression and the second compression. Further, a second cache memory (e.g., L2 cache 118) is assumed to be capable of storing (along with uncompressed data) data compressed using the second compression, and thus a corresponding compression-decompression functional block (e.g., compression-decompression functional block 124) is capable of compressing and decompressing data using only the second compression. In this example, the second cache memory is not capable of storing data compressed using the first compression. Further, a third cache memory (e.g., L1 cache 114) is assumed to store only uncompressed data.

[0048] Also, in the example of Figure 4, only one of the first compression and the second compression is applied to the data stored in the first cache memory, although this is not a requirement. Figure 5 is a flow chart illustrating an embodiment in which a compression sequence is applied to the data stored in the first cache memory.

[0049] The operation of Figure 4 begins when the compression / decompression functional block receives data in an uncompressed state (step 400). For this operation, the compression / decompression functional block receives data, such as a 64B cache line, from a memory (e.g., memory 104) or another source (e.g., a network interface, a processor, etc.) in an uncompressed state. In the "uncompressed" state, a full set of bits / bytes of data, depending on the type of data, are present and configured to represent the value of the data, and the data has not yet been compressed. For example, if the data includes one or more 32-bit floating point values, all 32 bits are present to represent each of the one or more values ​​(sign, exponent, fraction, etc.).

[0050] The compression / decompression functional block then compresses the data using either a first compression or a second compression (step 402). Each of the first compression and the second compression includes one or more compression operations in which some or all of the bits / bytes of the uncompressed data are removed, reduced, replaced, or otherwise altered. The particular one or more compression operations for each of the first compression and the second compression, i.e., the changes made to the uncompressed data during each compression, vary depending on the type of compression. For example, the first compression and / or the second compression may be or may include one or more of pattern matching compression, value matching compression, zero-content compression, Lempel-Ziv (LZ) (and variations) compression, Markov compression, delta compression, etc.

[0051] In operation 402, the compression / decompression functional block, if compressing data using either the first compression or the second compression, first attempts to compress the data using the second compression (e.g., lighter compression). The second compression is attempted before the first compression (e.g., heavier compression) because both the first cache memory and the second cache memory are capable of storing and decompressing data compressed using the second compression. Thus, when data is copied from the first cache memory to the second cache memory, the data can be copied without being decompressed, thereby eliminating the need for the compression / decompression functional block to perform a corresponding decompression operation. If the data is compressed using the second compression, the compression / decompression functional block sets metadata (e.g., one or more bits) associated with the data to indicate that the data was compressed using the second compression and provides the compressed data to the first cache memory for storage (step 404).

[0052] An attempt at a second compression may not result in the data being compressed due to a lack of a corresponding pattern, value, etc., and therefore the data may remain uncompressed. In this case, the compression / decompression functional block attempts to compress the data using the first compression. The compression / decompression functional block attempts the first compression because, despite the need to decompress the data when copying data compressed using the first compression from the first cache memory to the second cache memory, it is desirable to compress the data for storage in the first cache memory to make better use of the storage available in the first cache memory. Once the data is compressed using the first compression, the compression / decompression functional block sets metadata associated with the data to indicate that the data was compressed using the first compression and provides the compressed data to the first cache memory for storage (step 404).

[0053] In the example of Figure 4, it is assumed that the data has been successfully compressed using either the first compression or the second compression. If the data cannot be compressed despite attempts to compress the data using the first compression and the second compression, the data is stored in an uncompressed state in the first cache memory. In this case, the uncompressed data is simply copied from the first cache memory to the second cache memory in step 408.

[0054] When data is read from the first cache memory and stored in the second cache memory, if the data was compressed using the first compression, the compression / decompression functional block restores the data to an uncompressed state by decompressing the data to reverse the effect of the first compression on the data (step 406). For this operation, the compression / decompression functional block performs one or more decompression operations during which some or all of the bits / bytes of data that were previously removed, reduced, replaced, or otherwise altered are restored to their original, complete values. As with compression, the particular one or more decompression operations performed depend on the type of first compression. During this operation, the compression / decompression functional block prepares the data for storage in the second cache memory (uncompressed). The data is then provided to and stored in the second cache memory (step 408) either compressed using the second compression (compressed in step 402) or in an uncompressed state.

[0055] When data is read from the second cache memory and stored in the third cache memory, if the data was compressed using the second compression, the compression / decompression functional block restores the data to an uncompressed state by decompressing the data to reverse the effect of the second compression on the data (step 410). For this operation, the compression / decompression functional block performs one or more decompression operations during which some or all of the bits / bytes of data that were previously removed, reduced, replaced, or otherwise altered are restored to their original, complete values. As with compression, the particular one or more decompression operations performed depend on the type of second compression. During this operation, the compression / decompression functional block prepares the data for storage in the third cache memory (uncompressed). The data is then provided to and stored in the second cache memory in an uncompressed state (step 412).

[0056] Referring to Figure 5, Figure 5 is a flow chart illustrating a process for compressing data and storing it in a cache memory according to some embodiments. It should be noted that the operations illustrated in Figure 5 are provided as general examples of operations performed by some embodiments. Operations performed by other embodiments include different operations, operations performed in a different order, and / or operations performed by different entities or functional blocks.

[0057] In the example of FIG. 5, a first cache memory (e.g., L3 cache 122) is assumed to be capable of storing (along with uncompressed data) data compressed using a sequence of a second compression (e.g., lighter compression) and a first compression (e.g., heavier compression), and thus a corresponding compression-decompression functional block (e.g., compression-decompression functional block 128) is capable of compressing and decompressing data using a first compression and a second compression. Furthermore, a second cache memory (e.g., L2 cache 118) is assumed to be capable of storing (along with uncompressed data) data compressed using a second compression only, and thus a corresponding compression-decompression functional block (e.g., compression-decompression functional block 124) is capable of compressing and decompressing data using a second compression only. In this example, the second cache memory is not capable of storing data compressed using a first compression. Furthermore, a third cache memory (e.g., L1 cache 114) is assumed to store only uncompressed data.

[0058] Also, unlike the example of FIG. 4, in the example of FIG. 5, both the second compression and the first compression sequence are applied to the data stored in the first cache memory. That is, the data is compressed using the second compression, and the already compressed data is compressed again using the first compression. This combination of compressions can reduce the data size even further than either compression alone. In some embodiments, the latter compression, i.e., the first compression, includes one or more operations to handle data of different lengths, since the data may have been successfully compressed using the second compression or may not have been compressed (if the data does not have a pattern, value, etc. that can be compressed by the second compression).

[0059] Also, in the example of Figure 5, it is assumed that the data has been successfully compressed using a sequence of the second compression and the first compression. If the data cannot be compressed despite an attempt to compress the data using the first compression and / or the second compression, the data is stored in the first cache memory in an uncompressed state or in some other one-time compressed state. In this case, the operation of Figure 5 is modified to operate using the one-time compressed data (similar to Figure 4).

[0060] The operation of Figure 5 begins when the compression / decompression functional block receives data in an uncompressed state (step 500). For this operation, the compression / decompression functional block receives data, such as a 64B cache line, from a memory (e.g., memory 104) or another source (e.g., a network interface, a processor, etc.) in an uncompressed state. In the "uncompressed" state, a full set of bits / bytes of data, depending on the type of data, are present and configured to represent the value of the data, and the data has not yet been compressed. For example, if the data includes one or more 32-bit floating point values, all 32 bits representing each value (sign, exponent, fraction, etc.) are present.

[0061] The compression / decompression functional block then compresses the data using a sequence of a first compression followed by a second compression (step 502). Each of the first compression and the second compression includes one or more compression operations in which some or all of the bits / bytes of the data are removed, reduced, replaced, or otherwise altered. The particular one or more compression operations for each of the first compression and the second compression, i.e., the changes made to the data during each compression, vary depending on the type of compression. For example, the first compression and / or the second compression may be or include one or more of pattern matching compression, value matching compression, zero-content compression, Lempel-Ziv (LZ) (and variations) compression, Markov compression, delta compression, etc.

[0062] In the operation of step 502, both the second compression and the first compression are performed on the data. The second compression is performed first, and thus the data is first compressed using the second compression because the second cache memory is capable of both storing and decompressing data compressed using the second compression. The first compression is then performed in an attempt to further reduce the data size. This compression sequence allows the data to be decompressed to reverse the effects of the first compression and restore the data to have only the effects of the second compression in preparation for storing a copy in the second cache memory. After compressing the data using the second compression and the first compression sequence, the compression and decompression functional block sets metadata (e.g., one or more bits) associated with the data to indicate that the data was compressed using the second compression and the first compression sequence and provides the compressed data to the first cache memory for storage (step 504).

[0063] When data is read from the first cache memory and stored in the second cache memory, the compression / decompression functional block decompresses the data to reverse the effect of the first compression on the data, thereby restoring the data to a state in which the data was compressed using only the second compression (step 506). For this operation, the compression / decompression functional block performs one or more decompression operations during which some or all of the bits / bytes of the data that were previously removed, reduced, replaced, or otherwise modified are restored to their values ​​after the second compression. As with compression, the particular one or more decompression operations performed depend on the type of first compression. During this operation, the compression / decompression functional block prepares the data for storage in the second cache memory (compressed using only the second compression) and updates metadata associated with the data to indicate that the data was compressed using only the second compression. The data compressed using the second compression (compressed in step 502) is then provided to and stored in the second cache memory (step 508).

[0064] When data is read from the second cache memory and stored in the third cache memory, the compression / decompression functional block restores the data to an uncompressed state by decompressing the data to reverse the effect of the second compression on the data (step 510). For this operation, the compression / decompression functional block performs one or more decompression operations during which some or all of the bits / bytes of data that were previously removed, reduced, replaced, or otherwise altered are restored to their original, complete values. As with compression, the particular one or more decompression operations performed depend on the type of second compression. During this operation, the compression / decompression functional block prepares the data for storage in the third cache memory (uncompressed). The uncompressed data is then provided to the second cache memory for storage (step 512).

[0065] In some embodiments, the electronic device (e.g., electronic device 100 and / or portions thereof) uses code and / or data stored in a non-transitory computer-readable storage medium to perform some or all of the operations described herein. More specifically, the electronic device reads the code and / or data from the computer-readable storage medium and executes the code and / or uses the data in performing the described operations. The computer-readable storage medium may be any device, medium, or combination thereof that stores code and / or data used by the electronic device. For example, the computer-readable storage medium may include, but is not limited to, volatile and / or non-volatile memory, including flash memory, random access memory (e.g., eDRAM, RAM, SRAM, DRAM, DDR4 SDRAM, etc.), read-only memory (ROM), and / or magnetic or optical storage media (e.g., disk drives, magnetic tapes, CDs, DVDs, etc.).

[0066] In some embodiments, one or more hardware modules perform the operations described herein. For example, a hardware module may include, but is not limited to, one or more processors / cores / central processing units (CPUs), application specific integrated circuits (ASICs) chips, neural network processors or accelerators, field programmable gate arrays (FPGAs), computational units, embedded processors, graphics processors (GPUs) / graphics cores, pipelines, accelerated processing units (APUs), functional blocks, controllers, compression / decompression functional blocks, and / or other programmable logic devices. When such a hardware module is activated, the hardware module performs some or all of the operations. In some embodiments, a hardware module includes one or more general purpose circuits configured to perform operations by executing instructions (program code, firmware, etc.).

[0067] In some embodiments, data structures representing some or all of the structures and mechanisms described herein (e.g., electronic device 100, compression and decompression functional blocks 124-128, cache memories in a hierarchy of cache memories, and / or portions thereof) are stored in a non-transitory computer-readable storage medium, including a database or other data structure that can be read by the electronic device and used directly or indirectly to manufacture hardware including the structures and mechanisms. For example, the data structure may be a behavioral level description or a register transfer level (RTL) description of the hardware functionality in a high-level design language (HDL) such as Verilog or VHDL. The description may be read by a synthesis tool, which may synthesize the description to generate a netlist from a synthesis library that includes a list of gates / circuit elements that represent the functionality of the hardware including the structures and mechanisms described above. The netlist may then be placed and routed, and a data set may be generated that describes the geometric shapes that are applied to the mask. The mask may then be used in various semiconductor manufacturing steps to manufacture one or more semiconductor circuits (e.g., integrated circuits) corresponding to the structures and mechanisms described above. Alternatively, the database on the computer accessible storage medium may be a netlist (with or without a synthesis library) or a data set or Graphical Data System (GDS) II data, as appropriate.

[0068] In this description, variables or unspecified values ​​(i.e., general descriptions of values ​​without specific instances of the value) are represented by letters such as N. Similar letters may be used elsewhere in this description, but as used herein, the variables and unspecified values ​​in each instance are not necessarily the same, i.e., there may be different variable quantities and values ​​for some or all of the general variables and unspecified values. In other words, N and other letters used to represent variables and unspecified values ​​in this description are not necessarily related to each other.

[0069] As used herein, the phrase "et cetra" or "etc." is intended to present the equivalent of "and / or," i.e., "at least one" of the elements in the list to which "etc." pertains. For example, in the sentence "the electronic device performs a first operation, a second operation, etc.", the electronic device performs at least one of the first operation, the second operation, and other operations. Moreover, the elements in the list to which "etc." pertains are merely examples in a set of examples, and at least some of the examples may not appear in some embodiments.

[0070] The foregoing descriptions of the embodiments have been presented for purposes of illustration and description only. They are not intended to be exhaustive or to limit the embodiments to the precise forms disclosed. Accordingly, many modifications and variations will be apparent to those skilled in the art. Moreover, the above disclosure is not intended to limit the embodiments. The scope of the embodiments is defined by the appended claims.

Claims

1. 1. An electronic device for compressing data for storage in a cache memory, comprising: a hierarchy of cache memories including a first cache memory and a second cache memory, the first cache memory being lower in the hierarchy than the second cache memory; At least one compression / decompression function block; The at least one compression / decompression functional block comprises: Receiving data in an uncompressed state; compressing the data using either a first compression or a second compression, and using the first compression if an attempt to compress the data using the second compression fails to compress the data; providing said data to said first cache memory for storage after said data is compressed; when the data is read from the first cache memory and stored in the second cache memory, and if the data is compressed using the first compression, decompressing the data to reverse the effect of the first compression on the data, thereby restoring the data to the uncompressed state; providing data compressed using the second compression or the uncompressed data to the second cache memory for storage; 4. The method of claim 3, Electronic devices.

2. a third cache memory in a hierarchy of cache memories, the second cache memory being lower in the hierarchy than the third cache memory; the at least one compression / decompression functional block, when the data is read from the second cache memory and stored in the third cache memory, and when the data is compressed using the second compression, decompressing the data to reverse the effect of the second compression on the data, thereby restoring the data to the uncompressed state; providing said data to said third cache memory for storage; 4. The method of claim 3, The electronic device of claim 1 .

3. the first compression being a heavier compression and the second compression being a lighter compression; decompressing the data using the lighter compression is faster than decompressing the data using the heavier compression. The electronic device of claim 2.

4. Compressing the data using either the first compression or the second compression includes: performing one or more second compression operations of the second compression on the data, the one or more second compression operations compressing data having a second characteristic; performing one or more first compression operations of the first compression on the data if the one or more compression operations of the second compression do not result in compression of the data because the data does not have the second characteristic, the one or more first compression operations compressing data having a first characteristic. The electronic device of claim 1 .

5. one or both of the first compression operation and the second compression operation include at least one of pattern matching compression, value matching compression, zero-content compression, Lempel-Ziv based compression, Markov compression, and delta compression; The electronic device of claim 4.

6. storing the data in an uncompressed state in the first cache memory and in the second cache memory if both the first characteristic and the second characteristic are absent from the data and neither the first compression nor the second compression results in compression of the data. The electronic device of claim 4.

7. After compressing the data using either the first compression or the second compression, the at least one compression and decompression functional block: and updating metadata associated with the data to indicate that the data was compressed using either the first compression or the second compression. The electronic device of claim 1 .

8. The at least one compression / decompression functional block comprises: receiving the other data in an uncompressed state; and compressing the other data using a sequence of the second compression and the first compression, the first compression supporting a variable input format; providing the other data to the first cache memory for storage after compressing the other data; decompressing the other data to reverse the effect of the first compression on the other data when the other data is read from the first cache memory and stored in the second cache memory, thereby restoring the other data to a state compressed using only the second compression; providing the other data compressed using the second compression to the second cache memory for storage; 4. The method of claim 3, The electronic device of claim 1 .

9. the at least one compression / decompression functional block receives the data from a memory; The electronic device of claim 1 .

10. the data stored in the memory is compressed using a third compression and decompressed to restore the data to its uncompressed state before the data is transferred to the compression / decompression functional block.

10. The electronic device of claim 9.

11. the data is compressed using a third compression for communication over one or more communication links between the memory and the at least one compression and decompression functional block.

10. The electronic device of claim 9.

12. 1. A method of compressing data for storage in a cache memory of an electronic device comprising: a hierarchy of cache memories including a first cache memory and a second cache memory, the first cache memory being lower in the hierarchy than the second cache memory; and at least one compression and decompression functional block, the method comprising: receiving data in an uncompressed state by said at least one compression / decompression functional block; compressing, by the at least one compression and decompression functional block, the data using either a first compression or a second compression, and using the first compression if an attempt to compress the data using the second compression fails to compress the data; providing said data to said first cache memory for storage after said data is compressed by said at least one compression / decompression functional block; when the data is read from the first cache memory and stored in the second cache memory by the at least one compression / decompression functional block, if the data is compressed using the first compression, decompressing the data to reverse the effect of the first compression on the data, thereby restoring the data to the uncompressed state; providing, by the at least one compression / decompression functional block, data compressed using the second compression or the data in an uncompressed state to the second cache memory for storage; method.

13. the electronic device further comprising a third cache memory in the hierarchy of cache memories, the second cache memory being lower in the hierarchy than the third cache memory; The method comprises: when the data is read from the second cache memory and stored in the third cache memory, and the data is compressed using the second compression; decompressing, by said at least one compression / decompression functional block, said data to reverse the effect of said second compression on said data, thereby restoring said data to said uncompressed state; providing, by the at least one compression / decompression functional block, the data to the third cache memory for storage.

13. The method of claim 12.

14. the first compression being a heavier compression and the second compression being a lighter compression; decompressing the data using the lighter compression is faster than decompressing the data using the heavier compression.

14. The method of claim 13.

15. Compressing the data using either the first compression or the second compression includes: performing one or more second compression operations of the second compression on the data, the one or more second compression operations compressing data having a second characteristic; performing one or more first compression operations of the first compression on the data if the one or more compression operations of the second compression do not result in compression of the data because the data does not have the second characteristic, the one or more first compression operations compressing data having a first characteristic.

13. The method of claim 12.

16. one or both of the first compression operation and the second compression operation include at least one of pattern matching compression, value matching compression, zero-content compression, Lempel-Ziv based compression, Markov compression, and delta compression; 16. The method of claim 15.

17. If both the first characteristic and the second characteristic are absent from the data and neither the first compression nor the second compression results in compression of the data, the method further comprises: storing the data in the uncompressed state in the first cache memory and the second cache memory.

16. The method of claim 15.

18. The method includes, after compressing data using either the first compression or the second compression, updating, by the compression / decompression functional block, metadata associated with the data to indicate that the data was compressed using either the first compression or the second compression.

13. The method of claim 12.

19. The method comprises: receiving, by said at least one compression / decompression functional block, said other data in an uncompressed state; compressing, by the at least one compression and decompression functional block, the other data using a sequence of the second compression and the first compression, the first compression supporting a variable input format; compressing the other data by the at least one compression / decompression functional block before providing the data to the first cache memory for storage; decompressing the other data to reverse the effect of the first compression on the other data when the data is read from the first cache memory and stored in the second cache memory, thereby restoring the other data to a state compressed using only the second compression; providing, by the at least one compression and decompression functional block, the data compressed using the second compression to the second cache memory for storage.

13. The method of claim 12.

20. receiving, by the at least one compression and decompression functional block, the data from a memory, the data being compressed using a third compression for storage in the memory and decompressed for communication to the at least one compression and decompression functional block.

13. The method of claim 12.

Citation Information

Patent Citations

  • Storage device

    JP1995210324A

  • Compression / development system for memory data

    JP2011170403A

  • Methods, devices and systems for hybrid data compression and decompression

    JP2018522457A

  • Cache system and a method of operating a cache memory

    US20130311722A1