A conversion lookaside buffer verification method, device, equipment and storage medium
By comparing the input and resource content of the TLB predictor and the TLB to be tested in the TLB verification platform, and using multiple TLB functional models to verify the behavior of the TLB, the problem of incomplete TLB verification in the existing technology is solved and the accuracy of the verification is improved. and reliability, detecting performance issues early.
Patent Information
- Application Number
- CN202410764898.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-14
Smart Images

Figure CN118349491B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a conversion lookaside buffer verification method, device, equipment and storage medium. Background Art
[0002] The Memory Management Unit (MMU) is generally composed of a Translation Lookaside Buffer (TLB) and a Page Table Walk (PTW) module. The TLB is mainly responsible for storing various types of page tables for input read and write requests to search and do address translation; it is responsible for determining whether prefetching is required and for generating some exception interrupts. The PTW module is responsible for issuing page table walks to read page tables and write new page tables into the TLB.
[0003] Existing MMU verification methods basically adopt end-to-end verification methods. Generally, independent testbench will not be built for verification of sub-modules inside the MMU, resulting in the inability to guarantee whether the internal behavior of the TLB is correct (including TLB hit / miss, replacement strategy of page tables in the TLB, whether prefetching and invalidate operations occur correctly, etc.). Only the correctness of end-to-end address translation can be guaranteed. Such verification quality obviously cannot meet the verification requirements.
[0004] In addition, in end-to-end verification, it is not easy to create various cross-scenarios, especially when facing multiple sets of input requests, and it is not possible to discover performance problems in TLB design at an early stage. Only after all MMUs are designed and through MMU system-level performance testing can it be discovered whether there are performance problems with the TLB.
[0005] Secondly, there are many types of TLB units in the TLB. Each TLB unit has different formats, storage, and query rules, which makes verification quite difficult. The existing verification process is unlikely to cover all TLB behaviors. Summary of the invention
[0006] The present invention provides a translation lookaside buffer verification method, device, equipment and storage medium, which can improve the accuracy and reliability of TLB verification results.
[0007] According to one aspect of the present invention, a translation lookaside buffer verification method is provided, which is applied to a TLB verification platform, and the method comprises:
[0008] Inputting the same operation request as the TLB to be tested into the TLB predictor; the operation request includes a data read and write request, an invalid operation request, and a page table or directory;
[0009] Among them, the TLB predictor integrates functional models corresponding to multiple different types of TLBs;
[0010] Receiving the read and write input requests respectively sent by the TLB predictor and the TLB to be tested, comparing the read and write input requests, and obtaining a request comparison result;
[0011] Receiving TLB resource prediction content sent by the TLB predictor, reading actual resource content in the TLB to be tested, and comparing the resource prediction content with the actual resource content to obtain a content comparison result;
[0012] A verification result corresponding to the TLB to be tested is determined according to the request comparison result and the content comparison result.
[0013] Optionally, the same operation request as the TLB to be tested is input to the TLB predictor, including:
[0014] Determine whether the current verification mode corresponding to the TLB to be tested is an active mode;
[0015] If yes, the same operation request is input to the TLB predictor and the TLB to be tested respectively;
[0016] If not, the operation request received by the TLB to be tested is monitored, and the same operation request is input into the TLB predictor according to the monitoring result.
[0017] Optionally, after determining the verification result corresponding to the TLB to be tested according to the request comparison result and the content comparison result, the method further includes:
[0018] If it is determined that an error occurs in the TLB to be tested according to the request comparison result and the content comparison result, then obtaining a TLB unit type in which an error occurs in the TLB to be tested and an error position corresponding to the TLB unit;
[0019] The type of the TLB unit where the error occurs and the error position are printed, so as to debug the TLB to be tested according to the printing result.
[0020] According to another aspect of the present invention, another translation lookaside buffer verification method is provided, which is applied to a TLB predictor, and the method comprises:
[0021] After detecting that the verification process corresponding to the TLB to be tested has started, receiving an operation request sent by the TLB verification platform;
[0022] Processing the verification process according to the pre-integrated functional models corresponding to the various types of TLBs and the operation request to obtain a processing result corresponding to the TLB predictor;
[0023] The processing result corresponding to the TLB predictor is sent to the TLB verification platform, so that the TLB verification platform determines the verification result corresponding to the TLB to be tested according to the processing result corresponding to the TLB predictor and the processing result corresponding to the TLB to be tested.
[0024] Optionally, after detecting that the verification process corresponding to the TLB to be tested has started, receiving an operation request sent by the TLB verification platform includes:
[0025] After detecting that the query process corresponding to the TLB to be tested has started, receiving a data read and write request sent by the TLB verification platform;
[0026] According to the pre-integrated functional models corresponding to the various types of TLBs and the operation request, the verification process is processed to obtain a processing result corresponding to the TLB predictor, including:
[0027] According to the pre-integrated functional models corresponding to various types of TLBs and data read and write requests, it is queried whether there is a page table or directory corresponding to the data read and write request in all TLB resources, and whether the data read and write request hits the TLB unit.
[0028] Optionally, the verification process is processed according to the pre-integrated functional models corresponding to the multiple different types of TLBs and the operation request to obtain a processing result corresponding to the TLB predictor, including:
[0029] If the verification process is a TLB cache replacement process, a target TLB unit hit event or a TLB write event is obtained according to the pre-integrated functional models corresponding to the various types of TLBs and the data read and write request;
[0030] Wherein, the target TLB unit includes a TLB unit for storing an instruction page table, a TLB unit for storing a data page table, and a TLB unit for storing a primary directory;
[0031] According to the location information of the target TLB unit hit event or the TLB write event, the node status information of the cache replacement unit (Pseudo Least Recently Used, PLRU) is updated.
[0032] According to another aspect of the present invention, a translation lookaside buffer verification device is provided, which is applied to a TLB verification platform, and the device comprises:
[0033] A request input module, used for inputting the same operation request as the TLB to be tested into the TLB predictor; the operation request includes a data read and write request, an invalid operation request, and a page table or directory;
[0034] Among them, the TLB predictor integrates functional models corresponding to multiple different types of TLBs;
[0035] A request comparison module, used for receiving the read and write input requests respectively sent by the TLB predictor and the TLB to be tested, comparing the read and write input requests to obtain a request comparison result;
[0036] A content comparison module, used for receiving the TLB resource prediction content sent by the TLB predictor, reading the actual resource content in the TLB to be tested, and comparing the resource prediction content with the actual resource content to obtain a content comparison result;
[0037] The verification result determination module is used to determine the verification result corresponding to the TLB to be tested according to the request comparison result and the content comparison result.
[0038] According to another aspect of the present invention, another translation lookaside buffer verification device is provided, which is applied to a TLB predictor, and the device comprises:
[0039] A process detection module is used to receive an operation request sent by the TLB verification platform after detecting that the verification process corresponding to the TLB to be tested has started;
[0040] A process processing module, used to process the verification process according to the pre-integrated functional models corresponding to the various types of TLBs and the operation request, and obtain a processing result corresponding to the TLB predictor;
[0041] The result sending module is used to send the processing result corresponding to the TLB predictor to the TLB verification platform, so that the TLB verification platform determines the verification result corresponding to the TLB to be tested according to the processing result corresponding to the TLB predictor and the processing result corresponding to the TLB to be tested.
[0042] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0043] at least one processor; and
[0044] a memory communicatively connected to the at least one processor; wherein,
[0045] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the conversion lookaside buffer verification method according to any embodiment of the present invention.
[0046] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the conversion lookaside buffer verification method described in any embodiment of the present invention when executed.
[0047] The technical solution provided by the embodiment of the present invention inputs the same operation request as the TLB to be tested to the TLB predictor through a TLB verification platform, receives the read and write input requests respectively sent by the TLB predictor and the TLB to be tested, compares the read and write input requests to obtain a request comparison result, receives the TLB resource prediction content sent by the TLB predictor, reads the actual resource content in the TLB to be tested, and compares the resource prediction content with the actual resource content to obtain a content comparison result, and determines the technical means of the verification result corresponding to the TLB to be tested according to the request comparison result and the content comparison result. This can realize the TLB level in the MMU, verify the performance of the TLB, and improve the accuracy and reliability of the verification result.
[0048] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1a is a flow chart of a conversion lookaside buffer verification method provided according to an embodiment of the present invention;
[0051] Figure 1b is a schematic diagram of the structure of a TLB in an MMU provided according to an embodiment of the present invention;
[0052] Figure 1c is a schematic diagram of the structure of a TLB verification platform provided according to an embodiment of the present invention;
[0053] Figure 2 is a flow chart of another conversion lookaside buffer verification method provided according to an embodiment of the present invention;
[0054] Figure 3 is a flow chart of another conversion lookaside buffer verification method provided according to an embodiment of the present invention;
[0055] Figure 4 is a structural schematic diagram of a conversion lookaside buffer verification device provided according to an embodiment of the present invention;
[0056] Figure 5 is a schematic structural diagram of another conversion lookaside buffer verification device provided according to an embodiment of the present invention;
[0057] Figure 6 The invention is a schematic diagram of the structure of an electronic device for implementing the conversion lookaside buffer verification method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0060] Figure 1a A flowchart of a translation lookaside buffer verification method provided by an embodiment of the present invention is applicable to the case of verifying the performance of a TLB in an MMU. The method can be executed by a translation lookaside buffer verification device, which can be implemented in the form of hardware and / or software, and can be configured in a TLB verification platform. Figure 1a As shown, the method includes:
[0061] Step 110: Inputting the same operation request as the TLB to be tested into the TLB predictor; the operation request includes a data read and write request, an invalid operation request, and a page table or directory.
[0062] In this embodiment, specifically, Figure 1b It can be a schematic diagram of the structure of the TLB in the MMU, such as Figure 1b As shown, the TLB may include multiple different types of TLB units, such as PTE DTLB responsible for storing data common page tables, PTE ITLB responsible for storing instruction common page tables, Frag PTE DTLB responsible for storing data continuous page tables, FragPTE ITLB responsible for storing instruction continuous page tables, and PDE TLB for storing the first-level directory.
[0063] Among them, PTE DTLB is mainly used to store data ordinary page tables, which can be first-level ordinary page tables or second-level ordinary page tables, but cannot store first-level directories. Among them, the first-level ordinary page table covers 2MB-32MB space and can be statically configured through registers; the second-level ordinary page table can cover 4KB space. If the input read and write request corresponding to the TLB hits the first-level ordinary page table or the second-level ordinary page table, the request address can be directly translated and converted into a physical address. If an invalidate request is input, the ordinary page table in the corresponding invalidate range is cleared.
[0064] PTE ITLB is mainly used to store instruction normal page tables, and other specifications are consistent with PTE DTLB.
[0065] Frag PTE DTLB is mainly used to store data continuous page tables, which can be either a first-level continuous page table or a second-level continuous read page table, but cannot store a first-level directory. Among them, the first-level continuous page table can cover 2^N times of the 2MB-32MB space, and the second-level continuous page table can cover 2^N times of the 4KB space, where N is determined by the fragment field in the continuous page table. If the input read and write request corresponding to the TLB hits the first-level continuous page table or the second-level continuous page table, the request address can be directly translated and converted into a physical address. If an invalidate request is input, the continuous page table in the corresponding invalidate range is cleared.
[0066] Frag PTE ITLB is mainly used to store instruction continuous page tables, and its other specifications are consistent with frag PTE DTLB.
[0067] PDE TLB is mainly used to store the first-level directory (PDE). Its coverage space is the same as the first-level page table. If the input read or write request corresponding to the TLB does not hit the PTE page table, but hits the PDE page table, the TLB outputs the entry address of the second-level page table corresponding to the request. If an invalidate request is input, the first-level directory within the corresponding invalidate range is cleared.
[0068] The PTW return pipe is used to receive the page table (PTE) or directory (PDE) read back by the TLB. On the one hand, the page table or directory read back is written into the corresponding TLB unit according to the type; on the other hand, since the page table read back is aligned with the bus width, that is, 16 page tables will be retrieved at a time, the PTW return pipe also needs to determine whether to write the 16 page tables retrieved at a time into the first-level page table / directory cache space or the second-level page table / directory cache space according to whether they are first-level page tables or directories or second-level page tables. If an invalidate request is entered, the page table or directory in the corresponding invalidate range is cleared.
[0069] Figure 1b The first-level page table cache in the PTW is used to receive the first-level page table or directory written by the PTW return pipe, in units of cacheline, that is, 16 page tables or directories are written at a time. If the input read or write request hits in the first-level page table cache, the first-level page table cache will write the hit page table to the corresponding TLB unit according to the type, and translate and output the input read or write request. If an invalidate request is input, the page table or directory in the corresponding invalidate range will be cleared.
[0070] Figure 1b The L2 page table cache in the PTW is used to receive the L2 page table written by the PTW return pipe, in units of cacheline, that is, 16 page tables are written at a time. If the input read or write request hits in the L2 page table cache, the L2 page table cache will write the hit page table to the corresponding TLB unit according to the type, and translate and output the input read or write request. If an invalidate request is input, the page table in the corresponding invalidate range is cleared.
[0071] In this embodiment, in order to perform performance testing on the TLB, a TLB predictor and a TLB testbench may be pre-built. The TLB predictor integrates functional models corresponding to various types of TLBs to predict all functions of the TLB. Figure 1c It can be a structural diagram of a TLB verification platform in this embodiment, such as Figure 1cAs shown, the TLB verification platform can input the same data read and write requests as the TLB under test (TLB DUT) to the TLB predictor through the request0 injector module and the request1 injector module, input the same invalid operation request as the TLB under test to the TLB predictor through the invalidate injector module, and input the same page table or directory as the TLB under test to the TLB predictor through the PTW return data module.
[0072] In a specific embodiment, after receiving the above operation request, the TLB predictor can simulate and predict all behaviors of the TLB to be tested, including read and write request query page table, TLB invalidate, PTW return data update TLB / cache, TLB internal polling and PLRU replacement strategy, and send the processing results to the scoreboard in real time; secondly, the TLB predictor is also used to predict the replacement strategy of all TLB units or caches in the TLB to be tested. Once an event of a TLB unit or cache change occurs, the TLB predictor will compare the node status in the replacement strategy model with the internal node status in the TLB to be tested one by one, and report an error immediately if the comparison is inconsistent; finally, the TLB predictor is also used to compare the correctness of the status of all nodes in the replacement strategy, and can compare the correctness of the replaced positions of various TLB units, and compare whether the behavior triggering the replacement action is correct, and can report errors in the first time to avoid replacement strategy errors.
[0073] Step 120: receiving the read and write input requests respectively sent by the TLB predictor and the TLB to be tested, and comparing the read and write input requests to obtain a request comparison result.
[0074] In this embodiment, if Figure 1c As shown, the TLB verification platform can receive the read and write input requests fed back by the TLB predictor and the TLB to be tested for the above operation requests through the request0 scoreboard module and the request1 scoreboard module, and compare the read and write input requests to obtain request comparison results.
[0075] Step 130: Receive the TLB resource prediction content sent by the TLB predictor, read the actual resource content in the TLB to be tested, and compare the resource prediction content with the actual resource content to obtain a content comparison result.
[0076] In this embodiment, if Figure 1cAs shown, the TLB verification platform can receive the TLB resource prediction content sent by the TLB predictor through the TLB scoreboard module, and compare the resource prediction content with the actual resource content in the TLB to be tested to obtain a content comparison result.
[0077] Step 140: Determine a verification result corresponding to the TLB to be tested according to the request comparison result and the content comparison result.
[0078] In this step, optionally, if the request comparison result or the content comparison result is inconsistent, it can be determined that the TLB to be tested has failed in verification, and the failure information is reported.
[0079] In this embodiment, since the TLB level verification environment is more convenient and easy to generate various stimuli, including TLB query, TLB invalidate, TLB update and cross-scenario between these scenarios, by building a TLB verification platform, the signal can be directly input to the TLB to be tested, and then more test scenarios can be covered in the TLB verification environment, thereby improving the reliability of the TLB verification result. Secondly, by constructing a TLB predictor based on the functional models corresponding to various types of TLBs, all standard behaviors of the TLB to be tested can be predicted, thereby ensuring the accuracy of the verification results.
[0080] In addition, the translation lookaside buffer verification method provided in this embodiment can also be integrated in the MMU upper layer or SOC system verification environment as a checker to ensure the correctness of the TLB in the upper layer test environment, and can test the performance indicators of the TLB at an early stage and provide feedback to the architecture layer to determine the ratio, size, depth and other parameters of various TLBs.
[0081] The technical solution provided by the embodiment of the present invention inputs the same operation request as the TLB to be tested to the TLB predictor through a TLB verification platform, receives the read and write input requests respectively sent by the TLB predictor and the TLB to be tested, compares the read and write input requests to obtain a request comparison result, receives the TLB resource prediction content sent by the TLB predictor, reads the actual resource content in the TLB to be tested, and compares the resource prediction content with the actual resource content to obtain a content comparison result, and determines the technical means of the verification result corresponding to the TLB to be tested according to the request comparison result and the content comparison result. This can realize the TLB level in the MMU, verify the performance of the TLB, and improve the accuracy and reliability of the verification result.
[0082] Figure 2 A flowchart of another conversion lookaside buffer verification method provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the method includes:
[0083] Step 210 , determine whether the current verification mode corresponding to the TLB to be tested is the active mode, if so, execute step 220 ; if not, execute step 230 .
[0084] Step 220: Input the same operation request to the TLB predictor and the TLB to be tested respectively.
[0085] Step 230: monitor the operation request received by the TLB to be tested, and input the same operation request into the TLB predictor according to the monitoring result.
[0086] In a specific embodiment, Figure 1c As shown, if the current verification mode corresponding to the TLB to be tested is the active mode, the request0 injector module and the request1 injector module can input the same data read and write requests to the TLB predictor and the TLB to be tested respectively; conversely, if the current verification mode is the passive mode, the request0 injector module and the request1 injector module are used to monitor the data read and write requests received by the TLB to be tested, and input the same data read and write requests to the TLB predictor.
[0087] Accordingly, in active mode, the invalidate injector module is used to input the same invalidation operation request to the TLB predictor and the TLB under test; in passive mode, the invalidate injector module is used to monitor the invalidation operation request received by the TLB under test and input the same request to the TLB predictor.
[0088] In active mode, the PTW return data module is used to return the same page table or directory to the TLB predictor and the TLB under test; in passive mode, the PTW return data module is used to monitor the page table or directory of the entire row returned in the TLB under test, and send this page table or directory to the TLB predictor.
[0089] Step 240: receiving the read and write input requests respectively sent by the TLB predictor and the TLB to be tested, and comparing the read and write input requests to obtain a request comparison result.
[0090] Step 250: Receive the TLB resource prediction content sent by the TLB predictor, read the actual resource content in the TLB to be tested, and compare the resource prediction content with the actual resource content to obtain a content comparison result.
[0091] Step 260: Determine the verification result corresponding to the TLB to be tested according to the request comparison result and the content comparison result.
[0092] Step 270: If it is determined that an error occurs in the TLB to be tested according to the request comparison result and the content comparison result, the type of the TLB unit in which the error occurs in the TLB to be tested and the error position corresponding to the TLB unit are obtained.
[0093] Step 280: Print the type of the TLB unit where the error occurs and the error position, so as to debug the TLB to be tested according to the printing result.
[0094] The advantage of this setting is that the performance of the TLB to be tested can be debugged in a timely manner, thereby ensuring the normal operation of the MMU.
[0095] The technical solution provided by the embodiment of the present invention determines whether the current verification mode corresponding to the TLB to be tested is the active mode. If so, the same operation request is input to the TLB predictor and the TLB to be tested respectively. If not, the operation request received by the TLB to be tested is monitored, and the same operation request is input to the TLB predictor according to the monitoring result, and the read and write input requests sent by the TLB predictor and the TLB to be tested are received respectively, and the read and write input requests are compared to obtain a request comparison result, and the TLB resource prediction content sent by the TLB predictor is received, and the actual resource content in the TLB to be tested is read, and the resource prediction content is compared with the actual resource content to obtain a content comparison result, and the verification result corresponding to the TLB to be tested is determined according to the request comparison result and the content comparison result. If it is determined that an error occurs in the TLB to be tested, the type of the TLB unit in which the error occurs in the TLB to be tested, and the error position corresponding to the TLB unit are obtained, and the type of the TLB unit in which the error occurs and the error position are printed, so as to debug the TLB to be tested according to the printed result, thereby improving the accuracy and reliability of the TLB verification result.
[0096] Figure 3 A flowchart of another translation lookaside buffer verification method provided by an embodiment of the present invention. This embodiment is applicable to the case of verifying the performance of a TLB in an MMU. The method can be executed by a translation lookaside buffer verification device. The translation lookaside buffer verification device can be implemented in the form of hardware and / or software. The translation lookaside buffer verification device can be configured in a TLB predictor. Figure 3 As shown, the method includes:
[0097] Step 310: After detecting that the verification process corresponding to the TLB to be tested has started, an operation request sent by the TLB verification platform is received.
[0098] Step 320: Process the verification process according to the pre-integrated functional models corresponding to the various types of TLBs and the operation request to obtain a processing result corresponding to the TLB predictor.
[0099] In this embodiment, specifically, the verification process may include a query process, a TLB cache replacement process, a TLB write process, and an invalidation process. Each process may communicate with each other through events, and each process is executed independently in a loop until the test is completed.
[0100] In one implementation of this embodiment, if the verification process is a query process, the TLB predictor can receive a data read and write request sent by the TLB verification platform, and then query whether there is a page table or directory corresponding to the data read and write request in all TLB resources based on the pre-integrated functional models corresponding to multiple different types of TLBs and the data read and write request, and whether the data read and write request hits the TLB unit, thereby obtaining the processing result corresponding to the query process.
[0101] Specifically, if neither the page table nor the directory hits, it is marked as a page table miss and the original input virtual address is maintained. If the input request hits PTE ITLB / PTE DTLB / Frag PTE ITLB / Frag PTE DTLB / PDE TLB, a hit TLB event is triggered and the hit location information is sent to the TLB cache replacement process. If the data read or write request hits the first-level cache (L1 prefetch buffer) or the second-level cache (L0 prefetch buffer), a hit pbuf event is triggered and the hit PTE / PDE is sent to the write TLB process. Finally, the predicted TLB query results are sent to the request0 scoreboard module and the request1 scoreboard module respectively.
[0102] In another implementation of this embodiment, if the verification process is a TLB cache replacement process, the TLB predictor can obtain the target TLB unit hit event or TLB write event according to the pre-integrated functional models corresponding to the various types of TLBs and the data read and write request, and then update the node status information of the PLRU according to the location information of the target TLB unit hit event or TLB write event. The target TLB unit includes a TLB unit (PTE ITLB and Frag PTE ITLB) for storing an instruction page table, a TLB unit (PTE DTLB and FragPTE DTLB) for storing a data page table, and a TLB unit (PDE TLB) for storing a primary directory.
[0103] Specifically, if the verification process is a TLB cache replacement process, the TLB predictor may wait for a TLB PTE / PDE hit event or a write TLB event to be triggered, and then update the PLRU node status information according to the hit or write TLB location information (set / way), and calculate the next replacement location information.
[0104] In another implementation of this embodiment, if the verification process is a write TLB process, the TLB predictor may wait for the returned page table or the event that the input request hits the first-level cache or the second-level cache, and then prepare to write the hit page table into the corresponding TLB unit. Specifically, the TLB predictor may write the page table to be written into the TLB unit into the corresponding position according to the current position information of the TLB cache replacement process, trigger the write TLB event at the same time, and send the write TLB position information to the TLB cache replacement process for node status update.
[0105] In another implementation of this embodiment, if the verification process is an invalidation operation process, the TLB predictor may wait for an invalidation operation request, and perform a clearing operation on corresponding resources inside the TLB predictor according to the type and scope of the invalidation operation request.
[0106] Step 330: Send the processing result corresponding to the TLB predictor to the TLB verification platform, so that the TLB verification platform determines the verification result corresponding to the TLB to be tested according to the processing result corresponding to the TLB predictor and the processing result corresponding to the TLB to be tested.
[0107] In this embodiment, specifically, the processing result corresponding to the TLB predictor may include a read / write input request and resource prediction content.
[0108] The technical solution provided by the embodiment of the present invention detects that the verification process corresponding to the TLB to be tested has started through the TLB predictor, receives an operation request sent by a TLB verification platform, processes the verification process according to the pre-integrated functional models corresponding to multiple different types of TLBs and the operation request, obtains the processing result corresponding to the TLB predictor, and sends the processing result corresponding to the TLB predictor to the TLB verification platform, so that the TLB verification platform determines the verification result corresponding to the TLB to be tested according to the processing result corresponding to the TLB predictor and the processing result corresponding to the TLB to be tested. The technical means can improve the accuracy and reliability of the TLB verification result.
[0109] Figure 4 A schematic diagram of a translation lookaside buffer verification device provided by an embodiment of the present invention, wherein the device is applied in a TLB verification platform, such as Figure 4As shown, the device includes: a request input module 410, a request comparison module 420, a content comparison module 430 and a verification result determination module 440.
[0110] A request input module 410, used to input the same operation request as the TLB to be tested to the TLB predictor; the operation request includes a data read and write request, an invalid operation request, and a page table or directory;
[0111] Among them, the TLB predictor integrates functional models corresponding to multiple different types of TLBs;
[0112] A request comparison module 420, configured to receive the read and write input requests respectively sent by the TLB predictor and the TLB to be tested, compare the read and write input requests, and obtain a request comparison result;
[0113] The content comparison module 430 is used to receive the TLB resource prediction content sent by the TLB predictor, read the actual resource content in the TLB to be tested, and compare the resource prediction content with the actual resource content to obtain a content comparison result;
[0114] The verification result determination module 440 is used to determine the verification result corresponding to the TLB to be tested according to the request comparison result and the content comparison result.
[0115] The technical solution provided by the embodiment of the present invention inputs the same operation request as the TLB to be tested to the TLB predictor through a TLB verification platform, receives the read and write input requests respectively sent by the TLB predictor and the TLB to be tested, compares the read and write input requests to obtain a request comparison result, receives the TLB resource prediction content sent by the TLB predictor, reads the actual resource content in the TLB to be tested, and compares the resource prediction content with the actual resource content to obtain a content comparison result, and determines the technical means of the verification result corresponding to the TLB to be tested according to the request comparison result and the content comparison result. This can realize the TLB level in the MMU, verify the performance of the TLB, and improve the accuracy and reliability of the verification result.
[0116] Based on the above embodiment, the request input module 410 includes:
[0117] A mode judgment unit is used to judge whether the current verification mode corresponding to the TLB to be tested is an active mode; if so, input the same operation request to the TLB predictor and the TLB to be tested respectively; if not, monitor the operation request received by the TLB to be tested, and input the same operation request to the TLB predictor according to the monitoring result.
[0118] The verification result determination module 440 includes:
[0119] an error position determination unit, configured to obtain a type of a TLB unit in which an error occurs in the TLB to be tested and an error position corresponding to the TLB unit if it is determined that an error occurs in the TLB to be tested according to the request comparison result and the content comparison result;
[0120] The printing unit is used to print the type of the TLB unit where the error occurs and the error position, so as to debug the TLB to be tested according to the printing result.
[0121] The above device can execute the methods provided by all the above embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not fully described in the embodiments of the present invention, please refer to the methods provided by all the above embodiments of the present invention.
[0122] Figure 5 A schematic diagram of the structure of a translation lookaside buffer verification device provided by an embodiment of the present invention, wherein the device is applied to a TLB predictor, such as Figure 5 As shown, the device includes: a process detection module 510, a process processing module 520 and a result sending module 530.
[0123] The process detection module 510 is used to receive an operation request sent by the TLB verification platform after detecting that the verification process corresponding to the TLB to be tested has started;
[0124] The process processing module 520 is used to process the verification process according to the pre-integrated functional models corresponding to the various types of TLBs and the operation request, and obtain the processing result corresponding to the TLB predictor;
[0125] The result sending module 530 is used to send the processing result corresponding to the TLB predictor to the TLB verification platform, so that the TLB verification platform determines the verification result corresponding to the TLB to be tested according to the processing result corresponding to the TLB predictor and the processing result corresponding to the TLB to be tested.
[0126] The technical solution provided by the embodiment of the present invention detects that the verification process corresponding to the TLB to be tested has started through the TLB predictor, receives an operation request sent by a TLB verification platform, processes the verification process according to the pre-integrated functional models corresponding to multiple different types of TLBs and the operation request, obtains the processing result corresponding to the TLB predictor, and sends the processing result corresponding to the TLB predictor to the TLB verification platform, so that the TLB verification platform determines the verification result corresponding to the TLB to be tested according to the processing result corresponding to the TLB predictor and the processing result corresponding to the TLB to be tested. The technical means can improve the accuracy and reliability of the TLB verification result.
[0127] Based on the above embodiment, the process detection module 510 includes:
[0128] The query process detection unit is used to receive a data read and write request sent by the TLB verification platform after detecting that the query process corresponding to the TLB to be tested has started.
[0129] The process processing module 520 includes:
[0130] A data query determination unit, for querying whether there is a page table or directory corresponding to the data read / write request in all TLB resources and whether the data read / write request hits the TLB unit according to the pre-integrated functional models corresponding to the various types of TLBs and the data read / write request if the verification process is a query process;
[0131] An event acquisition unit, configured to acquire a target TLB unit hit event or a TLB write event according to pre-integrated functional models corresponding to a plurality of different types of TLBs and the data read and write request if the verification process is a TLB cache replacement process;
[0132] Wherein, the target TLB unit includes a TLB unit for storing an instruction page table, a TLB unit for storing a data page table, and a TLB unit for storing a primary directory;
[0133] The information updating unit is used to update the node status information of the PLRU according to the location information of the target TLB unit hit event or the TLB write event.
[0134] The above device can execute the methods provided by all the above embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not fully described in the embodiments of the present invention, please refer to the methods provided by all the above embodiments of the present invention.
[0135] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0136] like Figure 6As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0137] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0138] The processor 11 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the conversion backup buffer verification method.
[0139] In some embodiments, the conversion lookaside buffer verification method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the conversion lookaside buffer verification method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the conversion lookaside buffer verification method in any other appropriate manner (e.g., by means of firmware).
[0140] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0141] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0142] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0143] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0144] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0145] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0146] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0147] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A conversion lookaside buffer verification method, characterized in that: Applied to a translation lookaside buffer TLB verification platform, the method comprises: Inputting the same operation request as the TLB to be tested into the TLB predictor; the operation request includes a data read and write request, an invalid operation request, and a page table or directory; Among them, the TLB predictor integrates functional models corresponding to multiple different types of TLBs; Receiving the read and write input requests respectively sent by the TLB predictor and the TLB to be tested, comparing the read and write input requests, and obtaining a request comparison result; Receiving TLB resource prediction content sent by the TLB predictor, reading actual resource content in the TLB to be tested, and comparing the resource prediction content with the actual resource content to obtain a content comparison result; Determine a verification result corresponding to the TLB to be tested according to the request comparison result and the content comparison result; The TLB predictor is used to process the verification process corresponding to the TLB to be tested according to the pre-integrated functional models and operation requests corresponding to the multiple different types of TLBs, and obtain the processing result corresponding to the TLB predictor; The TLB predictor is also used to obtain a target TLB unit hit event or a TLB write event if the verification process is a TLB cache replacement process based on the functional models corresponding to the pre-integrated multiple different types of TLBs and the data read and write requests; the target TLB unit includes a TLB unit for storing an instruction page table, a TLB unit for storing a data page table, and a TLB unit for storing a primary directory; and the node status information of the cache replacement unit PLRU is updated according to the location information of the target TLB unit hit event or the TLB write event.
2. The method according to claim 1, characterized in that Input the same operation request as the TLB to be tested to the TLB predictor, including: Determine whether the current verification mode corresponding to the TLB to be tested is an active mode; If yes, the same operation request is input to the TLB predictor and the TLB to be tested respectively; If not, the operation request received by the TLB to be tested is monitored, and the same operation request is input into the TLB predictor according to the monitoring result.
3. The method according to claim 1, characterized in that After determining the verification result corresponding to the TLB to be tested according to the request comparison result and the content comparison result, the method further includes: If it is determined that an error occurs in the TLB to be tested according to the request comparison result and the content comparison result, then obtaining a TLB unit type in which an error occurs in the TLB to be tested and an error position corresponding to the TLB unit; The type of the TLB unit where the error occurs and the error position are printed, so as to debug the TLB to be tested according to the printing result.
4. A conversion lookaside buffer verification method, characterized in that: Applied to a translation lookaside buffer (TLB) predictor, the method comprises: After detecting that the verification process corresponding to the TLB to be tested has started, receiving an operation request sent by the TLB verification platform; Processing the verification process according to the pre-integrated functional models corresponding to the various types of TLBs and the operation request to obtain a processing result corresponding to the TLB predictor; Sending the processing result corresponding to the TLB predictor to the TLB verification platform, so that the TLB verification platform determines the verification result corresponding to the TLB to be tested according to the processing result corresponding to the TLB predictor and the processing result corresponding to the TLB to be tested; After detecting that the verification process corresponding to the TLB to be tested has started, receiving the operation request sent by the TLB verification platform includes: after detecting that the query process corresponding to the TLB to be tested has started, receiving the data read and write request sent by the TLB verification platform; According to the functional models corresponding to the pre-integrated multiple different types of TLBs and the operation request, the verification process is processed to obtain the processing result corresponding to the TLB predictor, including: according to the functional models corresponding to the pre-integrated multiple different types of TLBs and the data read and write request, querying whether there is a page table or directory corresponding to the data read and write request in all TLB resources, and whether the data read and write request hits the TLB unit; The verification process is processed according to the functional models corresponding to the pre-integrated multiple different types of TLBs and the operation request to obtain the processing results corresponding to the TLB predictor, including: if the verification process is a TLB cache replacement process, then according to the functional models corresponding to the pre-integrated multiple different types of TLBs and the data read and write requests, a target TLB unit hit event or a TLB write event is obtained; wherein the target TLB unit includes a TLB unit for storing an instruction page table, a TLB unit for storing a data page table, and a TLB unit for storing a first-level directory; according to the location information of the target TLB unit hit event or the TLB write event, the node status information of the cache replacement unit PLRU is updated.
5. A conversion lookaside buffer verification device, characterized in that: Applied to a translation lookaside buffer TLB verification platform, the device comprises: A request input module, used for inputting the same operation request as the TLB to be tested into the TLB predictor; the operation request includes a data read and write request, an invalid operation request, and a page table or directory; Among them, the TLB predictor integrates functional models corresponding to multiple different types of TLBs; A request comparison module, used for receiving the read and write input requests respectively sent by the TLB predictor and the TLB to be tested, comparing the read and write input requests to obtain a request comparison result; A content comparison module, used for receiving the TLB resource prediction content sent by the TLB predictor, reading the actual resource content in the TLB to be tested, and comparing the resource prediction content with the actual resource content to obtain a content comparison result; A verification result determination module, used to determine a verification result corresponding to the TLB to be tested according to the request comparison result and the content comparison result; The TLB predictor is used to process the verification process corresponding to the TLB to be tested according to the pre-integrated functional models and operation requests corresponding to the multiple different types of TLBs, and obtain the processing result corresponding to the TLB predictor; The TLB predictor is also used to obtain a target TLB unit hit event or a TLB write event if the verification process is a TLB cache replacement process based on the functional models corresponding to the pre-integrated multiple different types of TLBs and the data read and write requests; the target TLB unit includes a TLB unit for storing an instruction page table, a TLB unit for storing a data page table, and a TLB unit for storing a primary directory; and the node status information of the cache replacement unit PLRU is updated according to the location information of the target TLB unit hit event or the TLB write event.
6. A conversion lookaside buffer verification device, characterized in that: Applied to a translation lookaside buffer TLB predictor, the device comprises: A process detection module is used to receive an operation request sent by the TLB verification platform after detecting that the verification process corresponding to the TLB to be tested has started; A process processing module, used to process the verification process according to the pre-integrated functional models corresponding to the various types of TLBs and the operation request, and obtain a processing result corresponding to the TLB predictor; A result sending module, used for sending the processing result corresponding to the TLB predictor to the TLB verification platform, so that the TLB verification platform determines the verification result corresponding to the TLB to be tested according to the processing result corresponding to the TLB predictor and the processing result corresponding to the TLB to be tested; After detecting that the verification process corresponding to the TLB to be tested has started, receiving the operation request sent by the TLB verification platform includes: after detecting that the query process corresponding to the TLB to be tested has started, receiving the data read and write request sent by the TLB verification platform; According to the functional models corresponding to the pre-integrated multiple different types of TLBs and the operation request, the verification process is processed to obtain the processing result corresponding to the TLB predictor, including: according to the functional models corresponding to the pre-integrated multiple different types of TLBs and the data read and write request, querying whether there is a page table or directory corresponding to the data read and write request in all TLB resources, and whether the data read and write request hits the TLB unit; The verification process is processed according to the functional models corresponding to the pre-integrated multiple different types of TLBs and the operation request to obtain the processing results corresponding to the TLB predictor, including: if the verification process is a TLB cache replacement process, then according to the functional models corresponding to the pre-integrated multiple different types of TLBs and the data read and write requests, a target TLB unit hit event or a TLB write event is obtained; wherein the target TLB unit includes a TLB unit for storing an instruction page table, a TLB unit for storing a data page table, and a TLB unit for storing a first-level directory; according to the location information of the target TLB unit hit event or the TLB write event, the node status information of the cache replacement unit PLRU is updated.
7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the conversion lookaside buffer verification method according to any one of claims 1 to 3 or 4.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the conversion lookaside buffer verification method according to any one of claims 1 to 3 or 4 when executed.
Citation Information
Patent Citations
Method and device for verifying cache consistency of multi-core processor
CN116167310A
Memory management method, graphic processing unit, storage medium and terminal equipment
CN116681578A
Memory management unit, data processing device and method, equipment and storage medium
CN117687938A
Memory protection in a computer system employing memory virtualization
US20070283115A1
Method and system for efficient memory region deallocation
US20140181454A1
