Prefetcher design system based on path history signature and optimization method thereof

By designing a prefetcher system based on path history signatures, adopting multi-step mode and confidence evaluation, the problems of traditional prefetchers in inter-page historical information interference and cross-page prediction are solved, and the accuracy and efficiency of prefetching are improved.

CN120670334APending Publication Date: 2025-09-19JIANGSU HUACHUANG MICROSYSTEM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510865383.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Traditional historical prefetchers in processors have problems such as interference between historical information between pages, inability to predict across pages, and low prediction accuracy caused by fixed prefetch depth.

Method used

A prefetcher design system based on path history signature is adopted, including intra-page signature table, intra-page offset prediction table, global history register and prefetch filter. Prefetch accuracy is evaluated through multi-step mode, step confidence and signature confidence, and prefetch depth and range are dynamically adjusted.

Benefits of technology

It improves the accuracy of prefetching, reduces the interference of historical information between pages, enables cross-page prediction, and improves cache hit rate and memory access efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670334A_ABST
    Figure CN120670334A_ABST
Patent Text Reader

Abstract

The invention discloses a prefetcher design system based on path history signatures. The prefetcher design system comprises an in-page signature table, an in-page offset prediction table, a global history register and a prefetch filter, the invention also discloses a prefetcher optimization method based on the path history signature. The method comprises the following steps: S1, confirming a physical page number corresponding to the physical address according to the physical address; s2, accessing an in-page signature table according to the physical page number, and indexing an in-page offset prediction table by using the obtained historical signature; s3, calculating the overall confidence coefficient of the prediction path through a prefetching filter, and judging whether the overall confidence coefficient reaches a set threshold value or not; and S4, when it is detected that page crossing occurs in a certain time of prefetching, accessing the in-page signature table again by using a new physical page number, and accessing the in-page offset prediction table by using the obtained historical signature. According to the method, a multi-step mode is supported, inter-page historical information interference can be reduced, a cross-page access mode can be predicted, and prediction accuracy can be evaluated by using path confidence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of processor data prefetching, and in particular to a prefetcher design system based on path history signature and an optimization method thereof. Background Art

[0002] As computer system performance continues to improve, the gap between processor execution speed and memory access latency continues to widen. This phenomenon is known as the memory wall. To address this problem, prefetching technology is widely used in modern processor designs. Prefetching technology predicts future data accesses by the program and loads data into the cache in advance, thereby reducing memory access latency and improving system performance.

[0003] A history-based prefetcher is a common prefetching strategy that predicts future accesses by analyzing historical memory access patterns. Although traditional history prefetchers are effective in some scenarios, they face serious challenges when transitioning between physical pages. For example, many existing technologies use very short historical data for prediction, or rely only on the first offset within the page. This approach seriously affects the accuracy of predictions due to the lack of sufficient historical information. Some designs use longer global historical information, which causes interference between historical information between pages, that is, the historical information within the page is not separated. Traditional prefetching methods usually stagnate when encountering physical page boundaries, resulting in the inability to use the historical information of the previous page for cross-page predictions, which makes these methods unable to achieve maximum performance in scenarios with multi-page program access. The impact of prefetch success rate and prefetch depth is not considered. Traditional technologies use a fixed depth for prefetching, while this value should change dynamically. Therefore, at some moments, it will occupy storage bandwidth due to being too long, and at other moments, the prefetch coverage range will be insufficient due to being too short. Summary of the Invention

[0004] In response to the above problems, the purpose of the present invention is to propose a prefetcher design system based on path history signature and its optimization method. The present invention supports multi-step mode, and can reduce the interference of historical information between pages and predict access patterns across pages. At the same time, path confidence can be used to evaluate the accuracy of the prediction and improve the accuracy of prefetching.

[0005] This is achieved through the following technical solutions: First, a prefetcher design system based on path history signatures is proposed, including: an intra-page signature table; used to record the intra-page offset address and historical signature of the last prefetch of the page; an intra-page offset prediction table; used to record the step increment, step confidence and signature confidence of the prefetch address within the page, and indexed according to the historical signature output by the intra-page signature table; a global history register; used to record global historical step information, and fold the current long-bit-width historical step information into a short-bit-width historical signature; a prefetch filter; by maintaining a confidence value on each predicted path, and dynamically increasing or decreasing the depth and range of the prefetch according to the accuracy of the historical prefetch address. The prefetcher design system of the present invention supports multi-step mode, and can reduce the interference of historical information between pages and predict cross-page access patterns, solving the problem of low prediction accuracy caused by the inability of traditional methods to predict cross-page access patterns.

[0006] Preferably, the field composition of the data structure of the page signature table at least includes: Tag, the page offset address of the last prefetch, and the signature. The page signature table can record the access mode of each page.

[0007] Preferably, each page corresponds to an independent intra-page signature table. By storing an independent intra-page signature table for each page, the interference of historical information between pages can be reduced and the accuracy of pre-fetching can be improved.

[0008] Preferably, the data structure of the intra-page offset prediction table includes at least the following fields: tag, step increment, step confidence, and signature confidence. The intra-page offset prediction table can accurately predict prefetch addresses, improve cache hit rates, and reduce memory access latency.

[0009] Preferably, each intra-page offset prediction table includes multiple step increments, and each step increment corresponds to a corresponding step confidence. By storing multiple step increments in the intra-page offset prediction table and each step increment corresponds to a corresponding step confidence, the accuracy of prefetching can be improved.

[0010] Preferably, when a historical signature matches the intra-page offset prediction table, the step increment with the highest confidence level is selected. If the step increment from a previous prefetch is used, the corresponding step confidence level is ++, otherwise -. Furthermore, if any prefetch succeeds, the signature confidence level is ++; if any prefetch fails, the signature confidence level is -. By using both step confidence and signature confidence to represent the overall reliability of the current prefetch, the prefetch results can be made more accurate.

[0011] Preferably, the global history register is implemented as a 128-bit shift register, which stores the predicted step increment after completing the step increment prediction. Through the global history register, the corresponding history signature can be obtained when the signature table in the page is missed, thereby improving prefetch efficiency.

[0012] On the second aspect, a prefetcher optimization method based on path history signature is also proposed, which includes the following steps: S1. In the cache hierarchy, when the L2 cache receives an access request for a physical address, it confirms the corresponding physical page number according to the physical address; S2. Access the page signature table according to the physical page number, if it hits, obtain the historical signature of the current page, if not, obtain the historical signature of the current page according to the global history register; then use the obtained historical signature to index the page offset prediction table to obtain the maximum step confidence in the current page and its corresponding step increment; S3. Calculate the predicted path through the prefetch filter Overall confidence, and determine whether it reaches the set threshold; if the threshold is not reached, the prefetch process is stopped; if it is higher than the threshold, a prefetch request is initiated, and the corresponding step increment is sent to the next level cache, and the step increment is updated to the current page offset prediction table and the global history register; S4, when it is detected that a certain prefetch occurs across pages, the page signature table is accessed again using the new physical page number. If a hit occurs, the historical signature corresponding to the new physical page number is obtained. If there is no hit, the historical signature corresponding to the new physical page number is obtained according to the global history register; and the obtained historical signature is used to access the page offset prediction table to perform the prefetch process. The prefetcher optimization method of the present invention accesses the page signature table according to the physical page number and obtains the page's historical signature before performing the prefetch process, which can make the prefetch result more accurate.

[0013] Preferably, in step S3, the overall confidence of each predicted path is calculated by multiplying the confidence values ​​of all predictions on that predicted path. By calculating the overall confidence of each predicted path, it is possible to determine whether to continue prefetching based on the overall confidence of the predicted path and evaluate the accuracy of prefetching.

[0014] Preferably, in step S4, after obtaining the history signature corresponding to the new physical page number according to the global history register, the history signature is updated to the corresponding in-page signature table. By updating the history signature to the corresponding in-page signature table, the accuracy of subsequent pre-fetching can be improved.

[0015] Compared with the prior art, the present invention has the following beneficial effects: The technical solution of the present invention can support multi-step mode, reduce interference of historical information between pages, and predict cross-page access patterns by storing multiple step increments and their corresponding step confidences in the intra-page offset prediction table and saving an independent intra-page signature table for each page, thereby solving the problem of low prediction accuracy caused by the inability of traditional methods to predict cross-page access patterns. At the same time, through the global history register, the corresponding historical signature can be obtained when the intra-page signature table is missed, thereby improving the prefetch efficiency, and dynamically increasing or decreasing the prefetch depth and range according to the accuracy of the historical prefetch address, thereby improving the prefetch accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of the structure of a prefetcher design system based on path history signature; Figure 2 Flowchart of a prefetcher optimization method based on path history signature. DETAILED DESCRIPTION

[0017] The following is a combination of the embodiments of the present invention Figure 1-2 , the technical solutions in the embodiments of the present invention are described in detail.

[0018] like Figure 1 FIG. 1 is a schematic diagram of a prefetcher design system based on path history signatures, including an intra-page signature table, an intra-page offset prediction table, a global history register, and a prefetch filter. Specifically, the system includes the following: The in-page signature table is used to record the in-page offset address and historical signature of the last prefetch of the page; specifically, the field composition of the data structure of the in-page signature table includes at least: Tag, which refers to the number of the current page and is used to uniquely identify the page; the in-page offset address of the last prefetch; Signature, which is a signature obtained after compression based on the step increment corresponding to the most recent n prefetches, and is used to index the in-page offset prediction table, where n is a positive integer; the prefetcher design system of the present invention can record the access pattern within each page through the in-page signature table.

[0019] In this embodiment, each page corresponds to an independent intra-page signature table, that is, the historical information in the page is separated and processed, which can reduce the interference of historical information between pages and improve the accuracy of pre-fetching.

[0020] The intra-page offset prediction table is used to record the step increment, step confidence and signature confidence of the prefetch address within the page, and is indexed according to the historical signature output by the intra-page signature table; specifically, the field composition of the data structure of the intra-page offset prediction table includes at least: Tag, which refers to an N-bit signature, such as 12-bit. When the intra-page offset prediction table is accessed in parallel using the historical signature output by the intra-page signature table, a match therewith is considered a hit; step increment refers to the provided prediction step; step confidence is implemented by a 4-bit saturated counter, and if the prediction is correct, it is ++, otherwise it is --; signature confidence is implemented by a 4-bit saturated counter, and if the prediction is correct, it is ++, otherwise it is --; the prefetcher design system of the present invention can accurately predict the prefetch address through the intra-page offset prediction table, improve the cache hit rate, and reduce the memory access delay.

[0021] In this embodiment, each intra-page offset prediction table contains multiple step increments, and each step increment corresponds to a corresponding step confidence. When a historical signature hits the intra-page offset prediction table, the step increment with the largest corresponding step confidence is selected; if the step increment of a certain prefetch is used, the corresponding step confidence is ++, that is, the step confidence increases, otherwise -, that is, the step confidence decreases; and if any prefetch is successful, the signature confidence is ++, that is, the signature confidence increases, and if the prefetch fails, the signature confidence is -, that is, the signature confidence decreases; the present invention improves the accuracy of prefetching by storing multiple step increments in the intra-page offset prediction table and each step increment corresponds to a corresponding step confidence, and by using step confidence and signature confidence to represent the overall credibility of this prefetch, the prefetch result can be made more accurate.

[0022] In this embodiment, the present invention uses "step confidence / signature confidence" to represent the overall credibility of a certain prefetch, and signature confidence is represented by Csig. The larger Csig is, the lower the reliability of a certain prefetch path is. That is, although a certain historical signature appears frequently, there are multiple step patterns, resulting in increased prefetch uncertainty. Among them, Csig stands for Confidence of Signature, which represents signature confidence and is used to measure the credibility of the prefetch path associated with a certain historical signature.

[0023] The global history register is used to record the global historical step information and fold the current long-width historical step information into a short-width historical signature; wherein, folding is to compress the long-width historical step information into a short-width signature in order to obtain a historical signature that can index the intra-page offset prediction table.

[0024] In this embodiment, the global history register is implemented using a 128-bit shift register, which stores the predicted step increment after completing the step increment prediction; the prefetcher design system of the present invention can obtain the corresponding history signature through the global history register when the signature table in the page is missed, thereby improving the prefetch efficiency.

[0025] The prefetch filter maintains a confidence value on each predicted path and dynamically increases or decreases the depth and range of prefetching based on the accuracy of historical prefetch addresses. The workflow of the prefetch filter is as follows: The first step is to initialize the confidence value: in the initial state, its confidence value is determined by the result of the page offset prediction table; The second step is confidence value update: When a new prefetch is initiated, the confidence value is adjusted based on whether the prediction result is successfully verified, that is, whether it is confirmed by subsequent accesses. If the prefetch is successful, the confidence value is increased; if the prefetch fails, the confidence value is decreased. The third step is path confidence calculation: the overall confidence of each predicted path is calculated; the overall confidence of the predicted path is represented by the product of all predicted confidence values. When the value is lower than the set threshold, the prefetching process will be stopped.

[0026] Among them, the depth of prefetch refers to the number of steps of future memory access addresses that the prefetcher can predict and load in advance, and the range of prefetch refers to the size of the memory address space that the prefetcher can cover; the prefetcher design system of the present invention predicts the credibility of the entire prediction path by calculating the overall confidence of each prediction path, and dynamically evaluates the reliability of the prediction path, which can improve the accuracy of prefetching.

[0027] like Figure 2 As shown, it is a flow chart of a prefetcher optimization method based on path history signature. First, when the L2 cache receives an access request for a physical address, it confirms the corresponding physical page number according to the physical address; then, the page signature table is accessed according to the physical page number, and the obtained historical signature is used to index the page offset prediction table to obtain the maximum step confidence in the current page and its corresponding step increment; then, the overall confidence of the predicted path is calculated through the prefetch filter, and it is determined whether it reaches the set threshold; finally, when it is detected that a certain prefetch crosses the page, the new physical page number is used to access the page signature table again, or the historical signature corresponding to the new physical page number is obtained according to the global history register; and the obtained historical signature is used to access the page offset prediction table; the present invention supports multi-step mode, and can reduce the interference of historical information between pages and predict the access mode across pages, and can use path confidence to evaluate the accuracy of the prediction.

[0028] The method specifically comprises the following steps: S1. In the cache hierarchy, when the L2 cache receives an access request for a physical address, it confirms the corresponding physical page number based on the physical address.

[0029] S2. Access the in-page signature table according to the physical page number. If a hit is found, obtain the historical signature of the current page. If no hit is found, obtain the historical signature of the current page according to the global history register. Then use the obtained historical signature to index the in-page offset prediction table to obtain the maximum step confidence in the current page and its corresponding step increment.

[0030] S3. Calculate the overall confidence of the predicted path through the prefetch filter and determine whether it reaches the set threshold; if it does not reach the threshold, stop the prefetch process; if it is higher than the threshold, initiate a prefetch request, send the corresponding step increment to the next level cache, and update the step increment to the current page offset prediction table and the global history register.

[0031] Among them, the calculation method of the overall confidence of each predicted path is the product of the confidence values ​​of all predictions on the predicted path; by calculating the overall confidence of each predicted path, it is possible to determine whether to continue prefetching based on the overall confidence of the predicted path and evaluate the accuracy of prefetching.

[0032] S4. When it is detected that a prefetch crosses pages, the new physical page number is used to access the page signature table again. If a hit is found, the historical signature corresponding to the new physical page number is obtained. If there is no hit, the historical signature corresponding to the new physical page number is obtained according to the global history register; and the obtained historical signature is used to access the page offset prediction table to perform the prefetch process.

[0033] Among them, after obtaining the history signature corresponding to the new physical page number according to the global history register, the history signature is updated to the corresponding in-page signature table, which can improve the accuracy of subsequent pre-fetching.

[0034] To sum up, the present invention can support multi-step mode, reduce interference of historical information between pages, and predict cross-page access patterns by storing multiple step increments and their corresponding step confidences in the intra-page offset prediction table and saving an independent intra-page signature table for each page, thereby solving the problem of low prediction accuracy caused by the inability of traditional methods to predict cross-page access patterns; at the same time, through the global history register, the corresponding historical signature can be obtained when the intra-page signature table is missed, thereby improving the prefetch efficiency, and dynamically increasing or decreasing the prefetch depth and range according to the accuracy of the historical prefetch address, thereby improving the prefetch accuracy, and having significant progress.

[0035] The above embodiments are only for illustrating the technical idea of ​​the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the present invention.

Claims

1. A prefetcher design system based on path history signature, characterized in that: include: In-page signature table; used to record the in-page offset address and historical signature of the last prefetch of the page; Intra-page offset prediction table; Used to record the step increment, step confidence, and signature confidence of the pre-fetched address within the page, and index based on the historical signature output by the signature table within the page; Global history register; used to record the global historical step information and fold the current long-bit-width historical step information into a short-bit-width historical signature; Prefetch filter; By maintaining a confidence value on each predicted path, and dynamically increasing or decreasing the depth and range of prefetching based on the accuracy of historical prefetched addresses.

2. A prefetcher design system based on path history signature according to claim 1, characterized in that: The fields of the data structure of the in-page signature table include at least: Tag, the in-page offset address of the last prefetch, and the signature.

3. A prefetcher design system based on path history signature according to claim 1, characterized in that: Each page corresponds to an independent in-page signature table.

4. A prefetcher design system based on path history signature according to claim 1, characterized in that: The fields of the data structure of the intra-page offset prediction table include at least: Tag, step increment, step confidence and signature confidence.

5. The prefetcher design system based on path history signature according to claim 1, characterized in that: Each intra-page offset prediction table contains multiple step increments, and each step increment corresponds to a corresponding step confidence.

6. A prefetcher design system based on path history signature according to claim 1, characterized in that: When the historical signature hits the page offset prediction table, the step increment with the largest corresponding step confidence is selected; if the step increment of a prefetch is used, the corresponding step confidence is ++, otherwise -; and if any prefetch succeeds, the signature confidence is ++, and if the prefetch fails, the signature confidence is -.

7. The prefetcher design system based on path history signature according to claim 1, characterized in that: The global history register is implemented as a 128-bit shift register, which stores the predicted step increment after completing the step increment prediction.

8. A method for optimizing a prefetcher based on a path history signature, using a prefetcher design system based on a path history signature according to any one of claims 1 to 7, characterized in that: The method comprises the following steps: S1. In the cache hierarchy, when the L2 cache receives an access request for a physical address, it determines the corresponding physical page number based on the physical address. S2. Access the page signature table based on the physical page number. If a hit is found, obtain the historical signature of the current page. If not, obtain the historical signature of the current page based on the global history register. Then, use the obtained historical signature to index the page offset prediction table to obtain the maximum step confidence and its corresponding step increment within the current page. S3. Calculate the overall confidence of the predicted path through the pre-fetch filter and determine whether it reaches the set threshold; If the threshold is not reached, the prefetch process is stopped; if it is higher than the threshold, a prefetch request is initiated, the corresponding step increment is sent to the next level cache, and the step increment is updated to the current page offset prediction table and the global history register; S4. When it is detected that a prefetch crosses pages, the new physical page number is used to access the page signature table again. If a hit is found, the historical signature corresponding to the new physical page number is obtained. If there is no hit, the historical signature corresponding to the new physical page number is obtained according to the global history register; and the obtained historical signature is used to access the page offset prediction table to perform the prefetch process.

9. The method for optimizing a prefetcher based on a path history signature according to claim 8, wherein: In step S3, the overall confidence of each predicted path is calculated by multiplying the confidence values ​​of all predictions on the predicted path.

10. The method for optimizing a prefetcher based on a path history signature according to claim 8, wherein: In step S4, after the history signature corresponding to the new physical page number is obtained according to the global history register, the history signature is updated to the corresponding in-page signature table.