WO2016113869A1 - Arranging apparatus for functions in cache memory - Google Patents
Arranging apparatus for functions in cache memory Download PDFInfo
- Publication number
- WO2016113869A1 WO2016113869A1 PCT/JP2015/050845 JP2015050845W WO2016113869A1 WO 2016113869 A1 WO2016113869 A1 WO 2016113869A1 JP 2015050845 W JP2015050845 W JP 2015050845W WO 2016113869 A1 WO2016113869 A1 WO 2016113869A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- function
- cache memory
- program
- instruction code
- functions
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
Definitions
- the present invention relates to a program placement apparatus, a program placement method, and a program placement program.
- a cache memory In a computer system, a cache memory is used to improve performance. In the computer system, high-speed reading is possible by copying the information in the main memory to the cache memory. However, since the cache memory has a small capacity, information eviction associated with instruction reading, that is, a contention cache miss occurs. The occurrence of a competitive cache miss leads to a decrease in the execution speed of the program, so it is necessary to suppress it as much as possible.
- Patent Literature 1 when executing a program, a dynamic function flow expressing the function calling order as a time series is generated, and based on the generated dynamic function flow, function strength information on a certain function and all other functions. Ask for. Patent Document 1 discloses a technique for reducing contention cache misses by arranging functions in a memory space based on the function strength information.
- Patent Document 2 a function is divided into instruction code blocks having a cache line size, that is, an ICB, simulated, and flow information is extracted in ICB units.
- information that considers the appearance frequency of an ICB that belongs to a function different from itself in the vicinity of each ICB is obtained as the neighbor weight information of another ICB viewed from the own ICB.
- a technique for reducing contention cache misses by determining function placement based on this neighborhood weight information is disclosed.
- the correlation between functions is obtained based on the time-series relationship between functions at the time of program execution or between cache lines, so that highly correlated functions are not assigned to the same cache line. Functions were placed in memory space.
- a conflict cache miss does not occur even between highly correlated functions. For example, when a 4-way configuration is adopted as the cache memory, a conflict cache miss does not occur even if four highly correlated functions are called continuously and repeatedly.
- a conflict cache miss may not occur. Not. For this reason, there is a problem that an optimal arrangement cannot be obtained depending on the configuration of the cache memory and the function call pattern.
- the object of the present invention is to output optimum function arrangement information regardless of the cache memory configuration and function call pattern.
- a program placement apparatus is a program placement apparatus that places a program including a plurality of functions in a cache memory that uses at least one way.
- An acquisition unit that acquires the calling order of each function of the plurality of functions by executing the program;
- a virtual cache memory generation unit that generates a virtual cache memory having storage areas corresponding to the number of ways of the cache memory;
- a simulation is executed to call each function of the plurality of functions as a call instruction code in the calling order with respect to the virtual cache memory, and when the call instruction code that has already been called is called again, other than the call instruction code in the storage area
- a simulator unit that acquires information on the generated conflict as conflict information;
- An arrangement position determining unit that determines an arrangement position of each function of the plurality of functions in the cache memory based on the contention information.
- the acquisition unit acquires the function calling order
- the virtual cache memory generation unit generates a virtual cache memory having storage areas corresponding to the number of ways of the cache memory.
- the simulator unit executes a simulation for calling each function of the plurality of functions as a call instruction code in the calling order with respect to the virtual cache memory, and when a conflict occurs, the information on the generated conflict is acquired as the conflict information.
- the arrangement position determining unit determines the function arrangement position in the cache memory based on the competition information. Therefore, it is possible to obtain an optimal function arrangement position in consideration of the cache memory configuration and the function call order.
- FIG. 2 is a block configuration diagram showing a program arrangement device according to the first embodiment.
- FIG. 3 is a block configuration diagram of a virtual cache simulator unit according to the first embodiment. 6 is a diagram showing an execution sequence of ICB according to Embodiment 1.
- FIG. FIG. 3 is a configuration diagram of conflict information according to the first embodiment.
- FIG. 3 is a hardware configuration diagram of the program arrangement device according to the first embodiment.
- FIG. 3 is a flowchart showing the operation of the program placement method of the program placement apparatus according to the first embodiment.
- FIG. 3 is a flowchart showing an operation of simulation processing according to the first embodiment.
- FIG. 4 is a diagram for explaining virtual cache memory generation processing according to the first embodiment.
- FIG. 4 is a diagram for explaining virtual cache memory generation processing according to the first embodiment.
- FIG. 6 is an example of competition information according to the first embodiment.
- FIG. 3 is a flowchart showing an operation of competition information registration processing according to the first embodiment.
- FIG. 10 is a detailed process flowchart of step S2050 according to the first embodiment.
- FIG. 5 is a detailed process flow diagram of step S2051 according to the first embodiment.
- FIG. 4 is a diagram showing virtual cache memory update processing according to the first embodiment.
- FIG. 4 is a diagram showing virtual cache memory update processing according to the first embodiment.
- FIG. 3 is a flowchart showing an operation of arrangement position determination processing according to the first embodiment.
- FIG. 3 is a configuration diagram of a rule 131 according to the first embodiment. The flowchart which shows the operation
- FIG. 5 is a block configuration diagram showing a program arrangement apparatus according to a second embodiment.
- FIG. 9 is a flowchart showing an operation of a program placement method of the program placement apparatus according to the second embodiment.
- FIG. 10 is a flowchart showing an operation of function arrangement adjustment processing according to the second embodiment.
- FIG. 5 is a block configuration diagram showing a program arrangement apparatus according to a second embodiment.
- FIG. 9 is a flowchart showing an operation of a program placement method of the program placement apparatus according to the second embodiment.
- FIG. 10 is a flowchart showing an operation of function arrangement adjustment processing according to the second embodiment.
- FIG. *** Explanation of configuration *** FIG. 1 is a block configuration diagram showing a program placement apparatus 500 according to the first embodiment.
- the program placement apparatus 500 includes a program 10, an acquisition unit 21, a calling order 31, cache configuration information 40, program information 50, a virtual cache simulator unit 60, competition information 70, a placement position determination unit 80, function placement information 90, and a function placement unit. 100, an optimized program 110, and a priority table 130.
- the program placement apparatus 500 places a program including a plurality of functions in a cache memory that uses at least one way.
- the program placement apparatus 500 is a program optimization apparatus that optimizes the placement position of the program 10 in a cache memory provided in the computer.
- Program 10 is an optimization target program that is a target for reducing contention cache misses.
- the program 10 includes a source code, an object file, and one or more files among execution files.
- the acquiring unit 21 acquires the instruction code calling order 31 included in each function of the plurality of functions by executing the program 10.
- the acquisition unit 21 is a program execution unit 20 that executes the program 10 and acquires the instruction trace 30 that is the function call order 31.
- the program execution unit 20 may be either a real machine including the target processor or a simulator that simulates the target processor as long as it has a mechanism that can acquire the instruction trace 30.
- the instruction trace 30 is data in which instruction addresses of execution instructions when the program 10 is executed are arranged in time series.
- the cache configuration information 40 is information on the cache memory 401 mounted on the target processor that finally operates the program 10, and includes information on the cache line size, the number of ways, the number of sets, and the type of replacement algorithm.
- the program information 50 holds information on a set of function labels, arrangement addresses, and function sizes for all functions included in the program 10.
- the virtual cache simulator unit 60 receives the instruction trace 30, the cache configuration information 40, and the program information 50 and outputs contention information 70. Based on the instruction trace 30, the virtual cache simulator unit 60 generates conflict information for each ICB included in each function, which cannot be acquired by the cache memory 401 that is a real cache memory, and outputs it as the conflict information 70.
- the contention information 70 is a contention miss database that stores contention information in units of ICBs of the cache line size included in each function.
- the arrangement position determination unit 80 determines the arrangement position of each function of the plurality of functions in the cache memory 401 based on the competition information 70.
- the arrangement position determination unit 80 receives the cache configuration information 40, the program information 50, and the competition information 70 as inputs, and outputs function arrangement information 90.
- the arrangement position determination unit 80 arranges each function in the memory space in order based on the determined priority order. When placing a certain function, the placement position determination unit 80 refers to the conflict information 70 and obtains the number of occurrences of a conflict cache miss with an already placed function.
- the arrangement position determination unit 80 determines the function arrangement position so that the number of occurrences of the contention cache miss is minimized.
- the function placement information 90 is a list of function placements that is calculated by the placement location determination unit 80 and minimizes the number of contention cache miss occurrences, and is composed of a set of labels and placement addresses of all functions.
- the function placement unit 100 receives the program 10 and the function placement information 90 as input, executes the function rearrangement, and outputs the optimized program 110.
- the optimized program 110 has the same operation as that of the program 10, but has a different function arrangement in the program and minimizes contention cache misses.
- the priority table 130 sets a rule 131 for determining the priority of each function of a plurality of functions.
- the arrangement position determination unit 80 determines the priority of each function of a plurality of functions arranged in the cache memory 401 based on the priority table 130.
- the arrangement position determination unit 80 determines the arrangement position of each function of the plurality of functions in the order of the determined priority.
- Each functional block may be implemented as one or a plurality of programs, or a plurality of functional blocks may be implemented as one program.
- the instruction trace 30, the cache configuration information 40, the program information 50, the conflict information 70, and the function arrangement information 90 may exist as files, or may be data arranged only on the memory.
- FIG. 2 is a block configuration diagram of the virtual cache simulator unit 60 according to the present embodiment.
- the virtual cache simulator unit 60 includes a virtual cache memory generation unit 601 and a simulator unit 605.
- the simulator unit 605 includes a virtual cache data holding unit 602, an instruction trace reading unit 603, and a conflict information generating unit 604.
- the virtual cache memory generation unit 601 generates virtual cache memories 403 having as many storage areas 4031 as the number of ways in the cache memory 401. Specifically, the virtual cache memory generation unit 601 generates a plurality of areas 4039 having consecutive addresses as the virtual cache memory 403.
- the plurality of areas 4039 includes a storage area 4031 corresponding to the number of ways and a plurality of temporary storage areas 4032 continuous behind the storage areas 4031 corresponding to the number of ways.
- the storage area 4031 may be referred to as a real way and the temporary storage area 4032 may be referred to as a virtual way.
- the virtual cache memory generation unit 601 builds the virtual cache memory 403 that is the data structure of the virtual cache data holding unit 602 based on the cache configuration information 40.
- the simulator unit 605 executes a simulation for calling the instruction code 301 included in each function of the plurality of functions in the calling order 31 as the calling instruction code 4033 with respect to the virtual cache memory 403.
- the simulator unit 605 calls the call instruction code 4033 that has already been called again, and there is a conflict in which the instruction code 301 other than the call instruction code 4033 is stored in the storage area 4031, the simulator unit 605 displays the information of the generated conflict as the conflict information. Obtained as 70.
- An instruction code set 701 is acquired.
- the simulator unit 605 acquires a set of all instruction codes and call instruction codes stored in an area before the call instruction code 4033 already stored in the virtual cache memory 403 as a conflict instruction code set 701.
- the simulator unit 605 acquires all the instruction codes stored in the area before the calling instruction code already stored in the virtual cache memory 403 after acquiring the competing instruction code set 701, respectively Move to.
- the simulator unit 605 stores the call instruction code 4033 already stored in the virtual cache memory 403 in the first storage area 4031 of the virtual cache memory 403, and the instruction code 301 next to the call instruction code 4033 in the call order 31. Is called as the call instruction code 4033.
- the instruction code 301 obtained by dividing a function into cache line sizes, that is, an execution sequence 303 of an ICB for each function is set. Therefore, the instruction code 301 called as the calling instruction code 4033 by the simulator unit 605 is an ICB for each function obtained by dividing the function into the cache line size of the cache memory 401.
- the instruction code 301 will be described as an instruction code block, that is, an ICB.
- the conflicting instruction code set 701 is a conflicting ICB 702 that is a combination of ICBs related to the conflict.
- the virtual cache data holding unit 602 reads the instruction trace 30 based on the data structure of the virtual cache memory 403 constructed by the virtual cache memory generation unit 601 and simulates the operation of the cache.
- the instruction trace reading unit 603 sequentially extracts the instruction code 301, that is, the ICB, based on the instruction trace 30 and passes the instruction code 301 to the virtual cache data holding unit 602.
- the conflict information generation unit 604 registers information regarding the combination of ICBs causing the cache miss in the conflict information 70.
- the simulator unit 605 acquires a combination of instruction codes 301 that caused a conflict among instruction codes included in each function of a plurality of functions as a conflict instruction code set 701.
- the simulator unit 605 counts the number of conflicts generated by the conflicting instruction code set 701 as the number of conflicts, and acquires the counted number of conflicts as the conflict information 70.
- the instruction trace 30 will be described with reference to FIG.
- the configuration of the competition information 70 will be described with reference to FIG. It is assumed that the ICB execution sequence 303 of FIG. 3 is obtained from the instruction trace 30.
- the competition information generation unit 604 generates the competition information 70 shown in FIG. 4 based on the ICB execution sequence 303 shown in FIG.
- the contention information 70 is composed of contention miss data records 71 for all ICBs.
- the contention miss data record 71 has an ICB name 72, a total number of misses 73 as its own ICB, a total number of misses 74 as another ICB, and one or more contention miss entries 75.
- the conflict miss entry 75 includes a miss ID 76, a conflict ICB number 77, and a miss number 78 for each conflict ICB.
- the self ICB represents the ICB being focused on, and A0 is the self ICB in the contention miss data record 71 of A0 in FIG.
- the other ICB represents a set of other ICBs with which the focused ICB is competing.
- B0 and C0 are other ICBs.
- the competing ICB represents a set of all ICBs competing when a certain cache miss occurs.
- the ICB name 72 is a name for identifying each ICB.
- the total number of misses 73 as the own ICB represents the number of contention cache misses that occurred when referring to itself.
- the total miss count 74 as another ICB represents the number of contention cache misses that occurred when referring to another ICB that competes with itself.
- the contention miss entry 75 is data indicating a cache miss occurrence state in a certain ICB combination, and there is one or more contention miss data records 71 for each contention miss data record 71.
- the miss ID 76 is an ID for uniquely identifying a conflicting cache miss in each ICB.
- the contention ICB number 77 represents the number of ICBs related when a contention cache miss occurs.
- the number of competing ICBs 77 includes its own ICB. In the same ICB, although the number of competing ICBs is the same, it is recorded as another cache miss because the number of occurrences of competing cache misses is held for each combination of competing ICBs.
- the number of misses 78 for each competing ICB represents the number of occurrences of a competing cache miss for each ICB related to the occurrence of a competing cache miss.
- the meaning of the value of the number of misses 78 for each competing ICB will be described using the contention miss data record 71 of A0 in FIG. 4 as an example.
- the conflict miss entry 75 included in A0 focusing on the row where the miss ID 76 is 3, the conflict ICB number 77 is 2, the miss number 78 for each conflict ICB is 1 for A0, hatched for B0, and 0 for C0. Has been.
- the miss ID 3 the number of cache misses in which two ICBs A0 and C0 are used as competing ICBs is set.
- An ICB in which a number is input indicates that it is related to a cache miss, and a hatched ICB indicates that it is not related. Therefore, in the row where the miss ID is 3, numbers are set in A0 and C0. The numbers indicate the number of occurrences of cache misses caused by the combination of competing ICBs.
- a row with a miss ID of 3 indicates that in the combination of A0 and C0, a cache miss occurs once when A0 is referenced, and no cache miss occurs when C0 is referenced.
- the program placement apparatus 500 is a computer.
- the program placement apparatus 500 includes hardware such as a processor 901, an auxiliary storage device 902, a memory 903, a communication device 904, an input interface 905, and a display interface 906.
- the processor 901 is connected to other hardware via the signal line 910, and controls these other hardware.
- the input interface 905 is connected to the input device 907.
- the display interface 906 is connected to the display 908.
- the processor 901 is an IC (Integrated Circuit) that performs processing.
- the processor 901 is, for example, a CPU (Central Processing Unit), a DSP (Digital Signal Processor), or a GPU (Graphics Processing Unit).
- the auxiliary storage device 902 is, for example, a ROM (Read Only Memory), a flash memory, or an HDD (Hard Disk Drive).
- the memory 903 is, for example, a RAM (Random Access Memory).
- the communication device 904 includes a receiver 9401 that receives data and a transmitter 9402 that transmits data.
- the communication device 904 is, for example, a communication chip or a NIC (Network Interface Card).
- the input interface 905 is a port to which the cable 911 of the input device 907 is connected.
- the input interface 905 is, for example, a USB (Universal Serial Bus) terminal.
- the display interface 906 is a port to which the cable 912 of the display 908 is connected.
- the display interface 906 is, for example, a USB terminal or an HDMI (registered trademark) (High Definition Multimedia Interface) terminal.
- the input device 907 is, for example, a mouse, a keyboard, or a touch panel.
- the display 908 is, for example, an LCD (Liquid Crystal Display).
- the auxiliary storage device 902 includes an acquisition unit 21, a virtual cache simulator unit 60, an arrangement position determination unit 80, and a function arrangement unit 100 (hereinafter, acquisition unit 21, virtual cache simulator unit 60, arrangement position determination unit 80, A program for realizing the function of the function arrangement unit 100 is collectively stored as “part”.
- acquisition unit 21, virtual cache simulator unit 60, arrangement position determination unit 80, A program for realizing the function of the function arrangement unit 100 is collectively stored as “part”.
- a program that realizes the function of the “unit” included in the above-described program placement apparatus 500 is referred to as a program placement program.
- the program arrangement program may be a single program or may be composed of a plurality of programs. This program arrangement program is loaded into the memory 903, read into the processor 901, and executed by the processor 901. Further, the auxiliary storage device 902 also stores an OS (Operating System).
- OS Operating System
- the program placement apparatus 500 may include a plurality of processors 901. A plurality of processors 901 may execute a program for realizing the function of “unit” in cooperation with each other.
- information, data, signal values, and variable values indicating the results of the processing of “unit” are stored as files in the memory 903, the auxiliary storage device 902, or a register or cache memory in the processor 901.
- circuitry may be provided as “circuitry”. Further, “part” may be read as “circuit”, “process”, “procedure”, or “processing”. “Circuit” and “Circuitry” include not only the processor 901 but also other types of processing circuits such as a logic IC or GA (Gate Array) or ASIC (Application Specific Integrated Circuit) or FPGA (Field-Programmable Gate Array). It is a concept to include.
- GA Gate Array
- ASIC Application Specific Integrated Circuit
- FPGA Field-Programmable Gate Array
- a program product is a storage medium, storage device, or the like on which a program placement program that realizes the function described as “part” is recorded, and can be read by a computer regardless of the appearance format. The program is being loaded.
- the program arrangement program is a program that is executed by the program arrangement apparatus 500 that is a computer that arranges the program 10 including a plurality of functions in the cache memory 401 using at least one way.
- the acquisition unit 21 executes the acquisition process S1 for acquiring the calling order 31 of the instruction code 301 included in each function of the plurality of functions by executing the program 10. That is, the program execution unit 20 executes the program 10 and extracts the instruction trace 30.
- the virtual cache memory generation unit 601 executes a virtual cache memory generation process S1a for generating virtual cache memories 403 having as many storage areas 4031 as the number of ways in the cache memory 401.
- the simulator unit 605 executes the simulation process S2 that calls the instruction code 301 to the virtual cache memory 403 as the call instruction code 4033 in the calling order 31.
- the simulator unit 605 conflicts the conflict information when there is a conflict in which an instruction code other than the call instruction code is stored in the storage area 4031 when the call instruction code 4033 that has already been called is called again. Obtained as information 70. That is, in the simulation process S ⁇ b> 2, the virtual cache simulator unit 60 generates the competition information 70 based on the instruction trace 30, the cache configuration information 40, and the program information 50.
- the arrangement position determination unit 80 executes an arrangement position determination process S3 for determining an arrangement position 801 of each function of the plurality of functions in the cache memory 401 based on the competition information 70. That is, in the arrangement position determination process S3, the arrangement position determination unit 80 receives the cache configuration information 40, the program information 50, and the competition information 70 as input, and generates function arrangement information 90 related to the function arrangement position 801.
- the function placement unit 100 receives the program 10 and the function placement information 90 as input, executes the function placement process S4 that places the function in the cache memory 401, and outputs the optimized program 110 To do.
- FIG. 7 is a flowchart showing the operation of the virtual cache simulation process S200 according to the present embodiment.
- the virtual cache simulation process includes a virtual cache memory generation process S1a and a simulation process S2.
- the virtual cache simulator unit 60 executes a virtual cache simulation process S200 for generating contention information 70 based on the information of the instruction trace 30, the cache configuration information 40, and the program information 50.
- step S200 the virtual cache memory generation unit 601 executes a virtual cache memory generation process S1a for generating the virtual cache memory 403 based on the cache configuration information 40. Details of the virtual cache memory generation processing S1a will be described later.
- the virtual cache data holding unit 602 holds data in the virtual cache memory 403 configured by the virtual cache memory generation unit 601.
- step S201 the instruction trace reading unit 603 determines whether the instruction trace 30 has been read to the end. If not read, the process proceeds to step S202. If read, the process ends.
- step S202 the instruction trace reading unit 603 extracts one instruction address from the instruction trace 30, and the process proceeds to step S203.
- the instruction trace reading unit 603 executes an ICB acquisition process S203 for obtaining an ICB including the extracted instruction address. After executing the ICB acquisition process S203, the instruction trace reading unit 603 proceeds to step S204.
- step S204 the conflict information generation unit 604 determines whether the ICB causes a cache miss. If a cache miss occurs, the contention information generation unit 604 proceeds to step S205, and if not, the contention information generation unit 604 proceeds to step S206.
- step S205 the conflict information generation unit 604 registers the combination information of the ICB when a cache miss occurs as the conflict ICB 702 in the conflict information 70, and proceeds to step S206. Details of step S205 will be described later.
- step S206 the contents of the cache are updated according to the read block, and the process returns to step S201.
- the virtual cache simulator unit 60 continues the above processing until step S201 becomes true, that is, until YES in step S201.
- the virtual cache memory generation process S1a will be described with reference to FIGS.
- the virtual cache memory generation unit 601 changes the configuration of the virtual cache memory 403 based on the cache configuration information 40.
- the virtual cache memory generation unit 601 generates a plurality of areas 4039 having consecutive addresses.
- the plurality of areas 4039 are configured by storage areas 4031 that are actual ways corresponding to the number of ways, and temporary storage areas 4032 that are a plurality of virtual ways that follow the storage area 4031.
- FIG. 8 shows a method of generating the virtual cache memory 403 when the cache memory 401 is of the direct map method, the number of ways is 1, the number of sets is 2, 64B cache lines, and the LRU (Least Recently Used) method.
- FIG. 9 shows a method for generating the virtual cache memory 403 when the cache memory 401 is a 2-way set associative method, the number of ways is 2, the number of sets is 4, a 64B cache line, and an LRU method.
- the virtual cache memory 403 is configured as an N-way set associative cache with one set regardless of the number of ways and the number of sets of the cache memory 401.
- N is a parameter that can be arbitrarily set by the user, and as the value is set larger, the correlation between a large number of ICBs can be observed.
- the virtual cache memory 403 is configured as an N-way, but the timing for determining a cache miss when executing a simulation differs depending on the configuration of the cache memory 401. That is, in the virtual cache memory generation process S1a, the number of ways in the cache memory 401 is handled as the storage area 4031, that is, the actual way, and the remaining ways are handled as the temporary storage area 4032, that is, the virtual way.
- the real way is 1 and the virtual way is N-1.
- the real way is 2 and the virtual way is N-2.
- the contention information generation unit 604 treats that a cache miss has occurred.
- the virtual cache memory 403 by configuring the virtual cache memory 403, the correlation between ICBs at the timing of occurrence of a cache miss that cannot be observed in the cache memory 401 is detected.
- the cache line size and replacement algorithm of the virtual cache memory 403 are the same as those of the cache memory 401.
- 10 and 11 show an arrangement state on the cache memory with the number of sets 8 when the function A and the function B are arranged in a continuous memory area.
- Function A is arranged from set 0 to set 3
- function B is arranged from set 3 to set 7.
- ICB serial number of the function is added to the function label.
- the ICB serial numbers 0, 1, 2, and 3 are added to the function labels A and B, respectively.
- the function is divided into ICB from the beginning.
- the function A is divided as A0 to A3
- the function B is divided as B0 to B3.
- the method shown in FIG. 10 does not consider the actual cache arrangement and performs division based on the top of the function.
- the division into ICBs is performed in units of cache lines in consideration of the actual memory arrangement.
- the instruction codes of function A from set 0 to set 2 are divided into A0, A1, and A2, respectively.
- the instruction code belonging to the own function is divided as an ICB. That is, it is assumed that the first half of the contents of A3 is the instruction code of the function A, and the remaining half contains nothing.
- the set 3 of the function B starts not from the beginning of the cache line but from the middle. Even in such a case, the division from the top of the cache line of set 3 to the ICB is executed instead of from the top of the function B.
- the competition information registration process S205 for registering the ICB combination information in the competition information 70 will be described with reference to FIGS.
- FIGS. a case is considered in which an execution sequence 303 of ICB as shown in FIG. FIG. 12 shows the contents of the virtual cache memory 403 with the number of actual ways 1 at the timing when C0 which is the first call instruction code 4033 is referred to.
- C0 since there is no C0 in the real way, a cache miss occurs. Since C0 does not exist in the virtual way, it is understood that the first reference to C0 is an initial reference miss. In the case of an initial reference mistake, information is not recorded in the conflict information 70.
- FIG. 13 shows the contents of the virtual cache memory with the number of actual ways 1 at the timing when B0 which is the second call instruction code 4033 is referred to.
- B0 since there is no B0 in the real way, a cache miss occurs.
- B0 since B0 exists in the virtual way, the second reference to B0 is treated as a conflict cache miss, that is, a conflict has occurred.
- All ICBs on the left side of B0 which is the call instruction code 4033 existing in the virtual way and B0 which is the call instruction code 4033 are registered in the conflict information 70 as the conflict ICB 702. That is, the simulator unit 605 registers all ICBs and B0 in the area before B0 which is the call instruction code 4033 existing in the virtual way as the conflicting ICB 702 in the conflict information 70.
- the contention information generation unit 604 first records the contention miss data record 71 corresponding to B0 as a contention cache miss of its own ICB by a combination of B0 and C0. The contention information generation unit 604 then records the contention miss data record 71 of C0, which is the contention ICB, as a contention cache miss of another ICB by a combination of B0 and C0. If there are other competing ICBs, the same processing as in C0 is executed.
- the contention information 70 after the second B0 reference is as shown in FIG. As described above, when recording the contention information 70, not only the contention cache miss that occurs when referring to the own ICB but also the number of contention cache misses that occur due to the influence of other ICBs are recorded.
- step S2050 the competition information generation unit 604 registers the own ICB in the competition information 70.
- step S ⁇ b> 2051 the conflict information generation unit 604 registers ICBs other than the own ICB in the conflict information 70 among the competing ICBs.
- step S205000 the competition information generation unit 604 determines whether the own ICB exists in the competition information 70.
- the competition information generation unit 604 transitions to step S205001 if it exists, and transitions to step S205002 if it does not exist.
- step S205001 the contention information generation unit 604 extracts the contention miss data record 71 of the own ICB, and transitions to step S205005.
- step S205002 the conflict information generation unit 604 generates a conflict miss data record 71 of its own ICB, and the process proceeds to step S205003.
- step S205003 the self ICB name is set in the ICB name 72, and the process proceeds to step S205004.
- step S205004 the total number of mistakes 73 as the own ICB is initialized to 1, and the total number of mistakes 74 as another ICB is initialized to 0, and the process proceeds to step S205007.
- step S205005 the conflict information generation unit 604 confirms whether the record of the combination of conflict ICBs to be registered, that is, the conflict miss entry 75 already exists.
- the competition information generation unit 604 transitions to step S205006 if it exists, and transitions to step S205007 if it does not exist.
- step S205006 the contention information generation unit 604 increments the value of the total number of mistakes 73 as its own ICB by 1, and proceeds to step S205011.
- step S205007 the conflict information generation unit 604 generates the conflict miss entry 75, adds the generated conflict miss entry 75 to the conflict miss data record 71, and transitions to step S205008.
- step S205008 the conflict information generation unit 604 allocates a new miss ID 76 for the cache miss to be processed, and the process proceeds to step S20509.
- step S20509 the conflict information generation unit 604 sets the conflicting ICB number of the cache miss to be processed to the conflicting ICB number 77, and the processing transitions to step S205010.
- step S205010 the contention information generation unit 604 initializes the value of the contention ICB to 0 in the number of misses 78 for each contention ICB, and transitions to step S205011.
- step S205011 the conflict information generation unit 604 increments the value of its own ICB by 1 in the number of misses 78 for each competing ICB, and ends the processing.
- step S205100 the conflict information generation unit 604 determines whether there is an unprocessed conflict ICB.
- the competition information generation unit 604 transitions to step S205101 if it exists, and ends if it does not exist.
- step S205101 the competition information generation unit 604 selects one of the unprocessed competition ICBs, and transitions to step S205102.
- step S ⁇ b> 205102 the conflict information generation unit 604 determines whether a conflict ICB to be processed exists in the conflict information 70.
- the competition information generation unit 604 transitions to step S205103 if it exists, and transitions to step S205104 if it does not exist.
- step S205103 the conflict information generation unit 604 takes out the conflict miss data record 71 of the conflict ICB to be processed, and proceeds to step S205107.
- step S205104 the conflict information generation unit 604 generates a conflict miss data record 71 of the target conflict ICB, and the process proceeds to step S205105.
- step S205105 the conflict information generation unit 604 sets the target ICB name to be processed in the ICB name 72, and the process proceeds to step S205106.
- step S205106 the contention information generation unit 604 initializes the total number of mistakes 73 as its own ICB to 0 and the total number of mistakes 74 as another ICB to 1, and proceeds to step S205109.
- step S205107 the conflict information generation unit 604 checks whether a record of the combination of conflict ICBs to be registered, that is, the conflict miss entry 75 already exists. When it exists, it changes to step S205108, and when it does not exist, it changes to step S205109. In step S205108, the conflict information generation unit 604 increments the value of the total number of mistakes 74 as the other ICB by 1, and the process proceeds to step S205112.
- step S205109 after generating the conflict miss entry 75, the conflict information generation unit 604 adds the generated conflict miss entry 75 to the conflict miss data record 71, and proceeds to step S205110.
- step S205110 the conflict information generation unit 604 allocates a new miss ID 76 for the cache miss to be processed, and the process proceeds to step S205111.
- step S205111 the conflict information generation unit 604 sets the conflicting ICB number of the cache miss to be processed as the conflicting ICB number 77, and the processing transitions to step S205112.
- step S205112 the contention information generation unit 604 initializes the value of the contention ICB to 0 in the number of misses 78 for each contention ICB, and proceeds to step S205113.
- step S205113 the conflict information generation unit 604 increments the value of its own ICB by 1 in the number of misses 78 for each competing ICB, and returns to step S205100.
- the conflict information generation unit 604 continues the above processing until step S205100 is false, that is, NO in step S205100.
- step S ⁇ b> 206 the virtual cache simulator unit 60 performs ICB replacement in the virtual cache memory 403 based on the replacement algorithm set in the cache configuration information 40.
- the ICB to be replaced is arranged on the rightmost side.
- an ICB existing in a way with a smaller number indicates that access has been made more recently.
- FIG. 18 and 19 show how the contents of the cache are replaced by the LRU method.
- the virtual cache simulator unit 60 shifts all ICBs existing in the virtual cache memory 403 to the right by one way, Save C0 in real way 0.
- the virtual cache simulator unit 60 shifts all ICBs existing on the virtual cache memory 403 backward by one area, and stores C0 in the top real way of the virtual cache memory 403.
- the virtual cache simulator 60 since B0 exists on the virtual cache memory 403 when referring to B0, the virtual cache simulator 60 moves B0 existing on the virtual way 1 to the real way 0, and all the left side of B0 ICB is shifted one way to the right. In FIG. 19, since the ICB on the left side of B0 is only C0, the virtual cache simulator unit 60 shifts C0 to the right by one way. In other words, after acquiring the competing ICB 702, the virtual cache simulator unit 60 moves all ICBs stored in the area before B0, which is the call instruction code 4033, to the next area. Then, the virtual cache simulator unit 60 stores B0 in the top real way of the virtual cache memory 403.
- FIG. 20 is a flowchart showing the operation of the arrangement position determination process S3 according to the present embodiment.
- the arrangement position determination unit 80 outputs function arrangement information 90 based on the competition information 70.
- the arrangement position determination unit 80 determines the priority order for arranging the functions.
- the arrangement position determination unit 80 determines the order in which the functions are arranged based on the rule 131.
- the rule 131 will be described with reference to FIG. FIG. 21 is an example of the rule 131, and the rule 131 may be other than FIG. 21.
- rules 1 to 4 are set.
- the arrangement position determination unit 80 applies the rule from a smaller number, and applies the following rule when the same value is obtained by a plurality of functions.
- the arrangement position determination unit 80 gives priority to each function of a plurality of functions according to rule 1 in descending order of the sum of the total number of mistakes 74 as other ICBs belonging to each ICB. Whether or not to cause a contention error is determined by the relationship with the already-arranged function, and therefore the arrangement position determination unit 80 arranges from a function that is highly likely to affect other ICBs.
- the arrangement position determination unit 80 applies rule 2 between functions having the same value in rule 1 and assigns priorities according to the number of types of competitive ICBs of each ICB belonging to the function. Rule 2 is applied in order to preferentially arrange a function that affects more ICBs even if the number of contention errors occurring in the other ICBs is the same.
- the placement position determination unit 80 applies rule 3 and determines the total number of mistakes 73 as the own ICB of each ICB belonging to the function. Finally, the arrangement position determining unit 80 gives priority to the size of the function of the rule 4. If the priority order is not determined by rule 4, the arrangement position determination unit 80 selects a function to be arbitrarily arranged.
- step S301 the arrangement position determination unit 80 determines whether or not all functions have been arranged, and if not arranged, the process proceeds to step S302, and if arranged, the process proceeds to step S305.
- step S ⁇ b> 302 the arrangement position determining unit 80 extracts one function having a higher priority from unallocated functions.
- step S303 the fetched processing target function is moved from set 0 to the last set, and in all placement methods, the number of contention cache miss occurrences caused by the already placed function is calculated, and the place where the minimum number of misses is obtained is obtained. Details of step S303 will be described later.
- step S304 the arrangement position determining unit 80 determines an arrangement at a location indicating the minimum number of contention cache miss occurrences, and transitions to step S301. The above processing is continued until step S301 becomes true, that is, until YES is determined in step S301.
- step S305 the arrangement position determination unit 80 summarizes the above arrangement results and outputs function arrangement information 90.
- Step S303 Computation processing for the number of contention errors with the already placed function> With reference to FIG. 22, the calculation processing of the number of mistakes with the already arranged function in step S303 will be described.
- step S30300 the arrangement position determining unit 80 sets an arrangement target function that is a function to be arranged in a place where it has not yet been arranged, and the process proceeds to step S30301.
- step S30301 the arrangement position determining unit 80 initializes a temporary variable for storing the number of misses to 0, and proceeds to step S30302.
- step S30302 the arrangement position determination unit 80 extracts ICBs for which the number of cache misses has not yet been calculated from the ICBs included in the arrangement target function, and proceeds to step S30303.
- step S30303 it is checked whether the extracted ICB to be processed exists in the competition information 70. If it exists, the process proceeds to step S30304, and if not, the process proceeds to step S30310.
- step S30304 the arrangement position determination unit 80 extracts the contention error data record 71 of the extracted processing target ICB, and proceeds to step S30305.
- step S30305 the arrangement position determining unit 80 extracts one unexamined conflict miss entry 75, and proceeds to step S30306.
- step S30306 the arrangement position determining unit 80 checks the number of competing ICBs already arranged among the competing ICBs included in the conflict miss entry 75, and proceeds to step S30307.
- step S30307 the arrangement position determination unit 80 transitions to step S30308 when the number of already arranged competitive ICBs + 1 is larger than the number of ways described in the cache configuration information 40, that is, when a cache miss occurs.
- the arrangement position determination unit 80 transitions to step S30309 when the number of already arranged competing ICBs + 1 is equal to or less than the number of ways described in the cache configuration information 40, that is, no cache miss occurs.
- step S30308 the arrangement position determining unit 80 totals the number of misses 78 for each competing ICB included in the contention miss entry 75, adds it to the temporary variable for the number of misses, and proceeds to step S30309.
- step S30309 the arrangement position determination unit 80 determines whether all the contention miss entries 75 included in the processing target ICB have been checked. The arrangement position determination unit 80 transitions to step S30310 when all are checked, and returns to step S30305 when there is a contention miss entry 75 that is not checked.
- step S30310 the placement position determination unit 80 determines whether all ICBs included in the placement target function have been examined.
- the arrangement position determination unit 80 transitions to step S30311 when it is examined, and returns to step S30302 otherwise.
- step S30311 the arrangement position determining unit 80 transitions to step S30312 if the value of the temporary variable for the number of misses is smaller than the current minimum miss number, and transitions to step S30313 otherwise.
- the arrangement position determination unit 80 updates the minimum number of misses and the minimum arrangement, and the process proceeds to step S30313.
- step S30313 the arrangement position determination unit 80 determines whether all arrangements have been tried in the arrangement target function. If the arrangement has been tried, the arrangement ends. If not, the arrangement position determination unit 80 returns to step S30300.
- step S30313 becomes true, that is, until YES is determined in step S30313. If “YES” in the step S30313, it means that all arrangements have been tried in the arrangement target function.
- the arrangement position determination process S3 will be described in detail using a specific example.
- the execution sequence 303 of the ICB as shown in FIG. 3 is obtained from the instruction trace 30, the arrangement in the direct map cache with the number of sets 2 is considered.
- the competition information 70 is generated from the execution sequence of FIG. 3, the result is as shown in FIG.
- step S300 the priority order of the functions is calculated from the rule 131 and the competition information 70, and it is determined that the functions C, B, and A are arranged in this order.
- step S302 the function C is first extracted. Since function C is the first function, it is placed in set 0. Subsequently, in step S302, the function B is extracted. In step S303, the function B is arranged from the set 0 to the last set, and the place where the smallest number of misses among the number of contention misses occurring with the existing arrangement function is obtained.
- FIG. 23 shows the calculation result of the number of cache miss occurrences when the function B is arranged in the set 0. A cache miss occurring with C0 when function B is placed in set 0 is calculated. As a result of the calculation, CM (B0, C0) is obtained as 4.
- CM (X, Y) represents the number of cache misses when ICBs specified in parentheses are arranged in the same set. Therefore, CM (B0, C0) is the number of cache misses when B0 and C0 are arranged in the same set.
- FIG. 24 shows the calculation result of the number of cache miss occurrences when the function B is arranged in the set 1.
- CM (B0) 0 is obtained.
- the function B is arranged in the set 1 in step S304.
- step S303 the function A is arranged from the set 0 to the last set, and the place where the smallest number of misses among the number of contention misses occurring with the existing arrangement function is obtained.
- FIG. 25 shows the calculation result of the number of cache miss occurrences when the function A is arranged in the set 0.
- the cache miss that occurs with C0 when function A is placed in set 0 is calculated.
- CM (A0, C0) is the number of cache misses when A0 and C0 are arranged in the same set.
- step S304 shows the calculation result of the number of cache miss occurrences when the function A is arranged in the set 1.
- the function A is arranged in the set 1 in step S304.
- step S301 Since the arrangement of all the functions is completed after the arrangement of the function A, step S301 becomes true, and the process proceeds to step S305.
- step S305 function allocation information 90 is output assuming that function C is allocated to the address stored in set 0, and function B and function A are allocated to the addresses stored in set 1, respectively.
- Program placement apparatus 500 includes a virtual cache simulator unit that receives instruction traces and extracts contention information between functions.
- a conflict miss database that holds the conflict information of each ICB is provided, and a layout position determination unit that calculates a function layout that suppresses the conflict miss is provided based on the conflict miss database.
- the program placement apparatus 500 divides a function into ICBs having a cache line size, extracts ICB combination information when a contention miss occurs, and places the function based on the information. Therefore, according to the program placement apparatus 500, it is possible to determine the placement that suppresses the contention error.
- the program placement apparatus 500 sets the number of sets to 1 regardless of the configuration of the real cache memory, and assumes that all ICBs use the same cache area and perform simulation. Execute. Therefore, according to the program placement apparatus 500, it is possible to extract combination information of ICBs having correlation when a conflict error occurs.
- the program placement apparatus 500 records the number of times of occurrence of contention misses for each combination of correlated ICBs when contention misses occur in the contention miss database. Therefore, according to the program placement apparatus 500, it is possible to calculate the accurate number of contention errors in the optimum placement search process, that is, the placement position determination process.
- the optimal placement search unit that is, the placement position determination unit, calculates the number of times that a conflict miss of a function other than itself is caused by each function based on the conflict miss database. To calculate. Then, the arrangement position determination unit arranges in the memory area in order from the calculated function having the highest number of contention misses. Therefore, according to the program placement apparatus 500, an accurate optimum placement can be searched.
- the virtual cache simulator unit stores the correlation of each function block in the instruction trace as the competition information. Since the arrangement position determination unit determines the function arrangement that minimizes the number of competing cache misses based on the competition information, more accurate function arrangement information can be output.
- Embodiment 2 FIG. In the present embodiment, differences from the first embodiment will be mainly described.
- the same components as those described in Embodiment 1 are denoted by the same reference numerals, and the description thereof may be omitted.
- the arrangement position determination unit 80 arranges functions in a memory space from a function having a high priority, and outputs function arrangement information 90.
- the memory usage efficiency may deteriorate.
- FIG. 28 is a block configuration diagram showing a program placement apparatus 500a according to the second embodiment.
- the program placement apparatus 500a according to the present embodiment includes a function placement adjustment unit 120 in addition to the configuration shown in FIG.
- the function placement adjustment unit 120 rearranges each function of the plurality of functions into a rearrangement position 802 different from the placement position 801 based on the placement position 801 of each function of the plurality of functions determined by the placement position determination unit 80. .
- the free area 4015 of the cache memory 401 when each function of the plurality of functions is arranged at the rearrangement position 802 is more than the free area 4016 of the cache memory 401 when each function of the plurality of functions is arranged at the arrangement position 801. There are few.
- the function placement adjustment unit 120 receives the program information 50 and the function placement information 90 as input, and outputs function placement information 90a with improved memory use efficiency.
- the function arrangement information 90 is information in which each function of a plurality of functions is arranged at the arrangement position 801.
- the function arrangement information 90a is information in which each function of a plurality of functions is arranged at the rearrangement position 802.
- Each functional block may be implemented as one or a plurality of programs, or a plurality of functional blocks may be implemented as one program.
- Steps S1, S1a, S2, and S3 in FIG. 29 are the same as those in the first embodiment.
- the function placement adjustment unit 120 generates function placement information 90 a with improved memory use efficiency based on the program information 50 and the function placement information 90.
- step S500 the function placement adjustment unit 120 initializes the memory address to the top of the memory space in which the function is placed, and the process proceeds to step S501.
- step S501 the function placement adjustment unit 120 checks whether all functions have been placed. If not arranged, the process proceeds to step S502, and if arranged, the process proceeds to step S506.
- step S502 the function placement adjustment unit 120 checks whether there is a function starting with a block address and a block offset indicated by the current memory address among the unplaced functions. If it exists, the process proceeds to step S503, and if it does not exist, the process proceeds to step S505.
- step S503 the function placement adjustment unit 120 extracts from the function placement information 90 one function that satisfies the block address and the block offset indicated by the current memory address from among the unplaced functions, and places the function at the current memory address. To do. After placement, the process proceeds to step S504.
- step S504 the function placement adjustment unit 120 advances the memory address by the size of the function to be processed.
- step S505 the function arrangement adjustment unit 120 advances the memory address by one block offset.
- step S506 the function arrangement adjustment unit 120 outputs the current arrangement information as the function arrangement information 90, and ends the process.
- the function arrangement adjustment processing S5 will be described in detail using a specific example.
- a case where the function arrangement adjustment process S5 is executed on the function arrangement information 90 shown in FIG. 27 will be described.
- the result of executing the function placement adjustment process S5 on the function placement information 90 is assumed to be function placement information 90a in FIG.
- the top of the memory space is 0, and the number of instructions in the block is 2.
- the function placement adjustment unit 120 initializes a memory address, a block address, and a block offset at the beginning of a memory space in which a function is placed. At this time, the memory address is 0, the block address is 0, and the block offset is 0.
- the function placement adjustment unit 120 places the function A satisfying the block address 0 and the block offset 0 among the unplaced functions at the memory address 0. Then, the function arrangement adjustment unit 120 adds the size 5 of the function A to the memory address to obtain the memory address 5, the block address 2, and the block offset 1.
- the function placement adjustment unit 120 takes out the function E satisfying the block address 2 and the block offset 1 and places it at the memory address 5. After the arrangement, the function arrangement adjustment unit 120 adds the size 6 of the function E to the memory address to obtain the memory address 11, the block address 5, and the block offset 1.
- the program arrangement apparatus 500a includes a function arrangement adjustment unit that rearranges function arrangements based on the function arrangement information 90 output from the arrangement position determination unit. Then, the program placement apparatus 500a executes the function rearrangement so that the free space in the memory is smaller than the free space in the memory when placed according to the function placement information 90. As described above, according to the program arrangement apparatus 500a according to the present embodiment, the function arrangement adjustment unit 120 executes the function rearrangement based on the function arrangement information 90 output from the arrangement position determination unit. Memory usage efficiency can be improved.
- the “information generation unit” and “function arrangement adjustment unit” were independent functional blocks.
- the program placement apparatus may not be configured as described above, and the configuration of the program placement apparatus is arbitrary.
- the “acquisition unit”, “arrangement position determination unit”, “function arrangement unit”, and “function arrangement adjustment unit” may be realized by one functional block.
- the “instruction trace reading unit”, “virtual cache memory generation unit”, “virtual cache data holding unit”, and “contention information generation unit” may be realized by one functional block.
- the program placement apparatus may be a program placement system constituted by a plurality of devices instead of a single device.
- the function blocks of the program placement apparatus are arbitrary as long as the functions described in the embodiment can be realized. Any other combination of these functional blocks may constitute the program placement apparatus.
- first and second embodiments have been described above, one of the two embodiments may be partially implemented. Alternatively, a plurality of these two embodiments may be partially combined. In addition, these two embodiments may be implemented in any combination as a whole or in part. In addition, said embodiment is an essentially preferable illustration, Comprising: It does not intend restrict
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The present invention comprises: an acquisition unit (21) that acquires a calling order (31) for functions; a virtual cache memory generation unit that generates a virtual cache memory having storage areas corresponding to the number of ways for cache memory; a simulator unit that performs a simulation calling an instruction code included in each of a plurality of functions on the calling order (31) as a call instruction code with respect to the virtual cache memory and that, in cases where conflict arises, acquires information concerning the conflict as conflict information (70); and an arrangement position determination unit (80) that determines an arrangement position of functions in the cache memory on the basis of the conflict information 70.
Description
本発明は、プログラム配置装置、プログラム配置方法及びプログラム配置プログラムに関する。
The present invention relates to a program placement apparatus, a program placement method, and a program placement program.
コンピュータシステムにおいて、性能向上を目的として、キャッシュメモリが利用される。コンピュータシステムでは、メインメモリの情報をキャッシュメモリにコピーしておくことにより、高速な読出しが可能となる。しかし、キャッシュメモリは小容量のため、命令の読出しに伴う情報の追い出し、すなわち競合キャッシュミスが発生する。競合キャッシュミスの発生は、プログラムの実行速度の低下につながるため、出来る限り抑制する必要がある。
In a computer system, a cache memory is used to improve performance. In the computer system, high-speed reading is possible by copying the information in the main memory to the cache memory. However, since the cache memory has a small capacity, information eviction associated with instruction reading, that is, a contention cache miss occurs. The occurrence of a competitive cache miss leads to a decrease in the execution speed of the program, so it is necessary to suppress it as much as possible.
そこで、競合キャッシュミスを発生する可能性の高い命令同士が、同一のキャッシュラインに割り当てられないように配置する方法が研究されている。
プログラムが関数単位で構成されることに着目し、関数間の呼び出し関係を表す関数強度を定義し、関数強度が高い関数同士が同一のキャッシュラインに割り当てられないようにする手法が提案されている。 Therefore, a method has been studied in which instructions that are likely to cause contention cache misses are not allocated to the same cache line.
Focusing on the fact that programs are structured in units of functions, a method has been proposed in which function strengths representing the call relationship between functions are defined, and functions with high function strengths are not assigned to the same cache line. .
プログラムが関数単位で構成されることに着目し、関数間の呼び出し関係を表す関数強度を定義し、関数強度が高い関数同士が同一のキャッシュラインに割り当てられないようにする手法が提案されている。 Therefore, a method has been studied in which instructions that are likely to cause contention cache misses are not allocated to the same cache line.
Focusing on the fact that programs are structured in units of functions, a method has been proposed in which function strengths representing the call relationship between functions are defined, and functions with high function strengths are not assigned to the same cache line. .
特許文献1では、プログラム実行時に、関数の呼び出し順を時系列として表現した動的関数フローを生成し、生成した動的関数フローに基づいて、ある関数と他の全ての関数との関数強度情報を求める。特許文献1では、その関数強度情報に基づいて、関数をメモリ空間に配置することで、競合キャッシュミスを削減する手法が開示されている。
In Patent Literature 1, when executing a program, a dynamic function flow expressing the function calling order as a time series is generated, and based on the generated dynamic function flow, function strength information on a certain function and all other functions. Ask for. Patent Document 1 discloses a technique for reducing contention cache misses by arranging functions in a memory space based on the function strength information.
また、メインメモリからキャッシュメモリに対して、キャッシュライン単位で、データのコピーが実行されることに着目した手法が提案されている。
特許文献2では、関数をキャッシュラインサイズの命令コードブロック、すなわちICBに分割してシミュレーションし、ICB単位でフロー情報を抽出する。特許文献2では、各ICBの近傍内に、自分と異なる関数に属するICBの出現頻度を考慮した情報を、自ICBから見た他のICBの近傍重み情報として求める。この近傍重み情報に基づいて、関数配置を決定することによって、競合キャッシュミスを削減する手法が開示されている。 In addition, a method has been proposed that focuses on copying data from the main memory to the cache memory in units of cache lines.
InPatent Document 2, a function is divided into instruction code blocks having a cache line size, that is, an ICB, simulated, and flow information is extracted in ICB units. In Patent Document 2, information that considers the appearance frequency of an ICB that belongs to a function different from itself in the vicinity of each ICB is obtained as the neighbor weight information of another ICB viewed from the own ICB. A technique for reducing contention cache misses by determining function placement based on this neighborhood weight information is disclosed.
特許文献2では、関数をキャッシュラインサイズの命令コードブロック、すなわちICBに分割してシミュレーションし、ICB単位でフロー情報を抽出する。特許文献2では、各ICBの近傍内に、自分と異なる関数に属するICBの出現頻度を考慮した情報を、自ICBから見た他のICBの近傍重み情報として求める。この近傍重み情報に基づいて、関数配置を決定することによって、競合キャッシュミスを削減する手法が開示されている。 In addition, a method has been proposed that focuses on copying data from the main memory to the cache memory in units of cache lines.
In
従来技術では、プログラム実行時における関数相互、またはキャッシュライン相互の時系列的な関係に基づいて、関数間の相関性を求め、相関性の高い関数同士が同一のキャッシュラインに割り当てられないように関数をメモリ空間に配置していた。
しかし、キャッシュメモリの構成によっては、相関性の高い関数同士でも、競合キャッシュミスが発生しない場合が存在する。例えば、キャッシュメモリとして4ウェイ構成を採用した場合、相関性の高い4つの関数が、連続的かつ繰り返し呼び出されたとしても、競合キャッシュミスは発生しない。
このように、キャッシュメモリの構成と関数の呼び出しパターンによっては、競合キャッシュミスが発生しない可能性があるにも関わらず、従来技術では関数の相関性を求める際に、このような事象を考慮していない。そのため、キャッシュメモリの構成と関数の呼び出しパターンによっては、最適な配置が求まらないという課題があった。 In the prior art, the correlation between functions is obtained based on the time-series relationship between functions at the time of program execution or between cache lines, so that highly correlated functions are not assigned to the same cache line. Functions were placed in memory space.
However, depending on the configuration of the cache memory, there may be a case where a conflict cache miss does not occur even between highly correlated functions. For example, when a 4-way configuration is adopted as the cache memory, a conflict cache miss does not occur even if four highly correlated functions are called continuously and repeatedly.
As described above, depending on the configuration of the cache memory and the function call pattern, there is a possibility that a conflict cache miss may not occur. Not. For this reason, there is a problem that an optimal arrangement cannot be obtained depending on the configuration of the cache memory and the function call pattern.
しかし、キャッシュメモリの構成によっては、相関性の高い関数同士でも、競合キャッシュミスが発生しない場合が存在する。例えば、キャッシュメモリとして4ウェイ構成を採用した場合、相関性の高い4つの関数が、連続的かつ繰り返し呼び出されたとしても、競合キャッシュミスは発生しない。
このように、キャッシュメモリの構成と関数の呼び出しパターンによっては、競合キャッシュミスが発生しない可能性があるにも関わらず、従来技術では関数の相関性を求める際に、このような事象を考慮していない。そのため、キャッシュメモリの構成と関数の呼び出しパターンによっては、最適な配置が求まらないという課題があった。 In the prior art, the correlation between functions is obtained based on the time-series relationship between functions at the time of program execution or between cache lines, so that highly correlated functions are not assigned to the same cache line. Functions were placed in memory space.
However, depending on the configuration of the cache memory, there may be a case where a conflict cache miss does not occur even between highly correlated functions. For example, when a 4-way configuration is adopted as the cache memory, a conflict cache miss does not occur even if four highly correlated functions are called continuously and repeatedly.
As described above, depending on the configuration of the cache memory and the function call pattern, there is a possibility that a conflict cache miss may not occur. Not. For this reason, there is a problem that an optimal arrangement cannot be obtained depending on the configuration of the cache memory and the function call pattern.
本発明は、キャッシュメモリの構成と関数の呼び出しパターンに依らず、最適な関数配置情報を出力することを目的とする。
The object of the present invention is to output optimum function arrangement information regardless of the cache memory configuration and function call pattern.
本発明に係るプログラム配置装置は、少なくとも1つのウェイを使用するキャッシュメモリに複数の関数を含むプログラムを配置するプログラム配置装置において、
前記プログラムを実行することにより、前記複数の関数の各関数の呼び出し順を取得する取得部と、
前記キャッシュメモリの前記ウェイの数分の格納エリアを有する仮想キャッシュメモリを生成する仮想キャッシュメモリ生成部と、
前記仮想キャッシュメモリに対して前記複数の関数の各関数を前記呼び出し順に呼出命令コードとして呼び出すシミュレーションを実行し、既に呼び出した前記呼出命令コードを再度呼び出した際に前記格納エリアに前記呼出命令コード以外の関数が格納されている競合が発生した場合、発生した前記競合の情報を競合情報として取得するシミュレータ部と、
前記競合情報に基づいて、前記キャッシュメモリにおける前記複数の関数の各関数の配置位置を決定する配置位置決定部と
を備える。 A program placement apparatus according to the present invention is a program placement apparatus that places a program including a plurality of functions in a cache memory that uses at least one way.
An acquisition unit that acquires the calling order of each function of the plurality of functions by executing the program;
A virtual cache memory generation unit that generates a virtual cache memory having storage areas corresponding to the number of ways of the cache memory;
A simulation is executed to call each function of the plurality of functions as a call instruction code in the calling order with respect to the virtual cache memory, and when the call instruction code that has already been called is called again, other than the call instruction code in the storage area When a conflict in which the function is stored occurs, a simulator unit that acquires information on the generated conflict as conflict information;
An arrangement position determining unit that determines an arrangement position of each function of the plurality of functions in the cache memory based on the contention information.
前記プログラムを実行することにより、前記複数の関数の各関数の呼び出し順を取得する取得部と、
前記キャッシュメモリの前記ウェイの数分の格納エリアを有する仮想キャッシュメモリを生成する仮想キャッシュメモリ生成部と、
前記仮想キャッシュメモリに対して前記複数の関数の各関数を前記呼び出し順に呼出命令コードとして呼び出すシミュレーションを実行し、既に呼び出した前記呼出命令コードを再度呼び出した際に前記格納エリアに前記呼出命令コード以外の関数が格納されている競合が発生した場合、発生した前記競合の情報を競合情報として取得するシミュレータ部と、
前記競合情報に基づいて、前記キャッシュメモリにおける前記複数の関数の各関数の配置位置を決定する配置位置決定部と
を備える。 A program placement apparatus according to the present invention is a program placement apparatus that places a program including a plurality of functions in a cache memory that uses at least one way.
An acquisition unit that acquires the calling order of each function of the plurality of functions by executing the program;
A virtual cache memory generation unit that generates a virtual cache memory having storage areas corresponding to the number of ways of the cache memory;
A simulation is executed to call each function of the plurality of functions as a call instruction code in the calling order with respect to the virtual cache memory, and when the call instruction code that has already been called is called again, other than the call instruction code in the storage area When a conflict in which the function is stored occurs, a simulator unit that acquires information on the generated conflict as conflict information;
An arrangement position determining unit that determines an arrangement position of each function of the plurality of functions in the cache memory based on the contention information.
本発明に係るプログラム配置装置によれば、取得部が、関数の呼び出し順を取得し、仮想キャッシュメモリ生成部が、キャッシュメモリのウェイの数分の格納エリアを有する仮想キャッシュメモリを生成する。また、シミュレータ部が、仮想キャッシュメモリに対して複数の関数の各関数を前記呼び出し順に呼出命令コードとして呼び出すシミュレーションを実行し、競合が発生した場合、発生した前記競合の情報を競合情報として取得する。さらに、配置位置決定部が、競合情報に基づいてキャッシュメモリにおける関数の配置位置を決定する。よって、キャッシュメモリの構成及び関数の呼び出し順を加味した最適な関数の配置位置を得ることができる。
According to the program placement apparatus according to the present invention, the acquisition unit acquires the function calling order, and the virtual cache memory generation unit generates a virtual cache memory having storage areas corresponding to the number of ways of the cache memory. Also, the simulator unit executes a simulation for calling each function of the plurality of functions as a call instruction code in the calling order with respect to the virtual cache memory, and when a conflict occurs, the information on the generated conflict is acquired as the conflict information. . Further, the arrangement position determining unit determines the function arrangement position in the cache memory based on the competition information. Therefore, it is possible to obtain an optimal function arrangement position in consideration of the cache memory configuration and the function call order.
実施の形態1.
***構成の説明***
図1は、実施の形態1に係るプログラム配置装置500を示すブロック構成図である。
プログラム配置装置500は、プログラム10、取得部21、呼び出し順31、キャッシュ構成情報40、プログラム情報50、仮想キャッシュシミュレータ部60、競合情報70、配置位置決定部80、関数配置情報90、関数配置部100、最適化済プログラム110、優先順位テーブル130を備える。Embodiment 1 FIG.
*** Explanation of configuration ***
FIG. 1 is a block configuration diagram showing a program placement apparatus 500 according to the first embodiment.
The program placement apparatus 500 includes aprogram 10, an acquisition unit 21, a calling order 31, cache configuration information 40, program information 50, a virtual cache simulator unit 60, competition information 70, a placement position determination unit 80, function placement information 90, and a function placement unit. 100, an optimized program 110, and a priority table 130.
***構成の説明***
図1は、実施の形態1に係るプログラム配置装置500を示すブロック構成図である。
プログラム配置装置500は、プログラム10、取得部21、呼び出し順31、キャッシュ構成情報40、プログラム情報50、仮想キャッシュシミュレータ部60、競合情報70、配置位置決定部80、関数配置情報90、関数配置部100、最適化済プログラム110、優先順位テーブル130を備える。
*** Explanation of configuration ***
FIG. 1 is a block configuration diagram showing a program placement apparatus 500 according to the first embodiment.
The program placement apparatus 500 includes a
プログラム配置装置500は、少なくとも1つのウェイを使用するキャッシュメモリに複数の関数を含むプログラムを配置する。プログラム配置装置500は、コンピュータが備えるキャッシュメモリにおけるプログラム10の配置位置を最適化するプログラム最適化装置である。
The program placement apparatus 500 places a program including a plurality of functions in a cache memory that uses at least one way. The program placement apparatus 500 is a program optimization apparatus that optimizes the placement position of the program 10 in a cache memory provided in the computer.
プログラム10は、競合キャッシュミスの削減を行う対象である最適化対象プログラムである。プログラム10は、ソースコード、オブジェクトファイル及び実行ファイルの内の1つのファイル、または複数のファイルを含む。
Program 10 is an optimization target program that is a target for reducing contention cache misses. The program 10 includes a source code, an object file, and one or more files among execution files.
取得部21は、プログラム10を実行することにより、複数の関数の各関数に含まれる命令コードの呼び出し順31を取得する。取得部21は、プログラム10を実行し、関数の呼び出し順31である命令トレース30を取得するプログラム実行部20である。プログラム実行部20は、命令トレース30を取得できる機構が備わっているのであれば、ターゲットプロセッサを含む実機、またはターゲットプロセッサを模擬するシミュレータのどちらであってもよい。
The acquiring unit 21 acquires the instruction code calling order 31 included in each function of the plurality of functions by executing the program 10. The acquisition unit 21 is a program execution unit 20 that executes the program 10 and acquires the instruction trace 30 that is the function call order 31. The program execution unit 20 may be either a real machine including the target processor or a simulator that simulates the target processor as long as it has a mechanism that can acquire the instruction trace 30.
命令トレース30は、プログラム10を実行した際の、実行命令の命令アドレスを時系列に並べたデータである。
キャッシュ構成情報40は、プログラム10を、最終的に動作させるターゲットプロセッサに搭載される、キャッシュメモリ401の情報であり、キャッシュラインサイズ、ウェイ数、セット数及び置換アルゴリズムの種類の情報を含む。
プログラム情報50は、プログラム10に含まれる全関数について、関数のラベル、配置アドレス、関数のサイズの組の情報を保持する。 Theinstruction trace 30 is data in which instruction addresses of execution instructions when the program 10 is executed are arranged in time series.
Thecache configuration information 40 is information on the cache memory 401 mounted on the target processor that finally operates the program 10, and includes information on the cache line size, the number of ways, the number of sets, and the type of replacement algorithm.
Theprogram information 50 holds information on a set of function labels, arrangement addresses, and function sizes for all functions included in the program 10.
キャッシュ構成情報40は、プログラム10を、最終的に動作させるターゲットプロセッサに搭載される、キャッシュメモリ401の情報であり、キャッシュラインサイズ、ウェイ数、セット数及び置換アルゴリズムの種類の情報を含む。
プログラム情報50は、プログラム10に含まれる全関数について、関数のラベル、配置アドレス、関数のサイズの組の情報を保持する。 The
The
The
仮想キャッシュシミュレータ部60は、命令トレース30、キャッシュ構成情報40及びプログラム情報50を入力として、競合情報70を出力する。仮想キャッシュシミュレータ部60は、命令トレース30に基づいて、実キャッシュメモリであるキャッシュメモリ401では取得できない、各関数に含まれるICB単位での競合情報を生成し、競合情報70として出力する。
競合情報70は、各関数に含まれるキャッシュラインサイズのICB単位での競合の情報を保持する競合ミスデータベースである。 The virtualcache simulator unit 60 receives the instruction trace 30, the cache configuration information 40, and the program information 50 and outputs contention information 70. Based on the instruction trace 30, the virtual cache simulator unit 60 generates conflict information for each ICB included in each function, which cannot be acquired by the cache memory 401 that is a real cache memory, and outputs it as the conflict information 70.
Thecontention information 70 is a contention miss database that stores contention information in units of ICBs of the cache line size included in each function.
競合情報70は、各関数に含まれるキャッシュラインサイズのICB単位での競合の情報を保持する競合ミスデータベースである。 The virtual
The
配置位置決定部80は、競合情報70に基づいて、キャッシュメモリ401における複数の関数の各関数の配置位置を決定する。配置位置決定部80は、キャッシュ構成情報40、プログラム情報50及び競合情報70を入力とし、関数配置情報90を出力する。配置位置決定部80は、決められた優先順位に基づいて、各関数を順番にメモリ空間に配置していく。配置位置決定部80は、ある関数を配置する際には、競合情報70を参照し、既配置の関数との競合キャッシュミス発生回数を求める。配置位置決定部80は、この競合キャッシュミス発生回数が最小となるように、関数の配置場所を決定する。
The arrangement position determination unit 80 determines the arrangement position of each function of the plurality of functions in the cache memory 401 based on the competition information 70. The arrangement position determination unit 80 receives the cache configuration information 40, the program information 50, and the competition information 70 as inputs, and outputs function arrangement information 90. The arrangement position determination unit 80 arranges each function in the memory space in order based on the determined priority order. When placing a certain function, the placement position determination unit 80 refers to the conflict information 70 and obtains the number of occurrences of a conflict cache miss with an already placed function. The arrangement position determination unit 80 determines the function arrangement position so that the number of occurrences of the contention cache miss is minimized.
関数配置情報90は、配置位置決定部80により算出された、競合キャッシュミス発生回数を最小にする関数配置のリストであり、全ての関数のラベルと配置アドレスの組で構成される。
関数配置部100は、プログラム10と関数配置情報90とを入力として、関数の再配置を実行し、最適化済プログラム110を出力する。
最適化済プログラム110は、プログラム10と動作は同じであるが、プログラム内の関数配置が異なり、競合キャッシュミスが最小化されたプログラムである。 Thefunction placement information 90 is a list of function placements that is calculated by the placement location determination unit 80 and minimizes the number of contention cache miss occurrences, and is composed of a set of labels and placement addresses of all functions.
Thefunction placement unit 100 receives the program 10 and the function placement information 90 as input, executes the function rearrangement, and outputs the optimized program 110.
The optimizedprogram 110 has the same operation as that of the program 10, but has a different function arrangement in the program and minimizes contention cache misses.
関数配置部100は、プログラム10と関数配置情報90とを入力として、関数の再配置を実行し、最適化済プログラム110を出力する。
最適化済プログラム110は、プログラム10と動作は同じであるが、プログラム内の関数配置が異なり、競合キャッシュミスが最小化されたプログラムである。 The
The
The optimized
優先順位テーブル130は、複数の関数の各関数の優先順位を判定するためのルール131を設定する。配置位置決定部80は、優先順位テーブル130に基づいてキャッシュメモリ401に配置する複数の関数の各関数の優先順位を判定する。配置位置決定部80は、判定した優先順位の順に複数の関数の各関数の配置位置を決定する。
The priority table 130 sets a rule 131 for determining the priority of each function of a plurality of functions. The arrangement position determination unit 80 determines the priority of each function of a plurality of functions arranged in the cache memory 401 based on the priority table 130. The arrangement position determination unit 80 determines the arrangement position of each function of the plurality of functions in the order of the determined priority.
各機能ブロックは、1つあるいは複数のプログラムとして実装されていてもよいし、複数の機能ブロックが1つのプログラムとして実装されていてもよい。また、命令トレース30、キャッシュ構成情報40、プログラム情報50、競合情報70及び関数配置情報90はファイルとして存在してもよいし、メモリ上にのみ配置されるデータであってもよい。
Each functional block may be implemented as one or a plurality of programs, or a plurality of functional blocks may be implemented as one program. Further, the instruction trace 30, the cache configuration information 40, the program information 50, the conflict information 70, and the function arrangement information 90 may exist as files, or may be data arranged only on the memory.
図2は、本実施の形態に係る仮想キャッシュシミュレータ部60のブロック構成図である。
仮想キャッシュシミュレータ部60は、仮想キャッシュメモリ生成部601とシミュレータ部605とを備える。シミュレータ部605は、仮想キャッシュデータ保持部602、命令トレース読出し部603、競合情報生成部604を備える。 FIG. 2 is a block configuration diagram of the virtualcache simulator unit 60 according to the present embodiment.
The virtualcache simulator unit 60 includes a virtual cache memory generation unit 601 and a simulator unit 605. The simulator unit 605 includes a virtual cache data holding unit 602, an instruction trace reading unit 603, and a conflict information generating unit 604.
仮想キャッシュシミュレータ部60は、仮想キャッシュメモリ生成部601とシミュレータ部605とを備える。シミュレータ部605は、仮想キャッシュデータ保持部602、命令トレース読出し部603、競合情報生成部604を備える。 FIG. 2 is a block configuration diagram of the virtual
The virtual
仮想キャッシュメモリ生成部601は、キャッシュメモリ401のウェイの数分の格納エリア4031を有する仮想キャッシュメモリ403を生成する。具体的には、仮想キャッシュメモリ生成部601は、仮想キャッシュメモリ403として、アドレスが連続する複数のエリア4039を生成する。複数のエリア4039は、ウェイの数分の格納エリア4031とウェイの数分の格納エリア4031の後ろに連続する複数の仮格納エリア4032とからなる。以下において、格納エリア4031を実ウェイと表記し、仮格納エリア4032を仮想ウェイと表記する場合がある。
以上のように、仮想キャッシュメモリ生成部601は、キャッシュ構成情報40に基づいて、仮想キャッシュデータ保持部602のデータ構造である仮想キャッシュメモリ403を構築する。 The virtual cachememory generation unit 601 generates virtual cache memories 403 having as many storage areas 4031 as the number of ways in the cache memory 401. Specifically, the virtual cache memory generation unit 601 generates a plurality of areas 4039 having consecutive addresses as the virtual cache memory 403. The plurality of areas 4039 includes a storage area 4031 corresponding to the number of ways and a plurality of temporary storage areas 4032 continuous behind the storage areas 4031 corresponding to the number of ways. Hereinafter, the storage area 4031 may be referred to as a real way and the temporary storage area 4032 may be referred to as a virtual way.
As described above, the virtual cachememory generation unit 601 builds the virtual cache memory 403 that is the data structure of the virtual cache data holding unit 602 based on the cache configuration information 40.
以上のように、仮想キャッシュメモリ生成部601は、キャッシュ構成情報40に基づいて、仮想キャッシュデータ保持部602のデータ構造である仮想キャッシュメモリ403を構築する。 The virtual cache
As described above, the virtual cache
シミュレータ部605は、仮想キャッシュメモリ403に対して複数の関数の各関数に含まれる命令コード301を呼び出し順31に呼出命令コード4033として呼び出すシミュレーションを実行する。シミュレータ部605は、既に呼び出した呼出命令コード4033を再度呼び出した際に格納エリア4031に呼出命令コード4033以外の命令コード301が格納されている競合が発生した場合、発生した競合の情報を競合情報70として取得する。
The simulator unit 605 executes a simulation for calling the instruction code 301 included in each function of the plurality of functions in the calling order 31 as the calling instruction code 4033 with respect to the virtual cache memory 403. When the simulator unit 605 calls the call instruction code 4033 that has already been called again, and there is a conflict in which the instruction code 301 other than the call instruction code 4033 is stored in the storage area 4031, the simulator unit 605 displays the information of the generated conflict as the conflict information. Obtained as 70.
具体的には、シミュレータ部605は、呼出命令コード4033を呼び出した際に格納エリア4031に対して競合が発生し、かつ、呼出命令コード4033が仮格納エリア4032にある場合、次のように競合命令コード組701を取得する。シミュレータ部605は、既に仮想キャッシュメモリ403に格納されている呼出命令コード4033より前のエリアに格納されている全ての命令コードと呼出命令コードとの組を競合命令コード組701として取得する。
Specifically, when the simulator unit 605 calls the call instruction code 4033, a conflict occurs in the storage area 4031 and the call instruction code 4033 is in the temporary storage area 4032, the following conflict occurs: An instruction code set 701 is acquired. The simulator unit 605 acquires a set of all instruction codes and call instruction codes stored in an area before the call instruction code 4033 already stored in the virtual cache memory 403 as a conflict instruction code set 701.
また、シミュレータ部605は、競合命令コード組701を取得した後に、既に仮想キャッシュメモリ403に格納されている呼出命令コードより前のエリアに格納されている全ての命令コードをそれぞれ1つ後ろのエリアに移動する。そして、シミュレータ部605は、既に仮想キャッシュメモリ403に格納されている呼出命令コード4033を仮想キャッシュメモリ403の先頭の格納エリア4031に格納し、呼び出し順31における呼出命令コード4033の次の命令コード301を呼出命令コード4033として呼び出す。
In addition, the simulator unit 605 acquires all the instruction codes stored in the area before the calling instruction code already stored in the virtual cache memory 403 after acquiring the competing instruction code set 701, respectively Move to. The simulator unit 605 stores the call instruction code 4033 already stored in the virtual cache memory 403 in the first storage area 4031 of the virtual cache memory 403, and the instruction code 301 next to the call instruction code 4033 in the call order 31. Is called as the call instruction code 4033.
ここで、呼び出し順31である命令トレース30には、関数をキャッシュラインサイズに分割した命令コード301、すなわち関数毎のICBの実行系列303が設定されている。よって、シミュレータ部605により呼出命令コード4033として呼び出される命令コード301とは、関数をキャッシュメモリ401のキャッシュラインサイズに分割した関数毎のICBである。以下、命令コード301を命令コードブロック、すなわちICBとして説明する。競合命令コード組701は、競合に関連するICBの組み合わせである競合ICB702である。
Here, in the instruction trace 30 which is the calling order 31, an instruction code 301 obtained by dividing a function into cache line sizes, that is, an execution sequence 303 of an ICB for each function is set. Therefore, the instruction code 301 called as the calling instruction code 4033 by the simulator unit 605 is an ICB for each function obtained by dividing the function into the cache line size of the cache memory 401. Hereinafter, the instruction code 301 will be described as an instruction code block, that is, an ICB. The conflicting instruction code set 701 is a conflicting ICB 702 that is a combination of ICBs related to the conflict.
仮想キャッシュデータ保持部602は、仮想キャッシュメモリ生成部601により構築された仮想キャッシュメモリ403のデータ構造に基づいて、命令トレース30を読み込み、キャッシュの動作を模擬する。
The virtual cache data holding unit 602 reads the instruction trace 30 based on the data structure of the virtual cache memory 403 constructed by the virtual cache memory generation unit 601 and simulates the operation of the cache.
命令トレース読出し部603は、命令トレース30に基づいて、命令コード301、すなわちICBを順番に取り出し、仮想キャッシュデータ保持部602に渡す。
競合情報生成部604は、仮想キャッシュデータ保持部602でキャッシュミスが発生した際に、キャッシュミスを引き起こすICBの組み合わせに関する情報を競合情報70に登録する。 The instructiontrace reading unit 603 sequentially extracts the instruction code 301, that is, the ICB, based on the instruction trace 30 and passes the instruction code 301 to the virtual cache data holding unit 602.
When the cache miss occurs in the virtual cachedata holding unit 602, the conflict information generation unit 604 registers information regarding the combination of ICBs causing the cache miss in the conflict information 70.
競合情報生成部604は、仮想キャッシュデータ保持部602でキャッシュミスが発生した際に、キャッシュミスを引き起こすICBの組み合わせに関する情報を競合情報70に登録する。 The instruction
When the cache miss occurs in the virtual cache
以上のように、シミュレータ部605は、複数の関数の各関数に含まれる命令コードのうち競合を発生させた命令コード301の組み合わせを競合命令コード組701として取得する。シミュレータ部605は、競合命令コード組701により発生した競合の回数を競合回数として計数し、計数した競合回数を競合情報70として取得する。
As described above, the simulator unit 605 acquires a combination of instruction codes 301 that caused a conflict among instruction codes included in each function of a plurality of functions as a conflict instruction code set 701. The simulator unit 605 counts the number of conflicts generated by the conflicting instruction code set 701 as the number of conflicts, and acquires the counted number of conflicts as the conflict information 70.
図3を用いて、命令トレース30について説明する。また、図4を用いて、競合情報70の構成について説明する。
命令トレース30より、図3のICBの実行系列303が得られているものとする。競合情報生成部604は、図3のICBの実行系列303に基づいて、図4に示す競合情報70を生成する。 Theinstruction trace 30 will be described with reference to FIG. The configuration of the competition information 70 will be described with reference to FIG.
It is assumed that the ICB execution sequence 303 of FIG. 3 is obtained from theinstruction trace 30. The competition information generation unit 604 generates the competition information 70 shown in FIG. 4 based on the ICB execution sequence 303 shown in FIG.
命令トレース30より、図3のICBの実行系列303が得られているものとする。競合情報生成部604は、図3のICBの実行系列303に基づいて、図4に示す競合情報70を生成する。 The
It is assumed that the ICB execution sequence 303 of FIG. 3 is obtained from the
図4に示す通り、競合情報70は、全ICBごとの競合ミスデータレコード71から構成される。競合ミスデータレコード71は、ICB名72、自ICBとしての合計ミス数73、他ICBとしての合計ミス数74及び1個以上の競合ミスエントリ75を有する。
競合ミスエントリ75は、ミスID76、競合ICB数77及び競合ICBごとのミス数78から構成される。自ICBとは、着目しているICB自身のことを表しており、図4のA0の競合ミスデータレコード71においては、A0が自ICBとなる。他ICBとは、着目しているICBが競合している他のICBの集合を表しており、図4のA0の競合ミスデータレコード71においては、B0、C0が他ICBとなる。競合ICBとは、あるキャッシュミスが発生した際に、競合する全ICBの集合を表す。 As shown in FIG. 4, thecontention information 70 is composed of contention miss data records 71 for all ICBs. The contention miss data record 71 has an ICB name 72, a total number of misses 73 as its own ICB, a total number of misses 74 as another ICB, and one or more contention miss entries 75.
The conflict missentry 75 includes a miss ID 76, a conflict ICB number 77, and a miss number 78 for each conflict ICB. The self ICB represents the ICB being focused on, and A0 is the self ICB in the contention miss data record 71 of A0 in FIG. The other ICB represents a set of other ICBs with which the focused ICB is competing. In the conflict miss data record 71 of A0 in FIG. 4, B0 and C0 are other ICBs. The competing ICB represents a set of all ICBs competing when a certain cache miss occurs.
競合ミスエントリ75は、ミスID76、競合ICB数77及び競合ICBごとのミス数78から構成される。自ICBとは、着目しているICB自身のことを表しており、図4のA0の競合ミスデータレコード71においては、A0が自ICBとなる。他ICBとは、着目しているICBが競合している他のICBの集合を表しており、図4のA0の競合ミスデータレコード71においては、B0、C0が他ICBとなる。競合ICBとは、あるキャッシュミスが発生した際に、競合する全ICBの集合を表す。 As shown in FIG. 4, the
The conflict miss
ICB名72は各ICBを識別するための名前である。
自ICBとしての合計ミス数73は、自分自身を参照する時に発生した競合キャッシュミス回数を表す。
他ICBとしての合計ミス数74は、自分自身と競合する、他のICBを参照する時に発生した、競合キャッシュミス回数を表す。
競合ミスエントリ75は、あるICBの組み合わせにおける、キャッシュミスの発生状況を示すデータであり、競合ミスデータレコード71ごとに1個以上存在する。 TheICB name 72 is a name for identifying each ICB.
The total number ofmisses 73 as the own ICB represents the number of contention cache misses that occurred when referring to itself.
Thetotal miss count 74 as another ICB represents the number of contention cache misses that occurred when referring to another ICB that competes with itself.
The contention missentry 75 is data indicating a cache miss occurrence state in a certain ICB combination, and there is one or more contention miss data records 71 for each contention miss data record 71.
自ICBとしての合計ミス数73は、自分自身を参照する時に発生した競合キャッシュミス回数を表す。
他ICBとしての合計ミス数74は、自分自身と競合する、他のICBを参照する時に発生した、競合キャッシュミス回数を表す。
競合ミスエントリ75は、あるICBの組み合わせにおける、キャッシュミスの発生状況を示すデータであり、競合ミスデータレコード71ごとに1個以上存在する。 The
The total number of
The
The contention miss
ミスID76は、各ICB内の競合キャッシュミスを一意に識別するためのIDである。
競合ICB数77は、競合キャッシュミス発生時に関連するICBの数を表す。競合ICB数77には、自ICBも含まれる。同じICB内において、同じ競合ICB数であるにも関わらず、別のキャッシュミスとして記録されているのは、競合キャッシュミスの発生回数を、競合ICBの組み合わせごとに保持しているからである。 Themiss ID 76 is an ID for uniquely identifying a conflicting cache miss in each ICB.
Thecontention ICB number 77 represents the number of ICBs related when a contention cache miss occurs. The number of competing ICBs 77 includes its own ICB. In the same ICB, although the number of competing ICBs is the same, it is recorded as another cache miss because the number of occurrences of competing cache misses is held for each combination of competing ICBs.
競合ICB数77は、競合キャッシュミス発生時に関連するICBの数を表す。競合ICB数77には、自ICBも含まれる。同じICB内において、同じ競合ICB数であるにも関わらず、別のキャッシュミスとして記録されているのは、競合キャッシュミスの発生回数を、競合ICBの組み合わせごとに保持しているからである。 The
The
競合ICBごとのミス数78は、競合キャッシュミス発生時に関連するICBごとの、競合キャッシュミス発生回数を表す。競合ICBごとのミス数78の値の意味を、図4のA0の競合ミスデータレコード71を例に説明する。A0に含まれる競合ミスエントリ75の内、ミスID76が3の行に注目すると、競合ICB数77が2で、競合ICBごとのミス数78はA0で1、B0で斜線、C0で0が入力されている。ミスIDが3の行は、A0とC0との2つのICBを競合ICBとして発生したキャッシュミスの回数が設定されている。数字の入力されているICBは、キャッシュミスに関連していることを表し、斜線のICBは関連していないことを表す。よって、ミスIDが3の行では、A0とC0とに数字が設定されている。また数字は、競合ICBの組み合わせにより発生したキャッシュミスの発生回数を示している。ミスIDが3の行では、A0とC0の組み合わせにおいて、A0参照時に1回キャッシュミスが発生し、C0の参照時にはキャッシュミスが発生しないことを表す。
The number of misses 78 for each competing ICB represents the number of occurrences of a competing cache miss for each ICB related to the occurrence of a competing cache miss. The meaning of the value of the number of misses 78 for each competing ICB will be described using the contention miss data record 71 of A0 in FIG. 4 as an example. In the conflict miss entry 75 included in A0, focusing on the row where the miss ID 76 is 3, the conflict ICB number 77 is 2, the miss number 78 for each conflict ICB is 1 for A0, hatched for B0, and 0 for C0. Has been. In the row with the miss ID 3, the number of cache misses in which two ICBs A0 and C0 are used as competing ICBs is set. An ICB in which a number is input indicates that it is related to a cache miss, and a hatched ICB indicates that it is not related. Therefore, in the row where the miss ID is 3, numbers are set in A0 and C0. The numbers indicate the number of occurrences of cache misses caused by the combination of competing ICBs. A row with a miss ID of 3 indicates that in the combination of A0 and C0, a cache miss occurs once when A0 is referenced, and no cache miss occurs when C0 is referenced.
図5を用いて、本実施の形態に係るプログラム配置装置500のハードウェア構成の一例について説明する。
An example of the hardware configuration of the program placement apparatus 500 according to the present embodiment will be described with reference to FIG.
プログラム配置装置500のハードウェア構成例を図5を参照して説明する。
プログラム配置装置500はコンピュータである。
プログラム配置装置500は、プロセッサ901、補助記憶装置902、メモリ903、通信装置904、入力インタフェース905、ディスプレイインタフェース906といったハードウェアを備える。
プロセッサ901は、信号線910を介して他のハードウェアと接続され、これら他のハードウェアを制御する。
入力インタフェース905は、入力装置907に接続されている。
ディスプレイインタフェース906は、ディスプレイ908に接続されている。 A hardware configuration example of the program placement apparatus 500 will be described with reference to FIG.
The program placement apparatus 500 is a computer.
The program placement apparatus 500 includes hardware such as aprocessor 901, an auxiliary storage device 902, a memory 903, a communication device 904, an input interface 905, and a display interface 906.
Theprocessor 901 is connected to other hardware via the signal line 910, and controls these other hardware.
The input interface 905 is connected to theinput device 907.
Thedisplay interface 906 is connected to the display 908.
プログラム配置装置500はコンピュータである。
プログラム配置装置500は、プロセッサ901、補助記憶装置902、メモリ903、通信装置904、入力インタフェース905、ディスプレイインタフェース906といったハードウェアを備える。
プロセッサ901は、信号線910を介して他のハードウェアと接続され、これら他のハードウェアを制御する。
入力インタフェース905は、入力装置907に接続されている。
ディスプレイインタフェース906は、ディスプレイ908に接続されている。 A hardware configuration example of the program placement apparatus 500 will be described with reference to FIG.
The program placement apparatus 500 is a computer.
The program placement apparatus 500 includes hardware such as a
The
The input interface 905 is connected to the
The
プロセッサ901は、プロセッシングを行うIC(Integrated Circuit)である。
プロセッサ901は、例えば、CPU(Central Processing Unit)、DSP(Digital Signal Processor)、GPU(Graphics Processing Unit)である。
補助記憶装置902は、例えば、ROM(Read Only Memory)、フラッシュメモリ、HDD(Hard Disk Drive)である。
メモリ903は、例えば、RAM(Random Access Memory)である。
通信装置904は、データを受信するレシーバー9401及びデータを送信するトランスミッター9402を含む。
通信装置904は、例えば、通信チップ又はNIC(Network Interface Card)である。
入力インタフェース905は、入力装置907のケーブル911が接続されるポートである。
入力インタフェース905は、例えば、USB(Universal Serial Bus)端子である。
ディスプレイインタフェース906は、ディスプレイ908のケーブル912が接続されるポートである。
ディスプレイインタフェース906は、例えば、USB端子又はHDMI(登録商標)(High Definition Multimedia Interface)端子である。
入力装置907は、例えば、マウス、キーボード又はタッチパネルである。
ディスプレイ908は、例えば、LCD(Liquid Crystal Display)である。 Theprocessor 901 is an IC (Integrated Circuit) that performs processing.
Theprocessor 901 is, for example, a CPU (Central Processing Unit), a DSP (Digital Signal Processor), or a GPU (Graphics Processing Unit).
Theauxiliary storage device 902 is, for example, a ROM (Read Only Memory), a flash memory, or an HDD (Hard Disk Drive).
Thememory 903 is, for example, a RAM (Random Access Memory).
Thecommunication device 904 includes a receiver 9401 that receives data and a transmitter 9402 that transmits data.
Thecommunication device 904 is, for example, a communication chip or a NIC (Network Interface Card).
The input interface 905 is a port to which the cable 911 of theinput device 907 is connected.
The input interface 905 is, for example, a USB (Universal Serial Bus) terminal.
Thedisplay interface 906 is a port to which the cable 912 of the display 908 is connected.
Thedisplay interface 906 is, for example, a USB terminal or an HDMI (registered trademark) (High Definition Multimedia Interface) terminal.
Theinput device 907 is, for example, a mouse, a keyboard, or a touch panel.
Thedisplay 908 is, for example, an LCD (Liquid Crystal Display).
プロセッサ901は、例えば、CPU(Central Processing Unit)、DSP(Digital Signal Processor)、GPU(Graphics Processing Unit)である。
補助記憶装置902は、例えば、ROM(Read Only Memory)、フラッシュメモリ、HDD(Hard Disk Drive)である。
メモリ903は、例えば、RAM(Random Access Memory)である。
通信装置904は、データを受信するレシーバー9401及びデータを送信するトランスミッター9402を含む。
通信装置904は、例えば、通信チップ又はNIC(Network Interface Card)である。
入力インタフェース905は、入力装置907のケーブル911が接続されるポートである。
入力インタフェース905は、例えば、USB(Universal Serial Bus)端子である。
ディスプレイインタフェース906は、ディスプレイ908のケーブル912が接続されるポートである。
ディスプレイインタフェース906は、例えば、USB端子又はHDMI(登録商標)(High Definition Multimedia Interface)端子である。
入力装置907は、例えば、マウス、キーボード又はタッチパネルである。
ディスプレイ908は、例えば、LCD(Liquid Crystal Display)である。 The
The
The
The
The
The
The input interface 905 is a port to which the cable 911 of the
The input interface 905 is, for example, a USB (Universal Serial Bus) terminal.
The
The
The
The
補助記憶装置902には、図1に示す取得部21、仮想キャッシュシミュレータ部60、配置位置決定部80、関数配置部100(以下、取得部21、仮想キャッシュシミュレータ部60、配置位置決定部80、関数配置部100をまとめて「部」と表記する)の機能を実現するプログラムが記憶されている。上述したプログラム配置装置500が備える「部」の機能を実現するプログラムは、プログラム配置プログラムと称される。プログラム配置プログラムは、1つのプログラムであってもよいし、複数のプログラムから構成されていてもよい。
このプログラム配置プログラムは、メモリ903にロードされ、プロセッサ901に読み込まれ、プロセッサ901によって実行される。
更に、補助記憶装置902には、OS(Operating System)も記憶されている。
そして、OSの少なくとも一部がメモリ903にロードされ、プロセッサ901はOSを実行しながら、「部」の機能を実現するプログラムを実行する。
図5では、1つのプロセッサ901が図示されているが、プログラム配置装置500が複数のプロセッサ901を備えていてもよい。
そして、複数のプロセッサ901が「部」の機能を実現するプログラムを連携して実行してもよい。
また、「部」の処理の結果を示す情報やデータや信号値や変数値が、メモリ903、補助記憶装置902、又は、プロセッサ901内のレジスタ又はキャッシュメモリにファイルとして記憶される。 Theauxiliary storage device 902 includes an acquisition unit 21, a virtual cache simulator unit 60, an arrangement position determination unit 80, and a function arrangement unit 100 (hereinafter, acquisition unit 21, virtual cache simulator unit 60, arrangement position determination unit 80, A program for realizing the function of the function arrangement unit 100 is collectively stored as “part”. A program that realizes the function of the “unit” included in the above-described program placement apparatus 500 is referred to as a program placement program. The program arrangement program may be a single program or may be composed of a plurality of programs.
This program arrangement program is loaded into thememory 903, read into the processor 901, and executed by the processor 901.
Further, theauxiliary storage device 902 also stores an OS (Operating System).
Then, at least a part of the OS is loaded into thememory 903, and the processor 901 executes a program that realizes the function of “unit” while executing the OS.
Although oneprocessor 901 is illustrated in FIG. 5, the program placement apparatus 500 may include a plurality of processors 901.
A plurality ofprocessors 901 may execute a program for realizing the function of “unit” in cooperation with each other.
In addition, information, data, signal values, and variable values indicating the results of the processing of “unit” are stored as files in thememory 903, the auxiliary storage device 902, or a register or cache memory in the processor 901.
このプログラム配置プログラムは、メモリ903にロードされ、プロセッサ901に読み込まれ、プロセッサ901によって実行される。
更に、補助記憶装置902には、OS(Operating System)も記憶されている。
そして、OSの少なくとも一部がメモリ903にロードされ、プロセッサ901はOSを実行しながら、「部」の機能を実現するプログラムを実行する。
図5では、1つのプロセッサ901が図示されているが、プログラム配置装置500が複数のプロセッサ901を備えていてもよい。
そして、複数のプロセッサ901が「部」の機能を実現するプログラムを連携して実行してもよい。
また、「部」の処理の結果を示す情報やデータや信号値や変数値が、メモリ903、補助記憶装置902、又は、プロセッサ901内のレジスタ又はキャッシュメモリにファイルとして記憶される。 The
This program arrangement program is loaded into the
Further, the
Then, at least a part of the OS is loaded into the
Although one
A plurality of
In addition, information, data, signal values, and variable values indicating the results of the processing of “unit” are stored as files in the
「部」を「サーキットリー」で提供してもよい。
また、「部」を「回路」又は「工程」又は「手順」又は「処理」に読み替えてもよい。
「回路」及び「サーキットリー」は、プロセッサ901だけでなく、ロジックIC又はGA(Gate Array)又はASIC(Application Specific Integrated Circuit)又はFPGA(Field-Programmable Gate Array)といった他の種類の処理回路をも包含する概念である。 The “part” may be provided as “circuitry”.
Further, “part” may be read as “circuit”, “process”, “procedure”, or “processing”.
“Circuit” and “Circuitry” include not only theprocessor 901 but also other types of processing circuits such as a logic IC or GA (Gate Array) or ASIC (Application Specific Integrated Circuit) or FPGA (Field-Programmable Gate Array). It is a concept to include.
また、「部」を「回路」又は「工程」又は「手順」又は「処理」に読み替えてもよい。
「回路」及び「サーキットリー」は、プロセッサ901だけでなく、ロジックIC又はGA(Gate Array)又はASIC(Application Specific Integrated Circuit)又はFPGA(Field-Programmable Gate Array)といった他の種類の処理回路をも包含する概念である。 The “part” may be provided as “circuitry”.
Further, “part” may be read as “circuit”, “process”, “procedure”, or “processing”.
“Circuit” and “Circuitry” include not only the
なお、プログラムプロダクトと称されるものは、「部」として説明している機能を実現するプログラム配置プログラムが記録された記憶媒体、記憶装置などであり、見た目の形式に関わらず、コンピュータ読み取り可能なプログラムをロードしているものである。
Note that what is called a program product is a storage medium, storage device, or the like on which a program placement program that realizes the function described as “part” is recorded, and can be read by a computer regardless of the appearance format. The program is being loaded.
***動作の説明***
図6を用いて、本実施の形態に係るプログラム配置装置500のプログラム配置方法、プログラム配置処理S10について説明する。
上述したように、プログラム配置プログラムは、少なくとも1つのウェイを使用するキャッシュメモリ401に複数の関数を含むプログラム10を配置するコンピュータであるプログラム配置装置500に実行させるプログラムである。 *** Explanation of operation ***
The program placement method and program placement processing S10 of the program placement apparatus 500 according to the present embodiment will be described with reference to FIG.
As described above, the program arrangement program is a program that is executed by the program arrangement apparatus 500 that is a computer that arranges theprogram 10 including a plurality of functions in the cache memory 401 using at least one way.
図6を用いて、本実施の形態に係るプログラム配置装置500のプログラム配置方法、プログラム配置処理S10について説明する。
上述したように、プログラム配置プログラムは、少なくとも1つのウェイを使用するキャッシュメモリ401に複数の関数を含むプログラム10を配置するコンピュータであるプログラム配置装置500に実行させるプログラムである。 *** Explanation of operation ***
The program placement method and program placement processing S10 of the program placement apparatus 500 according to the present embodiment will be described with reference to FIG.
As described above, the program arrangement program is a program that is executed by the program arrangement apparatus 500 that is a computer that arranges the
取得処理S1において、取得部21は、プログラム10を実行することにより、複数の関数の各関数に含まれる命令コード301の呼び出し順31を取得する取得処理S1を実行する。すなわち、プログラム実行部20は、プログラム10を実行し、命令トレース30を抽出する。
In the acquisition process S1, the acquisition unit 21 executes the acquisition process S1 for acquiring the calling order 31 of the instruction code 301 included in each function of the plurality of functions by executing the program 10. That is, the program execution unit 20 executes the program 10 and extracts the instruction trace 30.
仮想キャッシュメモリ生成処理S1aにおいて、仮想キャッシュメモリ生成部601は、キャッシュメモリ401のウェイの数分の格納エリア4031を有する仮想キャッシュメモリ403を生成する仮想キャッシュメモリ生成処理S1aを実行する。
In the virtual cache memory generation process S1a, the virtual cache memory generation unit 601 executes a virtual cache memory generation process S1a for generating virtual cache memories 403 having as many storage areas 4031 as the number of ways in the cache memory 401.
シミュレーション処理S2において、シミュレータ部605は、仮想キャッシュメモリ403に対して命令コード301を呼び出し順31に呼出命令コード4033として呼び出すシミュレーション処理S2を実行する。シミュレーション処理S2において、シミュレータ部605は、既に呼び出した呼出命令コード4033を再度呼び出した際に格納エリア4031に呼出命令コード以外の命令コードが格納されている競合が発生した場合、競合の情報を競合情報70として取得する。すなわち、シミュレーション処理S2において、仮想キャッシュシミュレータ部60が、命令トレース30、キャッシュ構成情報40及びプログラム情報50に基づいて、競合情報70を生成する。
In the simulation process S2, the simulator unit 605 executes the simulation process S2 that calls the instruction code 301 to the virtual cache memory 403 as the call instruction code 4033 in the calling order 31. In the simulation process S2, the simulator unit 605 conflicts the conflict information when there is a conflict in which an instruction code other than the call instruction code is stored in the storage area 4031 when the call instruction code 4033 that has already been called is called again. Obtained as information 70. That is, in the simulation process S <b> 2, the virtual cache simulator unit 60 generates the competition information 70 based on the instruction trace 30, the cache configuration information 40, and the program information 50.
配置位置決定処理S3において、配置位置決定部80は、競合情報70に基づいて、キャッシュメモリ401における複数の関数の各関数の配置位置801を決定する配置位置決定処理S3を実行する。すなわち、配置位置決定処理S3において、配置位置決定部80が、キャッシュ構成情報40、プログラム情報50及び競合情報70を入力とし、関数の配置位置801に関する関数配置情報90を生成する。
In the arrangement position determination process S3, the arrangement position determination unit 80 executes an arrangement position determination process S3 for determining an arrangement position 801 of each function of the plurality of functions in the cache memory 401 based on the competition information 70. That is, in the arrangement position determination process S3, the arrangement position determination unit 80 receives the cache configuration information 40, the program information 50, and the competition information 70 as input, and generates function arrangement information 90 related to the function arrangement position 801.
最後に、関数配置処理S4において、関数配置部100が、プログラム10と関数配置情報90とを入力として、関数をキャッシュメモリ401に配置する関数配置処理S4を実行し、最適化済プログラム110を出力する。
Finally, in the function placement process S4, the function placement unit 100 receives the program 10 and the function placement information 90 as input, executes the function placement process S4 that places the function in the cache memory 401, and outputs the optimized program 110 To do.
図7は、本実施の形態に係る仮想キャッシュシミュレーション処理S200の動作を示すフロー図である。
仮想キャッシュシミュレーション処理は、仮想キャッシュメモリ生成処理S1a及びシミュレーション処理S2を備える。仮想キャッシュシミュレータ部60は、命令トレース30、キャッシュ構成情報40及びプログラム情報50の情報に基づいて、競合情報70を生成する仮想キャッシュシミュレーション処理S200を実行する。 FIG. 7 is a flowchart showing the operation of the virtual cache simulation process S200 according to the present embodiment.
The virtual cache simulation process includes a virtual cache memory generation process S1a and a simulation process S2. The virtualcache simulator unit 60 executes a virtual cache simulation process S200 for generating contention information 70 based on the information of the instruction trace 30, the cache configuration information 40, and the program information 50.
仮想キャッシュシミュレーション処理は、仮想キャッシュメモリ生成処理S1a及びシミュレーション処理S2を備える。仮想キャッシュシミュレータ部60は、命令トレース30、キャッシュ構成情報40及びプログラム情報50の情報に基づいて、競合情報70を生成する仮想キャッシュシミュレーション処理S200を実行する。 FIG. 7 is a flowchart showing the operation of the virtual cache simulation process S200 according to the present embodiment.
The virtual cache simulation process includes a virtual cache memory generation process S1a and a simulation process S2. The virtual
<仮想キャッシュメモリ生成処理S1a>
ステップS200において、仮想キャッシュメモリ生成部601が、キャッシュ構成情報40に基づいて、仮想キャッシュメモリ403を生成する仮想キャッシュメモリ生成処理S1aを実行する。仮想キャッシュメモリ生成処理S1aの詳細については後述する。仮想キャッシュデータ保持部602は、仮想キャッシュメモリ生成部601が構成する仮想キャッシュメモリ403にデータを保持する。 <Virtual cache memory generation processing S1a>
In step S200, the virtual cachememory generation unit 601 executes a virtual cache memory generation process S1a for generating the virtual cache memory 403 based on the cache configuration information 40. Details of the virtual cache memory generation processing S1a will be described later. The virtual cache data holding unit 602 holds data in the virtual cache memory 403 configured by the virtual cache memory generation unit 601.
ステップS200において、仮想キャッシュメモリ生成部601が、キャッシュ構成情報40に基づいて、仮想キャッシュメモリ403を生成する仮想キャッシュメモリ生成処理S1aを実行する。仮想キャッシュメモリ生成処理S1aの詳細については後述する。仮想キャッシュデータ保持部602は、仮想キャッシュメモリ生成部601が構成する仮想キャッシュメモリ403にデータを保持する。 <Virtual cache memory generation processing S1a>
In step S200, the virtual cache
<シミュレーション処理S2>
ステップS201において、命令トレース読出し部603は、命令トレース30を最後まで読み出したか判断し、読み出していなければステップS202に遷移し、読み出していれば処理を終了する。 <Simulation process S2>
In step S201, the instructiontrace reading unit 603 determines whether the instruction trace 30 has been read to the end. If not read, the process proceeds to step S202. If read, the process ends.
ステップS201において、命令トレース読出し部603は、命令トレース30を最後まで読み出したか判断し、読み出していなければステップS202に遷移し、読み出していれば処理を終了する。 <Simulation process S2>
In step S201, the instruction
ステップS202において、命令トレース読出し部603が、命令トレース30から命令アドレスを1つ取り出し、ステップS203に遷移する。
ステップS203において、命令トレース読出し部603が、取り出した命令アドレスが含まれるICBを求めるICB取得処理S203を実行する。命令トレース読出し部603は、ICB取得処理S203を実行した後、ステップS204に遷移する。 In step S202, the instructiontrace reading unit 603 extracts one instruction address from the instruction trace 30, and the process proceeds to step S203.
In step S203, the instructiontrace reading unit 603 executes an ICB acquisition process S203 for obtaining an ICB including the extracted instruction address. After executing the ICB acquisition process S203, the instruction trace reading unit 603 proceeds to step S204.
ステップS203において、命令トレース読出し部603が、取り出した命令アドレスが含まれるICBを求めるICB取得処理S203を実行する。命令トレース読出し部603は、ICB取得処理S203を実行した後、ステップS204に遷移する。 In step S202, the instruction
In step S203, the instruction
ステップS204において、競合情報生成部604が、ICBがキャッシュミスを起こすか判断する。競合情報生成部604は、キャッシュミスが発生すればステップS205に遷移し、発生しなければステップS206に遷移する。
ステップS205では、競合情報生成部604は、キャッシュミス発生時のICBの組み合わせ情報を競合ICB702として、競合情報70に登録し、ステップS206に遷移する。ステップS205の詳細は後述する。
ステップS206では、読み出したブロックに応じて、キャッシュの内容を更新し、ステップS201に戻る。仮想キャッシュシミュレータ部60は、上記の処理をステップS201が真になるまで、すなわちステップS201においてYESになるまで続ける。 In step S204, the conflictinformation generation unit 604 determines whether the ICB causes a cache miss. If a cache miss occurs, the contention information generation unit 604 proceeds to step S205, and if not, the contention information generation unit 604 proceeds to step S206.
In step S205, the conflictinformation generation unit 604 registers the combination information of the ICB when a cache miss occurs as the conflict ICB 702 in the conflict information 70, and proceeds to step S206. Details of step S205 will be described later.
In step S206, the contents of the cache are updated according to the read block, and the process returns to step S201. The virtualcache simulator unit 60 continues the above processing until step S201 becomes true, that is, until YES in step S201.
ステップS205では、競合情報生成部604は、キャッシュミス発生時のICBの組み合わせ情報を競合ICB702として、競合情報70に登録し、ステップS206に遷移する。ステップS205の詳細は後述する。
ステップS206では、読み出したブロックに応じて、キャッシュの内容を更新し、ステップS201に戻る。仮想キャッシュシミュレータ部60は、上記の処理をステップS201が真になるまで、すなわちステップS201においてYESになるまで続ける。 In step S204, the conflict
In step S205, the conflict
In step S206, the contents of the cache are updated according to the read block, and the process returns to step S201. The virtual
<仮想キャッシュメモリ生成処理S1aの詳細説明>
図8及び図9を用いて、仮想キャッシュメモリ生成処理S1aについて説明する。
仮想キャッシュメモリ生成部601は、キャッシュ構成情報40に基づいて、仮想キャッシュメモリ403の構成を変化させる。仮想キャッシュメモリ生成部601は、アドレスが連続する複数のエリア4039を生成する。複数のエリア4039は、ウェイの数分の実ウェイである格納エリア4031と、格納エリア4031の後ろに連続する複数の仮想ウェイである仮格納エリア4032とから構成される。 <Detailed Description of Virtual Cache Memory Generation Processing S1a>
The virtual cache memory generation process S1a will be described with reference to FIGS.
The virtual cachememory generation unit 601 changes the configuration of the virtual cache memory 403 based on the cache configuration information 40. The virtual cache memory generation unit 601 generates a plurality of areas 4039 having consecutive addresses. The plurality of areas 4039 are configured by storage areas 4031 that are actual ways corresponding to the number of ways, and temporary storage areas 4032 that are a plurality of virtual ways that follow the storage area 4031.
図8及び図9を用いて、仮想キャッシュメモリ生成処理S1aについて説明する。
仮想キャッシュメモリ生成部601は、キャッシュ構成情報40に基づいて、仮想キャッシュメモリ403の構成を変化させる。仮想キャッシュメモリ生成部601は、アドレスが連続する複数のエリア4039を生成する。複数のエリア4039は、ウェイの数分の実ウェイである格納エリア4031と、格納エリア4031の後ろに連続する複数の仮想ウェイである仮格納エリア4032とから構成される。 <Detailed Description of Virtual Cache Memory Generation Processing S1a>
The virtual cache memory generation process S1a will be described with reference to FIGS.
The virtual cache
図8は、キャッシュメモリ401が、ダイレクトマップ方式、ウェイの数は1、セット数2、64Bキャッシュライン、LRU(Least Recently Used)方式である場合の仮想キャッシュメモリ403の生成方法を示している。
図9は、キャッシュメモリ401が、2ウェイセットアソシアティブ方式、ウェイの数は2、セット数4、64Bキャッシュライン、LRU方式である場合の、仮想キャッシュメモリ403の生成方法を示している。
仮想キャッシュメモリ403は、キャッシュメモリ401のウェイ数及びセット数に関わらず、セット数1のNウェイセットアソシアティブキャッシュとして構成される。ここでNは、使用者が任意に設定できるパラメータであり、大きい値を設定するほど、多数のICB間の相関性を観測することができる。 FIG. 8 shows a method of generating the virtual cache memory 403 when the cache memory 401 is of the direct map method, the number of ways is 1, the number of sets is 2, 64B cache lines, and the LRU (Least Recently Used) method.
FIG. 9 shows a method for generating the virtual cache memory 403 when the cache memory 401 is a 2-way set associative method, the number of ways is 2, the number of sets is 4, a 64B cache line, and an LRU method.
The virtual cache memory 403 is configured as an N-way set associative cache with one set regardless of the number of ways and the number of sets of the cache memory 401. Here, N is a parameter that can be arbitrarily set by the user, and as the value is set larger, the correlation between a large number of ICBs can be observed.
図9は、キャッシュメモリ401が、2ウェイセットアソシアティブ方式、ウェイの数は2、セット数4、64Bキャッシュライン、LRU方式である場合の、仮想キャッシュメモリ403の生成方法を示している。
仮想キャッシュメモリ403は、キャッシュメモリ401のウェイ数及びセット数に関わらず、セット数1のNウェイセットアソシアティブキャッシュとして構成される。ここでNは、使用者が任意に設定できるパラメータであり、大きい値を設定するほど、多数のICB間の相関性を観測することができる。 FIG. 8 shows a method of generating the virtual cache memory 403 when the cache memory 401 is of the direct map method, the number of ways is 1, the number of sets is 2, 64B cache lines, and the LRU (Least Recently Used) method.
FIG. 9 shows a method for generating the virtual cache memory 403 when the cache memory 401 is a 2-way set associative method, the number of ways is 2, the number of sets is 4, a 64B cache line, and an LRU method.
The virtual cache memory 403 is configured as an N-way set associative cache with one set regardless of the number of ways and the number of sets of the cache memory 401. Here, N is a parameter that can be arbitrarily set by the user, and as the value is set larger, the correlation between a large number of ICBs can be observed.
上記の通り、仮想キャッシュメモリ403はNウェイとして構成されるが、キャッシュメモリ401の構成によって、シミュレーションを実行する際のキャッシュミスを判定するタイミングが異なる。すなわち、仮想キャッシュメモリ生成処理S1aでは、キャッシュメモリ401のウェイの数分を格納エリア4031、すなわち実ウェイとして扱い、残りのウェイを仮格納エリア4032、すなわち仮想ウェイとして扱う。
As described above, the virtual cache memory 403 is configured as an N-way, but the timing for determining a cache miss when executing a simulation differs depending on the configuration of the cache memory 401. That is, in the virtual cache memory generation process S1a, the number of ways in the cache memory 401 is handled as the storage area 4031, that is, the actual way, and the remaining ways are handled as the temporary storage area 4032, that is, the virtual way.
図8の例では、実ウェイが1、仮想ウェイがN-1となる。図9の例では、実ウェイが2、仮想ウェイがN-2となる。アクセスしたいデータが、仮想ウェイに入っていたとしても、実ウェイに入っていなければ、競合情報生成部604はキャッシュミスが発生したものとして扱う。上記の通り、仮想キャッシュメモリ403を構成することで、キャッシュメモリ401では観測することができない、キャッッシュミス発生タイミングでの、ICB間の相関性を検出する。仮想キャッシュメモリ403のキャッシュラインサイズ及び置換アルゴリズムは、キャッシュメモリ401と同様である。
In the example of FIG. 8, the real way is 1 and the virtual way is N-1. In the example of FIG. 9, the real way is 2 and the virtual way is N-2. Even if the data to be accessed is in the virtual way, if it is not in the real way, the contention information generation unit 604 treats that a cache miss has occurred. As described above, by configuring the virtual cache memory 403, the correlation between ICBs at the timing of occurrence of a cache miss that cannot be observed in the cache memory 401 is detected. The cache line size and replacement algorithm of the virtual cache memory 403 are the same as those of the cache memory 401.
<ICB取得処理S203>
ステップS203における命令アドレスが含まれるICBを求めるICB取得処理S203について補足する。
命令アドレスが含まれるICBを求めるためには、関数をどのようにICBへ分割するかを選択する必要がある。手法としては、図10に示す関数の先頭からICBのサイズで分割する方法と、図11に示す関数が含まれるキャッシュラインの先頭から分割する方法とがある。 <ICB acquisition process S203>
It supplements about ICB acquisition process S203 which calculates | requires ICB containing the instruction address in step S203.
In order to obtain the ICB including the instruction address, it is necessary to select how to divide the function into ICBs. As a technique, there are a method of dividing by the size of ICB from the top of the function shown in FIG. 10, and a method of dividing from the top of the cache line including the function shown in FIG.
ステップS203における命令アドレスが含まれるICBを求めるICB取得処理S203について補足する。
命令アドレスが含まれるICBを求めるためには、関数をどのようにICBへ分割するかを選択する必要がある。手法としては、図10に示す関数の先頭からICBのサイズで分割する方法と、図11に示す関数が含まれるキャッシュラインの先頭から分割する方法とがある。 <ICB acquisition process S203>
It supplements about ICB acquisition process S203 which calculates | requires ICB containing the instruction address in step S203.
In order to obtain the ICB including the instruction address, it is necessary to select how to divide the function into ICBs. As a technique, there are a method of dividing by the size of ICB from the top of the function shown in FIG. 10, and a method of dividing from the top of the cache line including the function shown in FIG.
図10及び図11は、関数Aと関数Bとが連続したメモリ領域に配置された場合の、セット数8のキャッシュメモリ上の配置状況を示している。関数Aはセット0からセット3に配置され、関数Bはセット3からセット7に配置されている。ある関数のICBを表現する際には、関数のラベルに、その関数におけるICBの通し番号を付加した形式を使用する。ここでは、関数のラベルA及びBに、その関数におけるICBの通し番号0,1,2,3が付加されている。
10 and 11 show an arrangement state on the cache memory with the number of sets 8 when the function A and the function B are arranged in a continuous memory area. Function A is arranged from set 0 to set 3, and function B is arranged from set 3 to set 7. When an ICB of a function is expressed, a format in which the ICB serial number of the function is added to the function label is used. Here, the ICB serial numbers 0, 1, 2, and 3 are added to the function labels A and B, respectively.
図10に示す手法では、関数の先頭からICBへ分割する。関数AはA0からA3までのように分割され、関数BはB0からB3のように分割される。このように、図10に示す手法では実際のキャッシュ配置は考慮せず、関数の先頭を基準に分割を行う。
In the method shown in FIG. 10, the function is divided into ICB from the beginning. The function A is divided as A0 to A3, and the function B is divided as B0 to B3. As described above, the method shown in FIG. 10 does not consider the actual cache arrangement and performs division based on the top of the function.
一方、図11に示す手法では、ICBへの分割は、実際のメモリ配置を考慮した上で、キャッシュライン単位で行う。関数Aのセット0からセット2の命令コードは、A0、A1、A2にそれぞれ分割される。関数Aのセット3のように、他の関数Bと共有している場合は、自分の関数に属する命令コードのみをICBとして分割する。つまり、A3の内容の内、前半分は関数Aの命令コードで、残りの半分は何も入っていないものとする。
また、関数Bのセット3は、キャッシュラインの先頭ではなく、真ん中から始まっている。このような場合であっても、関数Bの先頭からではなく、セット3のキャッシュラインの先頭からICBへの分割を実行する。つまり、B0の前半分は何も入っておらず、残りの半分に関数Bの命令コードが入っているものとする。
上記の通り、メモリ配置を考慮したICBの分割を実行することにより、実際のプログラム動作通りの、正確な競合キャッシュミス発生状況を記録することができる。そのため、本実施の形態では、図11に示す手法を採用する。 On the other hand, in the method shown in FIG. 11, the division into ICBs is performed in units of cache lines in consideration of the actual memory arrangement. The instruction codes of function A fromset 0 to set 2 are divided into A0, A1, and A2, respectively. In the case of sharing with another function B as in the set 3 of the function A, only the instruction code belonging to the own function is divided as an ICB. That is, it is assumed that the first half of the contents of A3 is the instruction code of the function A, and the remaining half contains nothing.
Further, theset 3 of the function B starts not from the beginning of the cache line but from the middle. Even in such a case, the division from the top of the cache line of set 3 to the ICB is executed instead of from the top of the function B. That is, it is assumed that the front half of B0 contains nothing and the other half contains the instruction code of function B.
As described above, by executing the ICB division in consideration of the memory arrangement, it is possible to record an accurate contention cache miss occurrence situation according to the actual program operation. Therefore, in the present embodiment, the method shown in FIG. 11 is adopted.
また、関数Bのセット3は、キャッシュラインの先頭ではなく、真ん中から始まっている。このような場合であっても、関数Bの先頭からではなく、セット3のキャッシュラインの先頭からICBへの分割を実行する。つまり、B0の前半分は何も入っておらず、残りの半分に関数Bの命令コードが入っているものとする。
上記の通り、メモリ配置を考慮したICBの分割を実行することにより、実際のプログラム動作通りの、正確な競合キャッシュミス発生状況を記録することができる。そのため、本実施の形態では、図11に示す手法を採用する。 On the other hand, in the method shown in FIG. 11, the division into ICBs is performed in units of cache lines in consideration of the actual memory arrangement. The instruction codes of function A from
Further, the
As described above, by executing the ICB division in consideration of the memory arrangement, it is possible to record an accurate contention cache miss occurrence situation according to the actual program operation. Therefore, in the present embodiment, the method shown in FIG. 11 is adopted.
<競合情報登録処理S205>
ICBの組み合わせ情報を競合情報70に登録する競合情報登録処理S205について図12から図14を用いて説明する。
ここでは、命令トレース30より、図3のようなICBの実行系列303が得られている場合を考える。
図12は、1回目の呼出命令コード4033であるC0を参照したタイミングでの、実ウェイ数1の仮想キャッシュメモリ403の内容を示している。1回目のC0を参照したタイミングでは、実ウェイにC0は無いため、キャッシュミスが発生する。仮想ウェイにもC0は存在しないため、1回目のC0への参照は初期参照ミスであることが分かる。初期参照ミスの場合、競合情報70への情報の記録は行わない。 <Competitive information registration process S205>
The competition information registration process S205 for registering the ICB combination information in thecompetition information 70 will be described with reference to FIGS.
Here, a case is considered in which an execution sequence 303 of ICB as shown in FIG.
FIG. 12 shows the contents of the virtual cache memory 403 with the number ofactual ways 1 at the timing when C0 which is the first call instruction code 4033 is referred to. At the timing referring to C0 for the first time, since there is no C0 in the real way, a cache miss occurs. Since C0 does not exist in the virtual way, it is understood that the first reference to C0 is an initial reference miss. In the case of an initial reference mistake, information is not recorded in the conflict information 70.
ICBの組み合わせ情報を競合情報70に登録する競合情報登録処理S205について図12から図14を用いて説明する。
ここでは、命令トレース30より、図3のようなICBの実行系列303が得られている場合を考える。
図12は、1回目の呼出命令コード4033であるC0を参照したタイミングでの、実ウェイ数1の仮想キャッシュメモリ403の内容を示している。1回目のC0を参照したタイミングでは、実ウェイにC0は無いため、キャッシュミスが発生する。仮想ウェイにもC0は存在しないため、1回目のC0への参照は初期参照ミスであることが分かる。初期参照ミスの場合、競合情報70への情報の記録は行わない。 <Competitive information registration process S205>
The competition information registration process S205 for registering the ICB combination information in the
Here, a case is considered in which an execution sequence 303 of ICB as shown in FIG.
FIG. 12 shows the contents of the virtual cache memory 403 with the number of
図13は、2回目の呼出命令コード4033であるB0を参照したタイミングでの、実ウェイ数1の仮想キャッシュメモリの内容を示している。2回目のB0を参照したタイミングでは、実ウェイにB0は無いため、キャッシュミスが発生する。一方、仮想ウェイにはB0が存在するため、2回目のB0への参照は競合キャッシュミス、すなわち競合が発生したとして扱う。仮想ウェイに存在する呼出命令コード4033であるB0より左側にあるすべてのICBと呼出命令コード4033であるB0とを競合ICB702として、競合情報70に登録する。すなわち、シミュレータ部605は、仮想ウェイに存在する呼出命令コード4033であるB0より前のエリアにある全てのICBとB0とを競合ICB702として、競合情報70に登録する。
FIG. 13 shows the contents of the virtual cache memory with the number of actual ways 1 at the timing when B0 which is the second call instruction code 4033 is referred to. At the timing of referring to B0 for the second time, since there is no B0 in the real way, a cache miss occurs. On the other hand, since B0 exists in the virtual way, the second reference to B0 is treated as a conflict cache miss, that is, a conflict has occurred. All ICBs on the left side of B0 which is the call instruction code 4033 existing in the virtual way and B0 which is the call instruction code 4033 are registered in the conflict information 70 as the conflict ICB 702. That is, the simulator unit 605 registers all ICBs and B0 in the area before B0 which is the call instruction code 4033 existing in the virtual way as the conflicting ICB 702 in the conflict information 70.
競合情報生成部604は、まずB0に対応する競合ミスデータレコード71に、B0及びC0の組み合わせによる自ICBの競合キャッシュミスとして記録する。競合情報生成部604は、次に競合ICBであるC0の競合ミスデータレコード71に、B0及びC0の組み合わせによる他ICBの競合キャッシュミスとして記録する。競合ICBが他にもあった場合は、上記C0と同様に処理を実行する。2回目のB0参照後の競合情報70は図14のようになる。上記の通り、競合情報70に記録する際には、自ICB参照時に発生する競合キャッシュミスだけでなく、他ICBに影響して発生する競合キャッシュミスの回数も記録する。
The contention information generation unit 604 first records the contention miss data record 71 corresponding to B0 as a contention cache miss of its own ICB by a combination of B0 and C0. The contention information generation unit 604 then records the contention miss data record 71 of C0, which is the contention ICB, as a contention cache miss of another ICB by a combination of B0 and C0. If there are other competing ICBs, the same processing as in C0 is executed. The contention information 70 after the second B0 reference is as shown in FIG. As described above, when recording the contention information 70, not only the contention cache miss that occurs when referring to the own ICB but also the number of contention cache misses that occur due to the influence of other ICBs are recorded.
図15から図17を用いて、競合情報登録処理S205の動作について説明する。
図15を用いて、競合情報登録処理S205の全体処理フローについて説明する。
ステップS2050において、競合情報生成部604は、自ICBを競合情報70に登録する。
ステップS2051において、競合情報生成部604は、競合ICBの内、自ICB以外の他ICBを競合情報70に登録する。 The operation of the conflict information registration process S205 will be described with reference to FIGS.
The overall processing flow of the conflict information registration process S205 will be described with reference to FIG.
In step S2050, the competitioninformation generation unit 604 registers the own ICB in the competition information 70.
In step S <b> 2051, the conflictinformation generation unit 604 registers ICBs other than the own ICB in the conflict information 70 among the competing ICBs.
図15を用いて、競合情報登録処理S205の全体処理フローについて説明する。
ステップS2050において、競合情報生成部604は、自ICBを競合情報70に登録する。
ステップS2051において、競合情報生成部604は、競合ICBの内、自ICB以外の他ICBを競合情報70に登録する。 The operation of the conflict information registration process S205 will be described with reference to FIGS.
The overall processing flow of the conflict information registration process S205 will be described with reference to FIG.
In step S2050, the competition
In step S <b> 2051, the conflict
<ステップS2050自ICBの登録処理の詳細説明>
図16を用いて、図15のステップS2050の詳細処理フローについて説明する。
ステップS205000において、競合情報生成部604は、自ICBが競合情報70に存在するか判断する。競合情報生成部604は、存在する場合は、ステップS205001に遷移し、存在しない場合はステップS205002に遷移する。
ステップS205001において、競合情報生成部604は、自ICBの競合ミスデータレコード71を取り出し、ステップS205005に遷移する。 <Detailed Description of Step S2050 Own ICB Registration Process>
The detailed processing flow of step S2050 in FIG. 15 will be described with reference to FIG.
In step S205000, the competitioninformation generation unit 604 determines whether the own ICB exists in the competition information 70. The competition information generation unit 604 transitions to step S205001 if it exists, and transitions to step S205002 if it does not exist.
In step S205001, the contentioninformation generation unit 604 extracts the contention miss data record 71 of the own ICB, and transitions to step S205005.
図16を用いて、図15のステップS2050の詳細処理フローについて説明する。
ステップS205000において、競合情報生成部604は、自ICBが競合情報70に存在するか判断する。競合情報生成部604は、存在する場合は、ステップS205001に遷移し、存在しない場合はステップS205002に遷移する。
ステップS205001において、競合情報生成部604は、自ICBの競合ミスデータレコード71を取り出し、ステップS205005に遷移する。 <Detailed Description of Step S2050 Own ICB Registration Process>
The detailed processing flow of step S2050 in FIG. 15 will be described with reference to FIG.
In step S205000, the competition
In step S205001, the contention
ステップS205002では、競合情報生成部604は、自ICBの競合ミスデータレコード71を生成し、ステップS205003に遷移する。
ステップS205003において、ICB名72に自ICB名を設定し、ステップS205004に遷移する。
ステップS205004で、自ICBとしての合計ミス数73を1に、他ICBとしての合計ミス数74を0に初期化し、ステップS205007に遷移する。 In step S205002, the conflictinformation generation unit 604 generates a conflict miss data record 71 of its own ICB, and the process proceeds to step S205003.
In step S205003, the self ICB name is set in theICB name 72, and the process proceeds to step S205004.
In step S205004, the total number ofmistakes 73 as the own ICB is initialized to 1, and the total number of mistakes 74 as another ICB is initialized to 0, and the process proceeds to step S205007.
ステップS205003において、ICB名72に自ICB名を設定し、ステップS205004に遷移する。
ステップS205004で、自ICBとしての合計ミス数73を1に、他ICBとしての合計ミス数74を0に初期化し、ステップS205007に遷移する。 In step S205002, the conflict
In step S205003, the self ICB name is set in the
In step S205004, the total number of
ステップS205005において、競合情報生成部604は、登録する競合ICBの組み合わせの記録、すなわち競合ミスエントリ75が既に存在するか確認する。競合情報生成部604は、存在する場合は、ステップS205006に遷移し、存在しない場合はステップS205007に遷移する。
ステップS205006で、競合情報生成部604は、自ICBとしての合計ミス数73の値を1増加させ、ステップS205011に遷移する。 In step S205005, the conflictinformation generation unit 604 confirms whether the record of the combination of conflict ICBs to be registered, that is, the conflict miss entry 75 already exists. The competition information generation unit 604 transitions to step S205006 if it exists, and transitions to step S205007 if it does not exist.
In step S205006, the contentioninformation generation unit 604 increments the value of the total number of mistakes 73 as its own ICB by 1, and proceeds to step S205011.
ステップS205006で、競合情報生成部604は、自ICBとしての合計ミス数73の値を1増加させ、ステップS205011に遷移する。 In step S205005, the conflict
In step S205006, the contention
ステップS205007において、競合情報生成部604は、競合ミスエントリ75を生成後、生成した競合ミスエントリ75を競合ミスデータレコード71に追加し、ステップS205008に遷移する。
ステップS205008において、競合情報生成部604は、処理対象のキャッシュミスに対して、新しいミスID76を割り振り、ステップS205009に遷移する。
ステップS205009において、競合情報生成部604は、処理対象のキャッシュミスの競合ICB数を、競合ICB数77に設定し、ステップS205010に遷移する。
ステップS205010で、競合情報生成部604は、競合ICBごとのミス数78において、競合ICBの値を0に初期化し、ステップS205011に遷移する。 In step S205007, the conflictinformation generation unit 604 generates the conflict miss entry 75, adds the generated conflict miss entry 75 to the conflict miss data record 71, and transitions to step S205008.
In step S205008, the conflictinformation generation unit 604 allocates a new miss ID 76 for the cache miss to be processed, and the process proceeds to step S20509.
In step S20509, the conflictinformation generation unit 604 sets the conflicting ICB number of the cache miss to be processed to the conflicting ICB number 77, and the processing transitions to step S205010.
In step S205010, the contentioninformation generation unit 604 initializes the value of the contention ICB to 0 in the number of misses 78 for each contention ICB, and transitions to step S205011.
ステップS205008において、競合情報生成部604は、処理対象のキャッシュミスに対して、新しいミスID76を割り振り、ステップS205009に遷移する。
ステップS205009において、競合情報生成部604は、処理対象のキャッシュミスの競合ICB数を、競合ICB数77に設定し、ステップS205010に遷移する。
ステップS205010で、競合情報生成部604は、競合ICBごとのミス数78において、競合ICBの値を0に初期化し、ステップS205011に遷移する。 In step S205007, the conflict
In step S205008, the conflict
In step S20509, the conflict
In step S205010, the contention
ステップS205011において、競合情報生成部604は、競合ICBごとのミス数78において、自ICBの値を1増加させ、処理を終了する。
In step S205011, the conflict information generation unit 604 increments the value of its own ICB by 1 in the number of misses 78 for each competing ICB, and ends the processing.
<ステップS2051他ICBの登録処理の詳細説明>
図17を用いて、図15のステップS2051の詳細処理フローについて説明する。
ステップS205100において、競合情報生成部604は、未処理の競合ICBが存在するか判断する。競合情報生成部604は、存在する場合は、ステップS205101に遷移し、存在しない場合は終了する。 <Detailed Description of Step S2051 Other ICB Registration Process>
The detailed processing flow of step S2051 in FIG. 15 will be described with reference to FIG.
In step S205100, the conflictinformation generation unit 604 determines whether there is an unprocessed conflict ICB. The competition information generation unit 604 transitions to step S205101 if it exists, and ends if it does not exist.
図17を用いて、図15のステップS2051の詳細処理フローについて説明する。
ステップS205100において、競合情報生成部604は、未処理の競合ICBが存在するか判断する。競合情報生成部604は、存在する場合は、ステップS205101に遷移し、存在しない場合は終了する。 <Detailed Description of Step S2051 Other ICB Registration Process>
The detailed processing flow of step S2051 in FIG. 15 will be described with reference to FIG.
In step S205100, the conflict
ステップS205101において、競合情報生成部604は、未処理の競合ICBから1つ選択し、ステップS205102に遷移する。
ステップS205102において、競合情報生成部604は、処理対象の競合ICBが競合情報70に存在するか判断する。競合情報生成部604は、存在すれば、ステップS205103に遷移し、存在しなければ、ステップS205104に遷移する。 In step S205101, the competitioninformation generation unit 604 selects one of the unprocessed competition ICBs, and transitions to step S205102.
In step S <b> 205102, the conflictinformation generation unit 604 determines whether a conflict ICB to be processed exists in the conflict information 70. The competition information generation unit 604 transitions to step S205103 if it exists, and transitions to step S205104 if it does not exist.
ステップS205102において、競合情報生成部604は、処理対象の競合ICBが競合情報70に存在するか判断する。競合情報生成部604は、存在すれば、ステップS205103に遷移し、存在しなければ、ステップS205104に遷移する。 In step S205101, the competition
In step S <b> 205102, the conflict
ステップS205103において、競合情報生成部604は、処理対象の競合ICBの競合ミスデータレコード71を取り出し、ステップS205107に遷移する。
In step S205103, the conflict information generation unit 604 takes out the conflict miss data record 71 of the conflict ICB to be processed, and proceeds to step S205107.
ステップS205104において、競合情報生成部604は、処理対象の競合ICBの競合ミスデータレコード71を生成し、ステップS205105に遷移する。
ステップS205105において、競合情報生成部604は、ICB名72に処理対象の競合ICB名を設定し、ステップS205106に遷移する。
ステップS205106において、競合情報生成部604は、自ICBとしての合計ミス数73を0に、他ICBとしての合計ミス数74を1に初期化し、ステップS205109に遷移する。 In step S205104, the conflictinformation generation unit 604 generates a conflict miss data record 71 of the target conflict ICB, and the process proceeds to step S205105.
In step S205105, the conflictinformation generation unit 604 sets the target ICB name to be processed in the ICB name 72, and the process proceeds to step S205106.
In step S205106, the contentioninformation generation unit 604 initializes the total number of mistakes 73 as its own ICB to 0 and the total number of mistakes 74 as another ICB to 1, and proceeds to step S205109.
ステップS205105において、競合情報生成部604は、ICB名72に処理対象の競合ICB名を設定し、ステップS205106に遷移する。
ステップS205106において、競合情報生成部604は、自ICBとしての合計ミス数73を0に、他ICBとしての合計ミス数74を1に初期化し、ステップS205109に遷移する。 In step S205104, the conflict
In step S205105, the conflict
In step S205106, the contention
ステップS205107において、競合情報生成部604は、登録する競合ICBの組み合わせの記録、すなわち、競合ミスエントリ75が既に存在するか確認する。存在する場合は、ステップS205108に遷移し、存在しない場合はステップS205109に遷移する。
ステップS205108において、競合情報生成部604は、他ICBとしての合計ミス数74の値を1増加させ、ステップS205112に遷移する。 In step S205107, the conflictinformation generation unit 604 checks whether a record of the combination of conflict ICBs to be registered, that is, the conflict miss entry 75 already exists. When it exists, it changes to step S205108, and when it does not exist, it changes to step S205109.
In step S205108, the conflictinformation generation unit 604 increments the value of the total number of mistakes 74 as the other ICB by 1, and the process proceeds to step S205112.
ステップS205108において、競合情報生成部604は、他ICBとしての合計ミス数74の値を1増加させ、ステップS205112に遷移する。 In step S205107, the conflict
In step S205108, the conflict
ステップS205109において、競合情報生成部604は、競合ミスエントリ75を生成後、生成した競合ミスエントリ75を競合ミスデータレコード71に追加し、ステップS205110に遷移する。
ステップS205110において、競合情報生成部604は、処理対象のキャッシュミスに対して、新しいミスID76を割り振り、ステップS205111に遷移する。
ステップS205111において、競合情報生成部604は、処理対象のキャッシュミスの競合ICB数を、競合ICB数77に設定し、ステップS205112に遷移する。
ステップS205112において、競合情報生成部604は、競合ICBごとのミス数78において、競合ICBの値を0に初期化し、ステップS205113に遷移する。 In step S205109, after generating theconflict miss entry 75, the conflict information generation unit 604 adds the generated conflict miss entry 75 to the conflict miss data record 71, and proceeds to step S205110.
In step S205110, the conflictinformation generation unit 604 allocates a new miss ID 76 for the cache miss to be processed, and the process proceeds to step S205111.
In step S205111, the conflictinformation generation unit 604 sets the conflicting ICB number of the cache miss to be processed as the conflicting ICB number 77, and the processing transitions to step S205112.
In step S205112, the contentioninformation generation unit 604 initializes the value of the contention ICB to 0 in the number of misses 78 for each contention ICB, and proceeds to step S205113.
ステップS205110において、競合情報生成部604は、処理対象のキャッシュミスに対して、新しいミスID76を割り振り、ステップS205111に遷移する。
ステップS205111において、競合情報生成部604は、処理対象のキャッシュミスの競合ICB数を、競合ICB数77に設定し、ステップS205112に遷移する。
ステップS205112において、競合情報生成部604は、競合ICBごとのミス数78において、競合ICBの値を0に初期化し、ステップS205113に遷移する。 In step S205109, after generating the
In step S205110, the conflict
In step S205111, the conflict
In step S205112, the contention
ステップS205113において、競合情報生成部604は、競合ICBごとのミス数78において、自ICBの値を1増加させ、ステップS205100に戻る。
競合情報生成部604は、上記の処理をステップS205100が偽、すなわちステップS205100においてNOになるまで続ける。 In step S205113, the conflictinformation generation unit 604 increments the value of its own ICB by 1 in the number of misses 78 for each competing ICB, and returns to step S205100.
The conflictinformation generation unit 604 continues the above processing until step S205100 is false, that is, NO in step S205100.
競合情報生成部604は、上記の処理をステップS205100が偽、すなわちステップS205100においてNOになるまで続ける。 In step S205113, the conflict
The conflict
<ステップS206キャッシュ内容の更新処理の詳細説明>
次に、図7のステップS206における、キャッシュ内容の更新処理について図18及び図19を用いて説明する。
ステップS206では、仮想キャッシュシミュレータ部60は、キャッシュ構成情報40に設定された置換アルゴリズムに基づいて、仮想キャッシュメモリ403におけるICBの置換を実行する。仮想キャッシュメモリ403では、置換対象となるICBは最も右側に配置される。LRU方式では、数字の小さいウェイに存在するICBほど、最近にアクセスされたことを示す。 <Detailed Description of Step S206 Cache Content Update Processing>
Next, the cache content update processing in step S206 of FIG. 7 will be described with reference to FIGS.
In step S <b> 206, the virtualcache simulator unit 60 performs ICB replacement in the virtual cache memory 403 based on the replacement algorithm set in the cache configuration information 40. In the virtual cache memory 403, the ICB to be replaced is arranged on the rightmost side. In the LRU method, an ICB existing in a way with a smaller number indicates that access has been made more recently.
次に、図7のステップS206における、キャッシュ内容の更新処理について図18及び図19を用いて説明する。
ステップS206では、仮想キャッシュシミュレータ部60は、キャッシュ構成情報40に設定された置換アルゴリズムに基づいて、仮想キャッシュメモリ403におけるICBの置換を実行する。仮想キャッシュメモリ403では、置換対象となるICBは最も右側に配置される。LRU方式では、数字の小さいウェイに存在するICBほど、最近にアクセスされたことを示す。 <Detailed Description of Step S206 Cache Content Update Processing>
Next, the cache content update processing in step S206 of FIG. 7 will be described with reference to FIGS.
In step S <b> 206, the virtual
図18及び図19ではLRU方式でキャッシュの内容を置き換える様子を示している。
図18では、C0の参照時にC0が仮想キャッシュメモリ403上に存在しないため、仮想キャッシュシミュレータ部60は、仮想キャッシュメモリ403上に存在する全てのICBを右に1ウェイ分ずらし、ウェイ0、すなわち実ウェイ0にC0を保存する。言い換えると、仮想キャッシュシミュレータ部60は、仮想キャッシュメモリ403上に存在する全てのICBを後ろに1エリア分ずらし、仮想キャッシュメモリ403の先頭の実ウェイにC0を保存する。 18 and 19 show how the contents of the cache are replaced by the LRU method.
In FIG. 18, since C0 does not exist in the virtual cache memory 403 when C0 is referred to, the virtualcache simulator unit 60 shifts all ICBs existing in the virtual cache memory 403 to the right by one way, Save C0 in real way 0. In other words, the virtual cache simulator unit 60 shifts all ICBs existing on the virtual cache memory 403 backward by one area, and stores C0 in the top real way of the virtual cache memory 403.
図18では、C0の参照時にC0が仮想キャッシュメモリ403上に存在しないため、仮想キャッシュシミュレータ部60は、仮想キャッシュメモリ403上に存在する全てのICBを右に1ウェイ分ずらし、ウェイ0、すなわち実ウェイ0にC0を保存する。言い換えると、仮想キャッシュシミュレータ部60は、仮想キャッシュメモリ403上に存在する全てのICBを後ろに1エリア分ずらし、仮想キャッシュメモリ403の先頭の実ウェイにC0を保存する。 18 and 19 show how the contents of the cache are replaced by the LRU method.
In FIG. 18, since C0 does not exist in the virtual cache memory 403 when C0 is referred to, the virtual
図19では、B0の参照時にB0が仮想キャッシュメモリ403上に存在するため、仮想キャッシュシミュレータ部60は、仮想ウェイ1に存在したB0を実ウェイ0に移動し、B0より左側にあった全てのICBを右に1ウェイ分ずらしている。図19では、B0より左側にあったICBはC0のみであるため、仮想キャッシュシミュレータ部60は、C0を右に1ウェイ分ずらしている。言い換えると、仮想キャッシュシミュレータ部60は、競合ICB702を取得した後に、呼出命令コード4033であるB0より前のエリアに格納されている全てのICBをそれぞれ1つ後ろのエリアに移動する。そして、仮想キャッシュシミュレータ部60は、B0を仮想キャッシュメモリ403の先頭の実ウェイに格納する。
In FIG. 19, since B0 exists on the virtual cache memory 403 when referring to B0, the virtual cache simulator 60 moves B0 existing on the virtual way 1 to the real way 0, and all the left side of B0 ICB is shifted one way to the right. In FIG. 19, since the ICB on the left side of B0 is only C0, the virtual cache simulator unit 60 shifts C0 to the right by one way. In other words, after acquiring the competing ICB 702, the virtual cache simulator unit 60 moves all ICBs stored in the area before B0, which is the call instruction code 4033, to the next area. Then, the virtual cache simulator unit 60 stores B0 in the top real way of the virtual cache memory 403.
キャッシュメモリ401で置換を行う場合、ウェイ間の置換は起こらず、置換対象を表すビットを有効にする処理を行うが、仮想キャッシュメモリ403では、あるICBの2回の参照の間に参照されたICBを検出する必要があるため、このような更新処理を行う。
When replacement is performed in the cache memory 401, replacement between ways does not occur, and processing for validating a bit representing a replacement target is performed. However, in the virtual cache memory 403, a reference was made between two references of a certain ICB. Since it is necessary to detect the ICB, such an update process is performed.
<配置位置決定処理S3>
図20は、本実施の形態に係る配置位置決定処理S3の動作を示すフロー図である。
配置位置決定部80が、競合情報70に基づいて、関数配置情報90を出力する。
まず、ステップS300において、配置位置決定部80は、関数を配置する優先順位を決定する。配置位置決定部80は、ルール131に基づいて、関数を配置する順番を決定する。 <Arrangement position determination process S3>
FIG. 20 is a flowchart showing the operation of the arrangement position determination process S3 according to the present embodiment.
The arrangementposition determination unit 80 outputs function arrangement information 90 based on the competition information 70.
First, in step S300, the arrangementposition determination unit 80 determines the priority order for arranging the functions. The arrangement position determination unit 80 determines the order in which the functions are arranged based on the rule 131.
図20は、本実施の形態に係る配置位置決定処理S3の動作を示すフロー図である。
配置位置決定部80が、競合情報70に基づいて、関数配置情報90を出力する。
まず、ステップS300において、配置位置決定部80は、関数を配置する優先順位を決定する。配置位置決定部80は、ルール131に基づいて、関数を配置する順番を決定する。 <Arrangement position determination process S3>
FIG. 20 is a flowchart showing the operation of the arrangement position determination process S3 according to the present embodiment.
The arrangement
First, in step S300, the arrangement
図21を用いて、ルール131を説明する。図21は、ルール131の一例であり、ルール131は図21以外でもよい。
ルール131には、ルール1からルール4まで設定されている。配置位置決定部80は、数字の小さいルールから適用し、複数の関数で同じ値となる場合は、次のルールを適用する。 Therule 131 will be described with reference to FIG. FIG. 21 is an example of the rule 131, and the rule 131 may be other than FIG. 21.
In therule 131, rules 1 to 4 are set. The arrangement position determination unit 80 applies the rule from a smaller number, and applies the following rule when the same value is obtained by a plurality of functions.
ルール131には、ルール1からルール4まで設定されている。配置位置決定部80は、数字の小さいルールから適用し、複数の関数で同じ値となる場合は、次のルールを適用する。 The
In the
まず、配置位置決定部80は、ルール1に従って、複数の関数の各関数について、関数に属する、各ICBの他ICBとしての合計ミス数74の総和が大きい順に優先順位をつける。競合ミスを起こすかどうかは、既配置の関数との関係で決まるため、配置位置決定部80は、他ICBに影響を及ぼす可能性の高い関数から配置していく。
次に、配置位置決定部80は、ルール1で同じ値となった関数同士では、ルール2を適用し、関数に属する、各ICBの競合ICBの種類数で優先順位をつける。ルール2は、他ICBで発生する競合ミス数が同じであっても、より多くの他ICBに対して影響を及ぼす関数を、優先的に配置するために適用される。
配置位置決定部80は、ルール2でも優劣がつかない場合、ルール3を適用し、関数に属する、各ICBの自ICBとしての合計ミス数73の総和で判断する。最後に、配置位置決定部80は、ルール4の関数のサイズで優劣をつける。ルール4でも優先順位が決まらない場合は、配置位置決定部80は、任意で配置する関数を選択する。 First, the arrangementposition determination unit 80 gives priority to each function of a plurality of functions according to rule 1 in descending order of the sum of the total number of mistakes 74 as other ICBs belonging to each ICB. Whether or not to cause a contention error is determined by the relationship with the already-arranged function, and therefore the arrangement position determination unit 80 arranges from a function that is highly likely to affect other ICBs.
Next, the arrangementposition determination unit 80 applies rule 2 between functions having the same value in rule 1 and assigns priorities according to the number of types of competitive ICBs of each ICB belonging to the function. Rule 2 is applied in order to preferentially arrange a function that affects more ICBs even if the number of contention errors occurring in the other ICBs is the same.
If neitherrule 2 nor rule 2 is superior or inferior, the placement position determination unit 80 applies rule 3 and determines the total number of mistakes 73 as the own ICB of each ICB belonging to the function. Finally, the arrangement position determining unit 80 gives priority to the size of the function of the rule 4. If the priority order is not determined by rule 4, the arrangement position determination unit 80 selects a function to be arbitrarily arranged.
次に、配置位置決定部80は、ルール1で同じ値となった関数同士では、ルール2を適用し、関数に属する、各ICBの競合ICBの種類数で優先順位をつける。ルール2は、他ICBで発生する競合ミス数が同じであっても、より多くの他ICBに対して影響を及ぼす関数を、優先的に配置するために適用される。
配置位置決定部80は、ルール2でも優劣がつかない場合、ルール3を適用し、関数に属する、各ICBの自ICBとしての合計ミス数73の総和で判断する。最後に、配置位置決定部80は、ルール4の関数のサイズで優劣をつける。ルール4でも優先順位が決まらない場合は、配置位置決定部80は、任意で配置する関数を選択する。 First, the arrangement
Next, the arrangement
If neither
ステップS301において、配置位置決定部80は、全関数を配置したかどうか判断し、配置していなければステップS302に遷移し、配置していればステップS305に遷移する。
ステップS302において、配置位置決定部80は、未配置の関数の内、優先順位の高い関数を1つ取り出す。
ステップS303において、取り出した処理対象の関数をセット0から最後のセットまで動かし、全ての配置方法において、既配置の関数と引き起こす競合キャッシュミス発生回数を計算し、最小のミス数となる場所を求める。ステップS303の詳細は後述する。
ステップS304において、配置位置決定部80は、最小の競合キャッシュミス発生回数を示す場所に配置を決定し、ステップS301に遷移する。上記の処理をステップS301が真になるまで、すなわちステップS301でYESとなるまで続ける。
ステップS305において、配置位置決定部80は、上記の配置結果をまとめ、関数配置情報90を出力する。 In step S301, the arrangementposition determination unit 80 determines whether or not all functions have been arranged, and if not arranged, the process proceeds to step S302, and if arranged, the process proceeds to step S305.
In step S <b> 302, the arrangementposition determining unit 80 extracts one function having a higher priority from unallocated functions.
In step S303, the fetched processing target function is moved fromset 0 to the last set, and in all placement methods, the number of contention cache miss occurrences caused by the already placed function is calculated, and the place where the minimum number of misses is obtained is obtained. . Details of step S303 will be described later.
In step S304, the arrangementposition determining unit 80 determines an arrangement at a location indicating the minimum number of contention cache miss occurrences, and transitions to step S301. The above processing is continued until step S301 becomes true, that is, until YES is determined in step S301.
In step S305, the arrangementposition determination unit 80 summarizes the above arrangement results and outputs function arrangement information 90.
ステップS302において、配置位置決定部80は、未配置の関数の内、優先順位の高い関数を1つ取り出す。
ステップS303において、取り出した処理対象の関数をセット0から最後のセットまで動かし、全ての配置方法において、既配置の関数と引き起こす競合キャッシュミス発生回数を計算し、最小のミス数となる場所を求める。ステップS303の詳細は後述する。
ステップS304において、配置位置決定部80は、最小の競合キャッシュミス発生回数を示す場所に配置を決定し、ステップS301に遷移する。上記の処理をステップS301が真になるまで、すなわちステップS301でYESとなるまで続ける。
ステップS305において、配置位置決定部80は、上記の配置結果をまとめ、関数配置情報90を出力する。 In step S301, the arrangement
In step S <b> 302, the arrangement
In step S303, the fetched processing target function is moved from
In step S304, the arrangement
In step S305, the arrangement
<ステップS303既配置関数との競合ミス数の計算処理>
図22を用いて、ステップS303の既配置関数とのミス数の計算処理について説明する。
ステップS30300において、配置位置決定部80は、配置対象の関数である配置対象関数をまだ配置していない場所にセットし、ステップS30301に遷移する。
ステップS30301において、配置位置決定部80は、ミス数を格納する一時変数を0に初期化し、ステップS30302に遷移する。
ステップS30302において、配置位置決定部80は、配置対象関数に含まれるICBの内、まだキャッシュミス数を計算していないICBを取り出し、ステップS30303に遷移する。 <Step S303: Computation processing for the number of contention errors with the already placed function>
With reference to FIG. 22, the calculation processing of the number of mistakes with the already arranged function in step S303 will be described.
In step S30300, the arrangementposition determining unit 80 sets an arrangement target function that is a function to be arranged in a place where it has not yet been arranged, and the process proceeds to step S30301.
In step S30301, the arrangementposition determining unit 80 initializes a temporary variable for storing the number of misses to 0, and proceeds to step S30302.
In step S30302, the arrangementposition determination unit 80 extracts ICBs for which the number of cache misses has not yet been calculated from the ICBs included in the arrangement target function, and proceeds to step S30303.
図22を用いて、ステップS303の既配置関数とのミス数の計算処理について説明する。
ステップS30300において、配置位置決定部80は、配置対象の関数である配置対象関数をまだ配置していない場所にセットし、ステップS30301に遷移する。
ステップS30301において、配置位置決定部80は、ミス数を格納する一時変数を0に初期化し、ステップS30302に遷移する。
ステップS30302において、配置位置決定部80は、配置対象関数に含まれるICBの内、まだキャッシュミス数を計算していないICBを取り出し、ステップS30303に遷移する。 <Step S303: Computation processing for the number of contention errors with the already placed function>
With reference to FIG. 22, the calculation processing of the number of mistakes with the already arranged function in step S303 will be described.
In step S30300, the arrangement
In step S30301, the arrangement
In step S30302, the arrangement
ステップS30303で、取り出した処理対象のICBが競合情報70に存在するか調べ、存在すればステップS30304に遷移し、存在しなければステップS30310に遷移する。
ステップS30304で、配置位置決定部80は、取り出した処理対象のICBの競合ミスデータレコード71を取り出し、ステップS30305に遷移する。
ステップS30305で、配置位置決定部80は、未調査の競合ミスエントリ75を1つ取り出し、ステップS30306に遷移する。
ステップS30306で、配置位置決定部80は、競合ミスエントリ75に含まれる競合ICBの内、既配置の競合ICB数を調べ、ステップS30307に遷移する。 In step S30303, it is checked whether the extracted ICB to be processed exists in thecompetition information 70. If it exists, the process proceeds to step S30304, and if not, the process proceeds to step S30310.
In step S30304, the arrangementposition determination unit 80 extracts the contention error data record 71 of the extracted processing target ICB, and proceeds to step S30305.
In step S30305, the arrangementposition determining unit 80 extracts one unexamined conflict miss entry 75, and proceeds to step S30306.
In step S30306, the arrangementposition determining unit 80 checks the number of competing ICBs already arranged among the competing ICBs included in the conflict miss entry 75, and proceeds to step S30307.
ステップS30304で、配置位置決定部80は、取り出した処理対象のICBの競合ミスデータレコード71を取り出し、ステップS30305に遷移する。
ステップS30305で、配置位置決定部80は、未調査の競合ミスエントリ75を1つ取り出し、ステップS30306に遷移する。
ステップS30306で、配置位置決定部80は、競合ミスエントリ75に含まれる競合ICBの内、既配置の競合ICB数を調べ、ステップS30307に遷移する。 In step S30303, it is checked whether the extracted ICB to be processed exists in the
In step S30304, the arrangement
In step S30305, the arrangement
In step S30306, the arrangement
ステップS30307で、配置位置決定部80は、既配置の競合ICB数+1が、キャッシュ構成情報40に記述されたウェイ数より大きい、すなわちキャッシュミスが発生する場合、ステップS30308に遷移する。配置位置決定部80は、既配置の競合ICB数+1が、キャッシュ構成情報40に記述されたウェイ数以下である、すなわちキャッシュミスが発生しない場合、ステップS30309に遷移する。
In step S30307, the arrangement position determination unit 80 transitions to step S30308 when the number of already arranged competitive ICBs + 1 is larger than the number of ways described in the cache configuration information 40, that is, when a cache miss occurs. The arrangement position determination unit 80 transitions to step S30309 when the number of already arranged competing ICBs + 1 is equal to or less than the number of ways described in the cache configuration information 40, that is, no cache miss occurs.
ステップS30308で、配置位置決定部80は、競合ミスエントリ75に含まれる競合ICBごとのミス数78を合計し、ミス数の一時変数に加算し、ステップS30309に遷移する。
ステップS30309で、配置位置決定部80は、処理対象のICBに含まれる全ての競合ミスエントリ75を調べたか判断する。配置位置決定部80は、全て調べている場合、ステップS30310に遷移し、調べていない競合ミスエントリ75がある場合はステップS30305に戻る。 In step S30308, the arrangementposition determining unit 80 totals the number of misses 78 for each competing ICB included in the contention miss entry 75, adds it to the temporary variable for the number of misses, and proceeds to step S30309.
In step S30309, the arrangementposition determination unit 80 determines whether all the contention miss entries 75 included in the processing target ICB have been checked. The arrangement position determination unit 80 transitions to step S30310 when all are checked, and returns to step S30305 when there is a contention miss entry 75 that is not checked.
ステップS30309で、配置位置決定部80は、処理対象のICBに含まれる全ての競合ミスエントリ75を調べたか判断する。配置位置決定部80は、全て調べている場合、ステップS30310に遷移し、調べていない競合ミスエントリ75がある場合はステップS30305に戻る。 In step S30308, the arrangement
In step S30309, the arrangement
ステップS30310で、配置位置決定部80は、配置対象関数に含まれる全てのICBを調べたかどうか判断する。配置位置決定部80は、調べた場合、ステップS30311に遷移し、そうでない場合、ステップS30302に戻る。
ステップS30311で、配置位置決定部80は、ミス数の一時変数の値が、現在の最小ミス数より小さい場合、ステップS30312に遷移し、そうでない場合、ステップS30313に遷移する。
ステップS30312で、配置位置決定部80は、最小ミス数と最小配置を更新し、ステップS30313に遷移する。
ステップS30313で、配置位置決定部80は、配置対象関数において、全ての配置を試したか判断し、試した場合は終了し、そうでない場合はステップS30300に戻る。 In step S30310, the placementposition determination unit 80 determines whether all ICBs included in the placement target function have been examined. The arrangement position determination unit 80 transitions to step S30311 when it is examined, and returns to step S30302 otherwise.
In step S30311, the arrangementposition determining unit 80 transitions to step S30312 if the value of the temporary variable for the number of misses is smaller than the current minimum miss number, and transitions to step S30313 otherwise.
In step S30312, the arrangementposition determination unit 80 updates the minimum number of misses and the minimum arrangement, and the process proceeds to step S30313.
In step S30313, the arrangementposition determination unit 80 determines whether all arrangements have been tried in the arrangement target function. If the arrangement has been tried, the arrangement ends. If not, the arrangement position determination unit 80 returns to step S30300.
ステップS30311で、配置位置決定部80は、ミス数の一時変数の値が、現在の最小ミス数より小さい場合、ステップS30312に遷移し、そうでない場合、ステップS30313に遷移する。
ステップS30312で、配置位置決定部80は、最小ミス数と最小配置を更新し、ステップS30313に遷移する。
ステップS30313で、配置位置決定部80は、配置対象関数において、全ての配置を試したか判断し、試した場合は終了し、そうでない場合はステップS30300に戻る。 In step S30310, the placement
In step S30311, the arrangement
In step S30312, the arrangement
In step S30313, the arrangement
配置位置決定部80は、ステップS30313が真となるまで、すなわちステップS30313でYESとなるまで、上記処理を繰り返す。ステップS30313でYESになることは、配置対象関数において全ての配置を試したことを意味する。
The arrangement position determining unit 80 repeats the above processing until step S30313 becomes true, that is, until YES is determined in step S30313. If “YES” in the step S30313, it means that all arrangements have been tried in the arrangement target function.
次に、具体例を用いて配置位置決定処理S3について、詳細に説明する。
命令トレース30より、図3のようなICBの実行系列303が得られている場合に、セット数2のダイレクトマップキャッシュへの配置を考える。関数はA、B、Cの三種類であり、全ての関数は1つのICB以内のサイズであるとする。図3の実行系列から競合情報70を生成すると、図4のような結果となる。 Next, the arrangement position determination process S3 will be described in detail using a specific example.
When the execution sequence 303 of the ICB as shown in FIG. 3 is obtained from theinstruction trace 30, the arrangement in the direct map cache with the number of sets 2 is considered. There are three types of functions A, B, and C, and all the functions are assumed to have a size within one ICB. When the competition information 70 is generated from the execution sequence of FIG. 3, the result is as shown in FIG.
命令トレース30より、図3のようなICBの実行系列303が得られている場合に、セット数2のダイレクトマップキャッシュへの配置を考える。関数はA、B、Cの三種類であり、全ての関数は1つのICB以内のサイズであるとする。図3の実行系列から競合情報70を生成すると、図4のような結果となる。 Next, the arrangement position determination process S3 will be described in detail using a specific example.
When the execution sequence 303 of the ICB as shown in FIG. 3 is obtained from the
配置位置決定部80による、具体的な処理について、図20のステップS3の詳細処理フローを用いて、以下で説明する。
ステップS300で、ルール131と競合情報70とから、関数の優先順位が計算され、関数C、関数B、関数Aの順番で配置していくことが決定される。 Specific processing by the arrangementposition determination unit 80 will be described below using the detailed processing flow of step S3 in FIG.
In step S300, the priority order of the functions is calculated from therule 131 and the competition information 70, and it is determined that the functions C, B, and A are arranged in this order.
ステップS300で、ルール131と競合情報70とから、関数の優先順位が計算され、関数C、関数B、関数Aの順番で配置していくことが決定される。 Specific processing by the arrangement
In step S300, the priority order of the functions is calculated from the
ステップS302において、まず関数Cが取り出される。関数Cは最初の関数であるため、セット0に配置される。続いて、ステップS302で、関数Bが取り出される。
ステップS303において、関数Bをセット0から最後のセットまで配置をためし、既配置関数との間で起こる競合ミス数の内、最小のミス数となる場所を求める。
図23に、関数Bをセット0に配置した場合の、キャッシュミス発生回数の計算結果を示す。関数Bがセット0に配置される場合の、C0との間で起こすキャッシュミスが計算される。計算の結果、CM(B0,C0)が4と求まる。ここでCM(X,Y)は、カッコ内で指定されたICBが、同じセットに配置された場合のキャッシュミス数を表すものとする。よって、CM(B0,C0)は、B0,C0が同じセットに配置された場合のキャッシュミス数である。
図24に、関数Bをセット1に配置した場合の、キャッシュミス発生回数の計算結果を示す。関数Bがセット1に配置される場合、CM(B0)=0と求まる。
以上の結果、ステップS304において、関数Bはセット1に配置される。 In step S302, the function C is first extracted. Since function C is the first function, it is placed inset 0. Subsequently, in step S302, the function B is extracted.
In step S303, the function B is arranged from theset 0 to the last set, and the place where the smallest number of misses among the number of contention misses occurring with the existing arrangement function is obtained.
FIG. 23 shows the calculation result of the number of cache miss occurrences when the function B is arranged in theset 0. A cache miss occurring with C0 when function B is placed in set 0 is calculated. As a result of the calculation, CM (B0, C0) is obtained as 4. Here, CM (X, Y) represents the number of cache misses when ICBs specified in parentheses are arranged in the same set. Therefore, CM (B0, C0) is the number of cache misses when B0 and C0 are arranged in the same set.
FIG. 24 shows the calculation result of the number of cache miss occurrences when the function B is arranged in theset 1. When the function B is arranged in the set 1, CM (B0) = 0 is obtained.
As a result, the function B is arranged in theset 1 in step S304.
ステップS303において、関数Bをセット0から最後のセットまで配置をためし、既配置関数との間で起こる競合ミス数の内、最小のミス数となる場所を求める。
図23に、関数Bをセット0に配置した場合の、キャッシュミス発生回数の計算結果を示す。関数Bがセット0に配置される場合の、C0との間で起こすキャッシュミスが計算される。計算の結果、CM(B0,C0)が4と求まる。ここでCM(X,Y)は、カッコ内で指定されたICBが、同じセットに配置された場合のキャッシュミス数を表すものとする。よって、CM(B0,C0)は、B0,C0が同じセットに配置された場合のキャッシュミス数である。
図24に、関数Bをセット1に配置した場合の、キャッシュミス発生回数の計算結果を示す。関数Bがセット1に配置される場合、CM(B0)=0と求まる。
以上の結果、ステップS304において、関数Bはセット1に配置される。 In step S302, the function C is first extracted. Since function C is the first function, it is placed in
In step S303, the function B is arranged from the
FIG. 23 shows the calculation result of the number of cache miss occurrences when the function B is arranged in the
FIG. 24 shows the calculation result of the number of cache miss occurrences when the function B is arranged in the
As a result, the function B is arranged in the
最後に関数Aが取り出され、同様にキャッシュミス数の計算が実行される。
ステップS303において、関数Aをセット0から最後のセットまで配置をためし、既配置関数との間で起こる競合ミス数の内、最小のミス数となる場所を求める。
図25に、関数Aをセット0に配置した場合の、キャッシュミス発生回数の計算結果を示す。関数Aがセット0に配置される場合の、C0との間で起こすキャッシュミスが計算される。計算の結果、CM(A0,C0)=3+2=5と求まる。CM(A0,C0)は、A0,C0が同じセットに配置された場合のキャッシュミス数である。
図26に、関数Aをセット1に配置した場合の、キャッシュミス発生回数の計算結果を示す。関数Aがセット1に配置される場合、CM(A0,B0)=2+1=3と求まる。
以上の結果、ステップS304において、関数Aはセット1に配置される。 Finally, the function A is taken out and the calculation of the number of cache misses is executed in the same manner.
In step S303, the function A is arranged from theset 0 to the last set, and the place where the smallest number of misses among the number of contention misses occurring with the existing arrangement function is obtained.
FIG. 25 shows the calculation result of the number of cache miss occurrences when the function A is arranged in theset 0. The cache miss that occurs with C0 when function A is placed in set 0 is calculated. As a result of the calculation, CM (A0, C0) = 3 + 2 = 5 is obtained. CM (A0, C0) is the number of cache misses when A0 and C0 are arranged in the same set.
FIG. 26 shows the calculation result of the number of cache miss occurrences when the function A is arranged in theset 1. When the function A is arranged in the set 1, CM (A0, B0) = 2 + 1 = 3 is obtained.
As a result, the function A is arranged in theset 1 in step S304.
ステップS303において、関数Aをセット0から最後のセットまで配置をためし、既配置関数との間で起こる競合ミス数の内、最小のミス数となる場所を求める。
図25に、関数Aをセット0に配置した場合の、キャッシュミス発生回数の計算結果を示す。関数Aがセット0に配置される場合の、C0との間で起こすキャッシュミスが計算される。計算の結果、CM(A0,C0)=3+2=5と求まる。CM(A0,C0)は、A0,C0が同じセットに配置された場合のキャッシュミス数である。
図26に、関数Aをセット1に配置した場合の、キャッシュミス発生回数の計算結果を示す。関数Aがセット1に配置される場合、CM(A0,B0)=2+1=3と求まる。
以上の結果、ステップS304において、関数Aはセット1に配置される。 Finally, the function A is taken out and the calculation of the number of cache misses is executed in the same manner.
In step S303, the function A is arranged from the
FIG. 25 shows the calculation result of the number of cache miss occurrences when the function A is arranged in the
FIG. 26 shows the calculation result of the number of cache miss occurrences when the function A is arranged in the
As a result, the function A is arranged in the
関数Aの配置後、全関数の配置が終了するため、ステップS301が真となり、ステップS305に遷移する。
ステップS305において、関数Cをセット0に格納されるアドレス、関数Bと関数Aをセット1に格納されるアドレスにそれぞれ配置されるものとして、関数配置情報90が出力される。 Since the arrangement of all the functions is completed after the arrangement of the function A, step S301 becomes true, and the process proceeds to step S305.
In step S305,function allocation information 90 is output assuming that function C is allocated to the address stored in set 0, and function B and function A are allocated to the addresses stored in set 1, respectively.
ステップS305において、関数Cをセット0に格納されるアドレス、関数Bと関数Aをセット1に格納されるアドレスにそれぞれ配置されるものとして、関数配置情報90が出力される。 Since the arrangement of all the functions is completed after the arrangement of the function A, step S301 becomes true, and the process proceeds to step S305.
In step S305,
***効果の説明***
本実施の形態に係るプログラム配置装置500は、命令トレースを入力とし、関数間の競合情報を抽出する仮想キャッシュシミュレータ部を備える。また、各ICBの競合情報を保持する競合ミスデータベースを備え、競合ミスデータベースに基づいて、競合ミスを抑制する関数配置を算出する配置位置決定部を備える。プログラム配置装置500は、関数をキャッシュラインサイズのICBに分割し、競合ミス発生時のICBの組み合わせ情報の抽出を行い、その情報に基づいて関数を配置する。よって、プログラム配置装置500によれば、競合ミスを抑制する配置を決定することができる。 *** Explanation of effects ***
Program placement apparatus 500 according to the present embodiment includes a virtual cache simulator unit that receives instruction traces and extracts contention information between functions. In addition, a conflict miss database that holds the conflict information of each ICB is provided, and a layout position determination unit that calculates a function layout that suppresses the conflict miss is provided based on the conflict miss database. The program placement apparatus 500 divides a function into ICBs having a cache line size, extracts ICB combination information when a contention miss occurs, and places the function based on the information. Therefore, according to the program placement apparatus 500, it is possible to determine the placement that suppresses the contention error.
本実施の形態に係るプログラム配置装置500は、命令トレースを入力とし、関数間の競合情報を抽出する仮想キャッシュシミュレータ部を備える。また、各ICBの競合情報を保持する競合ミスデータベースを備え、競合ミスデータベースに基づいて、競合ミスを抑制する関数配置を算出する配置位置決定部を備える。プログラム配置装置500は、関数をキャッシュラインサイズのICBに分割し、競合ミス発生時のICBの組み合わせ情報の抽出を行い、その情報に基づいて関数を配置する。よって、プログラム配置装置500によれば、競合ミスを抑制する配置を決定することができる。 *** Explanation of effects ***
Program placement apparatus 500 according to the present embodiment includes a virtual cache simulator unit that receives instruction traces and extracts contention information between functions. In addition, a conflict miss database that holds the conflict information of each ICB is provided, and a layout position determination unit that calculates a function layout that suppresses the conflict miss is provided based on the conflict miss database. The program placement apparatus 500 divides a function into ICBs having a cache line size, extracts ICB combination information when a contention miss occurs, and places the function based on the information. Therefore, according to the program placement apparatus 500, it is possible to determine the placement that suppresses the contention error.
本実施の形態に係るプログラム配置装置500は、仮想キャッシュシミュレータ部において、実キャッシュメモリの構成に関わらず、セット数を1に設定し、全てのICBが同じキャッシュ領域を使用するものとして、シミュレーションを実行する。よって、プログラム配置装置500によれば、競合ミス発生時に、相関関係のあるICBの組み合わせ情報を抽出することができる。
In the virtual cache simulator unit, the program placement apparatus 500 according to the present embodiment sets the number of sets to 1 regardless of the configuration of the real cache memory, and assumes that all ICBs use the same cache area and perform simulation. Execute. Therefore, according to the program placement apparatus 500, it is possible to extract combination information of ICBs having correlation when a conflict error occurs.
本実施の形態に係るプログラム配置装置500は、競合ミスデータベースにおいて、競合ミス発生時に、相関関係のあるICBの組み合わせごとに、競合ミス発生回数を記録する。よって、プログラム配置装置500によれば、最適配置探索処理、すなわち配置位置決定処理において、正確な競合ミス発生回数を計算することができる。
The program placement apparatus 500 according to the present embodiment records the number of times of occurrence of contention misses for each combination of correlated ICBs when contention misses occur in the contention miss database. Therefore, according to the program placement apparatus 500, it is possible to calculate the accurate number of contention errors in the optimum placement search process, that is, the placement position determination process.
本実施の形態に係るプログラム配置装置500は、最適配置探索部、すなわち配置位置決定部は、各関数が原因となり、自分以外の関数の競合ミスを発生させている回数を、競合ミスデータベースに基づいて算出する。そして、配置位置決定部は、算出した競合ミス回数の多い関数から順番にメモリ領域に配置する。よって、プログラム配置装置500によれば、正確な最適配置を探索できる。
In the program placement apparatus 500 according to the present embodiment, the optimal placement search unit, that is, the placement position determination unit, calculates the number of times that a conflict miss of a function other than itself is caused by each function based on the conflict miss database. To calculate. Then, the arrangement position determination unit arranges in the memory area in order from the calculated function having the highest number of contention misses. Therefore, according to the program placement apparatus 500, an accurate optimum placement can be searched.
以上のように、本実施の形態に係るプログラム配置装置500によれば、仮想キャッシュシミュレータ部が、命令トレースにおける、各関数ブロックの相関性を競合情報として保存する。そして、競合情報に基づいて、配置位置決定部にて、競合キャッシュミス数が最小となる関数配置を決定するため、より正確な関数配置情報を出力することができる。
As described above, according to the program placement apparatus 500 according to the present embodiment, the virtual cache simulator unit stores the correlation of each function block in the instruction trace as the competition information. Since the arrangement position determination unit determines the function arrangement that minimizes the number of competing cache misses based on the competition information, more accurate function arrangement information can be output.
実施の形態2.
本実施の形態では、主に、実施の形態1と異なる点について説明する。
実施の形態1で説明した構成と同様の構成については同一の符号を付し、その説明を省略する場合がある。Embodiment 2. FIG.
In the present embodiment, differences from the first embodiment will be mainly described.
The same components as those described inEmbodiment 1 are denoted by the same reference numerals, and the description thereof may be omitted.
本実施の形態では、主に、実施の形態1と異なる点について説明する。
実施の形態1で説明した構成と同様の構成については同一の符号を付し、その説明を省略する場合がある。
In the present embodiment, differences from the first embodiment will be mainly described.
The same components as those described in
実施の形態1では、配置位置決定部80は、優先順位の高い関数からメモリ空間に配置し、関数配置情報90を出力する。しかし、配置する関数の順番やサイズによっては、メモリ使用効率が悪くなる場合がある。
In the first embodiment, the arrangement position determination unit 80 arranges functions in a memory space from a function having a high priority, and outputs function arrangement information 90. However, depending on the order and size of the functions to be arranged, the memory usage efficiency may deteriorate.
図27に示す関数配置情報90が出力された場合を考える。
図27では、最初の関数の先頭から、最後の関数の最後尾までの領域の内、有効な関数の命令で埋まっている割合は約69%となる。メモリ容量の増大は、コストの増加につながるため、メモリ効率を向上させることが重要である。
そこで、本実施の形態では、メモリ使用効率を向上させる方式について説明する。 Consider a case where thefunction arrangement information 90 shown in FIG. 27 is output.
In FIG. 27, the ratio of the area from the beginning of the first function to the end of the last function that is filled with valid function instructions is approximately 69%. Since an increase in memory capacity leads to an increase in cost, it is important to improve memory efficiency.
Therefore, in this embodiment, a method for improving the memory usage efficiency will be described.
図27では、最初の関数の先頭から、最後の関数の最後尾までの領域の内、有効な関数の命令で埋まっている割合は約69%となる。メモリ容量の増大は、コストの増加につながるため、メモリ効率を向上させることが重要である。
そこで、本実施の形態では、メモリ使用効率を向上させる方式について説明する。 Consider a case where the
In FIG. 27, the ratio of the area from the beginning of the first function to the end of the last function that is filled with valid function instructions is approximately 69%. Since an increase in memory capacity leads to an increase in cost, it is important to improve memory efficiency.
Therefore, in this embodiment, a method for improving the memory usage efficiency will be described.
***構成の説明***
図28は、本実施の形態2に係るプログラム配置装置500aを示すブロック構成図である。
本実施の形態のプログラム配置装置500aは、図1の構成に加え、関数配置調整部120を有する。
関数配置調整部120は、配置位置決定部80により決定された複数の関数の各関数の配置位置801に基づいて、複数の関数の各関数を配置位置801とは異なる再配置位置802に並び替える。複数の関数の各関数が再配置位置802に配置された場合のキャッシュメモリ401の空き領域4015は、複数の関数の各関数が配置位置801に配置された場合のキャッシュメモリ401の空き領域4016よりも少ない。 *** Explanation of configuration ***
FIG. 28 is a block configuration diagram showing a program placement apparatus 500a according to the second embodiment.
The program placement apparatus 500a according to the present embodiment includes a functionplacement adjustment unit 120 in addition to the configuration shown in FIG.
The functionplacement adjustment unit 120 rearranges each function of the plurality of functions into a rearrangement position 802 different from the placement position 801 based on the placement position 801 of each function of the plurality of functions determined by the placement position determination unit 80. . The free area 4015 of the cache memory 401 when each function of the plurality of functions is arranged at the rearrangement position 802 is more than the free area 4016 of the cache memory 401 when each function of the plurality of functions is arranged at the arrangement position 801. There are few.
図28は、本実施の形態2に係るプログラム配置装置500aを示すブロック構成図である。
本実施の形態のプログラム配置装置500aは、図1の構成に加え、関数配置調整部120を有する。
関数配置調整部120は、配置位置決定部80により決定された複数の関数の各関数の配置位置801に基づいて、複数の関数の各関数を配置位置801とは異なる再配置位置802に並び替える。複数の関数の各関数が再配置位置802に配置された場合のキャッシュメモリ401の空き領域4015は、複数の関数の各関数が配置位置801に配置された場合のキャッシュメモリ401の空き領域4016よりも少ない。 *** Explanation of configuration ***
FIG. 28 is a block configuration diagram showing a program placement apparatus 500a according to the second embodiment.
The program placement apparatus 500a according to the present embodiment includes a function
The function
関数配置調整部120は、プログラム情報50、関数配置情報90を入力とし、メモリ使用効率を向上させた関数配置情報90aを出力する。関数配置情報90は、複数の関数の各関数が配置位置801に配置される情報である。関数配置情報90aは、複数の関数の各関数が再配置位置802に配置される情報である。
The function placement adjustment unit 120 receives the program information 50 and the function placement information 90 as input, and outputs function placement information 90a with improved memory use efficiency. The function arrangement information 90 is information in which each function of a plurality of functions is arranged at the arrangement position 801. The function arrangement information 90a is information in which each function of a plurality of functions is arranged at the rearrangement position 802.
なお、各機能ブロックは1つあるいは複数のプログラムとして実装されていてもよいし、複数の機能ブロックが1つのプログラムとして実装されていてもよい。
Each functional block may be implemented as one or a plurality of programs, or a plurality of functional blocks may be implemented as one program.
***動作の説明***
図29を用いて、本実施の形態に係るプログラム配置装置500aのプログラム配置方法、プログラム配置処理S10aについて説明する。 *** Explanation of operation ***
The program placement method and program placement processing S10a of the program placement apparatus 500a according to the present embodiment will be described with reference to FIG.
図29を用いて、本実施の形態に係るプログラム配置装置500aのプログラム配置方法、プログラム配置処理S10aについて説明する。 *** Explanation of operation ***
The program placement method and program placement processing S10a of the program placement apparatus 500a according to the present embodiment will be described with reference to FIG.
図29のステップS1,S1a,S2,S3は実施の形態1と同様である。
ステップS5において、関数配置調整部120は、プログラム情報50、関数配置情報90に基づいて、メモリ使用効率を向上させた関数配置情報90aを生成する。 Steps S1, S1a, S2, and S3 in FIG. 29 are the same as those in the first embodiment.
In step S <b> 5, the functionplacement adjustment unit 120 generates function placement information 90 a with improved memory use efficiency based on the program information 50 and the function placement information 90.
ステップS5において、関数配置調整部120は、プログラム情報50、関数配置情報90に基づいて、メモリ使用効率を向上させた関数配置情報90aを生成する。 Steps S1, S1a, S2, and S3 in FIG. 29 are the same as those in the first embodiment.
In step S <b> 5, the function
図30を用いて、本実施の形態に係る関数配置調整処理S5について説明する。
まず、ステップS500において、関数配置調整部120は、メモリアドレスを関数が配置されるメモリ空間の先頭に初期化し、ステップS501に遷移する。
ステップS501において、関数配置調整部120は、全関数を配置したかどうか確認する。配置していなければ、ステップS502に遷移し、配置していればステップS506に遷移する。
ステップS502において、関数配置調整部120は、未配置の関数の内、現在のメモリアドレスが示す、ブロックアドレスとブロックオフセットで始まる関数が存在するか確認する。存在すればステップS503に遷移し、存在しなければステップS505に遷移する。
ステップS503において、関数配置調整部120は、未配置の関数の内、現在のメモリアドレスが示す、ブロックアドレスとブロックオフセットを満たす関数を、関数配置情報90から一つ取り出し、現在のメモリアドレスに配置する。配置後、ステップS504に遷移する。
ステップS504において、関数配置調整部120は、処理対象の関数のサイズ分、メモリアドレスを進める。
ステップS505において、関数配置調整部120は、ブロックオフセット1つ分、メモリアドレスを進める。
ステップS506において、関数配置調整部120は、現在の配置情報を関数配置情報90として出力し、処理を終了する。 The function arrangement adjustment process S5 according to the present embodiment will be described with reference to FIG.
First, in step S500, the functionplacement adjustment unit 120 initializes the memory address to the top of the memory space in which the function is placed, and the process proceeds to step S501.
In step S501, the functionplacement adjustment unit 120 checks whether all functions have been placed. If not arranged, the process proceeds to step S502, and if arranged, the process proceeds to step S506.
In step S502, the functionplacement adjustment unit 120 checks whether there is a function starting with a block address and a block offset indicated by the current memory address among the unplaced functions. If it exists, the process proceeds to step S503, and if it does not exist, the process proceeds to step S505.
In step S503, the functionplacement adjustment unit 120 extracts from the function placement information 90 one function that satisfies the block address and the block offset indicated by the current memory address from among the unplaced functions, and places the function at the current memory address. To do. After placement, the process proceeds to step S504.
In step S504, the functionplacement adjustment unit 120 advances the memory address by the size of the function to be processed.
In step S505, the functionarrangement adjustment unit 120 advances the memory address by one block offset.
In step S506, the functionarrangement adjustment unit 120 outputs the current arrangement information as the function arrangement information 90, and ends the process.
まず、ステップS500において、関数配置調整部120は、メモリアドレスを関数が配置されるメモリ空間の先頭に初期化し、ステップS501に遷移する。
ステップS501において、関数配置調整部120は、全関数を配置したかどうか確認する。配置していなければ、ステップS502に遷移し、配置していればステップS506に遷移する。
ステップS502において、関数配置調整部120は、未配置の関数の内、現在のメモリアドレスが示す、ブロックアドレスとブロックオフセットで始まる関数が存在するか確認する。存在すればステップS503に遷移し、存在しなければステップS505に遷移する。
ステップS503において、関数配置調整部120は、未配置の関数の内、現在のメモリアドレスが示す、ブロックアドレスとブロックオフセットを満たす関数を、関数配置情報90から一つ取り出し、現在のメモリアドレスに配置する。配置後、ステップS504に遷移する。
ステップS504において、関数配置調整部120は、処理対象の関数のサイズ分、メモリアドレスを進める。
ステップS505において、関数配置調整部120は、ブロックオフセット1つ分、メモリアドレスを進める。
ステップS506において、関数配置調整部120は、現在の配置情報を関数配置情報90として出力し、処理を終了する。 The function arrangement adjustment process S5 according to the present embodiment will be described with reference to FIG.
First, in step S500, the function
In step S501, the function
In step S502, the function
In step S503, the function
In step S504, the function
In step S505, the function
In step S506, the function
次に、具体例を用いて関数配置調整処理S5について、詳細に説明する。
図27に示す関数配置情報90に対して、関数配置調整処理S5を実行した場合について説明する。関数配置情報90に対して、関数配置調整処理S5を実行した結果を図31の関数配置情報90aとする。
この具体例では、メモリ空間の先頭を0、ブロック内の命令数は2とする。
まず、関数配置調整部120は、メモリアドレス、ブロックアドレス、ブロックオフセットを関数が配置されるメモリ空間の先頭に初期化する。このとき、メモリアドレス0、ブロックアドレス0、ブロックオフセット0となる。 Next, the function arrangement adjustment processing S5 will be described in detail using a specific example.
A case where the function arrangement adjustment process S5 is executed on thefunction arrangement information 90 shown in FIG. 27 will be described. The result of executing the function placement adjustment process S5 on the function placement information 90 is assumed to be function placement information 90a in FIG.
In this specific example, the top of the memory space is 0, and the number of instructions in the block is 2.
First, the functionplacement adjustment unit 120 initializes a memory address, a block address, and a block offset at the beginning of a memory space in which a function is placed. At this time, the memory address is 0, the block address is 0, and the block offset is 0.
図27に示す関数配置情報90に対して、関数配置調整処理S5を実行した場合について説明する。関数配置情報90に対して、関数配置調整処理S5を実行した結果を図31の関数配置情報90aとする。
この具体例では、メモリ空間の先頭を0、ブロック内の命令数は2とする。
まず、関数配置調整部120は、メモリアドレス、ブロックアドレス、ブロックオフセットを関数が配置されるメモリ空間の先頭に初期化する。このとき、メモリアドレス0、ブロックアドレス0、ブロックオフセット0となる。 Next, the function arrangement adjustment processing S5 will be described in detail using a specific example.
A case where the function arrangement adjustment process S5 is executed on the
In this specific example, the top of the memory space is 0, and the number of instructions in the block is 2.
First, the function
次に、関数配置調整部120は、未配置の関数のうち、ブロックアドレス0、ブロックオフセット0を満たす関数Aを、メモリアドレス0に配置する。そして、関数配置調整部120は、メモリアドレスに関数Aのサイズ5を加算し、メモリアドレス5、ブロックアドレス2、ブロックオフセット1とする。
Next, the function placement adjustment unit 120 places the function A satisfying the block address 0 and the block offset 0 among the unplaced functions at the memory address 0. Then, the function arrangement adjustment unit 120 adds the size 5 of the function A to the memory address to obtain the memory address 5, the block address 2, and the block offset 1.
次に、関数配置調整部120は、ブロックアドレス2、ブロックオフセット1を満たす関数Eを取り出し、メモリアドレス5に配置する。配置後、関数配置調整部120は、メモリアドレスに、関数Eのサイズ6を加算し、メモリアドレス11、ブロックアドレス5、ブロックオフセット1とする。
Next, the function placement adjustment unit 120 takes out the function E satisfying the block address 2 and the block offset 1 and places it at the memory address 5. After the arrangement, the function arrangement adjustment unit 120 adds the size 6 of the function E to the memory address to obtain the memory address 11, the block address 5, and the block offset 1.
次のブロックアドレス5、ブロックオフセット1を満たす関数は存在しないため、関数配置調整部120がメモリアドレスをブロックオフセット1進めると、メモリアドレス12、ブロックアドレス6、ブロックオフセット2となる。続いて、同じように処理を進めることにより、関数D、関数C、関数G、関数F、関数Bの順番で関数が配置される。
以上のように、関数配置調整処理S5の結果として、最初の関数の先頭から、最後の関数の最後尾までの領域の内、有効な関数の命令で埋まっている割合は98%となる。 Since there is no function that satisfies thenext block address 5 and block offset 1, when the function placement adjustment unit 120 advances the memory address by block offset 1, the memory address 12, block address 6, and block offset 2 are obtained. Subsequently, by proceeding in the same manner, the functions are arranged in the order of function D, function C, function G, function F, and function B.
As described above, as a result of the function arrangement adjustment process S5, the ratio of the area from the beginning of the first function to the end of the last function that is filled with valid function instructions is 98%.
以上のように、関数配置調整処理S5の結果として、最初の関数の先頭から、最後の関数の最後尾までの領域の内、有効な関数の命令で埋まっている割合は98%となる。 Since there is no function that satisfies the
As described above, as a result of the function arrangement adjustment process S5, the ratio of the area from the beginning of the first function to the end of the last function that is filled with valid function instructions is 98%.
***効果の説明***
本実施の形態に係るプログラム配置装置500aは、配置位置決定部が出力した関数配置情報90に基づいて、関数配置の並び替えを行う関数配置調整部を備える。そして、プログラム配置装置500aはでは、関数配置情報90に従って配置した場合のメモリの空き領域よりもメモリの空き領域が少なくなるように、関数の並び替えを実行する。
以上のように、本実施の形態に係るプログラム配置装置500aによれば、配置位置決定部が出力する関数配置情報90に基づいて、関数配置調整部120が、関数の並び替えを実行することで、メモリの使用効率を向上することができる。 *** Explanation of effects ***
The program arrangement apparatus 500a according to the present embodiment includes a function arrangement adjustment unit that rearranges function arrangements based on thefunction arrangement information 90 output from the arrangement position determination unit. Then, the program placement apparatus 500a executes the function rearrangement so that the free space in the memory is smaller than the free space in the memory when placed according to the function placement information 90.
As described above, according to the program arrangement apparatus 500a according to the present embodiment, the functionarrangement adjustment unit 120 executes the function rearrangement based on the function arrangement information 90 output from the arrangement position determination unit. Memory usage efficiency can be improved.
本実施の形態に係るプログラム配置装置500aは、配置位置決定部が出力した関数配置情報90に基づいて、関数配置の並び替えを行う関数配置調整部を備える。そして、プログラム配置装置500aはでは、関数配置情報90に従って配置した場合のメモリの空き領域よりもメモリの空き領域が少なくなるように、関数の並び替えを実行する。
以上のように、本実施の形態に係るプログラム配置装置500aによれば、配置位置決定部が出力する関数配置情報90に基づいて、関数配置調整部120が、関数の並び替えを実行することで、メモリの使用効率を向上することができる。 *** Explanation of effects ***
The program arrangement apparatus 500a according to the present embodiment includes a function arrangement adjustment unit that rearranges function arrangements based on the
As described above, according to the program arrangement apparatus 500a according to the present embodiment, the function
上記の実施の形態では、「取得部」、「配置位置決定部」、「関数配置部」、「命令トレース読出し部」、「仮想キャッシュメモリ生成部」、「仮想キャッシュデータ保持部」、「競合情報生成部」、「関数配置調整部」がそれぞれ独立した機能ブロックであった。しかし、プログラム配置装置は上記のような構成でなくてもよく、プログラム配置装置の構成は任意である。「取得部」、「配置位置決定部」、「関数配置部」、「関数配置調整部」をひとつの機能ブロックで実現してもよい。また、「命令トレース読出し部」、「仮想キャッシュメモリ生成部」、「仮想キャッシュデータ保持部」、「競合情報生成部」を1つの機能ブロックで実現してもよい。
In the above embodiment, “acquisition unit”, “arrangement position determination unit”, “function arrangement unit”, “instruction trace reading unit”, “virtual cache memory generation unit”, “virtual cache data holding unit”, “contention” The “information generation unit” and “function arrangement adjustment unit” were independent functional blocks. However, the program placement apparatus may not be configured as described above, and the configuration of the program placement apparatus is arbitrary. The “acquisition unit”, “arrangement position determination unit”, “function arrangement unit”, and “function arrangement adjustment unit” may be realized by one functional block. Further, the “instruction trace reading unit”, “virtual cache memory generation unit”, “virtual cache data holding unit”, and “contention information generation unit” may be realized by one functional block.
また、プログラム配置装置は、1つの装置でなく、複数の装置から構成されたプログラム配置システムでもよい。プログラム配置装置の機能ブロックは、実施の形態に記載した機能を実現することができれば、任意である。これらの機能ブロックを、他のどのような組み合わせでプログラム配置装置を構成しても構わない。
Further, the program placement apparatus may be a program placement system constituted by a plurality of devices instead of a single device. The function blocks of the program placement apparatus are arbitrary as long as the functions described in the embodiment can be realized. Any other combination of these functional blocks may constitute the program placement apparatus.
以上、実施の形態1,2について説明したが、これらの2つの実施の形態のうち、1つの実施の形態を部分的に実施しても構わない。あるいは、これらの2つの実施の形態のうち、複数を部分的に組み合わせて実施しても構わない。その他、これらの2つの実施の形態を、全体としてあるいは部分的に、どのように組み合わせて実施しても構わない。
なお、上記の実施の形態は、本質的に好ましい例示であって、本発明、その適用物や用途の範囲を制限することを意図するものではなく、必要に応じて種々の変更が可能である。 Although the first and second embodiments have been described above, one of the two embodiments may be partially implemented. Alternatively, a plurality of these two embodiments may be partially combined. In addition, these two embodiments may be implemented in any combination as a whole or in part.
In addition, said embodiment is an essentially preferable illustration, Comprising: It does not intend restrict | limiting the range of this invention, its application thing, or a use, A various change is possible as needed. .
なお、上記の実施の形態は、本質的に好ましい例示であって、本発明、その適用物や用途の範囲を制限することを意図するものではなく、必要に応じて種々の変更が可能である。 Although the first and second embodiments have been described above, one of the two embodiments may be partially implemented. Alternatively, a plurality of these two embodiments may be partially combined. In addition, these two embodiments may be implemented in any combination as a whole or in part.
In addition, said embodiment is an essentially preferable illustration, Comprising: It does not intend restrict | limiting the range of this invention, its application thing, or a use, A various change is possible as needed. .
10 プログラム、20 プログラム実行部、21 取得部、30 命令トレース、31 呼び出し順、40 キャッシュ構成情報、50 プログラム情報、60 仮想キャッシュシミュレータ部、70 競合情報、71 競合ミスデータレコード、72 ICB名、73 自ICBとしての合計ミス数、74 他ICBとしての合計ミス数、75 競合ミスエントリ、76 ミスID、77 競合ICB数、78 競合ICBごとのミス数、80 配置位置決定部、90,90a 関数配置情報、100 関数配置部、110 最適化済プログラム、120 関数配置調整部、130 優先順位テーブル、131 ルール、301 命令コード、303 ICBの実行系列、401 キャッシュメモリ、403 仮想キャッシュメモリ、601 仮想キャッシュメモリ生成部、602 仮想キャッシュデータ保持部、603 命令トレース読出し部、604 競合情報生成部、605 シミュレータ部、701 競合命令コード組、702 競合ICB、703 競合回数、801 配置位置、802 再配置位置、500,500a プログラム配置装置、901 プロセッサ、902 補助記憶装置、903 メモリ、904 通信装置、905 入力インタフェース、906 ディスプレイインタフェース、907 入力装置、908 ディスプレイ、910 信号線、911,912 ケーブル、9401 レシーバー、9402 トランスミッター、4015,4016 空き領域、4031 格納エリア、4032 仮格納エリア、4033 呼出命令コード、4039 複数のエリア、S1 取得処理、S1a 仮想キャッシュメモリ生成処理、S2 シミュレーション処理、S3 配置位置決定処理、S4 関数配置処理、S5 関数配置調整処理、S10,S10a プログラム配置処理。
10 programs, 20 program execution units, 21 acquisition units, 30 instruction traces, 31 calling order, 40 cache configuration information, 50 program information, 60 virtual cache simulator units, 70 conflict information, 71 conflict miss data records, 72 ICB names, 73 Total number of mistakes as own ICB, 74 Total number of mistakes as other ICBs, 75 conflict miss entries, 76 miss IDs, 77 conflict ICB counts, 78 miss counts per competing ICB, 80 placement position determination unit, 90, 90a function placement Information, 100 function allocation unit, 110 optimized program, 120 function allocation adjustment unit, 130 priority table, 131 rule, 301 instruction code, 303 ICB execution series, 401 cache memory, 403 virtual cache memory, 01 Virtual cache memory generation unit, 602 Virtual cache data holding unit, 603 Instruction trace reading unit, 604 Contention information generation unit, 605 Simulator unit, 701 Contention instruction code set, 702 Contention ICB, 703 Number of contention, 801 Location, 802 Re Placement position, 500, 500a Program placement device, 901 processor, 902 auxiliary storage device, 903 memory, 904 communication device, 905 input interface, 906 display interface, 907 input device, 908 display, 910 signal line, 911, 912 cable, 9401 Receiver, 9402 transmitter, 4015, 4016 free space, 4031 storage area, 4032 temporary storage area, 4033 call instruction code, 4 39 a plurality of areas, S1 acquisition process, S1a virtual cache generating process, S2 simulation process, S3 position determination processing, S4 function arrangement process, S5 function disposition adjustment process, S10, S10a program allocation process.
Claims (9)
- 少なくとも1つのウェイを使用するキャッシュメモリに複数の関数を含むプログラムを配置するプログラム配置装置において、
前記プログラムを実行することにより、前記複数の関数の各関数に含まれる命令コードの呼び出し順を取得する取得部と、
前記キャッシュメモリの前記ウェイの数分の格納エリアを有する仮想キャッシュメモリを生成する仮想キャッシュメモリ生成部と、
前記仮想キャッシュメモリに対して前記命令コードを前記呼び出し順に呼出命令コードとして呼び出すシミュレーションを実行し、既に呼び出した前記呼出命令コードを再度呼び出した際に前記格納エリアに前記呼出命令コード以外の命令コードが格納されている競合が発生した場合、発生した前記競合の情報を競合情報として取得するシミュレータ部と、
前記競合情報に基づいて、前記キャッシュメモリにおける前記複数の関数の各関数の配置位置を決定する配置位置決定部と
を備えるプログラム配置装置。 In a program placement apparatus that places a program including a plurality of functions in a cache memory that uses at least one way,
An acquisition unit that acquires the calling order of instruction codes included in each function of the plurality of functions by executing the program;
A virtual cache memory generation unit that generates a virtual cache memory having storage areas corresponding to the number of ways of the cache memory;
A simulation is executed to call the instruction code to the virtual cache memory as a calling instruction code in the calling order, and when the calling instruction code that has already been called is called again, an instruction code other than the calling instruction code is stored in the storage area. When a stored conflict occurs, a simulator unit that acquires information on the generated conflict as conflict information;
A program placement apparatus comprising: a placement position determination unit that determines a placement position of each function of the plurality of functions in the cache memory based on the contention information. - 前記シミュレータ部は、
前記複数の関数の各関数に含まれる命令コードのうち前記競合を発生させた命令コードの組み合わせを競合命令コード組として取得し、前記競合命令コード組により発生した前記競合の回数を競合回数として計数し、計数した前記競合回数を前記競合情報として取得し、
前記配置位置決定部は、
前記競合回数に基づいて、前記複数の関数の各関数の前記配置位置を決定する請求項1に記載のプログラム配置装置。 The simulator unit is
A combination of instruction codes causing the conflict among instruction codes included in each function of the plurality of functions is acquired as a conflict instruction code set, and the number of conflicts generated by the conflict instruction code set is counted as the number of conflicts. And obtaining the counted number of competitions as the competition information,
The arrangement position determining unit
The program placement apparatus according to claim 1, wherein the placement position of each function of the plurality of functions is determined based on the number of times of competition. - 前記仮想キャッシュメモリ生成部は、
前記仮想キャッシュメモリとして、アドレスが連続する複数のエリアであって前記ウェイの数分の格納エリアと前記ウェイの数分の格納エリアの後ろに連続する複数の仮格納エリアとからなる複数のエリアを生成する請求項2に記載のプログラム配置装置。 The virtual cache memory generator is
As the virtual cache memory, a plurality of areas consisting of a plurality of areas having consecutive addresses, each including a storage area for the number of ways and a plurality of temporary storage areas following the storage area for the number of ways. The program placement device according to claim 2 to be generated. - 前記シミュレータ部は、
前記呼出命令コードを呼び出した際に前記格納エリアに対して前記競合が発生し、かつ、前記呼出命令コードが前記仮格納エリアにある場合、既に前記仮想キャッシュメモリに格納されている前記呼出命令コードより前のエリアに格納されている全ての命令コードと前記呼出命令コードとの組を前記競合命令コード組として取得する請求項3に記載のプログラム配置装置。 The simulator unit is
The call instruction code already stored in the virtual cache memory when the contention occurs in the storage area when the call instruction code is called and the call instruction code is in the temporary storage area 4. The program placement apparatus according to claim 3, wherein a set of all instruction codes stored in an earlier area and the call instruction code is acquired as the competing instruction code set. - 前記シミュレータ部は、
前記競合命令コード組を取得した後に、既に前記仮想キャッシュメモリに格納されている前記呼出命令コードより前のエリアに格納されている全ての命令コードをそれぞれ1つ後ろのエリアに移動し、既に前記仮想キャッシュメモリに格納されている前記呼出命令コードを前記仮想キャッシュメモリの先頭の前記格納エリアに格納し、前記呼び出し順における前記呼出命令コードの次の命令コードを前記呼出命令コードとして呼び出す請求項4に記載のプログラム配置装置。 The simulator unit is
After obtaining the contention instruction code set, all instruction codes stored in the area before the call instruction code already stored in the virtual cache memory are moved to the area one after, respectively, 5. The calling instruction code stored in a virtual cache memory is stored in the storage area at the head of the virtual cache memory, and an instruction code next to the calling instruction code in the calling order is called as the calling instruction code. The program arrangement device described in 1. - 前記プログラム配置装置は、
前記複数の関数の各関数の優先順位を判定するためのルールを設定する優先順位テーブルを備え、
前記配置位置決定部は、
前記優先順位テーブルに基づいて前記キャッシュメモリに配置する前記複数の関数の各関数の優先順位を判定し、判定した優先順位の順に前記複数の関数の各関数の前記配置位置を決定する請求項1から5のいずれか1項に記載のプログラム配置装置。 The program placement device comprises:
A priority table for setting a rule for determining the priority of each function of the plurality of functions;
The arrangement position determining unit
2. The priority of each function of the plurality of functions to be arranged in the cache memory is determined based on the priority table, and the arrangement position of each function of the plurality of functions is determined in the determined priority order. 6. The program arrangement device according to any one of items 1 to 5. - 前記プログラム配置装置は、
前記配置位置決定部により決定された前記複数の関数の各関数の前記配置位置に基づいて、前記複数の関数の各関数を前記配置位置とは異なる再配置位置に並び替える関数配置調整部を備え、
前記複数の関数の各関数が前記再配置位置に配置された場合の前記キャッシュメモリの空き領域は、前記複数の関数の各関数が前記配置位置に配置された場合の前記キャッシュメモリの空き領域よりも少ない請求項1から6のいずれか1項に記載のプログラム配置装置。 The program placement device comprises:
A function arrangement adjustment unit that rearranges each function of the plurality of functions to a rearrangement position different from the arrangement position based on the arrangement position of each function of the plurality of functions determined by the arrangement position determination unit; ,
The free area of the cache memory when each function of the plurality of functions is arranged at the relocation position is more than the free area of the cache memory when each function of the plurality of functions is arranged at the arrangement position. The program arrangement device according to any one of claims 1 to 6, wherein there are few. - 少なくとも1つのウェイを使用するキャッシュメモリに複数の関数を含むプログラムを配置するプログラム配置装置のプログラム配置方法において、
取得部が、前記プログラムを実行することにより、前記複数の関数の各関数に含まれる命令コードの呼び出し順を取得し、
仮想キャッシュメモリ生成部が、前記キャッシュメモリの前記ウェイの数分の格納エリアを有する仮想キャッシュメモリを生成し、
シミュレータ部が、前記仮想キャッシュメモリに対して前記命令コードを前記呼び出し順に呼出命令コードとして呼び出すシミュレーションを実行し、既に呼び出した前記呼出命令コードを再度呼び出した際に前記格納エリアに前記呼出命令コード以外の命令コードが格納されている競合が発生した場合、発生した前記競合の情報を競合情報として取得し、
配置位置決定部が、前記競合情報に基づいて、前記キャッシュメモリにおける前記複数の関数の各関数の配置位置を決定するプログラム配置方法。 In a program placement method of a program placement device for placing a program including a plurality of functions in a cache memory that uses at least one way,
The acquisition unit acquires the calling order of instruction codes included in each function of the plurality of functions by executing the program,
A virtual cache memory generating unit generates a virtual cache memory having storage areas corresponding to the number of ways of the cache memory;
When the simulator unit executes a simulation for calling the instruction code as the calling instruction code in the calling order with respect to the virtual cache memory, and when the calling instruction code that has already been called is called again, other than the calling instruction code in the storage area If a conflict that stores the instruction code is generated, information on the generated conflict is acquired as conflict information,
A program arrangement method, wherein an arrangement position determination unit determines an arrangement position of each function of the plurality of functions in the cache memory based on the contention information. - 少なくとも1つのウェイを使用するキャッシュメモリに複数の関数を含むプログラムを配置するプログラム配置装置のプログラム配置プログラムにおいて、
前記プログラムを実行することにより、前記複数の関数の各関数に含まれる命令コードの呼び出し順を取得する取得処理と、
前記キャッシュメモリの前記ウェイの数分の格納エリアを有する仮想キャッシュメモリを生成する仮想キャッシュメモリ生成処理と、
前記仮想キャッシュメモリに対して前記命令コードを前記呼び出し順に呼出命令コードとして呼び出すシミュレーションを実行し、既に呼び出した前記呼出命令コードを再度呼び出した際に前記格納エリアに前記呼出命令コード以外の命令コードが格納されている競合が発生した場合、発生した前記競合の情報を競合情報として取得するシミュレーション処理と、
前記競合情報に基づいて、前記キャッシュメモリにおける前記複数の関数の各関数の配置位置を決定する配置位置決定処理とをコンピュータに実行させるプログラム配置プログラム。 In a program placement program of a program placement device that places a program including a plurality of functions in a cache memory that uses at least one way,
An acquisition process for acquiring the calling order of instruction codes included in each function of the plurality of functions by executing the program;
Virtual cache memory generation processing for generating virtual cache memory having storage areas for the number of ways of the cache memory;
A simulation is executed to call the instruction code to the virtual cache memory as a calling instruction code in the calling order, and when the calling instruction code that has already been called is called again, an instruction code other than the calling instruction code is stored in the storage area. When a stored conflict occurs, a simulation process for acquiring information on the generated conflict as conflict information;
A program arrangement program for causing a computer to execute an arrangement position determination process for determining an arrangement position of each function of the plurality of functions in the cache memory based on the contention information.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2015/050845 WO2016113869A1 (en) | 2015-01-14 | 2015-01-14 | Arranging apparatus for functions in cache memory |
JP2016569166A JP6138384B2 (en) | 2015-01-14 | 2015-01-14 | Program placement apparatus, program placement method, and program placement program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2015/050845 WO2016113869A1 (en) | 2015-01-14 | 2015-01-14 | Arranging apparatus for functions in cache memory |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016113869A1 true WO2016113869A1 (en) | 2016-07-21 |
Family
ID=56405431
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2015/050845 WO2016113869A1 (en) | 2015-01-14 | 2015-01-14 | Arranging apparatus for functions in cache memory |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP6138384B2 (en) |
WO (1) | WO2016113869A1 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000509861A (en) * | 1997-02-27 | 2000-08-02 | コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ | How to reduce the frequency of cache misses on computers |
JP2009032198A (en) * | 2007-07-30 | 2009-02-12 | Fujitsu Microelectronics Ltd | Cache coloring method |
JP2010218218A (en) * | 2009-03-17 | 2010-09-30 | Nec Corp | Method and device for arranging program into memory space, and program |
JP2011008607A (en) * | 2009-06-26 | 2011-01-13 | Adcore-Tech Co Ltd | Device and method for allocating memory |
-
2015
- 2015-01-14 JP JP2016569166A patent/JP6138384B2/en active Active
- 2015-01-14 WO PCT/JP2015/050845 patent/WO2016113869A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000509861A (en) * | 1997-02-27 | 2000-08-02 | コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ | How to reduce the frequency of cache misses on computers |
JP2009032198A (en) * | 2007-07-30 | 2009-02-12 | Fujitsu Microelectronics Ltd | Cache coloring method |
JP2010218218A (en) * | 2009-03-17 | 2010-09-30 | Nec Corp | Method and device for arranging program into memory space, and program |
JP2011008607A (en) * | 2009-06-26 | 2011-01-13 | Adcore-Tech Co Ltd | Device and method for allocating memory |
Also Published As
Publication number | Publication date |
---|---|
JP6138384B2 (en) | 2017-05-31 |
JPWO2016113869A1 (en) | 2017-04-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Calder et al. | Predictive sequential associative cache | |
US8938603B2 (en) | Cache system optimized for cache miss detection | |
JP5460486B2 (en) | Apparatus and method for sorting data | |
CN104809179B (en) | The device and method for accessing Hash table | |
JP5733385B2 (en) | Endian conversion method and system | |
US9223680B2 (en) | Information processing apparatus and debugging method | |
US8868835B2 (en) | Cache control apparatus, and cache control method | |
CN103218309A (en) | Multi-level instruction cache prefetching | |
CN104516826B (en) | The corresponding method and device of a kind of virtual big page and the big page of physics | |
CN114637700B (en) | Address translation method for target virtual address, processor and electronic equipment | |
CN105359142B (en) | Hash connection method and device | |
US20020169900A1 (en) | Direct memory access controller, and direct memory access control method | |
TW202004494A (en) | Direct memory access method and device, dedicated computing chip and heterogeneous computing system | |
JP6138384B2 (en) | Program placement apparatus, program placement method, and program placement program | |
JP5979966B2 (en) | Circuit design support apparatus, circuit design support method, and program | |
JP6567215B2 (en) | Architecture selection apparatus, architecture selection method, and architecture selection program | |
JP2021192187A (en) | Appearance frequency calculation program, graphics processing unit, information processing device, and appearance frequency calculation method | |
US8732687B2 (en) | Arrangement method of programs to memory space, apparatus, and recording medium | |
US20140173225A1 (en) | Reducing memory access time in parallel processors | |
CN113448958B (en) | Data processing method and device, electronic equipment and storage medium | |
US20150234656A1 (en) | Vector processor, information processing apparatus, and overtaking control method | |
CN109992529B (en) | Virtual address determination method and device, processor and storage medium | |
US12020029B2 (en) | Program conversion device, program conversion method, and program conversion program | |
US10977176B2 (en) | Prefetching data to reduce cache misses | |
JP2011150486A (en) | Data processing apparatus |
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: 15877821 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2016569166 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 15877821 Country of ref document: EP Kind code of ref document: A1 |