![]() METHOD FOR PREDICTING DATA TO BE PRELOADED IN A CACHE MEMORY
专利摘要:
This method of predicting data to be preloaded comprises: - the acquisition (110) of a statistical distribution, called "model", of the deltas of a model access sequence, - the construction (112) of a the so-called "observed" statistical distribution of the deltas of an observed access sequence, - the identification (114) in the statistical distribution observed, by comparing it with the model statistical distribution, of the most deficient class, that is, the class for which the NoDSM-NoDSO difference is maximum, where NoDSM and NoDSO are the occurrence numbers of that class deduced, respectively, from the model statistical distribution and the observed statistical distribution, - the supply (116) as a prediction of the data to be precharged in the cache memory, of at least one predicted address where the data to be preloaded is contained, this predicted address being constructed from the most deficient class identified as l in step e). 公开号:FR3045183A1 申请号:FR1562435 申请日:2015-12-15 公开日:2017-06-16 发明作者:Suzanne Lesecq;Henri-Pierre Charles;Stephane Mancini;Lionel Vincent 申请人:Commissariat a lEnergie Atomique CEA;Commissariat a lEnergie Atomique et aux Energies Alternatives CEA; IPC主号:
专利说明:
METHOD FOR PREDICTING DATA TO BE PRELOADED IN A CACHE MEMORY [001] The invention relates to a method for predicting data to be preloaded in a cache memory, and a method for executing a program implementing this prediction method. The invention also relates to an information recording medium and an electronic module for implementing this prediction method. [002] It is very important to predict as accurately as possible the data to be preloaded in a cache memory because this limits the "cache failures" or "miss" in English. This therefore limits the number of times the microprocessor must fetch the data it wants to access in another memory slower than the cache memory. Indeed, if the prediction is correct, the data that the microprocessor wishes to access was then preloaded in the cache memory before the microprocessor executes the instruction to read this data. Therefore, when it executes this reading instruction, it can very quickly obtain the data which it wishes to access. Conversely, in case of cache fault, the time spent by the microprocessor to read the data in another memory is longer. Because of this, this time spent reading in another memory that the cache memory is called "penalty". Thus, limiting the number of cache faults improves the performance and thus accelerates the execution of a program by the microprocessor. [003] Many methods for predicting the data to be preloaded in the cache memory have already been proposed. For example, such methods have been described in the following documents: - US5305389 Al, and - Joseph D., Grunwald D., "Prefetching using Markov predictors", Computers, IEEE Transactions, Vol. 48, No. 2, pp. 121-133, February 1999. [004] In particular, certain known methods comprise: a) for each instant t where a microprocessor executes an instruction to read a piece of data necessary for the execution of a program, calculating a difference, called delta, between the address of the data to be read contained in this read instruction executed at the instant t and the address of the data to be read contained in this same read instruction when it was first executed at a time t-1, two instructions for reading are the same if they both correspond to the same value of the ordinal counter of the microprocessor, and b) the storage of an access sequence observed containing only the N delta calculated successively for each instant t included inside. a sliding window [ti; t0], where the instants t0 and ti are equal to instants t, respectively the most recent and the oldest, for which a delta of the observed access sequence has been calculated and the number N is a predetermined integer greater than or equal to together. In known methods, the next delta of the observed access sequence is predicted by comparing the observed access sequence with a model access sequence. In this context, the pattern access sequence is often called "Pattern" or "Pattern" in English. It is a predetermined temporal succession of deltas that is repeated several times during the execution of the program. [006] For example, if the model access sequence is the following temporal sequence of deltas: 1, 2, 3, 4, 3, 2 and if the observed access sequence is the following sequence: 1, 2, 3 , 4, 3, then the known methods predict that the next delta will most likely have the value 2. For this, the known methods identify the value of the delta to be added to the observed access sequence which maximizes the temporal correlation with the sequence of model access. Then, the data to be precharged in the cache memory is the data recorded at the address deduced from this predicted delta and the address read during the last execution of the read instruction. [007] On the other hand, if the access sequence observed is the sequence 4, 3, 1, 2, 3, the known methods note that the sequence 4, 3, 1, 2, 3 is not temporally correlated. with the access sequence model 1, 2, 3, 4, 3, 2. Therefore, in this case, the known methods are not able to provide data to preload in the cache memory. The objective of the present invention is to provide an improved method for predicting the data to be preloaded in the cache memory. It therefore has for object such a method including in addition the following steps: c) the acquisition of a statistical distribution, called "model", of the deltas of a model access sequence, this model statistical distribution comprising: possible classes of values for deltas, and associated with each of these classes, - a number depending on the number of occurrences of this class in the model access sequence, d) the construction of a statistical distribution, called "observed" , deltas of the observed access sequence, e) the identification in the statistical distribution observed, by comparing it with the model statistical distribution, of the most deficient class, that is to say of the class for which the NoDSM - NoDSO difference is maximal, where NoDSM and NoDSO are the occurrence numbers of this class deduced, respectively, from the model statistical distribution and the statistical distribution observed, f) the supply as a pre diction of the data to be precharged in the cache memory before the next execution of the same read instruction, of at least one predicted address where the data to be preloaded is contained, this predicted address being constructed from the most deficient class identified during step e). [009] In the claimed method, a model statistical distribution is used to identify the predicted delta that is most likely to be calculated for the next t time. More precisely, in the claimed method, it is considered that the predicted delta that is most likely to occur is that which makes it possible to minimize the differences between the model statistical distribution and the observed statistical distribution. With this approach, it is not necessary that there be a perfect temporal correlation between a model access sequence and the access sequence observed to be able to predict the next data to be preloaded. For example, if we take the example above where the pattern access sequence is 1, 2, 3, 4, 3, 2, the model statistical distribution associated with this sequence is associated with the values 1, 2, 3 and 4 the occurrence numbers, respectively, 1, 2, 2, 1. In other words, the model statistical distribution indicates that in the model access sequence, the value 1 appears only once, the value 2 appears twice, the value 3 appears twice and the value 4 appears once. [0010] If the observed access sequence is 4, 3, 1, 2, 3, the observed statistical distribution constructed for this observed access sequence associates the values 1, 2, 3, 4 respectively in number of occurrences 1 , 1, 2, 1. We see, therefore, that the next delta of the access sequence that would bring the statistical distribution closest to the model statistical distribution closer together is a predicted delta whose value is equal to 2. Thus, under these conditions, the claimed method is capable of predicting data to be pre-loaded in the cache even if the time order of the deltas of the observed access sequence is not the same as that of the template access sequence. Thus, the claimed method is robust to a change in the temporal order of the deltas of the observed access sequence with respect to the temporal order of the deltas in the template access sequence. The claimed method has been implemented during the execution of a program where the temporal order of the deltas of a pattern can change with respect to the order of these same deltas in a pattern access sequence . The results obtained show that the claimed method more often estimates more correctly the data to be precharged in the cache memory. The implementation of the claimed method has therefore made the execution of this program faster. The embodiments of this prediction method may comprise one or more of the following characteristics: during step c), the acquisition of the model statistical distribution comprises: storing a model access sequence containing only the last M delta successively calculated for each instant t included within a sliding window [t3; t2] prior to the sliding window [ti; t0], where the instants t2 and t3 are equal to instants t, respectively the most recent and the oldest, for which a delta of the model access sequence has been calculated, and the number of deltas calculated for instants t included between the instants t2 and tee a predetermined constant, and the number M is a predetermined integer greater than or equal to two, and - each time a new pattern access sequence is stored, the construction of the statistical distribution pattern at from the deltas of this stored pattern access sequence; systematically, there is no time t between the times t2 and t1 for which a delta is calculated so that the pattern access sequence immediately immediately precedes the observed access sequence; the method comprises: calculating a similarity metric whose value varies monotonically as a function of the importance of the differences between the model and observed statistical distributions and / or the calculation of a prediction error whose value varies monotonically as a function of the number of times the address predicted from the access sequence observed during the sliding window [ti; t0] is different from the address of the data to be read actually contained in the read instruction executed at the instant following t0 + 1, and - in response to the crossing of a threshold predetermined by the calculated similarity metric and / or by the calculated prediction error, modifying the number N of deltas contained in the observed access sequence or the number M of deltas contained in the model access sequence; the method comprises: calculating a first similarity metric whose value varies monotonically as a function of the importance of the differences between the model and observed statistical distributions and / or the calculation of a first prediction error whose value varies monotonically as a function of the number of times the address predicted from the model statistical distribution and the access sequence observed during the sliding window [ti; t0] is different from the address of the data to be read actually contained in the read instruction executed at the following time to + 1, and - the storage of an access sequence, called "prediction", containing only P successively calculated deltas for each instant t included inside a sliding window [t5; t4] prior to the sliding window [ti; t0], where the instants t4 and t5 are equal to the instants t, respectively the most recent and the oldest, for which a delta of the prediction access sequence has been calculated and the number P is predetermined integer number different from the number M, - the construction of a statistical distribution called "prediction", from the deltas of the prediction access sequence, - the calculation of a second similarity metric and / or a second prediction error in using the prediction statistical distribution in place of the model statistical distribution, and then - if the calculated second similarity metric or the calculated second prediction error is better than, respectively, the first computed similarity metric or the first calculated prediction error then the number M is taken equal to the number P for the next iteration of the process, otherwise the number M remains unchanged; the observed access sequence systematically contains the delta calculated from the address of the data item to be read contained in the most recently executed read instruction; at each iteration of step e), only one predicted address is provided. These embodiments of the prediction method also have the following advantages: The construction of the model statistical distribution from a model access sequence found during an earlier sliding window makes it possible to dynamically adapt the statistical distribution. model as the program runs while limiting the amount of memory resource used. The fact that the model access sequence immediately precedes the observed access sequence makes it possible to adapt very quickly the model statistical distribution to a modification of the pattern which is repeated during the execution of the program. - The calculation of a similarity metric between the model and observed statistical distributions or the calculation of a prediction error makes it possible to automatically detect that the size of the model access sequence or the access sequence observed is not more suited to the pattern that repeats itself when running the program and thus automatically trigger a change of this size during program execution. - The use of a statistical prediction distribution in addition to the model statistical distribution makes it possible to test the consequences of a modification of the size of the model access sequence to try to find a size that allows to obtain better results than the current size of the model access sequence and this without degrading the current quality of the predictions provided. - The fact that the observed access sequence systematically contains the delta that occurred at the most recent time t, makes it possible to react more quickly to a modification of the pattern that is repeated during the execution of the program and therefore to adapt the prediction process more quickly to this modification. - Predicting only one data item to be preloaded makes it possible to limit the size of the memory resources needed to record the predicted data. This also makes it possible to limit the pollution of the cache memory by unnecessary replacements of lines of this cache memory. The invention also relates to a method of executing a program, stored in a main memory, by a microprocessor associated with a cache memory, this method comprising: the execution by the microprocessor of an instruction reading data necessary for the execution of the program, this instruction containing the address where this data is stored in the main memory, if the data corresponding to the address contained in the reading instruction to be executed is in the cache memory, reading this data in the cache, and otherwise reading this data in the main memory or in another memory different from the cache memory, - before the microprocessor executes again the same instruction of read, the prediction of the data to be precharged in the cache memory and the precharging of the predicted data in the cache memory or in a buffer memory, in the the prediction is performed in accordance with the claimed method. The invention also relates to an information recording medium comprising instructions for the execution of the claimed method, when these instructions are executed by an electronic computer. The invention also relates to an electronic module for predicting data to be preloaded in a cache memory, this module being arranged for: a) for each instant t where a microprocessor executes a read instruction of a data item necessary for the execution of a program, calculating a deviation, called delta, between the address of the data to be read contained in this reading instruction executed at time t and the address of the data to be read contained in this same read instruction at its previous execution at a time t-1, two read instructions being the same if they both correspond to the same value of the microprocessor ordinal counter, b) storing an observed access sequence containing only the N delta calculated successively for each instant t included inside a sliding window [ti; t0], where the instants t0 and ti are equal to instants t, respectively the most recent and the oldest, for which a delta of the observed access sequence has been calculated and the number N is a predetermined integer greater than or equal to to two, c) to acquire a statistical distribution, called "model", of the deltas of a model access sequence, this model statistical distribution including: - classes of possible values for the deltas, and associated with each of these classes, a number depending on the number of occurrences of this class in the model access sequence, d) constructing an "observed" statistical distribution of the deltas of the observed access sequence, e) identifying in the observed statistical distribution , comparing it with the model statistical distribution, the most deficient class, ie the class for which the NoDSM-NoDSO difference is maximal, where NoDSM and NoDSO are the occurrence numbers d e this class deduced respectively from the statistical model distribution and the observed statistical distribution, f) provide as prediction of the data to be precharged in the cache memory before the next execution of the same read instruction, at least one address predicted where the data to be precharged is contained, this predicted address being constructed from the most deficient class identified in step e). The invention will be better understood with the reading of the following description, given solely by way of non-limiting example, and with reference to the drawings in which: - Figure 1 is a schematic illustration of a electronic processing unit; FIG. 2 is a schematic illustration of the code of a computer program executed by the processing unit of FIG. 1; FIG. 3 is a generic flowchart of a method of operation of the processing unit of FIG. 1; FIG. 4 is a flowchart of a method for predicting a data item to be precharged in a cache memory, implemented in the method of FIG. 3; FIG. 5 is a timing diagram illustrating various access sequences used during the implementation of the method of FIG. 4; FIG. 6 is a histogram used to represent statistical distributions used during the implementation of the method of FIG. 4; FIG. 7 is a timing diagram illustrating the evolution of the predictions provided by the method of FIG. 4 over time; FIG. 8 is a flowchart of another embodiment of a method for predicting data to be precharged in a cache memory, which can be implemented in place of the method of FIG. 4; FIG. 9 is a schematic illustration of two distribution functions used in the method of FIG. 8; FIG. 10 is a flowchart of a method for automatic adaptation of the size of a model access sequence, usable in combination with the method of FIG. 4 or 8; FIG. 11 is a timing diagram illustrating the evolution over time of two magnitudes Po and Eo calculated by the method of FIG. 10; FIG. 12 is a timing diagram illustrating the evolution over time of the sizes M and N of two access sequences calculated by the method of FIG. 10; FIG. 13 is a flowchart of a method for automatic adaptation of the size of the access sequences that can be used in combination with the method of FIG. 4 or 8. In these figures the same references are used to designate the same elements. In the remainder of this description, the features and functions well known to those skilled in the art are not described in detail. Figure 1 shows an electronic unit 2 of calculation. For example, unit 2 is a computer. The hardware structure of such a computer is well known and only the elements necessary for the understanding of the invention are represented and described in more detail. Unit 2 comprises: - a programmable electronic calculator 4, - a main memory 6, - a non-volatile memory 8, and - a data transfer bus 10 between the memories 8, 10 and the computer 4. The memory 6 is typically a fast memory to which the computer 4 accesses faster than the memory 8. Here, the memory 6 is a random access memory. It can be a volatile memory such as a DRAM ("Dynamic Random Access Memory"), the memory 6 can also be a non-volatile random access memory such as a FLASH memory. The memory 8 is for example a hard disk or any other type of non-volatile memory. The memory 8 comprises a computer program 12 to be executed by the computer 4, as well as data 14 to be processed by this program 12 when it is executed. During the execution of the program 12 by the computer 4, the instructions of the program 12 as well as the data 14 are transferred in a first step in the memory 6 to access it more quickly. In the memory 6, the instructions of the program 12 and the data 14 processed by this program carry, respectively, the reference numerals 16 and 18. Typically, the data 14 contains structured data in the form of matrices or in the form of linked lists. In a matrix, each data is identified by coordinates such as row and column numbers. In a linked list, each item has a pointer to the previous and / or next item in that list. An example of structured data is a digital image. The processing of such structured data by the program 12 generally involves the execution of loops that are repeated a large number of times. The computer 4 comprises: - a microprocessor 20 also known by the acronym CPU ("Central Processing Unit"), - a cache memory 22, - a preloading module 24 also known by the English term "prefetcher", a buffer 26, and a data transfer bus 28 between the microprocessor 20, the memory 22, the memory 24, the buffer memory 26 and the bus 10. The microprocessor 20 is able to execute a program. For this purpose, it furthermore comprises a PC register called "Program Counter" or "Instruction Pointer" which contains the address of the instruction currently being executed or the "Instruction Pointer". next instruction to be executed by the microprocessor 20. The cache memory 22 is here a level L1 cache memory. It makes it possible to store data to which the microprocessor 20 can access more quickly than if they had only been stored in the memory 6. For example, these data are instructions of the program 16 or data to be processed from the data 18. The memory 22 comprises for this purpose a memory 30 and a microcomputer 32. The memory 30 contains the data to which the microprocessor 20 can access faster without having to read them in the memory 6. The microcomputer 32 manages the recording and erasure In particular, when a new data item is to be stored in the memory 30, the microcomputer 32 determines, according to an algorithm of its own, the data or data to be erased in the memory 30 to free up the necessary space. recording this new data in the cache memory 22. The function of the module 24 is to predict, before the microprocessor 20 needs it, where the data to be preloaded in the cache memory 22 and to trigger the preloading of these data. Here, the module 24 is able to execute the methods of FIGS. 4, 8, 10 and 13. For this purpose, the module 24 may include a microcomputer dedicated to this function. In this case, it includes its own memory containing the instructions necessary to execute the processes of FIGS. 4, 8, 10 and 13 and its own microprocessor which executes these instructions. It can also be a dedicated integrated circuit. In this case, the process instructions of FIGS. 4, 8, 10 and 13 are hard-wired in this integrated circuit. The memory 26 is here a buffer used by the module 24 to temporarily save the data or data to be preloaded before they are transferred, if necessary, into the cache memory 22. The various components of the computer 4 are here manufactured on the same substrate such as a silicon chip. FIG. 2 diagrammatically represents a portion of the executable code of the program 12. In this figure, the vertical wavy lines indicate that all the instructions of the program 12 have not been represented. Specifically, only two read instructions "Ld @ A1" and "Ld @ A2" were represented. Subsequently, these two instructions are respectively called instructions 11 and 12. The instructions 11 and 12 cause the loading into microprocessor registers 20, when executed by this microprocessor 20, of a data item recorded respectively at the addresses @ A1 and @ A2 of memory 6. An arrow starting from an instruction after the instruction 11 and going back to an instruction before the instruction 12 indicates that the instructions 11 and 12 are located inside a loop likely to to be executed a large number of times. The instructions 11 and 12 are respectively at the addresses PCL and PC2 of the computer PC counter. Thus, when the value of the ordinal counter PC is equal to PCI, this means that the instruction 11 is being executed or will be executed. When the value of the ordinal counter PC is equal to PC2, this means that the instruction 12 is being executed or will be executed. Thus, even if the @ A1 and @ A2 addresses of the data to be read are equal, the value of the PC ordinal counter makes it possible to unambiguously identify the reading instruction currently being executed or that will be executed. Typically, the addresses @ A1 and @ A2 are addresses calculated by the instructions which precede, respectively, the instructions 11 and 12. Thus, from one iteration to the next of the loop, the value of the addresses @ A1 and @ A2 can change while the values of the PC ordinal counter identifying instructions 11 and 12 do not change during these successive reiterations of the loop. The data read at the address @ A1 or @ A2 may be an instruction executable by the microprocessor 20 or data to be processed by this microprocessor 20. Consequently, as described below, the value of the PC ordinal counter is used to reliably identify a given read instruction among all the reading instructions contained in the program 12. The generic operation of the calculation unit 2 will now be described with reference to the method of FIG. 3. At the start of the execution of the program 12, in a step 50, this program 12 and the data 14 are loaded into the memory 6 and therefore bear the reference numerals 16 and 18. In a step 51, the module 24 determines whether or not to implement the preloading of data in the buffer memory 26. For this, the module 24 checks whether certain conditions are met. If one of these conditions is not verified, it proceeds only to a program execution phase 52 without precharging data in the buffer memory 26. Otherwise, it proceeds to a pre-loading phase 60. In example, in step 51, the module 24 checks whether the SA sequence contains at least M + N delta and, preferably, Tmax delta. In the phase 52, the microprocessor 20 executes the instructions of the program 16 to process the data 18. As illustrated in FIG. 2, during this execution, the microprocessor 20 is made to execute the instructions 11 and 12. These Instructions 11 and 12 can be executed a large number of times when they are located inside a loop as is the case here. Thus, for each of these read instructions, from the addresses successively accessed during each execution of this instruction, it is possible to construct a temporally ordered sequence of deltas. The construction of such a delta sequence is described in more detail with reference to the method of FIG. 4. Typically, this delta sequence may have a repeating pattern. It is by exploiting the fact that a pattern is repeated that it is possible to predict the next calculated delta and therefore the address that will be accessed the next time this reading instruction is executed. From now on, the operation of the unit 2 is described in the particular case of the instruction 11. All that is described in this particular case is also executed in parallel for the instruction 12 and for all the reading instructions within a loop. In a step 54, in response to the execution of the instruction 11, the microcomputer 32 determines whether the data corresponding to the address @ A1 is already contained in the memory 30 or not. If so, during a step 56, the cache memory 22 immediately returns the data requested by the microprocessor 20 via the bus 28. In this case, typically, the microprocessor 20 waits between 2 and 15 clock cycles before obtaining the required data and continuing the execution of the program 16. If the data corresponding to the address @ A1 is not already in the memory 30, then we are in the presence of a cache defect. In this case, during a step 58, the data is read in the memory 6 and transferred to the cache memory 22. Then, it is transferred from the cache memory 22 to the microprocessor 20 via the buses 10 and 28. In the event of a cache fault, it is often necessary for the microprocessor 20 to wait 10 or 100 or 1000 times longer than in step 56 before obtaining the required data and to be able to continue the execution of the program 16. , a cache defect significantly slows the execution of the program 16. Phase 60 is similar to phase 52 except that module 24 further implements the preloading of data in cache memory 22. In a step 62, before the execution of the read instruction 11, the module 24 predicts the data to be preloaded in the cache memory 22. The prediction must be as reliable as possible to maximize the probability that the data required at the next execution of the instruction 11 by the microprocessor 20 is already in the cache memory 22 or in the buffer memory 26. A prediction method implemented by the module 24 is described in more detail with reference to the Figures 4 and 8. At the end of step 62, during a step 64, if the data to be preloaded is not already in the cache memory 22 or in the buffer memory 26, the module 24 loads it from the memory 6 and saves it in a first step in the buffer memory 26. Typically, the buffer memory 26 is capable of containing at most one line or a complete word of the memory 6. The size of the buffer memory 26 is therefore less than cache size 22. It will be noted at this stage that transferring a complete word or a complete line of the memory 6 into the buffer memory 26 generally does not take more time than transferring only the portion of the word or line of the memory. memory 6 which contains the data to be preloaded. In addition, transferring a complete word or a complete line also makes it possible to limit the appearance of cache faults. Then, the microprocessor 20 executes the read instruction 11. Therefore, during a step 66, the microcomputer 32 checks whether the address @ A1 contained in the instruction 11 being executed corresponds to data already stored in the cache memory 22 or in the memory. buffer 26. If so, during a step 68, if the data is already stored in the cache memory 22, then the microcomputer 32 transfers it from the memory 30 to the microprocessor 20 as described for step 56 If the data is not contained in the cache memory 22 but in the buffer memory 26, the microcomputer 32 transfers this data from the buffer memory 26 to the memory 30 and then transfers it from the memory 30 to the microprocessor 20 as described for Step 56. Typically, the microcomputer 32 first looks for the data in the memory 30 and then only in the buffer memory 26. Given that the size of the buffer memory 26 is very small, even when the data is transferred from the buffer memory 26 via the memory 30, the microprocessor 20 obtains the desired data almost as quickly as if it were contained in the memory 30. In practice, it is all the content of the memory e buffer that is transferred into memory 30. If the data corresponding to the address @ A1 is not contained in the memory 30 and the buffer memory 26, during a step 70, this data is read in the memory 6 and then transferred to the cache memory 22. before being finally transferred to the microprocessor 20. For this, the procedure is as described for step 58. In addition, the module 24 triggers, only in this case, the transfer of the contents of the buffer memory 26 to the cache memory 22. The microcomputer 32 then manages the recording of the data to be preloaded in the cache memory 22. Thus, in this embodiment, the data to be preloaded is stored in the cache memory 22 only if it is not all immediately used by the microprocessor 20. This limits the number of times the data to be preloaded must actually be transferred to the cache memory 22. A method for predicting the data to be preloaded by the module 24 during the execution of step 62 will now be described with reference to FIG. 4. In a step 100, at each instant when the microprocessor 20 executes a read instruction, the module 24 raises the identifier of this instruction and compares it to a list of read instruction identifiers already executed. The identifier of the read instruction is here the address of this instruction contained in the PC's ordinal counter of the microprocessor 20. If the identified identifier is not already contained in this list, during a step 102, the module 24 adds this identifier to this list and associates the @A address of the data to be read contained in this read instruction. If the identified identifier is already contained in the list, then during a step 104, the module 24 calculates the difference, called delta, between the address to read contained in this read instruction and the address to read contained in the same read instruction at its previous execution. Then, the calculated delta and the address to be read contained in the instruction being executed are recorded in the list associated with the identifier of this instruction. In this list, the delta calculated successively for the same reading instruction are classified in order of calculation time. This forms a temporally ordered sequence of deltas calculated for the same read instruction. This sequence is called a memory access sequence 6. For each read instruction executed, the module 24 stores an access sequence. In particular, for instruction 11, the module 24 stores an access sequence SA (FIG. 5). Here, to limit the memory space required to store the different access sequences, the size of each access sequence is limited. Here, the size is limited to a maximum number Tmax of calculated deltas contained in the same access sequence. The number Tmax is strictly greater than four or six or ten. When an access sequence already contains Tmax deltas calculated and a newer delta has just been calculated by the module 24, the oldest delta of this access sequence is deleted and the new calculated delta is added. to this access sequence. Thus, each access sequence contains only the most recent calculated Tmax deltas. From now on, the operation of the module 24 is described in the particular case of the instruction 11. The operation of the module 24 for any of the other reading instructions executed by the microprocessor 20 is the same as that which will be described in this particular case. For the digital applications given below, it is assumed that the stored access sequence for instruction 11 is the SA sequence shown in FIG. 5. In FIG. 5, the time axis is oriented by a moment t0 the most recent towards the oldest moments. In this embodiment, the sequence SA contains: an access sequence SO which contains only the most recent successive N deltas, and an access sequence SM which contains only the successive M deltas older than the deltas of the SO sequence. The sizes N and M are predetermined integers greater than or equal to 2 or 4 or 6. The sum of the sizes N and M is always less than or equal to the size Tmax. In the example of FIG. 5, the size M is equal to 9 and the size N is equal to 8. The access sequence SO is called the access sequence observed. It contains all the deltas calculated for each instant t of a sliding observation window [ti; t0] from time t0 to time ti. The instant t is a moment when the instruction 11 is executed by the microprocessor 20 and therefore for which the module 24 calculates a delta and then stores it in the sequence SA. The instant t0 is the most recent instant t. The instant ti is the oldest time t for which a delta of the sequence SO has been calculated. The SM sequence contains all the deltas calculated for each instant t of a sliding window [t3; t2] from time t2 to time t3. The instants t2 and t3 are the instants t, respectively the most recent and the oldest, for which deltas of the sequence SM have been calculated. In this embodiment, the sliding window [t3; t2] moves at the same time as the window [U; t0] so that the sequence SO always contains the most recent computed N deltas and that the sequence SM always contains the calculated M deltas that immediately precede those of the sequence SO. Here, the sequences SO and SM are distinct and separated from each other by no calculated delta. Thus, the time interval] U; t2 [does not contain any time of execution of instruction 11. In this embodiment, the sizes of the sequences SO and SM are permanently linked by the following relationship: N = M-1. Whenever a new delta is added to the SA sequence, in a step 108, the oldest delta of this SA sequence is cleared. In addition, the module 24 updates and stores the SO and SM sequences following this modification of the SA sequence. Here, the new calculated delta is added to the SO sequence and becomes the most recent delta of this sequence. The other deltas are shifted one unit to the left on the graph of Figure 5. The oldest delta precedent of the SO sequence is cleared from the SO sequence and becomes the most recent delta of the SM sequence. In a step 110, the module 24 acquires a DSM model statistical distribution. A statistical distribution is a table that associates, with each possible class of values for the calculated deltas of an access sequence, a number that makes it possible to obtain the number of occurrences of the values of this class in this access sequence. . To maximize the efficiency of the prediction, the access sequence taken as a template must correspond to a pattern that repeats itself several times in the access sequence when the program 12 is executed. In this embodiment, the sequence The access path taken as a template is the SM sequence and the DSM distribution is constructed each time the SM sequence is modified. Here, each class of the DSM distribution corresponds to a single possible value for the calculated deltas. The number associated with each class is obtained by counting the number of occurrences of this class in the sequence SM and then dividing this count by the size M of the sequence SM. Thus, in this embodiment, this number therefore corresponds to an occurrence frequency. The DSM distribution, thus constructed for the SM sequence of FIG. 5, is represented by M bars in the histogram of FIG. Then, during a step 112, an observed statistical distribution DSO is constructed. The DSO distribution is the statistical distribution of the SO sequence. This DSO distribution is constructed as described with reference to step 110, except that it is the deltas contained in the SO sequence that are taken into account and not the deltas contained in the SM sequence. The DSO distribution, constructed for the SO sequence of Figure 5, is represented by O bars in the histogram of Figure 6. In a step 114, the module 24 identifies in the DSO distribution built the most deficient class. The most deficient class is the class for which the difference NoDSM - NoDSO is maximal. NoDSM and NoDSO are the numbers associated with, respectively the DSM and DSO distributions, to the same class. For this, the module 24 compares the DSO distribution, built in step 112, DSM distribution built in step 110. In the case shown in Figure 6, the class most deficient is the class associated with the value "10". This means that if the SO sequence reproduces a pattern similar to that which occurred during the SM sequence, then it is highly probable that the value of the next calculated delta will be equal to 10. For this reason, the value of the class la more deficient identified in step 114 is called Delta predicted thereafter. Note that unlike the known prediction method, the method described here is robust vis-à-vis permutations in the temporal order in which appear deltas of a pattern that are repeated several times during execution of the program 12. This method is also robust vis-à-vis some discrepancies between the observed pattern and the pattern of this pattern. For example, here, the sequence SO of FIG. 5 comprises the value "3" which does not exist in the sequence SM. However, this difference does not disturb the identification of the predicted delta. In a step 116, the module 24 provides as prediction of the data to be preloaded, the address, said "predicted", this data in the memory 6. For this, the module 24 calculates this address predicted from the predicted delta in step 114. For example, the module 24 adds to the last address accessed by the instruction 11, the value of the predicted delta. The last address accessed by instruction It is contained in the list stored in steps 102 and 104. The method of FIG. 4 has been implemented and tested with a program that rotates a digital image. The result obtained is illustrated by the graph of FIG. 7. The abscissa axis of this graph indicates the instants t where the instruction 11 has been executed. For each of these instants t, the graph has a circle if the predicted delta and the delta actually observed are identical and a black point if the observed delta is not superimposed with the predicted delta. This graph shows that very often, the predicted delta is correct and therefore that the microprocessor 20 very quickly accesses the data to be read. For example, in the simulations performed, the predicted delta is different from the delta actually calculated in only 16% of the cases. The method of Figure 8 is identical to that of Figure 4 except that steps 110, 112 and 114 are replaced by steps 150,152 and 154. Step 150 is identical to step 110 except that the DSM distribution constructed is stored in the form of a distribution function SM (x) known as the "cumulative distribution function". The distribution function SM (x) indicates and returns the probability that the value of a calculated delta of the SM sequence has a value less than the threshold x. The function SM (x), obtained from the sequence SM of FIG. 5, is represented on the graph of FIG. 9. In this graph, the abscissa axis contains the different possible values for the threshold x. The probability returned by the function SM (x) is between 0 and 1, where "0" corresponds to a zero probability and "1" corresponds to a probability of 100%. For each possible value of the threshold x, the value of the function SM (x) is obtained by counting in the sequence SM the number of calculated deltas whose value is lower than this threshold x. Then, this count is divided by the size M of the sequence SM. Similarly, in step 152, the DSO distribution constructed is stored in the form of a SO (x) distribution function. The SO (x) function is constructed as described for the SM (x) function except that the SO is used to construct it instead of the SM sequence. The identification of the most deficient class, during step 154, is then obtained by calculating for each value of x equal to a possible value of a calculated delta, the following difference: SM (x) - SM (xl) - [SO (x) - SO (xl)]. The most deficient class is equal to the value of x for which this difference is maximal. Note that for the most deficient class we have the following two equalities: NoDSM = SM (x) - SM (x-1) and NoDSO = SO (x) - SO (x-1). Step 154 thus identifies as the most deficient class the same class as that identified by implementing the method of FIG. [0075] Preferably, in addition to the method of FIG. 4 or 8, the module 24 executes a method of dynamically adjusting the size of the SM and SO sequences. An example of such a dynamic adjustment method will now be described with reference to FIG. 10. As in the previous methods, the method of FIG. 10 is described in the particular case of instruction 11. At predetermined intervals, for example each time the DSM distribution or the DSO distribution is modified, during a step 160, the module 24 calculates a po metric of similarity between the DSM and DSO distributions. For example, here, the module 24 implements the Cramer-Von Mises non-parametric hypothesis test for two samples. This test is used to compare the functions of the SM (x) and SO (x) distributions with each other. For this, in advance, these functions SM (x) and SO (x) are constructed, for example, as described with reference to steps 150 and 152. This hypothesis test is well known and only its main features are recalled here. The distance w between the two statistical distributions is defined by the following relation: The T similarity statistic of the test in the case where the two samples correspond, respectively, to the SM and SO sequences, is given by the following relation: where N and M are the sizes, respectively, of the SO and SM sequences, and - U is defined by the following relation: where n and Sj are respectively the rank of the deltas, respectively of the SM and SO sequences, in the SA sequence. In this embodiment, the po metric of similarity is obtained from the statistic T thus calculated. Here, the metric po is equal to the p-value, better known as "p-value". For example, the module 24 calculates the metric po in the following relation: where: - p is the value -p po, - AND is defined by the following relation: - Var (T) is defined by the following relation: If the metric po exceeds a predetermined threshold Spo, the DSM and DSO distributions are considered similar. Otherwise, they are considered to be different. In parallel, during a step 164, and for the same instant t as that for which the metric po is calculated, the module 24 calculates a prediction error Eo whose value is all the more important as the number false predictions is important. For example, here the error Eo is an error rate equal to the ratio NPC / NPT, where: - NPC is the number of times that the predicted delta identified for the moment t is equal to the delta actually calculated later for this moment t, and - NPT is the total number of times t for which a predicted delta has been identified. Typically the NPC / NPT ratio is calculated taking into account only the last C times t, where C is a predetermined number greater than two or five. Here, C is equal to five. Then, in a step 166, the module 24 automatically determines whether to change the size of the SM and SO sequences. For example, for this purpose, the module 24 checks whether the two following conditions are simultaneously fulfilled: - condition 1): po <Spo, and - condition 2): Eo> SEo. When the condition 1) is satisfied, this means that the DSM distribution is substantially different from the DSO distribution. When condition 2) is satisfied, it means that the prediction error rate is important. The thresholds Spo and SEo are predetermined thresholds and set experimentally for the process of dynamically adjusting the size of the SM and SO sequences to work correctly regardless of the program executed. The threshold Spo is typically between 0 and 1. Here, its value is chosen greater than or equal to 0.9 and, preferably, greater than or equal to 0.95 or 0.99. If both conditions 1) and 2) are simultaneously verified, the module 24 proceeds immediately to a step 168, during which the sizes of the SM and SO sequences are modified. For example, it increments the sizes M and N by 1. If the size M reaches a predefined maximum size TMmax, the size M is reset to a minimum value greater than or equal to 2 or 4. The size M can also be reset to zero value. In this case, the pre-loading of data in the buffer memory 26 is deactivated at least for the following M + N instants t. If one of the two conditions 1) and 2) is not verified, the sizes of the SM and SO sequences are not modified. The methods of FIGS. 8 and 10 have been jointly implemented during the execution of the program 12 which executes a rotation of a digital image. The graph of FIG. 11 represents the evolution of the po metric and the Eo error over time. The graph of FIG. 12 represents the evolution over time of the sizes M and N of the SM and SO sequences during the execution of this same program. It can be seen that the size of the SM and SO sequences is rapidly locked on a good value. However, the method of Figure 10 does not always find the optimal size M. For example, if the access sequence includes a repeated alternation of a first pattern and a second pattern, the method of Figure 10 may lock the size M to a value equal to the size of the first pattern or the second pattern. pattern. For example, the size of the first pattern is equal to four successive deltas and the size of the second pattern is equal to 3 successive deltas. In this type of situation, the error Eo can sometimes be further minimized by taking the size M equal to the size of a window that systematically includes an occurrence of the first pattern and an occurrence of the second pattern. For example, an interesting choice of size M if the first and second patterns are contiguous is to take, in this example, M = 7 (4 + 3). However, the method of FIG. 10 stops incrementing the size M as soon as it has found a size which simultaneously satisfies conditions 1) and 2). Thus, if the conditions 1) and 2) are simultaneously satisfied with M = 3 or M = 4, the module 24 will not explore the larger sizes and therefore the size M = 7. In addition, it may well be that the error Eo is worse for M = 5 and M = 6 than for M = 3 or 4. Therefore, continuing to increase the size M while conditions 1) and 2) are already satisfied may increase the prediction error. To remedy this drawback, it is proposed to perform in addition to the method of FIG. 10 or in the place of this method, an exploration method of different possible sizes for the SM sequence. An embodiment of such a method will now be described with reference to the method of FIG. 13. At predetermined intervals, for example, as soon as the size M of the sequence SM is locked on a given value, during a step 180, the module 24 stores an access sequence model SMP called "prediction" and an access sequence observed SOP. An example of SMP and SOP sequences is shown in FIG. 5. The SMP sequence contains only the MP delta calculated successively for each instant t included within a sliding window [t5; U]. The instants t4 and t5 are the instants, respectively the most recent and the oldest, for which a delta of the SMP sequence has been calculated. Here, the size MP is strictly greater than the size M. Thus, the instant t5 is earlier than the instant t3. The SOP sequence contains only the NP delta calculated successively for each instant t included within a sliding window [t4; t0]. In this embodiment, the sizes MP and NP are connected to each other by the same relationship as that which connects the sizes M and N. Thus, the size NP is equal to MP-1. In the process of FIG. 13, the stored SA sequence for instruction 11 in steps 100, 102 and 104 is the same. Indeed, typically, the size Tmax is greater than or equal to M + N + 1 and, preferably, greater than or equal to M + N + 4 orM + N + 6. As for the SM and SO sequences, each update of the sequence SA causes a corresponding update of the SMP and SOP sequences. In a step 182, the module 24 builds DSMP and DSOP statistical distributions called "prediction" from, respectively, SMP and SOP sequences. To do this, it proceeds as described with reference to steps 150 and 152 except that it is the SMP and SOP sequences that are used instead, respectively, of the SM and SO sequences. In a step 184, the module 24 calculates a similarity metric PP between the DSMP distribution and the DSOP distribution. For example, for this, it proceeds as described with reference to step 160. In this step 184, the module 24 also calculates an error Ep of prediction. For this, it identifies a predicted delta by comparing the DSMP distribution to the DSOP distribution. For this purpose, it proceeds as described with reference to steps 114 or 154 except that the DSMP and DSOP distributions are used in place of the DSM and DSO distributions, respectively. Then, it calculates the error Ep in the same way as described for the error Eo. If the metric pp and the error Ep are better than, respectively, the metric po and the error Eo calculated at the same time using the sequence SM, then it proceeds to a step 186 where the size M is modified to that it is equal to the size MP of the sequence SMP. In the opposite case, during a step 188, the size MP of the SMP sequence is modified to explore other possible sizes of the SM sequence. For example, the size MP is incremented by 1. If the size MP reaches the maximum size TMmax, the process is stopped or reset with a smaller size MP. In step 188, the size of the SM sequence is not changed. Thus, by the method of FIG. 13, the module 24 can find an optimum size M for the sequence SM. Many other embodiments are possible. For example, what has been described in the particular case of read instructions can also be implemented when writing data in the memory 6. Indeed, the writing of data in the memory 6 can be accelerated by pre-loading in the cache memory 22 the pre-existing data located at the address where the data is to be written. Then, when a write instruction is executed, the pre-existing data stored in the cache memory 22 is replaced by new data. The writing of the new data in the cache memory 22 is faster than a write directly into the memory 6. The new data is then moved later from the cache memory 22 to the memory 6 and then replaces the pre-existing data which was still there. This last step of transferring data between the cache memory 22 and the memory 6 can be done without interrupting the execution of the program by the microprocessor 20. In this case, the writing of a datum in the memory 6 therefore implies executing a read instruction of the pre-existing data. What has been described above can therefore be applied to this read instruction to speed up its execution and thus the execution of the writing in the memory 6. In the latter case, the address to be predicted corresponds to the address which contains the pre-existing data. The computing unit may comprise several cache levels hierarchized by access speed. These different levels of cache memory are arranged between the microprocessor 20 and the main memory 6. For example, the computing unit may comprise three levels of cache memory commonly called level L1, L2 and L3. Access to the L1 cache is faster than access to the L2 cache. Access to the L2 cache is faster than access to the L3 cache. Finally, access to the L3 level cache is faster than access to the memory 6. Generally, the sizes of these cache memories vary in decreasing as one gets closer to the memory. which the microprocessor accesses the fastest. In general, data is first stored in memory 6. Then, if useful, it is transferred to the L3 cache. If necessary, it is then transferred from the L3 cache to the L2 cache. Finally, still if necessary, it is transferred from the L2 level cache to the L1 cache. For example, it is not possible to transfer data from memory 6 directly to a L1 or L2 level cache. The level L2 cache memory can be made on the same substrate as that used to make the microprocessor 20. Currently, the level L3 cache memory is most often a memory made on a chip different from that where is realized the microprocessor. The method for predicting data to be preloaded in the particular case of the level cache Ll can also be used to predict the data to be preloaded in any of these cache levels. In particular, the described method can simultaneously be implemented for each of these cache memory levels. The buffer memory 26 may be omitted. In this case, the data predicted by the method of FIG. 4 is directly recorded in the cache memory 22 instead of being first recorded in the buffer memory 26. The preloading of data in the buffer memory 26 is not always systematically activated. For example, preloading of data in buffer 26 is enabled only if the read instructions are located in the lowest level loop, i.e. there is no other loop located inside this loop and containing the same reading instructions. The activation of the preloading of data in the buffer memory 26 is for example triggered by a specific instruction contained in the code of the executed program. The steps 110 and 112 of construction of the DSM and DSO statistical distributions can be performed in parallel or in the reverse order of FIG. 4. Alternatively, at a given time, it is possible to predict not a single data to preload but several. For example, the size of the sequence SO is taken equal to M-α, where a is an integer strictly greater than 1 and strictly less than M-2 or M / 2. At step 114 or 154, the deltas corresponding to the most deficient classes of the DSO distribution are identified. Then, predicted addresses are constructed, each from one of these predicted deltas. For example, a may be 2, 3, or 4. In another embodiment, a class of DSM and DSO distributions do not correspond to a single possible value for calculated deltas but to a continuous range of possible values for these calculated deltas. For example, the first class contains values between 0 and 3, the second class values between 4 and 6, and so on. Thus, each class contains several possible values for deltas. However, as before, the classes are preferably disjoined from each other and do not overlap each other. Therefore, during step 114 or 154, the identification of the most deficient class amounts to identifying several predicted deltas. Then, several predicted addresses are constructed from each of a respective predicted delta. Thus, in this variant, the method provides several predicted addresses as a prediction of several data to be preloaded in the cache memory 22. Preferably, in this embodiment, the size of a class is chosen equal to the size of a line of the cache memory 22 or a block of the cache memory 22. [00105] In a variant, the SM sequence is separated from the SO sequence by one or more calculated deltas. Thus, in this variant, the SM and SO sequences are disjoint. The SM sequence is not necessarily an access sequence constructed from the deltas calculated during an earlier sliding window [t3; t2]. For example, alternatively, the sequence SM contains deltas successively calculated between instants t3 and t2 fixed that do not evolve then as new deltas are calculated. By way of illustration, in this case, the memorization of the sequence SM is triggered by instructions incorporated in the program 12. The sequence SM can also be a pre-recorded sequence and loaded into memory at the beginning of the execution of the program 12 as described in the patent application US5305389 A1. [00108] In a variant, the sequence SO does not contain the delta calculated for the most recent t instant. The relationship between the size of the sequence SO and the size of the sequence SM can be different. For example, this relation is defined by the following equation: N = Μ-β, where β is an integer, preferably greater than or equal to two and less than or equal to M-2. In another variant, the size N of the sequence SO may be chosen greater than the size M of the sequence SM. In this case, β is an integer less than or equal to -1 and, for example, greater than or equal to -5 or -3. The DSM distribution is not necessarily constructed from an access sequence identified by the module 24. In a variant, the DSM distribution is a statistical distribution pre-stored in the memory 8 and loaded by the program 12 at the beginning of its execution or during its execution. In this case, it is not necessary to memorize the SM sequence to build the DSM distribution. The DSM or DSO distribution may be stored in other forms than a histogram or a distribution function. For example, each statistical distribution is constructed and stored as a probability density. Other methods are possible for calculating the similarity metrics between the DSM and DSO distributions. For example, a calculation of the correlation between the DSM and DSO distributions also provides a measure of the similarity between these two statistical distributions. Another hypothesis test such as Smirnov's nonparametric hypothesis test can also be used instead of the Cramer-Von Mises test. In the case of the Smirnov hypothesis test, the similarity metric po can also be a p-value. It is calculated, for example, using the following relation: where: - p (y) is the value of the similarity metric po, - K is a predetermined positive integer, typically greater than 3 or 50 or 100, - y is defined by the following relation: - Δη is the statistic of the Smirnov test. It is the equivalent of the T statistic of the Cramer von misses test. It is between 0 and 1. It also corresponds to the maximum difference between the two statistical distributions. - n is defined by the following relation: At a given instant, similarity metrics between several different DSM distributions and the DSO distribution can be calculated. Then, the DSM distribution most similar to the DSO distribution is used to identify the predicted delta. For example, the different DSM distributions are each constructed from an SM sequence having a size M different from the other SM sequences used to construct the other DSM distributions. Therefore, it allows for a given moment t to simultaneously test different possible sizes of the SM sequence to select, from these different sizes tested, the most appropriate size to identify the predicted delta. Then, it is this most appropriate size that is used for the SM sequence during subsequent iterations of the process. Rather than using a p-value as a similarity metric, it is also possible to use, for example, the T or Δη statistic directly and to compare it with a predetermined threshold. In this case, the value of the predetermined threshold is typically obtained from a table which gives the value of this threshold as a function of the desired degree of confidence. [00115] Other methods of calculating the error Eo prediction are possible. For example, the number C is chosen much larger, or even equal to infinity. It is also possible to calculate a prediction error which is in addition a function of the difference, in absolute value, between the predicted delta for the next instant t identified in step 114 or 154 and the delta actually calculated for this instant t. To trigger the modification of the size of the SM and SO sequences, other criteria are possible. For example, as a variant, only one of the conditions selected from conditions 1) and 2) is used. [00117] Other embodiments of step 168 are possible. For example, the size M is incremented from 2 to 2 and not from 1 to 1. Alternatively, the method of Figure 13 is implemented without implementing the method of Figure 10. For example, the method of Figure 13 is combined with the implementation of the method of Figure 4. In this case, a change in the size of the SM and SO sequences is only caused by the execution of the method of FIG. 13. In another variant, the method of FIG. 13 is used to explore possible MP sizes for the sequence SMP smaller than the size M of the currently used SM sequence. For the same given instant t, the method of FIG. 13 can be executed for several different MP sizes. This makes it possible to explore at a given instant several possible sizes for the sequence SM. [00120] In another embodiment, a library of several different DSM distributions is stored in the memory 6. Then, at predetermined intervals, the module 24 selects in this library the DSM distribution to use. For example, to select the DSM distribution, it calculates for each DSM distribution recorded in this library the similarity metric and / or the prediction error as described with reference to step 184. Next, it selects the DSM distribution that maximizes the similarity metric and / or which minimizes the prediction error. In this variant, it is not necessary to memorize and use the SM sequence. The preloading module 24 can also be integrated inside the microprocessor 20. It can also be implemented in software form. In this case, it is the microprocessor 20 which executes the instructions stored in the memory of the module 24. In the latter case, the module 24 is an information recording medium containing the instructions necessary for the execution of the methods of the FIGS. 4, 8, 10 and 13. The module 24 can also be integrated in the cache memory 22. In this case, the microcomputer 32 is adapted to perform all the functions of the module 24.
权利要求:
Claims (10) [1" id="c-fr-0001] A method for predicting a data item to be precharged in a cache memory, said method comprising: a) for each instant t where a microprocessor executes a read instruction of a piece of data necessary for the execution of a program, the calculation (104) of a deviation, called delta, between the address of the data to be read contained in this read instruction executed at time t and the address of the data to be read contained in this same read instruction when its previous execution at a time t-1, two read instructions being the same if they both correspond to the same value of the microprocessor ordinal counter, b) the storage (108) of an observed access sequence containing only the N delta calculated successively for each instant t included inside a sliding window [ti; t0], where the instants t0 and ti are equal to instants t, respectively the most recent and the oldest, for which a delta of the observed access sequence has been calculated and the number N is a predetermined integer greater than or equal to in two, characterized in that the method also comprises: c) acquiring (110; 150) a statistical distribution, called "model", of the deltas of a model access sequence, this model statistical distribution comprising: - classes of possible values for the deltas, and associated with each of these classes, - a number depending on the number of occurrences of this class in the model access sequence, d) the construction (112; statistical distribution, called "observed", of the deltas of the observed access sequence, e) the identification (114, 154) in the observed statistical distribution, by comparing it with the model statistical distribution, of the most deficient class, that is to say from the key for which the NoDSM - NoDSO difference is maximal, where NoDSM and NoDSO are the occurrence numbers of this class deduced, respectively, from the model statistical distribution and the observed statistical distribution, f) the supply (116) as predicting the data to be precharged in the cache memory before the next execution of the same read instruction, of at least one predicted address where the data to be preloaded is contained, this predicted address being constructed from the most deficient class identified during step e). [2" id="c-fr-0002] 2. Method according to claim 1, wherein, in step c), the acquisition of the model statistical distribution includes: storing (108) a model access sequence containing only the last M delta successively calculated for each moment t included within a sliding window [t3; t2] prior to the sliding window [ti; t0], where the instants t2 and t3 are equal to instants t, respectively the most recent and the oldest, for which a delta of the model access sequence has been calculated, and the number of deltas calculated for instants t included between the instants t2 and tee a predetermined constant, and the number M is a predetermined integer greater than or equal to two, and - whenever a new pattern access sequence is stored, the construct (110; 150) of the model statistical distribution from the deltas of this stored model access sequence. [3" id="c-fr-0003] 3. Method according to claim 2, wherein, systematically, there exists no time t between t2 and t1 for which a delta is calculated so that the pattern access sequence immediately immediately precedes the sequence of observed access. [4" id="c-fr-0004] 4. Method according to any one of the preceding claims, wherein the method comprises: calculating (160) a similarity metric whose value varies monotonically as a function of the importance of the differences between the model statistical distributions; and observed and / or calculating (164) a prediction error whose value varies monotonically as a function of the number of times the address predicted from the access sequence observed during the sliding window [ti; t0] is different from the address of the data to be read actually contained in the read instruction executed at the instant following t0 + 1, and - in response to the crossing of a threshold predetermined by the calculated similarity metric and / or by the calculated prediction error, the modification (168) of the number N of deltas contained in the observed access sequence or the number M of deltas contained in the model access sequence. [5" id="c-fr-0005] 5. Method according to any one of the preceding claims, wherein the method comprises: calculating (160) a first similarity metric whose value varies monotonously as a function of the importance of the differences between the statistical distributions. model and observed and / or calculation (164) of a first prediction error whose value varies monotonically as a function of the number of times the address predicted from the model statistical distribution and the access sequence observed during the sliding window [ti; t0] is different from the address of the data to be read actually contained in the read instruction executed at the instant following t0 + 1, and - the storage (180) of an access sequence, called "prediction ", containing only P delta successively calculated for each instant t included within a sliding window [t5; t4] prior to the sliding window [ti; t0], where the instants t4 and t5 are equal to the instants t, respectively the most recent and the oldest, for which a delta of the prediction access sequence has been calculated and the number P is predetermined integer number different from the number M, - the construction (182) of a statistical distribution called "prediction", from the deltas of the prediction access sequence, - the calculation (184) of a second metric of similarity and / or of a second prediction error using the prospecting statistical distribution in place of the model statistical distribution, and then - if the calculated second similarity metric or the second calculated prediction error is better than, respectively, the first calculated similarity metric or the first calculated prediction error, then the number M is taken as equal (186) to the number P for the next iteration of the method, otherwise the number M remains unchanged. [6" id="c-fr-0006] A method according to any one of the preceding claims, wherein the observed access sequence systematically contains the delta calculated from the address of the data to be read contained in the most recently executed read instruction. [7" id="c-fr-0007] The method of any of the preceding claims, wherein, at each iteration of step e), only one predicted address is provided. [8" id="c-fr-0008] 8. A method of executing a program, stored in a main memory, by a microprocessor associated with a cache memory, this method comprising: the execution by the microprocessor of an instruction for reading a data item necessary for execution of the program, this instruction containing the address where this data is stored in the main memory, - if the data corresponding to the address contained in the read instruction to be executed is in the cache memory, the reading (56 ) of this data in the cache memory, and if not the reading (58) of this data in the main memory or in another memory different from the cache memory, - before the microprocessor executes again the same read instruction, the prediction (62) of the data to be precharged in the cache memory and the precharging of the predicted data in the cache memory or in a buffer memory, characterized in that the prediction tion (62) is carried out according to any one of the preceding claims. [9" id="c-fr-0009] 9. An information recording medium, characterized in that it comprises instructions for the execution of a method according to any one of the preceding claims, when these instructions are executed by a microprocessor. [10" id="c-fr-0010] 10. Electronic module (24) for predicting a data item to be precharged in a cache memory, this module being arranged for: a) for each instant t where a microprocessor executes a read instruction of a piece of data necessary for the execution of a program, calculating a deviation, called delta, between the address of the data to be read contained in this read instruction executed at time t and the address of the data to be read contained in this same read instruction when its previous execution at a time t-1, two read instructions being the same if they both correspond to the same value of the microprocessor ordinal counter, b) storing an access sequence observed containing only the N delta calculated successively for each moment t included inside a sliding window [ti; t0], where the instants t0 and ti are equal to instants t, respectively the most recent and the oldest, for which a delta of the observed access sequence has been calculated and the number N is a predetermined integer greater than or equal to in two, characterized in that the electronic module is also arranged to: c) acquire a statistical distribution, called "model", of the deltas of a model access sequence, this model statistical distribution comprising: - classes of possible values for deltas, and associated with each of these classes, - a number depending on the number of occurrences of this class in the model access sequence, d) construct a statistical distribution, called "observed", of the deltas of the sequence d observed access, e) identify in the statistical distribution observed, by comparing it with the model statistical distribution, the most deficient class, ie the class for which the difference NoDSM - NoDSO is maximum, where NoDSM and NoDSO are the occurrence numbers of this class deduced, respectively, from the model statistical distribution and the observed statistical distribution, f) provide as a prediction of the data to be precharged in the cache before the next execution of the same read instruction, at least one predicted address where the data to be preloaded is contained, this predicted address being constructed from the most deficient class identified in step e).
类似技术:
公开号 | 公开日 | 专利标题 EP3182292B1|2018-06-20|Method for predicting data to be pre-loaded in a cache memory EP1876602A1|2008-01-09|Method for refreshing a dynamic RAM, and corresponding dynamic RAM device, in particular incorporated in a cellular mobile telephone FR2858874A1|2005-02-18|MEMORY CONTROL DEVICE, CHIP CARD, AND METHOD FOR CONTROLLING MEMORY READING OPERATION FR2624994A1|1989-06-23|INTERMEDIATE TRANSLATION REGISTER CONTROL SYSTEM FR2844613A1|2004-03-19|Rapid data transfer system to memory includes data compression and decompression engine controlling access to memory bank EP1748374A1|2007-01-31|Procedure and device protecting a memory against attacks by error injection EP0392932B1|1994-07-20|Method and device for speeding-up memory accesses using a modified LRU algorithm FR2939922A1|2010-06-18|PHYSICAL MANAGER OF SYNCHRONIZATION BARRIER BETWEEN MULTIPLE PROCESSES FR2831971A1|2003-05-09|METHOD FOR MEMORIZING DATA WITH ERROR CORRECTION EP1876601B1|2011-06-01|Method for refreshing a dynamic RAM, in particular in standby mode and in active operation mode, and corresponding dynamic RAM device, for example incorporated in a cellular mobile telephone FR2805368A1|2001-08-24|SYSTEM AND METHOD UTILIZING SPECEMATIVE ACCELERATION TO ANTEMEMOIRE FOR IMPROVED PERFORMANCE TW201502782A|2015-01-16|Os bootloader caching in non-volatile memory EP2836913B1|2019-12-25|Device for generating a signature during execution of a program task, and method for comparing flows of execution EP0435718A1|1991-07-03|Processor with plural microprogrammed units and with a mechanism for anticipated instruction execution EP0394115B1|1994-07-13|Apparatus for speeding-up memory accesses in a computer system EP1248261A2|2002-10-09|Random and rapid DRAM memory access management method EP2724237B1|2018-03-28|Method of managing the endurance of non-volatile memories FR2778254A1|1999-11-05|Memory cache cleaning method to reduce clock cycles in computer system with cache memories FR3055992A1|2018-03-16|INDEX MANAGEMENT IN A FLASH MEMORY EP3080815A2|2016-10-19|System and method for managing wear of an electronic memory JP7038656B2|2022-03-18|Access to cache EP3598314A1|2020-01-22|Direct memory access EP3637266A1|2020-04-15|Method for accessing a memory FR3103590A1|2021-05-28|Method for constructing a signature characteristic of accesses, by a microprocessor, to a memory FR3104285A1|2021-06-11|Checking the integrity of a memory
同族专利:
公开号 | 公开日 US20170168947A1|2017-06-15| FR3045183B1|2018-01-19| EP3182292A1|2017-06-21| US10002079B2|2018-06-19| EP3182292B1|2018-06-20|
引用文献:
公开号 | 申请日 | 公开日 | 申请人 | 专利标题 US5305389A|1991-08-30|1994-04-19|Digital Equipment Corporation|Predictive cache system| US6134643A|1997-11-26|2000-10-17|Intel Corporation|Method and apparatus for cache line prediction and prefetching using a prefetch controller and buffer and access history| TW410295B|1999-03-02|2000-11-01|Via Tech Inc|Memory access control device| US7113935B2|2000-12-06|2006-09-26|Epicrealm Operating Inc.|Method and system for adaptive prefetching| US6721870B1|2001-06-12|2004-04-13|Emc Corporation|Prefetch algorithm for short sequences| US7155575B2|2002-12-18|2006-12-26|Intel Corporation|Adaptive prefetch for irregular access patterns| US8433852B2|2010-08-30|2013-04-30|Intel Corporation|Method and apparatus for fuzzy stride prefetch|US10529396B2|2017-06-22|2020-01-07|International Business Machines Corporation|Preinstall of partial store cache lines| US10303608B2|2017-08-22|2019-05-28|Qualcomm Incorporated|Intelligent data prefetching using address delta prediction| US10437718B1|2018-04-27|2019-10-08|International Business Machines Corporation|Computerized methods for prefetching data based on machine learned sequences of memory addresses| CN109634527B|2018-12-12|2020-06-09|华中科技大学|Flash memory service life prediction method realized in SSD| US10838870B2|2019-04-17|2020-11-17|EMC IP Holding Company LLC|Aggregated write and caching operations based on predicted patterns of data transfer operations|
法律状态:
2016-12-29| PLFP| Fee payment|Year of fee payment: 2 | 2017-06-16| PLSC| Publication of the preliminary search report|Effective date: 20170616 | 2018-01-02| PLFP| Fee payment|Year of fee payment: 3 | 2019-09-27| ST| Notification of lapse|Effective date: 20190906 |
优先权:
[返回顶部]
申请号 | 申请日 | 专利标题 FR1562435A|FR3045183B1|2015-12-15|2015-12-15|METHOD FOR PREDICTING DATA TO BE PRELOADED IN A CACHE MEMORY|FR1562435A| FR3045183B1|2015-12-15|2015-12-15|METHOD FOR PREDICTING DATA TO BE PRELOADED IN A CACHE MEMORY| EP16201190.2A| EP3182292B1|2015-12-15|2016-11-29|Method for predicting data to be pre-loaded in a cache memory| US15/380,066| US10002079B2|2015-12-15|2016-12-15|Method of predicting a datum to be preloaded into a cache memory| 相关专利
Sulfonates, polymers, resist compositions and patterning process
Washing machine
Washing machine
Device for fixture finishing and tension adjusting of membrane
Structure for Equipping Band in a Plane Cathode Ray Tube
Process for preparation of 7 alpha-carboxyl 9, 11-epoxy steroids and intermediates useful therein an
国家/地区
|