WO2010116431A1 - キャッシュ制御装置及びキャッシュ制御方法 - Google Patents

キャッシュ制御装置及びキャッシュ制御方法 Download PDF

Info

Publication number
WO2010116431A1
WO2010116431A1 PCT/JP2009/006668 JP2009006668W WO2010116431A1 WO 2010116431 A1 WO2010116431 A1 WO 2010116431A1 JP 2009006668 W JP2009006668 W JP 2009006668W WO 2010116431 A1 WO2010116431 A1 WO 2010116431A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
way
processor
task
ways
Prior art date
Application number
PCT/JP2009/006668
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 パナソニック株式会社
Publication of WO2010116431A1 publication Critical patent/WO2010116431A1/ja
Priority to US13/253,456 priority Critical patent/US8868835B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0864Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using pseudo-associative means, e.g. set-associative or hashing
    • 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/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0842Multiuser, multiprocessor or multiprocessing cache systems for multiprocessing or multitasking

Definitions

  • the present invention relates to a cache control device and a cache control method, and more particularly to a cache control device that controls a set associative cache memory shared by a plurality of processors.
  • Processor systems including a plurality of processors include a tightly coupled system that mutually accesses the same data by sharing a memory space, and a loosely coupled system that exchanges data with each other via communication.
  • a tightly coupled system there are a configuration in which a cache memory is shared and a configuration in which a processor has a cache memory individually.
  • FIG. 9 is a block diagram showing a configuration of a multiprocessor system of a tightly coupled system sharing a cache memory.
  • a processor system 200 shown in FIG. 9 includes processors 10 and 11, a memory bus 20, a cache control device 201, a cache memory 50, and a main memory 60.
  • the processors 10 and 11 access the main memory 60 via the memory bus 20.
  • the cache control device 201 controls the cache memory 50.
  • the cache control device 201 includes a cache control unit 30 and a cache distribution control unit 240.
  • the cache control unit 30 performs the following control for access to the main memory 60 from the processors 10 and 11.
  • the cache control unit 30 accesses the cache memory 50 and does not access the main memory 60.
  • the access to the cache memory 50 is faster than the access to the main memory 60. Therefore, by using the cache memory 50, the time required for memory access can be shortened, so that the performance of the entire system can be improved.
  • the cache control unit 30 reads the data from the main memory 60 and writes the data to the cache memory 50. As a result, when the next access to the same data occurs, the cache control unit 30 can access the cache memory 50.
  • the cache control unit 30 When a write access to the main memory 60 occurs, the cache control unit 30 writes data to the main memory 60 and writes the data to the cache memory 50. As a result, data consistency between the cache memory 50 and the main memory 60 is guaranteed.
  • the cache allocation control unit 240 allocates the cache capacity of the cache memory 50 to processing units or tasks.
  • a task is a control unit that collectively manages the flow of starting, executing, and ending a program that operates under the management of the operating system.
  • the cache distribution control unit 240 distributes the ways 51a to 51f to processing units or tasks.
  • the cache memory 50 is configured by a hardware unit called “memory macrocell”.
  • the cache control device 201 includes an address calculator, a buffer circuit, a bus arbitration circuit, and the like for each unit.
  • the number of memory macrocells increases. This increases the area of the LSI and makes high-speed transmission impossible. As a result, frequency improvement cannot be expected.
  • the number of memory macrocells can be reduced by configuring one memory macrocell including a plurality of ways. For example, in FIG. 9, ways 51a and 51b are included in one memory macrocell, and similarly, ways 51c and 51d and ways 51e and 51f are included in each one memory macrocell.
  • the cache allocation control unit 240 can dynamically change the cache capacity allocated to each of the processors 10 and 11 according to the processing priority of the plurality of processors 10 and 11 sharing the cache memory 50. ing. Thereby, in the conventional cache control apparatus 201, the processor which performs a high priority process can use much cache capacity (for example, refer patent document 1).
  • the cache capacity is allocated according to the processing priority in the conventional cache control apparatus 201, but the allocation amount depends only on the priority. As a result, the cache capacity required for processing cannot be flexibly allocated. Therefore, in a system that needs to guarantee the processing performance, the capacity may be insufficient, and the performance cannot be guaranteed.
  • the conventional cache control apparatus 201 when the cache capacity is excessive, surplus resources that cannot be used are generated. As a result, the conventional cache control apparatus 201 has a problem that the cache capacity cannot be effectively used.
  • the conventional cache control apparatus 201 when a plurality of tasks to which ways are assigned operate on different processors and these ways exist in the same memory macrocell, cache accesses from these plurality of tasks are performed. If these occur at the same time, even if the access destination ways are different, access conflicts and one of them waits. As a result, the conventional cache control apparatus 201 has a problem that access is delayed.
  • an object of the present invention is to provide a cache control device and a cache control method capable of effectively utilizing surplus resources and suppressing the occurrence of access delay.
  • a cache control device that controls a set associative cache memory shared by a plurality of processors, and the cache memory includes a plurality of ways. And the plurality of ways are divided into a plurality of groups including one or more ways, and the cache control device performs a cache allocation process for assigning the ways to a plurality of tasks executed by the plurality of processors.
  • the cache allocation control unit includes a non-allocation way that is not allocated to any task in one group, and the group includes a plurality of processors. Ways assigned to tasks executed by other processors If Murrell, allocating the unallocated way included in the group, the one of the tasks of the plurality of tasks to be performed by the one processor.
  • the cache control device can allocate surplus unallocated ways to tasks, and thus can effectively use surplus resources. Furthermore, the cache control device according to an aspect of the present invention assigns an unassigned way to a task belonging to the same processor as a task to which a way included in the same group (memory macrocell) as the unassigned way is assigned. Thereby, ways included in one group are assigned to tasks executed by the same processor. Therefore, the cache control device according to an aspect of the present invention can avoid a cache access collision that occurs when different processors access ways included in the same group. As described above, the cache control device according to one embodiment of the present invention can suppress the occurrence of access delay.
  • the cache allocation control unit has an allocation task number that is the number of tasks already allocated by the cache allocation process. Ways included in the group may be assigned to tasks executed by the fewest processors.
  • the cache control device can preferentially assign ways to tasks of a processor with a small number of ways. Thereby, the cache control device according to an aspect of the present invention can equally distribute ways to the processors.
  • the cache control device further includes a storage unit that stores way information indicating a way allocated to each of the plurality of tasks, and the cache allocation control unit refers to the way information and the unallocated A way may be determined.
  • the cache control device can easily guarantee the processing performance by presetting the cache capacity for each task in the way information.
  • the storage unit is further provided corresponding to each processor and stores a search pointer for designating any one of the plurality of ways, and the cache distribution control unit corresponds to the search pointer.
  • a way designation unit for designating a way assigned to a task of a processor, and a task assigned to a way designated by the search pointer corresponding to the processor among a plurality of tasks executed by the processor,
  • An allocation unit that allocates an unallocated way, and each time the way specifying unit allocates a way to the task of the processor by the allocation unit, the way specified by the search pointer is assigned to the task of the processor. Is moved to the next way in a predetermined order. It may be.
  • the cache control device can equally distribute ways to a plurality of tasks executed by each processor.
  • the cache distribution control unit further includes a free way information generation unit that is provided corresponding to each processor and generates free way information including a bit string and stores the free way information in the storage unit.
  • Each of the plurality of ways includes a bit indicating whether or not the corresponding way is assigned to a plurality of tasks executed by the processor, and the way designating unit Each time a way is assigned to a task, the way specified by the search pointer may be moved to the next way in the order of the bit string among the ways to which the task of the processor is assigned.
  • the cache control device can sequentially select each task so that the ways are evenly distributed to a plurality of tasks executed by each processor.
  • the value of the search pointer is the sum of the number of bits in the bit string moved by the way designating unit, and the cache allocation control unit has all the ways included in one group assigned to any task. If not assigned, a way included in the group may be assigned to a task executed by a processor having the smallest value of the search pointer.
  • the cache control device can equally distribute ways to the processors.
  • the cache allocation control unit sets the search pointer value of the one processor to the maximum value. May be.
  • the cache control device can prevent a way from being assigned to a processor to which no way is assigned as an initial state.
  • the cache allocation control unit may perform the cache allocation process when the task is generated or deleted.
  • the cache control device can allocate ways without affecting task processing.
  • the present invention can be realized not only as such a cache control device but also as a cache control method using steps included in the characteristic means included in the cache control device. It can also be realized as a program to be executed. Needless to say, such a program can be distributed via a recording medium such as a CD-ROM and a transmission medium such as the Internet.
  • the present invention can be realized as a semiconductor integrated circuit (LSI) that realizes part or all of the functions of such a cache control device, or can be realized as a processor system including such a cache control device.
  • LSI semiconductor integrated circuit
  • the present invention can provide a cache control device and a cache control method capable of effectively utilizing surplus resources and suppressing the occurrence of access delay.
  • FIG. 1 is a block diagram showing a configuration of a processor system according to an embodiment of the present invention.
  • FIG. 2 is a block diagram showing the configuration of the cache distribution control unit according to the embodiment of the present invention.
  • FIG. 3A is a diagram showing an example of an initial state of the way information storage unit according to the embodiment of the present invention.
  • FIG. 3B is a diagram showing an example of an initial state of the way information storage unit according to the embodiment of the present invention.
  • FIG. 4 is a flowchart showing a cache allocation procedure by the cache allocation control unit according to the embodiment of the present invention.
  • FIG. 5 is a flowchart showing the operation of the effective position search unit according to the embodiment of the present invention.
  • FIG. 1 is a block diagram showing a configuration of a processor system according to an embodiment of the present invention.
  • FIG. 2 is a block diagram showing the configuration of the cache distribution control unit according to the embodiment of the present invention.
  • FIG. 3A is a diagram showing an example of an initial state of the
  • FIG. 6 is a flowchart showing the operation of the bit allocation unit according to the embodiment of the present invention.
  • FIG. 7A is a diagram showing an example of a state during the processing of the way information storage unit according to the embodiment of the present invention.
  • FIG. 7B is a diagram showing an example of a state during the processing of the way information storage unit according to the embodiment of the present invention.
  • FIG. 8A is a diagram showing an example of a state after the processing of the way information storage unit according to the embodiment of the present invention is completed.
  • FIG. 8B is a diagram showing an example of a state after the processing of the way information storage unit according to the embodiment of the present invention is completed.
  • FIG. 9 is a block diagram showing a configuration of a conventional processor system.
  • the cache control device assigns the remaining way to a task of the same processor as the task to which the way of the same group (memory macrocell) as the way is assigned. Thereby, the cache control device according to the embodiment of the present invention can avoid the collision of cache access between different processors, so that it is possible to suppress the occurrence of access delay and to effectively utilize surplus resources.
  • FIG. 1 is a diagram showing a configuration of a processor system 100 according to an embodiment of the present invention.
  • a processor system 100 shown in FIG. 1 includes processors 10 and 11, a memory bus 20, a cache control device 101, a cache memory 50, and a main memory 60.
  • processors 10 and 11 include processors 10 and 11, a memory bus 20, a cache control device 101, a cache memory 50, and a main memory 60.
  • symbol is attached
  • processor system 100 includes two processors 10 and 11
  • the number of processors is not limited to two, and the processor system 100 includes three or more processors. May be.
  • the processors 10 and 11 access the main memory 60 via the memory bus 20.
  • the cache control device 101 controls the cache memory 50.
  • the cache control apparatus 101 includes a cache control unit 30 and a cache distribution control unit 40.
  • the cache control unit 30 performs the following control for access to the main memory 60 from the processors 10 and 11.
  • a read access from the main memory 60 occurs, if the data to be accessed exists in the cache memory 50 (cache hit), the cache control unit 30 accesses the cache memory 50 and does not access the main memory 60.
  • the access to the cache memory 50 is faster than the access to the main memory 60. Therefore, by using the cache memory 50, the time required for memory access can be shortened, so that the performance of the entire system can be improved.
  • the cache control unit 30 reads the data from the main memory 60 and writes the data to the cache memory 50. As a result, when the next access to the same data occurs, the cache control unit 30 can access the cache memory 50.
  • the cache control unit 30 writes data to the main memory 60 and also writes the data to the cache memory 50. As a result, data consistency between the cache memory 50 and the main memory 60 is guaranteed.
  • the cache memory 50 has a set associative configuration.
  • the cache memory 50 includes a plurality of ways 51a to 51f. Note that the plurality of ways 51a to 51f will be referred to as ways 51 unless otherwise distinguished.
  • the cache memory 50 is configured by a hardware unit called a memory macro cell.
  • the cache control device 101 includes an address calculator, a buffer circuit, a bus arbitration circuit, and the like for each unit.
  • ways 51a and 51b are included in one memory macro cell, and similarly, ways 51c and 51d and ways 51e and 51f are included in each one memory macro cell. That is, the plurality of ways 51 are divided into a plurality of groups 52 a, 52 b and 52 c (memory macrocells) each including a plurality of ways 51.
  • the groups 52a, 52b, and 52c are referred to as a group 52 unless otherwise distinguished.
  • the cache allocation control unit 40 performs a cache allocation process for allocating a way 51 that is not allocated to any task among a plurality of ways 51 included in the cache memory 50 to a plurality of tasks executed by the processors 10 and 11. Do.
  • a task is a control unit that collectively manages the flow of starting, executing, and ending a program that operates under the management of the operating system.
  • the cache distribution control unit 40 sequentially performs the process of assigning unassigned ways to tasks for each group 52.
  • the cache allocation control unit 40 includes an unassigned way (a way 51 that is not assigned to any task) in one group 52, and the group 52 includes a plurality of processors 10 and 11.
  • an unassigned way included in the group 52 is assigned to one of a plurality of tasks executed by the one processor. .
  • the cache allocation control unit 40 has the smallest number of tasks already allocated by the cache allocation process.
  • the way 51 included in the group 52 is assigned to a task executed by the group 11.
  • FIG. 2 is a block diagram showing a configuration of the cache allocation control unit 40 according to the embodiment of the present invention.
  • FIG. 2 schematically shows the function of the cache allocation control unit 40 when the processor 10 or 11 executes software (program) to perform cache allocation control as a partial function of the operating system. Yes.
  • the functions of the cache distribution control unit 40 may be realized by hardware (a dedicated circuit).
  • the cache allocation control unit 40 includes a way information storage unit 410, a valid position search unit 440, a bit allocation unit 450, an empty way information generation unit 460, a determination unit 470, and a processor selection unit 480. And an initial value setting unit 490.
  • the way information storage unit 410 corresponds to a storage unit of the present invention, and stores way information 411a, 411b, 411c,..., 412a, 412b, 412c..., Empty way information 421 and 422, and search pointers 431 and 432.
  • the way information 411a, 411b, 411c..., The free way information 421, and the search pointer 431 correspond to the processor 10, and the 412a, 412b, 412c..., The free way information 422, and the search pointer 432 are the processor. 11 corresponds.
  • way information 411a, 411b, 411c,... is written as way information 411.
  • way information 412a, 412b, 412c is written as way information 411.
  • the way information 411 and 412 indicate the way 51 assigned to each of a plurality of tasks executed by the corresponding processor 10 or 11.
  • Empty space information 421 and 422 indicate whether each of the plurality of ways 51 is assigned to a plurality of tasks executed by the corresponding processor 10 or 11.
  • Search pointers 431 and 432 are provided for each of the processors 10 and 11, and each indicate an effective position for designating one of the plurality of ways 51. This effective position is used for a process for selecting a processor 10 or 11 to which a way 51 is allocated and a process for selecting a task to which a way 51 is allocated, which will be described later.
  • FIG. 3A and 3B are diagrams illustrating an example of an initial state of the way information storage unit 410.
  • FIG. 3A and 3B are diagrams illustrating an example of an initial state of the way information storage unit 410.
  • each way information 411 and 412 includes a bit string. This bit string is arranged in the order of bits 0, 1, 2,... From the right. Each bit corresponds to each way 51 included in the cache memory 50. If bit n is valid (indicates 1), it indicates that the task n can be used. If bit n is invalid (indicating 0), it indicates that the task n cannot be used.
  • the bit width of the way information 411 and 412 is the same as the number of ways included in the cache memory 50. For example, in the example shown in FIGS. 3A and 3B, the number of ways is 16, and the way information 411 and 412 are also 16 bits.
  • Empty way information 421 and 422 are provided for each of the processors 10 and 11.
  • the free way information 421 and 422 includes a bit string. This bit string is arranged in the order of bits 0, 1, 2,... From the right. Each bit corresponds to each way 51 included in the cache memory 50. A bit corresponding to a way assigned to any task belonging to the corresponding processor 10 or 11 is “1”, and a bit corresponding to a way to which no task is assigned is “0”. In FIG. 3A and FIG. 3B, “0” in the bit string included in the way information 411 and 412 and the free way information 421 and 422 is omitted.
  • Search pointers 431 and 432 are provided for each processor and hold an integer of 0 or more.
  • the numerical value held by the search pointer 431 represents the bit position of the way information 411 and the empty way information 421, and the numerical value held by the search pointer 432 represents the bit position of the way information 412 and the empty way information 422.
  • the values of the search pointers 431 and 432 indicate the sum of the number of bits moved by the search pointer 431 or 432 during the cache allocation process.
  • the search pointer 432 of the processor 11 holds “3” and indicates bit 3.
  • the search pointer 431 of the processor 10 holds “38”
  • the initial value setting unit 490 determines the way 51 used by the task when the task is generated in order to guarantee the processing performance of each task. Further, the initial value setting unit 490 sets information on the way 51 used by each determined task in the way information 411 and 412 as an initial value. For example, the initial value setting unit 490 sets the way information 411 and 412 shown in FIGS. 3A and 3B as initial values at the time of task generation.
  • the empty way information generation unit 460 generates empty way information 421 and 422 and stores them in the way information storage unit 410. Specifically, the free way information generation unit 460 calculates the free way information by calculating the logical sum of the initial values of all way information 411 (or 412) corresponding to the tasks included in the processor 10 (or 11). 421 and 422 are generated.
  • the determination unit 470 refers to the initial values of the way information 411 and 412 to determine the presence / absence of an unallocated way included in each group 52 and the allocation state.
  • the processor selection unit 480 uses the determination result of the determination unit 470 to select the processor 10 or 11 to which the unallocated way is allocated.
  • the bit allocation unit 450 corresponds to the allocation unit of the present invention, selects one or more tasks from among a plurality of tasks executed by the processor 10 or 11 selected by the processor selection unit 480, and assigns an unallocated way to the selected task. Assign. Specifically, the bit allocation unit 450 selects a task to which the way 51 at the valid position designated by the corresponding search pointer 431 or 432 is allocated.
  • the effective position search unit 440 corresponds to the way specification unit of the present invention, and causes the search pointer 431 or 432 to specify the way 51 assigned to the task of the corresponding processor 10 or 11.
  • the valid position search unit 440 assigns the task of the corresponding processor to the way 51 specified by the search pointer 431 or 432.
  • the next way 51 is moved in the order of the bit strings of the empty way information 421 and 422.
  • the valid position search unit 440 searches the valid position of the processor 10 (or 11) by the valid position search process, and finds the searched valid position. Set to the search pointer 431 (or 432).
  • the valid position search process is a process of sequentially incrementing the search pointers 431 and 432 by 1, and then searching for a bit in which the empty way information 421 or 422 becomes valid “1”.
  • the valid position search unit 440 repeatedly selects the assigned tasks (tasks to which ways are assigned in the initial value) of each processor 10 or 11 in order of bit strings.
  • FIG. 4 is a flowchart showing the flow of the cache allocation control process performed by the cache allocation control unit 40.
  • the initial value setting unit 490 sets the way information 411 and 412 shown in FIGS. 3A and 3B as initial values. Further, as shown in FIGS. 3A and 3B, there are 16 ways 51, and each memory macrocell includes two ways 51. In other words, it is assumed that the 16 ways 51 are divided into 8 groups 52 by two. Each processor 10 and 11 is assumed to execute three tasks.
  • the vacant way information generation unit 460 creates vacant way information 421 and 422 for each of the processors 10 and 11 (step S1001).
  • empty way information 421 and 422 shown in FIGS. 3A and 3B are generated.
  • the logical sum of the way information 411a to 411c of the tasks 0, 1 and 2 of the processor 10 is “1” at bits 0, 6 and 7 and “0” at the other bits.
  • the logical sum of the way information 412a to 412c of the tasks 0, 1 and 2 of the processor 11 is “1” in the bits 3 and 10, and “0” in the other bits.
  • the effective position search unit 440 searches for an effective position of the processor 10 by an effective position search process, and sets the searched effective position in the search pointer 431 (step S1002).
  • FIG. 5 is a flowchart showing the flow of the effective position search process by the effective position search unit 440.
  • the valid position search unit 440 extracts the search pointer 431 or 432 of the designated processor n (step S1101), and performs the processing of steps S1103 and S1104 shown below until the extracted search pointer 431 or 432 goes around the way width. Is repeated (step S1102).
  • the valid position search unit 440 takes out the initial value “0” of the search pointer 431 of the processor 10.
  • the valid position search unit 440 determines whether or not the way 51 of the bit specified by the search pointer 431 or 432 of the specified processor n is an allocated way (step S1103). Specifically, the valid position search unit 440 determines whether the bit specified by the search pointer 431 or 432 included in the empty way information 421 or 422 is valid “1” or invalid “0”. judge.
  • the valid position search unit 440 sets the bit 0 to the valid position of the processor 10. And “0” is set in the search pointer 431.
  • the valid position search unit 440 searches for the valid position of the processor 11 by the valid position search process, and sets the found valid position in the search pointer 432 (step S1003).
  • the valid position search unit 440 extracts the initial value “0” of the search pointer 432 of the processor 11 (step S1101).
  • the valid position search unit 440 determines whether the bit 0 specified by the search pointer 432 of the empty way information 422 is valid “1” or invalid “0” (step S1103). Here, since bit 0 of the free way information 422 is invalid “0” (No in step S1103), the valid position search unit 440 adds 1 to the search pointer 432 (step S1104).
  • the valid position search unit 440 determines whether bit 1 specified by the search pointer 432 is valid “1” or invalid “0” (step S1103).
  • bit 1 of the free way information 422 is invalid “0” (No in step S1103)
  • the valid position search unit 440 further adds 1 to the search pointer 432 (step S1104).
  • the valid position search unit 440 sequentially repeats the processes of steps S1103 and S1104 until the search pointer 432 reaches a bit indicated by valid “1” in the empty way information 422. In this example, the processes in steps S1103 and S1104 are repeated until the search pointer 432 becomes “3”. As a result, the valid position search unit 440 sets bit 3 as the valid position of the processor 11 and sets “3” in the search pointer 432.
  • the valid position search unit 440 sets the maximum value in the search pointer 431 or 432 and ends the loop (step S1105). This indicates that there is no valid bit.
  • the maximum value in the search pointer 431 or 432 it is determined that it is always large in the magnitude comparison (step S1006) described later, and other valid bits.
  • the task that exists is selected. For example, the maximum value is (bit width) ⁇ (bit width).
  • the cache distribution control unit 40 divides the free way information 421 and 422 into 2 bits corresponding to each group, and sequentially performs the processing from step S1005 to step S1019 shown below for each 2 bits. (Step S1004).
  • the determination unit 470 determines the state (valid or invalid) of the bits i and i + 1 of the free way information 421 and 422 (step S1005).
  • the states of bits i and i + 1 of the free way information 421 and 422 are represented as “(bit i + 1 state, bit i state)”.
  • the processor selection unit 480 selects the processor 10 or 11 that executes the assigned task. .
  • the processor selection unit 480 selects the processor 10 or 11 having a small numerical value of the search pointers 431 and 432 (step S1006).
  • the cache distribution control unit 40 shifts to the processing of the next group 52 without performing the task distribution.
  • the cache allocation control unit 40 determines the state of bit 0 and bit 1 included in the group 0. Bits 1 and 0 of the free way information 421 of the processor 10 are (0, 1), and bits 1 and 0 of the free way information 422 of the processor 11 are (0, 0). That is, since the way 51 is assigned to the task executed by the processor 10, the processor selection unit 480 selects the processor 10. Next, the bit allocation unit 450 performs a bit allocation process for allocating the task of the processor 10 selected by the processor selection unit 480 to the bit i + 1 (bit 1) to which no task is allocated (step S1011).
  • bit allocation process is a process for allocating an unallocated way to a task.
  • FIG. 6 is a flowchart showing the flow of bit allocation processing by the bit allocation unit 450.
  • the bit allocation unit 450 sequentially performs the processing from step S1202 to step S1204 for all the tasks 0 to m of the processor n selected by the processor selection unit 480 (step S1201).
  • the bit allocation unit 450 determines whether the bit specified by the search pointer 431 or 432 of the selected task i is valid “1” or invalid “0” with reference to the way information 411 or 412. (Step S1202).
  • the bit allocation unit 450 copies the valid bit to the empty bit (step S1203). That is, the bit allocation unit 450 changes the free bit of the way information 411 or 412 of the task i to valid “1”.
  • the vacant bit is a bit to which no task is assigned (invalid “0” in the vacant way information 421 or 422) among the bits i and i + 1.
  • bit allocation unit 450 selects another task of the processor n, and performs the process of step S1202 on the selected task.
  • step S1202 when the bit specified by the search pointer 431 or 432 of task i is invalid “0” (No in step S1202), the bit allocation unit 450 does not change the way information 411 or 412 of the task i. The process of step S1202 is performed for the next task.
  • the search pointer 431 of the processor 10 is “0”, and among the bit 0 of the way information 411a to 411c, only the bit 0 of the way information 411a is valid “1”.
  • the assigning unit 450 assigns the way 51 of bit 1 to the task 0 of the processor 10 by setting bit 1 of the way information 411 a to “1”.
  • the effective position search unit 440 searches for an effective position of the processor 10 (step S1012).
  • the valid position search unit 440 sets bit 6 as the valid position of the processor 10 and sets “6” in the search pointer 431.
  • the effective position search process here is the same as the process shown in FIG. 5 described above, but in step S1101, the value of the search pointer 431 or 432 that was originally set (in this example, “0”) is set. After adding 1, the processing from step S1102 is performed. The same applies to steps S1008, S1010, S1014, S1016, and S1018.
  • the determination unit 470 determines the state of bit 3 and bit 2 included in the group 1 (step S1005). Since bit 3 and bit 2 of the free way information 421 of the processor 10 are (0, 0) and bit 3 and bit 2 of the free way information 422 of the processor 11 are (1, 0), the processor selection unit 480 selects the processor 11. Next, the bit allocation unit 450 performs bit allocation processing for allocating the task of the processor 11 to bit i (bit 2) (step S1017).
  • the search pointer 432 of the processor 11 is “3”, and among the bits 3 of the way information 412a to 412c, only the bit 3 of the way information 412a is valid “1”.
  • the unit 450 assigns the way 51 of bit 2 to the task 0 of the processor 11 by setting bit 2 of the way information 412a to “1”.
  • the effective position search unit 440 searches for an effective position of the processor 11 (step S1018).
  • the valid position search unit 440 sets bit 10 as the valid position of the processor 11 and sets “10” in the search pointer 432.
  • the determination unit 470 determines the state of bit 5 and bit 4 included in the group 2 (step S1005). Bits 5 and 4 of the free way information 421 of the processor 10 are (0, 0), and bits 5 and 4 of the free way information 422 of the processor 11 are (0, 0). In other words, since none of the ways 51 included in one group 52 is assigned to a task, the processor selection unit 480 compares the search pointer 431 of the processor 10 with the search pointer 432 of the processor 11 to determine the search pointer. A processor having a small numerical value is determined as a processor x to which an empty bit is allocated (step S1006).
  • the search pointer 431 of the processor 10 is “6” and the search pointer 432 of the processor 11 is “10”, so the processor selection unit 480 frees up the processor 10.
  • the processor x to which bits are assigned is determined.
  • bit allocation unit 450 allocates bit i (bit 4) to the task of the processor x (processor 10) (step S1007).
  • bit i bit 4
  • the search pointer 431 of the processor 10 is “6”
  • the bits 6 of the way information 411a to 411c only the bit 6 of the way information 411b is valid “1”.
  • the unit 450 assigns the way 51 of bit 4 to the task 1 of the processor 10 by setting bit 4 of the way information 411b to “1” as shown in FIG. 8A.
  • the effective position search unit 440 searches for an effective position of the processor x (processor 10) (step S1008).
  • the valid position search unit 440 sets bit 7 as the valid position of the processor 10 and sets “7” in the search pointer 431.
  • bit allocation unit 450 allocates bit i + 1 (bit 5) to the task of the processor x (processor 10) (step S1009).
  • the bit allocation unit 450 determines the way information 411c. By setting bit 5 of this bit to “1”, the way 51 of bit 5 is assigned to task 2 of the processor 10.
  • the effective position search unit 440 searches for an effective position of the processor x (processor 10) (step S1010).
  • the valid position search unit 440 sets bit 0 as the valid position of the processor 10 and sets “16” in the search pointer 431.
  • the determination unit 470 determines the state of bits 7 and 6 included in the group 3 (step S1005). Bits 7 and 6 of the free way information 421 of the processor 10 are (1, 1), and bits 7 and 6 of the free way information 422 of the processor 11 are (0, 0). That is, since all the ways 51 are assigned to the task, the cache distribution control unit 40 does not change the way information 411 and 412.
  • the determination unit 470 determines the state of bits 9 and 8 included in the group 4 (step S1005). Since bits 9 and 8 of the free way information 421 of the processor 10 are (0, 0) and bits 9 and 8 of the free way information 422 of the processor 11 are (0, 0), The processor selection unit 480 compares the search pointer 431 “16” of the processor 10 with the search pointer 432 “6” of the processor 11 and assigns the processor 11 having a small search pointer value to the processor x to which the bits 9 and 8 are assigned. (Step S1006).
  • bit allocation unit 450 allocates bit 8 to the task of the processor 10 (step S1007).
  • the search pointer 432 of the processor 11 is “10”, and among the bits 10 of the way information 412a to 412c, the bit 10 of the way information 412b and 412c is valid “1”.
  • the way 51 of bit 8 is allocated to the task 1 and the task 2 of the processor 11.
  • the effective position search unit 440 searches for an effective position of the processor 11 (step S1008).
  • the valid position search unit 440 sets bit 3 as the valid position of the processor 11 and sets “19” in the search pointer 432.
  • bit allocation unit 450 allocates bit 9 to the task of the processor 11 (step S1009).
  • the search pointer 432 of the processor 11 is “19” (bit 3), and among the bits 3 of the way information 412a to 412c, only the bit 3 of the way information 412a is valid “1”.
  • bit 9 of the way information 412a is assigned to the task 0 of the processor 11.
  • the effective position search unit 440 searches for an effective position of the processor 11 (step S1010).
  • the valid position search unit 440 sets bit 10 as the valid position of the processor 11 and sets “26” in the search pointer 432.
  • step S1005 bit i + 1 and bit i of the empty way information 421 of the processor 10 are (1, 0), and bit i + 1 and bit i of the empty way information 422 of the processor 11 are (0, 0).
  • bit allocation unit 450 performs a bit allocation process for allocating the task of the processor 10 to the bit i (step S1013).
  • the valid position search unit 440 searches for the valid position of the processor 10 (step S1014), and the cache distribution control unit 40 performs processing for the next group (step S1004).
  • step S1005 the bits i + 1 and i of the free way information 421 of the processor 10 are (0, 0), and the bits i + 1 and i of the free way information 422 of the processor 11 are (0, 1).
  • the bit allocation unit 450 performs a bit allocation process for allocating the task of the processor 11 to the bit i + 1 (step S1015).
  • the valid position search unit 440 searches for the valid position of the processor 11 (step S1016), and the cache allocation control unit 40 performs processing for the next group (step S1004).
  • step S1005 in cases other than the above, that is, when the ways of bit i + 1 and bit i are both assigned to a task, the cache allocation control unit 40 does not assign a task and performs processing for the next group. Is performed (step S1004).
  • the cache control apparatus 101 sets initial values in the way information 411 and 412 so that the processing performance of each task can be guaranteed. As a result, the cache control apparatus 101 can secure a cache capacity for each task in a system that needs to guarantee processing performance.
  • the cache control apparatus 101 can allocate a surplus unallocated way to a task, it can allocate surplus resources to the task.
  • the cache control apparatus 101 assigns the unassigned way to the task of the same processor 10 or 11 as the task to which the way 51 of the same group 52 (memory macrocell) as the unassigned way is assigned.
  • the ways 51 included in one group 52 are assigned to tasks executed by the same processor 10 or 11. Therefore, the cache control apparatus 101 can avoid a cache access collision that occurs when different processors 10 and 11 access the way 51 included in the same group 52.
  • the cache control apparatus 101 according to the embodiment of the present invention can suppress the occurrence of access delay.
  • the cache control device 101 executes a task executed by the processor 10 or 11 having the smallest numerical value of the search pointer 431 or 432 when all the ways 51 included in one group 52 are not assigned to any task.
  • the way 51 included in the group 52 is assigned to the group 52.
  • the cache control apparatus 101 can preferentially assign the way 51 to tasks of the processor 10 or 11 to which the number of ways 51 assigned is small. As a result, the cache control apparatus 101 can equally distribute the ways 51 to the processors 10 or 11.
  • the valid position search unit 440 updates the search pointers 431 and 432 to select a plurality of tasks executed by the corresponding processor 10 or 11 in order in a predetermined order. Repeat to do. Also, the bit allocation unit 450 allocates an empty way 51 to the selected task. Thereby, the cache control apparatus 101 can equally distribute the ways 51 to a plurality of tasks executed by each processor 10 or 11.
  • the cache allocation control unit 40 has not specified a trigger for performing the cache allocation control process, but by executing the process at the time of starting or ending the task, the allocation of the task is not affected without affecting the task process. Ways can be allocated.
  • each group 52 includes two ways 51, but may include three or more ways 51. Further, each group 52 may include a different number of ways 51.
  • each processing unit included in the cache control apparatus 101 is typically realized by a processor such as a CPU executing a program (software).
  • the present invention may be the above program or a recording medium such as a CD-ROM on which the above program is recorded.
  • the program can be distributed by software download or the like via a transmission medium such as the Internet.
  • processing units included in the cache control apparatus 101 may be realized as an LSI that is an integrated circuit. These may be individually made into one chip, or may be made into one chip so as to include a part or all of them.
  • LSI is used, but depending on the degree of integration, it may be called IC, system LSI, super LSI, or ultra LSI.
  • circuits are not limited to LSI, and may be realized by a dedicated circuit or a general-purpose processor.
  • An FPGA Field Programmable Gate Array
  • reconfigurable processor that can reconfigure the connection and setting of circuit cells inside the LSI may be used.
  • the present invention can be applied to a cache control device and a cache control method. Further, the present invention can be applied to a processor system including a plurality of processors and a cache memory.
  • Cache control unit 40 Cache distribution control unit 50 Cache memory 51, 51a, 51b, 51c, 51d, 51e, 51f Way 52, 52a, 52b, 52c Group 60 Main memory 100, 200 Processor System 101, 201 Cache control device 410 Way information storage unit 411, 411a, 411b, 411c, 412, 412a, 412b, 412c Way information 421, 422 Empty way information 431, 432 Search pointer 440 Effective position search unit 450 Bit allocation unit 460 Empty way information generation unit 470 determination unit 480 processor selection unit 490 initial value setting unit

Landscapes

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

Abstract

 本発明に係るキャッシュ制御装置(101)は、キャッシュメモリ(50)に含まれる複数のウェイ(51)を、複数のプロセッサ(10及び11)により実行される複数のタスクに割り当てるキャッシュ配分制御部(40)を備える。キャッシュ配分制御部(40)は、1つのグループ(52)に、いずれのタスクにも割り当てられていない未割当ウェイが含まれ、かつ、当該グループ(52)にプロセッサ(10及び11)の一方により実行されるタスクに割り当てられたウェイ(51)が含まれる場合、当該グループ(52)に含まれる未割当ウェイを、当該一方のプロセッサ(10又は11)により実行される複数のタスクのうちいずれかのタスクに割り当てる。

Description

キャッシュ制御装置及びキャッシュ制御方法
 本発明は、キャッシュ制御装置及びキャッシュ制御方法に関し、特に、複数のプロセッサにより共有されるセットアソシアティブ方式のキャッシュメモリを制御するキャッシュ制御装置に関する。
 複数のプロセッサを含むプロセッサシステムには、メモリ空間を共有することにより同一データを相互にアクセスする密結合システムと、通信を介することで相互にデータを受け渡しする疎結合システムとがある。また、密結合システムとして、キャッシュメモリを共有する構成と、プロセッサ個別にキャッシュメモリを保有する構成とがある。
 図9は、キャッシュメモリを共有する密結合システムのマルチプロセッサシステムの構成を示すブロック図である。図9に示すプロセッサシステム200は、プロセッサ10及び11と、メモリバス20と、キャッシュ制御装置201と、キャッシュメモリ50と、メインメモリ60とを備える。
 プロセッサ10及び11はメモリバス20を介してメインメモリ60へアクセスする。
 キャッシュ制御装置201は、キャッシュメモリ50を制御する。このキャッシュ制御装置201は、キャッシュ制御部30と、キャッシュ配分制御部240とを備える。
 キャッシュ制御部30は、プロセッサ10及び11からメインメモリ60へのアクセスに対して以下のような制御を行う。メインメモリ60への読み出しアクセスが発生した場合、アクセスするデータがキャッシュメモリ50に存在すれば(キャッシュヒット)、キャッシュ制御部30は、キャッシュメモリ50へアクセスし、メインメモリ60へはアクセスしない。ここでキャッシュメモリ50へのアクセスはメインメモリ60へのアクセスに比べて高速である。よって、キャッシュメモリ50を用いることで、メモリアクセスに要する時間を短縮できるので、システム全体の性能を向上できる。
 一方、アクセスするデータがキャッシュメモリ50に存在しなければ(キャッシュミス)、キャッシュ制御部30は、メインメモリ60からデータを読み出すと共にキャッシュメモリ50へ当該データを書き込む。これにより次に同じデータへのアクセスが発生した際には、キャッシュ制御部30は、キャッシュメモリ50へアクセスできる。
 また、メインメモリ60への書き込みアクセスが発生した場合、キャッシュ制御部30は、メインメモリ60へデータを書き込むと共に、キャッシュメモリ50へ当該データを書き込む。これによりキャッシュメモリ50とメインメモリ60とのデータの整合性が保証される。
 キャッシュ配分制御部240は、キャッシュメモリ50のキャッシュ容量を処理単位又はタスクに配分する。ここでタスクとは、オペレーティングシステムの管理下で動作するプログラムの起動、その実行、及び終了などの流れを一括管理する制御単位のことである。キャッシュ容量の配分方法は構成によりさまざまである。例えばキャッシュメモリ50がセットアソシアティブ方式の構成を取る場合、キャッシュメモリ50は「ウェイ」と呼ばれる固定容量単位で分割されている。キャッシュ配分制御部240は、このウェイ51a~51fを処理単位又はタスクに配分する。
 また、キャッシュメモリ50は「メモリマクロセル」と呼ばれるハードウェア単位によって構成されている。キャッシュ制御装置201は、アドレス演算器、バッファ回路、及びバス調停回路などをこの単位ごとに備える。ここでメモリマクロセルの数が増大すると回路が増大する。これによりLSIの面積が増加すると共に高速な伝送ができなくなる。結果として周波数向上が期待できなくなる。この問題に対して、複数のウェイを含む1つのメモリマクロセルを構成することで、メモリマクロセル数を削減することができる。例えば図9では、ウェイ51a及び51bが1つのメモリマクロセルに含まれており、同様にウェイ51c及び51dと、ウェイ51e及び51fとがそれぞれの1つのメモリマクロセルに含まれる。
 ただし、各種回路がメモリマクロセルごとに共通になるため、同一のメモリマクロセルに含まれる異なるウェイへのアクセスが同時に発生した場合は、調停によりアクセス待ちが発生することになる。よって、多くのウェイを1つのメモリマクロセルで構成すると、アクセス待ちが頻出することになるため速度面で不利となるという課題を有する。
 この課題に対して、キャッシュ配分制御部240は、キャッシュメモリ50を共有する複数のプロセッサ10及び11の処理優先度に応じて、各プロセッサ10及び11に割り当てるキャッシュ容量を動的に変更できるようにしている。これにより、従来のキャッシュ制御装置201では、高優先度の処理を実行するプロセッサが多くのキャッシュ容量を使用できる(例えば、特許文献1参照)。
特開平7-248967号公報
 しかしながら、従来のキャッシュ制御装置201では処理優先度に応じてキャッシュ容量を割り当てるが、割当量が優先度にのみ依存する。これにより、処理が必要とするキャッシュ容量を柔軟に割り当てることができない。そのため、処理性能を保証する必要があるシステムでは容量が足りなくなる場合があり、性能を保証することができない。
 また、従来のキャッシュ制御装置201では、キャッシュ容量が余る場合には使用できない余剰資源が発生してしまう。これにより、従来のキャッシュ制御装置201は、キャッシュ容量を有効活用することができないという課題を有する。
 さらに、従来のキャッシュ制御装置201では、ウェイが割り当てられた複数のタスクがそれぞれ異なるプロセッサ上で動作し、かつ、それらのウェイが同じメモリマクロセルに存在する場合、これらの複数のタスクからのキャッシュアクセスが同時に発生すると、アクセス先のウェイが異なっていてもアクセスが衝突して片方が待たされる。これにより、従来のキャッシュ制御装置201は、アクセスが遅延するという課題がある。
 そこで本発明は、余剰資源を有効活用でき、かつアクセス遅延の発生を抑制できるキャッシュ制御装置及びキャッシュ制御方法を提供することを目的とする。
 上記課題を解決するために、本発明の一形態に係るキャッシュ制御装置は、複数のプロセッサにより共有されるセットアソシアティブ方式のキャッシュメモリを制御するキャッシュ制御装置であって、前記キャッシュメモリは複数のウェイを含み、前記複数のウェイは、1以上のウェイを含む複数のグループに分割されており、前記キャッシュ制御装置は、前記複数のプロセッサにより実行される複数のタスクに前記ウェイを割り当てるキャッシュ配分処理を行うキャッシュ配分制御部を備え、前記キャッシュ配分制御部は、1つの前記グループに、いずれのタスクにも割り当てられていない未割当ウェイが含まれ、かつ、当該グループに前記複数のプロセッサに含まれる一のプロセッサにより実行されるタスクに割り当てられたウェイが含まれる場合、当該グループに含まれる前記未割当ウェイを、前記一のプロセッサにより実行される複数のタスクのうちいずれかのタスクに割り当てる。
 この構成により、本発明の一形態に係るキャッシュ制御装置は、余っている未割当ウェイをタスクに割り当てることができるので、余剰資源を有効活用できる。さらに、本発明の一形態に係るキャッシュ制御装置は、未割当ウェイを、当該未割当ウェイと同一のグループ(メモリマクロセル)に含まれるウェイが割り当てられているタスクと同じプロセッサに属するタスクに割り当てる。これにより、1つのグループに含まれるウェイは、同一のプロセッサが実行するタスクに割り当てられる。よって、本発明の一形態に係るキャッシュ制御装置は、異なるプロセッサが同一のグループに含まれるウェイにアクセスした場合に発生するキャッシュアクセスの衝突を回避できる。このように、本発明の一形態に係るキャッシュ制御装置は、アクセス遅延の発生を抑制できる。
 また、前記キャッシュ配分制御部は、1つの前記グループに含まれる全てのウェイが、いずれのタスクにも割り当てられていない場合、当該キャッシュ配分処理により既に割り当てられたタスクの数である割当タスク数が最も少ないプロセッサが実行するタスクに、当該グループに含まれるウェイを割り当ててもよい。
 この構成により、本発明の一形態に係るキャッシュ制御装置は、ウェイが割り当てられている数が少ないプロセッサのタスクに、優先的にウェイを割り当てることができる。これにより、本発明の一形態に係るキャッシュ制御装置は、各プロセッサに均等にウェイを配分できる。
 また、前記キャッシュ制御装置は、さらに、前記複数のタスクのそれぞれに割り当てられたウェイを示すウェイ情報を記憶する記憶部を備え、前記キャッシュ配分制御部は、前記ウェイ情報を参照して前記未割当ウェイを判定してもよい。
 この構成により、本発明の一形態に係るキャッシュ制御装置は、タスクごとのキャッシュ容量をウェイ情報に予め設定することにより、処理性能を容易に保証できる。
 また、前記記憶部は、さらに、前記各プロセッサに対応して設けられ、前記複数のウェイのうちいずれかを指定するサーチポインタを記憶し、前記キャッシュ配分制御部は、前記サーチポインタに、対応するプロセッサのタスクに割り当てられているウェイを指定させるウェイ指定部と、前記プロセッサが実行する複数のタスクのうち、当該プロセッサに対応する前記サーチポインタで指定されているウェイに割り当てられているタスクに、未割当ウェイを割り当てる割当部とを備え、前記ウェイ指定部は、前記割当部により当該プロセッサのタスクにウェイが割り当てられるごとに、前記サーチポインタが指定するウェイを、当該プロセッサのタスクが割り当てられているウェイのうち、予め定められた順で次に位置するウェイに移動させてもよい。
 この構成により、本発明の一形態に係るキャッシュ制御装置は、各プロセッサが実行する複数のタスクに、均等にウェイを配分できる。
 また、前記キャッシュ配分制御部は、さらに、前記各プロセッサに対応して設けられ、ビット列を含む空きウェイ情報を生成したうえで、前記記憶部に記憶する空きウェイ情報生成部を備え、前記ビット列は、前記複数のウェイのそれぞれに対応し、対応するウェイが、当該プロセッサが実行する複数のタスクに割り当てられているか否かを示すビットを含み、前記ウェイ指定部は、前記割当部により当該プロセッサのタスクにウェイを割り当てるごとに、前記サーチポインタが指定するウェイを、当該プロセッサのタスクが割り当てられているウェイのうち、前記ビット列の順で次に位置するウェイに移動させてもよい。
 この構成により、本発明の一形態に係るキャッシュ制御装置は、各プロセッサが実行する複数のタスクに均等にウェイが配分されるように、各タスクを順次選択できる。
 また、前記サーチポインタの値は、前記ウェイ指定部により移動された前記ビット列におけるビット数の和であり、キャッシュ配分制御部は、1つの前記グループに含まれる全てのウェイが、いずれのタスクにも割り当てられていない場合、前記サーチポインタの値が最も少ないプロセッサが実行するタスクに、当該グループに含まれるウェイを割り当ててもよい。
 この構成により、本発明の一形態に係るキャッシュ制御装置は、各プロセッサに均等にウェイを配分できる。
 また、前記キャッシュ配分制御部は、一の前記プロセッサにより実行される複数のタスクのいずれにも、前記ウェイが割り当てられていない場合、当該一のプロセッサの前記サーチポインタの値を最大値に設定してもよい。
 この構成により、本発明の一形態に係るキャッシュ制御装置は、初期状態としてウェイが割り当てられていないプロセッサに対しては、ウェイを割り当てないようにできる。
 また、前記キャッシュ配分制御部は、前記タスクの生成又は削除時に、前記キャッシュ配分処理を行ってもよい。
 この構成により、本発明の一形態に係るキャッシュ制御装置は、タスクの処理に影響を与えることなくウェイを配分できる。
 なお、本発明は、このようなキャッシュ制御装置として実現できるだけでなく、キャッシュ制御装置に含まれる特徴的な手段をステップとするキャッシュ制御方法として実現したり、そのような特徴的なステップをコンピュータに実行させるプログラムとして実現したりすることもできる。そして、そのようなプログラムは、CD-ROM等の記録媒体及びインターネット等の伝送媒体を介して流通させることができるのは言うまでもない。
 さらに、本発明は、このようなキャッシュ制御装置の機能の一部又は全てを実現する半導体集積回路(LSI)として実現したり、このようなキャッシュ制御装置を含むプロセッサシステムとして実現したりできる。
 以上より、本発明は、余剰資源を有効活用でき、かつアクセス遅延の発生を抑制できるキャッシュ制御装置及びキャッシュ制御方法を提供できる。
図1は、本発明の実施の形態に係るプロセッサシステムの構成を示すブロック図である。 図2は、本発明の実施の形態に係るキャッシュ配分制御部の構成を示すブロック図である。 図3Aは、本発明の実施の形態に係るウェイ情報記憶部の初期状態の一例を示す図である。 図3Bは、本発明の実施の形態に係るウェイ情報記憶部の初期状態の一例を示す図である。 図4は、本発明の実施の形態に係るキャッシュ配分制御部によるキャッシュ配分手順を示すフローチャートである。 図5は、本発明の実施の形態に係る有効位置探索部の動作を示すフローチャートである。 図6は、本発明の実施の形態に係るビット割当部の動作を示すフローチャートである。 図7Aは、本発明の実施の形態に係るウェイ情報記憶部の処理途中における状態の一例を示す図である。 図7Bは、本発明の実施の形態に係るウェイ情報記憶部の処理途中における状態の一例を示す図である。 図8Aは、本発明の実施の形態に係るウェイ情報記憶部の処理完了後の状態の一例を示す図である。 図8Bは、本発明の実施の形態に係るウェイ情報記憶部の処理完了後の状態の一例を示す図である。 図9は、従来のプロセッサシステムの構成を示すブロック図である。
 以下、本発明のキャッシュ制御装置の実施の形態について図面を参照して説明する。
 本発明の実施の形態に係るキャッシュ制御装置は、余っているウェイを、当該ウェイと同一のグループ(メモリマクロセル)のウェイが割り当てられているタスクと同じプロセッサのタスクに割り当てる。これにより、本発明の実施の形態に係るキャッシュ制御装置は、異なるプロセッサ間のキャッシュアクセスの衝突を回避できるので、アクセス遅延の発生を抑制できるとともに、余剰資源を有効活用できる。
 まず、本発明の実施の形態に係るキャッシュ制御装置を含むプロセッサシステムの構成を説明する。
 図1は、本発明の実施の形態に係るプロセッサシステム100の構成を示す図である。
 図1に示すプロセッサシステム100は、プロセッサ10及び11と、メモリバス20と、キャッシュ制御装置101と、キャッシュメモリ50と、メインメモリ60とを備える。なお、図9と同様の要素には同一の符号を付している。
 また、この例ではプロセッサシステム100が2つのプロセッサ10及び11を備える例を記載しているが、プロセッサの数は2つに限定するものではなく、プロセッサシステム100は、3つ以上のプロセッサを備えてもよい。
 プロセッサ10及び11はメモリバス20を介してメインメモリ60へアクセスする。
 キャッシュ制御装置101はキャッシュメモリ50を制御する。このキャッシュ制御装置101は、キャッシュ制御部30と、キャッシュ配分制御部40とを備える。
 キャッシュ制御部30は、プロセッサ10及び11からメインメモリ60へのアクセスに対して以下のような制御を行う。メインメモリ60からの読み出しアクセスが発生した場合、アクセスするデータがキャッシュメモリ50に存在すれば(キャッシュヒット)、キャッシュ制御部30は、キャッシュメモリ50へアクセスし、メインメモリ60へはアクセスしない。ここでキャッシュメモリ50へのアクセスはメインメモリ60へのアクセスに比べて高速である。よって、キャッシュメモリ50を用いることにより、メモリアクセスに要する時間を短縮できるので、システム全体の性能を向上できる。
 一方、アクセスするデータがキャッシュメモリ50に存在しなければ(キャッシュミス)、キャッシュ制御部30は、メインメモリ60からデータを読み出すと共にキャッシュメモリ50へ当該データを書き込む。これにより次に同じデータへのアクセスが発生した際には、キャッシュ制御部30は、キャッシュメモリ50へアクセスできる。
 また、メインメモリ60への書き込みアクセスが発生した場合、キャッシュ制御部30は、メインメモリ60へデータを書き込むと共に、キャッシュメモリ50への当該データを書き込む。これによりキャッシュメモリ50とメインメモリ60とのデータの整合性が保証される。
 キャッシュメモリ50は、セットアソシアティブ方式の構成を有する。このキャッシュメモリ50は、複数のウェイ51a~51fを含む。なお、複数のウェイ51a~51fを特に区別しない場合にはウェイ51と記す。
 また、キャッシュメモリ50は、メモリマクロセルと呼ばれるハードウェア単位によって構成されている。キャッシュ制御装置101は、アドレス演算器、バッファ回路、及びバス調停回路などをこの単位ごとに備える。例えば、図1では、ウェイ51a及び51bが1つのメモリマクロセルに含まれており、同様にウェイ51c及び51dと、ウェイ51e及び51fとがそれぞれの1つのメモリマクロセルに含まれる。つまり、複数のウェイ51は、それぞれが複数のウェイ51を含む複数のグループ52a、52b及び52c(メモリマクロセル)に分割されている。なお、グループ52a、52b及び52cを特に区別しない場合にはグループ52と記す。
 キャッシュ配分制御部40は、キャッシュメモリ50に含まれる複数のウェイ51のうち、いずれのタスクにも割り当てられていないウェイ51を、プロセッサ10及び11に実行される複数のタスクに割り当てるキャッシュ配分処理を行う。ここでタスクとは、オペレーティングシステムの管理下で動作するプログラムの起動、その実行、及び終了などの流れを一括管理する制御単位のことである。
 また、キャッシュ配分制御部40は、グループ52ごとに、未割当ウェイをタスクに割り当てる処理を順次行う。
 具体的には、キャッシュ配分制御部40は、1つのグループ52に未割当ウェイ(いずれのタスクにも割り当てられていないウェイ51)が含まれ、かつ、当該グループ52に複数のプロセッサ10及び11のうち一方のプロセッサにより実行されるタスクに割り当てられたウェイ51が含まれる場合、当該グループ52に含まれる未割当ウェイを、当該一方のプロセッサにより実行される複数のタスクのうちいずれかのタスクに割り当てる。
 また、キャッシュ配分制御部40は、1つのグループ52に含まれる全てのウェイ51が、いずれのタスクにも割り当てられていない場合、当該キャッシュ配分処理により既に割り当てられたタスクの数が最も少ないプロセッサ10又は11が実行するタスクに、当該グループ52に含まれるウェイ51を割り当てる。
 以下、キャッシュ配分制御部40について詳細に説明する。
 図2は、本発明の実施の形態に係るキャッシュ配分制御部40の構成を示すブロック図である。また、図2は、プロセッサ10又は11がソフトウェア(プログラム)を実行することにより、オペレーティングシステムの一部の機能としてキャッシュ配分制御を行う場合の、キャッシュ配分制御部40の機能を模式的に表している。なお、キャッシュ配分制御部40の機能のうち一部又は全てをハードウェア(専用回路)で実現してもよい。
 図2に示すようにキャッシュ配分制御部40は、ウェイ情報記憶部410と、有効位置探索部440と、ビット割当部450と、空きウェイ情報生成部460と、判定部470と、プロセッサ選択部480と、初期値設定部490とを備える。
 ウェイ情報記憶部410は、本発明の記憶部に相当し、ウェイ情報411a、411b、411c…、412a、412b、412c…と、空きウェイ情報421及び422と、サーチポインタ431及び432とを記憶する。ここで、ウェイ情報411a、411b、411c…と、空きウェイ情報421と、サーチポインタ431とはプロセッサ10に対応し、412a、412b、412c…と、空きウェイ情報422と、サーチポインタ432とはプロセッサ11に対応する。
 また、ウェイ情報411a、411b、411c…を特に区別しない場合には、ウェイ情報411と記し、ウェイ情報412a、412b、412c…を特に区別しない場合には、ウェイ情報412と記す。
 ウェイ情報411及び412は、対応するプロセッサ10又は11が実行する複数のタスクのそれぞれに割り当てられたウェイ51を示す。
 空きウェイ情報421及び422は、複数のウェイ51のそれぞれが、対応するプロセッサ10又は11が実行する複数のタスクに割り当てられているか否かを示す。
 サーチポインタ431及び432は、プロセッサ10又は11ごとに設けられ、それぞれ複数のウェイ51のいずれかを指定する有効位置を示す。この有効位置は、後述する、ウェイ51を割り当てるプロセッサ10又は11を選択する処理と、ウェイ51を割り当てるタスクを選択する処理とに用いられる。
 図3A及び図3Bは、ウェイ情報記憶部410の初期状態の一例を示す図である。
 図3A及び図3Bに示すように、複数のウェイ情報411及び412は、プロセッサ10及び11上で動作するタスクごとに設けられる。各ウェイ情報411及び412は、ビット列を含む。このビット列は、右からビット0、1、2…の順で並んでいる。また、各ビットは、キャッシュメモリ50に含まれる各ウェイ51に対応しており、ビットnが有効(1を示す)ならばウェイnを当該タスクが使用できることを示す。また、ビットnが無効(0を示す)ならばウェイnを当該タスクが使用できないことを示す。このウェイ情報411及び412のビット幅はキャッシュメモリ50に含まれるウェイの数と同一である。例えば、図3A及び図3Bに示す例では、ウェイの数は16であり、ウェイ情報411及び412も16ビットである。
 空きウェイ情報421及び422はプロセッサ10及び11ごとに設けられる。この空きウェイ情報421及び422はビット列を含む。このビット列は、右からビット0、1、2…の順で並んでいる。また、各ビットは、キャッシュメモリ50に含まれる各ウェイ51に対応している。対応するプロセッサ10又は11に属するいずれかのタスクに割り当てられているウェイに対応するビットは「1」であり、いずれのタスクも割り当てられていないウェイに対応するビットは「0」となる。なお、図3A及び図3Bでは、ウェイ情報411及び412と、空きウェイ情報421及び422とに含まれるビット列の「0」は省略している。
 サーチポインタ431及び432はプロセッサごとに設けられ、0以上の整数を保持する。サーチポインタ431が保持する数値は、ウェイ情報411及び空きウェイ情報421のビットの位置を表し、サーチポインタ432が保持する数値は、ウェイ情報412及び空きウェイ情報422のビットの位置を表している。また、サーチポインタ431及び432の値は、当該キャッシュ配分処理の間に、当該サーチポインタ431又は432が移動したビット数の和を示す。
 また、サーチポインタ431及び432がウェイ情報411及び412のビット幅を超える数値を保持している場合は、ウェイ情報411及び412のビット幅に対する剰余の数値に当たるビットの位置を表す。例えば図3Bにおいて、プロセッサ11のサーチポインタ432は「3」を保持し、ビット3を示している。また、例えば、プロセッサ10のサーチポインタ431が「38」を保持している場合、ビット幅は16であることから、38mod16=6となる。よって、サーチポインタ431は、ビット6を表している。
 初期値設定部490は、各タスクの処理性能を保証するために、当該タスクの生成時に当該タスクが使用するウェイ51を決定する。また、初期値設定部490は、決定した各タスクが使用するウェイ51の情報を、ウェイ情報411及び412に初期値として設定する。例えば初期値設定部490は、図3A及び図3Bに示すウェイ情報411及び412を、タスク生成時に初期値として設定する。
 空きウェイ情報生成部460は、空きウェイ情報421及び422を生成し、ウェイ情報記憶部410に記憶する。具体的には、空きウェイ情報生成部460は、プロセッサ10(又は11)に含まれるタスクに対応する全てのウェイ情報411(又は412)の初期値の論理和を算出することにより、空きウェイ情報421及び422を生成する。
 判定部470は、ウェイ情報411及び412の初期値を参照して、各グループ52に含まれる未割当ウェイの有無、及び割当状態を判定する。
 プロセッサ選択部480は、判定部470の判定結果を用いて、未割当ウェイを割り当てるプロセッサ10又は11を選択する。
 ビット割当部450は、本発明の割当部に相当し、プロセッサ選択部480により選択されたプロセッサ10又は11が実行する複数のタスクのうち1以上のタスクを選択し、選択したタスクに未割当ウェイを割り当てる。具体的には、ビット割当部450は、対応するサーチポインタ431又は432で指定される有効位置のウェイ51が割り当てられているタスクを選択する。
 有効位置探索部440は、本発明のウェイ指定部に相当し、サーチポインタ431又は432に、対応するプロセッサ10又は11のタスクに割り当てられているウェイ51を指定させる。また、有効位置探索部440は、ビット割当部450により、プロセッサ10又は11のタスクにウェイ51が割り当てられるごとに、サーチポインタ431又は432が指定するウェイ51を、対応するプロセッサのタスクが割り当てられているウェイ51のうち、空きウェイ情報421及び422のビット列の順で次に位置するウェイ51に移動させる。
 具体的には、有効位置探索部440は、ビット割当部450によりタスクにウェイ51が割り当てられる毎に、有効位置探索処理によりプロセッサ10(又は11)の有効位置を探索し、探索した有効位置をサーチポインタ431(又は432)にセットする。
 ここで、有効位置探索処理とは、サーチポインタ431及び432を順次1ずつインクリメントしていき、次に空きウェイ情報421又は422が有効「1」となるビットを探索する処理である。
 言い換えると、有効位置探索部440は、各プロセッサ10又は11の、割当済みタスク(初期値においてウェイが割り当てられているタスク)をビット列の順に順番に選択することを繰り返す。
 以下、キャッシュ配分制御部40の動作を、具体例を交えて説明する。
 図4は、キャッシュ配分制御部40によるキャッシュ配分制御処理の動作の流れを示すフローチャートである。
 まず、初期値設定部490は、図3A及び図3Bに示すウェイ情報411及び412を初期値として設定する。また、図3A及び図3Bに示すように、ウェイ51は16個あり、各メモリマクロセルは2個のウェイ51を含むとする。つまり、16個のウェイ51は、2個ずつ8個のグループ52に分割されているとする。また、各プロセッサ10及び11は、それぞれ3個のタスクを実行するとする。
 まず、空きウェイ情報生成部460は、空きウェイ情報421及び422をプロセッサ10及び11ごとに作成する(ステップS1001)。この処理により図3A及び図3Bに示す空きウェイ情報421及び422が生成される。具体的には、プロセッサ10のタスク0、1、2のウェイ情報411a~411cの論理和は、ビット0、6、7で「1」となり、それ以外のビットで「0」となる。また、プロセッサ11のタスク0、1、2のウェイ情報412a~412cの論理和は、ビット3及び10で「1」となり、それ以外のビットで「0」となる。
 次に、有効位置探索部440は、有効位置探索処理によりプロセッサ10の有効位置を探索し、探索した有効位置をサーチポインタ431にセットする(ステップS1002)。
 以下、有効位置探索処理について詳細に説明する。
 図5は、有効位置探索部440による有効位置探索処理の流れを示すフローチャートである。
 まず、有効位置探索部440は、指定されたプロセッサnのサーチポインタ431又は432を取り出し(ステップS1101)、取り出したサーチポインタ431又は432がウェイ幅を一周するまで以下に示すステップS1103及びS1104の処理を繰り返す(ステップS1102)。
 ここでは、有効位置探索部440は、プロセッサ10のサーチポインタ431の初期値「0」を取り出す。
 まず、有効位置探索部440は、指定されたプロセッサnのサーチポインタ431又は432で指定されるビットのウェイ51が、割当済みウェイであるか否かを判定する(ステップS1103)。具体的には、有効位置探索部440は、空きウェイ情報421又は422に含まれる、サーチポインタ431又は432で指定されるビットが、有効「1」であるか、無効「0」であるかを判定する。
 ここでは、サーチポインタ431は「0」であり、空きウェイ情報421のビット0は、有効「1」なので(ステップS1103でYes)、有効位置探索部440は、当該ビット0をプロセッサ10の有効位置とし、サーチポインタ431に「0」をセットする。
 再度、図4を参照して説明を行う。
 次に、有効位置探索部440は、有効位置探索処理によりプロセッサ11の有効位置を探索し、探索した有効位置をサーチポインタ432にセットする(ステップS1003)。
 この場合、図5に示すように、まず、有効位置探索部440は、プロセッサ11のサーチポインタ432の初期値「0」を取り出す(ステップS1101)。
 次に、有効位置探索部440は、空きウェイ情報422の、サーチポインタ432で指定されるビット0が有効「1」であるか、無効「0」であるかを判定する(ステップS1103)。ここでは、空きウェイ情報422のビット0は、無効「0」なので(ステップS1103でNo)、有効位置探索部440は、サーチポインタ432に1を加算する(ステップS1104)。
 次に、有効位置探索部440は、サーチポインタ432で指定されるビット1が有効「1」であるか、無効「0」であるかを判定する(ステップS1103)。ここでは、空きウェイ情報422のビット1は、無効「0」なので(ステップS1103でNo)、有効位置探索部440は、サーチポインタ432に更に1を加算する(ステップS1104)。
 有効位置探索部440は、サーチポインタ432が、空きウェイ情報422で有効「1」が示されるビットに到達するまで、順次、ステップS1103及びS1104の処理を繰り返す。この例では、サーチポインタ432が「3」になるまで、ステップS1103及びS1104の処理が繰り返される。これにより、有効位置探索部440は、ビット3をプロセッサ11の有効位置とし、サーチポインタ432に「3」をセットする。
 また、サーチポインタ431又は432が一周した場合(ステップS1102でYes)、有効位置探索部440は、サーチポインタ431又は432に最大値を設定したうえでループを終了する(ステップS1105)。これは有効なビットが存在しないことを示しており、サーチポインタ431又は432に最大値を設定することにより、後述する大小比較(ステップS1006)の際に必ず大きいと判断され、他の有効なビットが存在するタスクが選択されるようになる。例えば、この最大値は(ビット幅)×(ビット幅)である。
 再度、図4を参照して説明を行う。
 次に、キャッシュ配分制御部40は、空きウェイ情報421及び422を、各グループに対応する2ビットずつに区切り、各2ビットに対して、以下に示すステップS1005からステップS1019までの処理を順次行う(ステップS1004)。
 まず、判定部470は、空きウェイ情報421及び422のビットi及びi+1の状態(有効又は無効)を判定する(ステップS1005)。以下、空きウェイ情報421及び422のビットi及びi+1の状態を、「(ビットi+1状態、ビットi状態)」として表す。
 ここで判定部470は、ウェイ情報411及び412の初期値において、1つのグループ52に含まれる複数のウェイ51がいずれもタスクに割り当てられていない(ステップS1005で、プロセッサ10=(0、0)かつプロセッサ11=(0、0))か、1以上のウェイ51がタスクに割り当てられ、かつ1以上のウェイ51がタスクに割り当てられていない(ステップS1005で、プロセッサ10=(0、1)かつプロセッサ11=(0、0)、又は、プロセッサ10=(1、0)かつプロセッサ11=(0、0)、又は、プロセッサ10=(0、0)かつプロセッサ11=(0、1)、又は、プロセッサ10=(0、0)かつプロセッサ11=(1、0))か、全てのウェイ51がタスクに割り当てられている(ステップS1005で、それ以外)かを判定する。
 また、プロセッサ選択部480は、1以上のウェイ51がタスクに割り当てられ、かつ1以上のウェイ51がタスクに割り当てられていない場合、当該割り当てられているタスクを実行するプロセッサ10又は11を選択する。
 また、プロセッサ選択部480は、1つのグループ52に含まれるウェイ51がいずれもタスクに割り当てられていない場合、サーチポインタ431及び432の数値が小さいプロセッサ10又は11を選択する(ステップS1006)。
 また、全てのウェイ51がタスクに割り当てられている場合、キャッシュ配分制御部40は、タスクの配分を行わず、次のグループ52の処理に移行する。
 この例では、キャッシュ配分制御部40は、グループ0に含まれるビット0及びビット1の状態を判定する。プロセッサ10の空きウェイ情報421のビット1及びビット0は、(0、1)であり、プロセッサ11の空きウェイ情報422のビット1及びビット0は、(0、0)である。つまり、プロセッサ10が実行するタスクにウェイ51が割り当てられているので、プロセッサ選択部480は、プロセッサ10を選択する。次に、ビット割当部450は、タスクが割り当てられていないビットi+1(ビット1)に、プロセッサ選択部480により選択されたプロセッサ10のタスクを割り当てるビット割当処理を行う(ステップS1011)。
 ここでビット割当処理とは、未割当ウェイをタスクに割り当てる処理である。
 以下、ビット割当処理について詳細に説明する。
 図6は、ビット割当部450によるビット割当処理の流れを示すフローチャートである。
 ビット割当部450は、プロセッサ選択部480により選択されたプロセッサnの全てのタスク0~mについて、ステップS1202からステップS1204までの処理を順次行う(ステップS1201)。
 まず、ビット割当部450は、プロセッサnのタスク0~mのうちタスクi(i=0~m)を選択する。ビット割当部450は、選択したタスクiの、サーチポインタ431又は432で指定されるビットが有効「1」であるか、無効「0」であるかをウェイ情報411又は412を参照して判定する(ステップS1202)。
 タスクiの、サーチポインタ431又は432で指定されるビットが有効「1」である場合(ステップS1202でYes)、ビット割当部450は、空きビットに有効ビットをコピーする(ステップS1203)。すなわち、ビット割当部450は、タスクiのウェイ情報411又は412の空きビットを有効「1」に変更する。ここで、空きビットとは、ビットi及びビットi+1のうち、いずれのタスクも割り当てられていない(空きウェイ情報421又は422で無効「0」の)ビットである。
 次に、ビット割当部450は、プロセッサnの別のタスクを選択し、選択したタスクに対して、ステップS1202の処理を行う。
 一方、タスクiの、サーチポインタ431又は432で指定されるビットが無効「0」である場合(ステップS1202でNo)、ビット割当部450は、当該タスクiのウェイ情報411又は412を変更せず、次のタスクに対して、ステップS1202の処理を行う。
 この例では、図3Aに示すように、プロセッサ10のサーチポインタ431は「0」であり、ウェイ情報411a~411cのビット0のうち、ウェイ情報411aのビット0のみが有効「1」なので、ビット割当部450は、図7Aに示すように、ウェイ情報411aのビット1を有効「1」にすることにより、ビット1のウェイ51をプロセッサ10のタスク0に割り当てる。
 再度、図4を参照して説明する。
 次に、有効位置探索部440は、プロセッサ10の有効位置を探索する(ステップS1012)。ここでは、図7Aに示すように有効位置探索部440は、ビット6をプロセッサ10の有効位置とし、サーチポインタ431に「6」をセットする。なお、ここでの有効位置探索処理は、上述した図5に示す処理と同様であるが、ステップS1101において、元にセットされているサーチポインタ431又は432の値(この例では「0」)に、1を加算した後、ステップS1102以降の処理を行う。また、ステップS1008、S1010、S1014、S1016及びS1018も同様である。
 以上により、グループ0に対する処理は終了し、次に、グループ1に対する処理が行われる。
 まず、判定部470は、グループ1に含まれるビット3及びビット2の状態を判定する(ステップS1005)。プロセッサ10の空きウェイ情報421のビット3及びビット2は、(0、0)であり、プロセッサ11の空きウェイ情報422のビット3及びビット2は、(1、0)であるので、プロセッサ選択部480はプロセッサ11を選択する。次に、ビット割当部450は、ビットi(ビット2)に、プロセッサ11のタスクを割り当てるビット割当処理を行う(ステップS1017)。
 ここで、図3Bに示すように、プロセッサ11のサーチポインタ432は「3」であり、ウェイ情報412a~412cのビット3のうち、ウェイ情報412aのビット3のみが有効「1」なので、ビット割当部450は、ウェイ情報412aのビット2を有効「1」にすることにより、ビット2のウェイ51をプロセッサ11のタスク0に割り当てる。
 次に、有効位置探索部440は、プロセッサ11の有効位置を探索する(ステップS1018)。ここでは、図7Bに示すように有効位置探索部440は、ビット10をプロセッサ11の有効位置とし、サーチポインタ432に「10」をセットする。
 以上により、グループ1に対する処理は終了し、次に、グループ2に対する処理が行われる。
 まず、判定部470は、グループ2に含まれるビット5及びビット4の状態を判定する(ステップS1005)。プロセッサ10の空きウェイ情報421のビット5及びビット4は、(0、0)であり、プロセッサ11の空きウェイ情報422のビット5及びビット4は、(0、0)である。つまり、1つのグループ52に含まれるウェイ51がいずれもタスクに割り当てられていないので、プロセッサ選択部480は、プロセッサ10のサーチポインタ431と、プロセッサ11のサーチポインタ432とを比較し、サーチポインタの数値が小さいプロセッサを、空きビットを割り当てるプロセッサxに決定する(ステップS1006)。
 ここでは、図7A及び図7Bに示すように、プロセッサ10のサーチポインタ431は「6」であり、プロセッサ11のサーチポインタ432は「10」であるので、プロセッサ選択部480は、プロセッサ10を空きビットを割り当てるプロセッサxに決定する。
 次に、ビット割当部450は、プロセッサx(プロセッサ10)のタスクにビットi(ビット4)を割り当てる(ステップS1007)。ここでは、図7Aに示すように、プロセッサ10のサーチポインタ431は「6」であり、ウェイ情報411a~411cのビット6のうち、ウェイ情報411bのビット6のみが有効「1」なので、ビット割当部450は、図8Aに示すように、ウェイ情報411bのビット4を有効「1」にすることにより、ビット4のウェイ51をプロセッサ10のタスク1に割り当てる。
 次に、有効位置探索部440は、プロセッサx(プロセッサ10)の有効位置を探索する(ステップS1008)。ここでは、有効位置探索部440は、ビット7をプロセッサ10の有効位置とし、サーチポインタ431に「7」をセットする。
 次に、ビット割当部450は、プロセッサx(プロセッサ10)のタスクにビットi+1(ビット5)を割り当てる(ステップS1009)。ここでは、プロセッサ10のサーチポインタ431は「7」であり、ウェイ情報411a~411cのビット7のうち、ウェイ情報411cのビット7のみが有効「1」なので、ビット割当部450は、ウェイ情報411cのビット5を有効「1」にすることにより、ビット5のウェイ51をプロセッサ10のタスク2に割り当てる。
 次に、有効位置探索部440は、プロセッサx(プロセッサ10)の有効位置を探索する(ステップS1010)。ここでは、有効位置探索部440は、ビット0をプロセッサ10の有効位置とし、サーチポインタ431に「16」をセットする。
 以上により、グループ2に対する処理は終了し、次に、グループ3に対する処理が行われる。
 まず、判定部470は、グループ3に含まれるビット7及びビット6の状態を判定する(ステップS1005)。プロセッサ10の空きウェイ情報421のビット7及びビット6は、(1、1)であり、プロセッサ11の空きウェイ情報422のビット7及びビット6は、(0、0)である。つまり、全てのウェイ51がタスクに割り当てられているので、キャッシュ配分制御部40は、ウェイ情報411及び412を変更しない。
 以上により、グループ3に対する処理は終了し、次に、グループ4に対する処理が行われる。
 まず、判定部470は、グループ4に含まれるビット9及びビット8の状態を判定する(ステップS1005)。プロセッサ10の空きウェイ情報421のビット9及びビット8は、(0、0)であり、プロセッサ11の空きウェイ情報422のビット9及びビット8は、(0、0)であるので、次に、プロセッサ選択部480は、プロセッサ10のサーチポインタ431「16」と、プロセッサ11のサーチポインタ432「6」とを比較し、サーチポインタの数値が小さいプロセッサ11を、ビット9及びビット8を割り当てるプロセッサxに決定する(ステップS1006)。
 次に、ビット割当部450は、プロセッサ10のタスクにビット8を割り当てる(ステップS1007)。ここでは、プロセッサ11のサーチポインタ432は「10」であり、ウェイ情報412a~412cのビット10のうち、ウェイ情報412b及び412cのビット10が有効「1」なので、ビット割当部450は、図8Bに示すように、ウェイ情報412b及び412cのビット8を有効「1」にすることにより、ビット8のウェイ51をプロセッサ11のタスク1及びタスク2に割り当てる。
 次に、有効位置探索部440は、プロセッサ11の有効位置を探索する(ステップS1008)。ここでは、有効位置探索部440は、ビット3をプロセッサ11の有効位置とし、サーチポインタ432に「19」をセットする。
 次に、ビット割当部450は、プロセッサ11のタスクにビット9を割り当てる(ステップS1009)。ここでは、プロセッサ11のサーチポインタ432は「19」(ビット3)であり、ウェイ情報412a~412cのビット3のうち、ウェイ情報412aのビット3のみが有効「1」なので、ビット割当部450は、図8Bに示すように、ウェイ情報412aのビット9を有効「1」にすることにより、ビット9のウェイ51をプロセッサ11のタスク0に割り当てる。
 次に、有効位置探索部440は、プロセッサ11の有効位置を探索する(ステップS1010)。ここでは、有効位置探索部440は、ビット10をプロセッサ11の有効位置とし、サーチポインタ432に「26」をセットする。
 以上により、グループ4に対する処理は終了する。以降、グループ5~7に対して、同様の処理が行われる。
 なお、ステップS1005において、プロセッサ10の空きウェイ情報421のビットi+1及びビットiが、(1、0)であり、プロセッサ11の空きウェイ情報422のビットi+1及びビットiが、(0、0)の場合には、次に、ビット割当部450は、ビットiに、プロセッサ10のタスクを割り当てるビット割当処理を行う(ステップS1013)。次に、有効位置探索部440は、プロセッサ10の有効位置を探索し(ステップS1014)、キャッシュ配分制御部40は、次のグループに対する処理を行う(ステップS1004)。
 また、ステップS1005において、プロセッサ10の空きウェイ情報421のビットi+1及びビットiが、(0、0)であり、プロセッサ11の空きウェイ情報422のビットi+1及びビットiが、(0、1)の場合には、次に、ビット割当部450は、ビットi+1に、プロセッサ11のタスクを割り当てるビット割当処理を行う(ステップS1015)。次に、有効位置探索部440は、プロセッサ11の有効位置を探索し(ステップS1016)、キャッシュ配分制御部40は、次のグループに対する処理を行う(ステップS1004)。
 また、ステップS1005において、上記以外の場合、つまり、ビットi+1及びビットiのウェイが、共にタスクに割り当てられている場合、キャッシュ配分制御部40は、タスクの割り当てを行わず、次のグループに対する処理を行う(ステップS1004)。
 以上説明したように、本発明の実施の形態に係るキャッシュ制御装置101は、各タスクの処理性能を保証できるように、ウェイ情報411及び412に初期値を設定する。これにより、キャッシュ制御装置101は、処理性能を保証する必要があるシステムにおいてタスクごとにキャッシュ容量を確保できる。
 また、キャッシュ制御装置101は、余っている未割当ウェイをタスクに割り当てることができるので、余剰資源をタスクに割り当てることができる。
 さらに、キャッシュ制御装置101は、未割当ウェイを、当該未割当ウェイと同一のグループ52(メモリマクロセル)のウェイ51が割り当てられているタスクと同じプロセッサ10又は11のタスクに割り当てる。これにより、1つのグループ52に含まれるウェイ51は、同一のプロセッサ10又は11が実行するタスクに割り当てられる。よって、キャッシュ制御装置101は、異なるプロセッサ10及び11が同一のグループ52に含まれるウェイ51にアクセスした場合に発生するキャッシュアクセスの衝突を回避できる。このように、本発明の実施の形態に係るキャッシュ制御装置101は、アクセス遅延の発生を抑制できる。
 また、キャッシュ制御装置101は、1つのグループ52に含まれる全てのウェイ51が、いずれのタスクにも割り当てられていない場合、サーチポインタ431又は432の数値が最も小さいプロセッサ10又は11が実行するタスクに、当該グループ52に含まれるウェイ51を割り当てる。これにより、キャッシュ制御装置101は、ウェイ51が割り当てられている数が少ないプロセッサ10又は11のタスクに、優先的にウェイ51を割り当てることができる。これにより、キャッシュ制御装置101は、各プロセッサ10又は11に均等にウェイ51を配分できる。
 また、有効位置探索部440は、ウェイ51をタスクに割り当てるたびに、サーチポインタ431及び432を更新することにより、対応するプロセッサ10又は11が実行する複数のタスクを予め定められた順に順番に選択することを繰り返す。また、ビット割当部450は、選択されたタスクに、空きウェイ51を割り当てる。これにより、キャッシュ制御装置101は、各プロセッサ10又は11が実行する複数のタスクに、均等にウェイ51を配分できる。
 なお、キャッシュ配分制御部40がキャッシュ配分制御処理を実施する契機を特定していないが、タスクの起動又はタスクの終了時に当該処理を実施することにより、タスクの処理に影響を与えることなく未割当ウェイを配分できる。
 また、上記説明では、各グループ52は、それぞれ2個のウェイ51を含むとしたが、3個以上のウェイ51を含んでもよい。また、各グループ52が異なる数のウェイ51を含んでもよい。
 また、上記実施の形態に係るキャッシュ制御装置101に含まれる各処理部は典型的には、CPU等のプロセッサがプログラム(ソフトウェア)を実行することにより実現される。
 さらに、本発明は上記プログラムであってもよいし、上記プログラムが記録されたCD-ROM等の記録媒体であってもよい。また、上記プログラムは、インターネット等の伝送媒体を介したソフトウェアダウンロード等により流通させることができるのは言うまでもない。
 なお、上記実施の形態に係るキャッシュ制御装置101に含まれる各処理部の一部又は全てを集積回路であるLSIとして実現してもよい。これらは個別に1チップ化されてもよいし、一部又はすべてを含むように1チップ化されてもよい。
 ここでは、LSIとしたが、集積度の違いにより、IC、システムLSI、スーパーLSI、ウルトラLSIと呼称されることもある。
 また、集積回路化はLSIに限るものではなく、専用回路又は汎用プロセッサで実現してもよい。LSI製造後にプログラムすることが可能なFPGA(Field Programmable Gate Array)、又はLSI内部の回路セルの接続や設定を再構成可能なリコンフィギュラブル・プロセッサを利用してもよい。
 また、本発明は、以上の実施の形態に限定されることなく、種々の変更が可能であり、それらも本発明の範囲内に包含されるものであることは言うまでもない。
 以上のように、本発明は、キャッシュ制御装置及びキャッシュ制御方法に適用できる。また、本発明は、複数のプロセッサ及びキャッシュメモリを含むプロセッサシステムに適用できる。
 10、11 プロセッサ
 20 メモリバス
 30 キャッシュ制御部
 40、240 キャッシュ配分制御部
 50 キャッシュメモリ
 51、51a、51b、51c、51d、51e、51f ウェイ
 52、52a、52b、52c グループ
 60 メインメモリ
 100、200 プロセッサシステム
 101、201 キャッシュ制御装置
 410 ウェイ情報記憶部
 411、411a、411b、411c、412、412a、412b、412c ウェイ情報
 421、422 空きウェイ情報
 431、432 サーチポインタ
 440 有効位置探索部
 450 ビット割当部
 460 空きウェイ情報生成部
 470 判定部
 480 プロセッサ選択部
 490 初期値設定部

Claims (9)

  1.  複数のプロセッサにより共有されるセットアソシアティブ方式のキャッシュメモリを制御するキャッシュ制御装置であって、
     前記キャッシュメモリは複数のウェイを含み、
     前記複数のウェイは、1以上のウェイを含む複数のグループに分割されており、
     前記キャッシュ制御装置は、
     前記複数のプロセッサにより実行される複数のタスクに前記ウェイを割り当てるキャッシュ配分処理を行うキャッシュ配分制御部を備え、
     前記キャッシュ配分制御部は、1つの前記グループに、いずれのタスクにも割り当てられていない未割当ウェイが含まれ、かつ、当該グループに前記複数のプロセッサに含まれる一のプロセッサにより実行されるタスクに割り当てられたウェイが含まれる場合、当該グループに含まれる前記未割当ウェイを、前記一のプロセッサにより実行される複数のタスクのうちいずれかのタスクに割り当てる
     キャッシュ制御装置。
  2.  前記キャッシュ配分制御部は、1つの前記グループに含まれる全てのウェイが、いずれのタスクにも割り当てられていない場合、当該キャッシュ配分処理により既に割り当てられたタスクの数である割当タスク数が最も少ないプロセッサが実行するタスクに、当該グループに含まれるウェイを割り当てる
     請求項1記載のキャッシュ制御装置。
  3.  前記キャッシュ制御装置は、さらに、
     前記複数のタスクのそれぞれに割り当てられたウェイを示すウェイ情報を記憶する記憶部を備え、
     前記キャッシュ配分制御部は、前記ウェイ情報を参照して前記未割当ウェイを判定する
     請求項1記載のキャッシュ制御装置。
  4.  前記記憶部は、さらに、前記各プロセッサに対応して設けられ、前記複数のウェイのうちいずれかを指定するサーチポインタを記憶し、
     前記キャッシュ配分制御部は、
     前記サーチポインタに、対応するプロセッサのタスクに割り当てられているウェイを指定させるウェイ指定部と、
     前記プロセッサが実行する複数のタスクのうち、当該プロセッサに対応する前記サーチポインタで指定されているウェイに割り当てられているタスクに、未割当ウェイを割り当てる割当部とを備え、
     前記ウェイ指定部は、前記割当部により当該プロセッサのタスクにウェイが割り当てられるごとに、前記サーチポインタが指定するウェイを、当該プロセッサのタスクが割り当てられているウェイのうち、予め定められた順で次に位置するウェイに移動させる
     請求項3記載のキャッシュ制御装置。
  5.  前記キャッシュ配分制御部は、さらに、
     前記各プロセッサに対応して設けられ、ビット列を含む空きウェイ情報を生成したうえで、前記記憶部に記憶する空きウェイ情報生成部を備え、
     前記ビット列は、前記複数のウェイのそれぞれに対応し、対応するウェイが、当該プロセッサが実行する複数のタスクに割り当てられているか否かを示すビットを含み、
     前記ウェイ指定部は、前記割当部により当該プロセッサのタスクにウェイを割り当てるごとに、前記サーチポインタが指定するウェイを、当該プロセッサのタスクが割り当てられているウェイのうち、前記ビット列の順で次に位置するウェイに移動させる
     請求項4記載のキャッシュ制御装置。
  6.  前記サーチポインタの値は、前記ウェイ指定部により移動された前記ビット列におけるビット数の和であり、
     キャッシュ配分制御部は、1つの前記グループに含まれる全てのウェイが、いずれのタスクにも割り当てられていない場合、前記サーチポインタの値が最も少ないプロセッサが実行するタスクに、当該グループに含まれるウェイを割り当てる
     請求項5記載のキャッシュ制御装置。
  7.  前記キャッシュ配分制御部は、一の前記プロセッサにより実行される複数のタスクのいずれにも、前記ウェイが割り当てられていない場合、当該一のプロセッサの前記サーチポインタの値を最大値に設定する
     請求項6記載のキャッシュ制御装置。
  8.  前記キャッシュ配分制御部は、前記タスクの生成又は削除時に、前記キャッシュ配分処理を行う
     請求項1記載のキャッシュ制御装置。
  9.  複数のプロセッサにより共有されるセットアソシアティブ方式のキャッシュメモリを制御するキャッシュ制御方法であって、
     前記キャッシュメモリは複数のウェイを含み、
     前記複数のウェイは、1以上のウェイを含む複数のグループに分割されており、
     前記キャッシュ制御方法は、
     前記複数のプロセッサにより実行される複数のタスクに前記ウェイを割り当てるキャッシュ配分処理を行うキャッシュ配分制御ステップを含み、
     前記キャッシュ配分制御ステップでは、1つの前記グループに、いずれのタスクにも割り当てられていない未割当ウェイが含まれ、かつ、当該グループに前記複数のプロセッサに含まれる一のプロセッサにより実行されるタスクに割り当てられたウェイが含まれる場合、当該グループに含まれる前記未割当ウェイを、前記一のプロセッサにより実行される複数のタスクのうちいずれかのタスクに割り当てる
     キャッシュ制御方法。
PCT/JP2009/006668 2009-04-08 2009-12-07 キャッシュ制御装置及びキャッシュ制御方法 WO2010116431A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US13/253,456 US8868835B2 (en) 2009-04-08 2011-10-05 Cache control apparatus, and cache control method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2009-094361 2009-04-08
JP2009094361A JP2010244435A (ja) 2009-04-08 2009-04-08 キャッシュ制御装置及びキャッシュ制御方法

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/253,456 Continuation US8868835B2 (en) 2009-04-08 2011-10-05 Cache control apparatus, and cache control method

Publications (1)

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

Family

ID=42935743

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2009/006668 WO2010116431A1 (ja) 2009-04-08 2009-12-07 キャッシュ制御装置及びキャッシュ制御方法

Country Status (3)

Country Link
US (1) US8868835B2 (ja)
JP (1) JP2010244435A (ja)
WO (1) WO2010116431A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015036959A (ja) * 2013-08-16 2015-02-23 富士通株式会社 キャッシュメモリ制御プログラム,キャッシュメモリを内蔵するプロセッサ及びキャッシュメモリ制御方法

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9348766B2 (en) * 2011-12-21 2016-05-24 Intel Corporation Balanced P-LRU tree for a “multiple of 3” number of ways cache
JP6207766B2 (ja) 2014-12-14 2017-10-04 ヴィア アライアンス セミコンダクター カンパニー リミテッド ヘテロジニアス置換ポリシーを用いるセット・アソシエイティブ・キャッシュ・メモリ
US9898411B2 (en) 2014-12-14 2018-02-20 Via Alliance Semiconductor Co., Ltd. Cache memory budgeted by chunks based on memory access type
WO2016097806A1 (en) 2014-12-14 2016-06-23 Via Alliance Semiconductor Co., Ltd. Fully associative cache memory budgeted by memory access type
EP3066571B1 (en) 2014-12-14 2018-06-13 VIA Alliance Semiconductor Co., Ltd. Cache memory budgeted by ways on memory access type
US9652398B2 (en) 2014-12-14 2017-05-16 Via Alliance Semiconductor Co., Ltd. Cache replacement policy that considers memory access type
US9846648B2 (en) * 2015-05-11 2017-12-19 Intel Corporation Create page locality in cache controller cache allocation
US10180908B2 (en) * 2015-05-13 2019-01-15 Qualcomm Incorporated Method and apparatus for virtualized control of a shared system cache
JP6732032B2 (ja) 2016-09-30 2020-07-29 三菱電機株式会社 情報処理装置

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002373115A (ja) * 2001-06-14 2002-12-26 Nec Corp 共有キャッシュメモリのリプレイスメント制御方法及びその装置
JP2004178571A (ja) * 2002-11-11 2004-06-24 Matsushita Electric Ind Co Ltd キャッシュ制御装置、キャッシュ制御方法、コンピュータシステム

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07248967A (ja) 1994-03-11 1995-09-26 Hitachi Ltd メモリ制御方式
JP2002342163A (ja) 2001-05-15 2002-11-29 Fujitsu Ltd マルチスレッドプロセッサ用キャッシュ制御方式
US6516387B1 (en) * 2001-07-30 2003-02-04 Lsi Logic Corporation Set-associative cache having a configurable split and unified mode
US7246202B2 (en) 2002-11-11 2007-07-17 Matsushita Electric Industrial Co., Ltd. Cache controller, cache control method, and computer system
US7325097B1 (en) * 2003-06-26 2008-01-29 Emc Corporation Method and apparatus for distributing a logical volume of storage for shared access by multiple host computers
CN1879092B (zh) * 2003-11-12 2010-05-12 松下电器产业株式会社 高速缓冲存储器及其控制方法
US7237067B2 (en) * 2004-04-22 2007-06-26 Hewlett-Packard Development Company, L.P. Managing a multi-way associative cache
JP2008097572A (ja) * 2006-09-11 2008-04-24 Matsushita Electric Ind Co Ltd 演算装置、コンピュータシステム、および携帯機器
JP2008257578A (ja) * 2007-04-06 2008-10-23 Toshiba Corp 情報処理装置、スケジューラおよび情報処理置のスケジュール制御方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002373115A (ja) * 2001-06-14 2002-12-26 Nec Corp 共有キャッシュメモリのリプレイスメント制御方法及びその装置
JP2004178571A (ja) * 2002-11-11 2004-06-24 Matsushita Electric Ind Co Ltd キャッシュ制御装置、キャッシュ制御方法、コンピュータシステム

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015036959A (ja) * 2013-08-16 2015-02-23 富士通株式会社 キャッシュメモリ制御プログラム,キャッシュメモリを内蔵するプロセッサ及びキャッシュメモリ制御方法

Also Published As

Publication number Publication date
JP2010244435A (ja) 2010-10-28
US20120030430A1 (en) 2012-02-02
US8868835B2 (en) 2014-10-21

Similar Documents

Publication Publication Date Title
WO2010116431A1 (ja) キャッシュ制御装置及びキャッシュ制御方法
US11941430B2 (en) Handling memory requests
US20210157596A1 (en) Executing Memory Requests Out of Order
US10489204B2 (en) Flexible in-order and out-of-order resource allocation
US9645937B2 (en) Expedited servicing of store operations in a data processing system
US11989816B2 (en) Allocation of resources to tasks
US9824014B2 (en) Expedited servicing of store operations in a data processing system
US8510529B2 (en) Method for generating program and method for operating system
US9632943B2 (en) Expedited servicing of store operations in a data processing system
US9910782B2 (en) Expedited servicing of store operations in a data processing system
US8402410B2 (en) Method and apparatus for managing configuration memory of reconfigurable hardware
KR101478648B1 (ko) 재구성 가능 하드웨어의 구성 메모리를 관리하는 방법 및장치
US20230004437A1 (en) Allocation of Resources to Tasks
WO2023004347A1 (en) Run-time configurable architectures
CN114730262A (zh) 用于功能单元分配的方法和装置
JP2011008607A (ja) メモリ割当装置及びメモリ割当方法

Legal Events

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

Ref document number: 09842941

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09842941

Country of ref document: EP

Kind code of ref document: A1