WO2011077549A1 - 演算処理装置 - Google Patents

演算処理装置 Download PDF

Info

Publication number
WO2011077549A1
WO2011077549A1 PCT/JP2009/071594 JP2009071594W WO2011077549A1 WO 2011077549 A1 WO2011077549 A1 WO 2011077549A1 JP 2009071594 W JP2009071594 W JP 2009071594W WO 2011077549 A1 WO2011077549 A1 WO 2011077549A1
Authority
WO
WIPO (PCT)
Prior art keywords
instruction
pipeline
data
unit
cache
Prior art date
Application number
PCT/JP2009/071594
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 JP2011547161A priority Critical patent/JP5482801B2/ja
Priority to CN200980163061.7A priority patent/CN102687128B/zh
Priority to PCT/JP2009/071594 priority patent/WO2011077549A1/ja
Priority to EP09852565.2A priority patent/EP2518632A4/en
Priority to KR1020127016301A priority patent/KR101402560B1/ko
Publication of WO2011077549A1 publication Critical patent/WO2011077549A1/ja
Priority to US13/528,153 priority patent/US20120260056A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0862Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with prefetch
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • G06F9/30043LOAD or STORE instructions; Clear instruction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • G06F9/30047Prefetch instructions; cache control instructions
    • 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 an arithmetic processing device.
  • the processor has a plurality of pipelines (an instruction control pipeline, an arithmetic pipeline, a branch control pipeline, etc.) that realize the function.
  • Each pipeline is divided into a plurality of stages.
  • Each stage includes a circuit unit that realizes a predetermined process, and operates so as to end the predetermined process assigned to each stage within a period called a cycle time that is the reciprocal of the operating frequency.
  • the output signal of the stage related to the previous process is used as the input signal of the stage related to the subsequent process, for example.
  • the processor is equipped with a small-capacity high-speed memory called a cache memory in order to shorten the access time from the processor to the main storage device.
  • the cache memory is arranged in a higher hierarchy of the main storage device and holds a part of data stored in the main storage device.
  • the cache memory is located closer to the processor than the main storage device, such as built in the processor. Therefore, when the processor accesses data loaded in the cache memory (hereinafter referred to as “cache hit”), the processor can access the target data in a short time.
  • cache miss when the processor accesses data not loaded in the cache memory (hereinafter referred to as “cache miss”), the data is read from the memory in the lower hierarchy of the cache memory, so the access time to the target data is long. Become. Therefore, in order to prevent cache misses, the memory controller of the cache memory keeps data that is accessed frequently from the processor in the cache memory and drives data that is accessed less frequently from the cache memory to the lower-level memory. To do.
  • the processor has an arithmetic unit that executes arithmetic processing and a register that holds data received from the cache memory by the arithmetic unit.
  • the register is, for example, a storage device that is arranged in an upper layer of the cache memory and is smaller in quantity and faster than the cache memory.
  • the operation unit outputs a prefetch instruction for loading data from the main storage device to the cache memory to the memory controller based on the load instruction before issuing a load instruction for loading data from the cache memory to the register. Since the arithmetic unit outputs a prefetch instruction to the memory controller prior to the load instruction, a cache miss does not occur when the arithmetic unit loads data from the cache memory, thereby reducing the data access time.
  • the arithmetic unit once reads data from the cache memory to the register and then performs various processes.
  • the data capacity held in one cache line of the cache memory is larger than the data capacity held in the register. For example, a single cache line holds a plurality of data specified by addresses.
  • the load instruction is not an instruction for loading all the data held in one cache line of the cache memory into the register, but an instruction for loading data specified by the address unit from the cache line into the register.
  • the load instruction issued to the register by the arithmetic unit is an instruction for loading data into the register in units of one address, whereas the prefetch instruction corresponds to a load from the main storage device to the cache memory. This is an instruction to load data. Therefore, for example, when two load instructions are issued for addresses held in one cache line, two prefetch instructions generated based on the two load instructions are data held in the same cache line. Is read from the main memory twice.
  • the cache hit determination is executed by pipeline processing in a cache controller (different from the memory controller in FIG. 1, the first pipeline in FIG. 1). If a prefetch instruction is output even after data is loaded from the main memory into the cache memory, the cache controller performs a cache hit determination. Even if data is stored in the cache memory, if multiple prefetch instructions are issued for the stored data, execution of another store instruction or load instruction will occur in pipeline processing, resulting in access time to the main memory device. Is extended.
  • the disclosed arithmetic processing device aims to shorten the access time to the main storage device.
  • the disclosed arithmetic processing apparatus is an arithmetic processing apparatus connected to a main storage device, and includes a first storage unit that stores a part of data stored in the main storage device, and data stored in the main storage device And an arithmetic processing unit that outputs an instruction to be stored in the first storage unit and a second memory that receives the instruction and stores the instruction until the first storage unit receives the target data of the instruction from the main storage device And when the target data of the instruction is stored in the first storage unit, the target data is read from the first storage unit and output to the arithmetic processing unit.
  • a first control unit that outputs an instruction to the main storage device when the target data is not stored in the first storage unit and an instruction that targets the same data as the target data of the instruction is not in the second storage unit;
  • an instruction is received from the arithmetic processing unit
  • a second control unit that completes the process of reading the target data from the main storage device by the instruction; Have.
  • the disclosed arithmetic processing device has an effect of shortening the access time to the main storage device.
  • FIG. 1 is a diagram illustrating an example of a hardware configuration of an arithmetic processing device.
  • An arithmetic processing unit 100 shown in FIG. 1 includes a processor core 10 serving as an arithmetic processing unit, an L2 cache controller 90, an L2 tag RAM (Level-2 Tag Random Access Memory) 140, and L2. It has a data RAM (Level-2 Data Random Access Memory) 120, a load buffer (LB) 160, and a memory controller (MC, Memory Controller) 200.
  • the arithmetic processing unit 100 may include a hit buffer (HB) 170 as shown in FIG.
  • the processor core 10 is connected to the main storage device 220 via the MC 200.
  • L2 cache RAM 110 The L2 data RAM 120 and the L2 tag RAM 140 are collectively referred to as “L2 cache RAM 110” in this specification. 1 is provided with a data input buffer 32 and a data output buffer 34.
  • the data input buffer 32 is used for buffering data read from the main storage device 22 or the L2 cache RAM 110 and input to the processor core 10.
  • the data output buffer 34 is used for buffering data output from the processor core 10.
  • the data buffered in the data output buffer 34 is transferred to the L2 cache RAM 110 or the main storage device 22.
  • FIG. 2 is a diagram illustrating an example of a configuration of a processor core.
  • the processor core 10 includes an instruction unit (IU: Instruction Unit) 12, an execution unit (EU: Execution Unit) 14, an L1 cache controller 18, and an L1 cache RAM 16 (Level-1 Cache Random Access Memory).
  • the L1 cache RAM 16 holds instructions and data.
  • the L1 cache controller 18 controls access to the L1 cache RAM 16.
  • the number of processor cores shown in FIG. 1 is one, the number of processor cores is not limited to the number shown in FIG. 1, and the arithmetic processing unit 100 may have a plurality of processor cores. Good.
  • the instruction unit 12 decodes an instruction read from the L1 cache RAM 16 via the instruction pipeline 15 and outputs the decoded instruction to the execution unit 14 via the instruction pipeline 15. For example, the instruction unit 12 supplies a “load instruction” or a “store instruction” (“load instruction etc.” in the figure) to the L1 cache controller 18 via the instruction pipeline 15. For example, when the instruction supplied from the instruction unit 12 to the L1 cache controller 18 is a “load instruction”, the L1 cache controller 18 reads the instruction specified by the “load instruction” from the L1 cache RAM 16. The instruction read from the L1 cache RAM 16 by the “load instruction” is supplied to the instruction unit 12.
  • the instruction read from the L1 cache RAM 16 is, for example, a data transfer instruction or an arithmetic operation instruction.
  • the data transfer instructions are, for example, instructions including a load (LD) instruction to the L1 cache RAM 16, a store (ST) instruction, a prefetch (PF) instruction, and a replacement (MO) instruction.
  • the instruction unit 12 decodes the instruction read from the L1 cache RAM 16, stores the decoded instruction (D instruction shown in FIG. 2), the register 13 for storing the operand used for executing the instruction, and the result of the instruction execution.
  • a register address specifying the register 13 is supplied to the execution unit 14 through the instruction pipeline 15 as “data”.
  • the execution unit 14 extracts the operand from the register 13 specified by the register address, and calculates the operand with the instruction decoded by the instruction unit 12.
  • the execution unit 14 When the instruction to be executed is a data transfer instruction, the execution unit 14 generates a virtual address from the value of a register as an operand, for example.
  • the execution unit 14 sends, for example, a load instruction, a store instruction, or a PF instruction (“load instruction etc.” in the figure) via the instruction pipeline 15 together with the target virtual address. This is supplied to the cache controller 18.
  • the execution unit 14 supplies the operation result to the instruction pipeline 15, and the operation result is stored in the L1 cache RAM 16 via the instruction pipeline 15.
  • the L1 cache RAM 16 includes a translation lookaside buffer (TLB), an L1 tag RAM, and an L1 data RAM (not shown).
  • the L1 cache controller 18 identifies the line of the L1 cache RAM 16 with the virtual address supplied from the execution unit 14, and compares the physical address (PA: Physical Address) read from each line of the TLB and the L1 cache RAM 16 with the virtual address. Thus, a cache miss or a cache hit is determined.
  • TLB translation lookaside buffer
  • PA Physical Address
  • processor core L1 cache controller
  • L1 cache controller When a cache miss occurs in the L1 cache RAM 16, the L1 cache controller 18 outputs an LD instruction or a PF instruction to the L2 cache controller 90. Then, the processor core 10 receives, for example, data based on the LD instruction or a completion notification of the PF instruction from the L2 cache controller 90.
  • FIG. 3 is a diagram illustrating an example of a configuration of a register and an L2 cache RAM targeted by an LD instruction or a PF instruction.
  • the register 13a shown in FIG. 3 is an example of a storage area of the register 13 shown in FIG.
  • the register 13a has, for example, a plurality of registers specified by addresses R0 to R15.
  • the storage capacity of the register corresponding to one address of the register 13a is 8 bytes in the example of FIG.
  • FIG. 3 shows a configuration of information stored in the L1 cache RAM 16.
  • A0 (i), A1 (i)... Shown in FIG. 3 indicate addresses of the L1 cache RAM.
  • One unit of the information 16a is 8 bytes in the example of FIG.
  • the execution unit 14 loads the information 16a stored in the L1 cache RAM 16 into the register 13a in units of 8 bytes.
  • the cache line 111a shown in FIG. 3 is a cache line of the L2 data RAM 120 shown in FIG.
  • the storage capacity of one cache line of the L2 data RAM 120 is 128 bytes in the example of FIG. In the example shown in FIG. 3, since the storage capacity of one register is 8 bytes, one cache line can store data for 16 registers.
  • one cache line is divided into 32-byte information such as A0 (i + M), A0 (i + M) + 32B, A0 (i + M) + 64B.
  • the execution unit 14 prefetches data to be loaded by the LD instruction into the L2 cache RAM 110 in advance by executing the program.
  • the data to be stored in the register 13a by the LD instruction is prefetched to the cache line of the L2 cache RAM 110 in units of 128 bytes, the data for the registers of the addresses R0 to R15 is stored in the cache line 111a by one prefetch. can do.
  • the following program A is an example of a program including an LD instruction and a PF instruction.
  • S0 Load data at address A0 (0) and store in R4;
  • S1 Load data at address A1 (0) and store in R5;
  • S2 Load data at address A2 (0) and store in R6;
  • S3 Load data at address A3 (0) and store in R7;
  • S5 R4 data loaded from address A0 (i) one loop before is moved to R0;
  • S6 Move R5 data loaded from address A1 (i) one loop before to R1;
  • S7 Move R6 data loaded from address A2 (i) one loop before to R2;
  • S8 R7 data loaded from address A3 (i) one loop before is moved to R3;
  • S9 Pref
  • Program A is a program that executes an LD instruction by loop processing, executes arithmetic processing on data stored in a register by the LD instruction, and stores an arithmetic processing result in the register.
  • the program A performs a process of continuously referring to data in a certain continuous address space, performing an operation using the referenced data, and continuously storing the operation result in another address area.
  • This address space is normally accessed as a virtual address (VA) from the program.
  • VA virtual address
  • the virtual address is converted into a physical address (PA) by MMU (TLB), and the L2 cache is accessed by the PA.
  • PA physical address
  • TLB MMU
  • the L2 cache is accessed by the PA.
  • the cost of memory has decreased significantly, and there is a situation where a relatively large page size such as 4 MB is adopted with emphasis on performance rather than memory usage efficiency. It is in a situation where there is no problem even assuming that it is.
  • the address to be referred to by the program is A0 (0), A1 (0), A2 (0), A3 (0), A0 (1), A1 (1), A2 (1), A3 (1 ),. . . , A0 (N), A1 (N), and A2 (N).
  • these addresses are arranged at regular intervals (8-byte intervals) as follows.
  • steps S4 to S17 loop processing is defined.
  • steps S5 to S8 a process is defined in which data loaded from addresses A0 (i) to A3 (i) and stored in registers R4 to R7 one loop before is moved to registers R0 to R3.
  • an LD instruction that loads data at addresses A0 (i + 1) to A3 (i + 1) and stores them in registers R4 to R7 is defined.
  • step S9 the data of the address A0 (i + M) ahead of the M loop is prefetched from the main storage device 220 to the L2 cache RAM 110.
  • the prefetch instruction is an instruction that predicts the data that is the target of the LD instruction and loads it from the main storage device 220 to the L2 cache RAM 110.
  • step S9 the data at the address predicted to be loaded and stored M ahead in the loop processing (S4 to S17) is prefetched. M is determined by Equation 1 below.
  • T1 Time to execute loop processing once (number of clock cycles)
  • T2 Time from issuance of PF instruction until data is stored in L2 cache (number of clock cycles)
  • Equation 1 By selecting a sufficiently large value satisfying Equation 1 as M, the effect of prefetching to conceal the access time to the main storage device 220 is maximized.
  • prefetch instructions PF1 to PF4 are issued redundantly to the same 128B cache line as indicated by the cache line 111a in FIG.
  • one prefetch is effective for one cache line, that is, the entire 128-byte line, as a result, three extra prefetches are performed.
  • the creator of the program must first know the line size of the cache line (128B in the example shown in FIG. 3). Assuming that the line size is known, if prefetching is performed in units of one line, that is, 128 bytes, in a situation where 32 bytes of data is loaded in one loop, the remainder obtained by dividing the loop variable i by 4 in the loop. By considering the correspondence of adding an instruction that issues a prefetch only when is 0, it is possible to issue a prefetch instruction once every four loops. However, since such an instruction has to add a calculation for a remainder or a conditional branch instruction in the loop, the execution efficiency of the instruction is lower than when the PF instruction is executed for each loop.
  • Step S10 is a store prefetch.
  • Address A4 (i + M) indicates a store address.
  • the addresses for storing the calculation results are A4 (0), A4 (1),. . . , A4 (N). Further, it is assumed that the store address is set at the following intervals.
  • Address A4 (i) A0 (i) + 0B
  • Address A4 (i + 1) A0 (i) + 8B
  • the operation result is stored continuously from the address A4 (i).
  • address A4 (i + 16) 16 cycles ahead is A4 (i) + 128B, and the cache line 128B is accessed in 16 loops.
  • Address A0 (i + 2 + M) A0 (I + M) + 16B ⁇ ⁇ ⁇
  • the address may be set in units of 8 bytes, and data is written to one register in one loop. Therefore, as shown in FIG. 3, in the case of storing into an 8-byte register, a store process in units of 8 bytes is executed in one loop. On the other hand, the store prefetch (S10) is also executed once in one loop. As shown in the cache line 111a in FIG. 3, since one cache line of the L2 data RAM has a data capacity of 128B, if the prefetch unit is 128 bytes, the data capacity of 128B can be increased by executing one PF instruction. 220 is loaded.
  • the prefetch instruction is issued an extra 15 times compared to the case where the prefetch size is 128B.
  • S18 to S23 show processing for moving data loaded from addresses A0 (N) to A3 (N) and stored in registers R4 to R7 to registers R0 to R3.
  • the data moved to the registers R0 to R3 in S23 is calculated with reference to S24, and the calculation result is stored in the register R8.
  • the calculation result of S24 is stored in store address A4 (N) in S25.
  • FIG. 4 is a diagram illustrating an example of an L2 cache RAM that is not divided into banks.
  • the L2 cache RAM 110 shown in FIG. 4 is, for example, a 4-way set associative cache memory. As shown in FIG. 4, the L2 cache RAM 110 includes a plurality of sets, and each set is managed by being divided into cache ways 101a to 101d.
  • the L2 cache RAM 110 shown in FIG. 4 manages the data held by the L2 cache RAM 110 in units of cache lines 103-1 to 103-n.
  • Reference numeral 30 shown in FIG. 4 indicates a request instruction output from the processor core.
  • the request instruction 30 is 47 bits, for example, with the upper 28 bits (46-19 + 1 bits) being the tag address of the physical address and the upper 18 to 7 bits 12 bits (18-7 + 1 bit) being the physical address.
  • the index address (IA: Index Address) the lower 7 bits are an address indicating somewhere within 128 bytes of one line of the physical address.
  • Each cache line is specified by, for example, a PA (physical address) obtained by converting the VA (virtual address) included in the LD instruction or PF instruction from the processor core 10 by the L1 cache controller.
  • the L2 cache RAM 110 includes an L2 tag RAM 140, an L2 data RAM 120, write amplifiers 123a to 123d, 143a to 143d, sense amplifiers 124a to 124d, 144a to 134d, comparison circuits 131a to 131d, and selection circuits 121, 122, 141, 142. .
  • Each of the L2 tag RAM 140 and the L2 data RAM 120 has a plurality of entries corresponding to the cache lines 103-1 to 103-n.
  • Each entry of the L2 tag RAM 140 holds a part of a physical address called “tag”.
  • the “tag” corresponds to the tag address of the request command 30 shown in FIG. Since the L2 cache RAM 110 illustrated in FIG. 4 has four ways, the association degree is “4”.
  • the L2 cache RAM 110 also includes a selection circuit 130.
  • the selection circuit 130 receives the output from the L2 data RAM 120 via the sense amplifiers 124a to 124d, and selects one of the inputs according to the value of the hit way signal output from the comparison circuits 131a to 131d. Output.
  • Each entry of the L2 data RAM 120 holds “data” specified by the “tag” of the L2 tag RAM 140.
  • the index address IA is supplied to the L2 tag RAM 140. Then, the entry of each way 101a to 101d corresponding to the supplied index address, that is, the tag address is output to the comparison circuits 131a to 131d corresponding to each way.
  • the comparison circuits 131a to 131d are circuits that determine a cache miss or a cache hit by comparing the tag address PA transmitted from the processor core 10 with the tag address read from the L2 tag RAM 140, respectively.
  • the comparison circuits 131a to 131d are associated with the cache ways 101a to 101d, respectively. Only the output of the comparison circuit corresponding to the way in which the tag match is detected, in other words, the way that hits the cache, becomes 1, and the outputs of the other comparison circuits become 0. As a result, the comparison circuits 131a to 131d output a 4-bit hit way signal to the selection circuit 130 in which the bit corresponding to the cache hit way becomes “1”. In the case of a cache miss, an operation for acquiring data from a physical address on the main storage device is performed.
  • the data values of the four cache lines corresponding to each cache way are selected from the cache lines of the L2 data RAM 120 specified by IA. Is read out. Then, the selection circuit 130 selects and outputs a data value corresponding to the way indicated by the hit way signal based on the hit way signal output from the comparison circuits 131a to 131d.
  • FIG. 5 is a diagram illustrating an example of the banked L2 cache RAM.
  • the L2 cache RAMs 110a and 110b shown in FIG. 5 have the same configuration as the L2 cache RAM 110 shown in FIG. In the example shown in FIG. 4, the line of the L2 cache RAM is specified by the 12-bit index address. However, the L2 cache RAMs 110a and 110b shown in FIG. Divided. In the example of FIG. 5, the L2 cache RAM 110a stores data specified by the index address whose least significant bit is “0”, and the L2 cache RAM 110b stores data specified by the index address whose least significant bit is “1”. Is stored.
  • the L2 cache RAMs 110a and 110b each have half the data of the L2 cache RAM 110 shown in FIG.
  • the selection circuits 131-1a to 131-1d receive the cache line data of each of the L2 cache RAMs 110a and 110b specified by the index address and the least significant bit (IA [7]) of the index address. Then, the selection circuit 131 selects and outputs the output data of the L2 cache RAM corresponding to the least significant bit of the index address.
  • the L2 cache controller 90 shown in FIG. 1 includes an MO port (Move-OutPort) 63, an LD (Load) port 64, a PF (Prefetch) port 66, a pipeline selection unit 60, a first priority control circuit 61, and a second priority.
  • a control circuit 62 is included.
  • the first priority control circuit 61 receives a replacement instruction from the MO port 63, a load instruction from the LD port 64, and a prefetch instruction from the PF port 66.
  • each command output from each core is input to the first priority control circuit 61.
  • the first priority control circuit 61 makes a selection based on the input request type and fixed priority. As an example of the priority, load instructions> replacement instructions> prefetch instructions are in this order. By setting the priority in this way, it becomes possible to prevent deadlock and live lock.
  • the L2 cache controller 90 further includes a first pipeline 70 and a second pipeline 80.
  • the second pipeline 80 is a pipeline provided only for prefetch processing, more specifically, for detecting coincidence between an address held by the LB 160 and an address corresponding to a prefetch request.
  • MO port 63, the LD port 64, and the PF port 66 are provided corresponding to the processor core 10, and there are as many as the number of processor cores 10. Therefore, when there are a plurality of processor cores 10, MO ports 63, LD ports 64, and PF ports 66 corresponding to the number of processor cores are prepared.
  • the MO port 63 receives and holds the L1 replacement instruction (“replacement instruction” in the figure) from the processor core 10, and when the L1 replacement instruction is selected by the first priority control circuit 61, the L1 replacement instruction is sent to the first pipe. Output to line 70.
  • the LD port 64 receives and holds an LD instruction (illustrated “load instruction”) from the processor core 10, and when the LD instruction is selected by the first priority control circuit 61, the LD instruction is input to the first pipeline 70. Output.
  • load instruction illustrated “load instruction”
  • the PF port 66 receives and holds a PF instruction (“prefetch instruction” in the figure) from the processor core, and also controls the first priority control selected by the pipeline selection unit 60 in the first pipeline 70 and the second pipeline 80.
  • a PF command is output via the circuit 61 and the second priority control circuit 62.
  • An example of the PF port 66 will be described later with reference to FIGS. 9A and 9B.
  • the MO port 63, the LD port 64, and the PF port 66 add (+1) (increment) to the current pointer value by an instruction notification from the processor core 10 in order to prevent an overflow of the instruction from the processor core 10. Then, 1 is subtracted from the current pointer value in the release notification to the processor core 10 ( ⁇ 1) It has a resource counter, and the instruction issue is restricted so that the resource counter does not exceed the number of entries.
  • the MO port 63, the LD port 64, and the PF port 66 issue a release notification to the L1 cache controller 18.
  • FIG. 6 shows the L2 cache controller 90, and more particularly shows details of an example of the PF port.
  • the PF port 66 includes an entry selection unit 66-1, an empty entry selection unit 66-2, a PF storage circuit 66-3, and a decoder 66-4.
  • the PF memory circuit 66-3 is a circuit for holding a PF instruction.
  • the valid bit (Valid), the physical address (PA), the code (CODE), the first pipe hold (P1HLD), the input prohibition (INH), the second pipe Information on hold (P2HLD) and second pipe end (P2DONE) is stored.
  • the entry refers to a storage area for storing the above information for each PF instruction.
  • the valid bit is a bit indicating validity / invalidity of the entry. When it is “1”, it indicates that the entry of the PF storage circuit 66-3 is valid, and when it is “0”, the entry of the PF storage circuit 66-3. Indicates that the entry is invalid.
  • the second pipe end (P2DONE) is a bit indicating that the PF instruction specified by PA is completed in the second pipeline 80. When the bit is “1”, the end of the PF instruction processing is indicated. Indicates that the PF instruction has not ended.
  • the valid bit is changed from “1” to “0” when the pipeline processing is completed without stopping in the first pipeline 70 or the second pipeline 80.
  • the second pipeline 80 executes the pipeline processing and finds that the target data is not registered in the LB 160, the second pipeline 80 stops the pipeline processing.
  • the second pipe end (P2DONE) of the entry not registered in the LB 160 becomes “1”, and the valid bit remains “1”.
  • the first pipeline 70 processes the PF instruction.
  • the empty entry selection unit 66-2 refers to the valid bit of each entry in the PF storage circuit 66-3, determines that the entry of the valid bit “0” is an entry to be overwritten, in other words, an empty entry, and determines the entry selection unit 66-1 is notified as an empty entry.
  • the entry selection unit 66-1 registers the PF instruction in the empty entry notified by the empty entry selection unit 66-2.
  • the code (CODE) is information for specifying the type of the PF instruction.
  • the code specifies one of “shared instruction prefetch instruction”, “shared data prefetch instruction”, and “exclusive data prefetch instruction”.
  • the “shared instruction prefetch instruction” is a signal that requests that the instruction acquired by prefetching is held in the L2 cache RAM 110 in a “shared type” state acquired by another processor core.
  • the “shared data prefetch instruction” is a signal requesting that the data acquired by prefetching be held in the L2 cache RAM 110 in a “shared type” state acquired by another processor core.
  • the “exclusive data prefetch instruction” is a signal that requests that the data acquired by prefetching be held in an exclusive type, that is, in a state in which the requesting processor core can change the data.
  • the first pipeline hold indicates that the first pipeline 70 is processing the PF instruction.
  • P1HLD When P1HLD is “1”, this indicates that the first pipeline is processing the PF instruction.
  • the second pipeline hold indicates that the second pipeline 80 is processing the PF instruction when the value is “1”.
  • the PF port 66 When the PF port 66 is notified from the corresponding pipeline that the first pipeline 70 or the second pipeline 80 selected by the pipeline selection unit 60 has processed the PF instruction, the PF port 66 receives the corresponding first pipe hold. Alternatively, the second pipe hold is changed during processing.
  • Inhibition indicates that the PF instruction cannot be output to the first pipeline 70 or the second pipeline 80 due to a condition such as the LB 160 being unusable.
  • the decoder 66-4 receives from the first pipeline 70 or the second pipeline 80 a completion notification or a cancellation notification specifying the port and the entry ID.
  • the decoder 66-4 sets the valid bit of the entry of the PF storage circuit 66-3 specified by the completion notification to be invalid.
  • the decoder 66-4 validates the first pipe hold or the second pipe hold of the entry of the PF storage circuit 66-3 specified by the stop notification. Set to.
  • the PF port 66 receives a PF instruction from the processor core 10, registers the PF instruction in an empty entry in the PF storage circuit 66-3, and receives the first pipeline 70 / via the pipeline selection unit 60 in the order in which the requests are received.
  • a PF instruction is input to the second pipeline 80.
  • the first pipeline 70 or the second pipeline 80 outputs a completion notification or a cancellation notification to the PF port 66 at the final stage.
  • the PF port 66 releases the entry of the PF storage circuit 66-3 corresponding to the completed process.
  • the PF port 66 outputs the PF instruction to the first pipeline 70 or the second pipeline 80 again. To do.
  • FIG. 7 is a diagram illustrating an example of a pipeline selection unit.
  • the pipeline selection unit 60a illustrated in FIG. 7 is an example of the pipeline selection unit 60 illustrated in FIG.
  • the pipeline selection unit 60a includes AND circuits 60-1, 60-3, and 60-4 that perform an AND operation, OR circuits 60-2, 60-5, and 60-6 that perform an OR operation, and a selection circuit 60-. 7 and 60-8, and priority circuit priority circuits 60-21 and 60-22. Note that the number of logic circuits and input / output connections shown in FIG.
  • the OR circuits 60-5 and 60-6 output a signal having a signal level “high” if the signal level becomes “high” even if there is one input / output connection corresponding to the number of PF ports.
  • the pipeline selection unit 60a selects the first pipeline 70 or the second pipeline 80 as the pipeline for processing the PF request.
  • the pipeline selection unit 60a receives the first pipe hold (HLD), the input inhibition (INH), and the valid bit signal (VALID) from the PF port 66 as input signals.
  • the valid bit signal (VALID) is a bit signal indicating whether or not an entry is valid for each entry number of the physical address of the PF port 66, and has a bit value corresponding to the number of entries of the PF port 66.
  • the pipeline selection unit 60a uses the first or second pipeline when the entry of the PF storage circuit 66-3 is valid and the first pipe is being processed or when the LB 160 is not in the prohibition state. A process for inputting a PF request to the.
  • the pipeline selection unit 60a receives the second pipe hold (P2HLD) and the second pipe end (P2DONE) as input signals from the PF port 6, and when any of the input signals is “1”, the second pipeline The input of the PF instruction to 80 is suppressed.
  • the second pipeline 80 inputs a PF instruction to the LB 160, and whether or not the PA of the entry held by the LB 160 matches the PA targeted by the PF instruction.
  • the process which detects is performed. In this specification, detecting a match with the PA of the data targeted by the PF request or the LD request for the entry held by the LB 160 is referred to as “PA match” in this specification.
  • the pipeline selection unit 60a operates so as not to input a PF instruction to the second pipeline 80 when the second pipe end (P2DONE) is “1”, that is, “PA match is not found”. This is because the second pipeline 80 performs “PA match” in the LB 160. If “PA match is not found” once, the “no PA match” result is obtained even if the “PA match” process is performed again. Because it is only obtained.
  • the pipeline selection unit 60a also operates so as not to input a PF instruction to the second pipeline 80 even when P2HLD is “1”, that is, when the second pipeline is being processed. In this case, since the second pipeline 80 is being processed, the input of the PF instruction to the second pipeline 80 is suppressed so that the same processing is not repeated.
  • the selection circuit 60-7 sends the PF instruction to the first priority control circuit.
  • the selection circuit 60-8 sends the PF instruction to the second priority control circuit.
  • the AND circuit 60-1 receives the inverted signal of the first pipe hold signal (P1HLD) and the inverted signal of the input prohibition signal (INH) as input signals from the PF port 66, and the input signals are all “1”, that is, P1HLD, When INH is both “0”, a signal S60-1 having a value “1” is output to the AND circuit 60-4 and the AND circuit 60-3.
  • the OR circuit 60-2 receives the second pipe hold (P2HLD) signal and the second pipe end (P2DONE) as input signals from the PF port 66, and when one of the input signals is “1”, the value is “1”. The signal S60-2 is output to the AND circuit 60-4.
  • the AND circuit 60-3 receives the valid bit signal (VALID) and the signal S60-1 as input signals from the PF port 66, and outputs a signal S60-3a having a value of “1” when the input signals are all “1”. To do.
  • the signal S60-3a is output to the first priority control circuit 61 and is selected via the OR circuit 60-5 and the priority circuit 60-21 that generate a 1-bit “PIPE request signal” from the input 8-bit signal.
  • the signal S60-5a is output to the circuit 60-7.
  • the signal S60-3a output to the first priority control circuit 61 is used by the first priority control circuit 61 as a selection signal for the first priority control circuit 61.
  • the selection circuit 60-7 selects the first priority control circuit 61 as the input destination of the PF instruction from the PF port corresponding to the entry number, and A PF instruction is input to the priority control circuit 61.
  • the priority circuit 60-21 selects the oldest entry number according to the time when the entry is registered in the PF port.
  • the AND circuit 60-4 receives the valid bit signal (VALID), the signal S60-1, and the inverted signal of the signal S60-2 as input signals from the PF port 66, and when the input signals are all “1”, the value “ 1 "signal S60-4a is output.
  • the signal S60-4a is output to the second priority control circuit 62 and also output to the selection circuit 60-8 via the OR circuit 60-5 and the priority circuit 60-21.
  • the selection circuit 60-8 selects the second priority control circuit 62 as the input destination of the PF instruction from the PF port corresponding to the entry number, and performs the second priority control.
  • a PF instruction is input to the circuit 62.
  • the priority circuit 60-22 selects the oldest entry number according to the time when the entry is registered in the PF port.
  • the input signal of the AND circuit 60-3 receives all the input signals of the AND circuit 60-4.
  • the output signal of the AND circuit 60-3 and the output signal of the AND circuit 60-4 become the PIPE request signal of the selection circuit 60-7 and the PIPE request signal of the selection circuit 60-8, respectively.
  • the second pipeline 80 since the second pipeline 80 is dedicated to the PF instruction, the second pipeline 80 processes the PF instruction received from the pipeline selection unit 60 and executes the PA matching detection process.
  • the PF instruction for which “PA match” is obtained in the second pipeline 80 is deleted from the entry of the PF port.
  • the second pipeline 80 receives the completion signal output from the LB 160 and sets the valid bit of the entry of the LB 160 that is the target of the PF instruction to “0”.
  • An entry of a PF instruction that does not become “PA match” by the second pipeline 80 is valid at the PF port 66 until the second pipeline end (P2DONE) becomes “1” and the first pipeline 70 completes processing. Retained as an entry.
  • the PF instruction that specifies the physical address of the request destination is preferentially output to the second priority control circuit 62, and the PA match detection process is executed in the second pipeline 80.
  • a PF instruction for which no PA match is detected in the second pipeline 80 is processed in the first pipeline 70. With such processing, the arithmetic processing device 100 can reduce the load of PF instruction processing in the first pipeline 70.
  • FIG. 8 is a diagram illustrating another example of the pipeline selection unit.
  • the pipeline selection unit 60b illustrated in FIG. 8 is an example of the pipeline selection unit 60 illustrated in FIG. 6 and is an example different from the pipeline selection unit 60a illustrated in FIG.
  • the pipeline selection unit 60b has one selection circuit 60-9 instead of the two selection circuits 60-7 and 60-8 of the pipeline selection unit 60a. By doing so, the number of selection circuits for the PF instruction can be reduced by one and the input side connection of the selection circuit can be reduced.
  • the pipeline selection unit 60b shown in FIG. 8 has an AND circuit 60-3b instead of the AND circuit 60-3 as compared with the pipeline selection unit 60a shown in FIG. 7, and includes OR circuits 60-10 to 60-12. AND circuits 60-13a to 60-13h.
  • OR circuits 60-10 to 60-12 OR circuits 60-10 to 60-12.
  • AND circuits 60-13a to 60-13h OR circuits 60-10 to 60-12.
  • omitted about the element to which the same referential mark as the referential mark shown in FIG. 7 was already demonstrated using FIG. 7, description is abbreviate
  • the AND circuit 60-3b also uses the output signal S60-2 of the OR circuit 60-2 as an input signal, so that the second pipe end or the second pipe hold is “1”. In this case, “1” can be output.
  • the PF instruction is not output to the second pipeline 80 when the second pipe end or the second pipe hold is “1”. Therefore, the signal S60-3b is a signal indicating the output of the PF instruction only to the first pipeline 70.
  • the signal S60-4b is a signal indicating that a PF instruction for only the first pipeline 70 exists.
  • the signal S60-4b is a signal indicating that there is a PF instruction to both the first pipeline 70 and the second pipeline 80
  • the signal S60-6b is the first pipeline 70 and the second pipeline.
  • 80 is a signal indicating that there is a PF request to both 80.
  • the pipeline selection unit 60b uses the “priority periodic signal”. .
  • the priority periodic signal is used to periodically change which of the first pipeline and the second pipeline is prioritized. If the priority period signal is on, the second pipe processing and processed flag request are selected with priority, and if the second pipe processing and processed flag request are not requested, the other Select a request from among the requests. The opposite is true when the priority period signal is off.
  • the priority periodic signal is a signal whose output changes to “1” and “0” in synchronization with the clock.
  • the priority period signal is an input signal of the AND circuits 60-13a to 60-13h.
  • the AND circuits 60-13a, 60-13b, 60-13e, and 60-13f receive the priority period signal as a normal input, the AND circuits 60-13a, 60-13b, 60-13e, and 60-13f When the priority period signal is “1”, “1” can be output.
  • the AND circuits 60-13c, 60-13d, 60-13g, and 60-13h receive the priority period signal as an inverting input, the AND circuits 60-13a, 60-13b, 60-13e, and 60-13f When the priority period signal is “0”, “1” can be output.
  • the arithmetic processing unit is provided with a plurality of processor cores, a plurality of prefetch ports associated with each core are provided, and the priority control unit selects a request from each prefetch port, and the first and first In the case of the configuration in which the input to the second pipeline is performed, the phase of the priority period signal supplied to each prefetch port is reversed.
  • one core outputs a request for the second pipe, while another core requests a request for the second pipe that has been processed in the second pipe.
  • the requests from the prefetch ports to the first and second pipes can be performed uniformly.
  • the AND circuits 60-3b and 60-4 receive the valid bit signal (VALID).
  • the valid bit signal (VALID) is a bit signal indicating whether or not an entry is valid for each entry number of the physical address of the PF port 66, and has a bit value corresponding to the number of entries of the PF port 66.
  • the AND circuits 60-3b and 60-4 receive different attribute values for each entry from the outputs of the AND circuits 60-1 and 60-2. Therefore, when the priority period signal is “1”, the entry in which the signal S60-3b is “1” is preferential in the AND circuits 60-13a and 60-13b, not in the AND circuits 60-13c and 60-13d. To be processed.
  • the AND circuit 60-13a outputs a signal having a value of “1” when the priority period signal and the output of the AND circuit 60-3b are “1”.
  • the output of S60-13a is supplied to the OR circuit 60-10.
  • the AND circuit 60-13b is “1” when the priority period signal and the output S60-4 of the AND circuit 60-4 are “1” and the output S60-3 of the AND circuit 60-3a is “0”. Is output to the OR circuit 60-11.
  • the signal from the AND circuit 60-13b is supplied to the OR circuit 60-10 and the OR circuit 60-11.
  • the AND circuit 60-13c sends a signal having a value of “1” to the OR circuit 60-10 and the OR circuit 60 when the priority period signal is “0” and the output of the AND circuit 60-4 is “1”. To -11.
  • the output from the AND circuit 60-11 operates as a PF instruction output to the second pipeline 80.
  • the output of the AND circuit 60-13c is also output to the OR circuit 60-10 in the same manner as the OR circuit 60-11, so that the second pipe ends or is changed in the same manner as the pipeline selection unit 60a shown in FIG. Even in cases other than the two-pipe interruption, the PF instruction is output to the first pipeline 70.
  • the AND circuit 60-13d has a value of “0” when the priority period signal is “0”, the output of the AND circuit 60-3b is “1”, and the output of the AND circuit 60-4 is “0”. 1 "is output to the OR circuit 60-12.
  • the AND circuit 60-13e outputs a signal having a value of “1” to the OR circuit 60-12 when the priority period signal is “1” and the signal S60-3b is “1”.
  • the AND circuit 60-13f outputs a signal having a value of “1” to the OR circuit 60-12 when the priority period signal is “1” and the value of the signal S60-5b is “0”.
  • the AND circuit 60-13g outputs a signal having a value of “1” to the OR circuit 60-12 when the priority period signal is “0” and the signal S60-4 is “1”.
  • the AND circuit 60-13h has a value of “1” when the priority period signal is “0”, the value of the signal S60-6b is “0”, and the value of the signal S60-3b is “1”. Is output to the OR circuit 60-12.
  • the OR circuit 60-10 outputs a signal S60-10 for selecting the PF instruction of the entry determined by the value of the priority period signal to the first pipeline 70 via the first priority control circuit 61. Further, the OR circuit 60-11 receives the signal S60-11 for selecting the PF instruction excluding the end of the second pipe process or the second pipe hold among the PF instructions of the entry determined by the priority period signal, and the second priority control circuit 62. To the second pipeline 80.
  • the OR circuit 60-12 outputs a signal indicating the output destination of the PF instruction to the selection circuit 60-9 in synchronization with the outputs of the control signals S60-10 and S60-11.
  • the selection circuit 60-9 outputs a PF command to the first priority control circuit 61 or the second priority control circuit according to the value of the input signal.
  • the LD instruction is an instruction for loading data into the execution unit 14, and the store instruction is an instruction for storing data in the main storage device 220.
  • the PF instruction is an instruction for loading data from the main storage device 220 to the L2 cache RAM 110.
  • the L1 replacement instruction is an instruction that replaces the L1 cache RAM 16 or invalidates data held in the L1 cache RAM 16 in accordance with an instruction from the L2 cache controller 90.
  • the update data of the L1 cache RAM 16 is reflected in the L2 cache RAM 110 and the L2 tag RAM 140 is updated when the L1 cache RAM 16 is invalidated.
  • the L2 replacement instruction is an instruction for expelling data from a certain cache line in order to store (where) the data loaded from the main storage device 220 when a cache miss occurs in the L2 cache RAM 110 due to a PF instruction or an LD instruction.
  • the MC replacement instruction is an instruction to write the data from the MC 200 held in the data input buffer 32 to the L2 cache RAM 110 or the data output to the processor core 10 It is an instruction to perform.
  • the L2 tag RAM 140 is updated and written to the L2 data RAM 120.
  • the data output to the processor core 10 and the L1 replacement instruction are issued.
  • the first priority control circuit 61 receives the MO instruction, the LD instruction, and the PF instruction from the MO port 63, the LD port 64, and the PF port 66 through the pipeline selection unit 60, respectively, and the first pipe according to a predetermined priority order.
  • An instruction is input to the line 70.
  • the first priority control circuit 61 inputs an instruction input to the first pipeline 70 to the first pipeline in the priority order of the L1 replacement instruction, the MC replacement instruction, the L2 replacement instruction, the LD instruction, and the PF instruction. . Therefore, the L1 replacement instruction has the highest priority and the PF instruction has the lowest priority.
  • the selection between the cores in the L1 replacement instruction, the LD instruction, and the PF instruction is selected to be equal. Since the MO port and LD port are prepared for each core, the MO command or LD command from another core is input to the first priority control circuit 61.
  • a PF instruction from another core is input to the pipeline selection unit 60.
  • the second priority control circuit 62 inputs the PF instruction output from the pipeline selection unit 60 to the second pipeline 80.
  • the first priority control circuit 61 may determine an entry that can be input according to the type of instruction, and then select an entry that has the oldest request from the core from the entries that can be input and output the instruction to the pipeline.
  • the first pipeline 70 performs data access control to the L2 cache RAM 110 and various resource management.
  • the first pipeline 70 performs cache miss or cache hit determination of the L2 cache RAM 110 according to, for example, an LD instruction or a PF instruction.
  • the first pipeline 70 further determines whether the data entry in the LD instruction for the main storage device 220 held in the LB 160 matches or does not match the cache line of the LD instruction or PF instruction.
  • a load instruction for the main storage device 220 is referred to as an “MLD instruction”.
  • the first pipeline 70 When the cache miss occurs in the L2 cache RAM 110, the first pipeline 70 inputs the LD instruction received from the LD port 64 or the PF instruction received from the PF port 66 to the LB 160. As a result, the first pipeline 70 receives a signal indicating whether or not the PAs match from the LB 160.
  • the first pipeline 70 reads / writes information (“R / W” in the drawing) between the L2 data RAM 120 and the L ′′ tag RAM 140.
  • the first pipeline 70 supplies the MO port 63, the LD port 64, and the PF port 66 with a completion signal indicating that the processing of the pipeline is completed or an interruption signal indicating that the processing is interrupted.
  • a completion signal indicating that the processing of the pipeline is completed or an interruption signal indicating that the processing is interrupted.
  • FIG. 1 also shows a hit buffer 170.
  • the first pipeline 70 registers the hit address in the hit buffer 170.
  • the second pipeline 80 is a pipeline that detects a match between the physical address of the data being issued in the MLD instruction held in the LB 160 and the physical address of the PF instruction.
  • the first pipeline 70 performs overall data access control to the L2 cache RAM 110, whereas the processing of the second pipeline 80 is limited to what is prefetch processing.
  • One of the reasons for limiting the processing performed by the second pipeline 80 is to process PF instructions continuously for the same physical address.
  • the second pipeline 80 determines whether or not the PA related to the PF instruction matches the PA of the LB160 entry based on the signal indicating the PA match / mismatch from the LB 160. Then, the PA match or PA mismatch determination result is supplied to each of the MO port 63, the LD port 64, and the PF port 66. In the example of FIG. 1, the second pipeline 80 is supplied with a signal obtained by ORing the output from the LB 160 and the output from the hit buffer (HB) 170.
  • [Load buffer] 9A and 9B are diagrams illustrating an example of the load buffer.
  • the LB 160 is a storage unit that holds data to be stored in the L2 cache RAM 110.
  • the LB 160 includes an entry selection unit 160-1, an empty entry selection unit 160-2, a storage unit 160-3, decoders 160-4 and 160-13, a PA comparison unit 160-5, an AND circuit 160-6, and an OR circuit 160-. 7
  • the LB 160 further includes an LB entry monitoring unit 160-10 and selection circuits 160-11 and 160-12.
  • the storage unit 160-3 has an entry configuration for registering valid bits (Valid), physical addresses (PA), codes (CODE), PF numbers, L1 identification information (L1LID), hold (HLD), and core ID (CORE_ID). Have The storage unit 160-3 further has an entry configuration for registering L2 way identification information (L2WAYID), a main controller command completion flag (Req_issued), a memory controller response reception (MS_cplt), and an L2 replacement command completion (MO_cplt).
  • L2WAYID L2 way identification information
  • Req_issued a main controller command completion flag
  • MS_cplt memory controller response reception
  • MO_cplt L2 replacement command completion
  • the physical address (PA) and code (CODE) are generated by the processor core 10 and sent to the LB 160 as part of the LD instruction or PF instruction via the LD port 64 or PF port 66. Registered by acquiring an entry.
  • the L1 identification number or the core ID is generated by the processor core 10 and registered by acquiring the first entry in the LB 160 via the LD port 64.
  • the L2 way ID is generated by the L2 tag RAM 140 and registered by the first entry acquisition in the LB 160.
  • the entry having the oldest acquired one is selected from the entries in which the value of the valid bit (Valid) in the storage unit 160-3 indicates “0”.
  • the selected entry includes information such as PA, CODE, REQ_ID, PF, and L2 way ID (L2WAY ID) along with an entry acquisition instruction from the first pipeline 70.
  • the LB 160 matches the PA sent from the first pipeline 70 or the second pipeline 80 with the PA 160 of each valid entry in the storage unit 160-3. The result is detected, and the result is sent to the first pipeline 70 or the second pipeline 80.
  • the empty entry selection unit 160-2 searches for an entry in which the valid bit (Valid) is invalid, and notifies the entry selection unit 161 of it.
  • the LB 160 When the LB 160 receives the LD command or PF command, the LB 160 registers the LD command or PF command for the entry notified by the empty entry selection unit 162. From the registered entry, an L2 replacement instruction and an MC replacement instruction are requested to the first pipe according to a predetermined condition.
  • the decoder 160-4 receives from the first pipeline 70 a completion notification or an abort notification specifying the entry ID. Upon receiving the MC replacement instruction completion notification from the first pipeline 70, the decoder 160-4 sets the valid bit of the entry specified by the completion notification to be invalid.
  • the decoder 160-4 When the decoder 160-4 receives the cancellation notification from the first pipeline 70, the decoder 160-4 sets the hold of the entry specified by the cancellation notification to be invalid.
  • the decoder 160-13 receives the memory response signal indicating that data has been read from the MC 200, and sets the memory controller response reception (MS_cplt) of the entry specified by the memory response signal to “1”.
  • the PA comparison unit 160-5 compares the target data PA of the LD instruction or PF instruction being processed in the first pipeline 70 with the data PA held in the LB 160, thereby matching the two data. to decide. Further, by comparing the PA of the target data of the PF instruction being processed in the second pipeline 80 with the PA of the data held in the LB 160, the coincidence of both data is determined.
  • FIG. 9A shows one PA comparison unit 160-5, but there is one PA comparison unit 160-5 for each entry in the storage unit 160-3.
  • the AND circuit 160-6 outputs “1” to the OR circuit 160-7 when the valid bit of the corresponding entry is “1” and the signal received from the PA comparison unit 160-5 is “1”.
  • the OR circuit 160-7 receives the output signals of the plurality of AND circuits 160-6 as input signals. If any value of the input signals is “1”, the OR circuit 160-7 sets the output signal as “PA match notification” and sets the first signal. Output to the pipeline 70 and the second pipeline 80.
  • the LB 160 receives the LD instruction or PF instruction from the first pipeline 70, and registers the LD instruction or PF instruction in a free entry in the storage unit 160-3.
  • the LB 160 also fetches instructions from the storage unit 160-3 in the order received and inputs the MLD instructions to the MC 200.
  • the first pipeline 70 supplies a completion notification or a cancellation notification to the LD port 64 or the PF port 66, and releases the entry of the storage unit 160-3 from the LD port 64 or the PF port 66.
  • the LB entry monitoring unit 160-10 refers to the storage unit 160-3, the valid bit (Valid) of the entry in the storage unit 160-3 is “1”, and the main controller commanded flag (Req_issued) is “0”. At this time, the signal S160-10a for inputting an instruction corresponding to the entry to the MC 200 is supplied to the selection circuit 160-11.
  • the selection circuit 160-11 When the selection circuit 160-11 receives the selection signal S160-10a from the LB entry monitoring unit 160-10, the selection circuit 160-11 sends a replacement processing instruction for replacing the entry that is the condition for generating the selection signal S160-10a to the first priority control circuit 61. To supply.
  • the valid bit (Valid) of the entry 160-3, the request issuance completion to the memory (Req_issued), the L2 replacement instruction completion (MO_CPLT), and the memory controller response reception (MS_cplt) are “1”.
  • the hold (hld flg) is “0”
  • the signal S160-10b is supplied to the selection circuit 160-12.
  • the replacement circuit 160-12 Upon receiving the signal S160-10b from the LB entry monitoring unit 160-10, the replacement circuit 160-12 outputs an MC replacement command to the selection unit 61.
  • FIG. 9A shows one load buffer
  • a load buffer is prepared for each of the divided L2 cache RAMs 110a and 110b.
  • LB PA coincidence detection can be executed in the same cycle.
  • the hit buffer (HB) 170 is a storage circuit that holds a request address or the like of a PF instruction in which a cache hit occurs when the first pipeline 70 determines a cache hit.
  • the second pipeline 80 executes processing for determining whether the PA of the entry held in the LB 160 matches the PA to be prefetched.
  • the second pipeline 80 responds from the LB 160.
  • the entry is deleted. For this reason, after the processing of the second pipeline 80 is completed, the L2 cache RAM 110 is accessed by the PF instruction that has finished loading from the main storage device 220 in the first pipeline.
  • the PF instruction is held in the hit buffer 170 that has hit the cache in the first pipeline so that the processing of the PF instruction is completed in the second pipeline 80, and the PA match (what and what) is matched by the second pipeline 80.
  • the PF instruction processing of the first pipeline 70 can be reduced.
  • the hit buffer 170 may have a storage circuit for a hit buffer separately from the LB 160, and the role of the hit buffer may be added to the load buffer 160.
  • the load buffer 160-3b illustrated in FIGS. 10A and 10B has a storage area for storing a hit valid (Hit_Valid) between an area for holding a valid bit (Valid) and an area for holding a hold (HLD).
  • Hit_Valid a hit valid
  • HFD a hit valid bit
  • the hit valid is a flag indicating whether or not the corresponding entry in the load buffer 160-3b is used as a hit buffer. When the hit valid is “1”, the corresponding entry is used as a hit buffer. In the hit valid, a bit value exclusive of the valid bit (Valid) is stored.
  • the hit valid (Hit_Valid) becomes “1”. .
  • the empty entry selection unit 162 regards an entry having a valid bit (Valid) of “0” as a “empty entry” and notifies the entry selection unit 161 of the entry, so that an entry with a valid bit (Valid) of “0” is new.
  • the entry is overwritten. Therefore, the entry of the load buffer 160-3b can be used as the hit buffer 170 until it is overwritten with the next entry.
  • the storage area of the hit buffer does not occupy a large storage area in the load buffer 160-3b. In this way, by setting a part of the storage area in the load buffer 160-3b as the hit buffer 170, the storage area of the load buffer 160-3b is not unduly enlarged.
  • the entry selection unit 160-1 makes the corresponding valid entry among the entries in the load buffer 160-3b when the processing of the first pipeline 70 is completed. An entry whose bit is “0” is acquired. In that case, by preferentially selecting an entry whose hit valid is also “0”, the hit valid data can be held in the load buffer 160-3b for a longer period of time, and the second pipeline 80 is hit valid. Therefore, the PF instruction processing load of the first pipeline 70 can be reduced.
  • the empty entry selection unit 162 selects a new entry from the entries whose valid bit is “0” and the hit valid is “1”. Select an entry.
  • the entry having a valid bid of “0” and a hit valid of “0” is selected and selected. Register the cache hit data in the entry.
  • Information such as PA, CODE, PF, and L2_way_ID is transmitted from the first pipeline 70 to the selected entry, stored in the entry, the hit valid is “1”, and the valid bit is also “1”. .
  • an AND circuit 160-8 and OR circuits 160-9 and 160-14 are added.
  • the AND circuit 160-8 receives the output signal of the PA comparison unit 160-5 and the value of the hit valid as input signals, and when both of the input signals are the value “1”, the AND circuit 160-8 sends the value “1” to the OR circuit 160-9. 1 "is output.
  • the OR circuit 160-9 receives the output signal of the AND circuit 160-8 as an input signal, and when the bit value of any one of the AND circuit 160-8 is “1”, the OR circuit 160-14 has a value “ 1 "is output.
  • the OR circuit 160-14 receives the output signal of the OR circuit 160-7 and the output signal of the OR circuit 160-9, and if any signal is “1”, the value is “1” as “PA match notification”. Is output to the second pipeline 80.
  • the “PA match notification” to the second pipeline 80 includes a match between the PA match of the PF instruction stored in the load buffer and the PA stored in the entry used as the hit buffer. Since the second pipeline 80 is used to execute the PF instruction completion process regardless of whether the hit buffer matches or the load buffer matches, the output signal of the OR circuit 160-7 and the OR circuit 160-9 The output signal is ORed by the OR circuit 160-14.
  • the LB 160 For each flow of the first pipeline 70, the LB 160 detects a PA match between the PA sent from the first pipeline 70 or the second pipeline 80 and each valid entry of 160-3b, and the result is obtained. The data is sent to the first pipeline 70 or the second pipeline 80. However, since the tag is always searched in the first pipeline, it is not necessary to determine the cache hit based on the hit valid. Therefore, only the PA match result of the valid entry of the LB 160 is sent to the first pipeline 70. Good. On the other hand, a logical sum of the PA match result of the valid entry of the LB 160 and the PA match result of the valid hit buffer entry is sent to the second pipeline 80.
  • the second pipeline 80 can complete the PF instruction by the cache hit condition in addition to the LB match condition by the HB PA match condition.
  • the LB 160 receives the data response from the MC 200, outputs a replacement instruction to the first pipeline 70, and releases the entry by setting the valid bit of the entry to “0” when the output is completed.
  • FIG. 11 is a diagram illustrating an example of processing by the first and second pipelines.
  • the first pipeline 70 includes request read (RR), priority determination (PD1, PD2), read PA input (PI), tag read (TR), cache hit detection (CD), processing result notification (RN), And a request processing decision (RP) stage.
  • the first pipeline 70 further includes stages of tag update PA input (TI), tag update operation (TW), PA transfer (LP), PA match detection (LD), and PA match result transfer (LT).
  • the first pipeline 70 reads a request held in the LD port 64, the PF port 66, the MO port 63, or the LB 160.
  • a request read from the LD port 64, PF port 66, MO port 63 or LB 160 is supplied to the first priority control circuit 61, and the first pipeline 70 has a predetermined priority order.
  • the request determined by the first priority control circuit 61 is received.
  • the first pipeline 70 In the read PA input (PI) stage, the first pipeline 70 inputs the physical address of the access target data to the L2 tag RAM 140. In the PA input stage, the first pipeline 70 also performs PA transfer (LP) to the LB 160.
  • LP PA transfer
  • the first pipeline 70 reads a tag from the L2 tag RAM 140. In the tag reading stage, the first pipeline 70 also performs PA coincidence detection (LD) at the LB 160.
  • LD PA coincidence detection
  • the first pipeline 70 detects a cache hit or a cache miss of the L2 cache RAM 110. In the cache hit detection stage, the first pipeline 70 also performs PA match result transfer (LT) in the LB 160.
  • LT PA match result transfer
  • the request processing determination (RP) stage processing is performed according to the detection result of the cache hit detection stage.
  • the first pipeline 70 inputs an LD instruction to the entry of the LB 160 and outputs a completion notification to the LD port 64 at the processing result notification (RN) stage.
  • RN processing result notification
  • a completion notification is output to the PF port 66 at the processing result notification stage.
  • the first pipeline 70 When the LD instruction is a cache hit detection, the first pipeline 70 reads data from the L2 data RAM 120 and supplies a completion notification to the LD port 64 at the processing result notification (RN) stage. After the LD instruction is input to the LB 160, the first pipeline 70 receives a “PA match notification” from the LB 160 and supplies a cancellation notification to the LD port 64.
  • RN processing result notification
  • the LB 160 When the LB 160 receives the MC replacement instruction completion notification, the LB 160 releases the entry specified by the completion notification. In addition, when the LD instruction is not processed, the first pipeline 70 supplies a stop notification to the LB 160 at the processing result notification stage. If the PF instruction is a cache hit detection, the first pipeline 70 supplies a completion notification to the PF port 66 at the processing result notification stage. After the PF instruction is input to the LB 160, the first pipeline 70 receives the “PA match notification” from the LB 160. If there is no difference between the requests held in the LB 160, the first pipeline 70 notifies the PF port 66 of the completion. Supply.
  • the first pipeline 70 receives a tag update PA based on data output from the main memory 220 or the L1 cache RAM 16.
  • the first pipeline 70 updates the tag data in the L2 tag RAM 140 using the input PA. That is, in the tag update operation stage, a write operation is performed on the L2 data RAM 120 and the L2 tag RAM 140.
  • Reference numeral 401 indicates a first flow of pipeline processing by the first pipeline 70.
  • Reference numeral 402 denotes a second flow of pipeline processing that is executed two cycles after the start of the first flow.
  • Reference numeral 403 denotes a third flow of pipeline processing executed two cycles after the start of the second flow.
  • Reference numeral 404 denotes a fourth flow of pipeline processing that is executed two cycles after the start of the third flow.
  • the first pipeline 70 executes the subsequent flow with a delay of two cycles with respect to the preceding flow.
  • a delay of two clock cycles for example, an idle cycle in which the pipeline is not executed every other cycle is set.
  • the “9” cycle tag write process 411, the “8” cycle tag read process 412 and the “10” cycle tag read process 413 do not occur in the same cycle.
  • the tag read operation performed in the even clock cycle of each flow is different from the tag write operation performed in the odd clock cycle of each flow. It can be implemented in clock cycles.
  • the L2 cache RAM 110 shown in FIG. 4 is a read / write shared 1-port RAM, and the write amplifiers 123a to 123d and 143a to 143d and the sense amplifiers 124a to 124d and 144a to 144d use a common column line and have the same cycle. Thus, writing to and reading from the memory cell are not possible. In order to perform read and write operations in the same cycle, it is necessary to provide a write column line and a read column line in one cell. As described above, the L2 cache RAM capable of writing and reading in the same cycle is complicated and expensive in cost. As described above, the first pipeline 70 executes the subsequent flow with a delay of two clock cycles from the previous flow, so that reading and writing are not executed in the same cycle, and the L2 cache RAM is read / written shared by one port. It can be a RAM.
  • the stages of the second pipeline 80 As the stages of the second pipeline 80, the above-described request read stage, priority determination stage, PA match detection stage, PA transfer stage to LB, request process determination stage, and process result notification stage are performed. 451 and 461 shown in FIG. 11 show examples of pipeline processing. Among these, the pipeline process 451 shows an example in which PA match detection is performed before the PA match detection in the first pipeline pipeline process 401. Further, the pipeline process 461 shows an example in which the PA match detection is performed after the PA match detection by the pipeline process 401.
  • the second pipeline 80 uses the hit buffer and the PF instruction target data described with reference to FIGS. 10A and 10B in the PA match detection process instead of the PA match in the LB 160 or in addition to the PA match in the LB 160. The matching process may be performed.
  • the PA coincidence detection processes 452 and 462 of the second pipeline 80 perform the PA coincidence detection process in the LB 160 in a different clock cycle from the PA coincidence detection process 414 of the first pipeline 70. Therefore, the first pipeline 70 and the second pipeline 80 do not have any influence such as stopping the first pipeline 70 while sharing the address match detection circuit in the PA match detection process.
  • the second pipeline determines the process based on the PA coincidence detection result with the LB, the number of processing cycles can be reduced as compared with the pipeline process using the first pipeline.
  • the second pipeline is used for the following reason.
  • the number of cycles of pipeline processing is preferably the same as the number of cycles of pipeline processing by the first pipeline.
  • the PF port ignores the completion notification from the second pipeline, and completes the processing according to the completion notification from the first pipeline and releases the entry of the corresponding storage unit 66-3.
  • the priority logic that prioritizes the completion notification from the first pipeline the completion notification received by the PF port can be narrowed down to one, and only one receiving port is provided for receiving the completion notification. It will be better.
  • the completion notification that reaches the PF port at the same time is a notification based on a separate request. In this case, it is necessary to provide two receptacles in order to receive completion notifications from both pipelines. As shown in FIG.
  • each pipeline notifies the processing result in the same cycle, so that the PF port 66 receives the completion notification or the cancellation notification regarding the PF instruction from the first pipeline 70 and the second pipeline 80 at the same timing.
  • the selection circuit 160-15 that gives priority to the completion notification from the first pipeline 70 can reduce the completion notification to one, so that one decoder 160-4 can be used as the completion notification receiver. I can do it.
  • FIG. 12 is a diagram illustrating an example of processing by the first and second pipelines for the banked L2 cache RAM.
  • the program A reading and writing cannot be performed simultaneously in the same cycle with respect to the L2 cache RAM 110a or the L2 cache RAM 110b.
  • the L2 cache RAM 110b can be read or written in the same cycle as the cycle in which the L2 cache RAM 110a is read or written. This is because the L2 cache RAM 110a and the L2 cache RAM 110b have separate memory cells.
  • pipeline processing it is also possible to execute two pipeline processes in the same cycle. For example, the PA match detection process can execute a plurality of pipeline processes in the same cycle.
  • 401a is the pipeline processing of the first pipeline 70 for the L2 cache RAM 110a
  • 401b is the pipeline processing of the first pipeline 70 for the L2 cache RAM 110b
  • 451a is pipeline processing of the second pipeline 80 for the L2 cache RAM 110a
  • 451b is pipeline processing of the second pipeline 80 for the L2 cache RAM 110b.
  • Pipeline processing 401b which is a subsequent flow with respect to pipeline processing 401a, is delayed by one cycle.
  • Pipeline processing 451b which is a subsequent flow with respect to pipeline processing 451a is delayed by one cycle. The reason why the subsequent flow can be executed after one cycle in this way is that reading and writing to the same L2 cache RAM in the same cycle can be prevented by dividing the bank.
  • 471 is a PA coincidence detection process by the first pipeline 70 in the “4” cycle
  • 472 is a PA coincidence detection process by the second pipeline 80 in the “3” cycle
  • 473 is a PA coincidence detection process by the first pipeline 70 in the “5” cycle
  • 472 is a PA coincidence detection process by the second pipeline 80 in the “4” cycle.
  • Processing 471 and processing 474 are PA coincidence detection processing in the same cycle. As shown in FIG. 7, since PA match is detected for each entry of the LB 160, it is possible to detect two PA matches in the same cycle.
  • the flow is executed after one cycle without performing reading and writing in the same cycle to the L2 cache RAM, and PA matching detection processing capable of performing a plurality of processes in the same cycle is performed.
  • the idle period of the circuit can be reduced.

Abstract

 主記憶装置に格納されるデータの一部を格納する第1の記憶部と、主記憶装置に格納されるデータを、第1の記憶部に格納する命令を出力する演算処理部と、命令を受け取るとともに、第1の記憶部が主記憶装置から命令の対象データを受け取るまで、命令を格納する第2の記憶部と、演算処理部から命令を受け取るとともに、命令の対象データが第1の記憶部に格納されている場合、対象データを第1の記憶部から読み出して演算処理部に出力する一方、命令の対象データが第1の記憶部に格納されず且つ命令の対象データと同じデータを対象とする命令が第2の記憶部に無い場合、命令を主記憶装置に出力する第1の制御部と、演算処理部から命令を受け取るとともに、命令の対象データと同じデータを対象とする命令が第2の記憶部に格納されている場合、命令による主記憶装置から対象データを読み出す処理を完了する第2の制御部と、を有する演算処理装置が提供される。

Description

演算処理装置
 本発明は、演算処理装置に関する。
 近年、プロセッサの処理速度の高速化のために、パイプライン方式を用いたプロセッサが使用されている。プロセッサとしては、例えば、CPU(Centoral Processing Unit)、DSP(Digital Signal Processor)、GPU(Graphics Processing Unit)がある。パイプライン方式において、プロセッサはその機能を実現する複数のパイプライン(命令制御パイプライン、演算パイプライン、分岐制御パイプライン等)を有する。又、各パイプラインは、それぞれ複数のステージに分割されている。各ステージは、所定の工程を実現する回路ユニットを含み、動作周波数の逆数であるサイクルタイムと呼ばれる期間内に、各ステージに割り当てられた所定の工程を終了するように動作する。そして、先工程に係るステージの出力信号は、例えば、後工程に係るステージの入力信号として使用される。
 また、プロセッサの動作周波数の向上により、プロセッサからメモリへのアクセス時間は、プロセッサ内の処理と比して相対的に長い。そのため、プロセッサは、プロセッサから主記憶装置へのアクセス時間を短縮するために、キャッシュメモリと言う小容量の高速メモリを搭載している。
 キャッシュメモリは、主記憶装置の上位階層に配置され、主記憶装置が記憶するデータの一部を保持する。キャッシュメモリは、プロセッサに内蔵されている等、主記憶装置よりプロセッサに近い位置にある。そのため、プロセッサが、キャッシュメモリにロードされているデータにアクセスする場合(以下、「キャッシュヒット」と言う)、プロセッサは短時間で対象データにアクセスすることが出来る。一方、プロセッサが、キャッシュメモリにロードされていないデータにアクセスする場合(以下、「キャッシュミス」と言う)、キャッシュメモリの下位階層にあるメモリからデータを読み出すため、対象データへのアクセス時間は長くなる。そのため、キャッシュミスが生じないように、キャッシュメモリのメモリコントローラは、プロセッサからのアクセス頻度が高いデータをキャッシュメモリに保持し、アクセス頻度が低いデータをキャッシュメモリから下位階層のメモリに追い出すように動作する。
 さらに、プロセッサは、演算処理を実行する演算部と、演算部がキャッシュメモリから受け取るデータを保持するレジスタを有する。レジスタは、例えば、キャッシュメモリの上位階層に配置され、キャッシュメモリより少量で高速な記憶装置である。
 演算部は、キャッシュメモリからレジスタにデータをロードするロード命令を発する前に、ロード命令に基づいて主記憶装置からキャッシュメモリにデータをロードするプリフェッチ命令をメモリコントローラに出力する。演算部がロード命令に先行してプリフェッチ命令をメモリコントローラに出力することで、演算部が、データをキャッシュメモリからロードするときキャッシュミスを生じないため、データアクセス時間が短縮する。
特開2006-40090号公報 特開2000-339157号公報
 演算部は、キャッシュメモリからレジスタへと一旦データを読み込んでから各種の処理を行なっている。レジスタに保持されるデータ容量に対して、キャッシュメモリの1つのキャッシュラインに保持されるデータ容量は大きい。例えば、1つのキャッシュラインには、アドレスで特定されるデータが複数保持される。
 ロード命令は、キャッシュメモリの1つのキャッシュラインに保持される全てのデータをレジスタにロードする命令ではなく、アドレス単位で特定されたデータをキャッシュラインからレジスタにロードする命令である。演算部によりレジスタに出されるロード命令は、1アドレス単位でデータをレジスタにロードする命令であるのに対して、プリフェッチ命令は、主記憶装置からキャッシュメモリへのロードに相当するので、キャッシュライン単位でデータをロードする命令である。そのため、例えば、2つのロード命令が、1つのキャッシュラインに保持されるアドレスを対象として出される場合、2つのロード命令に基づいて生成される2つのプリフェッチ命令は、同じキャッシュラインに保持されるデータを2回主記憶装置から読み出そうとする。
 この場合、最初のプリフェッチ命令により主記憶装置からデータはロードされるため、次のプリフェッチ命令は、キャッシュヒットにより主記憶装置からデータのロードは実行されない。キャッシュヒット判定は、キャッシュコントローラ(図1でいうメモリコントローラとは違う、図1でいえば第1パイプライン)におけるパイプライン処理により実行される。キャッシュメモリに主記憶装置からデータがロードされた後も、プリフェッチ命令が出力された場合、キャッシュコントローラは、キャッシュヒット判定を行う。キャッシュメモリにデータが格納されても、格納データに対して複数のプリフェッチ命令が出されると、パイプライン処理において他のストア命令や、ロード命令の実行待ちが生じて、主記憶装置へのアクセス時間が延長化する。
 開示の演算処理装置は、主記憶装置へのアクセス時間を短縮することを目的とする。
 開示の演算処理装置は、主記憶装置に接続される演算処理装置であって、主記憶装置に格納されるデータの一部を格納する第1の記憶部と、主記憶装置に格納されるデータを、第1の記憶部に格納する命令を出力する演算処理部と、命令を受け取るとともに、第1の記憶部が主記憶装置から命令の対象データを受け取るまで、命令を格納する第2の記憶部と、演算処理部から命令を受け取るとともに、命令の対象データが第1の記憶部に格納されている場合、対象データを第1の記憶部から読み出して演算処理部に出力する一方、命令の対象データが第1の記憶部に格納されず且つ命令の対象データと同じデータを対象とする命令が第2の記憶部に無い場合、命令を主記憶装置に出力する第1の制御部と、演算処理部から命令を受け取るとともに、命令の対象データと同じデータを対象とする命令が第2の記憶部に格納されている場合、命令による主記憶装置から対象データを読み出す処理を完了する第2の制御部と、を有する。
 開示の演算処理装置は、主記憶装置へのアクセス時間を短縮するという効果を奏する。
演算処理装置のハードウェア構成の一例を示す図である。 プロセッサコアのハードウェア構成の一例を示す図である。 ロード命令又はプリフェッチ命令が対象とするメモリ容量の一例を示す図である。 バンク分け無しL2キャッシュRAMのハードウェア構成の一例を示す図である。 バンク分け有りL2キャッシュRAMのハードウェア構成の一例を示す図である。 プリフェッチポートの一例を示す図である。 パイプライン選択部の一例を示す図である。 パイプライン選択部の一例を示す図である。 ロードバッファの一例を示す図である。 ロードバッファの一例を示す図である。 ヒットバッファの一例を示す図である。 ヒットバッファの一例を示す図である。 第1及び第2パイプラインによるパイプライン制御の一例を示すタイムチャートである。 バンク分けされたL2キャッシュRAMに対する第1及び第2パイプラインによるパイプライン制御の一例を示すタイムチャートである。
 以下、図面を参照して、プロセッサとしての演算処理装置の実施形態を説明する。
 <演算処理装置のハードウェア構成>
 図1は、演算処理装置のハードウェア構成の一例を示す図である。図1に示す演算処理装置100は、演算処理部としてのプロセッサコア(Processor Core)10、L2キャッシュコントローラ(Level-2 Cache Controller)90、L2タグRAM(Level-2 Tag Random Access Memory)140、L2データRAM(Level-2 Data Random Access Memory)120、ロードバッファ(LB,Load Buffer)160、及びメモリコントローラ(MC、Memory Controller)200を有する。演算処理装置100は、図1に示すように、ヒットバッファ(HB)170を有してもよい。プロセッサコア10は、MC200を介して主記憶装置220と接続する。なお、L2データRAM120及びL2タグRAM140は、本明細書において総称して「L2キャッシュRAM110」と参照される。
 また、図1の演算処理装置100には、データ入力バッファ32とデータ出力バッファ34とが設けられている。データ入力バッファ32は、主記憶装置22あるいはL2キャッシュRAM110から読み出してプロセッサコア10に入力するデータをバッファリングするために用いられる。一方データ出力バッファ34は、プロセッサコア10から出力されたデータをバッファリングするために用いられる。データ出力バッファ34にバッファリングされたデータは、L2キャッシュRAM110あるいは主記憶装置22に転送される。
 なお、図1に図示した各部の説明は、他の図面を用いた各部の詳細説明とあわせて行なう。
 [プロセッサコア]
 図2は、プロセッサコアの構成の一例を示す図である。プロセッサコア10は、命令部(IU:Instruction Unit)12、実行部(EU:Execution Unit)14、L1キャッシュコントローラ18、L1キャッシュRAM16(Level-1 Cache Random Access Memory)を有する。
 L1キャッシュRAM16は、命令やデータなどを保持する。L1キャッシュコントローラ18は、L1キャッシュRAM16のアクセスを制御する。なお、図1に示されるプロセッサコアの個数は1個であるが、プロセッサコアは図1に示される個数に制限されることなく、演算処理装置100は、複数個のプロセッサコアを有してもよい。
 [プロセッサコア:命令部]
 命令部12は、命令パイプライン15を介してL1キャッシュRAM16から読み出した命令をデコードし、デコードした命令を、命令パイプライン15を介して実行部14に出力する。例えば、命令部12は、命令パイプライン15を介して「ロード命令」又は「ストア命令」(図示「ロード命令等」)をL1キャッシュコントローラ18に供給する。命令部12からL1キャッシュコントローラ18に供給される命令が、例えば、「ロード命令」である場合、L1キャッシュコントローラ18は、「ロード命令」により指定される命令をL1キャッシュRAM16から読み出す。「ロード命令」によりL1キャッシュRAM16から読み出された命令は、命令部12に供給される。L1キャッシュRAM16から読み出される命令は、例えば、データ転送命令、算術演算命令である。データ転送命令は、例えば、L1キャッシュRAM16へのロード(LD)命令、ストア(ST)命令、プリフェッチ(PF)命令、及び置換(MO)命令を含む命令である。命令部12は、L1キャッシュRAM16から読み出した命令をデコードし、デコードした命令(図2に示すD命令)とともに、命令の実行に使用されるオペランドを格納するレジスタ13及び命令実行の結果を格納するレジスタ13を特定するレジスタアドレスを、「データ」として命令パイプライン15を介して実行部14に供給する。
 [プロセッサコア:実行部]
 実行部14は、レジスタアドレスで特定されるレジスタ13からオペランドを取り出し、命令部12がデコードした命令でオペランドを演算する。実行部14は、実行する命令がデータ転送命令である場合、例えば、オペランドとしてのレジスタの値から仮想アドレスを生成する。実行部14は、実行する命令がデータ転送命令である場合、例えば、ロード命令、ストア命令又はPF命令(図示「ロード命令等」)を、対象となる仮想アドレスとともに命令パイプライン15を介してL1キャッシュコントローラ18に供給する。実行部14は、命令を実行すると、演算結果を命令パイプライン15に供給し、演算結果は命令パイプライン15を介してL1キャッシュRAM16に格納される。
 [プロセッサコア:L1キャッシュメモリ]
 L1キャッシュRAM16は、図示しないTranslation Lookaside Buffer(TLB)、L1タグRAM、及びL1データRAMを含む。L1キャッシュコントローラ18は、実行部14から供給される仮想アドレスでL1キャッシュRAM16のラインを特定し、TLB及びL1キャッシュRAM16のラインからそれぞれ読み出される物理アドレス(PA:Physical Address)を仮想アドレスと比較することで、キャッシュミス又はキャッシュヒットを判断する。
 [プロセッサコア:L1キャッシュコントローラ]
 L1キャッシュコントローラ18は、L1キャッシュRAM16でキャッシュミスが生じると、LD命令やPF命令を、L2キャッシュコントローラ90に出力する。そして、プロセッサコア10は、例えば、LD命令によるデータ、又は、PF命令の完了通知を、L2キャッシュコントローラ90から受け取る。
 [レジスタとキャッシュライン]
 図3は、LD命令又はPF命令が対象とするレジスタとL2キャッシュRAMの構成の一例を示す図である。
 図3に示すレジスタ13aは、図2に示したレジスタ13の記憶領域の一例である。レジスタ13aは、例えば、アドレスR0~R15で特定される複数のレジスタを有する。レジスタ13aの1アドレスに対応するレジスタの記憶容量は、図3の例では8バイトである。
 図3に図示される16aは、L1キャッシュRAM16に格納される情報の構成を示している。図3に示すA0(i)、A1(i)・・・は、L1キャッシュRAMのアドレスを示す。情報16aの1単位は、図3の例では8バイトである。レジスタへのロード命令が発行されると、実行部14はL1キャッシュRAM16に格納されている情報16aを、8バイト単位でレジスタ13aにロードする。
 図3に示すキャッシュライン111aは、図1に示すL2データRAM120のキャッシュラインである。L2データRAM120の1キャッシュラインの記憶容量は、図3の例では128バイトである。図3に示す例では、1つのレジスタの記憶容量は8バイトであるので、1キャッシュラインは、16個のレジスタ分のデータを格納することができる。
 L2キャッシュRAMへのプリフェッチ命令が発行されると、主記憶内のデータがL2データRAM120のキャッシュライン111aに書き込まれる。
 なお、図3の例では、A0(i+M)、A0(i+M)+32B、A0(i+M)+64B・・・というように1キャッシュラインは32バイト単位の情報に分割されている。
 [LD命令又はPF命令出力用のプログラム]
 実行部14は、プログラムを実行することで、LD命令によるロード対象となるデータを前もって、L2キャッシュRAM110にプリフェッチする。LD命令でレジスタ13aに格納する予定のデータを、L2キャッシュRAM110のキャッシュラインに128バイト単位でプリフェッチするケースでは、1回のプリフェッチで、アドレスR0~R15のレジスタ用のデータをキャッシュライン111aに格納することができる。
 しかしながら、1つのキャッシュラインへのプリフェッチを1回で終わらせるようにPF命令を出力することは、実行部14が実行するプログラムに特殊な演算や分岐条件を加えることで行われるため、実行部14による実行効率を落とすことになる。
 下記プログラムAは、LD命令及びPF命令を含むプログラムの一例である。
 プログラムA
 // LOOPに入る前にi=0のデータをロードする。
 (S0) アドレスA0(0)のデータをロードしR4に格納する;
 (S1) アドレスA1(0)のデータをロードしR5に格納する;
 (S2) アドレスA2(0)のデータをロードしR6に格納する;
 (S3) アドレスA3(0)のデータをロードしR7に格納する;
     (ループ部)
 (S4) LOOP:  // for (i = 0 < N ; i++)
 (S5) 1ループ前にアドレスA0(i)からロードしたR4のデータをR0に移動;
 (S6) 1ループ前にアドレスA1(i)からロードしたR5のデータをR1に移動;
 (S7) 1ループ前にアドレスA2(i)からロードしたR6のデータをR2に移動;
 (S8) 1ループ前にアドレスA3(i)からロードしたR7のデータをR3に移動;
 (S9) Mループ先のアドレスA0(i+M) のデータをL2キャッシュRAM110にプリフェッチ; 
 (S10) Mループ先のアドレスA4(i+M) のデータをL2キャッシュRAM110にプリフェッチ; 
 (S11) 1ループ先のアドレスA0(i+1)のデータをロードしR4に格納する;
 (S12) 1ループ先のアドレスA1(i+1)のデータをロードしR5に格納する;
 (S13) 1ループ先のアドレスA2(i+1)のデータをロードしR6に格納する;
 (S14) 1ループ先のアドレスA3(i+1)のデータをロードしR7に格納する;
 (S15) R0,R1,R2,R3を参照して演算し、演算結果をR8に格納する;
 (S16) 演算結果R8をアドレスA4(i)にストアする;
 (S17) GOTO LOOP ;  // i=N-1ならばLOOPを抜ける
     (終了部)  // N周目
 (S18) LOOPの最後のループにアドレスA0(N)からロードしたR4のデータをR0に移動;
 (S19) LOOPの最後のループにアドレスA1(N)からロードしたR5のデータをR1に移動;
 (S20) LOOPの最後のループにアドレスA2(N)からロードしたR6のデータをR2に移動;
 (S21) LOOPの最後のループにアドレスA3(N)からロードしたR7のデータをR3に移動;
 (S22) R0,R1,R2,R3を参照して演算し、演算結果をR8に格納する;
 (S23) 演算結果R3をアドレスA4(N)に格納する;
 プログラムAは、ループ処理によりLD命令を実行し、LD命令によりレジスタに格納されたデータに対して演算処理を実行し、演算処理結果をレジスタにストアするプログラムである。プログラムAは、ある連続したアドレス空間のデータを連続して参照し、参照したデータを使用して演算を行い、その演算結果を別なアドレス領域に連続して格納する処理を行う。このアドレス空間は、プログラムからは通常仮想アドレス(VA)としてアクセスされるものである。仮想アドレスはMMU(TLB)で物理アドレス(PA)に変換され、L2キャッシュはPAによりアクセスされる。一般に、仮想アドレスが連続であっても物理アドレスが連続しているとは限らない。しかし、近年においてはメモリのコストが著しく低下したこともあり、メモリの使用効率よりも性能を重視して4MBといった比較的大きなページサイズが採用されている事情もあるため、物理アドレス空間においても連続していることを前提として考えても差し支えはない状況になっている。
 ここで、プログラムが参照する参照するアドレスは、A0(0), A1(0), A2(0), A3(0), A0(1), A1(1), A2(1), A3(1), ... , A0(N), A1(N), A2(N)の範囲であるものとする。
 また、これらのアドレスは、以下のような一定の間隔(8バイト間隔)で並んでいるものとする。
 アドレスA0(i) =A0(i)+0B
 アドレスA1(i) =A0(i)+8B
 アドレスA2(i) =A0(i)+16B
 アドレスA3(i) =A0(i)+24B
 アドレスA0(i+1)=A0(i)+32B
 アドレスA1(i+1)=A0(i)+40B
 アドレスA2(i+1)=A0(i)+48B
 アドレスA3(i+1)=A0(i)+56B
 アドレスA0(i+2)=A0(i)+64B
       ・
       ・
       ・
 アドレスA0(i+3)=A0(i)+96B
       ・
       ・
       ・
 アドレスA0(i+4)=A0(i)+128B
 このように、プログラムはアドレスA0(i)から連続してデータをロードする。ここで。1ループ処理を実行するたびに4アドレス分(A0(i)~A3(i))、つまり32バイト分のデータがロードされる。そして、4周先にロード対象となるアドレスA0(i+4)はA0(i)+128Bであるため、ループ4周でキャッシュライン128B分をアクセスすることになる。
 一方、プリフェッチは、ループ4周の処理が実行される間に、
 アドレスA0(i+M)
 アドレスA0(i+1+M) =A0(I+M)+32B
 アドレスA0(i+2+M) =A0(I+M)+64B
 アドレスA0(i+3+M) =A0(I+M)+96B
 のように4回発行される。
 ステップS0~S3には、ループ処理に入る前にi=0のデータ、つまりアドレスA0(0)~アドレスA3(0)のデータをロードして、レジスタR4~R7に格納する処理が定義される。ループ処理の1周目では、i=0に対するアドレスA0(0),A1(0),A2(0),A3(0)のデータがロードされていない。そのため、ループ処理に入る前に、S0~S3でこれらアドレスのデータをロードする。
 ステップS4~S17には、ループ処理が定義される。ステップS5~S8では、1ループ前にアドレスA0(i)~A3(i)からロードしてレジスタR4~R7に格納したデータを、レジスタR0~R3に移動する処理が定義されている。S11~14には、アドレスA0(i+1)~A3(i+1)のデータをロードして、レジスタR4~R7に格納するLD命令が定義される。ループ文(S4)によって、アドレスA0(i)~A3(i)(i=0~N)に格納されたデータが、アドレスR4~R7のレジスタに順次格納される。iはインクリメントされるため、ステップS5~S8、S11~14の実行によって、アドレスA0(i)~A3(i)に格納されたデータは、1ループの処理実行毎にアドレスR4~R7のレジスタに格納される。
 例えば、アドレスA0(i)~A3(i)で特定されるデータが、例えば、図3のキャッシュライン16aに示すように、8バイト単位で配置されるものとする。S11~14に示されるLD命令の格納対象アドレスR4~R7のレジスタ個数は、4つであるため、ループ処理1回で、8B×4=32Bのデータが、アドレスA0(i)~A3(i)からアドレスR4~R7のレジスタにロードされる。
 ステップS9では、Mループ先のアドレスA0(i+M)のデータを主記憶装置220からL2キャッシュRAM110にプリフェッチする。プリフェッチ命令は、LD命令の対象となるデータを先行予測して、主記憶装置220からL2キャッシュRAM110にロードする命令である。ステップS9では、ループ処理(S4~S17)中でM周先にロード及びストアされると予測されるアドレスのデータをプリフェッチする。Mは、以下の式1により決定される。
 M×T1≧T2 ・・・(1)
  T1:ループ処理を1周実行する時間(クロックサイクル数)
  T2:PF命令発行からL2キャッシュにデータが格納されるまでの時間(クロックサイクル数)
 式1を満たす十分大きな値をMとして選択することによって、主記憶装置220へのアクセス時間を隠蔽するというプリフェッチの効果を最大にする。
 ステップS9のプリフェッチは、S11~S14でのロード処理に必要なデータが対象となる。つまり、プログラムAのS9では、1回のPF命令実行により8B×4=32Bのデータのプリフェッチを行う。図3のキャッシュライン111aに示すように、L2データRAMの1キャッシュラインは128Bのデータ容量であるため、プリフェッチが128B単位で行なわれるとすると、1度のPF命令実行でL2データRAMの1キャッシュラインに相当するデータが主記憶装置220からロードされる。しかし、プログラムAでは、1ループ実行毎に、S9に示す1回のPF命令が実行される。そのため、図3のキャッシュライン111aに示すような128Bの同一キャッシュラインに対して4つのプリフェッチ命令PF1~PF4が重複して発行される。しかし、1回のプリフェッチは1キャッシュライン、つまり128バイトのライン全体に有効であるため、結果的に3回分の余計なプリフェッチが行われることになる。
 余計なプリフェッチを行なわないようにプログラムを用意するという対応も考えられるが、この場合、まずプログラムの作成者がキャッシュラインのラインサイズ(図3に示す例では128B)を知っていなければならない。ラインサイズを知っていたとした場合、1ラインつまり128バイト単位でプリフェッチを行うのであれば、1ループで32バイトのデータがロードされる状況では、にループ内でループ変数iを4で割った剰余が0である場合のみプリフェッチを発行する命令を加える対応を考えることで、プリフェッチ命令を4ループに1回の割合で発行させることが可能となる。しかし、このような命令は、ループ内に剰余のための演算や条件分岐命令を加えなければならないため、1ループ毎にPF命令を実行する場合よりも、命令の実行効率を落としてしまう。
 ステップS10は、ストア用のプリフェッチである。アドレスA4(i+M)はストアアドレスを示している。本実施例では、演算結果をストアするアドレスは、A4(0),A4(1), ... ,A4(N)の範囲であるものとする。
 また、ストアアドレスは以下のような間隔で設定されているものとする。
 アドレスA4(i)  =A0(i)+0B
 アドレスA4(i+1) =A0(i)+8B
 アドレスA4(i+2) =A0(i)+16B
       ・
       ・
       ・
       ・
 アドレスA4(i+16)=A0(i)+128B
 このように、プログラムAでは、アドレスA4(i)から連続して演算結果をストアする。また、16周先のアドレスA4(i+16)はA4(i)+128Bであり、ループ16周でキャッシュライン128B分をアクセスすることになる。
 また、16周のループ処理の間に、
 アドレスA0(i+M)
 アドレスA0(i+1+M) =A0(I+M)+8B
 アドレスA0(i+2+M) =A0(I+M)+16B
      ・
      ・
      ・
 アドレスA0(i+15+M) =A0(I+M)+128Bのように16回プリフェッチ命令が発行される。
 ストアの場合、アドレスが8バイト単位で設定されていることもあり、1ループで1つのレジスタへのデータ書き込みが行われる。そのため、図3に示すように、8バイトのレジスタへのストアの場合、1ループで8バイト単位のストア処理が実行される。一方、ストア用のプリフェッチ(S10)もまた、1ループで1回実行される。図3のキャッシュライン111aに示すように、L2データRAMの1キャッシュラインは128Bのデータ容量であるため、プリフェッチ単位が128バイトであれば1度のPF命令実行で128Bのデータ容量が主記憶装置220からロードされる。しかし、プログラムAでは、1ループ実行で1回のPF命令が実行されるため、図3の111aに示すような128Bの同一ラインに対して16回のプリフェッチが発行される。そのため、プリフェッチサイズが128Bの場合と比較して、15回余計にプリフェッチ命令が発行されることになる。
 ループ部のS11~S14で実行されるロード動作と、1周前にロードしたデータを使用した演算処理は互いに依存関係がないために並列に処理することが可能であり、これらの処理を並列に実行することで、L1キャッシュRAM16をキャッシュミスしたことでL2キャッシュRAM110にアクセスする時間を隠蔽する。プログラムAでは、S15に、レジスタR0~R3に格納されたデータに基づく演算を実行し、演算結果をレジスタR8に格納する処理が示されている。また、S16で、レジスタR8に格納された演算結果を、ストアアドレスA4(i)にストアする。
 S17では、iがN-1であるか否かが判定される。iがN-1でなければ、処理をS4に戻し、ループ処理を継続する。一方、i=N-1である場合、ループ処理を抜けてS18以降の処理を実行する。
 S18~S23では、アドレスA0(N)~アドレスA3(N)からロードしてレジスタR4~R7に格納したデータを、レジスタR0~R3に移動する処理が示されている。アドレスA0(N)~A3(N)は参照範囲の最終アドレスであり、i=N+1のアドレスのロードは不要である。その後、S23でレジスタR0~R3に移動したデータを、S24で参照して演算し、演算結果をレジスタR8に格納する。そして、S24の演算結果を、S25でストアアドレスA4(N)に格納する。
 図3及びプログラムAを用いて説明したように、既にプリフェッチ対象となったキャッシュラインに対して複数回プリフェッチする処理が実行される場合、このような不要なPF命令が、L2キャッシュコントローラの第1パイプライン70の渋滞を招く。そこで、本実施形態では、第2パイプライン80を用いて渋滞を回避する。
 [L2キャッシュRAM バンク分け無しタイプ]
 図4は、バンク分けがされていないL2キャッシュRAMの一例を示す図である。図4に示されるL2キャッシュRAM110は、例えば、4ウェイのセットアソシアティブ方式のキャッシュメモリである。図4に示されるように、L2キャッシュRAM110は、複数のセットで構成されており、各セットは、キャッシュウェイ101a~101dに分けて管理される。
 図4に示されるL2キャッシュRAM110は、L2キャッシュRAM110が保持するデータを、キャッシュライン103-1~103-nと言う単位で管理する。図4に示す30は、プロセッサコアから出力される要求命令を示す。要求命令30は、例えば、47ビットであり、上位28ビット(46-19+1ビット)が物理アドレスのうちのタグアドレス、上位18~7ビットの12ビット(18-7+1ビット)が物理アドレスのうちのインデックスアドレス(IA:Index Address)、下位7ビットは物理アドレスのうちの1ライン128バイト内のどこかを示すアドレスである。
 各キャッシュラインは、例えば、プロセッサコア10からのLD命令又はPF命令に含まれるVA(仮想アドレス)をL1キャッシュコントローラが変換して得られるPA(物理アドレス)により特定される。
 L2キャッシュRAM110は、L2タグRAM140、L2データRAM120、ライトアンプ123a~123d、143a~143d、センスアンプ124a~124d、144a~134d、比較回路131a~131d及び選択回路121、122、141、142を含む。L2タグRAM140、及びL2データRAM120はそれぞれ、キャッシュライン103-1~103-nに対応した複数のエントリを有する。L2タグRAM140の各エントリには、「タグ」と呼ばれる物理アドレスの一部が保持される。「タグ」は、図4に示す要求命令30のタグアドレスに相当する。図4に例示されるL2キャッシュRAM110は、4つのウェイを有するため、連想度は「4」である。したがって、1つのインデックスアドレスにより、4つのキャッシュライン及び4つのタグが特定される。
 L2キャッシュRAM110はまた、選択回路130を備える。選択回路130には、センスアンプ124a~124dを介したL2データRAM120からの出力が入力し、比較回路131a~131dから出力されるヒットウェイ信号の値に応じて、いずれかの入力を選択して出力する。
 L2データRAM120の各エントリには、L2タグRAM140の「タグ」により特定される「データ」が保持される。
 L2タグRAM140には、インデックスアドレスIAが供給される。そして、供給されたインデックスアドレスに対応する各ウェイ101a~101dのエントリ、つまりタグアドレスが、各ウェイに対応する比較回路131a~131dに出力される。
 比較回路131a~131dはそれぞれ、プロセッサコア10から送信されたタグアドレスPAと、L2タグRAM140から読み出したタグアドレスとを比較することで、キャッシュミス又はキャッシュヒットを判定する回路である。比較回路131a~131dは、それぞれキャッシュウェイ101a~101dに関係付けられる。タグの一致を検出したウェイ、言い換えるとキャッシュヒットしたウェイに対応する比較回路の出力のみが1となり、他の比較回路の出力は0となる。その結果、比較回路131a~131dは、キャッシュヒットしたウェイに対応するビットが「1」となった、計4ビットのヒットウェイ信号を選択回路130に出力する。キャッシュミスの場合、主記憶装置上の物理アドレスからデータを取得する動作がなされる。
 キャッシュヒットが発生した場合であってメモリアクセス要求が読出し要求の場合には、IAにより指定されるL2データRAM120のキャッシュラインから、各キャッシュウェイに対応する4つのキャッシュラインのデータ値が選択回路130に読み出される。そして、選択回路130は、比較回路131a~131dから出力されるヒットウェイ信号により、ヒットウェイ信号が示すウェイに対応するデータ値を選択して出力する。
 [L2キャッシュRAM バンク分け有りタイプ]
 図5は、バンク分けされたL2キャッシュRAMの一例を示す図である。図5に示されるL2キャッシュRAM110a、110bは、図4に示されるL2キャッシュRAM110と同じ構成を有するので、説明を省略する。図4で示した例では、L2キャッシュRAMのラインは、12ビットのインデックスアドレスにより特定されていたが、図5に示すL2キャッシュRAM110a、110bは、12ビットのインデックスアドレスの最下位のビットでバンク分けされる。図5の例では、L2キャッシュRAM110aは、最下位ビットが「0」のインデックスアドレスにより特定されるデータを格納し、L2キャッシュRAM110bは、最下位ビットが「1」のインデックスアドレスにより特定されるデータを格納する。
 L2キャッシュRAM110a、110bは、それぞれ図4に示したL2キャッシュRAM110の半分のデータを有する。選択回路131-1a~131-1dには、インデックスアドレスにより特定されたL2キャッシュRAM110a、110b各々のキャッシュラインのデータと、インデックスアドレスの最下位ビット(IA[7])とが入力する。そして、選択回路131は、インデックスアドレスの最下位ビットに対応するL2キャッシュRAMの出力データを選択して、出力する。
 [L2キャッシュコントローラ]
 図1に示すL2キャッシュコントローラ90は、MOポート(Move-OutPort)63、LD(Load)ポート64、PF(Prefetch)ポート66、パイプライン選択部60、第1優先制御回路61、及び第2優先制御回路62を有する。
 第1優先制御回路61には、MOポート63からの置換命令、LDポート64からのロード命令およびPFポート66からのプリフェッチ命令が入力する。なお、図6で示すように、演算処理装置が複数のプロセッサコアを有する場合には、第1優先制御回路61には各コアから出力される各命令が入力する。第1優先制御回路61は、入力する要求種別、固定的な優先度に基づいて選択する。優先度としては一例として、ロード命令>置換命令>プリフェッチ命令の順とする。このように優先度を設定することで、デッドロックやライブロック状態の防止が可能となる。
 また、第2優先制御回路62には、プロセッサコアからのプリフェッチ命令が入力する。L2キャッシュコントローラ90はさらに、第1パイプライン70、及び第2パイプライン80を有する。このうち、第2パイプライン80は、プリフェッチ処理専用、より具体的にはLB160が保持するアドレスとプリフェッチ要求に対応するアドレスとの一致検出のために設けられるパイプラインである。このような専用パイプラインを設けることによって、L2キャッシュのプリフェッチ処理のスループット向上や、処理性能の向上を実現することができる。
 [L2キャッシュコントローラ:MOポート、LDポート、PFポート]
 MOポート63、LDポート64、PFポート66はプロセッサコア10に対応して設けられ、プロセッサコア10の数だけ存在する。よって、プロセッサコア10が複数ある場合、プロセッサコアの個数に応じたMOポート63、LDポート64、PFポート66が用意される。
 MOポート63は、L1置換命令(図示「置換命令」)をプロセッサコア10から受け取り、且つ保持するとともに、第1優先制御回路61によりL1置換命令が選択された場合、L1置換命令を第1パイプライン70に出力する。
 LDポート64は、LD命令(図示「ロード命令」)をプロセッサコア10から受け取り、且つ保持するとともに、第1優先制御回路61によりLD命令が選択された場合、LD命令を第1パイプライン70に出力する。
 PFポート66は、PF命令(図示「プリフェッチ命令」)をプロセッサコアから受け取り、且つ保持するとともに、第1パイプライン70及び第2パイプライン80に、パイプライン選択部60が選択した第1優先制御回路61、第2優先制御回路62を介してPF命令を出力する。PFポート66の一例は、図9A及び図9Bを用いて後述する。
 MOポート63、LDポート64、PFポート66は、プロセッサコア10からの命令のオーバフローを防止するために、プロセッサコア10からの命令通知で現在のポインタ値に1を加算(+1)し(インクリメント)、プロセッサコア10への開放通知で現在のポインタ値から1を減算する(-1)資源カウンタを持ち、資源カウンタがエントリ数を超えないように命令発行を制限する。MOポート63、LDポート64、PFポート66は、第1パイプライン70又は第2パイプラインに出力した命令のパイプライン処理が完了すると、L1キャッシュコントローラ18に開放通知を発行する。
 [L2キャッシュコントローラ:PFポートの一例]
 図6はL2キャッシュコントローラ90を示し、特にPFポートの一例の詳細を示す図である。PFポート66は、エントリ選択部66-1、空きエントリ選択部66-2、PF記憶回路66-3、デコーダ66-4を有する。
 PF記憶回路66-3はPF命令を保持する回路であり、有効ビット(Valid)、物理アドレス(PA)、コード(CODE)、第1パイプホールド(P1HLD)、投入禁止(INH)、第2パイプホールド(P2HLD)、第2パイプ終了(P2DONE)の情報を格納する。なお、エントリとは、上記情報をPF命令毎に格納する記憶領域を言う。
 有効ビット(Valid)はエントリの有効・無効を示すビットであり、「1」のときPF記憶回路66-3のエントリが有効であることを示し、「0」のときPF記憶回路66-3のエントリが無効であることを示す。第2パイプ終了(P2DONE)は、PAによって特定されるPF命令が第2パイプライン80で完了していることを示すビットであり、「1」のときPF命令処理終了を示し、「0」のときPF命令が終了していないことを示す。
 有効ビットが「1」から「0」に変更されるのは、第1パイプライン70又は第2パイプライン80でパイプライン処理が中止せずに完了した場合である。第2パイプライン80は、パイプライン処理を実行してLB160に対象データが登録されていないことがわかると、パイプライン処理を中止する。この場合、LB160に登録されていないエントリの第2パイプ終了(P2DONE)が「1」になり、且つ有効ビットは「1」のままである。後述のように、第2パイプ終了(P2DONE)が「1」になり、且つ有効ビットが「1」の場合、第1パイプライン70がPF命令を処理する。
 空きエントリ選択部66-2はPF記憶回路66-3の各エントリの有効ビットを参照し、有効ビット「0」のエントリを上書き対象のエントリ、言い換えれば、空きエントリと判断して、エントリ選択部66-1に空きエントリとして通知する。エントリ選択部66-1は、空きエントリ選択部66-2により通知された空きエントリにPF命令を登録する。
 コード(CODE)は、PF命令の種類を特定する情報である。コードは、「共有型命令プリフェッチ命令」、「共有型データプリフェッチ命令」、「排他型データプリフェッチ命令」の何れかを特定する。「共有型命令プリフェッチ命令」は、プリフェッチで取得した命令を、他のプロセッサコアで取得する「共有型」の状態でL2キャッシュRAM110に保持することを要求する信号である。「共有型データプリフェッチ命令」は、プリフェッチで取得したデータを、他のプロセッサコアで取得する「共有型」の状態でL2キャッシュRAM110に保持することを要求する信号である。「排他型データプリフェッチ命令」は、プリフェッチで取得したデータを排他型、つまり要求元プロセッサコアがデータを変更できる状態で保持することを要求する信号である。
 第1パイプホールド(P1HLD)は、第1パイプライン70がPF命令を処理中であることを示す。P1HLDが「1」の場合は第1パイプラインがPF命令を処理中であることを示している。第2パイプホールド(P2HLD)は、その値が「1」のときに第2パイプライン80がPF命令を処理中であることを示す。PFポート66は、パイプライン選択部60により選択された第1パイプライン70又は第2パイプライン80がPF命令の処理をしたことを対応するパイプラインから通知されると、対応する第1パイプホールド又は第2パイプホールドを処理中に変更する。
 投入禁止(INH)は、LB160が使用不可能などの条件により、PF命令を第1パイプライン70又は第2パイプライン80に出力できない状態であることを示す。
 デコーダ66-4は、第1パイプライン70又は第2パイプライン80から、ポート並びにエントリIDを特定する完了通知又は中止通知を受け取る。デコーダ66-4は、第1パイプライン70又は第2パイプライン80から完了通知を受け取ると、完了通知により特定されるPF記憶回路66-3のエントリの有効ビットを無効に設定する。デコーダ66-4は、第1パイプライン70又は第2パイプライン80から中止通知を受け取ると、中止通知により特定されるPF記憶回路66-3のエントリの第1パイプホールド又は第2パイプホールドを有効に設定する。
 PFポート66は、プロセッサコア10からPF命令を受け取り、空いているPF記憶回路66-3のエントリにPF命令を登録し、要求の受信順にパイプライン選択部60を介して第1パイプライン70/第2パイプライン80へPF命令を投入する。第1パイプライン70又は第2パイプライン80は、最終ステージで完了通知または中止通知をPFポート66へ出力する。処理完了の場合は、PFポート66は完了した処理に対応するPF記憶回路66-3のエントリを開放し、処理中止の場合は再度第1パイプライン70または第2パイプライン80へPF命令を出力する。
 [L2キャッシュコントローラ:パイプライン選択部の第1例]
 図7は、パイプライン選択部の一例を示す図である。図7に示すパイプライン選択部60aは、図6に示すパイプライン選択部60の一例である。パイプライン選択部60aは、論理積演算を行うAND回路60-1、60-3、60-4、及び論理和演算を行うOR回路60-2、60-5、60-6、選択回路60-7、60-8、及び優先回路優先回路60-21、60-22を有する。なお、図7に示す論理回路並びに入出力結線は、実際には、PFポート66の数だけ用意される。OR回路60-5、60-6は、PFポートの数だけある入出力結線が1つでも信号レベルが「ハイ」になれば、信号レベル「ハイ」の信号を出力する。
 パイプライン選択部60aは、PF要求を処理するパイプラインとして、第1パイプライン70あるいは第2パイプライン80を選択する。パイプライン選択部60aは、第1パイプホールド(HLD)、投入禁止(INH)、有効ビット信号(VALID)を入力信号としてPFポート66から受け取る。なお、有効ビット信号(VALID)は、PFポート66の物理アドレスのエントリ番号毎にエントリが有効か否かを示すビット信号であり、PFポート66のエントリ数分のビット値を有する。パイプライン選択部60aは、それらの入力信号を用いて、PF記憶回路66-3のエントリが有効であり、且つ第1パイプ処理中又はLB160が投入禁止状態でない場合、第1又は第2パイプラインにPF要求を投入する処理を行う。
 また、パイプライン選択部60aは、第2パイプホールド(P2HLD)、第2パイプ終了(P2DONE)を入力信号としてPFポート6から受け取り、何れかの入力信号が「1」の場合、第2パイプライン80へのPF命令の投入を抑止する。なお、図9を用いて後述するように、第2パイプライン80はPF命令をLB160に投入して、LB160が保持するエントリのPAと、PF命令が対象とするPAとが一致するか否かを検出する処理を行う。なお、このように、LB160が保持するエントリに対して、PF要求又はLD要求が対象とするデータのPAとの一致を検出することを、当明細書では「PA一致」と言う。
 第2パイプライン80により「PA一致」が検出されなければ、本実施例では次に第1パイプライン70での処理を行う。したがって、パイプライン選択部60aは、第2パイプ終了(P2DONE)が「1」、つまり「PA一致なし」の場合には、第2パイプライン80にPF命令を投入しないように動作する。これは、第2パイプライン80は、LB160での「PA一致」を行うものであり、一度「PA一致なし」である場合、再度「PA一致」処理を行っても「PA一致なし」結果が得られるだけであるからである。
 パイプライン選択部60aはまた、P2HLDが「1」の場合、つまり第2パイプラインが処理中である場合にも、第2パイプライン80にPF命令を投入しないように動作する。この場合、第2パイプライン80は処理中であるので、同じ処理が繰り返されないように、PF命令の第2パイプライン80への投入を抑止する。
 選択回路60-7は、OR回路60-5の出力信号S60-5aが「1」、つまりS60-5aが第1パイプラインへの要求エントリを示している場合、PF命令を第1優先制御回路61へ出力する。選択回路60-8は、OR回路60-6の出力信号S60-6aが「1」、つまりS60-6aが第2パイプラインへの要求エントリを示している場合、PF命令を第2優先制御回路62へ出力する。
 AND回路60-1は、PFポート66から第1パイプホールド信号(P1HLD)の反転信号、及び投入禁止信号(INH)の反転信号を入力信号として受け取り、入力信号が全て「1」、つまりP1HLD、INHがともに「0」であるとき、値が「1」の信号S60-1をAND回路60-4とAND回路60-3とに出力する。OR回路60-2は、PFポート66から第2パイプホールド(P2HLD)信号及び第2パイプ終了(P2DONE)を入力信号として受け取り、いずれかの入力信号が「1」のとき値が「1」の信号S60-2をAND回路60-4に出力する。
 AND回路60-3は、PFポート66から有効ビット信号(VALID)、及び信号S60-1を入力信号として受け取り、入力信号が全て「1」のとき値が「1」の信号S60-3aを出力する。信号S60-3aは、第1優先制御回路61に出力されるとともに、入力する8ビット信号から1ビットの「PIPE要求信号」を生成するOR回路60-5及び優先回路60-21を介して選択回路60-7に信号S60-5aとして出力される。第1優先制御回路61に出力された信号S60-3aは、第1優先制御回路61の選択信号として、第1優先制御回路61で使用される。
 選択回路60-7は、値が「1」の信号S60-5aを受け取ると、エントリ番号に対応するPFポートからのPF命令の投入先として、第1優先制御回路61を選択して、第1優先制御回路61にPF命令を投入する。優先回路60-21は、例えば、エントリがPFポートに登録された時間に従って、最も古いエントリ番号を選択する。
 AND回路60-4は、PFポート66から有効ビット信号(VALID)、信号S60-1、及び信号S60-2の反転信号を入力信号として受け取り、入力信号が全て「1」である場合、値「1」の信号S60-4aを出力する。信号S60-4aは、第2優先制御回路62に出力されるとともに、OR回路60-5及び優先回路60-21を介して選択回路60-8に出力される。選択回路60-8は、値「1」の信号S60-6aを受け取ると、エントリ番号に対応するPFポートからのPF命令の投入先として第2優先制御回路62を選択して、第2優先制御回路62にPF命令を投入する。優先回路60-22は、例えば、エントリがPFポートに登録された時間に従って、最も古いエントリ番号を選択する。
 AND回路60-3の入力信号は、AND回路60-4の全入力信号を受け取る。AND回路60-3の出力信号、及び、AND回路60-4の出力信号は、それぞれ選択回路60-7のPIPE要求信号、及び、選択回路60-8のPIPE要求信号になる。このような回路構成により、第2パイプライン80にPF命令の投入が要求される場合は、第1パイプライン70にもPF命令の投入が要求される。しかし、上記したように、第1パイプライン70ではPF命令処理の優先順位は他の命令処理と比較して低く設定されている。そのため、PF命令は、他の命令がある場合、第1優先制御回路61により選択されず、第1パイプライン70には投入されない。
 一方、第2パイプライン80は、PF命令専用であるため、パイプライン選択部60から受け取ったPF命令を処理し、PA一致の検出処理を実行する。第2パイプライン80において「PA一致」が得られたPF命令は、PFポートのエントリから削除される。言い換えれば、第2パイプライン80は、LB160から出力される完了信号を受け取って、PF命令の対象となっていたLB160のエントリの有効ビットを、「0」にする。第2パイプライン80によって「PA一致」とならないPF命令のエントリは、第2パイプ終了(P2DONE)が「1」になり、第1パイプライン70が処理を完了するまで、PFポート66で有効なエントリとして保持される。
 このような動作により、第1のパイプライン70の状態が「ビジー状態」である場合、第1優先制御回路61にPF命令投入される機会が後回しにされる一方、第2パイプライン80はPF命令専用であることから一定のスループット以上で処理される。そのため、LB160でアドレス一致した要求がすべて第2パイプライン80で処理され、L2タグRAM140でTAG検索を行なわないと完了できない要求のみが第1のパイプライン70で処理されるように動作する。
 このように、要求先の物理アドレスを特定するPF命令は、優先的に第2優先制御回路62に出力されるとともに、第2パイプライン80でPA一致検出処理が実行される。第2パイプライン80でPA一致検出の無かったPF命令は、第1パイプライン70で処理される。このような処理により、演算処理装置100は、第1パイプライン70におけるPF命令処理の負荷を下げることが出来る。
 [L2キャッシュコントローラ:パイプライン選択部の第2例]
 図8は、パイプライン選択部の別な一例を示す図である。図8に示すパイプライン選択部60bは、図6に示すパイプライン選択部60の一例であり、図7に示すパイプライン選択部60aと異なる例である。
 パイプライン選択部60bは、パイプライン選択部60aの2つの選択回路60-7、60-8の代わりに、1つの選択回路60-9を有する。このようにすることで、PF命令の選択回路を1つ減らすと共に、選択回路の入力側結線を減らすことが出来る。
 図8に示すパイプライン選択部60bは、図7に示すパイプライン選択部60aに比してAND回路60-3に代わりAND回路60-3bを有し、OR回路60-10~60-12と、AND回路60-13a~60-13hとをさらに有する。なお、図7に示す参照符号と同じ参照符号が付された要素に関しては、図7を用いて既に説明したため説明を省略する。
 AND回路60-3bは、図7に示すAND回路60-3とは異なりOR回路60-2の出力信号S60-2も入力信号とするので、第2パイプ終了又は第2パイプホールドが「1」である場合に、「1」が出力可能になる。図7の回路と同様、図8の回路でも、第2パイプ終了又は第2パイプホールドが「1」である場合、第2パイプライン80にはPF命令は出力されない。そのため、信号S60-3bは、第1パイプライン70のみへのPF命令の出力を示す信号である。また、信号S60-4bは、第1パイプライン70のみへのPF命令が存在することを示す信号である。また、信号S60-4bは、第1パイプライン70と第2パイプライン80の両方へのPF命令があることを示す信号であり、信号S60-6bは、第1パイプライン70と第2パイプライン80の両方へPF要求が存在することを示す信号である。
 選択回路を1つにしても、PF命令を選択的に第1パイプライン70又は第2パイプライン80に出力できるようにするために、パイプライン選択部60bは、「優先度周期信号」を用いる。優先度周期信号は、第1パイプラインと第2パイプラインとのどちらを優先するかを周期的に変更するために用いられる。優先度周期信号がオンの場合には、第2のパイプ処理中および処理済みフラグの要求を優先して選択し、もし第2のパイプ処理中および処理済みフラグの要求がなければ、それ以外の要求のなかから要求を選択する。優先度周期信号がオフの場合はその逆である。優先度周期信号は、クロックに同期して出力が「1」と「0」に変わる信号である。優先度周期信号は、AND回路60-13a~60-13hの入力信号である。AND回路60-13a、60-13b、60-13e、60-13fは、優先度周期信号を正転入力として受け取るので、AND回路60-13a、60-13b、60-13e、60-13fは、優先度周期信号が「1」の場合、「1」を出力可能である。一方、AND回路60-13c、60-13d、60-13g、60-13hは、優先度周期信号を反転入力として受け取るので、AND回路60-13a、60-13b、60-13e、60-13fは、優先度周期信号が「0」の場合、「1」を出力可能である。
 なお、演算処理装置に複数のプロセッサコアが設けられており、各コアと括り付けられている複数のプリフェッチポートが設けられ、各プリフェッチポートからの要求をプライオリティ制御部が選択して第1および第2のパイプラインへ投入する構成である場合、各プリフェッチポートに供給する優先度周期信号の位相を逆位相にする。
 位相を互いに逆位相とすることで、あるコアからは第2のパイプへの要求を出力する一方、別のコアからは第2のパイプでの処理が終わった要求を第2のパイプへ要求するといった具合に、各プリフェッチポートから常時第1および第2のパイプへの要求を満遍なく行なうことが出来る。
 AND回路60-3b、60-4は、有効ビット信号(VALID)を受け取る。有効ビット信号(VALID)は、PFポート66の物理アドレスのエントリ番号毎にエントリが有効か否かを示すビット信号であり、PFポート66のエントリ数分のビット値を有する。また、AND回路60-3b、60-4は、AND回路60-1、60-2の出力からは、エントリ毎に異なる属性値を受け取る。そのため、優先度周期信号が「1」の場合、信号S60-3bが「1」となるエントリは、AND回路60-13c、60-13dではなく、AND回路60-13a、60-13bで優先的に処理される。一方、優先度周期信号が「0」の場合、信号S60-3b及びS60-4bが「0」となるエントリは、AND回路60-13c、60-13dで優先的に処理される。このように、優先度周期信号が「0」と「1」の値を周期的に変更することで、PFポート66に保持されるPF命令が優先度周期信号に応じて選択的に処理されることになる。
 AND回路60-13aは、優先度周期信号とAND回路60-3bの出力が「1」の場合に、値が「1」の信号を出力する。S60-13aの出力は、OR回路60-10に供給される。
 AND回路60-13bは、優先度周期信号とAND回路60-4の出力S60-4が「1」であり且つAND回路60-3aの出力S60-3が「0」の場合に、「1」をOR回路60-11に出力する。AND回路60-13bからの信号は、OR回路60-10とOR回路60-11とに供給される。
 AND回路60-13cは、優先度周期信号が「0」であり且つAND回路60-4の出力が「1」の場合に、値が「1」の信号をOR回路60-10とOR回路60-11とに出力する。AND回路60-11からの信号は、出力は第2パイプライン80へのPF命令出力として動作する。一方で、AND回路60-13cの出力は、OR回路60-11同様に、OR回路60-10にも出力されるので、図7に示すパイプライン選択部60a同様に、第2パイプ終了又は第2パイプ中断以外の場合でも、第1パイプライン70へPF命令は出力される。
 AND回路60-13dは、優先度周期信号が「0」であり且つAND回路60-3bの出力が「1」であり且つAND回路60-4の出力が「0」の場合に、値が「1」の信号をOR回路60-12に出力する。
 AND回路60-13eは、優先度周期信号が「1」であり、信号S60-3bが「1」の場合に、値が「1」の信号をOR回路60-12に出力する。
 AND回路60-13fは、優先度周期信号が「1」であり、信号S60-5bの値が「0」である場合に、値が「1」の信号をOR回路60-12に出力する。
 AND回路60-13gは、優先度周期信号が「0」であり、信号S60-4が「1」の場合に、値が「1」の信号をOR回路60-12に出力する。
 AND回路60-13hは、優先度周期信号が「0」であり、信号S60-6bの値が「0」であり、且つ信号S60-3bの値が「1」の場合に、値が「1」の信号をOR回路60-12に出力する。
 OR回路60-10は、優先度周期信号の値で決まるエントリのPF命令を選択する信号S60-10を、第1優先制御回路61を介して第1パイプライン70に出力する。また、OR回路60-11は、優先度周期信号で決まるエントリのPF命令のうち第2パイプ処理終了又は第2パイプホールドを除くPF命令を選択する信号S60-11を、第2優先制御回路62を介して第2パイプライン80に出力する。
 OR回路60-12は、制御信号S60-10、S60-11の出力に同期して、PF命令の出力先を示す信号を、選択回路60-9に出力する。選択回路60-9は、入力する信号の値に応じて、PF命令を第1優先制御回路61または第2優先制御回路に出力する。
 [L2キャッシュコントローラ:プロセッサコアからの命令]
 LD命令は、実行部14にデータをロードする命令であり、ストア命令は、主記憶装置220にデータを格納する命令である。PF命令は、主記憶装置220からL2キャッシュRAM110へデータをロードする命令である。
 L1置換命令は、L1キャッシュRAM16の置換、あるいは、L2キャッシュコントローラ90からの指示によってL1キャッシュRAM16が保持するデータを無効化する命令である。L1置換命令によって、L1キャッシュRAM16の更新データのL2キャッシュRAM110への更新反映、L1キャッシュRAM16の無効化に伴うL2タグRAM140の更新などが行なわれる。
 L2置換命令は、PF命令やLD命令によりL2キャッシュRAM110でキャッシュミスが生じた場合、主記憶装置220からロードしたデータを(どこに)格納するために、あるキャッシュラインからデータを追い出す命令である。
 MC置換命令は、L2置換命令が完了し、MC200からのデータ応答があると、データ入力バッファ32に保持されるMC200からのデータを、L2キャッシュRAM110への書き込む命令、又はプロセッサコア10にデータ出力を行う命令である。MC200からのデータが、PF命令によって獲得された場合には、L2タグRAM140の更新、およびL2データRAM120への書き込みを行う。MC200からのデータが、LD命令によって獲得された場合には、プロセッサコア10へのデータ出力およびL1置換命令の発行を行なう。
 [優先制御回路]
 第1優先制御回路61は、パイプライン選択部60を介してMOポート63、LDポート64、及びPFポート66からそれぞれMO命令、LD命令、及びPF命令を受け取り、所定の優先順位に従って第1パイプライン70へ命令を投入する。第1優先制御回路61は、例えば、第1パイプライン70に投入される命令を、L1置換命令、MC置換命令、L2置換命令、LD命令、PF命令の優先順番で第1パイプラインに投入する。よって、L1置換命令の優先順位が一番高く、PF命令の優先順位が一番低い。
 また、L1置換命令、LD命令、PF命令におけるコア間の選択は均等になるように選択される。また、MOポート及びLDポートはコア毎に用意されるため、第1優先制御回路61には、他コアからのMO命令又はLD命令が入力される。
 PFポートはコア毎に用意されるため、パイプライン選択部60には、他コアからのPF命令が入力される。第2優先制御回路62は、パイプライン選択部60が出力したPF命令を第2パイプライン80へ投入する。
 第1優先制御回路61は、命令の種類で投入可能なエントリを判断した後に、投入可能なエントリからコアからの要求が最も古いエントリを選んでパイプラインへ命令を出力してもよい。
 [第1パイプライン]
 第1パイプライン70は、L2キャッシュRAM110へのデータアクセス制御、各種資源管理を行う。第1パイプライン70は、例えば、LD命令又はPF命令に従って、L2キャッシュRAM110のキャッシュミス又はキャッシュヒット判定を行う。第1パイプライン70はさらに、LB160に保持される主記憶装置220に対するLD命令中のデータエントリと、LD命令又はPF命令のキャッシュラインとの一致又は不一致の判定を行う。なお、以下において、主記憶装置220に対するロード命令を、「MLD命令」と言う。
 第1パイプライン70は、L2キャッシュRAM110でキャッシュミスが生じると、LDポート64から受け取ったLD命令又はPFポート66から受け取ったPF命令を、LB160に投入する。その結果、第1パイプライン70は、LB160からPAが一致しているか否かを示す信号を受信する。
 また、第1パイプライン70は、L2データRAM120、L”タグRAM140との間の情報のリード/ライト(図中「R/W」)を実行する。
 第1パイプライン70は、パイプラインの処理が完了したことを示す完了信号、又は、処理が中断したことを示す中断信号を、MOポート63、LDポート64、PFポート66へ供給する。なお、第1パイプラインの処理の一例は、図11及び図12を用いて後述する。
 また、図1には、ヒットバッファ170が示されてる。キャッシュヒット時には、第1パイプライン70はヒットしたアドレスをヒットバッファ170に登録する。
 [第2パイプライン]
 第2パイプライン80は、LB160に保持されるMLD命令発行中のデータの物理アドレスと、PF命令の物理アドレスとの一致を検出するパイプラインである。第1パイプライン70が、L2キャッシュRAM110へのデータアクセス制御全般を行うのに対して、第2パイプライン80の処理がプリフェッチ処理に(何に)限定されている。第2パイプライン80の行う処理を限定する理由の1つは、同一の物理アドレスに対して連続してPF命令を処理するためである。
 第2パイプライン80は、LB160からのPA一致/不一致を示す信号に基づいて、PF命令に係るPAとLB160エントリのPAとが一致しているか否かを判別する。そして、PA一致あるいはPA不一致の判定結果を、MOポート63、LDポート64、PFポート66のそれぞれに供給する。 なお、図1の例では、第2パイプライン80にはLB160からの出力と、ヒットバッファ(HB)170からの出力との論理和を取った信号が供給されている。
 [ロードバッファ]
 図9A及び図9Bは、ロードバッファの一例を示す図である。
 LB160は、L2キャッシュRAM110に格納するデータを保持する記憶部である。
 LB160は、エントリ選択部160-1、空きエントリ選択部160-2、記憶部160-3、デコーダ160-4、160-13、PA比較部160-5、AND回路160-6、OR回路160-7を有する。LB160はさらに、LBエントリ監視部160-10、選択回路160-11、160-12を有する。
 記憶部160-3は、有効ビット(Valid)、物理アドレス(PA)、コード(CODE)、PF番号、L1識別情報(L1LID)、ホールド(HLD)、及びコアID(CORE_ID)を登録するエントリ構成を有する。記憶部160-3はさらに、L2ウェイ識別情報(L2WAYID)、メインコントローラ命令済みフラグ(Req_issued)、メモリコントローラ応答受信(MS_cplt)、L2置換命令完了(MO_cplt)を登録するエントリ構成を有する。
 物理アドレス(PA)、及びコード(CODE)は、プロセッサコア10で生成されて、LDポート64又はPFポート66を介して、LD命令又はPF命令の一部としてLB160に送られ、LB160で最初のエントリ獲得により登録される。
 L1識別番号又はコアIDは、プロセッサコア10で生成され、LDポート64を介して、LB160で最初のエントリ獲得により登録される。L2ウェイIDは、L2タグRAM140で生成され、LB160で最初のエントリ獲得により登録される。
 PF命令またはLD命令においてキャッシュミスを検出し、かつLB160でPA不一致が生じた場合、第1パイプライン70は、パイプライン処理完了時に、LB160のエントリを獲得するとともに、LB160を介してMC200にMLD命令を行なう。
 LB160から獲得するエントリは一例として、記憶部160-3の有効ビット(Valid)の値が「0」を示すエントリのうち、獲得されたのが最も古いエントリが選択される。選択されたエントリには、第1パイプライン70からのエントリ獲得指示とともに、PA、CODE、REQ_ID、PF、L2ウェイID(L2WAYID)等の情報を含む。
 また、第1パイプライン70で新たに処理が実行される毎に、LB160では第1パイプライン70又は第2パイプライン80から送出されるPAと記憶部160-3各有効エントリとのPA一致を検出し、その結果を第1パイプライン70又は第2パイプライン80に送出する。
 空きエントリ選択部160-2は、有効ビット(Valid)が無効となっているエントリを検索して、エントリ選択部161に通知する。
 LB160が、LD命令又はPF命令又を受け取ると、空きエントリ選択部162により通知されたエントリに対して、LD命令又はPF命令を登録する。登録されたエントリから、L2置換命令、MC置換命令が所定の条件にしたがって、第1のパイプに要求される。デコーダ160-4は、第1パイプライン70から、エントリIDを特定した完了通知又は中止通知を受け取る。デコーダ160-4は、第1パイプライン70からMC置換命令の完了通知を受け取ると、完了通知により特定されるエントリの有効ビットを無効に設定する。
 デコーダ160-4は、第1パイプライン70から中止通知を受け取ると、中止通知により特定されるエントリのホールドを無効に設定する。デコーダ160-13は、MC200からデータを読み出したことを示すメモリ応答信号を受け取り、メモリ応答信号により特定されるエントリのメモリコントローラ応答受信(MS_cplt)を「1」にする。
 PA比較部160-5は、第1パイプライン70で処理中のLD命令又はPF命令の対象データのPAと、LB160に保持されているデータのPAとを比較することで、両データの一致を判断する。また、第2パイプライン80で処理中のPF命令の対象データのPAとLB160に保持されているデータのPAとを比較することで、両データの一致を判断する。なお、図9Aには、1つのPA比較部160-5が示されるが、PA比較部160-5は、記憶部160-3のエントリ毎に1つある。
 AND回路160-6は、記憶部160-3のエントリの数だけある。AND回路160-6は、該当エントリの有効ビットが「1」であり且つPA比較部160-5から受け取った信号が「1」である場合、「1」をOR回路160-7に出力する。
 OR回路160-7は、複数のAND回路160-6の出力信号を入力信号として受け取り、入力信号のいずれかの値が「1」である場合、出力信号を「PA一致通知」として、第1パイプライン70及び第2パイプライン80に出力する。
 LB160は、第1パイプライン70からLD命令又はPF命令を受け取り、記憶部160-3の空いているエントリにLD命令又はPF命令を登録する。LB160はまた、記憶部160-3から受信順に命令を取り出し、MC200へMLD命令を投入する。第1パイプライン70は、完了通知または中止通知をLDポート64またはPFポート66へ供給して、LDポート64又はPFポート66から記憶部160-3のエントリを開放する。
 LBエントリ監視部160-10は、記憶部160-3を参照して、記憶部160-3のエントリの有効ビット(Valid)が「1」、及びメインコントローラ命令済みフラグ(Req_issued)が「0」のとき、MC200に当該エントリに対応する命令を投入するための信号S160-10aを選択回路160-11に供給するように動作する。
 選択回路160-11は、選択信号S160-10aをLBエントリ監視部160-10から受け取ると、選択信号S160-10a生成の条件となったエントリを置換する置換処理命令を、第1優先制御回路61に供給する。
 LBエントリ監視部160-10は、160-3のエントリの有効ビット(Valid)及びメモリへの要求発行完了(Req_issued)、L2置換命令完了(MO_CPLT)及びメモリコントローラ応答受信(MS_cplt)が「1」であり、ホールド(hld flg)が「0」のときに信号S160-10bを選択回路160-12に供給するように動作する。置換回路160-12は、LBエントリ監視部160-10から信号S160-10bを受け取ると、選択部61にMC置換命令を出力する。
 なお、図9Aでは、1つのロードバッファを示したが、図5に示すようにL2キャッシュRAMがバンク分けされる場合、ロードバッファはバンク分けされたL2キャッシュRAM110a、110b毎に用意される。このように、バンク分けされたL2キャッシュRAMとロードバッファとをバンク毎にセットにして用意することで、図12で後述するように、互いに異なるバンクであれば、L2タグRAMへのアクセス、又は、LBのPA一致検出を同じサイクルで実行することが可能になる。
 [ヒットバッファ]
 ヒットバッファ(HB)170は、第1パイプライン70がキャッシュヒットを判定した場合、キャッシュヒットが生じたPF命令の要求アドレス等を保持する記憶回路である。第2パイプライン80は、LB160に保持されるエントリのPAが、プリフェッチ対象のPAに一致するかどうか判定する処理を実行するが、主記憶装置220からデータをロードし終わると、LB160から対応するエントリが削除される。そのため、第2パイプライン80の処理終了後に、第1パイプラインで主記憶装置220からのロードを終了したPF命令によるL2キャッシュRAM110へのアクセスが生じる。そこで、第2パイプライン80でPF命令の処理が終了するように、第1パイプラインでキャッシュヒットしたヒットバッファ170でPF命令を保持して、第2パイプライン80により(何と何との)PA一致検出可能とすることで、第1パイプライン70のPF命令処理を削減することが出来る。
 ヒットバッファ170は、LB160とは別にヒットバッファ用の記憶回路を有してもよいし、ロードバッファ160にヒットバッファの役割を加えてもよい。
 図10A及び図10Bは、ヒットバッファの機能を加えたロードバッファの一例である。図10A及び図10Bに図示されるロードバッファ160-3bは、有効ビット(Valid)を保持する領域と、ホールド(HLD)を保持する領域との間に、ヒットバリッド(Hit_Valid)を格納する記憶領域を有する。ヒットバリッドは、ロードバッファ160-3bの対応するエントリがヒットバッファとして使用されているか否かを示すフラグである。ヒットバリッドが「1」の場合に、対応するエントリがヒットバッファとして使用されている。ヒットバリッドは、有効ビット(Valid)とは排他的なビット値が格納される。つまり、第1又は第2パイプラインが、LB160のエントリによって主記憶装置220からデータをロードして、有効ビット(Valid)が「0」に代わると、ヒットバリッド(Hit_Valid)が「1」になる。通常、空きエントリ選択部162は、有効ビット(Valid)が「0」のエントリを「空きエントリ」とみなしてエントリ選択部161に通知するため、有効ビット(Valid)が「0」のエントリは新しいエントリに上書きされる。したがって、ロードバッファ160-3bのエントリは、次のエントリに上書きされるまでヒットバッファ170として利用可能である。ヒットバッファの記憶領域は、ロードバッファ160-3bにおいて、大きな記憶領域を占有しない。このように、ロードバッファ160-3b内の一部の記憶領域をヒットバッファ170とすることで、ロードバッファ160-3bの記憶領域を不当に大きくすることはない。
 PF命令またはLD命令により第1パイプライン70がキャッシュミスを検出した場合、第1パイプライン70の処理完了時に、エントリ選択部160-1により、ロードバッファ160-3bのエントリのうち、対応する有効ビットが「0」であるエントリを獲得する。その場合、ヒットバリッドも「0」であるエントリを優先的に選択することで、ヒットバリッドのデータをより長時間、ロードバッファ160-3bに保持することができ、第2パイプライン80がヒットバリッドに基づいてPF命令の処理を実行できるので、第1パイプライン70のPF命令処理負荷を軽減することが出来る。
 空きエントリ選択部162は、有効ビットが「0」且つヒットバリッドが「0」であるエントリが存在しなければ、有効ビットが「0」且つヒットバリッドが「1」であるエントリの中から、新しいエントリを選択する。
 PF命令またはLD命令を処理する第1パイプライン70がキャッシュヒットを検出した場合、パイプラインの完了時に、有効ビッドが「0」且つヒットバリッドが「0」であるエントリを選択して、選択したエントリにキャッシュヒットしたデータを登録する。選択されたエントリには、第1パイプライン70からPA、CODE、PF、L2_way_ID等の情報が送出され、エントリに格納され、ヒットバリッドが「1」になるとともに、有効ビットも「1」にする。
 ロードバッファにヒットバッファ機能を追加する場合、図9Aに示したロードバッファ160の周辺回路に加えて、図10Aの例ではAND回路160-8、OR回路160-9、160-14が加えられる。AND回路160-8は、記憶部160-3のエントリの数だけある。AND回路160-8は、PA比較部160-5の出力信号と、ヒットバリッドの値とを入力信号として受け取り、入力信号がいずれも値「1」である場合、OR回路160-9に値「1」の信号を出力する。OR回路160-9は、AND回路160-8の出力信号を入力信号として受け取り、いずれかのAND回路160-8出力のビット値が「1」である場合、OR回路160-14に値が「1」の信号を出力する。OR回路160-14は、OR回路160-7の出力信号と、OR回路160-9の出力信号を受け取り、いずれかの信号が「1」であれば、「PA一致通知」として値が「1」の信号を、第2パイプライン80に出力する。
 このように、第2パイプライン80への「PA一致通知」は、ロードバッファに格納されるPF命令のPA一致と、ヒットバッファとして利用されているエントリに格納されるPAとの一致を含む。第2パイプライン80では、ヒットバッファの一致でも、ロードバッファの一致でも、PF命令の完了処理を実行するために使用されるので、OR回路160-7の出力信号と、OR回路160-9の出力信号は、OR回路160-14で論理和演算される。
 また、第1パイプライン70のフロー毎に、LB160は、第1パイプライン70又は第2パイプライン80から送出されるPAと160-3bの各有効エントリとのPA一致を検出し、その結果を第1パイプライン70又は第2パイプライン80に送出する。ただし、第1パイプラインではタグを常時検索することから、ヒットバリッドに基づくキャッシュヒットの判定は不要であるため、第1パイプライン70へ送出するのは、LB160の有効エントリのPA一致結果のみでよい。これに対して、第2パイプライン80へは、LB160の有効エントリのPA一致結果と有効ヒットバッファエントリのPA一致結果との論理和を送出する。
 第2パイプライン80は、HBのPA一致条件により、LB一致条件に加えてキャッシュヒット条件によってもPF命令を完了させることができる。LB160は、MC200からのデータ応答を受け置換命令を第1パイプライン70に対して出力し、その出力完了とともに、エントリの有効ビットを「0」にすることで、エントリを開放する。
 [第1パイプライン制御]
 図11は、第1及び第2パイプラインによる処理の一例を示す図である。第1パイプライン70は、要求読出(RR)、優先順位決定(PD1、PD2)、読出用PA入力(PI)、タグ読出(TR)、キャッシュヒット検出(CD)、処理結果通知(RN)、及び要求処理判断(RP)のステージを有する。第1パイプライン70はさらに、タグ更新PA入力)(TI)、タグ更新動作(TW)、PA転送(LP)、PA一致検出(LD)、及びPA一致結果転送(LT)のステージを有する。
 要求読出(RR)ステージでは、第1パイプライン70は、LDポート64又はPFポート66またはMOポート63またはLB160に保持される要求を読み取る。
 優先順位決定(PD1、PD2)ステージでは、LDポート64、PFポート66、MOポート63またはLB160から読み取った要求を第1優先制御回路61に供給して、第1パイプライン70は所定の優先順位により第1優先制御回路61により決定された要求を受け取る。
 読出用PA入力(PI)ステージでは、第1パイプライン70は、L2タグRAM140にアクセス対象データの物理アドレスを入力する。PA入力ステージでは、第1パイプライン70は、LB160へのPA転送(LP)も行う。
 タグ読出(TR)ステージでは、第1パイプライン70は、L2タグRAM140からタグを読み出す。タグ読出ステージでは、第1パイプライン70は、LB160でのPA一致検出(LD)も行う。
 キャッシュヒット検出(CD)ステージでは、第1パイプライン70は、L2キャッシュRAM110のキャッシュヒット又はキャッシュミスを検出する。キャッシュヒット検出ステージでは、第1パイプライン70は、LB160でのPA一致結果転送(LT)も行う。
 要求処理判断(RP)ステージでは、キャッシュヒット検出ステージの検出結果に従って、処理がなされる。キャッシュミス検出の場合、第1パイプライン70は、LB160のエントリにLD命令を投入して、処理結果通知(RN)ステージで、LDポート64へ完了通知を出力する。PF命令の場合は処理結果通知ステージで、PFポート66へ完了通知を出力する。
 LD命令がキャッシュヒット検出の場合、第1パイプライン70は、L2データRAM120からデータを読み出して、処理結果通知(RN)ステージで、LDポート64へ完了通知を供給する。第1パイプライン70は、LB160へLD命令投入後、LB160から「PA一致通知」を受け取り、LDポート64に中止通知を供給する。
 LB160は、MC置換命令の完了通知を受け取ると、完了通知により特定されたエントリを開放する。その他、LD命令が処理されなかった場合、第1パイプライン70は、処理結果通知ステージで、LB160に中止通知を供給する。
 PF命令がキャッシュヒット検出の場合、第1パイプライン70は、処理結果通知ステージで、PFポート66へ完了通知を供給する。第1パイプライン70は、LB160へPF命令投入後、LB160から「PA一致通知」を受け取り、LB160で保持する要求間に差異がなければ、第1パイプライン70は、PFポート66に完了通知を供給する。
 タグ更新PA入力ステージでは、第1パイプライン70は、主記憶装置220や、L1キャッシュRAM16から出力されたデータによるタグ更新用のPAを受け取る。タグ更新動作ステージでは、第1パイプライン70は、入力されたPAを用いてL2タグRAM140のタグデータの更新を行う。つまり、タグ更新動作ステージでは、L2データRAM120及びL2タグRAM140に対して書き込み動作が行われる。
 401は、第1パイプライン70によるパイプライン処理の第1フローを示す。402は、第1フローの開始から2サイクル後に実行されるパイプライン処理の第2フローを示す。403は、第2フロー開始から2サイクル後に実行されるパイプライン処理の第3フローを示す。404は、第3フロー開始から2サイクル後に実行されるパイプライン処理の第4フローを示す。
 パイプライン処理401~404に示すように、第1パイプライン70は、先行するフローに対して、2サイクル遅れて後続フローを実行する。このように、2クロックサイクル遅れて後続フローを実行するために、例えば、1サイクルおきにパイプラインが実行されないアイドルサイクルが設定される。
 411は、「9」サイクルで行われるパイプライン処理401のタグ書き込み処理を示す。412は、「8」サイクルで行われるパイプライン処理403のタグ読み出し処理を示す。413は、「10」サイクルで行われるパイプライン処理404のタグ読み出し処理を示す。図11に示されるように、「9」サイクルのタグ書き込み処理411と、「8」サイクルのタグ読み出し処理412及び「10」サイクルのタグ読み出し処理413は、同サイクルに生じない。このように、先行フローから2クロックサイクル遅れて後続フローの処理を行うことで、各フローの偶数クロックサイクルで行われるタグ読み出し動作と、各フローの奇数クロックサイクルで行われるタグ書き込み動作は、異なるクロックサイクルで実施することが可能になる。
 図4に示すL2キャッシュRAM110は、読み出し/書き込み共有の1ポートRAMであり、ライトアンプ123a~123d、143a~143dとセンスアンプ124a~124d、144a~144dとは、共通カラム線を使い、同サイクルでメモリセルへの書き込みと読み出しは出来ない。同じサイクルで読み出し及び書き込み動作をするには、1つのセルに書き込み用カラム線と、読み出し用カラム線とを設ける必要がある。このように、同じサイクルで書き込みと読み出しが可能なL2キャッシュRAMは、複雑で且つコスト的に高価になる。上記のように、第1パイプライン70が、先行フローから2クロックサイクル遅れて後続フローを実行することで、読み出しと書き込みが同じサイクルで実行されず、L2キャッシュRAMを読み出し/書き込み共有の1ポートRAMとすることが出来る。
 [第2パイプライン制御]
 第2パイプライン80のステージは、上述した要求読出ステージ、優先順位決定ステージ、PA一致検出ステージ、LBへのPA転送ステージ、要求処理判断ステージ、処理結果通知ステージが行われる。図11に示す451、461は、パイプライン処理の一例を示す。このうち、パイプライン処理451は、第1パイプラインパイプライン処理401におけるPA一致検出の前に、PA一致検出を行なう例を示している。また、パイプライン処理461は、パイプライン処理401によるPA一致検出の後に、PA一致検出を行なう例を示している。なお、第2パイプライン80は、PA一致検出処理において、LB160におけるPA一致の代わりに、又は、LB160におけるPA一致に加えて、図10A及び図10Bを用いて説明したヒットバッファとPF命令対象データとの一致処理を行ってもよい。
 414は、「4」サイクルで行われるパイプライン処理404のPA一致検出処理であり、452は、「3」サイクルで行われるパイプライン処理451のPA一致検出処理である。462は、「5」サイクルで行われるパイプライン処理461のPA一致検出処理である。
 第2パイプライン80のPA一致検出処理452、462は、第1パイプライン70のPA一致検出処理414と異なるクロックサイクルでLB160でのPA一致検出処理を行う。そのため、第1パイプライン70と第2パイプライン80は、PA一致検出処理で、アドレス一致検出回路を共用しながらも、第1パイプライン70を停止するなどの影響を一切与えずに済む。
 なお、第2のパイプラインではLBとのPA一致検出結果に基づく処理を決定しているので、第1のパイプラインによるパイプライン処理と比べて処理サイクル数を減らすことは可能である。しかし、PFポートから第1パイプラインと第2パイプラインとに同時に1つのPF命令が発行され、PF命令が双方のパイプラインに投入される場合には、以下の理由により第2のパイプラインによるパイプライン処理のサイクル数は、第1のパイプラインによるパイプライン処理のサイクル数と同一とすることが好ましい。
 第1パイプライン処理と第2パイプライン処理とのサイクル数を揃えることで、PFポートはPF命令に対する完了通知あるいは中止通知を同時に受け取ることが出来る。このような場合、PFポートが第2のパイプラインからの完了通知を無視し、第1パイプラインからの完了通知に従って処理の完了、および対応する記憶部66-3のエントリの開放処理を行なうような、第1パイプラインからの完了通知を優先とする優先順位論理を設定することで、PFポートが受け取る完了通知を1つに絞ることができ、完了通知を受けるための受け口は1つのみ設ければよくなる。ただし、第1パイプラインの処理段数と、第2のパイプラインの処理段数とが一致しない場合は、PFポートに同時に達する完了通知が別個のリクエストに基づく通知となる可能性がある。この場合には、双方のパイプラインからの完了通知を受けられるようにするために、受け口を2つ設ける必要がある。
 図11に示すように、「7」サイクルで処理結果通知を、第1パイプラインと第2パイプラインとが同時に行うために、パイプライン処理451の「5」及び「6」サイクルと、パイプライン処理461の「3」サイクルにアイドルサイクルがある。このように、各パイプラインが同じサイクルで処理結果通知を行うことで、PFポート66は、同じタイミングで第1パイプライン70及び第2パイプライン80からPF命令に関する完了通知又は中止通知を受け取る。PFポート66では、第1パイプライン70からの完了通知を優先とする選択回路160-15により完了通知を1つに絞ることで、完了通知の受け口としてデコーダ160-4を1つにすることが出来る。
 [バンク化されたRAMに対するパイプライン処理]
 図12は、バンク化されたL2キャッシュRAMに対する第1及び第2パイプラインによる処理の一例を示す図である。プログラムAに示すように、L2キャッシュRAM110a又はL2キャッシュRAM110bに対して同じサイクルに読み出し及び書き込みを同時することは出来ない。しかし、L2キャッシュRAM110aに読み出し又は書き込みが行われているサイクルと同じサイクルで、L2キャッシュRAM110bに対して読み出し又は書き込みを行うことは出来る。L2キャッシュRAM110aとL2キャッシュRAM110bは、メモリセルは別個に有しているからである。また、パイプライン処理においては、同じサイクルで2つのパイプライン処理を実行することも可能である。例えば、PA一致検出処理は、複数のパイプライン処理を同じサイクルで実行することが出来る。
 401aは、L2キャッシュRAM110aに対する第1パイプライン70のパイプライン処理であり、401bは、L2キャッシュRAM110bに対する第1パイプライン70のパイプライン処理である。451aは、L2キャッシュRAM110aに対する第2パイプライン80のパイプライン処理であり、451bは、L2キャッシュRAM110bに対する第2パイプライン80のパイプライン処理である。パイプライン処理401aに対して後続フローであるパイプライン処理401bは、1サイクル遅れである。パイプライン処理451aに対して後続フローであるパイプライン処理451bは、1サイクル遅れである。このように、後続フローを1サイクル後に実行できるのは、バンク分けによって、同一のL2キャッシュRAMに同サイクルで読み出し、書き込みが生じないようにすることが出来るからである。
 471は、「4」サイクルにおける第1パイプライン70によるPA一致検出処理であり、472は、「3」サイクルにおける第2パイプライン80によるPA一致検出処理である。473は、「5」サイクルにおける第1パイプライン70によるPA一致検出処理であり、472は、「4」サイクルにおける第2パイプライン80によるPA一致検出処理である。処理471と処理474は、同一サイクルのPA一致検出処理である。図7に示すように、PA一致は、LB160のエントリ毎にPA一致検出するため、同じサイクルで2つのPA一致検出を行うことも可能である。
 このように、バンク分けによって、L2キャッシュRAMへの同サイクルでの読み出し及び書き込みを行わずに、1サイクル後にフローを実行して、同サイクルで複数の処理が可能なPA一致検出処理を行うことで、回路のアイドル期間を少なくすることができる。
 10  プロセッサコア
 13  レジスタ
 60  パイプライン選択部
 61  第1優先制御回路
 62  第2優先制御回路
 63  MOポート
 64  LDポート
 66  PFポート
 70  第1パイプライン
 80  第2パイプライン
 90  L2キャッシュコントローラ
 100  演算処理装置
 110  L2キャッシュRAM
 120  L2データRAM
 140  L2タグRAM
 160  ロードバッファ
 170  ヒットバッファ
 220  主記憶装置

Claims (8)

  1.  主記憶装置に接続される演算処理装置であって、
     主記憶装置に格納されるデータの一部を格納する第1の記憶部と、
     主記憶装置に格納されるデータを、第1の記憶部に格納する命令を出力する演算処理部と、
     命令を受け取るとともに、第1の記憶部が主記憶装置から命令の対象データを受け取るまで、命令を格納する第2の記憶部と、
     演算処理部から命令を受け取るとともに、命令の対象データが第1の記憶部に格納されている場合、対象データを第1の記憶部から読み出して演算処理部に出力する一方、命令の対象データが第1の記憶部に格納されず且つ命令の対象データと同じデータを対象とする命令が第2の記憶部に無い場合、命令を主記憶装置に出力する第1の制御部と、
     演算処理部から命令を受け取るとともに、命令の対象データと同じデータを対象とする命令が第2の記憶部に格納されている場合、命令による主記憶装置から対象データを読み出す処理を完了する第2の制御部と、を有することを特徴とする演算処理装置。
  2.  第1の制御部は、第1の制御部で受け取った命令と、第2の記憶部に格納される命令との一致を確認しないサイクルにおいて、第2の制御部は、第2の制御部が第1の制御部で受け取った命令と、第2の記憶部に格納される命令との一致を確認する請求項1に記載の演算処理装置。
  3.  第1の制御部は、第1の記憶部に格納されるデータの読み出しサイクルと異なるサイクルで、第1の記憶部に格納されるデータの書き込みを実行する請求項1又は2に記載の演算処理装置。
  4.  第1の記憶部は、それぞれがメモリバンク分けされた第3の記憶部及び第4の記憶部を有し、
     第2の記憶部は、第3の記憶部に格納されるデータを対象とする命令を格納する第5の記憶部と、第4の記憶部に格納されるデータを対象とする命令を格納する第6の記憶部とを有し、
     第1の制御部は、第3の記憶部に格納されるデータの読み出しサイクルと同じサイクルで、第5の記憶部に格納されるデータの書き込みを実行する請求項1~3のいずれか1項に記載の演算処理装置。
  5.  第1の制御部による命令の完了通知と、第2の制御部による命令の完了通知を同じサイクルで行う請求項1~4のいずれか1項に記載の演算処理装置。
  6.  演算処理部から命令を受け取り、第1の制御部及び第2の制御部に命令を出力する第3の制御部を有し、
     命令の対象データと同じデータを対象とする命令が第2の記憶部に無い場合、第2の制御部は、命令による主記憶装置から読み出す処理を中止し、
     第3の制御部は、第2の制御部が命令を中止又は処理中の場合、命令を第2の制御部には出力せず、命令を第1の制御部に出力する請求項1~5のいずれか1項に記載の演算処理装置。
  7.  第3の制御部は、命令を第1の制御部と第2の制御部とに出力し、命令を処理する制御信号を第1の制御部又は第2の制御部に出力することで、第1の制御部又は第2の制御部に命令の処理を実行させる請求項1~6のいずれか1項に記載の演算処理装置。
  8.  第1の制御部が第1の記憶部における命令が対象とするデータが存在することを検出した場合、第1の制御部は検出されたデータのアドレスを第2の記憶部に格納し、
     命令の対象データのアドレスと第2の記憶部に格納された検出されたデータのアドレスが同じ場合、第2の制御部は、命令による主記憶装置から読み出す処理を完了する請求項1~7のいずれか1項に記載の演算処理装置。
PCT/JP2009/071594 2009-12-25 2009-12-25 演算処理装置 WO2011077549A1 (ja)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP2011547161A JP5482801B2 (ja) 2009-12-25 2009-12-25 演算処理装置
CN200980163061.7A CN102687128B (zh) 2009-12-25 2009-12-25 运算处理装置
PCT/JP2009/071594 WO2011077549A1 (ja) 2009-12-25 2009-12-25 演算処理装置
EP09852565.2A EP2518632A4 (en) 2009-12-25 2009-12-25 COMPUTING DEVICE
KR1020127016301A KR101402560B1 (ko) 2009-12-25 2009-12-25 연산 처리 장치
US13/528,153 US20120260056A1 (en) 2009-12-25 2012-06-20 Processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2009/071594 WO2011077549A1 (ja) 2009-12-25 2009-12-25 演算処理装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/528,153 Continuation US20120260056A1 (en) 2009-12-25 2012-06-20 Processor

Publications (1)

Publication Number Publication Date
WO2011077549A1 true WO2011077549A1 (ja) 2011-06-30

Family

ID=44195110

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2009/071594 WO2011077549A1 (ja) 2009-12-25 2009-12-25 演算処理装置

Country Status (6)

Country Link
US (1) US20120260056A1 (ja)
EP (1) EP2518632A4 (ja)
JP (1) JP5482801B2 (ja)
KR (1) KR101402560B1 (ja)
CN (1) CN102687128B (ja)
WO (1) WO2011077549A1 (ja)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014048829A (ja) * 2012-08-30 2014-03-17 Fujitsu Ltd 演算処理装置及び演算処理装置の制御方法
CN105318125A (zh) * 2014-07-18 2016-02-10 纽珀有限公司 软管接头
JP2017027156A (ja) * 2015-07-16 2017-02-02 富士通株式会社 演算処理装置及び演算処理装置の制御方法
JP2017040973A (ja) * 2015-08-17 2017-02-23 富士通株式会社 演算処理装置および演算処理装置の制御方法

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140201326A1 (en) 2013-01-16 2014-07-17 Marvell World Trade Ltd. Interconnected ring network in a multi-processor system
US20140223419A1 (en) * 2013-02-04 2014-08-07 Kabushiki Kaisha Toshiba Compiler, object code generation method, information processing apparatus, and information processing method
KR102008412B1 (ko) * 2013-03-04 2019-08-08 에스케이하이닉스 주식회사 반도체 장치 및 이 반도체 장치를 포함하는 마이크로프로세서, 프로세서, 시스템, 데이터 저장 시스템 및 메모리 시스템
KR102043727B1 (ko) * 2013-03-04 2019-12-02 에스케이하이닉스 주식회사 반도체 장치 및 그 제조 방법, 이 반도체 장치를 포함하는 마이크로 프로세서, 프로세서, 시스템, 데이터 저장 시스템 및 메모리 시스템
KR102092772B1 (ko) * 2013-03-27 2020-03-24 에스케이하이닉스 주식회사 반도체 장치 및 그 제조 방법, 이 반도체 장치를 포함하는 마이크로 프로세서, 프로세서, 시스템, 데이터 저장 시스템 및 메모리 시스템
US9865806B2 (en) 2013-06-05 2018-01-09 SK Hynix Inc. Electronic device and method for fabricating the same
US10490741B2 (en) 2013-06-05 2019-11-26 SK Hynix Inc. Electronic device and method for fabricating the same
KR102025256B1 (ko) * 2013-07-25 2019-09-26 에스케이하이닉스 주식회사 전자 장치 및 그 제조 방법
US9933841B2 (en) * 2014-04-17 2018-04-03 Arm Limited Reuse of results of back-to-back micro-operations
US10896138B2 (en) * 2016-05-27 2021-01-19 Apple Inc. Dynamically controlling random access memory retention in a wireless device
CN106250348B (zh) * 2016-07-19 2019-02-12 北京工业大学 一种基于gpu访存特性的异构多核架构缓存管理方法
US10606599B2 (en) * 2016-12-09 2020-03-31 Advanced Micro Devices, Inc. Operation cache

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05143451A (ja) * 1991-11-20 1993-06-11 Kisaburo Nakazawa データ処理装置
JP2000339157A (ja) 1999-05-27 2000-12-08 Fujitsu Ltd キャッシュメモリ制御装置および計算機システム
JP2003162446A (ja) * 2001-11-27 2003-06-06 Nec Electronics Corp マイクロコンピュータ
JP2006040090A (ja) 2004-07-29 2006-02-09 Fujitsu Ltd キャッシュメモリ制御装置、キャッシュメモリ制御方法、中央処理装置、情報処理装置、中央処理方法。
JP2006048182A (ja) * 2004-07-30 2006-02-16 Fujitsu Ltd 記憶制御装置、ムーブインバッファ制御方法およびプログラム
JP2006048181A (ja) * 2004-07-30 2006-02-16 Fujitsu Ltd 記憶制御装置、ムーブインバッファ制御方法およびプログラム
JP4160589B2 (ja) * 2005-10-31 2008-10-01 富士通株式会社 演算処理装置,情報処理装置,及び演算処理装置のメモリアクセス方法
WO2009104240A1 (ja) * 2008-02-18 2009-08-27 富士通株式会社 演算処理装置および演算処理装置の制御方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6317810B1 (en) * 1997-06-25 2001-11-13 Sun Microsystems, Inc. Microprocessor having a prefetch cache
US20060148743A1 (en) 2001-05-18 2006-07-06 Vasant Jadhav RNA interference mediated inhibition of histone deacetylase (HDAC) gene expression using short interfering nucleic acid (siNA)
US20070186049A1 (en) * 2006-02-03 2007-08-09 International Business Machines Corporation Self prefetching L2 cache mechanism for instruction lines
WO2007099598A1 (ja) * 2006-02-28 2007-09-07 Fujitsu Limited プリフェッチ機能を有するプロセッサ

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05143451A (ja) * 1991-11-20 1993-06-11 Kisaburo Nakazawa データ処理装置
JP2000339157A (ja) 1999-05-27 2000-12-08 Fujitsu Ltd キャッシュメモリ制御装置および計算機システム
JP2003162446A (ja) * 2001-11-27 2003-06-06 Nec Electronics Corp マイクロコンピュータ
JP2006040090A (ja) 2004-07-29 2006-02-09 Fujitsu Ltd キャッシュメモリ制御装置、キャッシュメモリ制御方法、中央処理装置、情報処理装置、中央処理方法。
JP2006048182A (ja) * 2004-07-30 2006-02-16 Fujitsu Ltd 記憶制御装置、ムーブインバッファ制御方法およびプログラム
JP2006048181A (ja) * 2004-07-30 2006-02-16 Fujitsu Ltd 記憶制御装置、ムーブインバッファ制御方法およびプログラム
JP4160589B2 (ja) * 2005-10-31 2008-10-01 富士通株式会社 演算処理装置,情報処理装置,及び演算処理装置のメモリアクセス方法
WO2009104240A1 (ja) * 2008-02-18 2009-08-27 富士通株式会社 演算処理装置および演算処理装置の制御方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2518632A4

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014048829A (ja) * 2012-08-30 2014-03-17 Fujitsu Ltd 演算処理装置及び演算処理装置の制御方法
CN105318125A (zh) * 2014-07-18 2016-02-10 纽珀有限公司 软管接头
JP2017027156A (ja) * 2015-07-16 2017-02-02 富士通株式会社 演算処理装置及び演算処理装置の制御方法
JP2017040973A (ja) * 2015-08-17 2017-02-23 富士通株式会社 演算処理装置および演算処理装置の制御方法

Also Published As

Publication number Publication date
KR20120086363A (ko) 2012-08-02
CN102687128B (zh) 2014-12-10
EP2518632A1 (en) 2012-10-31
EP2518632A4 (en) 2013-05-29
US20120260056A1 (en) 2012-10-11
JPWO2011077549A1 (ja) 2013-05-02
CN102687128A (zh) 2012-09-19
JP5482801B2 (ja) 2014-05-07
KR101402560B1 (ko) 2014-05-30

Similar Documents

Publication Publication Date Title
JP5482801B2 (ja) 演算処理装置
US7707397B2 (en) Variable group associativity branch target address cache delivering multiple target addresses per cache line
JP3412575B2 (ja) 命令履歴キャッシングを使用して推測的に命令を実行する回路、データ処理システム、およびそのための方法
US5835951A (en) Branch processing unit with target cache read prioritization protocol for handling multiple hits
US5835967A (en) Adjusting prefetch size based on source of prefetch address
US8316188B2 (en) Data prefetch unit utilizing duplicate cache tags
US5692168A (en) Prefetch buffer using flow control bit to identify changes of flow within the code stream
US20170371790A1 (en) Next line prefetchers employing initial high prefetch prediction confidence states for throttling next line prefetches in a processor-based system
US8683136B2 (en) Apparatus and method for improving data prefetching efficiency using history based prefetching
US20150186293A1 (en) High-performance cache system and method
CN112543916B (zh) 多表分支目标缓冲器
EP1441284A2 (en) Apparatus and method for efficiently updating branch target address cache
US5732243A (en) Branch processing unit with target cache using low/high banking to support split prefetching
US20140108743A1 (en) Store data forwarding with no memory model restrictions
JPH08194615A (ja) 情報処理装置
KR100955433B1 (ko) 파이프라인 구조를 갖는 캐시 메모리 및 이를 제어하는방법
US6963962B2 (en) Memory system for supporting multiple parallel accesses at very high frequencies
CN111213132B (zh) 用飞行中预取服务于cpu需求请求
JP2016511887A (ja) 命令処理システムと方法
JP2007514237A (ja) 分岐先バッファにおいてエントリを割り当てる方法及び装置
JP2018055568A (ja) 演算処理装置、情報処理装置及び演算処理装置の制御方法
US5900012A (en) Storage device having varying access times and a superscalar microprocessor employing the same
US5740416A (en) Branch processing unit with a far target cache accessed by indirection from the target cache
US20140019690A1 (en) Processor, information processing apparatus, and control method of processor
US6425090B1 (en) Method for just-in-time delivery of load data utilizing alternating time intervals

Legal Events

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

Ref document number: 200980163061.7

Country of ref document: CN

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

Ref document number: 09852565

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2011547161

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 2009852565

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 20127016301

Country of ref document: KR

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE