WO2010116735A1 - キャッシュメモリ装置、キャッシュメモリ制御方法、プログラムおよび集積回路 - Google Patents

キャッシュメモリ装置、キャッシュメモリ制御方法、プログラムおよび集積回路 Download PDF

Info

Publication number
WO2010116735A1
WO2010116735A1 PCT/JP2010/002551 JP2010002551W WO2010116735A1 WO 2010116735 A1 WO2010116735 A1 WO 2010116735A1 JP 2010002551 W JP2010002551 W JP 2010002551W WO 2010116735 A1 WO2010116735 A1 WO 2010116735A1
Authority
WO
WIPO (PCT)
Prior art keywords
line
index
hit
address
miss
Prior art date
Application number
PCT/JP2010/002551
Other languages
English (en)
French (fr)
Inventor
加藤一臣
Original Assignee
パナソニック株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by パナソニック株式会社 filed Critical パナソニック株式会社
Priority to US12/997,093 priority Critical patent/US9026738B2/en
Priority to JP2011508245A priority patent/JP5347019B2/ja
Priority to CN2010800017981A priority patent/CN102057359A/zh
Publication of WO2010116735A1 publication Critical patent/WO2010116735A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0862Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with prefetch
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0893Caches characterised by their organisation or structure
    • G06F12/0895Caches characterised by their organisation or structure of parts of caches, e.g. directory or tag array
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/12Replacement control
    • G06F12/121Replacement control using replacement algorithms
    • G06F12/126Replacement control using replacement algorithms with special data handling, e.g. priority of data or instructions, handling errors or pinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/60Details of cache memory
    • G06F2212/6042Allocation of cache space to multiple users or processors
    • G06F2212/6046Using a specific cache allocation policy other than replacement policy

Definitions

  • This relates to technology for refilling cache memory data.
  • the cache memory is a storage device that is arranged between the processor and the main memory and has a smaller capacity than the main memory but can be accessed at high speed.
  • the property of spatial locality (spatial locality, when an item is referenced, there is a high probability that an item near that item will be referenced again) is known. If the size of the target data (hereinafter referred to as “refill size”) is increased to some extent, the hit rate (hit rate, hit ratio) can be increased.
  • Patent Document 1 is known as a technique related to such refill size optimization.
  • cache memory tends to be used by a wide variety of programs operating in parallel. Therefore, even if a certain item on the cache memory is referred to by the program, it is difficult to predict whether a nearby item will be referred to subsequently. If this prediction is erroneously refilled with a large number of line sizes, the result is that most of the refilled data is not used, resulting in processing delay.
  • the present invention has been made under such a background, and provides a cache memory device that can contribute to controlling the refill size to an appropriate size that can utilize spatial locality according to the behavior of the program. With the goal.
  • the cache memory device of the present invention includes a storage means for storing cache data, an address extraction means for extracting a tag and an index from this address when receiving an access request including an address designation, and a tag extracted by the address extraction means And hit / miss determination means for determining whether the cache data is a hit or a miss based on the index, and a plurality of line sets each including a plurality of lines in which the index values are arranged, for each line constituting each line set
  • the management means for managing the number of accesses and the index extracted by the address extraction means indicate the index of the line managed by the management means.
  • the hit / miss determination means determines that this index is a hit, , Access the line corresponding to this index
  • the counting means for increasing the number of times by 1 and the index extracted by the address extraction means do not indicate the index of the line managed by the management means, and the hit / miss determination means determines that this index is a miss.
  • the identification means for identifying the line set corresponding to this index from the lines managed by the management means, and the access counts of all the lines constituting the identified line set must all match. Determining the line size to be refilled as the first line size, and determining the line size to be refilled as the second line size larger than the first line size if all match, and the determined line Refill means for refilling the cache data based on size And wherein the door.
  • the cache memory device of the present invention it is possible to improve the hit rate and reduce the data transfer related to the cache memory by increasing the refill size on condition that the number of accesses matches. Therefore, the operation performance of the program can be improved.
  • the figure which shows the structure of the information processing apparatus containing a cache memory apparatus Block diagram showing configuration of cache memory device
  • the figure which shows an example of the address information which an address analysis part acquires
  • the figure which shows an example of the cache data which a cache data storage part manages
  • the figure which shows an example of the information which a read / write frequency management part manages Flow chart showing operation of cache memory device Flow diagram showing operations related to count Flow chart showing operations related to frequency reset Flow diagram showing operations related to line size determination Diagram for explaining an example of setting managed lines
  • FIG. 1 is a diagram illustrating a configuration of an information processing apparatus 1000 including a cache memory device.
  • the information processing apparatus 1000 is composed of a general-purpose computer such as a PC (Personal Computer).
  • the information processing apparatus 1000 includes a processor 1, a memory device 2, a communication device 34, an input device 40, a display device 45, a timer circuit 51, and an interrupt controller 55. These devices are connected to each other through a bus line 50.
  • an HDD (Hard Disk Drive) 25 a reading device 32, an input device 40, and a display device 45 are connected to the bus line 50 through I / Fs (interfaces) 26, 35, 41, and 46, respectively.
  • the processor 1 is composed of three processors 11, 12, and 13. Each processor is called a CPU (Central Processing Unit).
  • CPU Central Processing Unit
  • the memory device 2 includes a ROM (Read Only Memory) 21 and a RAM (Random Access Memory) 22.
  • the ROM 21 has a function of storing a computer program and data for defining the operation of the processor 1, and is composed of a non-volatile memory that can be written and can hold stored contents even when the power is turned off, such as a flash ROM. .
  • the RAM 22 has a function of temporarily storing data generated as the processor 1 executes processing.
  • the RAM 22 includes a volatile memory that does not retain stored contents when the power is turned off.
  • the computer program and data may be stored in the HDD 25 instead of the ROM 21.
  • the processor 1 executes processing defined by the computer program while writing the computer program and data stored in the ROM 21 or the HDD 25 to the RAM 22 as necessary.
  • the HDD 25 is a device that stores computer programs and data.
  • the reading device 32 is a device that reads a computer program or data recorded on a recording medium 31 (eg, CD, DVD, memory card, etc.).
  • a recording medium 31 eg, CD, DVD, memory card, etc.
  • the communication device 34 is a device that exchanges computer programs and data between the outside and itself through a communication line 33 such as a telephone line, a network line, wireless communication, infrared communication, and the like.
  • the input device 40 is a device for inputting data and the like by a user's operation, and includes a keyboard, a mouse, and various input buttons.
  • the display device 45 is a device that displays data, images, and the like on a screen and outputs data and the like by voice, and includes, for example, a 19-inch liquid crystal display (LCD) and a speaker.
  • LCD liquid crystal display
  • the timer circuit 51 is a device that outputs a timer interrupt signal at a constant cycle.
  • the interrupt controller 55 is a device that relays an interrupt request signal sent from the timer circuit 51, the input device 40, the processor 1, the communication device 34 that is a network device, the HDD 25, the reading device 32, and the like to the processor 1. Priorities are assigned to the interrupt request signals from the respective devices.
  • the interrupt controller 55 has a function of arbitrating requests according to the priority when interrupts are generated from a plurality of devices at the same time.
  • FIG. 2 is a block diagram showing the configuration of the cache memory device 10.
  • the cache memory device 10 operates in cooperation with the processor 1 and the external memory 231.
  • RAM 22 included in memory device 2 shown in FIG. 1 is typically used.
  • the cache memory device 10 includes an address analysis unit 201, a management line determination unit 202, a frequency management unit 203, a line size determination unit 204, a hit / miss determination unit 205, a refill unit 206, and a cache data storage unit 207.
  • the cache data is managed for each data of a certain size called a cache line (hereinafter simply referred to as “line”). Further, each line of the cache data can be uniquely identified and accessed by the index value.
  • the address analysis unit 201 receives an address indicating a storage location of data requested from the processor 1.
  • the address analysis unit 201 separates the received address from a tag used for determining a hit and an index indicating a storage offset of cache data.
  • the address analysis unit 201 passes the index obtained by the separation to the management line determination unit 202, and passes the tag and index to the hit / miss determination unit 205.
  • the management line determination unit 202 determines whether the access to the data requested by the processor 1 is performed by the number management unit 203 (as described later, the number management unit 203 manages some predetermined lines among all the lines in the cache memory. Has a function of determining whether or not the access is to a line to be managed.
  • the management line determination unit 202 holds an index associated with the management target line. When the management line determination unit 202 receives an index from the address analysis unit 201, the management line determination unit 202 determines whether the index corresponds to the index held. As a typical configuration of the management line determination unit 202, it is only necessary to include a circuit that is asserted when an index to be managed is determined in advance as a cache memory device and an access occurs at that index.
  • the management line determination unit 202 determines that the line is a management target line
  • the management line determination unit 202 notifies the number management unit 203 that the line is a management target line.
  • the number management unit 203 and the line size determination unit 204 are notified that the line is not a management target line.
  • the hit / miss determination unit 205 has a function of determining whether the data requested by the processor 1 exists as cache data (hit) or does not exist (miss).
  • the hit / miss determination unit 205 receives the tag and the index from the address analysis unit 201, it passes the index to the cache data storage unit 207.
  • the hit / miss determination unit 205 receives a cache data tag corresponding to the passed index from the cache data storage unit 207.
  • the hit / miss determination unit 205 compares the tag acquired from the address analysis unit 201 with the tag acquired by inquiring the cache data storage unit 207.
  • the hit / miss determination unit 205 acquires the data of the corresponding line from the cache data storage unit 207 and passes it to the processor 1. In addition, the hit / miss determination unit 205 notifies the number of times management unit 203 and the line size determination unit 204 of a hit. On the other hand, if the tags do not match as a result of the comparison, it is determined as a miss, and the hit / miss determination unit 205 notifies the number management unit 203 and the line size determination unit 204 of a mistake.
  • the hit / miss determination unit 205 passes the tag and index received from the address analysis unit 201 to the number management unit 203 and the line size determination unit 204 regardless of whether the hit / miss occurs.
  • the number management unit 203 has a function of storing and managing the number of accesses (the number of reads and the number of writes) in some predetermined lines among all the lines in the cache memory. How to determine the line to be managed will be described later.
  • the number management unit 203 When the number management unit 203 receives a notification from the management line determination unit 202 that the access is to the management target line, the number management unit 203 identifies the corresponding management target line based on the index received from the next hit / miss determination unit 205. To do.
  • the number management unit 203 is connected to a line for notifying when there is a read request or a write request from the processor 1.
  • the number management unit 203 updates the read number or write number managed according to the read request or write request notified via this line and whether the notification from the hit / miss determination unit 205 is a hit or a miss.
  • the number management unit 203 when the number management unit 203 receives a notification from the hit / miss determination unit 205 that there is a miss, the number management unit 203 passes the tag and index received from the address analysis unit 201 to the refill unit 206. The number management unit 203 passes the line size to the refill unit 206.
  • the number management unit 203 receives a notification from the hit / miss determination unit 205 that it is a mistake and receives a notification that the line is not a management target line, the number management unit 203 is not an index that is not a management target line. Based on this value, an alternative index that is a management target line is specified. Then, the specified index is notified to the line size determining unit.
  • the line size determination unit 204 refers to the read / write count of the index notified from the number management unit 203, and sets the line size to be refilled to one line size or a plurality of lines (for example, four lines) size. It has a function to decide which one of these.
  • the process of determining this line is performed when the line size determination unit 204 receives a notification from the management line determination unit 202 that the line is not a management target line and receives a notification from the hit / miss determination unit 205 that the line is a mistake. Done.
  • the line size determination unit 204 acquires the index of the management target line from the number management unit 203. Next, the line size determination unit 204 acquires tags corresponding to all the acquired indexes from the cache data storage unit 207. Further, the line size determining unit 204 acquires the number of read / writes corresponding to all the acquired indexes from the number management unit 203.
  • the line size determination unit 204 determines that the line size to be refilled is a large four line size when the acquired tags, the number of reads, and the number of writes all match. If any of them does not match, the line size to be refilled is determined as a normal one line size. Then, the refill unit 206 is notified of the determined line size and the address of the data to be refilled.
  • the refill unit 206 acquires the address where the refill target data exists and the line size to be refilled from the number management unit 203 or the line size determination unit 204, and externally uses the acquired line size for the data existing at the acquired address. Read from the memory 231.
  • the refill unit 206 transfers the read data, the address of the data, and the size of the data to the cache data storage unit 207.
  • the refill unit 206 may acquire a tag and an index to be refilled from the number management unit 203 or the line size determination unit 204 instead of the data address and the data size, and pass them to the cache data storage unit 207. .
  • the cache data storage unit 207 has a function of storing and managing cache data.
  • the cache data storage unit 207 manages the stored data in units of lines, and each line can be uniquely identified by an index.
  • the cache data storage unit 207 manages each line by associating a tag indicating which address the data in each line is in the external memory 231 with.
  • the cache data storage unit 207 When the cache data storage unit 207 receives the index from the hit / miss determination unit 205, the cache data storage unit 207 identifies the line by the index, and returns a tag managed in association with the line to the hit / miss determination unit 205.
  • the cache data storage unit 207 grasps how many lines the data is based on the managed line size.
  • the address of the data is passed to the address analysis unit 201 to receive the tag and the index, the line is identified by the received index, and the data received from the refill unit 206 is identified.
  • Manage as line data Further, the cache data storage unit 207 manages the tag received from the address analysis unit 201 as a tag corresponding to the identified line. The cache data storage unit 207 may acquire the tag and index to be refilled and update the cache data instead of acquiring the data address and data size from the refill unit 206.
  • FIG. 3 shows an address 401 composed of 32 bits as an example.
  • a numerical value 402 from 0 to 31 indicates each bit constituting the address 401 for convenience from the lower 0th bit to the 31st bit (the 31st bit is the most significant bit).
  • the address 401 includes an upper address 403 from the 15th bit to the 31st bit, and a lower address 404 from the 5th bit to the 14th bit.
  • the address analysis unit 201 When the address analysis unit 201 receives the address 401, the address analysis unit 201 extracts the upper address 403 as a tag and the lower address 404 as an index from the address 401 according to the line size and the cache block size.
  • FIG. 3 shows an example in which the line size is 32 bytes and the cache block size is 32 KB.
  • the line size and cache block size given as examples are only examples, and can be changed according to the configuration of the cache memory.
  • the cache data storage unit 207 includes “cache data” 207 c, “index” 207 a indicating the line of this data, and “tag” indicating which address this data is in the external memory 231. 207b is managed.
  • some of the data lines (indexes) stored in the cache data storage unit 207 are managed lines managed by the number management unit 203. A specific example is shown in FIG.
  • the number management unit 203 includes an “index” 203a indicating a management target line, a “read count” 203b, and a “write count” 203c corresponding to the index.
  • “set 1” of 4 lines of indexes 0x000 to 0x003 and “set 2” of 4 lines of indexes 0x200 to 0x203 are managed.
  • the head indexes 0x000 and 0x200 of each set are lines in which the index starts at the page unit used by the program. ⁇ Operation> The operation of the cache memory device according to the embodiment will be described below.
  • the address analysis unit 201 separates (extracts) the address into a tag and an index (S11).
  • the hit / miss determination unit 205 when the hit / miss determination unit 205 receives the tag and the index from the address analysis unit 201, it makes an inquiry to the cache data storage unit 207 to determine whether it is a hit or a miss (S12). In this determination, the hit / miss determination unit 205 obtains the tag of the cache data corresponding to the index from the cache data storage unit 207, compares it with the tag separated by the address analysis unit 201, and if both tags match. The hit is determined (S12: hit), and if they do not match, it is determined as a miss (S12: miss).
  • the hit / miss determination unit 205 acquires the cache data corresponding to the address separated in step S11 from the cache data storage unit 207, and returns it to the processor 1 (S13).
  • the management line determination unit 202 determines whether or not the index included in the address separated in step S11 is the index of the management target line (S14).
  • the number management unit 203 identifies an access target line (S31), and if the access is a read request (S32: Read), the number of reads of the corresponding management target line is determined. Add once (S33).
  • the number management unit 203 adds the number of writes of the corresponding management target line once (S34).
  • the number management unit 203 reads the management target line index “0x000” twice (see FIG. 5). Add once and update to 3 times. If the access target line is “0x001” and the access is a write request, the count management unit 203 adds 1 to the read count of the management target line index “0x001” 0 times (see FIG. 5). Update to times.
  • the number management unit 203 counts the number of corresponding management target lines (S31). To S34).
  • the management line determination unit 202 determines whether the index included in the address separated in step S11 is the index of the management target line. (S16).
  • the count management unit 203 invalidates (resets) the read / write count of the access target line (S41). If the access is a read request (S42: Read), the number of reads of the corresponding management target line is set to 1 (S43).
  • the number management unit 203 sets the number of writes of the corresponding management target line to one (S44).
  • the number management unit 203 reads the management target line index “0x000” twice, writes three times ( (See Fig. 5) both reset to 0, and then reset the read count to 1.
  • the refill unit 206 acquires the data of the corresponding line (the line corresponding to the index included in the address separated in step S11) from the external memory 231 and the cache data storage unit 207.
  • the cache data is refilled (S19).
  • the refill unit 206 reads data corresponding to the refill target address received from the number management unit 203 from the external memory 231. Then, the refill unit 206 passes the read data to the cache data storage unit 207 and stores it as cache data. Next, the refill unit 206 returns the data read from the external memory 231 to the processor 1.
  • the management line determination unit 202 notifies the management number unit 203 to that effect.
  • the number management unit 203 identifies the nearest set of indexes that are smaller than the index acquired in step S11 from the management target lines managed by itself. For example, if the index included in the address separated in step S11 is “0x280” (FIG. 4), the nearest index set 2 (FIG. 5: “0x200” to “0x203”) is smaller than this index “0x280”. 4 lines)) (S20).
  • the line size determination unit 204 when the line size determination unit 204 receives information indicating the set specified from the management line determination unit 202, the line size determination unit 204 acquires the read / write count corresponding to the received set from the number management unit 203 and acquires The tag of the management target line belonging to the set is acquired from the cache data storage unit 207 (S51).
  • the read counts and write counts of all the managed lines that have been acquired all match S52. For example, if the index set is identified as set 2, the number of reads of the four lines “0x200” to “0x203” belonging to set 2 is 0, and the number of writes is all 2 (see FIG. 5). ) So make a positive determination. On the other hand, if the index set is specified as set 1, the number of reads for the four lines “0x000” to “0x003” belonging to set 1 is 2, 2, 0, 1 Since it is mixed (see FIG. 5), the determination is negative.
  • the line size determination unit 204 determines whether all the tags of all the managed lines that have been acquired match (S53). For example, if the index set is specified as set 2, the tags of four lines “0x200” to “0x203” belonging to set 2 all match “0x02000” (see FIG. 4). Make a positive determination. On the other hand, if the index set is identified as set 1, the four lines of tags “0x000” to “0x003” belonging to set 1 are 0x01c80, 0x01c80, 0x10000, 0x00040 and some of the two Since it is only a match and not a full match, a negative determination is made.
  • the line size determination unit 204 when all the read counts and write counts of all the acquired management target lines are matched (S52: Yes), and all the tags of all the acquired management target lines match ( In S53: Yes), the line size to be refilled is determined to be a size for four lines (S54).
  • the line size determining unit 204 determines the line size to be refilled as the size of one line.
  • the refill unit 206 acquires data of the corresponding line (the line corresponding to the index included in the address separated in step S11) from the external memory 231 and the cache data storage unit 207.
  • the cache data is refilled (S19).
  • the refill unit 206 performs refilling not only for the corresponding line but also for the 3 lines followed by the index from this line. For example, if the index included in the address separated in step S11 is “0x280”, the refill unit 206 refills not only “0x280” but also the subsequent three lines “0x281” to “0x283”. It will be.
  • the management target lines “0x200” to “0x203” have the same number of reads / writes (see FIG. 5), so the program may behave continuously. High nature. Therefore, by refilling not only "0x280” but also "0x281" to "0x283", access to the lines “0x281" to "0x283” occurs after refilling (program is "0x281" to "0x283" (See) can increase the probability of a cache hit.
  • the present invention is not limited to the above-described contents, and can be implemented in various forms for achieving the object of the present invention and the object related or incidental thereto. It does not matter.
  • the order is that the tag match is determined after the number of times match is determined, but this order is not limited to this, and the order may be reversed (after step S53 as S52) Also good).
  • step S53 determines a match between the tags indicating which address the data is in the external memory 231 with. This judgment can only eliminate the coincidence of the number of times that the tag number does not match and the number of read / write times coincidence, in other words, the number of times that does not clearly reflect the behavior of the program, contributing to the determination of a more appropriate refill size. can do. But the process of step S53 is not essential and the method of skipping step S53 can also be considered.
  • the hit / miss determination unit 205 may determine a hit on the condition that the valid tag indicates validity in addition to tag matching.
  • the number of lines is set to 4 lines that are the same as the number of lines included in one set of management target lines (FIG. 9: S54). Although it was decided, it is not limited to this. For example, it may be 2 lines or 8 lines.
  • the line size A when the number of reads / writes of the management target line matches is relatively larger than the line size B when they do not match (A> B), the line size is optimized. Can be useful.
  • the RAM 22 is cited as the external memory 231, but the requirements for the external memory 231 are not limited to the RAM 22, and the memory hierarchy is lower than that of the cache memory device 10. If there is enough.
  • the recording medium 31 read from the HDD 25 or the reading device 32 may be used as the external memory 231.
  • each line set is preferably provided so as to correspond to the head of the memory unit. In order to accurately estimate the behavior of the program, it is best to provide it at the head, but in some cases, each line set may be located in the middle of the memory unit.
  • Fig. 10 shows a more specific example of the management target line.
  • the memory unit used by the program is 4 kilobytes and the cache line size is 32 bytes
  • line sets are provided at index 0x80 (128) intervals.
  • Each line set is considered to be a set of the following four lines from indexes 0x000, 0x080, 0x100, and the like.
  • the number of lines to be set is sufficient if it is plural (two or more lines), for example, eight lines may be used.
  • step S52 in FIG. 9 may exclude the case where the number of reads is 0 and the number of writes is 0. This is because if both of them are all zero, it may not be optimal as a material for estimating the behavior of the program.
  • the information processing apparatus 1000 has been described as a PC.
  • the information processing apparatus 1000 is not limited to this and may be a mobile communication terminal such as a PDA (Personal Digital Assistance) or a mobile phone.
  • the information processing apparatus 1000 may be provided for use by the user as it is, or may be incorporated in various electronic devices.
  • the processor 1 has been described as a CPU.
  • a processor for media processing or graphic processing a DSP (Digital Signal Processor), or the like may be used. It may be composed of a single processor, or may be composed of a plurality of processors.
  • DSP Digital Signal Processor
  • Each functional block in FIG. 2 is typically realized as a cache memory existing between the processor and the external memory, but may be an LSI which is an integrated circuit. These may be individually made into one chip, or may be made into one chip so as to include a part or all of them.
  • the name used here is LSI, but it may also be called IC, system LSI, super LSI, or ultra LSI depending on the degree of integration.
  • the method of circuit integration is not limited to LSI's, and implementation using dedicated circuitry or general purpose processors is also possible.
  • An FPGA Field Programmable Gate Array
  • a reconfigurable processor that can reconfigure the connection and setting of circuit cells inside the LSI may be used.
  • integrated circuit technology comes out to replace LSI's as a result of the advancement of semiconductor technology or a derivative other technology, it is naturally also possible to carry out function block integration using this technology.
  • a control program comprising a program code for causing the processor of various information processing apparatuses and various circuits connected to the processor to execute the operations described in the embodiments on a recording medium, or various It can also be distributed and distributed via a communication channel or the like.
  • a recording medium includes non-transitory recording media such as an IC card, HDD, optical disk, flexible disk, and ROM.
  • the distributed and distributed control program is used by being stored in a memory or the like that can be read by the processor, and the processor executes the control program to realize various functions as shown in the embodiment. Will be.
  • the present embodiment includes the following aspects.
  • (1) The cache memory device includes a storage unit that stores cache data, an address extraction unit that extracts a tag and an index from this address when an access request including an address designation is received, and an address Based on the tags and indexes extracted by the extraction means, each line set is a hit / miss determination means for determining whether the cache data is a hit or a miss, and a plurality of line sets each having a plurality of lines in which index values are arranged.
  • the index extracted by the address extracting means indicates the index of the line managed by the managing means, and the hit / miss determining means for this index. If it is determined to be a hit, it corresponds to this index
  • the counting means for incrementing the number of in accesses by one, and the index extracted by the address extracting means does not indicate the index of the line managed by the managing means, and the hit / miss judging means
  • the specifying means for specifying the line set corresponding to this index from the lines managed by the management means and the access counts of all the lines constituting the specified line set all match.
  • Determining means for determining the line size to be refilled as the first line size if not, and determining the line size to be refilled as the second line size larger than the first line size if all of them match.
  • Each of the plurality of line sets includes a plurality of lines in which the index is arranged in a continuous value, and the specifying unit is smaller than the index value extracted by the address extracting unit and is the closest value
  • a line set including a predetermined index may be specified.
  • the cache data stored by the storage means is main memory data managed in units of pages for the program to read and write, Each of the plurality of line sets has a one-to-one correspondence for each page unit in the main memory, and the value of the head index of each line set is a value corresponding to the head of the page unit in the main memory. It doesn't matter if there is.
  • the storage means stores the cache data in line units in association with a tag indicating the location of the data in the main memory, and the index specifies a line in the storage means, The determination unit obtains all tags corresponding to all the lines constituting the specified line set from the storage unit, and all the access counts of all the lines constituting the specified line set match. If all of the acquired tags do not match, the line size to be refilled is determined as the first line size, and if all of the acquired tags match, The line size to be refilled may be determined as the second line size.
  • the access count managed by the management means includes a read count and a write count.
  • the access request based on this determination is a read request. If the access request based on the determination is a write request, the corresponding write count is increased by one, and the determining means determines that all the lines constituting the specified line set Are all matched, and the number of reads of all the lines constituting the specified line set is all the same, the line size to be refilled is the second line size.
  • the counting means indicates that the index extracted by the address extracting means is an index of a line managed by the managing means, and when the hit / miss determining means determines that the index is a miss, Resets the number of accesses including the number of reads and writes of the line corresponding to the index included in the access request, and after the reset, depending on whether the access request is a read request or a write request, the corresponding index read count or write count The number of times may be increased by one.
  • the storage means stores the cache data in units of lines in relation to a tag indicating the location of the data in the main memory, and the index specifies a line in the storage means
  • the hit determination means specifies an index corresponding to the index extracted by the address extraction means from the data stored in the storage means, and is extracted by the tag associated with the specified index and the address extraction means. If the two tags match, it may be determined as a hit, and if they do not match, it may be determined as a miss.
  • the cache memory control method includes a storage step for storing cache data, an address extraction step for extracting a tag and an index from this address when an access request including an address designation is received, Each line of a hit / miss determination step for determining whether the cache data is a hit or a miss based on the tag and index extracted by the address extraction step, and a plurality of line sets each including a plurality of lines in which index values are arranged.
  • the management step for managing the number of accesses for each line constituting the set, and the index extracted in the address extraction step indicate the index of the line managed in the management step, and the hit / miss determination for this index Hit by step and If it is determined, the counting step for increasing the number of accesses to the line corresponding to this index by 1 and the index extracted in the address extraction step do not indicate the index of the line managed in the management step.
  • an identifying step for identifying a line set corresponding to the index from the lines managed in the managing step and an identified line set are configured.
  • a program according to the present embodiment is a program for causing a cache memory device to execute a cache memory control process, and the cache memory control process includes a storage step for storing cache data and an address designation.
  • an address extraction step for extracting a tag and an index from this address
  • a hit / miss determination step for determining whether the cache data is a hit or a miss based on the tag and index extracted by the address extraction step
  • a management step for managing the number of accesses for each line constituting each line set for a plurality of line sets each having a plurality of lines each having index values; and the index extracted in the address extraction step is the management step Managed by The index of the line is shown, and when it is determined that the hit is detected by the hit / miss determination step for this index, a count step for increasing the number of accesses to the line corresponding to this index by one, and the index extracted in the address extraction step Does not indicate the index of the line managed in the management step, and if it is determined that the index is a miss by the hit / miss determination step, this index is selected from the lines managed in the management step.
  • the line size to be refilled is determined as the first line size unless the specific step for identifying the line set corresponding to the number of accesses and the number of accesses of all the lines constituting the identified line set all match. , Refill if everything matches.
  • a determination step of determining a can line size and the first line size is greater than the second line size, based on the determined line size, characterized in that it comprises a and refill step of refilling of the cache data.
  • the integrated circuit includes a storage unit that stores cache data, an address extraction unit that extracts a tag and an index from this address when an access request including an address designation is received, and an address extraction A hit / miss determination means for determining whether the cache data is a hit or a miss based on the tag and index extracted by the means, and a plurality of line sets each including a plurality of lines each having index values arranged therein,
  • the management means that manages the number of accesses for each line that constitutes and the index extracted by the address extraction means indicate the index of the line that is managed by the management means, and the hit / miss determination means hits this index. Is determined, the line corresponding to this index is allocated.
  • the cache memory device has a function of changing the line size to be refilled immediately according to the operation of the program, and is useful as an information processing device.
  • it is useful in devices equipped with computers such as information devices, AV devices, communication devices, and built-in devices such as home appliances.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

 キャッシュメモリ装置は、キャッシュミス時に行うリフィル処理に先立って、リフィルすべきラインサイズを決定するラインサイズ決定処理を行う。このラインサイズ決定処理では、あるセットに属する管理対象ラインのリードライト回数を取得し(S51)、リード回数同士及びライト回数同士がすべて一致した場合には(S52:Yes)、リフィルすべきラインサイズを大きいサイズに決定する(S54)。すべては一致していない場合には(S52:No)、リフィルすべきラインサイズを小さいサイズに決定する(S55)。

Description

キャッシュメモリ装置、キャッシュメモリ制御方法、プログラムおよび集積回路
 キャッシュメモリのデータをリフィルする技術に関する。
 キャッシュメモリは、プロセッサと主メモリとの間に配されて、主メモリより容量は小さいが高速にアクセスできる記憶装置である。
 キャッシュメモリにおいては、プロセッサが要求するデータがあることをヒット(hit)、ないことをミス(miss)と呼ぶ。そして、このミス時には、キャッシュメモリ上のデータを入れ替えるリフィル(refill, replacement)という処理を行う。
 一般にメモリの分野においては、空間的局所性(spatial locality,ある項目が参照された場合、その項目の近くにある項目が再び参照される確率が高いこと。)という性質が知られており、リフィル対象とするデータのサイズ(以下、「リフィルサイズ」と呼ぶ。)をある程度大きくすれば、ヒット率(hit rate,hit ratio)を高くできる。
 もっとも、キャッシュメモリの容量は限られているので、リフィルサイズをあまりに大きくすると、プロセッサが必要とするデータまでも入れ替えてしまいヒット率が低くなる(ミス率(miss rate)が高くなる)こともある。このような事態は、特にプログラムがキャッシュがミスとなったデータに後続するデータをすぐには使用しないような場合などに生じやすい。
 このようなリフィルサイズの最適化に関する技術としては、特許文献1が知られている。
特開2004-259109号公報
 ところで、キャッシュメモリは並行して動作する多種多様なプログラムにより使用される傾向にある。したがって、キャッシュメモリ上のある項目がプログラムにより参照されたとしても、続けて近くの項目が参照されるかどうかについては予想は困難である。この予想を誤って多くのラインサイズをリフィルしてしまうと、結果的にリフィルしたデータの大半が使用されない事態を招き、処理の遅延につながる。
 本発明は、このような背景の下になされたものであって、プログラムの挙動に応じて、リフィルサイズを、空間局所性を活用できる適切なサイズに制御することに貢献できるキャッシュメモリ装置の提供を目的とする。
 本発明のキャッシュメモリ装置は、キャッシュデータを格納する格納手段と、アドレスの指定を含むアクセス要求を受けると、このアドレスからタグとインデクスとを抽出するアドレス抽出手段と、アドレス抽出手段が抽出したタグとインデクスに基づき、前記キャッシュデータに関してヒットかミスかを判定するヒット/ミス判定手段と、それぞれインデクスの値が並んだ複数のラインからなる複数のラインセットについて、各ラインセットを構成するライン毎のアクセス回数を管理する管理手段と、前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しており、このインデクスに関して前記ヒット/ミス判定手段によりヒットと判定されると、このインデクスに対応するラインのアクセス回数を1回増やすカウント手段と、前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しておらず、このインデクスに関して前記ヒット/ミス判定手段によりミスと判定されると、前記管理手段が管理するラインの中からこのインデクスに対応するラインセットを特定する特定手段と、特定されたラインセットを構成する全ラインそれぞれのアクセス回数が、すべてが一致しているのでなければリフィルすべきラインサイズを第1ラインサイズと決定し、すべてが一致していればリフィルすべきラインサイズを前記第1ラインサイズより大きい第2ラインサイズと決定する決定手段と、決定されたラインサイズに基づいて、前記キャッシュデータのリフィルを行うリフィル手段と、を備えることを特徴とする。
 上記アクセス回数が一致していれば、プログラムがメモリを局所的に参照しているであろうという推定が働く。本発明のキャッシュメモリ装置によれば、このアクセス回数の一致を条件として、リフィルサイズを大きくすることで、ヒット率を向上させ、キャッシュメモリに関するデータ転送を低減することができる。もってプログラムの動作性能を高めることができる。
キャッシュメモリ装置を含む情報処理装置の構成を示す図 キャッシュメモリ装置の構成を示すブロック図 アドレス解析部が取得するアドレス情報の一例を示す図 キャッシュデータ格納部が管理するキャッシュデータの一例を示す図 リードライト回数管理部が管理する情報の一例を示す図 キャッシュメモリ装置の動作を示すフロー図 回数カウントに関する動作を示すフロー図 回数リセットに関する動作を示すフロー図 ラインサイズ決定に関する動作を示すフロー図 管理対象ラインを設定する例を説明するための図
 以下、実施の形態について、図面を参照しながら説明する。
<構成>
 図1は、キャッシュメモリ装置を含む情報処理装置1000の構成を示す図である。
 情報処理装置1000は、例えば、PC(Personal Computer)等の汎用のコンピュータから構成される。
 この情報処理装置1000は、プロセッサ1、メモリ装置2、通信装置34、入力装置40、表示装置45、タイマ回路51及び割り込みコントローラ55を備えている。これらの装置は、バスライン50を通じて互いに接続されている。
 また、バスライン50には、HDD(Hard Disk Drive)25,読取装置32,入力装置40及び表示装置45が、それぞれI/F(インタフェース)26,35,41及び46を通じて接続されている。
 プロセッサ1は、3つのプロセッサ11,12,13から構成されている。各プロセッサは、CPU(Central Processing Unit,中央演算処理装置)と呼ばれるものである。
 メモリ装置2は、ROM(Read Only Memory)21及びRAM(Random Access Memory)22を備えている。
 ROM21は、プロセッサ1の動作を規定するコンピュータプログラム及びデータを記憶する機能を有し、例えばフラッシュROMのように書き込みが可能で電源を切っても記憶内容を保持できる不揮発性のメモリから構成される。RAM22は、プロセッサ1が処理を実行するのに伴って発生するデータを一時的に記憶する機能を有し、例えば電源を切ると記憶内容が保持されない揮発性のメモリから構成される。なお、コンピュータプログラム及びデータは、ROM21に代えてHDD25に記憶させることもできる。
 プロセッサ1は、ROM21またはHDD25が格納するコンピュータプログラム及びデータを、必要に応じてRAM22に書き込みつつ、コンピュータプログラムが規定する処理を実行する。
 HDD25は、コンピュータプログラムやデータを記憶する装置である。
 読取装置32は、記録媒体31(例えばCD、DVD、メモリカードなど)に記録されたコンピュータプログラムあるいはデータを読み取る装置である。
 通信装置34は、電話回線、ネットワーク線、無線、赤外線通信等の通信回線33を通じて、外部と自身との間で、コンピュータプログラムやデータを交換する装置である。
 入力装置40は、ユーザの操作によりデータ等を入力する装置であり、キーボード、マウスや各種入力ボタンから構成される。
 表示装置45は、データ、画像等を画面に表示したり、データ等を音声で出力したりする装置であり、例えば19インチの液晶ディスプレイ(LCD:Liquid Crystal Display)とスピーカとから構成される。
 タイマ回路51は、一定の周期でタイマ割り込み信号を出力する装置である。
 割り込みコントローラ55は、タイマ回路51、入力装置40、プロセッサ1、ネットワークデバイスである通信装置34、HDD25、読取装置32などから送られる割り込み要求信号を、プロセッサ1へ中継する装置である。各装置からの割り込み要求信号には優先度が付けられている。この割り込みコントローラ55は、同時に複数の装置から割り込みが発生した場合には、それらの要求を上記優先度に応じて調停する機能(arbitration)を有している。
 図2は、キャッシュメモリ装置10の構成を示すブロック図である。キャッシュメモリ装置10は、プロセッサ1と外部メモリ231と協同して動作する。外部メモリ231としては、典型的には、図1に示すメモリ装置2に含まれるRAM22が用いられる。
 キャッシュメモリ装置10は、アドレス解析部201、管理ライン判定部202、回数管理部203、ラインサイズ決定部204、ヒット/ミス判定部205、リフィル部206、キャッシュデータ格納部207を備えている。なお、キャッシュデータは、キャッシュライン(以下、単に「ライン」と呼ぶ。)と呼ばれる、一定のサイズのデータごとに管理される。また、キャッシュデータの各ラインは、インデクスの値により一意に識別しアクセスすることができる。
 アドレス解析部201は、プロセッサ1から要求するデータの格納先を示すアドレスを受け取る。アドレス解析部201は、受け取ったアドレスから、ヒットを判定するために使用するタグと、キャッシュデータの格納オフセットを示すインデクスとに分離する。アドレス解析部201は、分離して得られたインデクスを管理ライン判定部202に渡し、タグとインデクスをヒット/ミス判定部205に渡す。
 管理ライン判定部202は、プロセッサ1が要求するデータへのアクセスが、回数管理部203(後述するように回数管理部203はキャッシュメモリにおける全ラインのうちの、一部の所定のラインを管理している。)が管理対象としているラインへのアクセスであるかどうかを判定する機能を有している。
 管理ライン判定部202は、管理対象ラインに対応付けられたインデクスを保持する。管理ライン判定部202は、アドレス解析部201からインデクスを受け取ると、そのインデクスが保持したインデクスにあたるかどうか判定する。管理ライン判定部202の典型的な構成としては、キャッシュメモリ装置として管理対象のインデクスが事前に定められ、そのインデクスでアクセスが発生した場合に、アサートされるような回路を備えていればよい。
 また、管理ライン判定部202は、管理対象のラインであると判定すると、回数管理部203に管理対象のラインであることを通知する。これに対して、管理対象のラインではないと判定すると、回数管理部203及びラインサイズ決定部204に管理対象のラインではないことを通知する。
 ヒット/ミス判定部205は、プロセッサ1が要求するデータがキャッシュデータとして存在するか(ヒット)、存在しないか(ミス)を判定する機能を有している。ヒット/ミス判定部205は、アドレス解析部201からタグとインデクスを受け取ると、インデクスをキャッシュデータ格納部207に渡す。次に、ヒット/ミス判定部205は、キャッシュデータ格納部207から、渡したインデクスに対応するキャッシュデータのタグを受け取る。ヒット/ミス判定部205は、アドレス解析部201から取得したタグと、キャッシュデータ格納部207に問い合わせて取得したタグを比較する。
 そして、比較の結果、タグ同士が一致すればヒットと判定し、ヒット/ミス判定部205は、キャッシュデータ格納部207から該当するラインのデータを取得し、プロセッサ1に渡す。また、ヒット/ミス判定部205は、ヒットの旨を回数管理部203及びラインサイズ決定部204に通知する。これに対して比較の結果、タグ同士が一致しなければミスと判定し、ヒット/ミス判定部205は、ミスであることを回数管理部203及びラインサイズ決定部204に通知する。
 また、ヒット/ミス判定部205は、ヒットかミスかに関わらず、回数管理部203及びラインサイズ決定部204に、アドレス解析部201から受け取ったタグとインデクスを渡す。
 回数管理部203は、キャッシュメモリにおける全ラインのうちの、一部の所定のラインにおけるアクセス回数(リード回数及びライト回数)を記憶し、管理する機能を有する。この管理対象とするラインの決め方については後述する。
 回数管理部203は、管理ライン判定部202から管理対象のラインへのアクセスであると通知を受けると、次にヒット/ミス判定部205から受け取ったインデクスに基づいて該当する管理対象のラインを特定する。
 回数管理部203には、プロセッサ1からリード要求またはライト要求があった場合に通知する線が接続されている。回数管理部203は、この線を経由して通知されたリード要求またはライト要求と、ヒット/ミス判定部205からの通知がヒットかミスかに応じて管理するリード回数またはライト回数を更新する。
 また、回数管理部203は、ヒット/ミス判定部205からミスであるという通知を受けた場合、回数管理部203は、アドレス解析部201から受け取ったタグとインデクスをリフィル部206に渡す。また、回数管理部203は、ラインサイズをリフィル部206に渡す。
 また、回数管理部203は、ヒット/ミス判定部205からミスであるという通知を受けた場合で、管理対象のラインではないと判定の通知を受けていれば、その管理対象のラインではないインデクスの値に基づいて、管理対象のラインである代わりのインデクスを特定する。そして、特定したインデクスをラインサイズ決定部に通知する。
 ラインサイズ決定部204は、回数管理部203から通知されたインデクスの、リードライト回数を参照して、リフィルすべきラインサイズを、1ラインサイズとするか複数ライン(例えば4ライン分)サイズとするかのいずれにするかを決定する機能を有している。
 このラインを決定する処理は、ラインサイズ決定部204は、管理ライン判定部202から管理対象のラインではないと通知を受け、かつヒット/ミス判定部205からミスであると通知を受けたときに行われる。
 この処理を詳しく述べると、ラインサイズ決定部204は、回数管理部203から管理対象のラインのインデクスを取得する。次に、ラインサイズ決定部204は、取得した全てのインデクスに対応するタグを、キャッシュデータ格納部207から取得する。また、ラインサイズ決定部204は、取得した全てのインデクスに対応するリードライト回数を回数管理部203から取得する。
 ラインサイズ決定部204は、取得したタグ同士、リード回数同士及びライト回数同士が全て一致する場合、リフィルすべきラインサイズを大きな4ラインサイズと決定する。また、いずれかが一致しない場合、リフィルすべきラインサイズは通常の1ラインサイズと決定する。そして、決定したラインサイズと、リフィルするデータのアドレスとをリフィル部206に通知する。
 リフィル部206は、回数管理部203あるいはラインサイズ決定部204からリフィル対象のデータが存在するアドレスと、リフィルすべきラインサイズを取得し、取得したアドレスに存在するデータを、取得したラインサイズで外部メモリ231から読み込む。
 読み込み後、リフィル部206は、読み込んだデータと、そのデータのアドレスと、データのサイズの三者をキャッシュデータ格納部207に受け渡す。なお、リフィル部206は、上記データのアドレスとデータのサイズの代わりに、回数管理部203やラインサイズ決定部204からリフィルするタグとインデクスを取得し、キャッシュデータ格納部207に渡してもかまわない。
 キャッシュデータ格納部207は、キャッシュのデータを格納・管理する機能を有する。キャッシュデータ格納部207は、格納したデータをライン単位で管理し、各ラインはインデクスによりどのラインかを一意に特定できるようになっている。また、キャッシュデータ格納部207は、各ライン毎に、各ラインにおけるデータが外部メモリ231においてどのアドレスのデータであるかを示すタグを関連づけて管理している。
 キャッシュデータ格納部207は、ヒット/ミス判定部205からインデクスを受け取ると、インデクスによりラインを特定し、そのラインと対応付けて管理しているタグをヒット/ミス判定部205に返す。
 キャッシュデータ格納部207は、リフィル部206からデータのサイズを受け取ると、管理するラインサイズからそのデータが何ライン分のデータであるか把握する。そして、リフィル部206からデータのアドレスを受け取ると、データのアドレスをアドレス解析部201に渡してタグとインデクスを受け取り、受け取ったインデクスによりラインを特定し、リフィル部206から受け取ったデータを、特定したラインのデータとして管理する。また、キャッシュデータ格納部207は、アドレス解析部201から受け取ったタグを、特定したラインに対応するタグとして管理する。なお、キャッシュデータ格納部207は、リフィル部206からデータのアドレスとデータのサイズを取得する代わりに、リフィルするタグとインデクスを取得し、キャッシュデータを更新してもかまわない。
 キャッシュデータ格納部207は、リフィル部206から数ライン分のデータを受け取っている場合、後続するインデクスのラインに対応させてラインサイズ分のデータを管理する。キャッシュデータ格納部207は、アドレス解析部201から受け取ったタグを、後続するインデクスのラインに対応するタグとして管理する。キャッシュデータ格納部207は、リフィル部206から受け取った、全てのラインのデータに関して前述の動作を行い、キャッシュデータを管理する。

 続いて、プロセッサ1がアドレス解析部201に渡すアドレスの例について説明する。図3には、一例として32ビットにより構成されるアドレス401を示している。0から31までの数値402は、アドレス401を構成する各ビットを、下位0ビット目から31ビット目まで便宜上示すものである(31ビット目が、最上位ビット)。
 アドレス401は、15ビット目から31ビット目の上位アドレス403、5ビット目から14ビット目の下位アドレス404を含んでいる。
 アドレス解析部201は、アドレス401を受け取ると、ラインサイズ、キャッシュブロックサイズに応じて、アドレス401から、上位アドレス403をタグ、下位アドレス404をインデクスとして切り出す。
 図3は一例として、ラインサイズが32バイト、キャッシュブロックサイズ32KBの場合を示している。もっとも、例に挙げたラインサイズやキャッシュブロックサイズはあくまで一例に過ぎず、キャッシュメモリの構成に応じて変更可能である。

 続いて、キャッシュデータ格納部207が管理するキャッシュデータの例について説明する。
 図4の例では、キャッシュデータ格納部207は、「キャッシュデータ」207cと、このデータのラインを示す「インデクス」207a,このデータが外部メモリ231においてどのアドレスのデータであるかを示す「タグ」207bを管理している。
 上述のように、このキャッシュデータ格納部207が格納しているデータのライン(インデクス)のうちの一部が回数管理部203が管理する管理対象ラインとなる。具体例を図5に示す。
 回数管理部203は、管理対象ラインを示す「インデクス」203a、インデクスに対応する「リード回数」203b,「ライト回数」203cを含む。
 図5の例では、インデクス0x000~0x003の4ラインの「セット1」と、インデクス0x200~0x203の4ラインの「セット2」とが管理対象となっている。上述のように、各セットの先頭のインデクス0x000, 0x200は、プログラムが使用するページ単位上においてインデクスが先頭になるラインである。

<動作>
 以下、実施の形態に係るキャッシュメモリ装置の動作について説明する。
 図6に示すように、まず、アドレス解析部201は、プロセッサ1からアドレスを受け取ると、そのアドレスをタグとインデクスに分離(抽出)する(S11)。
 次に、ヒット/ミス判定部205は、アドレス解析部201からタグとインデクスを受け取ると、キャッシュデータ格納部207に問い合わせてヒットかミスかを判定する(S12)。この判定は、ヒット/ミス判定部205が、キャッシュデータ格納部207からインデクスに対応するキャッシュデータのタグを取得し、アドレス解析部201が分離したタグと比較し、両タグが一致していれば、ヒットと判定し(S12:ヒット)、一致していなければミスと判定する(S12:ミス)。
 ヒットと判定すると(S12:ヒット)、ヒット/ミス判定部205は、キャッシュデータ格納部207から、ステップS11で分離したアドレスに対応するキャッシュデータを取得し、プロセッサ1に返す(S13)。
 そして、管理ライン判定部202は、ステップS11で分離したアドレスに含まれるインデクスが、管理対象ラインのインデクスであるかどうかを判定する(S14)。
 管理対象ラインのインデクスであれば(S14:Yes)、回数カウントの処理に移る(S15,図7)。管理対象ラインのインデクスでなければ(S14:No)、処理を終了する。
 図7に示すように、回数カウント処理では、回数管理部203はアクセス対象のラインを特定し(S31)、アクセスがリード要求であれば(S32:リード)、該当する管理対象ラインのリード回数を1回加算する(S33)。
 アクセスがリード要求であれば(S32:ライト)、回数管理部203は、該当する管理対象ラインのライト回数を1回加算する(S34)。
 具体的な例を挙げると、アクセス対象のラインが"0x000"でアクセスがリード要求であれば、回数管理部203は、管理対象ラインのインデクス"0x000"のリード回数2回(図5参照)に1回加算して3回へと更新する。また、アクセス対象のラインが"0x001"でアクセスがライト要求であれば、回数管理部203は、管理対象ラインのインデクス"0x001"のリード回数0回(図5参照)に1回加算して1回へと更新する。
 このように、キャッシュヒット場合で(S12:ヒット)、かつ管理対象ラインへのアクセスであれば(S14:Yes)、回数管理部203は対応する管理対象ラインの回数をカウントすることとなる(S31~S34)。
 さて、ヒット/ミス判定部205がミスと判定すると(S12:ミス)、管理ライン判定部202は、ステップS11で分離したアドレスに含まれるインデクスが、管理対象ラインのインデクスであるかどうかを判定する(S16)。
 管理対象ラインのインデクスであれば(S16:Yes)、回数リセットの処理に移る(S17,図8)。
 図8に示すように、回数リセット処理では、回数管理部203は、アクセス対象のラインの、リードライト回数を無効化(リセット)する(S41)。そして、アクセスがリード要求であれば(S42:リード)、該当する管理対象ラインのリード回数を1回に設定する(S43)。
 これに対して、アクセスがライト要求であれば(S42:ライト)、回数管理部203は、該当する管理対象ラインのライト回数を1回に設定する(S44)。
 具体的な例を挙げると、アクセス対象のラインが"0x000"でアクセスがリード要求であれば、回数管理部203は、管理対象ラインのインデクス"0x000"のリード回数2回、ライト回数3回(図5参照)を共に0回へとリセットし、その後、リード回数を1回に再設定する。
 このような回数のリセット処理を終えると、リフィル部206は、外部メモリ231から該当するライン(ステップS11で分離したアドレスに含まれるインデクスに対応するライン)のデータを取得し、キャッシュデータ格納部207のキャッシュデータにリフィルする(S19)。
 具体的には、リフィル部206は回数管理部203から受け取ったリフィル対象のアドレスに対応するデータを外部メモリ231から読み込む。そして、リフィル部206は、読み込んだデータをキャッシュデータ格納部207に渡し、キャッシュデータとして格納させる。次に、リフィル部206は、外部メモリ231から読み込んだデータをプロセッサ1に返す。
 管理対象ラインのインデクスでなければ(S16:No)、管理ライン判定部202は、その旨を管理回数部203に通知する。通知を受けた回数管理部203は、自己が管理する管理対象ラインの中から、ステップS11で取得したインデクスより小さく、かつ、最も近いインデクスのセットを特定する。例えば、ステップS11で分離したアドレスに含まれるインデクスが、"0x280"(図4)とすると、このインデクス"0x280"より小さく、最も近いインデクスのセット2(図5:"0x200"~"0x203"の4ラインのセット)と特定する(S20)。
 そして、ラインサイズ決定処理に移る(S21,図9)。
 ラインサイズ決定処理では、ラインサイズ決定部204は、管理ライン判定部202から特定されたセットを示す情報を受信すると、受信したセットに対応するリードライト回数を回数管理部203から取得するとともに、取得したセットに属する管理対象ラインのタグをキャッシュデータ格納部207から取得する(S51)。
 そして、取得した全ての管理対象ラインのリード回数同士・ライト回数同士がすべて一致するかどうかを判定する(S52)。例えば、インデクスのセットがセット2と特定されたのであれば、セット2に属する"0x200"~"0x203"の4ラインのリード回数は0回、ライト回数は2回とすべて一致する(図5参照)ので肯定的に判定する。これに対して、インデクスのセットがセット1と特定されたのであれば、セット1に属する"0x000"~"0x003"の4ラインのリード回数は、2回,2回,0回,1回とまちまちである(図5参照)ので、否定的に判定する。
 ステップS52で一致と判定すると(S52:Yes)、続いて、ラインサイズ決定部204は、取得したすべての管理対象ラインのタグ同士がすべて一致するかどうかを判定する(S53)。例えば、インデクスのセットがセット2と特定されたのであれば、セット2に属する"0x200"~"0x203"の4ラインのタグは、"0x02000"とすべて一致している(図4参照)ので、肯定的に判定する。これに対して、インデクスのセットがセット1と特定されたのであれば、セット1に属する"0x000"~"0x003"の4ラインのタグは、0x01c80,0x01c80,0x10000,0x00040と一部の2つが一致しているに過ぎず、全一致ではないので、否定的に判定する。
 ラインサイズ決定部204は、取得した全ての管理対象ラインのリード回数同士・ライト回数同士がすべて一致し(S52:Yes)、かつ、取得したすべての管理対象ラインのタグ同士がすべて一致した場合(S53:Yes)には、リフィルすべきラインサイズを4ライン分のサイズに決定する(S54)。
 ステップS52,S53の両判定のいずれかを満たさなければ(S52:No,or S53:No)、ラインサイズ決定部204は通常のリフィルすべきラインサイズを1ライン分のサイズに決定する。
 このようなラインサイズ決定処理を終えると、リフィル部206は、外部メモリ231から該当するライン(ステップS11で分離したアドレスに含まれるインデクスに対応するライン)のデータを取得し、キャッシュデータ格納部207のキャッシュデータにリフィルする(S19)。
 特に、リフィル部206は、リフィルサイズが4ラインであれば(S54)、対応するラインのみならず、このラインよりインデクッスが後続する3ラインについても、合わせてリフィルを行う。例えば、ステップS11で分離したアドレスに含まれるインデクスが"0x280"ならば、リフィル部206は"0x280"のみならず後続する"0x281"~"0x283"の3ラインの合計4ラインをリフィル対象とすることとなる。
 一般にプログラムはメモリをページ単位で使用・管理するものである。このため、同じページ単位に対応するインデクスのリード回数及びライト回数が一致していれば、プログラムが連続的な(シーケンシャルな)ふるまいをしていることが推定できる。このため、リード回数及びライト回数の一致を条件として通常より大きなラインサイズをリフィルすると、このリフィルしたデータが後々使用される可能性が高くなる(ヒット率が高くなる)ことが期待できる。
 本実施の例を用いて説明すると、管理対象ライン"0x200"~"0x203"はリード回数・ライト回数がすべて一致している(図5参照)ため、プログラムが連続的な挙動をしている可能性が高い。このため、"0x280"のみならず"0x281"~"0x283"をもリフィルすることで、リフィル後にライン"0x281"~"0x283"へのアクセスが発生して(プログラムが"0x281"~"0x283"参照して)キャッシュヒットとなる確率を高くすることできる。
 また、ある同じページ単位に対応するインデクスに関しては、その先頭部分のインデクスがプログラムの挙動が最も良く現れる。このため、"0x200"~"0x203"などのような先頭部分を管理対象ラインとして回数の一致を見ることで、プログラムの挙動を的確に反映したリフィルサイズとすることができる。
<補足1>
 以上、本実施の形態について説明したが、本発明は上記の内容に限定されず、本発明の目的とそれに関連又は付随する目的を達成するための各種形態においても実施可能であり、例えば、以下であっても構わない。
 (1)図9の例では、回数の一致を判定した後でタグの一致を判定するという順番であったが、この順番はこれに限らず反転させてもよい(ステップS53の次にS52としてもよい)。
 また、ステップS53の処理は、データが外部メモリ231においてどのアドレスのデータであるかを示すタグ同士の一致を判断している。この判断により、タグが不一致で偶然リード回数・ライト回数が一致していたものに過ぎない、言い換えるとプログラムのふるまいを鮮明に反映しない回数の一致を排除でき、より適切なリフィルサイズの決定に寄与することができる。もっとも、ステップS53の処理は必須ではなくステップS53をスキップするやり方も考え得る。
 (2)実施の形態では詳細は述べなかったが、一般的なキャッシュ技術と同様に、キャッシュデータ格納部207においては、データの有効(valid)・無効(invalid)を示す有効タグや、データの一貫性(consistency)を保証するためのダーティ(dirty)タグを、ライン毎に管理するようにしてもよい。
 また、特に、有効タグを管理する場合には、ヒット/ミス判定部205は、タグの一致に加えて、有効タグが有効を示す場合を条件にヒットと判定するようにしてもよい。
 (3)実施の形態では、ラインサイズ決定部204は、リフィルのラインサイズを大きくするときにライン数は、管理対象ラインの1セットに含まれるライン数と同じ4ライン(図9:S54)に決定するとしたが、これに限られない。例えば2ライン、8ラインとすることもできる。
 要は、管理対象ラインのリード回数・ライト回数が一致している場合のラインサイズAが、一致していない場合のラインサイズBより相対的に大きければ(A>B)、ラインサイズの最適化に役立てることができる。
 (4)実施の形態では、外部メモリ231としては、RAM22を挙げたが、外部メモリ231の要件としてはRAM22に限らず、キャッシュメモリ装置10より記憶階層(memory hierarchy)がより下位層のメモリであれば足りる。例えば、HDD25や読取装置32から読み込まれる記録媒体31を外部メモリ231として用いてもよい。
 (5)管理回数部203における管理対象ラインを、どのように設定するかについて述べる。実施の形態のように、インデクスの値が連続する複数のラインからなるラインセットを複数セット分構成し、ラインセット同士は一定間隔空けるようにする。この一定間隔は、プログラムが使用するメモリ単位(メモリにおけるプログラムの管理単位)の間隔に合わせ、各ラインセットは、メモリ単位の先頭に相当するように設けることが好ましい。なお、プログラムの挙動を精度良く推定するためには、先頭に設けることが最良であるものの、場合によってはメモリ単位の中程に各ラインセットが位置するようにしても構わない。
 管理対象ラインのさらなる具体例を図10に示す。図10に示すように、プログラムが使用するメモリ単位が4キロバイトで、キャッシュラインサイズが32バイトであれば、インデクス0x80(128)間隔でラインセットを設ける。そして各ラインセットは、インデクス0x000、0x080、0x100などから、それぞれ後続する4ライン分をセットとすることが考えられる。
 なお、セットとするラインの数は、複数(2ライン以上)であれば足り、例えば、8ラインとしてもよい。
 (6)図9のステップS52のYesは、リード回数同士がすべて0回かつライト回数同士がすべて0回の場合を除くとしても構わない。なぜならば、両者が共にすべて0回ならば、プログラムの挙動を推定する材料としては最適でない場合があるからである。
 (7)実施の形態では、情報処理装置1000はPCとして説明したが、これに限らず、PDA(Personal Digital Assistance)や携帯電話機等の携帯通信端末でもよい。また、情報処理装置1000は、それ自体としてユーザの使用に供するものでもよいし、様々な電子機器に組み込まれている態様でもよい。
 (8)実施の形態では、プロセッサ1は、CPUとして説明したが、これに限らず、メディア処理用やグラフィック処理用のプロセッサ、DSP(Digital Signal Processor)などであってもよい、また、プロセッサは、単一のプロセッサで構成されてもよく、複数のプロセッサで構成されてもよい。
 (9)図2の各機能ブロックは、典型的にはプロセッサと外部メモリとの間に存在するキャッシュメモリとして実現されるが、集積回路であるLSIとしてもよい。これらは個別に1チップ化されても良いし、一部又は全てを含むように1チップ化されても良い。ここでは、LSIとしたが、集積度の違いにより、IC、システムLSI、スーパーLSI、ウルトラLSIと呼称されることもある。また、集積回路化の手法はLSIに限るものではなく、専用回路又は汎用プロセッサで実現してもよい。LSI製造後に、プログラムすることが可能なFPGA(Field Programmable Gate Array)や、LSI内部の回路セルの接続や設定を再構成可能なリコンフィギュラブル・プロセッサーを利用してもよい。さらには、半導体技術の進歩又は派生する別技術によりLSIに置き換わる集積回路化の技術が登場すれば、当然、その技術を用いて機能ブロックの集積化を行ってもよい。
 (10)実施の形態で示した動作などを各種情報処理装置のプロセッサ、及びそのプロセッサに接続された各種回路に実行させるためのプログラムコードからなる制御プログラムを、記録媒体に記録すること、又は各種通信路等を介して流通させ頒布することもできる。このような記録媒体には、ICカード、HDD,光ディスク、フレキシブルディスク、ROMなどの非一時的な(non-transitory)な記録媒体が含まれる。流通、頒布された制御プログラムはプロセッサに読み出され得るメモリ等に格納されることにより利用に供され、そのプロセッサがその制御プログラムを実行することにより実施の形態で示したような各種機能が実現されることになる。
 (11)実施の形態や、本補足1で挙げた具体的なスペック値(ラインサイズ、キャッシュブロックサイズなど)はあくまで一例に過ぎず、キャッシュメモリの構成に応じて適宜変更可能である。
<補足2>
 本実施の形態は、次の態様を含むものである。
(1)本実施の形態に係るキャッシュメモリ装置は、キャッシュデータを格納する格納手段と、アドレスの指定を含むアクセス要求を受けると、このアドレスからタグとインデクスとを抽出するアドレス抽出手段と、アドレス抽出手段が抽出したタグとインデクスに基づき、前記キャッシュデータに関してヒットかミスかを判定するヒット/ミス判定手段と、それぞれインデクスの値が並んだ複数のラインからなる複数のラインセットについて、各ラインセットを構成するライン毎のアクセス回数を管理する管理手段と、前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しており、このインデクスに関して前記ヒット/ミス判定手段によりヒットと判定されると、このインデクスに対応するラインのアクセス回数を1回増やすカウント手段と、前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しておらず、このインデクスに関して前記ヒット/ミス判定手段によりミスと判定されると、前記管理手段が管理するラインの中からこのインデクスに対応するラインセットを特定する特定手段と、特定されたラインセットを構成する全ラインそれぞれのアクセス回数が、すべてが一致しているのでなければリフィルすべきラインサイズを第1ラインサイズと決定し、すべてが一致していればリフィルすべきラインサイズを前記第1ラインサイズより大きい第2ラインサイズと決定する決定手段と、決定されたラインサイズに基づいて、前記キャッシュデータのリフィルを行うリフィル手段と、を備えることを特徴とする。
(2)前記複数のラインセットのそれぞれは、インデクスが連続する値で並んだ複数のラインからなり、前記特定手段は、前記アドレス抽出手段が抽出したインデクスの値よりも小さく、かつ、最も近い値の所定インデクスを含むラインセットを特定するとしても構わない。
(3)前記格納手段が格納するキャッシュデータは、プログラムが読み出しおよび書き込みを行うためのページ単位で管理された主メモリのデータであって、
 前記複数のラインセットのそれぞれは、前記主メモリにおけるページ単位毎に、一対一に対応しており、各ラインセットの先頭のインデクスの値は、前記主メモリにおけるページ単位の先頭に対応する値であるとしても構わない。
(4)前記格納手段は、前記キャッシュデータを、このデータの主メモリにおける所在を示すタグに関係付けてライン単位で格納し、前記インデクスは前記格納手段におけるラインを指定するものであって、前記決定手段は、特定されたラインセットを構成する全ラインそれぞれに対応するすべてのタグを前記格納手段から取得し、前記特定されたラインセットを構成する全ラインそれぞれのアクセス回数のすべてが一致している場合において取得されたすべてのタグのすべてが一致しているのでなければ、リフィルすべきラインサイズを前記第1ラインサイズと決定し、取得されたすべてのタグのすべてが一致していれば、リフィルすべきラインサイズを前記第2ラインサイズと決定するとしても構わない。
 この構成によれば、より確実にプログラムの挙動を推定でき、適切なリフィルサイズの決定に資する。
(5)前記アクセス要求には、リード要求とライト要求の2種類が有り、
 前記管理手段が管理する前記アクセス回数は、リード回数とライト回数とを含み、前記カウント手段は、前記ヒット判定手段によりヒットと判定されると、この判定の基としたアクセス要求がリード要求であれば対応するインデクスのリード回数を1回増やし、判定の基としたアクセス要求がライト要求であれば対応するライト回数を1回増やし、前記決定手段は、特定されたラインセットを構成する全ラインそれぞれのライト回数がすべてが一致しており、かつ、特定されたラインセットを構成する全ラインそれぞれのリード回数がすべてが一致している場合には、リフィルすべきラインサイズを前記第2ラインサイズと決定し、特定されたラインセットを構成する全ラインそれぞれのライト回数がすべて一致しているのでない場合、または、特定されたラインセットを構成する全ラインそれぞれのリード回数がすべて一致しているのでない場合には、
リフィルすべきラインサイズを前記第1ラインサイズと決定するとしても構わない。
(6)前記カウント手段は、前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しており、このインデクスに関して前記ヒット/ミス判定手段によりミスと判定されると、前記アクセス要求に含まれるインデクスに対応するラインのリード回数とライト回数とを含むアクセス回数をリセットし、リセット後、アクセス要求がリード要求かライト要求かに応じて、対応するインデクスのリード回数またはライト回数を1回増やすとしても構わない。
(7)前記格納手段は、前記キャッシュデータを、このデータの主メモリにおける所在を示すタグに関係付けてライン単位で格納し、前記インデクスは前記格納手段におけるラインを指定するものであって、前記ヒット判定手段は、前記アドレス抽出手段により抽出されたインデクスに対応するインデクスを前記格納手段が格納するデータの中から特定し、特定されたインデクスに関係付けられたタグと、アドレス抽出手段により抽出されたタグとを比較し、両タグが一致してしればヒットと判定し不一致であればミスと判定するとしても構わない。
(8)本実施の形態に係るキャッシュメモリ制御方法は、 キャッシュデータを格納する格納ステップと、アドレスの指定を含むアクセス要求を受けると、このアドレスからタグとインデクスとを抽出するアドレス抽出ステップと、アドレス抽出ステップが抽出したタグとインデクスに基づき、前記キャッシュデータに関してヒットかミスかを判定するヒット/ミス判定ステップと、それぞれインデクスの値が並んだ複数のラインからなる複数のラインセットについて、各ラインセットを構成するライン毎のアクセス回数を管理する管理ステップと、前記アドレス抽出ステップで抽出したインデクスが、前記管理ステップで管理しているラインのインデクスを示しており、このインデクスに関して前記ヒット/ミス判定ステップによりヒットと判定されると、このインデクスに対応するラインのアクセス回数を1回増やすカウントステップと、前記アドレス抽出ステップで抽出したインデクスが、前記管理ステップで管理しているラインのインデクスを示しておらず、このインデクスに関して前記ヒット/ミス判定ステップによりミスと判定されると、前記管理ステップで管理しているラインの中からこのインデクスに対応するラインセットを特定する特定ステップと、特定されたラインセットを構成する全ラインそれぞれのアクセス回数が、すべてが一致しているのでなければリフィルすべきラインサイズを第1ラインサイズと決定し、すべてが一致していればリフィルすべきラインサイズを前記第1ラインサイズより大きい第2ラインサイズと決定する決定ステップと、決定されたラインサイズに基づいて、前記キャッシュデータのリフィルを行うリフィルステップと、を含むことを特徴とする。
(9)本実施の形態に係るプログラムは、キャッシュメモリ装置に、キャッシュメモリ制御処理を実行させるプログラムであって、前記キャッシュメモリ制御処理は、キャッシュデータを格納する格納ステップと、アドレスの指定を含むアクセス要求を受けると、このアドレスからタグとインデクスとを抽出するアドレス抽出ステップと、アドレス抽出ステップが抽出したタグとインデクスに基づき、前記キャッシュデータに関してヒットかミスかを判定するヒット/ミス判定ステップと、それぞれインデクスの値が並んだ複数のラインからなる複数のラインセットについて、各ラインセットを構成するライン毎のアクセス回数を管理する管理ステップと、前記アドレス抽出ステップで抽出したインデクスが、前記管理ステップで管理しているラインのインデクスを示しており、このインデクスに関して前記ヒット/ミス判定ステップによりヒットと判定されると、このインデクスに対応するラインのアクセス回数を1回増やすカウントステップと、前記アドレス抽出ステップで抽出したインデクスが、前記管理ステップで管理しているラインのインデクスを示しておらず、このインデクスに関して前記ヒット/ミス判定ステップによりミスと判定されると、前記管理ステップで管理しているラインの中からこのインデクスに対応するラインセットを特定する特定ステップと、特定されたラインセットを構成する全ラインそれぞれのアクセス回数が、すべてが一致しているのでなければリフィルすべきラインサイズを第1ラインサイズと決定し、すべてが一致していればリフィルすべきラインサイズを前記第1ラインサイズより大きい第2ラインサイズと決定する決定ステップと、決定されたラインサイズに基づいて、前記キャッシュデータのリフィルを行うリフィルステップと、を含むことを特徴とする。
(10)本実施の形態に係る集積回路は、キャッシュデータを格納する格納手段と、アドレスの指定を含むアクセス要求を受けると、このアドレスからタグとインデクスとを抽出するアドレス抽出手段と、アドレス抽出手段が抽出したタグとインデクスに基づき、前記キャッシュデータに関してヒットかミスかを判定するヒット/ミス判定手段と、それぞれインデクスの値が並んだ複数のラインからなる複数のラインセットについて、各ラインセットを構成するライン毎のアクセス回数を管理する管理手段と、前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しており、このインデクスに関して前記ヒット/ミス判定手段によりヒットと判定されると、このインデクスに対応するラインのアクセス回数を1回増やすカウント手段と、前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しておらず、このインデクスに関して前記ヒット/ミス判定手段によりミスと判定されると、前記管理手段が管理するラインの中からこのインデクスに対応するラインセットを特定する特定手段と、特定されたラインセットを構成する全ラインそれぞれのアクセス回数が、すべてが一致しているのでなければリフィルすべきラインサイズを第1ラインサイズと決定し、すべてが一致していればリフィルすべきラインサイズを前記第1ラインサイズより大きい第2ラインサイズと決定する決定手段と、決定されたラインサイズに基づいて、前記キャッシュデータのリフィルを行うリフィル手段と、を備えることを特徴とする。
 本発明にかかるキャッシュメモリ装置は、プログラムの動作に応じて即時にリフィルするラインサイズを変更する機能を有し、情報処理装置として有用である。また、情報機器、AV機器、通信機器、家電機器などの組み込み機器などのコンピュータを搭載する機器において有用である。
 1,11,12,13 プロセッサ
 2 メモリ装置
 10 キャッシュメモリ装置
 21 ROM
 22 RAM
 25 HDD
 26,35,41,46 インタフェース(I/F)
 31 記録媒体
 32 読取装置
 33 通信回線
 34 通信装置
 40 入力装置
 45 表示装置
 50 バスライン
 51 タイマ回路
 55 割込コントローラ
 201 アドレス解析部(アドレス抽出部)
 202 管理ライン判定部
 203 回数管理部
 204 ラインサイズ決定部
 205 ヒット/ミス判定部
 206 リフィル部
 207 キャッシュデータ格納部
 231 外部メモリ

Claims (10)

  1.  キャッシュデータを格納する格納手段と、
     アドレスの指定を含むアクセス要求を受けると、このアドレスからタグとインデクスとを抽出するアドレス抽出手段と、
     アドレス抽出手段が抽出したタグとインデクスに基づき、前記キャッシュデータに関してヒットかミスかを判定するヒット/ミス判定手段と、
     それぞれインデクスの値が並んだ複数のラインからなる複数のラインセットについて、各ラインセットを構成するライン毎のアクセス回数を管理する管理手段と、
     前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しており、このインデクスに関して前記ヒット/ミス判定手段によりヒットと判定されると、このインデクスに対応するラインのアクセス回数を1回増やすカウント手段と、
     前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しておらず、このインデクスに関して前記ヒット/ミス判定手段によりミスと判定されると、前記管理手段が管理するラインの中からこのインデクスに対応するラインセットを特定する特定手段と、
     特定されたラインセットを構成する全ラインそれぞれのアクセス回数が、
      すべてが一致しているのでなければリフィルすべきラインサイズを第1ラインサイズと決定し、
      すべてが一致していればリフィルすべきラインサイズを前記第1ラインサイズより大きい第2ラインサイズと決定する決定手段と、
     決定されたラインサイズに基づいて、前記キャッシュデータのリフィルを行うリフィル手段と、
    を備えることを特徴とするキャッシュメモリ装置。
  2.  前記複数のラインセットのそれぞれは、インデクスが連続する値で並んだ複数のラインからなり、
     前記特定手段は、前記アドレス抽出手段が抽出したインデクスの値よりも小さく、かつ、最も近い値の所定インデクスを含むラインセットを特定する
    ことを特徴とする請求項1に記載のキャッシュメモリ装置。
  3.  前記格納手段が格納するキャッシュデータは、プログラムが読み出しおよび書き込みを行うためのページ単位で管理された主メモリのデータであって、
     前記複数のラインセットのそれぞれは、前記主メモリにおけるページ単位毎に、一対一に対応しており、
     各ラインセットの先頭のインデクスの値は、前記主メモリにおけるページ単位の先頭に対応する値である
    ことを特徴とする請求項2に記載のキャッシュメモリ装置。
  4.  前記格納手段は、前記キャッシュデータを、このデータの主メモリにおける所在を示すタグに関係付けてライン単位で格納し、前記インデクスは前記格納手段におけるラインを指定するものであって、
     前記決定手段は、特定されたラインセットを構成する全ラインそれぞれに対応するすべてのタグを前記格納手段から取得し、
    前記特定されたラインセットを構成する全ラインそれぞれのアクセス回数のすべてが一致している場合において、
      取得されたすべてのタグのすべてが一致しているのでなければ、リフィルすべきラインサイズを前記第1ラインサイズと決定し、
      取得されたすべてのタグのすべてが一致していれば、リフィルすべきラインサイズを前記第2ラインサイズと決定する
    ことを特徴とする請求項1に記載のキャッシュメモリ装置。
  5.  前記アクセス要求には、リード要求とライト要求の2種類が有り、
     前記管理手段が管理する前記アクセス回数は、リード回数とライト回数とを含み、
     前記カウント手段は、前記ヒット判定手段によりヒットと判定されると、この判定の基としたアクセス要求がリード要求であれば対応するインデクスのリード回数を1回増やし、判定の基としたアクセス要求がライト要求であれば対応するライト回数を1回増やし、
     前記決定手段は、
      特定されたラインセットを構成する全ラインそれぞれのライト回数がすべてが一致しており、かつ、特定されたラインセットを構成する全ラインそれぞれのリード回数がすべてが一致している場合には、リフィルすべきラインサイズを前記第2ラインサイズと決定し、
      特定されたラインセットを構成する全ラインそれぞれのライト回数がすべて一致しているのでない場合、
      または、特定されたラインセットを構成する全ラインそれぞれのリード回数がすべて一致しているのでない場合には、
    リフィルすべきラインサイズを前記第1ラインサイズと決定する
    ことと特徴とする
    請求項1に記載のキャッシュメモリ装置。
  6.  前記カウント手段は、前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しており、このインデクスに関して前記ヒット/ミス判定手段によりミスと判定されると、前記アクセス要求に含まれるインデクスに対応するラインのリード回数とライト回数とを含むアクセス回数をリセットし、
     リセット後、アクセス要求がリード要求かライト要求かに応じて、対応するインデクスのリード回数またはライト回数を1回増やす
    ことを特徴とする請求項5に記載のキャッシュメモリ装置。
  7.  前記格納手段は、前記キャッシュデータを、このデータの主メモリにおける所在を示すタグに関係付けてライン単位で格納し、前記インデクスは前記格納手段におけるラインを指定するものであって、
     前記ヒット判定手段は、前記アドレス抽出手段により抽出されたインデクスに対応するインデクスを前記格納手段が格納するデータの中から特定し、特定されたインデクスに関係付けられたタグと、アドレス抽出手段により抽出されたタグとを比較し、両タグが一致してしればヒットと判定し不一致であればミスと判定する
    ことを特徴とする請求項1に記載のキャッシュメモリ装置。
  8.  キャッシュデータを格納する格納ステップと、
     アドレスの指定を含むアクセス要求を受けると、このアドレスからタグとインデクスとを抽出するアドレス抽出ステップと、
     アドレス抽出ステップが抽出したタグとインデクスに基づき、前記キャッシュデータに関してヒットかミスかを判定するヒット/ミス判定ステップと、
     それぞれインデクスの値が並んだ複数のラインからなる複数のラインセットについて、各ラインセットを構成するライン毎のアクセス回数を管理する管理ステップと、
     前記アドレス抽出ステップで抽出したインデクスが、前記管理ステップで管理しているラインのインデクスを示しており、このインデクスに関して前記ヒット/ミス判定ステップによりヒットと判定されると、このインデクスに対応するラインのアクセス回数を1回増やすカウントステップと、
     前記アドレス抽出ステップで抽出したインデクスが、前記管理ステップで管理しているラインのインデクスを示しておらず、このインデクスに関して前記ヒット/ミス判定ステップによりミスと判定されると、前記管理ステップで管理しているラインの中からこのインデクスに対応するラインセットを特定する特定ステップと、
     特定されたラインセットを構成する全ラインそれぞれのアクセス回数が、
      すべてが一致しているのでなければリフィルすべきラインサイズを第1ラインサイズと決定し、
      すべてが一致していればリフィルすべきラインサイズを前記第1ラインサイズより大きい第2ラインサイズと決定する決定ステップと、
     決定されたラインサイズに基づいて、前記キャッシュデータのリフィルを行うリフィルステップと、
    を含む
    ことを特徴とするキャッシュメモリ制御方法。
  9.  キャッシュメモリ装置に、キャッシュメモリ制御処理を実行させるプログラムであって、
     前記キャッシュメモリ制御処理は、
      キャッシュデータを格納する格納ステップと、
     アドレスの指定を含むアクセス要求を受けると、このアドレスからタグとインデクスとを抽出するアドレス抽出ステップと、
     アドレス抽出ステップが抽出したタグとインデクスに基づき、前記キャッシュデータに関してヒットかミスかを判定するヒット/ミス判定ステップと、
     それぞれインデクスの値が並んだ複数のラインからなる複数のラインセットについて、各ラインセットを構成するライン毎のアクセス回数を管理する管理ステップと、
     前記アドレス抽出ステップで抽出したインデクスが、前記管理ステップで管理しているラインのインデクスを示しており、このインデクスに関して前記ヒット/ミス判定ステップによりヒットと判定されると、このインデクスに対応するラインのアクセス回数を1回増やすカウントステップと、
     前記アドレス抽出ステップで抽出したインデクスが、前記管理ステップで管理しているラインのインデクスを示しておらず、このインデクスに関して前記ヒット/ミス判定ステップによりミスと判定されると、前記管理ステップで管理しているラインの中からこのインデクスに対応するラインセットを特定する特定ステップと、
     特定されたラインセットを構成する全ラインそれぞれのアクセス回数が、
      すべてが一致しているのでなければリフィルすべきラインサイズを第1ラインサイズと決定し、
      すべてが一致していればリフィルすべきラインサイズを前記第1ラインサイズより大きい第2ラインサイズと決定する決定ステップと、
     決定されたラインサイズに基づいて、前記キャッシュデータのリフィルを行うリフィルステップと、
    を含むことを特徴とするプログラム。
  10.  キャッシュデータを格納する格納手段と、
     アドレスの指定を含むアクセス要求を受けると、このアドレスからタグとインデクスとを抽出するアドレス抽出手段と、
     アドレス抽出手段が抽出したタグとインデクスに基づき、前記キャッシュデータに関してヒットかミスかを判定するヒット/ミス判定手段と、
     それぞれインデクスの値が並んだ複数のラインからなる複数のラインセットについて、各ラインセットを構成するライン毎のアクセス回数を管理する管理手段と、
     前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しており、このインデクスに関して前記ヒット/ミス判定手段によりヒットと判定されると、このインデクスに対応するラインのアクセス回数を1回増やすカウント手段と、
     前記アドレス抽出手段が抽出したインデクスが前記管理手段が管理しているラインのインデクスを示しておらず、このインデクスに関して前記ヒット/ミス判定手段によりミスと判定されると、前記管理手段が管理するラインの中からこのインデクスに対応するラインセットを特定する特定手段と、
     特定されたラインセットを構成する全ラインそれぞれのアクセス回数が、
      すべてが一致しているのでなければリフィルすべきラインサイズを第1ラインサイズと決定し、
      すべてが一致していればリフィルすべきラインサイズを前記第1ラインサイズより大きい第2ラインサイズと決定する決定手段と、
     決定されたラインサイズに基づいて、前記キャッシュデータのリフィルを行うリフィル手段と、
    を備えることを特徴とする集積回路。
PCT/JP2010/002551 2009-04-10 2010-04-07 キャッシュメモリ装置、キャッシュメモリ制御方法、プログラムおよび集積回路 WO2010116735A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US12/997,093 US9026738B2 (en) 2009-04-10 2010-04-07 Cache memory device, cache memory control method, program and integrated circuit
JP2011508245A JP5347019B2 (ja) 2009-04-10 2010-04-07 キャッシュメモリ装置、キャッシュメモリ制御方法、プログラムおよび集積回路
CN2010800017981A CN102057359A (zh) 2009-04-10 2010-04-07 高速缓冲存储器装置、高速缓冲存储器控制方法、程序及集成电路

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2009095808 2009-04-10
JP2009-095808 2009-04-10

Publications (1)

Publication Number Publication Date
WO2010116735A1 true WO2010116735A1 (ja) 2010-10-14

Family

ID=42936029

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/002551 WO2010116735A1 (ja) 2009-04-10 2010-04-07 キャッシュメモリ装置、キャッシュメモリ制御方法、プログラムおよび集積回路

Country Status (4)

Country Link
US (1) US9026738B2 (ja)
JP (1) JP5347019B2 (ja)
CN (1) CN102057359A (ja)
WO (1) WO2010116735A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014016812A (ja) * 2012-07-09 2014-01-30 Fujitsu Ltd メモリ装置、演算処理装置、及びキャッシュメモリの制御方法
JP2019517690A (ja) * 2016-06-13 2019-06-24 アドバンスト・マイクロ・ディバイシズ・インコーポレイテッドAdvanced Micro Devices Incorporated キャッシュ置換ポリシーのスケーリングされたセットデュエリング

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102207927B (zh) * 2011-05-27 2016-01-13 清华大学 动态可重构处理器之间的数据传输方法、处理器和系统
GB2538055B (en) 2015-04-28 2017-04-19 Advanced Risc Mach Ltd Data processing apparatus having a cache
GB2538054B (en) 2015-04-28 2017-09-13 Advanced Risc Mach Ltd Data processing apparatus, controller, cache and method
CN109766327A (zh) * 2015-05-29 2019-05-17 北京奇虎科技有限公司 数据库访问请求的分析方法和装置
US10956432B2 (en) * 2017-08-30 2021-03-23 Gsi Technology Inc. One by one selection of items of a set
CN107992433A (zh) * 2017-12-19 2018-05-04 北京云知声信息技术有限公司 二级缓存检测方法及装置
US10891228B2 (en) 2018-02-12 2021-01-12 International Business Machines Corporation Cache line states identifying memory cache
CN112711383B (zh) * 2020-12-30 2022-08-26 浙江大学 用于电力芯片的非易失性存储读取加速方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002149488A (ja) * 2000-11-15 2002-05-24 Hitachi Ltd 集積回路装置およびキャッシュメモリの制御方法
JP3515333B2 (ja) * 1997-08-26 2004-04-05 株式会社東芝 情報処理装置
JP2006085292A (ja) * 2004-09-14 2006-03-30 Matsushita Electric Ind Co Ltd 演算処理装置
JP4071886B2 (ja) * 1998-03-20 2008-04-02 松下電器産業株式会社 ブロック・サイズを変更可能なキャッシュ・メモリ・システム
JP4189402B2 (ja) * 2005-02-21 2008-12-03 パナソニック株式会社 キャッシュ回路

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04189402A (ja) 1990-11-21 1992-07-07 Seibu Electric & Mach Co Ltd インデックス刄物台装置
US6446164B1 (en) * 1991-06-27 2002-09-03 Integrated Device Technology, Inc. Test mode accessing of an internal cache memory
US6349364B1 (en) 1998-03-20 2002-02-19 Matsushita Electric Industrial Co., Ltd. Cache memory system with variable block-size mechanism
JPH11345167A (ja) * 1998-05-29 1999-12-14 Toshiba Corp キャッシュ制御方法ならびに装置
CN1168025C (zh) * 1999-03-10 2004-09-22 国际商业机器公司 用于多线程处理机的指令高速缓存器
JP3556556B2 (ja) * 2000-02-08 2004-08-18 株式会社東芝 命令コード変換装置及び情報処理システム
JP2002163150A (ja) * 2000-11-28 2002-06-07 Toshiba Corp プロセッサ
US20030007442A1 (en) * 2001-07-09 2003-01-09 Henrichs Joseph Reid Light intensity modulated direct overwrite magneto-optical microhead array chip hard disk drive
US7782731B2 (en) * 2001-07-23 2010-08-24 Joseph Reid Henrichs Optical hard disk drive having a phase-change microhead array chip
US7359890B1 (en) * 2002-05-08 2008-04-15 Oracle International Corporation System load based adaptive prefetch
JP2004259109A (ja) 2003-02-27 2004-09-16 Toshiba Corp マイクロプロセッサ及びキャッシュ制御方法
US20060143401A1 (en) * 2004-12-27 2006-06-29 Jacob Doweck Method and apparatus for prefetching based on cache fill buffer hits
JP2008225914A (ja) * 2007-03-13 2008-09-25 Fujitsu Ltd プリフェッチ制御装置、記憶装置システムおよびプリフェッチ制御方法
US9390018B2 (en) * 2012-08-17 2016-07-12 Advanced Micro Devices, Inc. Data cache prefetch hints

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3515333B2 (ja) * 1997-08-26 2004-04-05 株式会社東芝 情報処理装置
JP4071886B2 (ja) * 1998-03-20 2008-04-02 松下電器産業株式会社 ブロック・サイズを変更可能なキャッシュ・メモリ・システム
JP2002149488A (ja) * 2000-11-15 2002-05-24 Hitachi Ltd 集積回路装置およびキャッシュメモリの制御方法
JP2006085292A (ja) * 2004-09-14 2006-03-30 Matsushita Electric Ind Co Ltd 演算処理装置
JP4189402B2 (ja) * 2005-02-21 2008-12-03 パナソニック株式会社 キャッシュ回路

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014016812A (ja) * 2012-07-09 2014-01-30 Fujitsu Ltd メモリ装置、演算処理装置、及びキャッシュメモリの制御方法
JP2019517690A (ja) * 2016-06-13 2019-06-24 アドバンスト・マイクロ・ディバイシズ・インコーポレイテッドAdvanced Micro Devices Incorporated キャッシュ置換ポリシーのスケーリングされたセットデュエリング

Also Published As

Publication number Publication date
US9026738B2 (en) 2015-05-05
CN102057359A (zh) 2011-05-11
JP5347019B2 (ja) 2013-11-20
JPWO2010116735A1 (ja) 2012-10-18
US20120096213A1 (en) 2012-04-19

Similar Documents

Publication Publication Date Title
JP5347019B2 (ja) キャッシュメモリ装置、キャッシュメモリ制御方法、プログラムおよび集積回路
US9996466B2 (en) Apparatus, system and method for caching compressed data
CN112272816B (zh) 存储器系统或子系统中的预取信令
JP6859361B2 (ja) 中央処理ユニット(cpu)ベースシステムにおいて複数のラストレベルキャッシュ(llc)ラインを使用してメモリ帯域幅圧縮を行うこと
CN110554999B (zh) 基于日志式文件系统和闪存设备的冷热属性识别和分离方法、装置以及相关产品
CN102171663A (zh) 管理缓存内容的存储
CN111338561B (zh) 存储器控制器与存储器页面管理方法
US8112589B2 (en) System for caching data from a main memory with a plurality of cache states
CN102859504A (zh) 有效分区存储缓存
CN106951374B (zh) 用于检查块页地址的方法及其装置
US11762590B2 (en) Memory system and data processing system including multi-core controller for classified commands
US20220269600A1 (en) Method and computer program product for performing data writes into a flash memory
US9792228B2 (en) Enhancing lifetime of non-volatile cache by injecting random replacement policy
CN107229580B (zh) 顺序流检测方法与装置
WO2018147964A1 (en) Reducing bandwidth consumption when performing free memory list cache maintenance in compressed memory schemes of processor-based systems
CN112181275A (zh) 一种数据处理器及数据处理方法
US9910788B2 (en) Cache access statistics accumulation for cache line replacement selection
US9767043B2 (en) Enhancing lifetime of non-volatile cache by reducing intra-block write variation
CN110580128A (zh) 使用缓存反馈信息指导数据预读
US20230012880A1 (en) Level-aware cache replacement
CN117642731A (zh) 级感知高速缓存替换
CN117971728A (zh) 缓存器及缓存控制方法、集成电路系统、电子组件及设备
CN114185480A (zh) 存储器系统和数据处理系统
JP2013257699A (ja) データ記録装置、データ記録方法及びデータ記録プログラム

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201080001798.1

Country of ref document: CN

WWE Wipo information: entry into national phase

Ref document number: 2011508245

Country of ref document: JP

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10761439

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 12997093

Country of ref document: US

122 Ep: pct application non-entry in european phase

Ref document number: 10761439

Country of ref document: EP

Kind code of ref document: A1