WO2014030387A1 - キャッシュメモリコントローラ及びキャッシュメモリコントロール方法 - Google Patents

キャッシュメモリコントローラ及びキャッシュメモリコントロール方法 Download PDF

Info

Publication number
WO2014030387A1
WO2014030387A1 PCT/JP2013/061244 JP2013061244W WO2014030387A1 WO 2014030387 A1 WO2014030387 A1 WO 2014030387A1 JP 2013061244 W JP2013061244 W JP 2013061244W WO 2014030387 A1 WO2014030387 A1 WO 2014030387A1
Authority
WO
WIPO (PCT)
Prior art keywords
transfer
cache memory
access
instruction
reservation information
Prior art date
Application number
PCT/JP2013/061244
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 JP2014531518A priority Critical patent/JP5808495B2/ja
Priority to US14/411,709 priority patent/US20150234747A1/en
Priority to CN201380041056.5A priority patent/CN104508640A/zh
Priority to DE112013004110.3T priority patent/DE112013004110T5/de
Publication of WO2014030387A1 publication Critical patent/WO2014030387A1/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/0875Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with dedicated cache, e.g. instruction or stack
    • 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
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • G06F2212/1024Latency reduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/45Caching of specific data in cache memory
    • G06F2212/452Instruction code
    • 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/6028Prefetching based on hints or prefetch instructions

Definitions

  • the present invention relates to a cache memory controller and a cache memory control method.
  • the main memory is divided into an instruction area and a data area.
  • instructions such as programs are stored
  • data such as images used for processing by these instructions are stored. Since the operating frequency of the main memory is lower than the operating frequency of an access master such as a CPU, a cache memory that can be accessed at high speed is generally used. The access master can read and write data at a higher speed by accessing the cache memory.
  • the cache memory has a small capacity per unit area and is expensive, in many cases, it is difficult to replace the entire main memory with the cache memory. For this reason, a method of transferring a part of the data in the main memory to the cache memory is taken. Transfer from the main memory to the cache memory is performed in units of cache lines, which are units of management of the cache memory.
  • the access master can read and write data at high speed when the necessary data is stored in the cache memory and can be accessed reliably. This case is called a cache hit.
  • Patent Document 1 describes an information processing apparatus that stores an instruction from an access master in a buffer, prefetches data based on a past interrupt instruction history, and stores it in a cache memory as a data prefetching technique. As a result, when an interrupt instruction executed in the past by the access master is executed again, it becomes a cache hit, speeding up the branch to the interrupt routine, and speeding up the return from the interrupt routine or subroutine. it can.
  • an object of the present invention is to ensure that a cache hit can be made even for instructions and data that have not been accessed by an access master.
  • a cache memory controller includes a main memory having an instruction area for storing a first program and a data area for storing data used in a specific instruction included in the first program; A cache memory controller connected to an access master that executes an instruction included in the first program; a cache memory that stores a part of data of the main memory; and a start address of the specific instruction Before the access master executes the specific instruction, based on the number of remaining instruction steps from the address of the instruction being executed in the access master to the start address of the specific instruction. An interval is calculated, and the data used in the specific instruction is calculated at the access interval. Characterized in that it comprises a data processing unit to be transferred from the in-memory to the cache memory.
  • a cache memory control method includes a main memory having an instruction area for storing a first program and a data area for storing data used in a specific instruction included in the first program.
  • a transfer process of transferring from the main memory to the cache memory, and a providing process of providing data used by the specific instruction from the cache memory to the access master when the access master executes the specific instruction It is characterized by having.
  • a cache hit can be reliably performed even for instructions and data that have not been accessed by the access master.
  • FIG. 1 is a block diagram schematically showing a configuration of a cache memory controller according to a first embodiment.
  • FIG. 3 is a schematic diagram showing a transfer reservation function for operating the cache memory controller according to the first embodiment.
  • FIG. 11 is a schematic diagram illustrating an example in which a transfer reservation function is applied to a second program in the first embodiment.
  • 4 is a flowchart illustrating processing for compiling a second program into a first program in the first embodiment.
  • FIG. 3 is a schematic diagram showing a relationship between an input to compilation and an output in the first embodiment.
  • FIG. 3 is a schematic diagram illustrating an example of a first program generated by compiling a second program in the first embodiment.
  • FIG. 3 is a schematic diagram showing an example of arrangement of a first program in a main memory in the first embodiment.
  • 4 is a flowchart illustrating processing performed by a process switching unit of the data processing unit in the first embodiment.
  • 6 is a schematic diagram illustrating an example of a timing chart of processing in a processing switching unit in the first embodiment.
  • FIG. 4 is a flowchart illustrating processing performed by a request processing unit of a data processing unit in the first embodiment.
  • 5 is a flowchart illustrating processing performed by a reservation processing unit of the data processing unit in the first embodiment.
  • (A)-(c) is the schematic which shows the transition of the data transfer by the reservation process part in Embodiment 1.
  • FIG. 6 is a schematic diagram illustrating an example of a timing chart of processing performed by a reservation processing unit in the first embodiment.
  • FIG. 4 is a flowchart illustrating processing performed by the release processing unit of the data processing unit in the first embodiment.
  • FIG. 10 is a schematic diagram showing a modification of the second program in the first embodiment.
  • FIG. 6 is a block diagram schematically showing a configuration of a cache memory controller according to a second embodiment. 10 is a table stored in a reservation processing unit according to the second embodiment.
  • FIG. 10 is a diagram illustrating a first example of two pieces of transfer reservation information included in the first program, in which the priority determination unit of the data processing unit determines the priority in the second embodiment.
  • FIG. 25 is a diagram illustrating a second example of two pieces of transfer reservation information included in the first program, in which the priority determination unit of the data processing unit determines the priority according to the second embodiment.
  • FIG. 25 is a diagram illustrating a third example of two pieces of transfer reservation information included in the first program, in which the priority determination unit of the data processing unit determines the priority according to the second embodiment.
  • FIG. 25 is a diagram illustrating a fourth example of two pieces of transfer reservation information included in the first program, in which the priority determination unit of the data processing unit determines the priority according to the second embodiment.
  • FIG. 25 is a diagram illustrating a fifth example of two pieces of transfer reservation information included in the first program, in which the priority determination unit of the data processing unit determines the priority according to the second embodiment.
  • 10 is a schematic diagram illustrating an example of a timing chart of processing in a priority determination unit of a data processing unit in Embodiment 2.
  • FIG. 10 is a flowchart illustrating processing performed by a reservation processing unit of a data processing unit in the second embodiment.
  • 10 is a schematic diagram illustrating an example of a timing chart of processing in a priority determination unit of a data processing unit in Embodiment 2.
  • FIG. FIG. 10 is a block diagram schematically showing a modification of the cache memory controller according to the second embodiment.
  • FIG. 10 is a schematic diagram showing a modification of transfer reservation management information in the second embodiment.
  • FIG. 10 is a schematic diagram illustrating an example of progress address management information in the second embodiment.
  • FIG. 1 is a block diagram schematically showing the configuration of the cache memory controller 100 according to the first embodiment.
  • the cache memory controller 100 includes a cache memory 110, a memory management unit 120, a hit detection unit 130, and a data processing unit 140.
  • the connection relationship between the access master 1, the cache memory controller 100, and the main memory 10 is simply shown.
  • the cache memory controller 100 accesses data stored in the cache memory 110 or the main memory 10 to be described later based on the instruction command C1 from the access master 1.
  • the instruction command C 1 is an access request from the access master 1 to an address on the main memory 10.
  • the instruction command C 1 is a read request
  • the instruction command C 1 from the access master 1 and the instruction address A 1 indicating the address on the main memory 10 are input to the cache memory controller 100.
  • the cache memory controller 100 outputs the read data D1 corresponding to the instruction command C1 and the instruction address A1 to the access master 1.
  • FIG. 1 shows the cache memory controller 100 including one access master 1, but a plurality of access masters 1 may share the cache memory controller 100.
  • the access master 1 is configured by a control unit such as a CPU, for example, and executes instructions according to a process of a computer program (first program) stored in the main memory 10.
  • the main memory 10 includes an instruction area and a data area.
  • a command executed by the access master 1 is stored in the command area, and data used by the access master 1 for processing is stored in the data area.
  • data used by the access master 1 for processing is stored in the data area.
  • a first program is stored in the instruction area, and data used for instructions included in the first program is stored in the data area.
  • the cache memory 110 stores a part of the data stored in the main memory 10.
  • the cache memory 110 is composed of a semiconductor memory such as SRAM (Static Random Access Memory), and can access data faster than the main memory 10.
  • SRAM Static Random Access Memory
  • the cache memory 110 is divided every 64 bytes, and this divided unit is called a cache line.
  • the cache line stores continuous 64-byte data in the main memory 10.
  • the memory management unit 120 manages the cache memory 110.
  • the memory management unit 120 includes a tag memory 121 as a management information storage unit, and manages the cache memory 110 using the tag memory 121.
  • the tag memory 121 includes address information Ta in the main memory 10 of data stored in each cache line of the cache memory 110, a status flag Fs that is status identification information indicating whether data exists in each cache line, An access flag Fa, which is access identification information indicating whether or not the access master 1 has accessed each cache line, is stored as management information.
  • the status flag Fs indicates “valid” when data exists in each cache line of the cache memory 110, and indicates “invalid” when no data exists.
  • the access flag Fa indicates “valid” when the access master 1 accesses each cache line of the cache memory 110, and indicates “invalid” when the access master 1 does not access.
  • the memory management unit 120 determines whether a predetermined time has elapsed, for example, with a timer (not shown), based on a LRU (Least Recently Used) method for checking whether a predetermined residence time has been accessed.
  • the access flag Fa is reset at the measured timing. Accordingly, the memory management unit 120 can obtain a cache line that has not been accessed recently.
  • the hit detection unit 130 determines whether or not the access requested data of the address on the main memory 10 is stored in the cache memory 110.
  • the hit detection unit 130 detects a cache hit when such data is stored in the cache memory 110, and detects a hit when the data is not stored in the cache memory 110. The result is given to the data processing unit 140.
  • the hit detection unit 130 determines whether such data is stored in the cache memory 110 by referring to the cache line address information Ta in which the status flag Fs in the tag memory 121 indicates “valid”.
  • a cache hit occurs when the address information Ta that matches the address requested to be accessed is stored on the memory management unit 120, and a cache miss occurs when such address information Ta is not stored.
  • the data processing unit 140 transfers the data stored in the main memory 10 to the cache memory 110.
  • the data processing unit 140 includes the access master 1 in the first program according to transfer reservation information including an address in which data used in a specific instruction is stored in the main memory 10.
  • the data used in the specific instruction is transferred from the main memory 10 to the cache memory 110.
  • the data processing unit 140 reads data from the cache memory 110 or the main memory 10 in response to a request from the access master 1.
  • the data processing unit 140 writes data into the cache memory 110 or the main memory 10 in response to a request from the access master 1.
  • the data processing unit 140 includes a process switching unit 141, a request processing unit 142, a reservation processing unit 143, a release processing unit 144, a cache memory access arbitration unit 145, and a main memory access arbitration unit 146.
  • the process switching unit 141 analyzes the instruction command C1 from the access master 1, and switches the data output destination between the request processing unit 142 and the reservation processing unit 143. For example, when the instruction command C1 indicates read or write, the process switching unit 141 gives the instruction command C1 as the request command C2 and the instruction address A1 as the request address A2, respectively, to the request processing unit 142. Further, when the command command C1 indicates a read, the process switching unit 141 stores the command address A1 as the progress address A3 in the memory (progress address storage unit) 141a. Here, the progress address A3 indicates an address that the access master 1 is executing.
  • the process switching unit 141 uses the instruction command C1 as the transfer reservation command C3 and performs a reservation process together with the progress address A3 stored in the memory 141a. Part 143.
  • the request processing unit 142 receives data in the cache memory 110 or the main memory 10 according to the request command C2 and the request address A2 input from the process switching unit 141 and the hit detection result R1 input from the hit detection unit 130. Read or write. For example, upon receiving the request address A2 from the process switching unit 141, the request processing unit 142 gives the request address A2 to the hit detection unit 130. Then, as a response, the request processing unit 142 acquires the hit detection result R1 of the request address A2 from the hit detection unit 130. When the request command C2 input from the process switching unit 141 indicates a read, the request processing unit 142 outputs the read data D1 read from the cache memory 110 or the main memory 10 to the access master 1. Information exchange between the request processing unit 142 and the cache memory access arbitration unit 145 is performed via the signal S1. In addition, information is exchanged between the request processing unit 142 and the main memory access arbitration unit 146 via a signal S4.
  • the reservation processing unit 143 transfers data from the main memory 10 to the cache memory 110 according to the progress address A3 and transfer reservation command C3 input from the process switching unit 141 and the hit detection result R2 input from the hit detection unit 130. Transfer data. For example, when the reservation processing unit 143 receives the transfer reservation command C3 from the process switching unit 141, the reservation processing unit 143 specifies the address (transfer reservation address) where the data to be transferred is stored in the main memory 10, and uses the specified address A4. This is given to the hit detection unit 130. Then, as a response, the reservation processing unit 143 acquires the hit detection result R2 of the address A4 from the hit detection unit 130.
  • the reservation processing unit 143 transfers the data at that address from the main memory 10 to the cache memory 110. Further, when the reservation processing unit 143 starts the transfer based on the transfer reservation command C3, the reservation processing unit 143 provides the release processing unit 144 with the reserved area information I1 indicating the storage destination cache line. Information exchange between the reservation processing unit 143 and the cache memory access arbitration unit 145 is performed via the signal S2. In addition, information exchange between the reservation processing unit 143 and the main memory access arbitration unit 146 is performed via a signal S5.
  • the release processing unit 144 selects a cache line to be released when the memory management unit 120 determines that the free capacity of the cache memory 110 has decreased. For example, the release processing unit 144 monitors the status flag Fs of the tag memory 121 of the memory management unit 120, and the status flag Fs indicating “invalid” is equal to or less than a predetermined number (threshold value) such as T. If it becomes, it is determined that the free capacity of the cache memory 110 has decreased. Here, the release processing unit 144 selects a cache line to be released based on the access flag Fa of the tag memory 121 and the reserved area information I1 from the reservation processing unit 143. When the release processing unit 144 selects a cache line to be released, the release processing unit 144 provides release information indicating that the data of the selected cache line is written back to the main memory 10 to the cache memory access arbitration unit 145.
  • a predetermined number such as T.
  • the release processing unit 144 refers to the reserved area information I1 from the reservation processing unit 143 when selecting a cache line to be released. For example, the release processing unit 144 monitors the access flag Fa of the cache line in which data is stored by the reservation processing unit 143 based on the reserved area information I1, and the access master 1 is stored in those cache lines one or more times. The data is accessed and whether or not the access flag Fa is valid is recorded in the memory (access history information storage unit) 144a as a reserved area access flag Fra. When the access master 1 has never accessed the data of those cache lines, the release processing unit 144 does not target the cache lines for release. The release processing unit 144 resets the reserved area access flag Fra when the cache line is released. Information exchange between the release processing unit 144 and the cache memory access arbitration unit 145 is performed via a signal S3. In addition, information is exchanged between the release processing unit 144 and the main memory access arbitration unit 146 via a signal S6.
  • the cache memory access arbitration unit 145 transfers the cache memory 110 to the cache memory 110 based on signals S1 to S3 input from the request processing unit 142, the reservation processing unit 143, and the release processing unit 144 based on a predetermined priority order. Arrange the access order. Then, the cache memory access arbitration unit 145 provides the signals S1 to S3 to the cache memory 110 according to the arbitrated order. For example, it is assumed that the priority order is the request processing unit 142, the release processing unit 144, and the reservation processing unit 143 in descending order.
  • the cache memory access arbitration unit 145 is based on the lower priority signal. Access to the cache memory 110 is stopped, and access to the cache memory 110 based on the higher priority signal is performed with the highest priority. The access based on the signal with the lower priority among the simultaneously input signals is started as soon as the access based on the signal with the higher priority is completed.
  • the main memory access arbitration unit 146 is sent to the main memory 10 based on signals S4 to S6 input from the request processing unit 142, the reservation processing unit 143, and the release processing unit 144 based on a predetermined priority order. Arrange the access order. For example, the priority is assumed to be the request processing unit 142, the release processing unit 144, and the reservation processing unit 143 in order from the highest, as in the order of the cache memory access arbitration unit 145.
  • the signal is based on the signal with the lower priority. Access to the main memory 10 is stopped, and access to the main memory 10 based on the higher priority signal is performed with the highest priority. The access based on the signal with the lower priority among the simultaneously input signals is started as soon as the access based on the signal with the higher priority is completed.
  • the main memory access arbitration unit 146 validates only the access request from the request processing unit 142.
  • the main memory access arbitration unit 146 outputs to the reservation processing unit 143 a reservation transfer completion flag Ftf indicating that the transfer of data at that address has been completed.
  • FIG. 2 is a schematic diagram showing a transfer reservation function 160 for operating the cache memory controller 100.
  • the transfer reservation function 160 is a code indicating a transfer reservation command for transferring specific data from the main memory 10 to the cache memory 110.
  • the transfer reservation function 160 refers to the start address MM_ADDR of the continuous area referred to by the access master 1 after execution of this function, the size H * V of this continuous area, and this continuous area.
  • a start address PROC of a function which is an instruction group is defined.
  • the continuous area is a partial area where the addresses of the instruction area or the data area on the main memory 10 are continuous.
  • the start address MM_ADDR, the size H * V, and the start address PROC are transfer reservation information.
  • the access master 1 executes a first program described in a format that can be executed by the access master 1, such as an assembly language.
  • the transfer reservation function 160 shown in FIG. 2 is included in a second program described in a format that cannot be executed by the access master 1 in a high-level language such as C language.
  • the first program is generated by compiling the second program.
  • FIG. 3 is a schematic diagram showing an example in which the transfer reservation function 160 shown in FIG. 2 is applied to the second program.
  • the second program 170 shown in FIG. 3 is arranged in a function 173 constituted by an instruction that the access master 1 refers to data arranged in a continuous area on the main memory 10 and another continuous area.
  • the transfer reservation function 171 and the transfer reservation function 172 are processed before the functions 173 and 174 are executed.
  • the second program is written so that the transfer reservation function 160 is processed before the access master 1 performs processing for referring to the data in the continuous area.
  • a command for transferring from the memory 10 to the cache memory 110 can be inserted into the first program in a format that can be executed by the access master 1.
  • FIG. 4 is a flowchart showing a process for compiling (converting) the second program 170 shown in FIG. 3 into the first program.
  • the flow shown in FIG. 4 is executed when the second program is input to the compiler Cgc, as shown in FIG.
  • the compiler Cgc is a program conversion unit having a function of compiling the transfer reservation function 160 shown in FIG. 2 in accordance with generally used specifications. Further, it is assumed that the second program 170 is stored in a storage unit (not shown).
  • the compiler Cgc determines whether or not the source code to be compiled in the second program is the transfer reservation function 160 shown in FIG. 2 (step S10). If the source code is the transfer reservation function 160 (S10: Yes), the process proceeds to step S11. If the source code is not the transfer reservation function 160 (S10: No), the process proceeds to step S12. move on.
  • step S11 the compiler Cgc compiles the source code into a command corresponding to the first program.
  • step S12 the compiler Cgc compiles the source code according to generally used specifications.
  • the compiler Cgc determines whether the source code to be compiled is the end of the second program (S13). If the source code is not the end (S13: No), the compiler Cgc updates the compile target to the next source code, and proceeds to step S10. If the source code is at the end (S13: Yes), the compiler Cgc ends the flow.
  • FIG. 6 is a schematic diagram showing an example of a first program obtained by compiling the second program 170 shown in FIG. 3 by the compiler Cgc.
  • addresses are shown in the left column, and instruction words are written in hexadecimal numbers in the right column. Since the instruction format depends on the compiler Cgc, description on the instruction word format is omitted here, and the operation indicated by each instruction will be described.
  • the instructions 181a to 181c shown in FIG. 6 are transfer reservation instructions generated based on the transfer reservation function 171 shown in FIG.
  • the command 181a is a command for notifying the process switching unit 141 of the start address MM_ADDR1 of the continuous area described in the transfer reservation function 171 shown in FIG.
  • the command 181b is a command for notifying the process switching unit 141 of the size H1 * V1 of the continuous area described in the transfer reservation function 171 shown in FIG.
  • the command 181c is a command for notifying the process switching unit 141 of the head address PROC1 described in the transfer reservation function 171 shown in FIG.
  • Instructions 182a to 182c are transfer reservation instructions generated based on the transfer reservation function 172 in FIG.
  • the command 182a is a command for notifying the process switching unit 141 of the start address MM_ADDR2 of the continuous area described in the transfer reservation function 172 shown in FIG.
  • the command 182b is a command for notifying the process switching unit 141 of the size H2 * V2 of the continuous area described in the transfer reservation function 172 shown in FIG.
  • the command 182c is a command for notifying the process switching unit 141 of the head address PROC2 described in the transfer reservation function 172 shown in FIG.
  • the transfer reservation instructions 181a to 181c and 182a to 182c execute a group of instructions 1831 for executing processes P1 and P2 performed using data in the main memory 10.
  • 1832, 1833,..., 1841, 1842, 1843,... So that the access master 1 has transfer reservation instructions 181a to 181c, 182a to 182c are executed. Therefore, the access master 1 can send an instruction command C1 indicating transfer reservation information to the process switching unit 141 in accordance with the transfer reservation instructions 181a to 181c and 182a to 182c before executing these instruction groups. Thereby, before the access master 1 executes these instruction groups, data used in these instruction groups is transferred from the main memory 10 to the cache memory 110.
  • FIG. 7 is a schematic diagram showing an example of arrangement of the first program 180 shown in FIG. 6 in the main memory 10.
  • the first program 180 shown in FIG. 6 is stored in the instruction area 190 on the main memory 10.
  • instructions 181a to 181c compiled from the transfer reservation function 171 shown in FIG. 3 are arranged in the area 191p, and instructions 182a to 182c compiled from the transfer reservation function 172 shown in FIG. Placed in.
  • the access master 1 executes the instruction 181a (see FIG. 6) arranged in the area 191p, the start address of the continuous area 197d referred to by the function 173 shown in FIG. 3 is notified to the reservation processing unit 143. Is done. Subsequently, the access master 1 executes the instruction 181b (see FIG. 6) arranged in the area 191p, thereby notifying the reservation processing unit 143 of the size of the continuous area 197d. Furthermore, when the access master 1 executes the instruction 181c (see FIG. 6) arranged in the area 191p, the start address of the area 193p storing the command corresponding to the function 173 shown in FIG. 3 is reserved. To the unit 143.
  • the access master 1 executes the instructions 182a to 182c (see FIG. 6) arranged in the area 192p, the start address and size of the continuous area 198d referred to in the function 174 shown in FIG. And the reservation processing unit 143 is notified of the start address of the area 194p in which the command corresponding to the function 174 shown in FIG.
  • FIG. 8 is a flowchart showing processing performed by the processing switching unit 141 of the data processing unit 140.
  • the process switching unit 141 starts the process.
  • the process switching unit 141 determines whether or not the input instruction address A1 is an address included in the instruction area 190 shown in FIG. 7 (S20). If the instruction address A1 is the address of the instruction area 190 (S20: Yes), the process proceeds to step S21. If the instruction address A1 is not the address of the instruction area 190 (S20: No), the process is step. Proceed to S22.
  • step S21 the process switching unit 141 stores the input instruction address A1 as the progress address A3 in the memory 141a. If the progress address A3 is already stored, the process switching unit 141 updates the value. On the other hand, when the instruction address A1 is not the address of the instruction area 190, the progress address A3 is not updated.
  • step S22 the process switching unit 141 gives the reservation processing unit 143 the progress address A3 stored in the memory 141a.
  • the process switching unit 141 determines whether or not the command command C1 input from the access master 1 is either read or write (S23). If the command command C1 is either read or write (S23: Yes), the process proceeds to step S24. If the command command C1 is neither read nor write (S23: No), the process is performed. Proceed to step S25.
  • step S24 the process switching unit 141 gives the input command command C1 and command address A1 to the request processing unit 142 as the request command C2 and the request address A2, respectively.
  • step S25 the process switching unit 141 gives the instruction command C1 to the reservation processing unit 143 as the transfer reservation command C3.
  • the transfer reservation command C3 is, for example, the instructions 181a to 181c and the instructions 182a to 182c shown in FIG.
  • the process switching unit 141 determines whether the data processing unit 140 has an instruction command C1 from the access master 1 (whether there is an unprocessed instruction command C1) (S26). If there is an unprocessed instruction command C1 (S26: Yes), the process proceeds to step S20. If there is no unprocessed instruction command C1 (S26: No), the process switching unit 141 ends the flow. To do.
  • FIG. 9 is a schematic diagram illustrating an example of a timing chart of processing in the processing switching unit 141.
  • FIG. 9 shows the timing at which the command command C1 is input from the access master 1 to the process switching unit 141, the timing at which data is output to the request processing unit 142, and the timing at which data is output to the reservation processing unit 143. Yes.
  • the process switching unit 141 receives the request command C2 and the request address A2 at time t11, respectively. To the request processing unit 142. Further, the process switching unit 141 updates the value of the progress address A3 to a value indicating the instruction address A2, and gives it to the reservation processing unit 143.
  • the process switching unit 141 transmits the request command C2 and the instruction command C2 respectively at time t13.
  • the request address A2 is given to the request processing unit 142.
  • the process switching unit 141 does not update the value of the progress address A3, but gives the progress address A3 recorded in the memory 141a to the reservation processing unit 143.
  • the request command unit 142 sets the request command C2 and the request address A2 as the request command C2 and the request address A2, respectively. give. Further, the process switching unit 141 updates the value of the progress address A3 to the value indicated by the instruction address A1, and gives it to the reservation processing unit 143.
  • the process switching unit 141 switches the output destination to the request processing unit 142 or the reservation processing unit 143 according to the instruction command C1 and the instruction address A1 input from the access master 1.
  • FIG. 10 is a flowchart showing processing performed by the request processing unit 142 of the data processing unit 140.
  • the request processing unit 142 starts processing.
  • the request processing unit 142 determines whether the data requested by the request command C2 exists in the cache memory 110 based on the hit detection result R1 from the hit detection unit 130 (S30). If the data requested by the request command C2 does not exist in the cache memory 110 (S30: No), in other words, if the hit result R1 indicates a cache miss, the process proceeds to step S31. On the other hand, if the data requested by the request command C2 exists in the cache memory 110 (S30: Yes), in other words, if the hit result R1 indicates a cache hit, the process proceeds to step S32.
  • the request processing unit 142 gives an instruction to transfer data to the main memory access arbitration unit 146 in order to transfer data from the main memory 10 to the cache memory 110.
  • This instruction includes the request address A2.
  • the main memory access arbitration unit 146 performs a process of transferring data stored at the address indicated by the request address A2 from the main memory 10 to the cache memory 110.
  • the main memory access arbitration unit 146 reads data stored in the address indicated by the request address A2 from the main memory 10 and supplies the data to the request processing unit 142.
  • the request processing unit 142 gives the given data to the cache memory access arbitration unit 145 and causes the cache memory 110 to write the data.
  • the memory management unit 120 stores the address of the data written in the tag memory 121 as the address information Ta, and the corresponding status flag Fs has data. Update to show that.
  • step S32 the request processing unit 142 accesses the cache memory 110.
  • the request processing unit 142 gives the request command C2 and the request address A2 to the cache memory access arbitration unit 145 in order to write the data indicated by the request command C2 to the cache line.
  • the request processing unit 142 gives the request address A2 to be read to the cache memory access arbitration unit 145 in order to read the data indicated by the request command C2 from the cache line.
  • the data acquired in this way is given to the access master 1 as read data D1.
  • the memory management unit 120 updates the access flag Fa stored in the tag memory 121 to indicate that it has been accessed.
  • the request processing unit 142 reads the data read from the main memory 10 via the main memory access arbitration unit 146. May be transferred to the cache memory 110 via the cache memory access arbitration unit 145 and output to the access master 1 as read data. In this case, the process of step S32 in FIG. 10 is not performed. However, the memory management unit 120 updates the access flag Fa stored in the tag memory 121 to indicate that it has been accessed.
  • FIG. 11 is a flowchart showing processing performed by the reservation processing unit 143 of the data processing unit 140.
  • the reservation processing unit 143 receives, from the process switching unit 141, the progress address A3, the start address MM_ADDR of the continuous area in which the data to be transferred is stored, the size H * V of the continuous area in which the data to be transferred is stored, and the transfer
  • a head address PROC of an instruction group that refers to a continuous area in which data to be stored and a hit detection result R2 indicating a cache hit or a cache miss are input from the hit detection unit 130, processing is started.
  • the reservation processing unit 143 calculates an interval for accessing the main memory 10 (hereinafter referred to as an access interval Da) (S40).
  • the calculation of the access interval Da uses the number of instruction steps Ds from the progress address A3 to the head address PROC of the instruction group that refers to the continuous area in which the data to be transferred is stored.
  • the instruction step number Ds refers to a continuous area in which data to be transferred is stored from an advance address A3 that is an instruction address at the time when reservation processing is started. It can be calculated by the difference up to the head address PROC of the instruction group.
  • Ds (start address PROC of instruction group) ⁇ (progress address A3) (1)
  • the reservation processing unit 143 performs transfer among the size H * V of the continuous area in which the data to be transferred input from the process switching unit 141 is stored.
  • the number of instruction steps Dspu required for transfer per unit size can be calculated.
  • the reservation processing unit 143 uses the instruction step number Dspu required for transfer per unit size as the access interval Da.
  • Dspu (number of instruction steps Ds) / (size Rs of remaining continuous area) (2)
  • the reservation processing unit 143 determines whether the data to be transferred next exists in the cache memory 110 among the continuous area data to be transferred (S41).
  • the data to be transferred next is data of the transfer unit length to be transferred next in the continuous area data to be transferred. If the data to be transferred next does not exist in the cache memory 110 (S41: No), in other words, if the hit detection result R2 of the data to be transferred next indicates a cache miss, Since it is necessary to transfer the data from the main memory 10 to the cache memory 110, the reservation processing unit 143 advances the processing to step S42.
  • step S42 the reservation processing unit 143 provides the main memory access arbitration unit 146 with an instruction to transfer data from the main memory 10 to the cache memory 110 at the access interval Da calculated in step S40.
  • the reservation processing unit 143 gives a transfer instruction to the main memory access arbitration unit 146 at any one of the eight steps, for example, at the first step among the eight steps.
  • the main memory access arbitration unit 146 reads data to be transferred from the main memory 10 and provides the data to the reservation processing unit 143.
  • the reservation processing unit 143 gives the given data to the cache memory access arbitration unit 145 and causes the cache memory 110 to write the data.
  • the memory management unit 120 stores the address of the data written in the tag memory 121 as the address information Ta, and the corresponding status flag Fs has data. Update to show that.
  • the reservation processing unit 143 updates the transfer completion size indicating the total size of the already transferred data (S43).
  • the reservation processing unit 143 determines whether or not the transfer completion size is equal to or larger than the size H * V of the continuous area in which the data to be transferred input from the process switching unit 141 is stored (S44). If the transfer completion size is less than the size H * V of the continuous area in which the data to be transferred is stored (S44: No), the process proceeds to step S45, and the size of the continuous area in which the data to be transferred is stored If it is equal to or higher than H * V (S44: Yes), the flow ends.
  • step S45 the reservation processing unit 143 determines whether or not the updated progress address A3 is acquired from the process switching unit 141. If the progress address A3 is acquired (S45: Yes), the process proceeds to step S40. If the progress address A3 is not acquired (S45: No), the process proceeds to step S41.
  • the reservation processing unit 143 transfers the necessary data to the cache memory 110 based on the transfer reservation command C3, so that even in the area on the main memory 10 that has not been accessed by the access master 1, The hit rate can be improved reliably.
  • FIG. 12 (a) to 12 (c) are schematic diagrams showing transition of data transfer by the reservation processing unit 143.
  • FIG. 12 (a) shows the transition of the progress address A3
  • FIG. 12 (b) shows the transition of the remaining size of the continuous area in which the data to be transferred is stored, and
  • FIG. 12 (c) is accessed.
  • the transition of the interval Da is shown.
  • the access interval Da0 at time t0 is calculated when the transfer reservation command C3 is input to the reservation processing unit 143.
  • the reservation processing unit 143 calculates the access interval Da1 again. (Refer to FIG. 12C), the interval for accessing the main memory 10 is adjusted.
  • the reservation processing unit 143 calculates the access interval Da again, and transfers the continuous area at the access interval Da.
  • the remaining size of the continuous area in which the data to be transferred is stored is “0” by the time tn when the progress address A3 becomes the start address PROC of the instruction group that refers to the continuous area, that is, the transfer is completed.
  • the transfer process is performed as follows. At time tn, since the progress address A3 is the start address PROC of the instruction group that refers to the continuous area, the access interval Dan is “0”.
  • FIG. 13 is a schematic diagram illustrating an example of a timing chart of processing performed by the reservation processing unit 143.
  • FIG. 13 illustrates the timing at which the progress address A3 and the size H * V of the continuous area in which the data to be transferred are stored are input from the process switching unit 141 and the remaining continuous areas in the continuous area in which the data to be transferred are stored.
  • the timing at which the area size is switched, the timing for calculating the access interval Da, and the timing for accessing the main memory 10 are shown.
  • the reservation processing unit 143 calculates the access interval Da0.
  • the reservation processing unit 143 accesses the main memory 10 at the calculated access interval Da0 until time t1 when the progress address A3 from the processing switching unit 141 is updated.
  • the reservation processing unit 143 calculates the access interval Da1, and the calculated access interval until time t2 when the progress address A3 is updated.
  • the main memory 10 is accessed with Da1.
  • the reservation processing unit 143 calculates the access interval Da2, and the calculated access until the progress address A3 is updated.
  • the main memory 10 is accessed at the interval Da2.
  • the reservation processing unit 143 accesses the main memory 10 at the access interval Da calculated every time the progress address A3 input from the process switching unit 141 is updated, and the progress address A3 is notified by the transfer reservation command C3. The transfer is completed until the head address PROC of the instruction group that refers to the continuous area.
  • the cache memory 110 is efficiently accessed by adjusting the interval for accessing the main memory 10 with reference to the progress address A3 and completing the transfer before the instruction group referring to the continuous area is executed. Can be used.
  • FIG. 14 is a flowchart showing processing performed by the release processing unit 144 of the data processing unit 140.
  • the release processing unit 144 constantly monitors whether the status flag Fs indicating invalidity (no data is stored) in the tag memory 121 of the memory management unit 120 is a predetermined number, for example, T or less.
  • the release processing unit 144 determines whether the status flag Fs is T or less (S50). If there are more than T status flags Fs (S50: No), the release processing unit 144 stands by and continues monitoring the status flag Fs of the memory management unit 120. On the other hand, if the number of status flags Fs is T or less (S50: Yes), the process proceeds to step S51.
  • step S51 the release processing unit 144 selects a cache line that is a candidate for release from among the cache lines on the cache memory 110.
  • a method for selecting a cache line to be a release candidate for example, an LRU method for selecting a cache line that has not been referenced for the longest time is applied.
  • the release processing unit 144 determines whether or not the cache line selected in Step S51 is a target to be released (S52). Of each cache line of the cache memory 110, a cache line that stores data transferred by the transfer reservation command C3 and has not been accessed once by the access master 1 is not subject to release.
  • the release target is the reserved area in the cache line selected as the release candidate, the cache line transferred to the cache memory 110 by the request command C2, and the cache line selected as the release candidate.
  • the cache line indicated that the access flag Fa has become valid by the access flag Fra.
  • the release processing unit 144 monitors the access flag Fa of the cache line in which the reservation processing unit 143 stores data based on the reservation area information I1 from the reservation processing unit 143, and the access flag Fa becomes valid one or more times. Is recorded in the memory 144a as a reserved area access flag Fra.
  • step S51 If the cache line selected in step S51 is not a release target (S52: No), the process proceeds to step S51, and the release processing unit 144 again selects a cache line as a release candidate by the LRU method. select. On the other hand, when the cache line selected in step S51 is a target to be released (S52: Yes), the process proceeds to step S53.
  • step S53 the release processing unit 144 gives an instruction to the cache memory access arbitration unit 145 to rewrite the data stored in the cache line targeted for release to the main memory 10 (S53).
  • the cache memory access arbitration unit 145 reads the data stored in the cache line targeted for release, and provides this data to the release processing unit 144.
  • the release processing unit 144 gives the data to the main memory access arbitration unit 146 and causes the main memory 10 to write the data.
  • step S50 the release processing unit 144 continues to monitor the status flag Fs of the tag memory 121.
  • the data transferred by the transfer reservation command C3 is stored, and the cache line that has not been accessed by the access master 1 is not subject to release, so that the data referred to by the access master is reliably cached. Stored in the memory 110.
  • the transfer reservation functions 171 and 172 are described in the second program 170 as shown in FIG. 3, and these are generated by the compiler Cgc compiling them.
  • the transfer reservation command only needs to be described in the first program. Accordingly, a compiler that generates the first program 180 having the transfer reservation commands 181a to 181c and 182a to 182c shown in FIG. 6 from the second program 270 as shown in FIG. 15 may be used.
  • the compiler may generate a transfer reservation instruction by analyzing a code indicating an instruction that uses data stored in the data area of the main memory 10 included in the second program.
  • the transfer reservation instruction may not be included in the first program executed by the access master 1.
  • the reservation processing unit 143 analyzes the first program stored in the predetermined program area on the main memory 10 stored in the cache memory 110, and refers to it in a process executed later. Transfer reservation information for transferring the data to be transferred from the main memory 10 to the cache memory 110 may be generated.
  • the first program is generated from the second program using a general-purpose compiler, and the data referred to by the access master 1 can be reliably stored in the cache memory 110.
  • FIG. 2 Embodiment 2.
  • FIG. 16 to 30 Embodiment 2.
  • FIG. 16 is a block diagram schematically showing the configuration of the cache memory controller 200 according to the second embodiment.
  • the cache memory controller 200 includes a cache memory 110, a memory management unit 120, a hit detection unit 130, and a data processing unit 240.
  • FIG. 16 simply shows the connection relationship between the access master 1, the cache memory controller 200, and the main memory 10.
  • the main memory 10 is collectively managed by a certain capacity called a bank.
  • the bank is divided into an instruction area and a data area.
  • a specific continuous area can be accessed by specifying a row address and a column address for the main memory 10.
  • the data processing unit 240 transfers the data stored in the main memory 10 to the cache memory 110.
  • the data processing unit 240 stores the received transfer reservation information every time it receives transfer reservation information including an address where data used in a specific command is stored in the main memory 10. Then, when a plurality of transfer reservation information is stored, the data processing unit 240 arbitrates these.
  • the data processing unit 240 is used in the specific instruction before the access master 1 executes the specific instruction included in the first program according to the transfer reservation information determined to have a high priority by arbitration. Data to be transferred from the main memory 10 to the cache memory 110. Further, the data processing unit 240 writes data into the cache memory 110 or the main memory 10 in response to a request from the access master 1.
  • the data processing unit 240 includes a processing switching unit 141, a request processing unit 142, a reservation processing unit 243, a release processing unit 144, a cache memory access arbitration unit 145, a main memory access arbitration unit 146, and a priority determination unit. 247 and an access management unit 248.
  • processing switching unit 141 The functions of the processing switching unit 141, the request processing unit 142, the release processing unit 144, the cache memory access arbitration unit 145, and the main memory access arbitration unit 146 are the same as those in the first embodiment and have already been described. Description of is omitted.
  • the priority determination unit 247 receives the progress address A3 and the transfer reservation command C3 from the process switching unit 141. Then, the priority determination unit 247 stores the transfer reservation information represented by the received transfer reservation command C3 in the memory 247a (transfer reservation storage unit). The priority determination unit 247 calculates an access interval Da for each stored transfer reservation information. The method for calculating the access interval Da is the same as in the first embodiment. Based on the calculated access interval Da and the access elapsed time R5 obtained from the access management unit 248, the priority determination unit 247 determines transfer reservation information that causes the reservation processing unit 243 to perform processing with the highest priority.
  • the priority determination unit 247 gives the access management unit 248 the start address Am of the continuous area in which the data to be transferred, which is indicated by the transfer reservation information, is stored as the address A5, and, as a response, the access elapsed time R5, Received from the access management unit 248. Further, the priority determination unit 247 determines the access interval Da to the continuous area on the main memory 10 of the determined transfer reservation information with the highest priority and the start address Am of the continuous area in which data to be transferred is stored. This is given to the reservation processing unit 243.
  • the priority The determination unit 247 erases the transfer reservation information from the memory 247a.
  • FIG. 17 is a schematic diagram showing the transfer reservation management information 201 stored in the memory 247 a of the priority determination unit 247.
  • the transfer reservation management information 201 includes an arrival order column 201a, a reference instruction group start address column 201b, a continuous area start address column 201c, a transfer remaining size column 201d, and a transfer status column 201e.
  • the arrival order column 201a stores information indicating the arrival order of the transfer reservation information.
  • the reference instruction group head address column 201b stores a head address PROC of a function that is an instruction group included in the transfer reservation command C3 and refers to a continuous area in which data to be transferred is stored.
  • the continuous area head address column 201c stores the head address of the continuous area in which the data to be transferred is stored in the main memory 10 in accordance with the transfer reservation command C3.
  • the initial value of the continuous area head address column 201c is the head address MM_ADDR of the continuous area that is included in the transfer reservation command C3 and referred to by the access master 1.
  • the remaining transfer size column 201d stores the remaining size of data to be transferred according to the transfer reservation command C3.
  • the initial value of the remaining transfer size column 201d is the size H * V of the continuous area that is included in the transfer reservation command C3 and stores the data to be transferred.
  • the transfer status column 201e includes transfer status information indicating whether data is being transferred based on transfer reservation information corresponding to information stored in the reference instruction group start address column 201b and the continuous area start address column 201c. Store. For example, in this embodiment, if this field is “1”, it indicates that transfer is in progress, and if “0”, it indicates that transfer is waiting.
  • the priority determination unit 247 in the order in which the transfer reservation command C3 is received, indicates the continuous area start address MM_ADDR indicated by the transfer reservation command C3 and the data to be transferred. And the head address PROC of a function that is a command group that refers to a continuous area in which data to be transferred is stored are stored in the transfer reservation management information 201 as transfer reservation information.
  • the priority determination unit 247 receives the reservation transfer status signal V1 from the reservation processing unit 243, the content stored in the memory 247a is updated.
  • the access management unit 248 monitors the request address A2 from the process switching unit 141, measures the time elapsed since the previous access as the access elapsed time Td with a timer (not shown), and is measured.
  • the access elapsed time Td is stored in the memory 248a (access elapsed time storage unit).
  • the access management unit 248 sets the request address A2 from the process switching unit 141 to the request processing unit with a continuous area composed of a plurality of addresses divided by row addresses and column addresses belonging to each bank on the main memory 10 as one unit. Each time it is sent to 142, the continuous area to which the request address A2 belongs is specified, and the access elapsed time Td of the specified continuous area is reset.
  • the access management unit 248 identifies the continuous area to which the address A5 belongs, and the access elapsed time Td of the identified continuous area is set as the response R5 to the memory 248a. And give this to the priority determination unit 247.
  • FIG. 18 is a schematic diagram showing the access management information 202 stored in the memory 248 a of the access management unit 248.
  • the access management information 202 includes a bank number column 202a, a row address column 202b, a column address column 202c, and an access elapsed time column 202d.
  • the bank number column 202a stores a bank number for identifying the bank of the main memory 10.
  • the row address column 202b stores the row address range of the continuous area formed in the bank of the main memory 10.
  • the column address column 202 c stores the column address range of the continuous area formed in the bank of the main memory 10.
  • the access elapsed time column 202d displays an access elapsed time Td indicating the elapsed time since the last access to the continuous area specified by the row address column 202b and the column address column 202c of the bank specified by the bank No column 202a.
  • Td the access elapsed time since the cache memory controller 200 was activated.
  • the reservation processing unit 243 receives the hit detection result R2 given from the hit detection unit 130, the start address Am and the main memory of the continuous area given from the priority determination unit 247 in which the data to be transferred is stored.
  • the main memory 10 is accessed according to the access interval Da to 10 and data for one line, which is a preset transfer unit, is transferred to the cache memory 110.
  • the reservation processing unit 243 updates the reservation transfer status signal V1 to a value indicating that the transfer is completed, thereby transferring the data for one line.
  • the priority determination unit 247 is notified of the completion.
  • the reservation processing unit 243 provides the hit detection unit 130 with the head address Am of the continuous area received from the priority determination unit 247 and storing the data to be transferred as the address A4. And the reservation process part 243 acquires the hit detection result R2 of the address A4 from the hit detection part 130 as the response.
  • the hit detection result R2 is a cache miss
  • the reservation processing unit 243 transfers the data at that address from the main memory 10 to the cache memory 110.
  • the reservation processing unit 243 starts transferring the start address Am of the continuous area in which the data to be transferred is stored, the reservation processing unit 243 provides the release processing unit 144 with reserved area information I1 indicating the storage destination cache line.
  • the reservation processing unit 243 sends a reservation transfer status signal V1 to indicate that the transfer is complete. Update and notify the priority determination unit 247.
  • the reserved transfer status signal V1 is, for example, a 1-bit signal.
  • FIG. 19 is a flowchart showing processing when the priority determination unit 247 mediates a plurality of transfer reservation information.
  • the priority determination unit 247 receives, from the process switching unit 141, the progress address A3, the start address MM_ADDR of the continuous area in which the data to be transferred is stored, the size H * V of the continuous area in which the data to be transferred is stored, and When the transfer reservation command C3 including the start address PROC of the instruction group referring to the continuous area in which the data to be transferred is stored is received, the processing is started.
  • step S61 the priority determination unit 247 determines whether there is transfer reservation information indicating that the transfer status column 201e of the transfer reservation management information 201 stored in the memory 247a indicates that transfer is in progress. In any one of the stored transfer reservation information, when “1” indicating that transfer is in progress is stored in the transfer status column 201e of the transfer reservation management information 201 (S61: Yes), priority is given. The degree determining unit 247 advances the processing to step S62. On the other hand, when “0” representing transfer waiting is stored in the transfer status column 201e of all stored transfer reservation information (S61: No), the priority determination unit 247 performs the process in step S63. Proceed to
  • step S62 the priority determination unit 247 updates a record in which “1” indicating that transfer is in progress is stored in the transfer status column 201e of the transfer reservation management information 201. Specifically, the priority determination unit 247 determines the size of one line of the cache memory 10 (in this case, for example, from the value of the transfer remaining size column 201d of the corresponding record of the transfer reservation management information 201). , “1”) is subtracted and updated. The priority determination unit 247 deletes the transfer reservation information (record) when the value of the remaining transfer size column 201d becomes “0”.
  • the priority determination unit 247 sets the continuous area top address column 201c to One line is added to the head address of the stored continuous area. In other words, the priority determination unit 247 updates the start address of the continuous area to the address after one line. Furthermore, the priority determination unit 247 updates the transfer status column 201e of the corresponding record to “0” indicating standby, and advances the process to step S63.
  • step S63 the priority determination unit 247 determines the number of transfer reservation information waiting for transfer stored in the memory 247a. When the number of transfer reservation information is “0”, the priority determination unit 247 ends the flow. If the number of pieces of transfer reservation information is “1”, the priority determination unit 247 advances the process to step S64. If the number of pieces of transfer reservation information is “2” or more, the priority determination unit 247 advances the process to step S65.
  • step S64 the priority determination unit 247 determines the single transfer reservation information received from the process switching unit 141, in other words, the only transfer reservation information stored in the memory 247a as the highest priority transfer reservation information. Then, the process proceeds to step S69.
  • step S65 the priority determination unit 247 calculates the access interval Da of each transfer reservation information stored in the memory 247a. Then, the process proceeds to step S66.
  • the access interval Da is calculated by the equation (2) in the first embodiment.
  • step S66 the priority determination unit 247 determines whether the access intervals Da of the transfer reservation information calculated in step S65 are similar. At this time, when the access interval Da of each transfer reservation information is within the preset allowable error range, the priority determination unit 247 determines that the access interval Da is approximately the same (S66: Yes), and advances the processing to step S67. When it is not the same degree (S66: No), the priority determination part 247 advances a process to step S68.
  • the allowable error of the access interval Da is a predetermined value, for example, “ ⁇ 10”.
  • step S67 the priority determination unit 247 determines the highest priority transfer reservation information based on the access elapsed time R5 for each transfer reservation information from the access management unit 248. For example, the priority determination unit 247 gives the address A5 stored in the continuous area head address 201c column of the transfer reservation management information 201 stored in the memory 247a to the access management unit 248, and, as a response, the access elapsed time Get R5. Then, the priority determination unit 247 determines the transfer reservation information having the longest access elapsed time R5 as the highest priority transfer reservation information. Then, the process proceeds to step S69.
  • step S68 the priority determination unit 247 determines the transfer reservation information having the smallest access interval Da among the access intervals Da of all transfer reservation information calculated in step S65 as the highest priority transfer reservation information. Then, the process proceeds to step S69.
  • step S69 the priority determination unit 247 addresses based on the highest priority transfer reservation information determined in step S64, S67, or S68 and stored in the corresponding continuous area head address column 201c of the transfer reservation management information 201. Is the start address Am of the continuous area in which the data to be transferred is stored. Then, the priority determination unit 247 gives the reservation processing unit 243 the head address Am of the continuous area where the data to be transferred is stored and the access interval Da. Then, the process proceeds to step S70.
  • step S70 the transfer status of the transfer reservation information given to the reservation processing unit 243 in step S69 out of the transfer reservation management information 201 stored in the memory 247a is changed from "0 (waiting for transfer)" to "1 (during transfer). ) ”. Then, the process proceeds to step S60.
  • the priority determination unit 247 determines the highest priority transfer reservation information from all the transfer reservation information stored in the memory 247a on the basis of the access interval Da calculated from the progress address A3, thereby making it more tight. Even for the transfer reservation information, the necessary data transfer can be completed before the access master 1 executes the instruction group indicated by the head address PROC, and the waste of the cache memory 110 can be prevented.
  • the priority determination unit 247 determines the highest priority transfer reservation information from all transfer reservation information stored in the memory 247a based on the access interval Da calculated from the progress address A3 and the access elapsed time R5 from the access management unit 248.
  • the cache hit rate can be improved even for a continuous area on the main memory 10 that is likely to be released from the cache memory 110.
  • FIGS. 20 to 24 show the sizes of the continuous areas in which the data to be transferred of the two transfer reservation information received by the priority determination unit 247 from the process switching unit 141 and the continuous data in which the data to be transferred are stored. It is the schematic which shows the relationship with the head address of the instruction group which refers to an area
  • the priority determination unit 247 starts the process of determining the priority of the transfer reservation information # 1 and the transfer reservation information # 2 received from the process switching unit 141 at time “0”.
  • T # 1 and t # 2 indicated on the horizontal axis are continuous areas storing transfer data indicated by transfer reservation information # 1 and transfer reservation information # 2 received from the process switching unit 141, respectively.
  • H1 * V1 and H2 * V2 indicate the size of the continuous area storing the data to be transferred, indicated by transfer reservation information # 1 and transfer reservation information # 2 received from the process switching unit 141, respectively.
  • 20 and 21 are examples in which it is determined in step S66 of FIG. 19 that the access interval Da of all transfer reservation information is not the same level.
  • FIG. 20 shows an instruction for referring to a continuous area in which transfer data is stored in transfer reservation information # 1 in comparison with transfer reservation information # 2 in which the size of the continuous area is large.
  • This is an example indicating that the number of instruction steps to the head address of the group is small, in other words, the time until the execution of the instruction group that refers to the continuous area in which the data to be transferred is stored is short.
  • the access interval Da calculated in step S65 in FIG. 19 is smaller than the value of the transfer reservation information # 2 and the value of the transfer reservation information # 1 exceeds the allowable error. Accordingly, in step S66 of FIG. 19, it is determined that the access interval Da of the transfer reservation information is not the same (S66: No), and transfer reservation information # 1 having a small access interval Da is determined as the highest priority transfer reservation information. .
  • FIG. 21 is an example in which the transfer reservation information # 2 is determined as the highest priority transfer reservation information by the priority determination unit 247, contrary to FIG.
  • the size of the continuous area in which the data to be transferred is stored is large, and the instruction refers to the continuous area in which the data to be transferred is stored.
  • the number of instruction steps up to the head address of the group is also large. In other words, it takes a long time to start executing an instruction group that refers to a continuous area in which data to be transferred is stored.
  • step S65 of FIG. 19 the access interval Da calculated in step S65 of FIG. 19 is smaller than the value of the transfer reservation information # 1 and the value of the transfer reservation information # 2 exceeds the allowable error. Therefore, in step S66 of FIG. 19, it is determined that the access interval Da of the transfer reservation information is not the same (S66: No), and transfer reservation information # 2 having a small access interval Da is determined as the highest priority transfer reservation information.
  • the priority determination unit 247 determines the transfer reservation information having the smallest access interval Da as the highest priority transfer reservation information, and transfers the calculated access interval Da and the highest priority transfer reservation information.
  • the reservation processing unit 243 is given the start address Am of the continuous area in which data is stored. As a result, it is not necessary for the reservation processing unit 243 to calculate the access interval Da, and the start of the reservation process is accelerated, so that the data transfer efficiency from the main memory 10 to the cache memory 110 can be improved.
  • step S66 of FIG. 19 it is determined in step S66 of FIG. 19 that the access interval Da of all transfer reservation information is approximately the same.
  • step S67 of FIG. Information # 1 is determined as the highest priority transfer reservation information.
  • the transfer reservation information # 2 with the longer access elapsed time R5 is the highest priority transfer reservation information in step S67 of FIG. As determined.
  • a group of instructions that refer to a continuous area in which the calculated access interval Da is small and is included in transfer reservation information # 1 and transfer reservation information # 2 and in which data to be transferred is stored.
  • the priority determination unit 247 has determined the transfer reservation information with the largest access elapsed time R5 as the highest priority transfer reservation information, but is not limited thereto. It is not a thing.
  • the access interval Da is equal to or less than a preset first threshold, and the difference between the start addresses PROC1 and PROC2 of the instruction group that refers to the continuous area in which the data to be transferred is stored is set in advance.
  • the priority determination unit 247 determines the transfer reservation information with the smallest start address of the instruction group referring to the continuous area in which the data to be transferred is stored as the highest priority transfer reservation information. May be. Thereby, the cache memory 110 does not store data unnecessarily, and waste of the cache memory 110 can be prevented.
  • the priority determination unit 247 determines whether the access interval Da is equal to or less than the first threshold or the next transfer reservation information is You may wait until it is entered.
  • the priority determination unit 247 can preferentially process transfer reservation information having a smaller access interval Da.
  • the cache memory 110 can be used efficiently.
  • the present invention is not limited to this. Even when three or more pieces of transfer reservation information are stored in the memory 247a, the cache memory 110 is wasted by determining the highest priority transfer reservation information from the access interval Da and the access elapsed time in the same manner as described above. Can be prevented.
  • FIG. 25 is a schematic diagram illustrating an example of a timing chart of processing performed by the priority determination unit 247.
  • FIG. 25 shows the timing at which the progress address A3 and the command command C3 are input from the process switching unit 141, the timing at which the highest priority transfer reservation information is determined, and the plurality of times received by the priority determination unit 247 from the process switching unit 141. Based on the transfer reservation information, the timing at which the size of the remaining data among the data to be transferred is switched is shown.
  • the priority determination unit 247 determines the transfer reservation information ( TR # 1) is stored in the memory 247a. Then, the priority determination unit 247 determines the highest priority transfer reservation information. At the stage of time t20, since the transfer reservation information received by the priority determination unit 247 is only TR # 1, the priority determination unit 247 determines TR # 1 as the highest priority transfer reservation information. Then, the priority determination unit 247 outputs the start address Am and the access interval Da of the continuous area to the reservation processing unit 243, and the reservation processing is started.
  • the priority determination unit 247 starts the determination process of the highest priority transfer reservation information. .
  • the priority determination unit 247 determines that the highest priority transfer reservation information is TR # 3, outputs the start address Am of the continuous area and the access interval Da to the reservation processing unit 243, and the reservation processing is started. .
  • the priority determination unit 247 determines from the total transfer reservation information stored in the memory 247a. Data transfer efficiency to the access master 1 can be improved by determining the priority transfer reservation information and completing the transfer before the instruction group referring to each continuous area is executed.
  • FIG. 26 is a flowchart showing processing when the reservation processing unit 243 transfers data based on the transfer reservation command C3.
  • the reservation processing unit 243 accesses the hit detection result R2 indicating a cache hit or a cache miss from the hit detection unit 130, the start address Am of the continuous area in which the data to be transferred from the priority determination unit 247 is stored, and access to the main memory.
  • the processing is started.
  • the reservation processing unit 243 determines whether data corresponding to the head address Am exists in the cache memory 110 (S80).
  • the data corresponding to the head address Am is data of the transfer unit length stored from the head address Am.
  • the reservation processing unit 243 makes this determination based on the hit detection result R2 from the hit detection unit 130. If the data corresponding to the head address Am does not exist in the cache memory 110 (S80: No), it is necessary to transfer the data from the main memory 10 to the cache memory, so that the reservation processing unit 243 performs step S81. Proceed with the process. On the other hand, if the data corresponding to the head address Am exists in the cache memory 110 (S80: Yes), the reservation processing unit 243 does not need to transfer the data from the main memory 10 to the cache memory 110. The process proceeds to step S82 without transferring the data.
  • the reservation processing unit 243 provides the main memory access arbitration unit 146 with an instruction to transfer data from the main memory 10 to the cache memory 110 at the access interval Dd input from the priority determination unit 247.
  • the main memory access arbitration unit 146 that has received the instruction to perform the transfer reads the data to be transferred from the main memory 10 and gives it to the reservation processing unit 243.
  • the reservation processing unit 243 gives the given data to the cache memory arbitration unit 145 and causes the cache memory arbitration unit 145 to write the data. Note that the subsequent processing of the memory management unit 120 is the same as that of the first embodiment, and thus description thereof is omitted.
  • the reservation processing unit 243 determines whether or not the transfer completion size is equal to or larger than the size of one line as a transfer unit (S82). If the transfer completion size is less than one line size (S82: No), the process returns to step S80. If the transfer completion size is one line size or more (S82: Yes), the process proceeds to S83.
  • the reservation processing unit 243 can efficiently use the cache memory 110 by transferring the transfer reservation information input from the priority determination unit 247 line by line.
  • the priority determination unit 247 determines the highest priority transfer reservation information every time the progress address A3 is input from the process switching unit 141 to the priority determination unit 247, and outputs the reservation information to the reservation processing unit 243. May perform transfer reservation processing accordingly.
  • the priority determination unit 247 determines whether it is necessary to consider the precharge time.
  • the precharge time occurs when the Row address on the main memory 10 is different. For this reason, the priority determination unit 247 stores the address of the continuous area of the data transferred with the previously determined highest priority transfer reservation information in the memory 247a, and compares the row address with the previous transfer target. It is determined whether or not the Row address of the transfer reservation information that has become different from the Row address of the transfer reservation information that is the current transfer target. When the Row address is different, the priority determination unit 247 considers the precharge time.
  • the precharge time Tpri (Cycle) is converted into the number of instruction steps. Conversion of the precharge time Tpri to the number of instruction steps is performed by the following equation (3).
  • the priority determination unit 247 holds a timer in advance, measures the number of cycles Tos required for execution of one measured instruction step, and uses the value for conversion of the precharge time Tpri.
  • the cycle number Tos required for execution of one instruction step is the average number of cycles required for execution of one instruction from the previous instruction to the current instruction or the current instruction. .
  • the access interval Dap considering the precharge time is calculated by the equation (4) using the converted precharge Spri calculated by the equation (3).
  • the reservation processing unit 243 may use the size H * V of the continuous area in which the data to be transferred, which is indicated by the transfer reservation information, is stored as a transfer unit.
  • FIG. 27 shows the processing performed by the priority determination unit 247 when the transfer unit of the reservation processing unit 243 is the size H * V of the continuous area in which the data to be transferred is stored, which is indicated by the transfer reservation information. It is the schematic which shows an example of a timing chart.
  • FIG. 27 illustrates the timing at which the progress address A3 and the command command C3 are input from the process switching unit 141, the timing at which the highest priority transfer reservation information is determined, and the plurality of times received by the priority determination unit 247 from the process switching unit 141. The timing at which the size of the remaining continuous area among the continuous areas in which the data to be transferred is stored is switched based on the transfer reservation information.
  • the priority determination unit 247 determines the transfer reservation information ( TR # 1) is stored in the memory 247a. Then, the priority determination unit 247 determines the highest priority transfer reservation information. At the stage of time t30, since the transfer reservation information received by the priority determination unit 247 is only TR # 1, the priority determination unit 247 determines TR # 1 as the highest priority transfer reservation information. Then, the priority determination unit 247 calculates the start address PROC1 of the continuous area in which the data to be transferred, which is indicated by TR # 1, and the size H1 * V1 of the continuous area in which the data to be transferred is stored. The accessed access interval Da is output to the reservation processing unit 243, and the reservation process is started.
  • the priority determination unit 247 determines the next highest priority transfer reservation information.
  • the start address PROC2 of the continuous area storing the data to be transferred and the size H2 * V2 of the continuous area storing the data to be transferred, which are indicated by the transfer reservation information # 2 which is the priority transfer reservation information, are calculated.
  • the time elapsed since the previous access is stored in the memory 248a as the access elapsed time Td.
  • the present invention is not limited to this.
  • the access management unit 248 displays the corresponding access progress.
  • the time Td may be reset.
  • the transfer reservation information for transferring the data stored in the continuous area on the main memory 10 stored in the cache line that is more likely to be released from the cache memory 110 is given priority to the reservation processing unit 243.
  • FIG. 28 is a schematic diagram illustrating an example in which two access masters 1 # 1 and 1 # 2 are connected to the cache memory controller 300.
  • the process switching unit 341 stores a progress address A3 for each access master 1 in the memory 341a. Therefore, when the instruction address A1 # 1 or A1 # 2 input from the connected access master 1 # 1 or 1 # 2 is an address included in the instruction area 190 shown in FIG. 341 is stored as the progress address A3 of the access master 1 # 1 or 1 # 2 to which the instruction address is input in the memory 341a, or the progress address A3 of the access master 1 # 1 or 1 # 2 is already stored. If so, update that value.
  • the process switching unit 341 determines the priority of the instruction address stored as the progress address A3 and the access master number Mn preset for each access master indicating the access master 1 # 1 or 1 # 2. To the unit 347. Further, when the instruction command C1 # 1 or C1 # 2 input from the access master 1 # 1 or 1 # 2 is neither read nor write, the instruction command C1 # 1 or C1 # 2 is transferred to the transfer reservation command C3. Is output to the priority determination unit 347.
  • the priority determination unit 347 receives the transfer reservation command C3, the progress address A3, and the access master number Mn from the process switching unit 341. Then, the priority determination unit 347 receives the access master number Mn, the start address MM_ADDR of the continuous area referred to by the access master 1 indicated by the received transfer reservation command C3, the size H * V of the continuous area, and the The start address PROC of the function, which is an instruction group that refers to the continuous area, is stored in the memory 347a (transfer reservation storage unit). Further, the priority determination unit 347 stores the received access master number Mn and the received progress address A3 in the memory 347b (progress address storage unit). The priority determination unit 347 calculates the access interval Da based on the progress address of each access master 1 stored in the memory 347b, and determines the highest priority transfer reservation information.
  • FIG. 29 is a schematic diagram showing the transfer reservation management information 301 stored in the memory 347a of the priority determination unit 347.
  • the transfer reservation management information 301 includes an arrival order column 301a, an access master number column 301f, a reference instruction group start address column 301b, a continuous area start address column 301c, a transfer remaining size column 301d, and a transfer status column 301e.
  • Have. 29, the arrival order column 301a, the reference instruction group start address column 301b, the continuous area start address column 301c, the transfer remaining size column 301d, and the transfer status column 301e are the arrival order column 201a, reference instruction group start address in FIG. Since this is the same as the column 201b, the continuous area top address column 201c, the remaining transfer size column 201d, and the transfer status column 201e, description thereof will be omitted.
  • the access master number column 301f stores the access master number Mn given from the process switching unit 341.
  • FIG. 30 is a schematic diagram showing the progress address management information 303 stored in the memory 347b of the priority determination unit 347.
  • the progress address management information has an access master number column 303a and a progress address column 303b.
  • the access master number column 303a stores the access master number Mn given from the process switching unit 341.
  • the progress address column 303b stores the progress address A3 given from the process switching unit 341.
  • the priorities of the plurality of transfer reservation information input from the plurality of access masters 1 connected to the cache memory controller 300 are determined, and the main memory 10 determines the priority of the access master 1 according to the progress of the program.
  • the main memory 10 determines the priority of the access master 1 according to the progress of the program.
  • the data area on the main memory 10 is designated as the continuous area in which the data to be transferred indicated by the transfer reservation information is stored.
  • the continuous area in which data to be transferred is stored may be an instruction area on the main memory 10.
  • the start address PROC of the instruction group referring to the continuous area storing the data to be transferred, designated by the transfer reservation information is the instruction of the continuous area belonging to the instruction area on the main memory 10 to be transferred. May be the address of the instruction immediately before execution. Thereby, for example, even when the instruction executed by the access master 1 is a branch instruction, the branch destination instruction group can be transferred to the cache memory 110 before they are executed, thereby preventing a decrease in the operating speed of the access master 1. can do.
  • the process switching units 141 and 341 described above have analyzed the instruction command C1 from the connected access master 1 to determine whether it is a read or write, and switched the process.
  • the present invention is not limited to this.
  • the instruction command C1 input from the access master 1 is either read or write, and the addresses of the memories 247a and 347a of the priority determination units 247 and 347 are attached to the instruction command C1.
  • the process switching units 141 and 341 may switch the process by decoding the input address.
  • the process switching units 141 and 341 It can be determined that this is transfer reservation information.
  • a general-purpose bus such as AMBA AXI (Advanced Extensible Interface) is used for connection between the access master 1 and the cache memory controllers 100 to 300, for example, as hardware for the access master 1 and for use with the access master 1. Therefore, the versatility of the cache memory controllers 100 to 300 can be improved.
  • the hit detection result R2 is a cache miss
  • the data at the address is transferred from the main memory 10 to the cache memory 110, and the reservation indicating the cache line of the storage destination is stored.
  • the area information I1 is given to the release processing unit 144, but the present invention is not limited to this.
  • the reserved area information I1 indicating the storage destination cache line may be given to the release processing unit 144.
  • the release processing unit 144 receives the reserved area information I1
  • the access master 1 does not access the access flag Fa of the cache line indicated by the reserved area information I1 stored in the tag memory 121 “invalid.
  • the reserved area access flag Fra is set so as to indicate that the access flag Fa has never been valid.
  • 1 access master 10 main memory, 100, 200, 300 cache memory controller, 110 cache memory, 120 memory management unit, 130 hit detection unit, 140, 240, 340 data processing unit, 141, 341 processing switching unit, 142 request processing Sections, 143, 243 reservation processing section, 144 release processing section, 145 cache memory access arbitration section, 146 main memory access arbitration section, 247, 347 priority determination section, 248 access management section.

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

 第1のプログラムを格納する命令領域及び第1のプログラムに含まれる特定の命令で利用されるデータを格納するデータ領域を有するメインメモリ(10)と、第1のプログラムに含まれている命令を実行するアクセスマスタ(1)と、に接続されたキャッシュメモリコントローラ(100)であって、メインメモリ(10)の一部のデータを格納するキャッシュメモリ(110)と、特定の命令の先頭アドレスを含む転送予約情報に従って、アクセスマスタ(1)が特定の命令を実行する前に、アクセスマスタ(1)で実行中の命令のアドレスから特定の命令の先頭アドレスまでの残りの命令ステップ数に基づいてアクセス間隔を算出し、このアクセス間隔で、特定の命令で利用されるデータをメインメモリ(10)からキャッシュメモリ(110)に転送するデータ処理部(140)とを備える。

Description

キャッシュメモリコントローラ及びキャッシュメモリコントロール方法
 本発明は、キャッシュメモリコントローラ及びキャッシュメモリコントロール方法に関する。
 近年、機器で扱うコンピュータプログラム及び映像等のデータ量が増大しており、機器に搭載されるハードディスク及びメインメモリも大容量化している。メインメモリは、命令領域とデータ領域に分けられる。命令領域には、プログラム等の命令が格納され、データ領域には、それらの命令が処理に使用する映像等のデータが格納される。メインメモリの動作周波数は、CPU等のアクセスマスタの動作周波数に比べて低速なため、一般的に、高速にアクセス可能なキャッシュメモリが用いられる。アクセスマスタは、キャッシュメモリにアクセスすることで、より高速なデータのリード及びライトが可能となる。
 しかしながら、キャッシュメモリは、単位面積当たりの容量が小さく、高価なため、多くの場合、メインメモリ全体をキャッシュメモリに置き換えることは困難である。このため、メインメモリのデータの一部をキャッシュメモリに転送する方法が取られる。メインメモリからキャッシュメモリへの転送は、キャッシュメモリの管理単位であるキャッシュライン単位で行われる。アクセスマスタが高速にデータのリード及びライトを行うことができるようになるのは、キャッシュメモリに必要なデータが格納されており、かつ、確実にアクセスできる場合である。この場合をキャッシュヒットという。
 これに対して、アクセスマスタがアクセスした際に、アクセス要求されたアドレスのデータがキャッシュメモリに格納されていない場合をキャッシュミスという。この場合、アクセス要求されたデータをメインメモリからキャッシュメモリへ転送する必要がある。これによって、プログラムの待ち時間の発生による低速化、及び、消費電力の増大が発生する。そのため、アクセスマスタが必要とするデータを予めメインメモリから先読みして、キャッシュメモリに転送しておくことで、確実にデータにアクセスできる確率(キャッシュヒット率)を向上させることが望まれる。
 特許文献1には、データの先読み手法として、アクセスマスタからの命令をバッファに格納し、過去の割込み命令履歴を基にデータを先読みしてキャッシュメモリに格納する情報処理装置が記載されている。これにより、アクセスマスタが過去に実行した割込み命令を再度実行する場合には、キャッシュヒットとなり、割込みルーチンへの分岐を高速化すること、及び、割込みルーチン又はサブルーチンからの復帰を高速化することができる。
特許第4739380号公報
 しかしながら、特許文献1に記載された情報処理装置では、先読みできるデータは過去に実行した履歴のある割り込み命令のみである。そのため、アクセスマスタが未だ実行していない割り込み命令、及び、過去に実行した際とは異なる分岐先となったデータを先読みすることはできない。このため、キャッシュミスが発生する問題がある。
 そこで、本発明は、アクセスマスタがアクセスしたことのない命令及びデータに対しても確実にキャッシュヒットできるようにすることを目的とする。
 本発明の一態様に係るキャッシュメモリコントローラは、第1のプログラムを格納する命令領域及び当該第1のプログラムに含まれる特定の命令で利用されるデータを格納するデータ領域を有するメインメモリと、前記第1のプログラムに含まれている命令を実行するアクセスマスタと、に接続されたキャッシュメモリコントローラであって、前記メインメモリの一部のデータを格納するキャッシュメモリと、前記特定の命令の先頭アドレスを含む転送予約情報に従って、前記アクセスマスタが前記特定の命令を実行する前に、前記アクセスマスタで実行中の命令のアドレスから前記特定の命令の先頭アドレスまでの残りの命令ステップ数に基づいてアクセス間隔を算出し、前記アクセス間隔で、前記特定の命令で利用されるデータを前記メインメモリから前記キャッシュメモリに転送するデータ処理部と、を備えることを特徴とする。
 本発明の一態様に係るキャッシュメモリコントロール方法は、第1のプログラムを格納する命令領域及び当該第1のプログラムに含まれる特定の命令で利用されるデータを格納するデータ領域を有するメインメモリから、前記第1のプログラムに含まれている命令を実行するアクセスマスタに、キャッシュメモリを用いて前記特定の命令で利用されるデータを提供するキャッシュメモリコントロール方法であって、前記特定の命令の先頭アドレスを含む転送予約情報に従って、前記アクセスマスタが前記特定の命令を実行する前に、前記アクセスマスタで実行中の命令のアドレスから前記特定の命令の先頭アドレスまでの残りの命令ステップ数に基づいてアクセス間隔を算出し、前記アクセス間隔で、前記特定の命令で利用されるデータを前記メインメモリから前記キャッシュメモリに転送する転送過程と、前記アクセスマスタが前記特定の命令を実行する際に、前記キャッシュメモリから前記特定の命令で利用されるデータを前記アクセスマスタに提供する提供過程と、を有することを特徴とする。
 本発明の一態様によれば、アクセスマスタがアクセスしたことのない命令及びデータに対しても確実にキャッシュヒットできるようになる。
実施の形態1に係るキャッシュメモリコントローラの構成を概略的に示すブロック図である。 実施の形態1に係るキャッシュメモリコントローラを動作させるための転送予約関数を示す概略図である。 実施の形態1における、第2のプログラムに転送予約関数を適用した例を示す概略図である。 実施の形態1における、第2のプログラムを第1のプログラムにコンパイルする処理を示すフローチャートである。 実施の形態1における、コンパイルへの入力と出力との関係を示す概略図である。 実施の形態1における、第2のプログラムをコンパイラがコンパイルすることで生成された第1のプログラムの一例を示す概略図である。 実施の形態1における、第1のプログラムのメインメモリへの配置例を示す概略図である。 実施の形態1における、データ処理部の処理切換部が行う処理を示すフローチャートである。 実施の形態1における処理切換部での処理のタイミングチャートの一例を示す概略図である。 実施の形態1における、データ処理部の要求処理部が行う処理を示すフローチャートである。 実施の形態1における、データ処理部の予約処理部が行う処理を示すフローチャートである。 (a)~(c)は、実施の形態1における、予約処理部によるデータ転送の推移を示す概略図である。 実施の形態1における、予約処理部が行う処理のタイミングチャートの一例を示す概略図である。 実施の形態1における、データ処理部の開放処理部が行う処理を示すフローチャートである。 実施の形態1における、第2のプログラムの変形例を示す概略図である。 実施の形態2に係るキャッシュメモリコントローラの構成を概略的に示すブロック図である。 実施の形態2における、予約処理部が記憶するテーブルである。 実施の形態2における、アクセス管理情報の一例を示す概略図である。 実施の形態2における、データ処理部の優先度決定部が行う処理を示すフローチャートである。 実施の形態2における、データ処理部の優先度決定部が優先度を決定する、第1のプログラムに含まれる2つの転送予約情報の第1の例を示す図である。 実施の形態2における、データ処理部の優先度決定部が優先度を決定する、第1のプログラムに含まれる2つの転送予約情報の第2の例を示す図である。 実施の形態2における、データ処理部の優先度決定部が優先度を決定する、第1のプログラムに含まれる2つの転送予約情報の第3の例を示す図である。 実施の形態2における、データ処理部の優先度決定部が優先度を決定する、第1のプログラムに含まれる2つの転送予約情報の第4の例を示す図である。 実施の形態2における、データ処理部の優先度決定部が優先度を決定する、第1のプログラムに含まれる2つの転送予約情報の第5の例を示す図である。 実施の形態2における、データ処理部の優先度決定部での処理のタイミングチャートの一例を示す概略図である。 実施の形態2における、データ処理部の予約処理部が行う処理を示すフローチャートである。 実施の形態2における、データ処理部の優先度決定部での処理のタイミングチャートの一例を示す概略図である。 実施の形態2に係るキャッシュメモリコントローラの変形例を概略的に示すブロック図である。 実施の形態2における、転送予約管理情報の変形例を示す概略図である。 実施の形態2における、進行アドレス管理情報の一例を示す概略図である。
実施の形態1.
 図1は、実施の形態1に係るキャッシュメモリコントローラ100の構成を概略的に示すブロック図である。キャッシュメモリコントローラ100は、キャッシュメモリ110と、メモリ管理部120と、ヒット検出部130と、データ処理部140とを備える。
 図1では、アクセスマスタ1と、キャッシュメモリコントローラ100と、メインメモリ10との接続関係が簡単に示されている。キャッシュメモリコントローラ100は、アクセスマスタ1からの命令コマンドC1に基づき、後述するキャッシュメモリ110又はメインメモリ10に格納されたデータへのアクセスを行う。ここで、命令コマンドC1は、アクセスマスタ1からの、メインメモリ10上のアドレスへのアクセス要求である。例えば、命令コマンドC1がリード要求であれば、アクセスマスタ1から命令コマンドC1と、メインメモリ10上のアドレスを示す命令アドレスA1がキャッシュメモリコントローラ100に入力される。そして、キャッシュメモリコントローラ100は、命令コマンドC1及び命令アドレスA1に対応するリードデータD1をアクセスマスタ1に出力する。
 なお、図1は、アクセスマスタ1が1つで構成されるキャッシュメモリコントローラ100を表しているが、複数のアクセスマスタ1がキャッシュメモリコントローラ100を共有しても良い。また、アクセスマスタ1は、例えばCPU等の制御部で構成され、メインメモリ10に格納されたコンピュータプログラム(第1のプログラム)のプロセスに従って命令を実行する。
 メインメモリ10は、命令領域とデータ領域とを備える。命令領域にはアクセスマスタ1が実行する命令が格納され、データ領域にはアクセスマスタ1が処理に利用するデータが格納される。例えば、本実施の形態においては、命令領域には、第1のプログラムが格納され、データ領域には、第1のプログラムに含まれている命令で利用されるデータが格納される。
 キャッシュメモリ110は、メインメモリ10に格納されているデータの一部を格納する。キャッシュメモリ110は、例えばSRAM(Static Random Access Memory)のような半導体メモリで構成され、メインメモリ10よりも高速にデータのアクセスができる。例えば、キャッシュメモリ110は、64バイト毎に分割され、この分割された単位をキャッシュラインと呼ぶ。そして、キャッシュラインには、メインメモリ10の、連続した64バイトのデータが格納される。
 メモリ管理部120は、キャッシュメモリ110の管理を行う。例えば、メモリ管理部120は、管理情報記憶部としてのタグメモリ121を備え、このタグメモリ121を用いて、キャッシュメモリ110の管理を行う。
 タグメモリ121は、キャッシュメモリ110の各キャッシュラインに格納されたデータの、メインメモリ10におけるアドレス情報Taと、各キャッシュラインにデータが存在するかどうかを示すステータス識別情報であるステータスフラグFsと、各キャッシュラインにアクセスマスタ1がアクセスしたかどうかを示すアクセス識別情報であるアクセスフラグFaとを管理情報として記憶する。
 ステータスフラグFsは、キャッシュメモリ110の各キャッシュラインにデータが存在する場合に「有効」、データが存在しない場合に「無効」を示す。
 アクセスフラグFaは、キャッシュメモリ110の各キャッシュラインにアクセスマスタ1がアクセスした場合に「有効」、アクセスマスタ1がアクセスしていない場合に「無効」を示す。メモリ管理部120は、例えば、所定の滞留時間にアクセスされたかを調べるLRU(Least Recently Used)方式に基づき、所定のタイミングで、例えば、タイマー(図示せず)で予め定められた時間の経過が計測されたタイミングで、アクセスフラグFaをリセットする。これにより、メモリ管理部120は、最近アクセスされていないキャッシュラインを求めることができる。
 ヒット検出部130は、アクセス要求される、メインメモリ10上のアドレスのデータがキャッシュメモリ110に格納されているかどうかを判断する。そして、ヒット検出部130は、そのようなデータがキャッシュメモリ110に格納されている場合にはキャッシュヒットを、そのようなデータがキャッシュメモリ110に格納されていない場合にはキャッシュミスを示すヒット検出結果をデータ処理部140に与える。ヒット検出部130は、タグメモリ121内のステータスフラグFsが「有効」を示すキャッシュラインのアドレス情報Taを参照することで、そのようなデータがキャッシュメモリ110に格納されているかどうかを判断する。アクセス要求されたアドレスと一致するアドレス情報Taがメモリ管理部120上に格納されている場合はキャッシュヒットとなり、そのようなアドレス情報Taが格納されていない場合はキャッシュミスとなる。
 データ処理部140は、メインメモリ10に記憶されているデータをキャッシュメモリ110に転送する。例えば、本実施の形態においては、データ処理部140は、特定の命令で利用されるデータがメインメモリ10に記憶されているアドレスを含む転送予約情報に従って、アクセスマスタ1が第1のプログラムに含まれているこの特定の命令を実行する前に、この特定の命令で利用されるデータをメインメモリ10からキャッシュメモリ110に転送する。また、データ処理部140は、アクセスマスタ1からの要求に応じて、キャッシュメモリ110又はメインメモリ10からデータを読み出す。さらに、データ処理部140は、アクセスマスタ1からの要求に応じて、キャッシュメモリ110又はメインメモリ10にデータを書き込む。データ処理部140は、処理切換部141と、要求処理部142と、予約処理部143と、開放処理部144と、キャッシュメモリアクセス調停部145と、メインメモリアクセス調停部146とを備える。
 処理切換部141は、アクセスマスタ1からの命令コマンドC1を解析し、データの出力先を要求処理部142及び予約処理部143の間で切り換える。例えば、命令コマンドC1がリード又はライトを示す場合は、処理切換部141は、命令コマンドC1を要求コマンドC2として、また、命令アドレスA1を要求アドレスA2として、それぞれを要求処理部142に与える。さらに、処理切換部141は、命令コマンドC1がリードを示す場合には、その命令アドレスA1を進行アドレスA3として、メモリ(進行アドレス記憶部)141aに記憶させる。ここで、進行アドレスA3は、アクセスマスタ1が実行中のアドレスを示す。一方、命令コマンドC1がデータ転送の予約を表す転送予約情報を示す場合は、処理切換部141は、命令コマンドC1を転送予約コマンドC3として、メモリ141aに記憶されている進行アドレスA3とともに、予約処理部143に与える。
 要求処理部142は、処理切換部141から入力される要求コマンドC2及び要求アドレスA2と、ヒット検出部130から入力されるヒット検出結果R1とに応じて、キャッシュメモリ110又はメインメモリ10上のデータをリード又はライトする。例えば、要求処理部142は、処理切換部141から要求アドレスA2を受け取ると、その要求アドレスA2をヒット検出部130に与える。そして、要求処理部142は、その応答として、ヒット検出部130から、要求アドレスA2のヒット検出結果R1を取得する。処理切換部141から入力される要求コマンドC2がリードを示す場合、要求処理部142は、キャッシュメモリ110又はメインメモリ10からリードしたリードデータD1をアクセスマスタ1へ出力する。
 なお、要求処理部142とキャッシュメモリアクセス調停部145との間の情報の受け渡しは、信号S1を介して行われる。また、要求処理部142とメインメモリアクセス調停部146との間の情報の受け渡しは、信号S4を介して行われる。
 予約処理部143は、処理切換部141から入力される進行アドレスA3及び転送予約コマンドC3と、ヒット検出部130から入力されるヒット検出結果R2とに応じて、メインメモリ10からキャッシュメモリ110へのデータの転送を行う。例えば、予約処理部143は、処理切換部141から転送予約コマンドC3を受け取ると、転送を行うデータがメインメモリ10に格納されているアドレス(転送予約アドレス)を特定し、特定されたアドレスA4をヒット検出部130に与える。そして、予約処理部143は、その応答として、ヒット検出部130から、アドレスA4のヒット検出結果R2を取得する。そして、予約処理部143は、ヒット検出結果R2がキャッシュミスである場合には、そのアドレスのデータをメインメモリ10からキャッシュメモリ110に転送する。また、予約処理部143は、転送予約コマンドC3に基づいて転送を開始すると、格納先のキャッシュラインを示す予約領域情報I1を開放処理部144に与える。
 なお、予約処理部143とキャッシュメモリアクセス調停部145との間の情報の受け渡しは、信号S2を介して行われる。また、予約処理部143とメインメモリアクセス調停部146との間の情報の受け渡しは、信号S5を介して行われる。
 開放処理部144は、メモリ管理部120を介して、キャッシュメモリ110の空き容量が少なくなったと判断した場合に、開放するキャッシュラインを選択する。例えば、開放処理部144は、メモリ管理部120のタグメモリ121のステータスフラグFsを監視し、「無効」を示すステータスフラグFsが、例えばT個のような予め定められた個数(閾値)以下となった場合に、キャッシュメモリ110の空き容量が少なくなったと判断する。ここで、開放処理部144は、タグメモリ121のアクセスフラグFaと、予約処理部143からの予約領域情報I1とに基づいて、開放されるキャッシュラインを選択する。開放処理部144は、開放するキャッシュラインを選択すると、選択されたキャッシュラインのデータをメインメモリ10へ書き戻すことを示す開放情報を、キャッシュメモリアクセス調停部145に与える。
 開放処理部144は、開放されるキャッシュラインを選択する際には、予約処理部143からの予約領域情報I1を参照する。例えば、開放処理部144は、予約領域情報I1に基づき、予約処理部143によりデータが格納されたキャッシュラインのアクセスフラグFaを監視し、アクセスマスタ1が1回以上それらのキャッシュラインに格納されたデータにアクセスし、アクセスフラグFaが有効となったかどうかを、予約領域アクセスフラグFraとして、メモリ(アクセス履歴情報記憶部)144aに記録する。アクセスマスタ1がそれらのキャッシュラインのデータに1回もアクセスしていない場合、開放処理部144は、そのキャッシュラインを開放の対象としない。なお、開放処理部144は、キャッシュラインが開放されると、その予約領域アクセスフラグFraをリセットする。
 なお、開放処理部144とキャッシュメモリアクセス調停部145との間の情報の受け渡しは、信号S3を介して行われる。また、開放処理部144とメインメモリアクセス調停部146との間の情報の受け渡しは、信号S6を介して行われる。
 キャッシュメモリアクセス調停部145は、予め定められた優先順位に基づき、要求処理部142と、予約処理部143と、開放処理部144とから入力される信号S1~S3に基づいて、キャッシュメモリ110へアクセスする順番を調停する。そして、キャッシュメモリアクセス調停部145は、調停された順番に従って、信号S1~S3をキャッシュメモリ110に与える。例えば、その優先順位は、高いものから順に、要求処理部142、開放処理部144及び予約処理部143であるものとする。
 従って、キャッシュメモリアクセス調停部145に対して、要求処理部142、予約処理部143及び開放処理部144のいずれか2つ以上から同時に信号が入力された場合、優先順位の低い方の信号に基づくキャッシュメモリ110へのアクセスは停止され、優先順位の高い方の信号に基づくキャッシュメモリ110へのアクセスが最優先に行われる。同時に入力された信号のうち、優先順位の低い方の信号に基づくアクセスは、優先順位の高い方の信号に基づくアクセスが終了次第、開始される。
 メインメモリアクセス調停部146は、予め定められた優先順位に基づき、要求処理部142と、予約処理部143と、開放処理部144とから入力される信号S4~S6に基づいて、メインメモリ10へアクセスする順番を調停する。例えば、その優先順位は、キャッシュメモリアクセス調停部145の順位と同様に、高いものから順に、要求処理部142、開放処理部144及び予約処理部143であるものとする。
 従って、メインメモリアクセス調停部146に対して、要求処理部142、予約処理部143及び開放処理部144のいずれか2つ以上から同時に信号が入力された場合、優先順位の低い方の信号に基づくメインメモリ10へのアクセスは停止され、優先順位の高い方の信号に基づくメインメモリ10へのアクセスが最優先に行われる。同時に入力された信号のうち、優先順位の低い方の信号に基づくアクセスは、優先順位の高い方の信号に基づくアクセスが終了次第、開始される。
 このとき、要求処理部142及び予約処理部143から同時に同じアドレスのデータに対してアクセスが要求された場合において、そのアドレスのデータがキャッシュメモリ110上に格納されていないときには、メインメモリアクセス調停部146は、要求処理部142からのアクセス要求のみを有効とする。メインメモリアクセス調停部146は、予約処理部143へは、そのアドレスのデータの転送が完了したことを示す予約転送完了フラグFtfを出力する。
 図2は、キャッシュメモリコントローラ100を動作させるための転送予約関数160を示す概略図である。転送予約関数160は、特定のデータをメインメモリ10からキャッシュメモリ110に転送する転送予約命令を示すコードである。図2に示されているように、転送予約関数160は、この関数実行後にアクセスマスタ1が参照する連続領域の先頭アドレスMM_ADDRと、この連続領域のサイズH*Vと、この連続領域を参照する命令群である関数の先頭アドレスPROCとを定義する。連続領域は、メインメモリ10上の命令領域又はデータ領域のアドレスが連続した一部の領域である。なお、本実施の形態においては、先頭アドレスMM_ADDR、サイズH*V及び先頭アドレスPROCが転送予約情報である。
 アクセスマスタ1は、例えばアセンブリ言語等、アクセスマスタ1が実行できる形式で記述された第1のプログラムを実行する。一方、図2に示されている転送予約関数160は、例えばC言語といった高級言語で、アクセスマスタ1が実行できない形式で記述された第2のプログラムに含まれている。第1のプログラムは、第2のプログラムをコンパイルすることで生成される。
 図3は、第2のプログラムに、図2に示されている転送予約関数160を適用した例を示す概略図である。図3に示されている第2のプログラム170は、アクセスマスタ1がメインメモリ10上の連続領域に配置されたデータを参照する命令で構成される関数173と、別の連続領域に配置されたデータを参照する命令で構成される関数174とを含む。プログラム170では、関数173及び174の実行前に、転送予約関数171及び転送予約関数172が処理される。
 第2のプログラムは、アクセスマスタ1が連続領域のデータを参照する処理を行う前に、転送予約関数160が処理されるように記述されているため、確実にキャッシュヒットしたい連続領域のデータをメインメモリ10からキャッシュメモリ110へ転送するためのコマンドを、アクセスマスタ1が実行可能な形式で第1のプログラムに挿入することができる。
 図4は、図3に示されている第2のプログラム170を第1のプログラムにコンパイル(変換)する処理を示すフローチャートである。図4に示されているフローは、図5に示されているように、第2のプログラムがコンパイラCgcに入力されることで実行される。コンパイラCgcは、一般に使用される仕様に従い、図2に示されている転送予約関数160をコンパイルする機能を備えているプログラム変換部である。また、第2のプログラム170は、図示しない記憶部に記憶されているものとする。
 コンパイラCgcは、コンパイルを開始すると、第2のプログラム中のコンパイル対象となっているソースコードが、図2に示されている転送予約関数160かどうかを判定する(ステップS10)。そして、ソースコードが転送予約関数160である場合(S10:Yes)には、処理はステップS11に進み、ソースコードが転送予約関数160ではない場合(S10:No)には、処理はステップS12に進む。
 ステップS11では、コンパイラCgcは、ソースコードを第1のプログラムに対応したコマンドにコンパイルする。一方、ステップS12では、コンパイラCgcは、ソースコードを、一般に使用される仕様に従ってコンパイルする。
 そして、コンパイラCgcは、コンパイル対象となっているソースコードが、第2のプログラムの終端かどうかを判定する(S13)。ソースコードが終端ではない場合(S13:No)には、コンパイラCgcは、コンパイル対象を次のソースコードに更新して、ステップS10に処理を進める。ソースコードが終端である場合(S13:Yes)には、コンパイラCgcは、フローを終了する。
 図6は、図3に示されている第2のプログラム170をコンパイラCgcがコンパイルした第1のプログラムの一例を示す概略図である。図6に示されている第1のプログラム180は、左列にアドレス、右列に命令語が16進数で表記される。命令の形式は、コンパイラCgcに依存するので、ここでは、命令語形式に関する説明を省略し、各命令が示す動作について説明する。
 図6に示されている命令181a~181cは、図3に示されている転送予約関数171を基に生成される転送予約命令である。命令181aは、図3に示されている転送予約関数171に記述された連続領域の先頭アドレスMM_ADDR1を処理切換部141へ通知する命令である。命令181bは、図3に示されている転送予約関数171に記述された連続領域のサイズH1*V1を処理切換部141へ通知する命令である。命令181cは、図3に示されている転送予約関数171に記述された先頭アドレスPROC1を処理切換部141へ通知する命令である。また、命令182a~182cは、図3における転送予約関数172を基に生成される転送予約命令である。命令182aは、図3に示されている転送予約関数172に記述された連続領域の先頭アドレスMM_ADDR2を処理切換部141へ通知する命令である。命令182bは、図3に示されている転送予約関数172に記述された連続領域のサイズH2*V2を処理切換部141へ通知する命令である。命令182cは、図3に示されている転送予約関数172に記述された先頭アドレスPROC2を処理切換部141へ通知する命令である。
 図6に示されているように、第1のプログラム180では、転送予約命令181a~181c、182a~182cが、メインメモリ10のデータを利用して行われる処理P1、P2を実行する命令群1831、1832、1833、・・・、1841、1842、1843、・・・、よりも先に記載されているため、アクセスマスタ1は、これらの命令群よりも先に、転送予約命令181a~181c、182a~182cを実行する。このため、アクセスマスタ1は、これらの命令群を実行する前に、転送予約命令181a~181c、182a~182cに従って、転送予約情報を示す命令コマンドC1を処理切換部141に送ることができる。これにより、アクセスマスタ1がこれらの命令群を実行する前に、これらの命令群で利用されるデータがメインメモリ10からキャッシュメモリ110に転送される。
 図7は、図6に示されている第1のプログラム180のメインメモリ10への配置例を示す概略図である。図7において、図6に示されている第1のプログラム180は、メインメモリ10上の命令領域190に格納される。特に、図3に示されている転送予約関数171をコンパイルした命令181a~181cは、領域191pに配置され、図3に示されている転送予約関数172をコンパイルした命令182a~182cは、領域192pに配置される。
 アクセスマスタ1が領域191pに配置された命令181a(図6参照)を実行することにより、図3に示されている関数173にて参照される連続領域197dの先頭アドレスが予約処理部143に通知される。続いて、アクセスマスタ1が領域191pに配置された命令181b(図6参照)を実行することにより、連続領域197dのサイズが予約処理部143に通知される。さらに、アクセスマスタ1が領域191pに配置された命令181c(図6参照)を実行することにより、図3に示されている関数173に対応するコマンドが格納された領域193pの先頭アドレスが予約処理部143に通知される。
 同様に、アクセスマスタ1が領域192pに配置された命令182a~182c(図6参照)を実行することにより、図3に示されている関数174にて参照される連続領域198dの先頭アドレス及びサイズと、図3に示されている関数174に対応するコマンドが格納された領域194pの先頭アドレスとが予約処理部143に通知される。
 次に、キャッシュメモリコントローラ100での処理の流れについて、フローチャートを用いて説明する。
 図8は、データ処理部140の処理切換部141が行う処理を示すフローチャートである。処理切換部141は、アクセスマスタ1から命令コマンドC1と命令アドレスA1とが入力されると処理を開始する。
 まず、処理切換部141は、入力された命令アドレスA1が、図7に示されている命令領域190に含まれるアドレスであるかどうかを判定する(S20)。命令アドレスA1が命令領域190のアドレスである場合(S20:Yes)には、処理はステップS21に進み、命令アドレスA1が命令領域190のアドレスではない場合(S20:No)には、処理はステップS22に進む。
 ステップS21では、処理切換部141は、入力された命令アドレスA1を進行アドレスA3としてメモリ141aに記憶する。なお、既に進行アドレスA3が記憶されている場合には、処理切換部141はその値を更新する。一方、命令アドレスA1が命令領域190のアドレスではない場合には、進行アドレスA3は更新されない。
 ステップS22では、処理切換部141は、メモリ141aに記憶されている進行アドレスA3を予約処理部143に与える。
 次に、処理切換部141は、アクセスマスタ1から入力される命令コマンドC1が、リード及びライトの何れかであるか否かを判定する(S23)。命令コマンドC1がリード及びライトの何れかである場合(S23:Yes)には、処理はステップS24に進み、命令コマンドC1がリード及びライトの何れでもない場合(S23:No)には、処理はステップS25に進む。
 ステップS24では、処理切換部141は、入力された命令コマンドC1及び命令アドレスA1を、それぞれ要求コマンドC2及び要求アドレスA2として要求処理部142に与える。一方、ステップS25では、処理切換部141は、命令コマンドC1を転送予約コマンドC3として予約処理部143に与える。転送予約コマンドC3は、例えば、図6に示されている命令181a~181c及び命令182a~182cである。
 次に、処理切換部141は、データ処理部140に、アクセスマスタ1からの命令コマンドC1があるかどうか(未処理の命令コマンドC1があるかどうか)を判定する(S26)。未処理の命令コマンドC1がある場合(S26:Yes)には、処理はステップS20に進み、未処理の命令コマンドC1がない場合(S26:No)には、処理切換部141は、フローを終了する。
 図9は、処理切換部141での処理のタイミングチャートの一例を示す概略図である。図9では、アクセスマスタ1から処理切換部141に命令コマンドC1が入力されるタイミングと、要求処理部142へデータを出力するタイミングと、予約処理部143へデータを出力するタイミングとが示されている。
 処理切換部141は、時刻t10において、アクセスマスタ1からリード要求を示す命令コマンドC1と、プログラム領域を示す命令アドレスA1とが入力されると、時刻t11において、それぞれを要求コマンドC2及び要求アドレスA2として要求処理部142へ出力する。また、処理切換部141は、進行アドレスA3の値を、命令アドレスA2を示す値に更新し、予約処理部143に与える。
 次に、時刻t12において、処理切換部141は、アクセスマスタ1からライト要求を示す命令コマンドC1と、データ領域を示す命令アドレスA1とが入力されると、時刻t13において、それぞれを要求コマンドC2及び要求アドレスA2として要求処理部142に与える。また、命令アドレスA1がデータ領域を示すため、処理切換部141は、進行アドレスA3の値は更新せず、メモリ141aに記録されている進行アドレスA3を予約処理部143に与える。
 時刻t13において、アクセスマスタ1からデータの転送予約を示す命令コマンドC1(TRI)と、転送予約を示す命令アドレスA1(TRIA)とが入力されると、処理切換部141は、要求処理部142への出力は行わず、時刻t14において、メモリ141aに記録されている進行アドレスA3を予約処理部143に与えるとともに、命令コマンドC1を転送予約コマンドC3として予約処理部143に与える。
 時刻t14において、アクセスマスタ1からリード要求を示す命令コマンドC1と、プログラム領域を示す命令アドレスA1とが入力されると、時刻t15において、それぞれを要求コマンドC2及び要求アドレスA2として要求処理部142に与える。また、処理切換部141は、進行アドレスA3の値を命令アドレスA1で示される値に更新し、予約処理部143に与える。
 以上のように、処理切換部141は、アクセスマスタ1から入力される命令コマンドC1及び命令アドレスA1に応じて、出力先を要求処理部142又は予約処理部143に切り換える。
 図10は、データ処理部140の要求処理部142が行う処理を示すフローチャートである。要求処理部142は、処理切換部141からの要求コマンドC2及び要求アドレスA2と、ヒット検出部130からのキャッシュヒット又はキャッシュミスを示すヒット検出結果R1とが入力されると、処理を開始する。
 まず、要求処理部142は、ヒット検出部130からのヒット検出結果R1により、要求コマンドC2で要求されるデータがキャッシュメモリ110に存在するかを判定する(S30)。要求コマンドC2で要求されるデータがキャッシュメモリ110に存在しない場合(S30:No)、言い換えると、ヒット結果R1がキャッシュミスを示す場合には、処理はステップS31に進む。一方、要求コマンドC2で要求されるデータがキャッシュメモリ110に存在する場合(S30:Yes)、言い換えると、ヒット結果R1がキャッシュヒットを示す場合には、処理はステップS32に進む。
 ステップS31では、要求処理部142は、メインメモリ10からキャッシュメモリ110へデータの転送を行うため、データの転送を行う命令をメインメモリアクセス調停部146に与える。この命令には、要求アドレスA2が含まれているものとする。そして、メインメモリアクセス調停部146は、要求アドレスA2で示されるアドレスに格納されているデータをメインメモリ10からキャッシュメモリ110に転送する処理を行う。例えば、メインメモリアクセス調停部146は、要求アドレスA2で示されるアドレスに格納されているデータをメインメモリ10から読み出し、このデータを要求処理部142に与える。要求処理部142は、与えられたデータをキャッシュメモリアクセス調停部145に与え、キャッシュメモリ110に書き込ませる。なお、キャッシュメモリ110にデータが書き込まれた場合には、メモリ管理部120は、タグメモリ121に書き込まれたデータのアドレスをアドレス情報Taとして格納するとともに、対応するステータスフラグFsがデータが存在することを示すように更新する。
 ステップS32では、要求処理部142は、キャッシュメモリ110へのアクセスを行う。要求コマンドC2がライト命令を示す場合、要求コマンドC2が示すデータをキャッシュラインにライトするため、要求処理部142は、キャッシュメモリアクセス調停部145へ要求コマンドC2と要求アドレスA2とを与える。一方、要求コマンドC2がリード命令を示す場合、要求コマンドC2が示すデータをキャッシュラインからリードするため、要求処理部142は、キャッシュメモリアクセス調停部145へリード対象の要求アドレスA2を与える。このようにして取得されたデータは、リードデータD1としてアクセスマスタ1に与えられる。また、キャッシュメモリ110にアクセスがあった場合には、メモリ管理部120は、タグメモリ121に格納されているアクセスフラグFaがアクセスしたことを示すように更新する。
 ここで、要求コマンドC2がリード要求を示し、かつ、ヒット検出結果R1がキャッシュミスを示す場合、要求処理部142は、メインメモリアクセス調停部146を介して、メインメモリ10から読み出されたデータを、キャッシュメモリアクセス調停部145を介してキャッシュメモリ110へ転送するとともに、リードデータとしてアクセスマスタ1に出力してもよい。この場合には、図10のステップS32の処理は行われない。但し、メモリ管理部120は、タグメモリ121に格納されているアクセスフラグFaがアクセスしたことを示すように更新する。
 図11は、データ処理部140の予約処理部143が行う処理を示すフローチャートである。予約処理部143は、処理切換部141から、進行アドレスA3、転送するデータが記憶されている連続領域の先頭アドレスMM_ADDR、転送するデータが記憶されている連続領域のサイズH*V、及び、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスPROCと、ヒット検出部130からキャッシュヒット又はキャッシュミスを示すヒット検出結果R2とが入力されると、処理を開始する。
 まず、予約処理部143は、メインメモリ10へアクセスする間隔(以下、アクセス間隔Daという)を算出する(S40)。アクセス間隔Daの算出には、進行アドレスA3から、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスPROCまでの命令ステップ数Dsが使用される。命令ステップ数Dsは、下記の(1)式で示されているように、予約処理を開始した時点での命令アドレスである進行アドレスA3から、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスPROCまでの差分で算出できる。
 Ds=(命令群の先頭アドレスPROC)-(進行アドレスA3)     (1)
 そして、予約処理部143は、下記の(2)式で示されているように、処理切換部141から入力された転送するデータが記憶されている連続領域のサイズH*Vのうち、転送が完了していない残りの連続領域のサイズRsで、命令ステップ数Dsを割ることで、単位サイズ当たりの転送に要する命令ステップ数Dspuを算出することができる。予約処理部143は、この単位サイズ当たりの転送に要する命令ステップ数Dspuをアクセス間隔Daとして使用する。
 Dspu=(命令ステップ数Ds)÷(残りの連続領域のサイズRs)    (2)
 次に、予約処理部143は、転送する連続領域のデータの内、次に転送する対象となるデータがキャッシュメモリ110に存在するか判定する(S41)。ここで、次に転送する対象となるデータは、転送する連続領域のデータの内、次に転送する転送単位長のデータである。そして、次に転送する対象となるデータがキャッシュメモリ110に存在しない場合(S41:No)、言い換えると、次に転送する対象となるデータのヒット検出結果R2が、キャッシュミスを示す場合には、メインメモリ10からキャッシュメモリ110へそのデータを転送する必要があるため、予約処理部143は、ステップS42に処理を進める。一方、次に転送する対象となるデータがキャッシュメモリ110に存在する場合(S41:Yes)、言い換えると、次に転送する対象となるデータのヒット検出結果R2が、キャッシュヒットを示す場合には、メインメモリ10からキャッシュメモリ110へそのデータを転送する必要がないため、予約処理部143は、そのデータを転送せずに、ステップS43に処理を進める。
 ステップS42では、予約処理部143は、ステップS40で算出されたアクセス間隔Daで、メインメモリ10からキャッシュメモリ110へデータの転送を行う命令をメインメモリアクセス調停部146に与える。例えば、アクセス間隔Daが「8」である場合には、進行アドレスA3が8ステップ分進むまでに、転送単位長のデータを転送する必要がある。このため、予約処理部143は、その8ステップの何れか、例えば、その8ステップの内の最初のステップで、メインメモリアクセス調停部146に転送命令を与える。このような転送命令を受けたメインメモリアクセス調停部146は、メインメモリ10から、転送対象となるデータを読み出し、予約処理部143に与える。予約処理部143は、与えられたデータをキャッシュメモリアクセス調停部145に与えて、キャッシュメモリ110に書き込ませる。なお、キャッシュメモリ110にデータが書き込まれた場合には、メモリ管理部120は、タグメモリ121に書き込まれたデータのアドレスをアドレス情報Taとして格納するとともに、対応するステータスフラグFsがデータが存在することを示すように更新する。
 次に、予約処理部143は、既に転送したデータの合計サイズを示す転送完了サイズを更新する(S43)。
 次に、予約処理部143は、転送完了サイズが、処理切換部141から入力された、転送するデータが記憶されている連続領域のサイズH*V以上かどうか判定する(S44)。転送完了サイズが、転送するデータが記憶されている連続領域のサイズH*V未満の場合(S44:No)には、処理はステップS45に進み、転送するデータが記憶されている連続領域のサイズH*V以上の場合(S44:Yes)には、フローを終了する。
 ステップS45では、予約処理部143は、処理切換部141から更新された進行アドレスA3を取得したか否かを判断する。進行アドレスA3が取得された場合(S45:Yes)には、処理はステップS40に進み、進行アドレスA3が取得されていない場合(S45:No)には、処理はステップS41に進む。
 以上のように、予約処理部143は、転送予約コマンドC3に基づいて必要なデータをキャッシュメモリ110へ転送することで、アクセスマスタ1がアクセスしたことのないメインメモリ10上の領域においても、キャッシュヒット率を確実に向上させることができる。
 図12(a)~(c)は、予約処理部143によるデータ転送の推移を示す概略図である。図12(a)は、進行アドレスA3の推移を示し、図12(b)は、転送するデータが記憶されている連続領域の残りのサイズの推移を示し、図12(c)は、アクセスする間隔Daの推移を示す。
 図12(c)に示されているように、時刻t0におけるアクセス間隔Da0は、予約処理部143に転送予約コマンドC3が入力された時点で計算される。
 図12(a)に示されているように、時刻t1において、進行アドレスA3の値が更新されると、その時点で転送するデータが記憶されている連続領域の残りのサイズ(図12(b)参照)と、進行アドレスA3から連続領域を参照する命令群の先頭アドレスPROCまでの残りのステップ数(図12(a)参照)とから、予約処理部143は、アクセス間隔Da1を再度算出し(図12(c)参照)、メインメモリ10へアクセスする間隔を調節する。
 このように、予約処理部143は、進行アドレスA3が更新されるとアクセス間隔Daを再度計算し、そのアクセス間隔Daで連続領域の転送を行う。そして、進行アドレスA3が、連続領域を参照する命令群の先頭アドレスPROCになる時刻tnまでに、転送するデータが記憶されている連続領域の残りのサイズが「0」、即ち、転送が完了するように転送処理を行う。時刻tnにおいては、進行アドレスA3が連続領域を参照する命令群の先頭アドレスPROCとなるため、アクセス間隔Danは「0」となる。
 図13は、予約処理部143が行う処理のタイミングチャートの一例を示す概略図である。図13は、処理切換部141から進行アドレスA3及び転送するデータが記憶されている連続領域のサイズH*Vが入力されるタイミングと、転送するデータが記憶されている連続領域のうち残りの連続領域のサイズが切り換わるタイミングと、アクセス間隔Daを算出するタイミングと、メインメモリ10へアクセスするタイミングとを示す。
 時刻t0において、処理切換部141から進行アドレスA3及び転送予約コマンドC3が入力されると、予約処理部143は、アクセス間隔Da0を算出する。処理切換部141からの進行アドレスA3が更新される時刻t1まで、予約処理部143は、算出されたアクセス間隔Da0で、メインメモリ10へのアクセスを行う。
 時刻t1において、処理切換部141から入力される進行アドレスA3が更新されると、予約処理部143は、アクセス間隔Da1を算出し、進行アドレスA3が更新される時刻t2まで、算出されたアクセス間隔Da1で、メインメモリ10へアクセスを行う。
 同様に、時刻t2において、処理切換部141から入力される進行アドレスA3が更新されると、予約処理部143は、アクセス間隔Da2を算出し、進行アドレスA3が更新されるまで、算出されたアクセス間隔Da2で、メインメモリ10へアクセスを行う。
 以降、予約処理部143は、処理切換部141から入力される進行アドレスA3が更新される度に算出されるアクセス間隔Daでメインメモリ10にアクセスし、進行アドレスA3が、転送予約コマンドC3で通知される連続領域を参照する命令群の先頭アドレスPROCとなるまでに転送を完了する。
 上記のように、進行アドレスA3を参照してメインメモリ10にアクセスする間隔を調節し、連続領域を参照する命令群が実行される前までに転送を完了することで、キャッシュメモリ110を効率良く使用できる。
 図14は、データ処理部140の開放処理部144が行う処理を示すフローチャートである。開放処理部144は、メモリ管理部120のタグメモリ121において、無効(データが格納されていないこと)を示すステータスフラグFsが予め定められた個数、例えばT個以下かどうかを常時監視する。
 開放処理部144は、ステータスフラグFsがT個以下かどうかを判定する(S50)。ステータスフラグFsがT個より多い場合(S50:No)には、開放処理部144は待機し、メモリ管理部120のステータスフラグFsの監視を続行する。一方、ステータスフラグFsがT個以下である場合(S50:Yes)には、処理はステップS51に進む。
 ステップS51では、開放処理部144は、キャッシュメモリ110上の各キャッシュラインのうち、開放の候補となるキャッシュラインを選択する。開放候補とするキャッシュラインを選択する方法としては、例えば、参照されていない時間が最も長いキャッシュラインを選択するLRU方式が適用される。
 そして、開放処理部144は、ステップS51で選択されたキャッシュラインが開放の対象であるか否かを判定する(S52)。キャッシュメモリ110の各キャッシュラインのうち、転送予約コマンドC3によって転送されたデータが格納され、かつ、アクセスマスタ1から1回もアクセスされていないキャッシュラインは、開放の対象とはならない。言い換えると、開放の対象となるのは、開放候補として選択されたキャッシュラインの内、要求コマンドC2によりキャッシュメモリ110に転送されたキャッシュラインと、開放候補として選択されたキャッシュラインの内、予約領域アクセスフラグFraにより、アクセスフラグFaが有効となったことがあると示されたキャッシュラインとである。そのため、開放処理部144は、予約処理部143からの予約領域情報I1に基づき、予約処理部143がデータを格納したキャッシュラインのアクセスフラグFaを監視し、アクセスフラグFaが1回以上有効となったかどうかを予約領域アクセスフラグFraとしてメモリ144aに記録する。
 そして、ステップS51で選択されたキャッシュラインが開放の対象ではない場合(S52:No)には、処理はステップS51に進み、開放処理部144は、再度LRU方式により、開放候補とするキャッシュラインを選択する。一方、ステップS51で選択されたキャッシュラインが開放の対象である場合(S52:Yes)には、処理はステップS53に進む。
 ステップS53では、開放処理部144は、開放の対象とされたキャッシュラインに格納されているデータを、メインメモリ10に書き戻す命令をキャッシュメモリアクセス調停部145に与える(S53)。このような命令を受けたキャッシュメモリアクセス調停部145は、開放の対象とされたキャッシュラインに格納されたデータを読み出し、このデータを開放処理部144に与える。開放処理部144は、そのデータをメインメモリアクセス調停部146に与えて、メインメモリ10にそのデータを書き込ませる。
 キャッシュメモリ110からメインメモリ10へキャッシュラインの書き戻しが完了すると、処理はステップS50に進み、開放処理部144は、タグメモリ121のステータスフラグFsの監視を続行する。
 以上のように、転送予約コマンドC3によって転送されたデータが格納され、かつ、アクセスマスタ1がアクセスしたことのないキャッシュラインを開放の対象としないことで、アクセスマスタが参照するデータが確実にキャッシュメモリ110に格納される。
 以上に記載した実施の形態1においては、図3に示されているような第2のプログラム170に転送予約関数171、172を記述し、これらをコンパイラCgcがコンパイルすることで生成された第1のプログラム180(図6参照)を使用して、キャッシュメモリコントローラ100を動作させる例を説明したが、このような例に限定されるものではない。第1のプログラム中に転送予約コマンドが記述されていればよい。従って、図15に示すような第2のプログラム270から、図6に示されている転送予約コマンド181a~181c、182a~182cを有する第1のプログラム180を生成するコンパイラを使用してもよい。言い換えると、コンパイラは、第2のプログラムに含まれている、メインメモリ10のデータ領域に格納されているデータを利用する命令を示すコードを解析することで、転送予約命令を生成すればよい。これにより、第2のプログラム270に転送予約関数160が意識的に記述されていないものであっても、適切な位置に確実に転送予約コマンドを記述でき、所望の目的を達成することができる。
 また、以上に記載した実施の形態1においては、アクセスマスタ1から転送予約コマンドが発行される例を説明したが、このような例に限定されるものではない。例えば、アクセスマスタ1が実行する第1のプログラムに転送予約命令が含まれていなくてもよい。このような場合には、予約処理部143が、キャッシュメモリ110内に格納されたメインメモリ10上の所定のプログラム領域に格納されている第1のプログラムを解析し、後に実行される処理で参照されるデータをメインメモリ10からキャッシュメモリ110へ転送する転送予約情報を生成すればよい。これにより、汎用的なコンパイラを使用して第2のプログラムから第1のプログラムを生成して、アクセスマスタ1が参照するデータを確実にキャッシュメモリ110に格納できる。
実施の形態2.
 実施の形態2を、図16~図30に基づいて説明する。
 図16は、実施の形態2に係るキャッシュメモリコントローラ200の構成を概略的に示すブロック図である。キャッシュメモリコントローラ200は、キャッシュメモリ110と、メモリ管理部120と、ヒット検出部130と、データ処理部240とを備える。
 図16では、アクセスマスタ1と、キャッシュメモリコントローラ200と、メインメモリ10との接続関係が簡単に示されている。
 メインメモリ10は、バンクと呼ばれる、ある程度の容量ごとにまとめて管理される。バンク内は、命令領域とデータ領域とに分けられる。また、メインメモリ10に対して、行(Row)アドレスと、列(Column)アドレスとを指定することにより、特定の連続領域にアクセスすることができる。
 キャッシュメモリ110、メモリ管理部120及びヒット検出部130の機能は、実施の形態1と同様であり、既に説明されているので、ここでの説明は省略する。
 データ処理部240は、メインメモリ10に記憶されているデータをキャッシュメモリ110に転送する。本実施の形態においては、データ処理部240は、特定の命令で利用されるデータがメインメモリ10に記憶されているアドレスを含む転送予約情報を受け取る度に、受け取った転送予約情報を記憶する。そして、データ処理部240は、転送予約情報が複数記憶されている場合に、これらを調停する。データ処理部240は、調停により優先度が高いと判定された転送予約情報に従い、第1のプログラムに含まれている特定の命令をアクセスマスタ1が実行する前に、この特定の命令で利用されるデータをメインメモリ10からキャッシュメモリ110に転送する。また、データ処理部240は、アクセスマスタ1からの要求に応じて、キャッシュメモリ110又はメインメモリ10にデータを書き込む。データ処理部240は、処理切換部141と、要求処理部142と、予約処理部243と、開放処理部144と、キャッシュメモリアクセス調停部145と、メインメモリアクセス調停部146と、優先度決定部247と、アクセス管理部248とを備える。
 処理切換部141、要求処理部142、開放処理部144、キャッシュメモリアクセス調停部145及びメインメモリアクセス調停部146の機能は、実施の形態1と同様であり、既に説明されているので、ここでの説明は省略する。
 優先度決定部247は、処理切換部141から進行アドレスA3及び転送予約コマンドC3を受け取る。そして、優先度決定部247は、受け取った転送予約コマンドC3で表される転送予約情報をメモリ247a(転送予約記憶部)に記憶する。優先度決定部247は、記憶されている転送予約情報毎にアクセス間隔Daを算出する。アクセス間隔Daの算出方法は、実施の形態1と同様である。優先度決定部247は、算出されたアクセス間隔Daと、アクセス管理部248から得られるアクセス経過時間R5とに基づき、最優先に予約処理部243に処理を行わせる転送予約情報を決定する。優先度決定部247は、アクセス管理部248へ、転送予約情報で示される、転送するデータが記憶されている連続領域の先頭アドレスAmをアドレスA5として与え、その応答として、アクセス経過時間R5を、アクセス管理部248より受け取る。さらに、優先度決定部247は、決定された最優先の転送予約情報の、メインメモリ10上の連続領域へのアクセス間隔Daと、転送するデータが記憶されている連続領域の先頭アドレスAmとを予約処理部243に与える。予約処理部243からの予約転送状況信号V1が転送完了を示し、転送予約情報として記憶されている、転送するデータが記憶されている連続領域のサイズH*Vが全て転送されると、優先度決定部247は、その転送予約情報をメモリ247aから消去する。
 図17は、優先度決定部247のメモリ247aに記憶されている転送予約管理情報201を示す概略図である。転送予約管理情報201は、到着順欄201aと、参照命令群先頭アドレス欄201bと、連続領域先頭アドレス欄201cと、転送残サイズ欄201dと、転送状況欄201eとを有する。
 到着順欄201aは、転送予約情報の到着順を示す情報を格納する。
 参照命令群先頭アドレス欄201bは、転送予約コマンドC3に含まれている、転送するデータが記憶されている連続領域を参照する命令群である関数の先頭アドレスPROCを格納する。
 連続領域先頭アドレス欄201cは、転送予約コマンドC3に応じて、転送するデータがメインメモリ10に格納されている連続領域の先頭アドレスを格納する。なお、連続領域先頭アドレス欄201cの初期値は、転送予約コマンドC3に含まれている、アクセスマスタ1が参照する連続領域の先頭アドレスMM_ADDRである。
 転送残サイズ欄201dは、転送予約コマンドC3に応じて転送するデータの残りのサイズを格納する。なお、転送残サイズ欄201dの初期値は、転送予約コマンドC3に含まれている、転送するデータが記憶されている連続領域のサイズH*Vである。
 転送状況欄201eは、参照命令群先頭アドレス欄201b及び連続領域先頭アドレス欄201cに格納された情報に対応する転送予約情報に基づいて、データが転送中であるか否かを示す転送状況情報を格納する。例えば、本実施の形態においては、この欄が「1」であれば、転送中であることを示し、「0」であれば、転送待機中であることを示す。
 なお、優先度決定部247は、転送予約コマンドC3を受け取った順に、転送予約コマンドC3で示される、アクセスマスタ1が参照する連続領域の先頭アドレスMM_ADDRと、転送するデータが記憶されている連続領域のサイズH*Vと、転送するデータが記憶されている連続領域を参照する命令群である関数の先頭アドレスPROCとを、転送予約情報として、転送予約管理情報201に格納する。優先度決定部247が、予約処理部243から予約転送状況信号V1を受け取ると、メモリ247aに記憶している内容を更新する。
 図16に戻り、アクセス管理部248は、処理切換部141からの要求アドレスA2を監視し、前回アクセスされてから経過した時間をアクセス経過時間Tdとしてタイマー(図示せず)で計測し、計測されたアクセス経過時間Tdをメモリ248a(アクセス経過時間記憶部)に記憶させる。アクセス管理部248は、メインメモリ10上の各バンクに属する行アドレスと、列アドレスとで分割される複数のアドレスからなる連続領域を1単位として、処理切換部141から要求アドレスA2が要求処理部142に送られるたびに、要求アドレスA2が属する連続領域を特定し、特定された連続領域のアクセス経過時間Tdをリセットする。また、優先度決定部247からアドレスA5が与えられた場合に、アクセス管理部248は、アドレスA5が属する連続領域を特定し、特定した連続領域のアクセス経過時間Tdを、応答R5として、メモリ248aから読み出し、これを優先度決定部247に与える。
 図18は、アクセス管理部248のメモリ248aに記憶されているアクセス管理情報202を示す概略図である。
 アクセス管理情報202は、バンクNo欄202aと、行アドレス欄202bと、列アドレス欄202cと、アクセス経過時間欄202dとを有する。
 バンクNo欄202aは、メインメモリ10のバンクを識別するためのバンクNoを格納する。
 行アドレス欄202bは、メインメモリ10のバンクに形成された連続領域の行アドレスの範囲を格納する。
 列アドレス欄202cは、メインメモリ10のバンクに形成された連続領域の列アドレスの範囲を格納する。
 アクセス経過時間欄202dは、バンクNo欄202aで特定されるバンクの、行アドレス欄202b及び列アドレス欄202cで特定される連続領域に、前回アクセスされてからの経過時間を示すアクセス経過時間Tdを格納する。アクセスマスタ1から一度もアクセスされていない連続領域に関しては、アクセス経過時間Tdは、キャッシュメモリコントローラ200が起動されてからの経過時間となる。
 図16に戻り、予約処理部243は、ヒット検出部130から与えられるヒット検出結果R2と、優先度決定部247から与えられる、転送するデータが記憶されている連続領域の先頭アドレスAm及びメインメモリ10へのアクセス間隔Daとに応じて、メインメモリ10へアクセスして、キャッシュメモリ110に、予め設定された転送単位である1ライン分のデータの転送を行う。キャッシュメモリ110への1ライン分のデータの転送が完了すると、予約処理部243は、予約転送状況信号V1を転送が完了したことを示す値に更新することで、1ライン分のデータの転送が完了したことを優先度決定部247に通知する。例えば、予約処理部243は、優先度決定部247から受け取った、転送するデータが記憶されている連続領域の先頭アドレスAmを、アドレスA4として、ヒット検出部130に与える。そして、予約処理部243は、その応答として、ヒット検出部130から、アドレスA4のヒット検出結果R2を取得する。そして、予約処理部243は、ヒット検出結果R2がキャッシュミスである場合には、そのアドレスのデータをメインメモリ10からキャッシュメモリ110に転送する。また、予約処理部243は、転送するデータが記憶されている連続領域の先頭アドレスAmの転送を開始すると、格納先のキャッシュラインを示す予約領域情報I1を開放処理部144に与える。最後に、予約処理部243は、転送するデータが記憶されている連続領域の先頭アドレスAmから1ライン分のデータの転送を完了すると、転送が完了したことを示すように予約転送状況信号V1を更新し、優先度決定部247に通知を行う。予約転送状況信号V1は、例えば、1ビットの信号とし、転送が完了しており、次の転送予約を受け付け可能な場合にはH(1)、反対に、他の転送予約を受け付け不可能な場合にはL(0)とする。
 次に、優先度決定部247での処理の流れについて、フローチャートを用いて説明する。
 図19は、優先度決定部247が、複数の転送予約情報を調停する際の処理を示すフローチャートである。優先度決定部247は、処理切換部141から、進行アドレスA3と、転送するデータが記憶されている連続領域の先頭アドレスMM_ADDR、転送するデータが記憶されている連続領域のサイズH*V、及び、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスPROCを含む転送予約コマンドC3とを受け取ると、処理を開始する。
 まず、優先度決定部247は、予約処理部243が処理中かどうか判定する(S60)。予約処理部243からの予約転送状況信号V1が転送予約受付不可(V1=L)を表している場合(S60:No)、転送が完了するまで待機する。予約処理部243からの予約転送状況信号V1が転送予約受付可能(V1=H)を表している場合(S60:Yes)、優先度決定部247は、ステップS61へ処理を進める。
 次に、ステップS61にて、優先度決定部247は、メモリ247aに記憶されている転送予約管理情報201の転送状況欄201eが転送中を表す転送予約情報があるか否かを判定する。記憶されている転送予約情報のうち、何れか1つにおいて、転送予約管理情報201の転送状況欄201eに、転送中を表す「1」が格納されている場合(S61:Yes)には、優先度決定部247は、処理をステップS62に進める。一方、記憶されている全ての転送予約情報の転送状況欄201eに転送待機中を表す「0」が格納されている場合(S61:No)には、優先度決定部247は、処理をステップS63に進める。
 ステップS62では、優先度決定部247は、転送予約管理情報201の転送状況欄201eに転送中を表す「1」が格納されているレコードを更新する。具体的には、優先度決定部247は、転送予約管理情報201の該当するレコードの転送残サイズ欄201dの値から、転送単位である、キャッシュメモリ10の1ライン分のサイズ(ここでは、例えば、「1」とする)を差し引くことで更新する。なお、優先度決定部247は、転送残サイズ欄201dの値が「0」になった場合、その転送予約情報(レコード)を削除する。一方、転送残サイズ欄201dの値から1ライン分のサイズを差し引いた後でも、転送残サイズ欄201dの値が「1」以上の場合、優先度決定部247は、連続領域先頭アドレス欄201cに格納されている連続領域の先頭アドレスを1ライン分加算する。言い換えると、優先度決定部247は、連続領域の先頭アドレスを1ライン分後のアドレスに更新する。更に、優先度決定部247は、該当するレコードの転送状況欄201eを、待機中を表す「0」に更新し、処理をステップS63に進める。
 ステップS63では、優先度決定部247は、メモリ247aに記憶されている、転送待機中の転送予約情報の個数を判定する。転送予約情報の個数が「0」個の場合には、優先度決定部247は、フローを終了する。転送予約情報の個数が「1」個の場合には、優先度決定部247は、処理をステップS64に進める。また、転送予約情報の個数が「2」個以上の場合は、優先度決定部247は、処理をステップS65に進める。
 ステップS64では、優先度決定部247は、処理切換部141から受け取った1つの転送予約情報、言い換えると、メモリ247aに記憶されている唯一の転送予約情報を、最優先転送予約情報と決定する。そして、処理はステップS69へ進む。
 ステップS65では、優先度決定部247は、メモリ247aに記憶されている各転送予約情報のアクセス間隔Daを算出する。そして、処理は、ステップS66に進む。アクセス間隔Daは、実施の形態1における(2)式により算出される。
 次にステップS66では、優先度決定部247は、ステップS65で算出された各転送予約情報のアクセス間隔Daが同程度か判定する。このとき、各転送予約情報のアクセス間隔Daが予め設定された許容誤差範囲内の場合、優先度決定部247は、同程度と判定し(S66:Yes)、処理をステップS67に進める。同程度ではない場合(S66:No)、優先度決定部247は、処理をステップS68に進める。アクセス間隔Daの許容誤差は、予め定められた値、例えば、「±10」とする。
 ステップS67では、優先度決定部247は、アクセス管理部248からの、各転送予約情報に対するアクセス経過時間R5に基づき、最優先転送予約情報を決定する。例えば、優先度決定部247は、メモリ247aに記憶されている転送予約管理情報201の連続領域先頭アドレス201c欄に格納されているアドレスA5をアクセス管理部248に与え、その応答として、アクセス経過時間R5を取得する。そして、優先度決定部247は、アクセス経過時間R5が最も大きい値の転送予約情報を、最優先転送予約情報と決定する。そして、処理は、ステップS69に進む。
 ステップS68では、優先度決定部247は、ステップS65で算出された全転送予約情報のアクセス間隔Daのうち、最もアクセス間隔Daが小さい転送予約情報を最優先転送予約情報と決定する。そして、処理は、ステップS69に進む。
 ステップS69では、優先度決定部247は、ステップS64、S67又はS68にて決定された最優先転送予約情報に基づき、転送予約管理情報201の対応する連続領域先頭アドレス欄201cに格納されているアドレスを、転送するデータが記憶されている連続領域の先頭アドレスAmとする。そして、優先度決定部247は、転送するデータが記憶されている連続領域の先頭アドレスAmと、アクセス間隔Daとを予約処理部243に与える。そして、処理はステップS70に進む。
 ステップS70では、メモリ247aに記憶されている転送予約管理情報201のうち、ステップS69で予約処理部243に与えた転送予約情報の転送状況を「0(転送待機中)」から「1(転送中)」へと変更する。そして、処理は、ステップS60に進む。
 以上のように、優先度決定部247は、進行アドレスA3から算出されるアクセス間隔Daに基づき、メモリ247aに記憶されている全転送予約情報から最優先転送予約情報を決定することで、より逼迫した転送予約情報に対しても、アクセスマスタ1が先頭アドレスPROCで示される命令群を実行する前までに、必要なデータの転送を完了でき、キャッシュメモリ110の浪費を防止できる。
 また、優先度決定部247は、進行アドレスA3から算出されるアクセス間隔Da及びアクセス管理部248からのアクセス経過時間R5に基づき、メモリ247aに記憶されている全転送予約情報から最優先転送予約情報を決定することで、キャッシュメモリ110から開放される可能性の高いメインメモリ10上の連続領域に対しても、キャッシュヒット率を向上させることができる。
 図20から図24は、それぞれ優先度決定部247が処理切換部141から受け取る2つの転送予約情報の、転送するデータが記憶されている連続領域のサイズと、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスとの関係を示す概略図である。図20~図24の縦軸は、転送するデータが記憶されている連続領域のサイズを表し、その横軸は時間を表す。優先度決定部247は、時間「0」で、処理切換部141から受け取った転送予約情報#1及び転送予約情報#2の優先度を決定する処理を開始する。横軸に記載されたt#1及びt#2は、それぞれ、処理切換部141から受け取った転送予約情報#1及び転送予約情報#2で示される、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスPROC1及び先頭アドレスPROC2がそれぞれ実行されるタイミングを表す。また、図中のH1*V1及びH2*V2はそれぞれ、処理切換部141から受け取った転送予約情報#1及び転送予約情報#2で示される、転送するデータが記憶されている連続領域のサイズを表す。
 図20及び図21は、それぞれ、図19のステップS66にて、全転送予約情報のアクセス間隔Daが同程度ではないと判断される例である。
 図20は、転送予約情報#2と比較して、転送予約情報#1において、転送するデータが記憶されている連続領域のサイズが大きく、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスまでの命令ステップ数が小さい、言い換えると、転送するデータが記憶されている連続領域を参照する命令群の実行が開始されるまでの時間が短いことを表す一例である。この場合、図19のステップS65にて算出されるアクセス間隔Daは、転送予約情報#2の値よりも転送予約情報#1の値の方が許容誤差を超えて小さくなる。従って、図19のステップS66にて、転送予約情報のアクセス間隔Daは同程度でないと判定され(S66:No)、アクセス間隔Daの小さい転送予約情報#1が最優先転送予約情報として決定される。
 図21は、図20とは反対に、優先度決定部247にて、最優先転送予約情報として転送予約情報#2が決定される例である。図21では、転送予約情報#1と比較して、転送予約情報#2において、転送するデータが記憶されている連続領域のサイズが大きく、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスまでの命令ステップ数も大きい、言い換えると、転送するデータが記憶されている連続領域を参照する命令群の実行が開始されるまでの時間が長い。従って、転送予約情報#2においては、転送するデータが記憶されている連続領域を参照する命令群の実行が開始されるまでの時間は長いが、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスPROC1とPROC2との差分が小さい。このため、図19のステップS65にて算出されるアクセス間隔Daは、転送予約情報#1の値よりも転送予約情報#2の値の方が許容誤差を超えて小さくなる。従って、図19のステップS66にて、転送予約情報のアクセス間隔Daは同程度ではないと判定され(S66:No)、アクセス間隔Daの小さい転送予約情報#2が最優先転送予約情報として決定される。
 以上のように、優先度決定部247は、アクセス間隔Daが最も小さい転送予約情報を最優先転送予約情報と決定し、算出されたアクセス間隔Daと、最優先転送予約情報で示される、転送するデータが記憶されている連続領域の先頭アドレスAmとを予約処理部243に与える。これにより、予約処理部243でアクセス間隔Daを算出する必要が無くなり、予約処理の開始が早くなるため、メインメモリ10からキャッシュメモリ110へのデータ転送効率を向上させることができる。
 図22から図24はそれぞれ、図19のステップS66にて、全転送予約情報のアクセス間隔Daが同程度であると判断される例である。
 図22では、転送予約情報#1及び転送予約情報#2の両方において、転送するデータが記憶されている連続領域のサイズに対して、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスまでの命令ステップ数が小さい。このため、図19のステップS65にて算出されるアクセス間隔Daの値が何れも同程度に小さくなり、ステップS66において、何れの転送予約情報のアクセス間隔Daも同程度であると判断される。
 図23では、転送予約情報#1において、転送するデータが記憶されている連続領域のサイズが非常に小さいが、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスまでの命令ステップ数も小さい。一方、転送予約情報#2において、転送するデータが記憶されている連続領域のサイズは大きいが、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスまでの命令ステップ数も大きい。このため、図19のステップS65にて算出されるアクセス間隔Daの値が何れも同程度に小さくなり、ステップS66において、何れの転送予約情報のアクセス間隔Daも同程度であると判断される。
 図24では、転送予約情報#1において、転送するデータが記憶されている連続領域のサイズは大きいが、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスまでの命令ステップ数もとても大きい。また、転送予約情報#2においても、転送するデータが記憶されている連続領域のサイズは非常に大きいが、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスまでの命令ステップ数も非常に大きい。このため、図19のステップS65にて算出されるアクセス間隔Daの値が何れも同程度に大きくなり、ステップS66において、何れの転送予約情報のアクセス間隔Daも同程度であると判断される。
 図22から図24の何れの場合においても、転送予約情報#1に対して転送予約情報#2のアクセス経過時間R5が短い場合、図19のステップS67にて、アクセス経過時刻R5の長い転送予約情報#1が最優先転送予約情報として決定される。反対に、転送予約情報#1に対して転送予約情報#2のアクセス経過時間R5が長い場合、図19のステップS67にて、アクセス経過時間R5の長い転送予約情報#2が最優先転送予約情報として決定される。
 上記のように、アクセス経過時間R5が最も大きい転送予約情報を最優先転送予約情報として決定することで、優先度決定部247が算出したアクセス間隔Daが同程度の複数の転送予約情報に対しても、キャッシュメモリ110から開放される可能性の高い連続領域の開放を防ぎ、キャッシュメモリコントローラ200の処理を高速化することができる。
 図23に示されているように、算出されるアクセス間隔Daがともに小さく、転送予約情報#1と転送予約情報#2に含まれる、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスPROC1とPROC2との差分が大きい場合には、優先度決定部247は、アクセス経過時刻R5が最も大きい転送予約情報を最優先転送予約情報として決定していたが、これに限定されるものではない。例えば、アクセス間隔Daが予め設定された第1の閾値以下であり、さらに、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスPROC1とPROC2との差分が、予め設定された第2の閾値以上である場合には、優先度決定部247は、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスが最も小さい転送予約情報を最優先転送予約情報と決定してもよい。これにより、キャッシュメモリ110がデータを不要に格納せず、キャッシュメモリ110の浪費を防ぐことができる。
 図24に示されているように、転送予約情報#1と比較して、転送予約情報#2において、転送するデータが記憶されている連続領域のサイズと、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスまでの命令ステップ数とが共に大きく、図19のステップS65で算出されるアクセス間隔Daの値が何れも同程度に大きい場合においても、優先度決定部247は、アクセス経過時間R5が最も大きい転送予約情報を最優先転送予約情報として決定していたが、これに限定されるものではない。例えば、算出されたアクセス間隔Daが、予め設定された第1の閾値以上の場合には、優先度決定部247は、アクセス間隔Daが第1の閾値以下となるか、次の転送予約情報が入力されるまで待機してもよい。これにより、先に受け取った転送予約情報よりもアクセス間隔Daが小さい転送予約情報を受け取った場合においても、優先度決定部247は、アクセス間隔Daの小さい転送予約情報を優先して処理することができ、キャッシュメモリ110を効率的に使用できる。
 上記では、優先度決定部247のメモリ247aに記憶された転送予約情報が2つである場合の例について説明したが、実際にはこれに限らない。メモリ247aに転送予約情報が3つ以上記憶されている場合であっても、上記と同様にアクセス間隔Daとアクセス経過時間とから、最優先転送予約情報を決定することで、キャッシュメモリ110の浪費を防ぐことができる。
 図25は、優先度決定部247が行う処理のタイミングチャートの一例を示す概略図である。図25は、処理切換部141から進行アドレスA3及び命令コマンドC3が入力されるタイミングと、最優先転送予約情報が決定されるタイミングと、優先度決定部247が処理切換部141から受け取った複数の転送予約情報に基づき、転送するデータのうち残りのデータのサイズが切り替わるタイミングとを示す。
 時刻t20において、処理切換部141から進行アドレスA3(1fc00fff)及び転送予約コマンドC3(TRI#1)が入力されると、優先度決定部247は、転送予約コマンドC3に基づいて、転送予約情報(TR#1)をメモリ247aに記憶させる。そして、優先度決定部247は、最優先転送予約情報を決定する。時刻t20の段階では、優先度決定部247が受け取っている転送予約情報はTR#1のみのため、優先度決定部247は、TR#1を最優先転送予約情報として決定する。そして、優先度決定部247は、その連続領域の先頭アドレスAmとアクセス間隔Daとを予約処理部243へ出力し、予約処理が開始される。予約処理部243が、TR#1で指定された転送するデータが記憶されている連続領域のサイズH1*V1のうち、1ライン分の転送を完了し、予約転送状況信号V1が転送予約受付可能状態(V1=H)となる時刻t24まで、優先度決定部247は処理を待機する。
 時刻t21~t23において、処理切換部141から優先度決定部247へ入力される進行アドレスA3及び転送予約コマンドC3が更新される。優先度決定部247は、時刻t21において入力される転送予約コマンドC3(TRI#2)に基づいて、転送予約情報(TR#2)をメモリ247aに記憶させ、また、時刻t23において入力される転送予約コマンドC3(TRI#3)に基づいて、転送予約情報(TR#3)をメモリ247aに記憶させる。しかしながら、予約処理部243からの予約転送状況信号V1が転送予約受付不可状態(V1=L)のため、優先度決定部247は処理を待機する。
 次に時刻t24において、予約処理部243からの予約転送状況信号V1が転送予約受付可能状態(V1=H)となるため、優先度決定部247は、最優先転送予約情報の決定処理を開始する。
 時刻t25において、優先度決定部247は、最優先転送予約情報をTR#3と決定し、その連続領域の先頭アドレスAmとアクセス間隔Daを予約処理部243へ出力し、予約処理が開始される。
 時刻t27において、TR#3における1ライン分の連続領域の転送が完了し、予約処理部243からの予約転送状況信号V1が転送予約受付可能状態(V1=H)となったため、時刻t24と同様に、優先度決定部247は、最優先転送予約情報の決定処理を開始する。ここでは、TR#2が最優先転送予約情報として決定される。
 以降、同様に、各時刻において予約処理部243からの予約転送状況信号V1が転送予約受付可能状態(V1=H)となる度に、優先度決定部247は、最優先転送予約情報を決定し、予約処理部243へ最優先転送予約情報の連続領域の先頭アドレスAmとアクセス間隔Daとを出力する。そして、優先度決定部247は、予約処理部243からの予約転送状況信号V1が転送予約受付不可状態(V1=L)ならば処理を待機する。
 最後に時刻t31において、優先度決定部247のメモリ247aが記憶している最後の転送予約情報(TR#2)の転送が完了すると、処理切換部141から転送予約コマンドC3が入力されるまで、予約処理部243からの予約転送状況信号V1は転送予約受付可能状態(V1=H)を保持し、優先度決定部247は処理を待機する。
 上記のように、優先度決定部247は、転送予約情報に従って、予め設定された転送単位サイズである1ライン分の転送を完了する毎に、メモリ247aに記憶されている全転送予約情報から最優先転送予約情報を決定し、各連続領域を参照する命令群が実行される前までに転送を完了することで、アクセスマスタ1へのデータ転送効率を向上することができる。
 次に、データ処理部240の予約処理部243が行う処理の流れについて、フローチャートを用いて説明する。
 図26は、予約処理部243が、転送予約コマンドC3に基づきデータを転送する際の処理を示すフローチャートである。予約処理部243は、ヒット検出部130からキャッシュヒット又はキャッシュミスを示すヒット検出結果R2と、優先度決定部247から転送するデータが記憶されている連続領域の先頭アドレスAmとメインメモリへのアクセス間隔Daとが入力されると、処理を開始する。
 まず、予約処理部243は、先頭アドレスAmに対応するデータがキャッシュメモリ110に存在するか判定する(S80)。ここで、先頭アドレスAmに対応するデータは、先頭アドレスAmから記憶されている転送単位長のデータである。予約処理部243は、ヒット検出部130からヒット検出結果R2により、この判定を行う。そして、先頭アドレスAmに対応するデータがキャッシュメモリ110に存在しない場合(S80:No)には、そのデータをメインメモリ10からキャッシュメモリへ転送する必要があるため、予約処理部243は、ステップS81に処理を進める。一方、先頭アドレスAmに対応するデータがキャッシュメモリ110に存在する場合(S80:Yes)には、そのデータをメインメモリ10からキャッシュメモリ110へ転送する必要がないため、予約処理部243は、そのデータを転送せずに、ステップS82に処理を進める。
 ステップS81では、予約処理部243は、優先度決定部247から入力されたアクセス間隔Ddで、メインメモリ10からキャッシュメモリ110へデータの転送を行う命令をメインメモリアクセス調停部146に与える。転送を行う命令を受けたメインメモリアクセス調停部146は、メインメモリ10から、転送対象となるデータを読み出し、予約処理部243に与える。予約処理部243は、与えられたデータをキャッシュメモリ調停部145に与えて、キャッシュメモリ110に書き込ませる。なお、これ以降のメモリ管理部120の処理は、実施の形態1と同様であるため、説明を省略する。
 次に、予約処理部243は、転送完了サイズが、転送単位である1ラインのサイズ以上かどうか判定する(S82)。転送完了サイズが1ラインサイズ未満の場合(S82:No)には、処理はステップS80に戻り、転送完了サイズが1ラインサイズ以上の場合(S82:Yes)には、処理はS83に進む。
 ステップS83では、予約処理部243は、予約転送状況信号V1を、転送するデータが記憶されている連続領域の先頭アドレスAmから1ライン分の転送を完了したことを示す、転送予約受付可能状態(V1=H)に設定して優先度決定部247へ出力し、予約処理を終了する。
 以上のように、予約処理部243は、優先度決定部247から入力された転送予約情報のうち1ラインずつ転送することで、キャッシュメモリ110を効率良く使用できる。
 なお、以上に記載した予約処理部243の処理の流れでは、転送予約コマンドC3にて指定された転送するデータが記憶されている連続領域のうち、1ラインずつ転送する例を説明したが、このような例に限定されるものではない。例えば、優先度決定部247は、処理切換部141から優先度決定部247に進行アドレスA3が入力される度に最優先転送予約情報を決定して予約処理部243へ出力し、予約処理部243は、それに従い転送予約処理を行ってもよい。このような場合には、メインメモリ10の行(Row)アドレスが異なる領域にアクセスする度に発生するプリチャージ時間を考慮してアクセス間隔Daを算出する必要がある。これにより、アクセス間隔Daが小さい複数の転送予約情報に対しても、メインメモリ10からキャッシュメモリ110への転送ができ、キャッシュヒット率を向上させることができる。
 ここで、プリチャージ時間を考慮したアクセス間隔Daの算出方法の一例を説明する。
 まず、優先度決定部247は、プリチャージ時間の考慮が必要かどうかを判定する。プリチャージ時間は、メインメモリ10上のRowアドレスが異なる場合に発生する。このため、優先度決定部247は、前回決定した最優先転送予約情報にて転送したデータの連続領域のアドレスをメモリ247aに記憶しておき、Rowアドレスの比較をすることで、前回転送対象となった転送予約情報のRowアドレスと、今回転送対象となった転送予約情報のRowアドレスとが異なるかどうかを判定する。Rowアドレスが異なる場合、優先度決定部247は、プリチャージ時間を考慮する。アクセス間隔Daは、転送単位サイズ当たりの転送に要する命令ステップ数であるため、プリチャージ時間Tpri(Cycle)を命令ステップ数に変換する。プリチャージ時間Tpriの命令ステップ数への変換は、下記の(3)式により行われる。
Figure JPOXMLDOC01-appb-M000001
 ここで式(3)では、優先度決定部247は、予めタイマーを保持し、計測した1命令ステップの実行にかかるサイクル数Tosを計測して、その値をプリチャージ時間Tpriの変換に使用する。また、1命令ステップの実行にかかるサイクル数Tosは、前回の命令から今回の命令までにかかったサイクル数、又は、今回の命令までの、1命令の実行にかかったサイクル数の平均値とする。
 そして、プリチャージ時間を考慮したアクセス間隔Dapは、(3)式で算出される変換後プリチャージSpriを用いて、(4)式で算出される。
Figure JPOXMLDOC01-appb-M000002
 また、予約処理部243は、転送予約情報で示された、転送するデータが記憶されている連続領域のサイズH*Vを転送単位としてもよい。この場合、優先度決定部247から予約処理部243へ、転送するデータが記憶されている連続領域のサイズH*Vを与え、転送が完了したら予約転送状況信号V1を転送予約受付可能状態(V1=H)とする。これにより、最優先転送予約情報を決定する処理を少なくでき、最優先転送予約情報の決定に必要な計算時間を短縮し、メインメモリ10からキャッシュメモリ110へのデータ転送効率を向上することができる。
 図27は、予約処理部243の転送単位を、転送予約情報で示された、転送するデータが記憶されている連続領域のサイズH*Vとした場合の、優先度決定部247が行う処理のタイミングチャートの一例を示す概略図である。図27は、処理切換部141から進行アドレスA3及び命令コマンドC3が入力されるタイミングと、最優先転送予約情報が決定されるタイミングと、優先度決定部247が処理切換部141から受け取った複数の転送予約情報に基づき、転送するデータが記憶されている連続領域のうち残りの連続領域のサイズが切り替わるタイミングとを示す。
 時刻t30において、処理切換部141から進行アドレスA3(1fc00fff)及び転送予約コマンドC3(TRI#1)が入力されると、優先度決定部247は、転送予約コマンドC3に基づいて、転送予約情報(TR#1)をメモリ247aに記憶させる。そして、優先度決定部247は、最優先転送予約情報を決定する。時刻t30の段階では、優先度決定部247が受け取っている転送予約情報はTR#1のみのため、優先度決定部247は、TR#1を最優先転送予約情報として決定する。そして、優先度決定部247は、TR#1で示される、転送するデータが記憶されている連続領域の先頭アドレスPROC1と、転送するデータが記憶されている連続領域のサイズH1*V1と、算出されたアクセス間隔Daとを、予約処理部243へ出力し、予約処理が開始される。
 時刻t31~t35において、処理切換部141から優先度決定部247へ入力される進行アドレスA3及び転送予約コマンドC3が更新される。優先度決定部247は、時刻t31において入力される転送予約コマンドC3(TRI#2)に基づいて、転送予約情報(TR#2)をメモリ247aに記憶させ、また、時刻t33において入力される転送予約コマンドC3(TRI#3)に基づいて、転送予約情報(TR#3)をメモリ247aに記憶させる。しかしながら、予約処理部243からの予約転送状況信号V1が転送予約受付不可状態(V1=L)のため、優先度決定部247は処理を待機する。
 時刻t35において、予約処理部243から入力される予約転送状況信号V1が転送予約受付可能状態(V1=H)となるため、優先度決定部247は、次の最優先転送予約情報を決定する。
 時刻t36において、優先度決定部247は、最優先転送予約情報としてTR#3を決定する。そして、優先度決定部247は、最優先転送予約情報として決定されたTR#3で示される、転送するデータが記憶されている連続領域の先頭アドレスPROC3及び転送するデータが記憶されている連続領域のサイズH3*V3と、算出されたアクセス間隔Daと、を予約処理部243へ出力し、予約処理が開始される。そして、優先度決定部247は、予約処理部243から入力される予約転送状況信号V1が転送予約受付可能状態(V1=H)となるまで処理を待機する。
 以降、上記と同様に、時刻t37において、優先度決定部247は、予約転送状況信号V1が転送予約受付可能状態(V1=H)となると、最優先転送予約情報を再度決定し、決定した最優先転送予約情報である転送予約情報#2で示される、転送するデータが記憶されている連続領域の先頭アドレスPROC2と、転送するデータが記憶されている連続領域のサイズH2*V2と、算出されたアクセス間隔Daとを、予約処理部243へ出力する。そして、予約処理部243から入力される予約転送状況信号V1が転送予約受付可能状態(V1=H)となるまで処理を待機する。
 以上に記載されたアクセス管理部248では、前回アクセスされてから経過した時間をアクセス経過時間Tdとしてメモリ248aに記憶しているが、これに限定されるものではない。例えば、前回アクセスされてから経過した時間が、キャッシュメモリ110の各キャッシュラインのうち、開放候補を決定するLRU方式で設定されている時間を経過した場合、アクセス管理部248は、対応するアクセス経過時間Tdをリセットしてもよい。これにより、キャッシュメモリ110から開放される可能性がより高いキャッシュラインに格納されているメインメモリ10上の連続領域に記憶されているデータを転送する転送予約情報を優先して予約処理部243へ出力できる。従って、開放処理部144が開放処理を行う回数を減らし、キャッシュメモリコントローラ200の処理を高速化することができる。
 以上に記載されたキャッシュメモリコントローラ200は、アクセスマスタ1が1つの場合について説明したが、このような例に限定されるものではない。アクセスマスタ1はキャッシュメモリコントローラ200に、複数接続されていてもよい。図28は、アクセスマスタ1#1及びアクセスマスタ1#2の2台が、キャッシュメモリコントローラ300に接続されている例を示す概略図である。
 キャッシュメモリコントローラ300に接続されるアクセスマスタ1が複数の場合、処理切換部341は、メモリ341a内に、アクセスマスタ1毎の進行アドレスA3を記憶する。従って、接続されているアクセスマスタ1#1又は1#2から入力された命令アドレスA1#1又はA1#2が、図7に示されている命令領域190に含まれるアドレスの場合、処理切換部341は、メモリ341a内の、命令アドレスを入力したアクセスマスタ1#1又は1#2の進行アドレスA3として記憶し、又は、既にそのアクセスマスタ1#1又は1#2の進行アドレスA3が記憶されている場合には、その値を更新する。そして、処理切換部341は、進行アドレスA3として記憶された命令アドレスと、そのアクセスマスタ1#1又は1#2を示す、アクセスマスタ毎に予め設定されたアクセスマスタ番号Mnとを、優先度決定部347へ出力する。さらに、アクセスマスタ1#1又は1#2から入力された命令コマンドC1#1又はC1#2が、リード及びライトの何れでもない場合、命令コマンドC1#1又はC1#2を、転送予約コマンドC3として優先度決定部347へ出力する。
 次に、優先度決定部347は、処理切換部341から転送予約コマンドC3と進行アドレスA3とアクセスマスタ番号Mnとを受け取る。そして、優先度決定部347は、受け取ったアクセスマスタ番号Mnと、受け取った転送予約コマンドC3で示される、アクセスマスタ1が参照する連続領域の先頭アドレスMM_ADDR、この連続領域のサイズH*V及びこの連続領域を参照する命令群である関数の先頭アドレスPROCと、をメモリ347a(転送予約記憶部)に記憶させる。さらに、優先度決定部347は、受け取ったアクセスマスタ番号Mnと、受け取った進行アドレスA3と、をメモリ347b(進行アドレス記憶部)に記憶させる。優先度決定部347は、メモリ347bに記憶されている各アクセスマスタ1の進行アドレスを基にアクセス間隔Daを算出し、最優先転送予約情報を決定する。
 図29は、優先度決定部347のメモリ347aに記憶されている転送予約管理情報301を示す概略図である。転送予約管理情報301は、到着順欄301aと、アクセスマスタ番号欄301fと、参照命令群先頭アドレス欄301bと、連続領域先頭アドレス欄301cと、転送残サイズ欄301dと、転送状況欄301eとを有する。なお、図29における到着順欄301a、参照命令群先頭アドレス欄301b、連続領域先頭アドレス欄301c、転送残サイズ欄301d及び転送状況欄301eは、図17における到着順欄201a、参照命令群先頭アドレス欄201b、連続領域先頭アドレス欄201c、転送残サイズ欄201d及び転送状況欄201eと同様であるため、説明を省略する。
 アクセスマスタ番号欄301fは、処理切換部341から与えられたアクセスマスタ番号Mnを格納する。
 図30は、優先度決定部347のメモリ347bに記憶されている進行アドレス管理情報303を示す概略図である。進行アドレス管理情報は、アクセスマスタ番号欄303aと、進行アドレス欄303bとを有する。
 アクセスマスタ番号欄303aは、処理切換部341から与えられたアクセスマスタ番号Mnを格納する。
 進行アドレス欄303bは、処理切換部341から与えられた進行アドレスA3を格納する。
 以上のように、キャッシュメモリコントローラ300に接続された複数のアクセスマスタ1から入力される複数の転送予約情報の優先度を決定し、各アクセスマスタ1のプログラムの進行状況に合わせてメインメモリ10からキャッシュメモリ110へのデータ転送を可能とすることで、キャッシュメモリコントローラ300に複数のアクセスマスタ1が接続されるシステムを設計することができる。このため、構築するシステムの規模を拡大することができる。
 以上に記載されたキャッシュメモリコントローラ100~300では、転送予約情報が示す、転送するデータが記憶されている連続領域としてメインメモリ10上のデータ領域を指定していたが、これに限定されるものではない。転送するデータが記憶されている連続領域は、メインメモリ10上の命令領域としてもよい。このような場合には、転送予約情報で指定する、転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスPROCは、転送するメインメモリ10上の命令領域に属する連続領域の命令が実行される直前の命令のアドレスとすればよい。これにより、例えばアクセスマスタ1が実行する命令が分岐命令の場合においても、分岐先の命令群を、それらが実行される前にキャッシュメモリ110へ転送でき、アクセスマスタ1の動作速度の低下を防止することができる。
 以上に記載された処理切換部141、341は、接続されているアクセスマスタ1からの命令コマンドC1を解析することで、リード及びライトの何れかであるかを判断し、処理を切り換えていたが、これに限定されるものではない。例えば、アクセスマスタ1から入力される命令コマンドC1がリード及びライトの何れかであり、かつ、このような命令コマンドC1に優先度決定部247、347のメモリ247a、347aのアドレスが添付されている場合には、処理切換部141、341は、入力されるアドレスをデコードすることにより、処理を切り換えてもよい。この場合、命令コマンドC1に添付されているアドレスがメインメモリ10上のアドレスではなく、優先度決定部247、347のメモリ247a、347aのアドレスを示す場合には、処理切換部141、341は、転送予約情報であると判断することができる。これにより、アクセスマスタ1として汎用的なCPU等のハードウェアの使用や、アクセスマスタ1とキャッシュメモリコントローラ100~300との接続に、例えば、AMBA AXI(Advanced eXtensible Interface)等の汎用的なバスを使用することができ、キャッシュメモリコントローラ100~300の汎用性を向上できる。
 以上に記載された予約処理部143、243では、ヒット検出結果R2がキャッシュミスである場合には、そのアドレスのデータをメインメモリ10からキャッシュメモリ110に転送し、格納先のキャッシュラインを示す予約領域情報I1を開放処理部144に与えていたが、これに限定されるものではない。例えば、ヒット検出結果R2がキャッシュヒットである場合においても、格納先のキャッシュラインを示す予約領域情報I1を開放処理部144に与えてもよい。この場合、開放処理部144は、予約領域情報I1を受け取ると、タグメモリ121に記憶されている、予約領域情報I1が示すキャッシュラインのアクセスフラグFaを、アクセスマスタ1がアクセスしていない「無効」を示すよう設定するとともに、アクセスフラグFaが1回も有効になっていないことを示すように予約領域アクセスフラグFraを設定する。これにより、転送予約情報で示される、転送するデータが記憶されている連続領域を参照する命令群をアクセスマスタ1が実行するまでに時間がかかった場合でも、そのキャッシュラインを開放することなく、確実にキャッシュヒットすることができる。
 1 アクセスマスタ、 10 メインメモリ、 100,200,300 キャッシュメモリコントローラ、 110 キャッシュメモリ、 120 メモリ管理部、 130 ヒット検出部、 140,240,340 データ処理部、 141,341 処理切換部、 142 要求処理部、 143,243 予約処理部、 144 開放処理部、 145 キャッシュメモリアクセス調停部、 146 メインメモリアクセス調停部、 247,347 優先度決定部、 248 アクセス管理部。

Claims (36)

  1.  第1のプログラムを格納する命令領域及び当該第1のプログラムに含まれる特定の命令で利用されるデータを格納するデータ領域を有するメインメモリと、前記第1のプログラムに含まれている命令を実行するアクセスマスタと、に接続されたキャッシュメモリコントローラであって、
     前記メインメモリの一部のデータを格納するキャッシュメモリと、
     前記特定の命令の先頭アドレスを含む転送予約情報に従って、前記アクセスマスタが前記特定の命令を実行する前に、前記アクセスマスタで実行中の命令のアドレスから前記特定の命令の先頭アドレスまでの残りの命令ステップ数に基づいてアクセス間隔を算出し、前記アクセス間隔で、前記特定の命令で利用されるデータを前記メインメモリから前記キャッシュメモリに転送するデータ処理部と、を備えること
     を特徴とするキャッシュメモリコントローラ。
  2.  前記第1のプログラムは、前記特定の命令の先頭アドレスを有する第1の転送予約命令を含み、
     前記アクセスマスタが前記特定の命令よりも先に前記第1の転送予約命令を実行することで、前記データ処理部は、前記アクセスマスタから前記転送予約情報を取得し、前記アクセスマスタが前記特定の命令を実行する前に、前記特定の命令で利用されるデータを前記メインメモリから前記キャッシュメモリに転送すること
     を特徴とする請求項1に記載のキャッシュメモリコントローラ。
  3.  前記データ処理部は、前記アクセスマスタで実行中の命令のアドレスが更新される毎に、前記アクセス間隔を算出すること
     を特徴とする請求項2に記載のキャッシュメモリコントローラ。
  4.  前記データ処理部は、前記第1の転送予約命令に従って前記キャッシュメモリに格納されたデータの内、前記アクセスマスタからアクセスされていない時間が最も長く、かつ、前記アクセスマスタが1回以上アクセスしたことのあるデータを、前記キャッシュメモリから開放すること
     を特徴とする請求項2又は3に記載のキャッシュメモリコントローラ。
  5.  前記第1の転送予約命令を示すコードを含む第2のプログラムを、前記第1のプログラムに変換するプログラム変換部をさらに備えること
     を特徴とする請求項2から4の何れか1項に記載のキャッシュメモリコントローラ。
  6.  前記特定の命令を示すコードを含む第2のプログラムを、前記第1のプログラムに変換するプログラム変換部をさらに備え、
     前記プログラム変換部は、前記特定の命令を示すコードを解析して前記第1の転送予約命令を生成すること
     を特徴とする請求項2から4の何れか1項に記載のキャッシュメモリコントローラ。
  7.  前記データ処理部は、前記第1のプログラムを解析することにより、前記転送予約情報を生成し、前記アクセスマスタが前記特定の命令を実行する前に、前記生成された転送予約情報に従って、前記特定の命令で利用されるデータを前記メインメモリから前記キャッシュメモリに転送すること
     を特徴とする請求項1に記載のキャッシュメモリコントローラ。
  8.  前記データ処理部は、前記アクセスマスタから受け取った複数の前記転送予約情報のうち、前記アクセス間隔に基づいて、最優先の転送予約情報を決定すること
     を特徴とする請求項2から7の何れか1項に記載のキャッシュメモリコントローラ。
  9.  前記データ処理部は、前記アクセスマスタから受け取った複数の前記転送予約情報のうち、前記アクセス間隔と、前記アクセスマスタから前記メインメモリにおいて予め定められた複数の連続領域の各々へアクセスしていない経過時間であるアクセス経過時間とに基づいて、最優先の転送予約情報を決定すること
     を特徴とする請求項2から7の何れか1項に記載のキャッシュメモリコントローラ。
  10.  前記データ処理部は、前記アクセスマスタから受け取った複数の前記転送予約情報のうち、前記アクセス間隔が最も小さい転送予約情報を、最優先の転送予約情報と決定すること
     を特徴とする請求項8又は9に記載のキャッシュメモリコントローラ。
  11.  前記データ処理部は、前記アクセスマスタから受け取った複数の前記転送予約情報に対して算出された前記アクセス間隔が全て同程度である場合には、
     前記アクセス経過時間が最も長い連続領域に格納されているデータにアクセスする転送予約情報を、最優先の転送予約情報と決定すること
     を特徴とする請求項8又は9に記載のキャッシュメモリコントローラ。
  12.  前記データ処理部は、前記アクセスマスタから受け取った複数の前記転送予約情報に対して算出された前記アクセス間隔が予め設定された第1の閾値以下であり、かつ、前記転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスの内、最も小さい先頭アドレスと、その次に小さい先頭アドレスとの差分が予め設定された第2の閾値以上である場合には、前記転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスが最も小さい転送予約情報を、最優先の転送予約情報と決定すること
     を特徴とする請求項8又は9に記載のキャッシュメモリコントローラ。
  13.  前記データ処理部は、前記アクセスマスタから受け取った複数の前記転送予約情報に対して算出された前記アクセス間隔が第1の閾値以上である場合には、最優先の転送予約命令を決定せず、前記アクセスマスタから受け取った複数の前記転送予約情報に対して再度算出されたアクセス間隔が前記第1の閾値以下となるまで処理を待機すること
    を特徴とする請求項8又は9に記載のキャッシュメモリコントローラ。
  14.  前記データ処理部は、決定された前記最優先の転送予約情報に従って転送される連続領域のうち、予め設定された転送単位サイズの転送を完了する毎に、再度、最優先の転送予約情報を決定すること
     を特徴とする請求項8から13の何れか1項に記載のキャッシュメモリコントローラ。
  15.  前記データ処理部は、前記アクセスマスタで実行中の命令のアドレスが進む度に、前記最優先の転送予約情報を決定すること
     を特徴とする請求項8から14の何れか1項に記載のキャッシュメモリコントローラ。
  16.  前記データ処理部は、決定された前記最優先の転送予約情報で示された、連続領域に記憶されている全てのデータの転送が完了する毎に、再度、最優先の転送予約情報を決定すること
     を特徴とする請求項8から15の何れか1項に記載のキャッシュメモリコントローラ。
  17.  前記データ処理部は、前記アクセスマスタから受け取った命令コマンドに添付されているアドレスに基づいて前記転送予約情報であることを判断し、前記転送予約情報に従って、前記アクセスマスタが前記特定の命令を実行する前に、前記特定の命令で利用されるデータを前記メインメモリから前記キャッシュメモリに転送すること
     を特徴とする請求項2から16の何れか1項に記載のキャッシュメモリコントローラ。
  18.  前記データ処理部は、前記転送予約情報に従って転送する連続領域のデータが前記キャッシュメモリに格納されている場合には、当該データを前記キャッシュメモリから開放しないこと
     を特徴とする請求項2から17の何れか1項に記載のキャッシュメモリコントローラ。
  19.  第1のプログラムを格納する命令領域及び当該第1のプログラムに含まれる特定の命令で利用されるデータを格納するデータ領域を有するメインメモリから、前記第1のプログラムに含まれている命令を実行するアクセスマスタに、キャッシュメモリを用いて前記特定の命令で利用されるデータを提供するキャッシュメモリコントロール方法であって、
     前記特定の命令の先頭アドレスを含む転送予約情報に従って、前記アクセスマスタが前記特定の命令を実行する前に、前記アクセスマスタで実行中の命令のアドレスから前記特定の命令の先頭アドレスまでの残りの命令ステップ数に基づいてアクセス間隔を算出し、前記アクセス間隔で、前記特定の命令で利用されるデータを前記メインメモリから前記キャッシュメモリに転送する転送過程と、
     前記アクセスマスタが前記特定の命令を実行する際に、前記キャッシュメモリから前記特定の命令で利用されるデータを前記アクセスマスタに提供する提供過程と、を有すること
     を特徴とするキャッシュメモリコントロール方法。
  20.  前記第1のプログラムは、前記特定の命令の先頭アドレスを有する第1の転送予約命令を含み、
     前記アクセスマスタが前記特定の命令よりも先に前記第1の転送予約命令を実行することで、前記転送過程は、前記アクセスマスタから前記転送予約情報を取得し、前記アクセスマスタが前記特定の命令を実行する前に、前記特定の命令で利用されるデータを前記メインメモリから前記キャッシュメモリに転送すること
     を特徴とする請求項19に記載のキャッシュメモリコントロール方法。
  21.  前記転送過程は、前記アクセスマスタで実行中の命令のアドレスが更新される毎に、前記アクセス間隔を算出すること
     を特徴とする請求項20に記載のキャッシュメモリコントロール方法。
  22.  前記第1の転送予約命令に従って前記キャッシュメモリに格納されたデータの内、前記アクセスマスタからアクセスされていない時間が最も長く、かつ、前記アクセスマスタが1回以上アクセスしたことのあるデータを、前記キャッシュメモリから開放する開放過程をさらに有すること
     を特徴とする請求項20又は21に記載のキャッシュメモリコントロール方法。
  23.  前記第1の転送予約命令を示すコードを含む第2のプログラムを、前記第1のプログラムに変換するプログラム変換過程をさらに有すること
     を特徴とする請求項20から22の何れか1項に記載のキャッシュメモリコントロール方法。
  24.  前記特定の命令を示すコードを含む第2のプログラムを、前記第1のプログラムに変換するプログラム変換過程をさらに有し、
     前記プログラム変換過程は、前記特定の命令を示すコードを解析して前記第1の転送予約命令を生成すること
     を特徴とする請求項20から22の何れか1項に記載のキャッシュメモリコントロール方法。
  25.  前記転送過程は、前記第1のプログラムを解析することにより、前記転送予約情報を生成し、前記アクセスマスタが前記特定の命令を実行する前に、前記生成された転送予約情報に従って、前記特定の命令で利用されるデータを前記メインメモリから前記キャッシュメモリに転送すること
     を特徴とする請求項19に記載のキャッシュメモリコントロール方法。
  26.  前記転送過程は、前記アクセスマスタから受け取った複数の前記転送予約情報のうち、前記アクセス間隔に基づいて、最優先の転送予約情報を決定すること
     を特徴とする請求項20から25の何れか1項に記載のキャッシュメモリコントロール方法。
  27.  前記転送過程は、前記アクセスマスタから受け取った複数の前記転送予約情報のうち、前記アクセス間隔と、前記アクセスマスタから前記メインメモリにおいて予め定められた複数の連続領域の各々へアクセスしていない経過時間であるアクセス経過時間とに基づいて、最優先の転送予約情報を決定すること
     を特徴とする請求項20から25の何れか1項に記載のキャッシュメモリコントロール方法。
  28.  前記転送過程は、前記アクセスマスタから受け取った複数の前記転送予約情報のうち、前記アクセス間隔が最も小さい転送予約命令を、最優先の転送予約情報と決定すること
     を特徴とする請求項26又は27に記載のキャッシュメモリコントロール方法。
  29.  前記転送過程は、前記アクセスマスタから受け取った複数の前記転送予約情報に対して算出された前記アクセス間隔が全て同程度である場合には、
     前記アクセス経過時間が最も長い連続領域に格納されているデータにアクセスする転送予約情報を、最優先の転送予約情報と決定すること
     を特徴とする請求項26又は27に記載のキャッシュメモリコントロール方法。
  30.  前記転送過程は、前記アクセスマスタから受け取った複数の前記転送予約情報に対して算出された前記アクセス間隔が予め設定された第1の閾値以下であり、かつ、前記転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスの内、最も小さい先頭アドレスと、その次に小さい先頭アドレスとの差分が予め設定された第2の閾値以上である場合には、前記転送するデータが記憶されている連続領域を参照する命令群の先頭アドレスが最も小さい転送予約情報を、最優先の転送予約情報と決定すること
     を特徴とする請求項26又は27に記載のキャッシュメモリコントロール方法。
  31.  前記転送過程は、前記アクセスマスタから受け取った複数の前記転送予約情報に対して算出された前記アクセス間隔が第1の閾値以上である場合には、最優先の転送予約情報を決定せず、前記アクセスマスタから受け取った複数の前記転送予約情報に対して再度算出されたアクセス間隔が前記第1の閾値以下となるまで処理を待機すること
     を特徴とする請求項26又は27に記載のキャッシュメモリコントロール方法。
  32.  前記転送過程は、決定された前記最優先の転送予約情報に従って転送される連続領域のうち、予め設定された転送単位サイズの転送を完了する毎に、再度、最優先の転送予約情報を決定すること
     を特徴とする請求項26から31の何れか1項に記載のキャッシュメモリコントロール方法。
  33.  前記転送過程は、前記アクセスマスタで実行中の命令のアドレスが進む度に、最優先の転送予約情報を決定すること
     を特徴とする請求項26から32の何れか1項に記載のキャッシュメモリコントロール方法。
  34.  前記転送過程は、決定された前記最優先の転送予約情報で示された、連続領域に記憶されている全てのデータの転送が完了すると、再度、最優先の転送予約情報を決定すること
     を特徴とする請求項26から33の何れか1項に記載のキャッシュメモリコントロール方法。
  35.  前記転送過程は、前記アクセスマスタから受け取った命令コマンドに添付されているアドレスに基づいて前記転送予約情報であることを判断し、前記転送予約情報に従って、前記アクセスマスタが前記特定の命令を実行する前に、前記特定の命令で利用されるデータを前記メインメモリから前記キャッシュメモリに転送すること
     を特徴とする請求項20から34の何れか1項に記載のキャッシュメモリコントロール方法。
  36.  前記転送過程は、前記転送予約情報に従って転送する連続領域のデータが前記キャッシュメモリに格納されている場合には、当該データを前記キャッシュメモリから開放しないこと
     を特徴とする請求項20から35の何れか1項に記載のキャッシュメモリコントロール方法。
PCT/JP2013/061244 2012-08-22 2013-04-16 キャッシュメモリコントローラ及びキャッシュメモリコントロール方法 WO2014030387A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2014531518A JP5808495B2 (ja) 2012-08-22 2013-04-16 キャッシュメモリコントローラ及びキャッシュメモリコントロール方法
US14/411,709 US20150234747A1 (en) 2012-08-22 2013-04-16 Cache memory controller and cache memory control method
CN201380041056.5A CN104508640A (zh) 2012-08-22 2013-04-16 高速缓冲存储器控制器和高速缓冲存储器控制方法
DE112013004110.3T DE112013004110T5 (de) 2012-08-22 2013-04-16 Cache-speichersteuerung und cache-speichersteuerverfahren

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2012183338 2012-08-22
JP2012-183338 2012-08-22

Publications (1)

Publication Number Publication Date
WO2014030387A1 true WO2014030387A1 (ja) 2014-02-27

Family

ID=50149707

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2013/061244 WO2014030387A1 (ja) 2012-08-22 2013-04-16 キャッシュメモリコントローラ及びキャッシュメモリコントロール方法

Country Status (5)

Country Link
US (1) US20150234747A1 (ja)
JP (1) JP5808495B2 (ja)
CN (1) CN104508640A (ja)
DE (1) DE112013004110T5 (ja)
WO (1) WO2014030387A1 (ja)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9355689B2 (en) * 2013-08-20 2016-05-31 Oracle International Corporation Detection of multiple accesses to a row address of a dynamic memory within a refresh period
US10152352B2 (en) * 2015-11-17 2018-12-11 Friday Harbor Llc Writing to contiguous memory addresses in a network on a chip architecture
CN111033476B (zh) * 2017-08-30 2023-08-01 奥林巴斯株式会社 存储器访问装置、图像处理装置和摄像装置
US11188474B2 (en) * 2018-06-19 2021-11-30 Western Digital Technologies, Inc. Balanced caching between a cache and a non-volatile memory based on rates corresponding to the cache and the non-volatile memory
JP2021196681A (ja) * 2020-06-10 2021-12-27 ルネサスエレクトロニクス株式会社 半導体装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003223359A (ja) * 2002-01-29 2003-08-08 Fujitsu Ltd 演算処理装置
JP2004348175A (ja) * 2003-05-14 2004-12-09 Sony Computer Entertainment Inc プリフェッチ命令制御方法、プリフェッチ命令制御装置、およびキャッシュメモリ制御装置
WO2005078579A1 (ja) * 2004-02-12 2005-08-25 Matsushita Electric Industrial Co., Ltd. プログラム変換装置およびプログラム変換方法
JP2008269450A (ja) * 2007-04-24 2008-11-06 Fujitsu Ltd プロセッサ及びプリフェッチ制御方法
JP2009157414A (ja) * 2007-12-25 2009-07-16 Hitachi Ltd 記憶装置、情報端末装置及びデータ先読み方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2514115B2 (ja) * 1991-02-15 1996-07-10 株式会社グラフィックス・コミュニケーション・テクノロジーズ 画像信号符号化装置
JPH10301848A (ja) * 1997-04-28 1998-11-13 Hitachi Ltd 多重ページサイズを有する仮想記憶装置
JP4374221B2 (ja) * 2003-08-29 2009-12-02 パナソニック株式会社 コンピュータシステムおよび記録媒体
US8966121B2 (en) * 2008-03-03 2015-02-24 Microsoft Corporation Client-side management of domain name information
CN102014158B (zh) * 2010-11-29 2013-07-10 北京兴宇中科科技开发股份有限公司 一种云存储服务客户端高效细粒度数据缓存系统与方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003223359A (ja) * 2002-01-29 2003-08-08 Fujitsu Ltd 演算処理装置
JP2004348175A (ja) * 2003-05-14 2004-12-09 Sony Computer Entertainment Inc プリフェッチ命令制御方法、プリフェッチ命令制御装置、およびキャッシュメモリ制御装置
WO2005078579A1 (ja) * 2004-02-12 2005-08-25 Matsushita Electric Industrial Co., Ltd. プログラム変換装置およびプログラム変換方法
JP2008269450A (ja) * 2007-04-24 2008-11-06 Fujitsu Ltd プロセッサ及びプリフェッチ制御方法
JP2009157414A (ja) * 2007-12-25 2009-07-16 Hitachi Ltd 記憶装置、情報端末装置及びデータ先読み方法

Also Published As

Publication number Publication date
CN104508640A (zh) 2015-04-08
JPWO2014030387A1 (ja) 2016-07-28
JP5808495B2 (ja) 2015-11-10
US20150234747A1 (en) 2015-08-20
DE112013004110T5 (de) 2015-05-28

Similar Documents

Publication Publication Date Title
US6978350B2 (en) Methods and apparatus for improving throughput of cache-based embedded processors
CA2680601C (en) Managing multiple speculative assist threads at differing cache levels
KR101753913B1 (ko) 기계 비전 알고리즘을 위한 멀티프로세서 시스템온칩
US8583894B2 (en) Hybrid prefetch method and apparatus
JP5808495B2 (ja) キャッシュメモリコントローラ及びキャッシュメモリコントロール方法
JP4064924B2 (ja) メモリアクセスを制御する方法及び装置
US7870307B2 (en) DMA and graphics interface emulation
US8255591B2 (en) Method and system for managing cache injection in a multiprocessor system
CN103365794B (zh) 数据处理方法、装置和系统
US20080189522A1 (en) Method and Apparatus for Enabling Resource Allocation Identification at the Instruction Level in a Processor System
US11157411B2 (en) Information handling system with immediate scheduling of load operations
JPH08194615A (ja) 情報処理装置
TW201401168A (zh) 資料預取器以及預取資料至快取記憶體的方法
TWI514156B (zh) 推測式快取修改技術
US20160357559A1 (en) Systems and methods for load canceling in a processor that is connected to an external interconnect fabric
US8195880B2 (en) Information handling system with immediate scheduling of load operations in a dual-bank cache with dual dispatch into write/read data flow
WO2009054959A1 (en) Coherent dram prefetcher
JP2002251321A (ja) キャッシュメモリシステム装置
JP2006119796A (ja) キャッシュメモリシステムおよび動画処理装置
US6892280B2 (en) Multiprocessor system having distributed shared memory and instruction scheduling method used in the same system
US8140765B2 (en) Information handling system with immediate scheduling of load operations in a dual-bank cache with single dispatch into write/read data flow
US8140756B2 (en) Information handling system with immediate scheduling of load operations and fine-grained access to cache memory
US11474946B2 (en) Calculator and calculation method
US20060224832A1 (en) System and method for performing a prefetch operation
JP2008015668A (ja) タスク管理装置

Legal Events

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

Ref document number: 13830676

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2014531518

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 1120130041103

Country of ref document: DE

Ref document number: 112013004110

Country of ref document: DE

WWE Wipo information: entry into national phase

Ref document number: 14411709

Country of ref document: US

122 Ep: pct application non-entry in european phase

Ref document number: 13830676

Country of ref document: EP

Kind code of ref document: A1