The purpose and advantages of the present disclosure will be apparent to those of ordinary skill in the art from the following detailed description in conjunction with the appended drawings in which like reference characters are used to indicate like elements, and in which:
In an alternate embodiment, the address of information resulting in a cache miss is compared to an address range to identify a cache way mask to be used.
Referring now to
In at least one embodiment, the cache 120 is utilized to store information for use by the processor 110 or utilized to facilitate the transfer of information between, for example, the system memory 130 and the display frame buffer 140. As will be appreciated, such transfers typically are initiated by the processor 110 prior to or during the execution of one or more instructions by the processor 110. As noted above, the storage for information for use by the processor 110 or the transfer of information may result in the overwriting of information already present in the cache memory 122. Being overwritten, this information consequently is unavailable for use by the processor 110 during subsequent operations, and therefore the overwriting of this information may hinder the efficiency of the processor 110 as well as the cache 120. Accordingly, in at least one embodiment, the cache control module 124 may implement a cache access control policy that restricts access to one or more portions (e.g., one or more ways or one or more cache blocks) of the cache memory 122 during certain types of information transfers and information storages in the cache memory 122. This access control policy may identify a subset of the plurality of ways or cache blocks that contain information expected to be used by the processor 110 subsequent to the information transfer or information storage operation, as well as those ways/cache blocks of the cache memory 122 that may contain information that is not expected to hold or store information to be utilized by the processor 110 subsequent to the information transfer. The access control policy therefore may identify those ways/cache blocks which may be utilized during the information transfer operation without substantially impeding the efficiency of the information processor 110 in its use of the cache 120. As discussed in detail herein, the access control policy may be implemented by one or more sets of cache masks that indicate those ways of the cache memory 122 which may be used to store information during an information transfer operation, as well as those ways which are prohibited from being used during an information transfer operation. It will be appreciated that information transfers from system memory 130 resulting in information being stored at cache 120 can include instruction information transfers from instruction space of memory 130 or application information transfers from data space (i.e. not instruction space) of memory 130.
The particular access policy utilized during an information transfer operation, in one embodiment, is selected based on a restricted identifier signal 116 provided or asserted by the processor 110 in response to, or in preparation of, an execution of a particular information transfer operation. Based on the signal 116 asserted or provided by the processor 110, the cache control module 124 selects an access policy to apply to the cache memory 122 so as to limit or prevent access to one or more ways of the cache memory 122.
The processor 110 may utilize an instruction analysis module 160 (e.g., a software, hardware or firmware module) to analyze instructions to be executed or currently executed by the processor 110 so as to determine whether to assert the signal 116. In one embodiment, the module 160 determines whether to assert the restricted identifier signal 116 based on a determination that an instruction to be executed is identified as a particular type of instruction associated with the transfer of transient information or large blocks of information, such as video data. Based on this identification, the module 160 may operate the processor 110 so as to assert the restriction signal 116 or directly assert the signal 116.
In one embodiment, particular instructions associated with large information transfers or information transfers of relatively transient information are identified based upon at least one of a prefix field or an opcode field of the instruction currently executed or to be executed. To illustrate, the REP instruction (prefix 0x F3 in the x86 architecture) is commonly used in the x86 processing architecture to repeat certain instructions such as the move string (MOVS) instruction (opcode 0xA4 or 0xA5 in the x86 architecture, depending upon operand size). Accordingly, the module 160 may analyze an instruction to be executed by the processor 110 to determine whether the prefix field of the instruction to be executed substantially matches the prefix field associated with the REP instruction. Further, the module 160 may also scrutinize the opcode field to be executed to determine whether it substantially matches the opcode value associated with the move string instruction. Should one or both of the fields of the instruction to be executed match the fields of a REP MOVS instruction, the module 160 may cause the restriction signal 116 to be asserted. However, it will be appreciated that in some instances, the REP MOVS instruction may be utilized in operations that do not utilize relatively large blocks of information or do not transfer transient information. Accordingly, in at least one embodiment, the REPNE instruction (prefix 0xF2 in the x86 architecture) may be utilized to identify information transfer operations that are to have restricted cache access. To illustrate, a particular instruction typically not utilized, such as the REPNE MOVS command may be utilized to particularly identify an information transfer operation that involves large blocks of information or relatively transient information via the cache 120. In this embodiment, the module 160 may scrutinize operations to be executed by the processor 110 to identify those that utilize the particular operation (e.g., the REPNE MOVS operation). Based on the identification of this unique operation, the module 160 may cause the restricted identifier signal 116 to be asserted.
Referring now to
The way select module 240 receives the one or more cache masks output by the multiplexer 230 and applies them as the access policy of the cache memory 122 so as to restrict access to one or more ways of the cache memory 122 during the execution of the instruction at the processor 110. As illustrated, the cache module 212 and 222 may comprise a plurality of fields where each field corresponds to one of the plurality of ways of the cache memory 122, and wherein access to a particular way of the cache memory 222 is controlled based on the value (i.e., 0 or 1) stored at the field of the cache mask associated with a particular way. Alternatively, the cache masks 212 or 222, may comprise a plurality of fields, each field associated with a particular cache line, wherein the value stored in each field of the prior fields controls access to the corresponding cache line.
In at least one embodiment, the cache mask 212 implemented during operations that do not involve the transfer of large blocks of information or the transfer of transient information typically are less restrictive than the cache mask 222 implemented during operations involving the transfer of transient information or large blocks of information, so as to prevent or limit the amount of overwriting of valid information which is expected to be used by the processor 110 subsequent to the information transfer operation. The particular access control policy to be implemented using the cache mask 212 or cache mask 222 may be predetermined or may be constructed or modified on the fly by, for example, an operating system 250 executed by the processor 110 or other processing device. To illustrate, the operating system 250 or other component of the cache 120 may monitor the cache memory 122 to determine or identify those portions of the cache which have been either most recently used, least recently used, or having some other appropriate performance parameter. Using this information, the operating system may set one or both of the cache masks 212 or 222 so as to protect those ways identified as being frequently used or most recently used, while allowing access to those ways identified as being the least frequently used or used last. Other considerations, such as the amount of valid information stored in a particular way, further may be utilized to determine whether or not access to a particular way should be granted in a particular access control policy. Although an exemplary implementation of a control access policy utilizing cache masks is illustrated, those skilled in the art may, using the guidelines provided herein, implement cache access policies utilizing other techniques without departing from the spirit or the scope of the present disclosure.
The way select module 240, in one embodiment, receives the cache mask output by the multiplexer 230 and implements the access control policy represented by the output cache mask. In one embodiment, the cache way mask contains a bit for each way of the cache. If a bit is asserted in the mask, then the corresponding way will not be replaced by the information being accessed. The cache controller will instead select a way to be overwritten with the new information among the ways having deasserted mask bits using conventional cache replacement policies (e.g., least-recently-used way or an unused way). In one embodiment, it will be appreciated that a mask state of a specific cache way of the plurality (N) of cache ways is stored a specific offset location within each corresponding way mask. For example, the left-most bit of each of way mask 210 and way masks 220 corresponds to a first way of the cache 120. While each cache way is represented by a single bit in each of the cache masks, it will be appreciated that more that one bit can :used to represent a specific cache way.
Referring now to
Referring now to
Referring now to
The method 600 of
Referring now to
In conventional systems, the transfer of transient information to particular partitions of the various caches results in an update in the MRU/LRU information associated with the cache partitions so as to reflect the writing of the transient information to the particular partitions. As the cache partitions holding this transient information are indicated as MRU information, the cache control logic typically will prevent the overwriting of these cache partitions until they become relatively aged compared to the other cache partitions. However, these cache partitions preferably would be accessible after the information transfer operation is complete as the transferred information was only transient in the cache. Accordingly, in one embodiment, the line select module 704 prevents the MRU/LRU array 502 from being updated during an information transfer operation involving transient information so that the LRU/MRU status of the cache lines used for the information transfer is not updated as a result of their use, or the line select module 704 may modify the MRU/LRU array 502 so that the entries of the array 706 corresponding to the cache lines used in the information transfer are changed to indicate that the cache lines were the least recently used cache lines. As a result, the cache lines used for storing transient information may be available for other operations following the information transfer operation.
It will be appreciated that conventional systems may utilize multiple cache levels whereby information is distributed among multiple caches during an information transfer operation. To illustrate, a processing system may utilize a level one (L1) cache, a level two (L2) cache to facilitate the temporary storage of information for use by a processor. However, after transient information is stored in a higher-level cache during an information transfer operation, the corresponding MRU/LRU information in conventional systems typically indicate that the transient information was most recently used and therefore might cause the overflow of information to a lower-level victim cache. To counter this situation, the line select module 704 further may maintain the transient line tag register 706 to reflect whether the corresponding cache lines of cache memory 122 contain transient information. To illustrate, the register 706 may comprise a one-bit field for each cache line of the cache memory 122. When a particular cache line is used to store transient information, the line select module 704 may write a “1”, for example, to the entry of the register 706 corresponding to the particular cache line to indicate that the particular cache line holds transient information.
The transient line tag register 706 then may be utilized in determining whether to spill information over to a victim cache. A victim module 708 associated with a lower-level cache, such as, for example, L2 cache 710, may analyze the register 706 before allowing information to be transferred to the L2 cache 710. In the event that a field of the register 706 associated with a particular cache line has a “1” to indicate that the cache line holds transient information, the victim module 708 directs the cache 120 to store the information in the cache line rather than spilling it over to the L2 cache 710. The victim module 708 then may clear the field of the register 706 by writing a “0” to indicate that the corresponding cache line no longer contains the transient information from the information transfer operation. Thus, when the victim module 708 detects a “0” in the field of the register 706 that corresponds to a particular cache line (thereby indicating that the information in the particular cache line isn't transient information), the victim module 708 may allow information to be spilled over to the L2 cache 710.
The method 800 of
It will be appreciated that in an alternate cache way cache allocation can select amongst access policies using different or additional criteria than that previously described. For example,
CPU 910 is analogous to CPU 110 of
Bus 950, system memory 930, and video frame buffer 940 operate in similar manners as bus 150, system memory 130, and video frame buffer 140 as previously described. Cache module 920 is utilized to store information for use by the processor 910 or utilized to facilitate the transfer of information between, for example, the system memory 930 and the display frame buffer 940. As will be appreciated, such transfers typically are initiated by the processor 910, prior to or during the execution of one or more instructions by the processor 910. As noted above, the storage of information for use by the processor 910 or the transfer of information may result in the overwriting of information already present in the cache memory 922. Being overwritten, this information consequently is unavailable for use by the processor 910 during subsequent operations, and therefore the overwriting of this information may hinder the efficiency of the processor 910 as well as the cache 920. Accordingly, in at least one embodiment, the cache control module 924 may implement a cache access control policy that restricts access to one or more portions (e.g., one or more ways or one or more cache blocks) of the cache memory 922 during information transfers affecting one or more specific address ranges as identified in a storage location such as registers 925. This access control policy may identify a subset of a plurality of ways that contain information expected to be used by the processor 910 subsequent to the information transfer from a specific location in memory, as well as those ways/cache blocks of the cache memory 922 that may contain information that is not expected to hold or store information to be utilized by the processor 910 subsequent to the information transfer. The access control policy therefore may identify those ways/cache blocks that may be utilized during the information transfer operation without substantially impeding the efficiency of the information processor 910 in its use of the cache 920. As discussed in detail herein, the access control policy may be implemented by one or more sets of cache masks that indicate those ways of the cache memory 922 which may be used to store information during an information transfer operation, as well as those ways which are prohibited from being used during an information transfer operation.
During operation, in response to a cache miss, one of the way masks 1010, 1024, and 1034 is used by the cache control module 1024 to modify the way select policy, thereby resulting in the cache policy being based upon an address of the information being accessed. Therefore, a restricted way mask of module 1020 is selected when an address causing the cache miss is within an address range of a corresponding address range field of module 1020. In addition, module 1020 asserts a select signal to multiplexer 1030 to select the restricted way mask when the miss address is within a restricted range or to select the normal way mask when the miss address is not within a restricted range. It will be appreciated that the address range fields 1023 and 1033 can further include both a beginning address (ADDR_L) and an ending address (ADDR_H) that indicate an address range. In an alternate embodiment, only a beginning address range is needed when there is an implied length associated with the address range. For example, a single address can identify the first byte of an address range having a fixed size. In another embodiment, a base address can be provided along with an address mask, wherein the address mask is applied to a current address to obtain a masked address result that is compared to the base address. When the masked address is the same as the base address the current address is within a range specified by a value at the address mask register.
In one embodiment, registers 1010, 1022, and 1032 are user definable registers of the programmer's model of an integrated device.
The way mask selected at multiplexer 1030 is used by the way select module 1040 to exclude specific ways from consideration from a cache select process that determines which one of the available caches ways will store the TAG and information that caused the cache miss. Basing a way select process on the address causing the miss provides the ability for specific portions of instruction space and information space to be cached differently to prevent code or information that is more important that other code or information from being evicted from the cache. For example, a cache way that includes an interrupt routine or information that is high priority information can be protected from being evicted from cache by lower priority routines or information, thereby improving performance of a system. This embodiment allows an application to reserve specific cache ways for certain types of information while still allowing other ways of the cache to store lower priority information. This allows multiple ways to be allocated between more and less critical information in an embedded system to optimize system performance.
The above-disclosed subject matter is to be considered illustrative, and not restrictive, and the appended claims are intended to cover all such modifications, enhancements, and other embodiments that fall within the true spirit and scope of the present invention. Thus, to the maximum extent allowed by law, the scope of the present invention is to be determined by the broadest permissible interpretation of the following claims and their equivalents, and shall not be restricted or limited by the foregoing detailed description.
The present application is related to U.S. patent application Ser. No. 11/052,650 (Client Reference No. P0005; Attorney Docket No.: 1458-P0005) entitled “SYSTEM HAVING CACHE MEMORY AND METHOD OF ACCESSING,” and filed on Feb. 7, 2005, the entirety of which is incorporated by reference herein.