Cache with reload capability after power restoration

A method and apparatus for repopulating a cache are disclosed. At least a portion of the contents of the cache are stored in a location separate from the cache. Power is removed from the cache and is restored some time later. After power has been restored to the cache, it is repopulated with the portion of the contents of the cache that were stored separately from the cache.

FIELD OF INVENTION

The present invention relates to computer cache memory, and more particularly, to methods and apparatus to reload the cache memory after power is removed and then restored to the cache memory.

BACKGROUND

In a computer, a cache is a small, fast memory separate from a processor's main memory that holds recently accessed data. Using the cache speeds up the access time for subsequent requests of the same data. A “cache hit” occurs when the requested data or memory location is found in the cache that is being searched. When the requested data or memory location is not found, it is considered a “cache miss,” and that data is likely allocated a new entry in the cache. If the cache is already full, one of many strategies may be employed to evict an existing entry.

A cache may include one or more tag storages and one or more data storages. A tag storage contains tags. Generically, a tag may be used to uniquely identify a cached piece of data and determine whether that cached data can be used to satisfy an incoming request. In one implementation, a tag may include an index of the main memory location of the cached data. In another implementation, in translation lookaside buffer (TLB) type caches, the tags may not directly index main memory locations, but may consist of virtual addresses and other request-based information that is not directly related to a specific main memory address. A data storage contains copies of the data from the main memory. The data storage may also contain data generated by the processor that has not yet been written out to the main memory (for example, with a write-back cache). Such data must be written out to memory before power can be removed from the cache.

To reduce power consumption in a computer, components (including internally integrated components) may be placed in low power states or completely powered off during idle periods. Powering off cache memories built with volatile storage elements results in a loss of state. Once power is restored, normal cache accesses will miss since the cache is empty, requiring data to be fetched from higher latency (and possibly lower bandwidth) persistent backing storage, resulting in lower performance. These accesses progressively refill the cache and, assuming that subsequent accesses start hitting these refilled entries, performance progressively recovers back to its nominal level.

Some existing techniques allow a cache to simultaneously power off a fraction of its contents, for example, both the tag storage and data storage. In one technique, power consumption may be reduced while maintaining state by providing power to only a portion of the cache. This particular solution consumes power in maintaining the state of some of the tag memories and corresponding data memories.

Other techniques reduce the cache's clock frequency to lower dynamic power consumption. Static power consumption may be reduced by a corresponding adjustment to the operating parameters of the cache's transistors (voltage reduction, biasing change, etc.).

The existing techniques result in a choice between sacrificing performance after power restoration to reduce power consumption or sacrificing optimal power consumption to retain power in a subset of the data storage to avoid the post-power restoration performance drop. Thus, there exists a need to power off most or all of a cache without sacrificing performance after the cache is powered on.

SUMMARY

A method for repopulating a cache begins by storing at least a portion of the contents of the cache in a location separate from the cache. Power is removed from the cache and is restored some time later. After power has been restored to the cache, it is repopulated with the portion of the contents of the cache that were stored separately from the cache.

A method for repopulating a cache begins by removing power from the cache and restoring power to the cache some time later. A cache client is signaled that power was restored to the cache and that the cache has lost state. The client issues a prefetch command to the cache, which uses the prefetch command to load data into the cache.

An apparatus for repopulating a cache includes a cache, a memory, and a memory controller. The cache is configured to store data and tags relating to the data. The memory is located separate from the cache and is configured to store tags from the cache when power is removed from the cache. The memory controller is configured to write tags from the cache to the memory when power is restored to the cache.

A computer-readable storage medium storing a set of instructions for execution by a general purpose computer to repopulate a cache, the set of instructions including a storing code segment, a removing code segment, a restoring code segment, and a repopulating code segment. The storing code segment is for storing at least a portion of the contents of the cache in a location separate from the cache. The removing code segment is for removing power from the cache. The restoring code segment is for restoring power to the cache. The repopulating code segment is for repopulating the cache with the portion of the contents of the cache stored separately from the cache.

DETAILED DESCRIPTION

The following describes an enhancement to an ordinary cache. Typically, when a cache is powered off, it takes a certain amount of time for the cache to refill with data and, therefore, the initial cache accesses are slower than before the cache was powered off. After power is restored, an empty cache may be progressively refilled as incoming requests miss the cache, which leads to new data filling the cache. The refilling process may be limited by the rate of the incoming requests, which may be slow because older requests are being serviced slowly due to the cache misses.

Data may be stored outside of the cache that is to be powered off so that the same data may be restored to the cache after power is returned and before a user requests that data from the cache again. Thus, the performance degradation is mitigated after powering on the cache because the data may be restored before the user makes a request to the cache for that piece of data. The refill process may overlap with normal processor requests and may not necessarily block the normal processor requests until the refill process is completed.

Power-gating may be used to reduce power consumption and the low performance period may be minimized by loading contents into the cache soon after power is restored. The cache may also be completely power-gated, eliminating all dynamic power and reducing static power to leakage through the power gates. In other embodiments, all of the data storage may be powered off, further minimizing power consumption.

A mechanism may be added to a cache to generate, and then save, preserve, or store “restore tags.” A restore tag contains enough information to locate and load data from the cache's backing storage memory after a power restoration event. It is similar in nature to a prefetch request, in that the data is fetched in anticipation that it will be needed by the cache in the near future to service one or more requests.

The restore tags are placed in a persistent storage location before powering off some or all of the cache to save power. When power is restored, the restore tags are used to load data from the cache's backing storage into the cache. This data loading is separate from, and generally in advance of, any loads triggered by normal cache requests. Some or all of the cache entries may be loaded in this manner. The loaded data may be the same data that was previously in the cache before being powered off or may be any data that is predicted to be useful after power is restored.

The restore tags may be constructed using information stored in the cache prior to the cache being powered off. This is based on the assumption that existing cache data will be needed after the power down period. A restore tag may be used to reload the exact data that was previously stored in the cache, to load useful intermediate information related to obtaining the data that was previously stored in the cache, or to load other data that is expected to be useful after restoring power. In such a case, the restore tag for a cache entry may be constructed based on the entry's tag contents (typically a portion of an address but possibly with additional attributes). Additional information may also be needed to construct the restore tag, such as the cache entry's logical address within the cache. Restore tags may also be constructed by software with knowledge of or expectations of the types of accesses that will occur soon after the cache is powered back on.

It is assumed that the cache has a backing storage memory that holds a duplicate copy of the cache's data contents. If the cache stores “dirty” write data that is more current than the data in the backing storage, the dirty data is written out to the backing storage memory before power is removed from the cache.

The embodiments described herein are applicable to many types of hardware caches including, but not limited to, instruction caches, data caches, translation lookaside buffers (TLBs), I/O TLBs, graphics data caches for textures and vertices, etc.

The cache's tags may be generated, saved, or preserved, and then loaded using a variety of mechanisms. Several embodiments include a mechanism to generate the restore tags either prior to the power off event, or after power has been restored. Additionally, several embodiments have a power-on reload engine that takes in restore tags after power restoration and uses the restore tags to load data into the cache from the cache's backing storage. The power-on reload engine may be combined or shared with existing logic such as a prefetch or load engine.

Design Variations

The following example embodiments are for instructional and explanatory purposes. One skilled in the art will recognize that variations of these embodiments are possible. Each embodiment has its own advantages and different power, performance, and complexity tradeoffs.

First Embodiment

In a first embodiment, as shown inFIGS. 1 and 2, a cache may store tag information and data information in separate memories. The cache may retain power for a subset of the tag memories, but allow the data memories and the remaining tag memories to be powered off. In this embodiment, the restore tags are generated after power is restored by using the preserved cache tags. The restore tags are used to load data contents from the cache's backing storage into the cache.

FIG. 1shows a portion of a memory system100, including a cache102, a cache controller104, a memory106, and a memory controller108. The cache102includes a first tag storage pool (Tag Storage Pool1)110, a second tag storage pool (Tag Storage Pool2)112, a first data storage pool (Data Storage Pool1)114, and a second data storage pool (Data Storage Pool2)116. The cache controller104includes a power-on reload engine118.

No special preparations are needed before powering off the cache. Tag Storage Pool1110retains its state and may remain powered on. Tag Storage Pool2112, Data Storage Pool1114, and Data Storage Pool2116are powered off (shown as shaded inFIG. 1). After power is restored, the power-on reload engine118in the cache controller104reads the tags from Tag Storage Pool1110and uses those tags as restore tags. The restore tags are used to fetch the data from memory106, and the fetched data is written to Data Storage Pool1114.

FIG. 2shows a flowchart of a method200for retaining power in a subset of tag memories while allowing data memories and other tag memories to be powered off. The method200involves creating and storing restore tags in a portion of the cache that remains powered on, which is accomplished by retaining state in a subset of tag stores (step202). Remaining tag stores along with all data stores may be powered off (step204). The tag store and data stores will remain powered off until a power on event is received.

Upon receiving the power on event, any caches that were powered off may be powered on (step206). Following power on, the restore tags are read (step208). The data may be fetched from memory using the restore tags (step210) and the fetched data may be written back into a data store (step212). The restore tags are used after power on to load data back into the cache before a user requests similar data from the cache.

The first embodiment involves tradeoffs between power, performance, and complexity. Most of the power related to cache storage is saved, but a small amount of power is still necessary to retain the state of one or more tag stores. The resulting performance depends on the usefulness of the stores that remain powered on. If a collection of recently used tags as well as less recently used tags are stored, performance may be lower. In one implementation, which includes preferentially allocating recently used tags to the tag store that remains powered on, performance may be higher. In another implementation, cache line swaps may be performed before removing power, such that the most recently used tags are transferred into the tag store that remains powered on. The complexity level for this embodiment is relatively low. There is no need to save data to an alternate location before removing power unless the cache line swapping logic, described above, is implemented.

Second Embodiment

In a second embodiment, as shown inFIGS. 3 and 4, a cache may generate restore tag information based upon the cache's tags. The cache may write the restore tags into a pool of persistent memory (on-chip or off-chip) before power is removed. This persistent memory may be in the fully operational state or a lower power state with retention, such as self-refresh, while the cache is powered off. In a typical personal computer (PC), this may be system memory or a separate dedicated pool of persistent memory. Restore tags or groups of restore tags may be stored in their normal encoding, or may be compressed before being written to persistent memory to reduce memory size and power requirements. When power is restored to the cache, the restore tags are read back into the cache and used to load data contents from the cache's backing storage into the cache.

FIG. 3shows a portion of a memory system300, including a cache302, a system memory304, a memory controller306, an internal persistent storage memory308, and processing engines310. The cache302contains a tag transfer engine312, a cache storage array314, and a power-on reload engine316. The system memory304contains cache tag storage318.

In preparation for power off, tags are read from the cache storage array314by the tag transfer engine312to generate restore tags. The tag transfer engine312writes the restore tags to either the cache tag storage318(through the memory controller306) or to internal persistent storage memory308. The tag transfer engine312may optionally compress the restore tags. The previous steps may optionally overlap, and cache tags may be read while previously generated restore tags are still being written out.

After power is restored, the power-on reload engine316reads restore tags from the cache tag storage318or the internal persistent storage memory308. The power-on reload engine316uses the restore tags (typically an address) to request the cache to fetch the data from system memory304. The cache302fetches the requested data and stores it in the cache storage array314. The previous three steps may overlap, meaning that once a restore tag is read, data related to that restore tag may be requested from the system memory304and stored in the cache storage array314before or while other restore tags are read.

FIG. 4shows a flowchart of a method400for writing restore tags to a pool of persistent memory before powering off the cache. In preparation for powering off the cache, tags are read from the cache to generate restore tags (step402). The restore tags may then be written to persistent memory (step404). Step402and step404may overlap, such that cache tags may be read (step402) while previously generated restore tags are written to the persistent memory (step404). Optionally, the restore tags may be compressed (step406) before the restore tags are written to the persistent memory (step404). Then, the cache may be powered off (step408). The cache will remain powered off until a power on event is received.

Upon receiving the power on event, the cache is powered on (step410) and the restore tags may be read from the persistent memory (step412). Data may be requested from backing storage using the restore tags (step414) and the requested data may be fetched and stored in the cache (step416). Steps412,414, and416may overlap, such that once a restore tag is read, data related to that restore tag may be requested from the backing storage and stored in the cache before or while other restore tags are read.

The second embodiment also demonstrates power, performance, and complexity tradeoffs. Maximum power is conserved if the restore tags are stored in the system memory, because the system memory already needs power to retain its state. A relatively small amount of extra power is consumed if the restore tags are stored in a separate, on-chip memory. The performance of the second embodiment is high because the implementation may preferentially choose to store either all of the tags or possibly a subset of tags, including the most recently used tags. The complexity level is moderate because the restore tags need to be generated and moved within the system.

Third Embodiment

In the third embodiment, as shown inFIGS. 5 and 6, a cache may generate restore tags. The restore tags may be written to a non-volatile memory somewhere within the system before the cache is powered off. The non-volatile memory may remain powered on or be powered off when the cache is powered off. Restore tags or groups of restore tags may be stored in their normal encoding, or may be compressed before being written to the non-volatile memory. Compressing restore tags may reduce memory and power requirements. When the cache is powered on, the non-volatile storage containing the restore tags is powered on. The contents of the non-volatile storage are read back into the cache and used to load data contents from the cache's backing storage into the cache.

FIG. 5shows a portion of a memory system500, including a cache502, a non-volatile memory504, a system memory506, a memory controller508, and processing engines510. The cache502contains a tag transfer engine512, a cache storage array514, and a power-on reload engine516.

In preparation for power off, the tag transfer engine512reads tags from the cache storage array514. The tag transfer engine512generates restore tags and writes them to the non-volatile memory504. The tag transfer engine512may optionally compress the restore tags. The previous steps may optionally overlap, such that cache tags may be read while previously generated restore tags are still being written out. After desired tags are stored, the cache502may be powered off. Optionally, the non-volatile memory504may be powered off to save additional power.

After power is restored, the cache502and the non-volatile memory504, if necessary, may be powered on. The power-on reload engine516reads restore tags from the non-volatile memory504. The power-on reload engine516uses the restore tags (typically an address) to request the cache data from the system memory506. The cache502fetches the requested data and stores it in the cache storage array514. The previous three steps may overlap, such that once a restore tag is read, data related to that restore tag may be requested from the system memory506and stored in the cache storage array514before or while other restore tags are read.

FIG. 6shows a flowchart of a method600for writing restore tags to a non-volatile memory before powering off the cache. In preparation for power off, tags may be read from the cache to generate restore tags (step602). The restore tags may then be written to the non-volatile memory (step604). Step602and step604may overlap, such that cache tags may be read (step602) while previously generated restore tags are written to the non-volatile memory (step604). Optionally, the restore tags may be compressed (step606) before the restore tags are written to the non-volatile memory (step604). The cache and the non-volatile memory may be powered off (step608). The cache will remain powered off until a power on event is received.

Upon receiving the power on event, the cache and the non-volatile memory (if powered off) may be powered on (step610). Following power on, restore tags may be read from the non-volatile memory (step612). Data may be requested from backing storage using the fetched restore tags (step614) and the requested data may be fetched and stored in the cache storage array (step616). Steps612,614, and616may overlap, such that once a restore tag is read from the non-volatile memory, the data related to that restore tag may be requested from the backing storage and stored in the cache before or while other restore tags are read.

The third embodiment demonstrates power, performance, and complexity tradeoffs. The non-volatile memory of the third embodiment saves slightly less power than the system memory implementation of the second embodiment. But, more power may be saved than with the second embodiment when the second embodiment uses a separate, always-on memory for the restore tags. This is especially true if the caches are powered off for a relatively long period of time. The performance of the third embodiment is high, because the implementation may preferentially choose to store either all of the tags or possibly a subset that includes the most recently used tags. Finally, the complexity level is high because the third embodiment requires integration of the non-volatile memory.

Fourth Embodiment

In a fourth embodiment, as shown inFIGS. 7 and 8, a multi-level cache design is used. Multi-level caches are used to combat the tradeoff between cache latency and hit rate. Small caches tend to have a shorter latency but a lower hit rate, while larger caches tend to have a higher hit rate but longer latency. Multi-level caches typically check a smaller cache first, then proceed to check a larger cache only if the data is not located in the smaller cache. Higher level caches are progressively checked until all caches are checked and then external memory is checked. In a strictly inclusive design, all data in a smaller cache is also in the larger cache. In an exclusive design, all data is in at most one of the caches. In semi-inclusive designs, some of the data from the smaller, lower level caches may also be in the larger, higher level caches.

In the fourth embodiment, lower cache levels may duplicate the contents of higher cache levels (for example, using an inclusive or semi-inclusive design). This embodiment may allow a higher level cache to be powered off while a lower level cache remains powered on. When the higher level cache is powered back on, contents from the lower level cache may be directly transferred back into the higher level cache. This may have performance benefits, since the higher level cache is typically larger and less likely to evict those entries due to capacity issues.

FIG. 7shows a portion of a memory system700, including a power-gated higher level cache (Level N Cache)702, a plurality of lower level caches (Level N-M Caches)7040-704n, a memory706, and a memory controller708.

No special preparation is needed before powering off the Level N Cache702. The Level N Cache702is powered off, while all or a subset of Level N-M Caches7040-704nremain powered on. After power is restored, each Level N-M Cache7040-704ngenerates and sends tag and data information back to the Level N cache702. The Level N Cache702writes the tag and data information into its local storage memory.

FIG. 8shows a flowchart of a method800for using a multi-level cache design to restore data to a higher level cache from lower level caches. A higher level cache may be powered off (step802). A subset of the lower level caches may remain powered on (step804). The higher level cache remains powered off until a power on event is received.

Upon receiving the power on event, the higher level cache is powered on (step806). The lower level caches generate and send tag and data information back to the higher level cache (step808). The higher level cache writes tag information and data information into its local storage memory (step810).

The fourth embodiment demonstrates tradeoffs between power, performance, and complexity. The fourth embodiment offers a high power savings, because the entire higher level cache may be powered off. But, relatively poor performance is expected, because only the data contained in the lower level cache is transferred to the higher level cache and that data is already available in the lower level caches. Performance benefits are expected when cache lines from the lower level caches get evicted due to capacity issues and the older lines that were previously transferred to the higher level cache are needed again. Moderate complexity is expected. In an inclusive or semi-inclusive cache design, cache lines are not typically transferred from lower level caches up to higher level caches as they are in an exclusive cache design. Thus, this embodiment, involving inclusive or semi-inclusive designs, may require adding new data paths to move cache lines from the lower level caches to a higher level cache.

Fifth Embodiment

In a fifth embodiment, as shown inFIGS. 9 and 10, a multi-level cache design is used. Lower cache levels may duplicate the contents of higher cache levels (i.e., using an inclusive or semi-inclusive design). This embodiment may allow a higher level cache to be powered off while a lower level cache remains powered on. When the higher level cache is powered on, restore tags may be generated based upon the contents of the lower level caches. The restore tags may be used to load data from the backing storage into the higher level cache. This is particularly advantageous in a translation lookaside buffer (TLB) design, which is a cache for address translation. In such a design, restore tags from translation entries in the lower level caches may allow the higher level caches to load hierarchical directory information in addition to the actual translation entry.

FIG. 9shows a portion of a memory system900, including a power-gated higher level cache (Level N Cache)902, a plurality of lower level caches (Level N-M Caches)9040-904n, a memory906, and a memory controller908. The Level N Cache902includes a power-on reload engine910.

No special preparation is required before powering off the Level N Cache902. The Level N Cache902is powered off, while all or a subset of Level N-M Caches9040-90nremain powered on. After restoring power, each Level N-M Cache9040-904ngenerates restore tags based on its local cache tag information. The Level N-M Caches9040-904nthen issue reload commands to the Level N Cache902based on the generated restore tags. The power-on reload engine910in the Level N Cache902uses the reload commands from Level N-M Caches9040-904nto request data from the memory906. The Level N Cache902stores the reloaded data into its cache storage memory. In these last two steps, the Level N Cache902may request, fetch, and store multiple pieces of data from memory906for each reload request if it must traverse multiple levels of hierarchical data. An example of this is if the cache is a TLB and must traverse multiple directory levels before reaching the final translation entry. All hierarchical information and directory entries fetched in this manner may also be stored in the Level N Cache902along with the final translation. This may be the equivalent of retaining the steps taken to arrive at the result.

FIG. 10shows a flowchart of a method1000for using a multi-level cache design to generate restore tags based upon the contents of lower level caches. A higher level cache may be powered off (step1002). A subset of the lower level caches may remain powered on (step1004). The higher level cache remains powered off until a power on event is received.

Upon receiving the power on event, the higher level cache is powered on (step1006) and the lower level caches generate restore tags based on local cache tag information (step1008). The lower level caches issue reload commands to the higher level cache based upon the restore tags (step1010). The higher level cache uses the reload commands to request data from its backing storage (step1012) and stores the reloaded data in its storage memory (step1014). The higher level cache may, optionally, retain hierarchical directory information (step1016) and write that information to its storage memory.

The fifth embodiment demonstrates tradeoffs between power, performance, and complexity. It offers a high power savings because the entire higher level cache may be powered off. Moderate performance is expected because more information is loaded into the higher level cache than with the fourth embodiment. But, performance will likely be lower than the first three embodiments, because only information from the smaller, lower level caches is retained. A low complexity level is expected. In this embodiment, a request from one of the lower level caches to the higher level cache may be similar to a cache miss in the lower level cache, which requires service from the higher level cache.

Sixth Embodiment

In a sixth embodiment, as shown inFIGS. 11 and 12, a list of restore tags may be programmed by software into a persistent storage location, such as a system memory or an internal memory. The cache may be persistently programmed or have implicit knowledge of where to locate the restore tags. Whenever the cache is powered on, the list of restore tags may be accessed and used to load data contents from the cache's backing storage into the cache.

FIG. 11shows a portion of a memory system1100, including a cache1102, an internal persistent storage memory1104, a system memory1106, a memory controller1108, and processing engines1110. The cache1102includes a power-on reload engine1112and a cache storage array1114. The processing engines1110include software1116.

Before or during the time that the cache is powered off, the software1116writes the restore tag information to the persistent storage. This persistent storage may be, for example, the internal persistent storage memory1104or the system memory1106. The cache1102may then be powered off. The cache1102remains powered off until a power on event is received. Upon receiving the power on event, the cache1102is powered on and the power-on reload engine1112reads restore tags from the system memory1106or the internal persistent storage memory1104. The power-on reload engine1112uses the restore tags (typically an address) to request the cache to fetch data from the system memory1106. The cache fetches the requested data and stores it in the cache storage array1114. The previous three steps may overlap, such that once a restore tag is read, data related to that restore tag may be requested from the system memory1106and stored in the cache storage array1114before or while other restore tags are read.

FIG. 12shows a flowchart of a method1200for creating a list of restore tags programmed by software and storing the restore tags in a persistent storage location. The software writes restore tag information to persistent storage (step1202). The cache may be powered off at any time (step1204). The cache remains powered off until a power on event is received.

Upon receiving the power on event, the cache is powered on (step1206) and the restore tags are read from the persistent memory (step1208). The restore tags are used to request data from the backing storage (step1210) and the requested data is fetched and stored in the cache (step1212). Steps1208,1210, and1212may overlap, such that once a restore tag is read, data related to that restore tag may be requested from the backing storage and stored in the cache before or while other restore tags are read and processed.

The sixth embodiment saves maximum power if the restore tags are stored in the system memory, because the system memory already requires power to retain state. A small amount of extra power is consumed if the restore tags are stored in a separate, on-chip memory. Lower performance is expected for this embodiment as compared to the first three embodiments, because the software may not be able to maintain the list of restore tags with the same update frequency as hardware. The hardware complexity is lower than the other embodiments, because there is no hardware necessary to save the restore tags. However, moderate software complexity is expected, since the software needs to maintain an active list of restore tags.

Seventh Embodiment

In a seventh embodiment, as shown inFIGS. 13 and 14, a list of restore tags is generated and updated based upon normal cache accesses. For example, a list of the last overall N requests or the last N requests from each of a number of sources may be saved and continually updated. This list may be filtered to remove duplicate, similar or overlapping entries. The list of restore tags may be stored in a persistent storage location that maintains state while the cache is powered off. It may also be stored in a non-persistent location. If stored in a non-persistent location, the list of restore tags may be transferred to a persistent storage location in preparation for powering off the cache and the non-persistent storage. After the cache is powered on, the restore tags are used to load data contents from the cache's backing storage into the cache.

FIG. 13shows a portion of a memory system1300, including a cache1302, processing engines1304, an internal persistent storage memory1306, a system memory1308, and a memory controller1310. The processing engines1304include software1312. The cache1302includes a restore tag list1314, a power-on reload engine1316, and a cache storage array1318.

During normal operation, accesses to the cache1302from a client (processing engines1304in this case) are used to generate restore tags that are stored in either a persistent storage location or a non-persistent location. The software1312writes the restore tag information to, for example, the persistent storage—either the internal persistent storage memory1306or the system memory1308. If the restore tag list1314will lose state when the cache1302is powered off, the restore tag list1314must be transferred to a persistent storage location prior to powering off the cache1302. The cache1302is then powered off and remains powered off until a power on event is received.

Upon receiving the power on event, the cache is powered on and the power-on reload engine1316reads the restore tags. The power-on reload engine1316uses the restore tags (typically an address) to request the cache data from the system memory1308. The cache1302fetches the requested data and stores it in the cache storage array1318. The previous three steps may overlap, such that once a restore tag is read, data related to that restore tag may be requested from the system memory1308and stored in the cache storage array1318before or while other restore tags are read.

FIG. 14shows a flowchart of a method1400for generating and updating a list of restore tags based upon normal cache accesses. Client accesses to the cache are used to generate restore tags (step1402). Optionally, the restore tags may be filtered to remove duplicate, similar, or overlapping entries (step1404). The restore tags are stored in a persistent storage location or in a non-persistent storage location (step1406). The restore tag list may be transferred to a persistent storage location if it is in a non-persistent storage location (step1408). The cache may then be powered off (step1410). The cache remains powered off until a power on event is received.

Upon receiving the power on event, the cache is powered on (step1412) and the restore tags are read (step1414). The restore tags are used to request data from the backing storage (step1416) and the requested data is fetched and stored in the cache (step1418). Steps1414,1416, and1418may overlap, such that once a restore tag is read, the data related to that restore tag may be requested from the backing storage and stored in the cache before or while other restore tags are read and processed.

The seventh embodiment saves maximum power if the restore tags are stored in the system memory, because the system memory already requires power to retain state. A small amount of extra power is consumed if the restore tags are stored in a separate, on-chip memory. Performance is expected to be high because the implementation may preferentially choose to store either all of the tags or possibly a subset of tags, including the most recently used tags. The complexity level is moderate because the restore tags need to be generated and moved within the system. In this implementation, more logic and storage is needed to hold the separate list of restore tags. However, no logic is needed to scan through the cache tags to determine which ones to save as restore tags.

Eighth Embodiment

In an eighth embodiment, as shown inFIGS. 15 and 16, a cache client that makes requests to the cache may be made aware of the cache's power state. If the client induces the cache to power up or detects a cache power up event, it may generate and send a special stream of prefetch commands to the cache. These prefetch commands act similar to the restore tags and induce the cache to load information from its backing storage. The client may generate prefetch commands to trigger the loading of data that the client thinks it needs in the near future. This is different from the normal generation of prefetch commands to the cache, because it is associated with the cache power up event. Additionally, the client may issue prefetch commands that it had previously issued to the cache before it was powered down.

FIG. 15shows a portion of a memory system1500, including a cache1502, a system memory1504, and a memory controller1506. The cache1502includes a cache storage array1508. A client1510may access the cache1502and the system memory1504. While one client is shown inFIG. 15, it is noted that any number of clients may communicate with the cache1502and the system memory1504.

The cache1502is powered off. After power is restored, the cache1502signals the client1510that it has just powered on and that state has been lost. The client1510issues a series of prefetch commands to the cache1502. These prefetch commands may have been previously issued to the cache1502before the power off event. The cache1502uses the prefetch commands to load data into the cache1502from the system memory1506in advance of actual accesses and requests from the client1510.

FIG. 16shows a flowchart of a method1600for using prefetch commands after power on to induce the cache to load information from its backing storage. The cache may be powered off at any time (step1602). After the cache is powered on (step1604), the cache signals to a client that a power on has occurred and that state has been lost (step1606). The client issues prefetch commands to the cache (step1608). The client may issue prefetch commands that had previously issued before the power off (step1610). The cache uses the prefetch commands to load data into the cache (step1612).

The eighth embodiment saves maximum power because the information gathered from the prefetch commands is located in the system memory, which already necessarily retains its state. Performance of this embodiment depends on the accuracy of the prefetching. The greater the anticipation and the earlier that prefetching may occur, the better the performance. Some applications may perform better with this embodiment, while other applications may benefit more from the other embodiments, depending on the client's cache access patterns. The complexity level is low for the cache portion of this embodiment; added complexity is expected for the processor because it needs to dynamically control the level of prefetching that occurs in response to the cache power state.