Substitute address verification method and system based on dynamic page table
By dynamically generating and storing target page tables and comparing the desired physical address and basic physical address, the problem of low verification efficiency and accuracy in the prior art is solved, and a more efficient and accurate verification process is achieved.
Patent Information
- Application Number
- CN202411703860.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-14
AI Technical Summary
In the prior art, when checking the replacement address generated based on RISC-V, the calibration efficiency and accuracy are low, and it is difficult to flexibly modify page table entries or conduct error-making tests.
The page table generation component dynamically generates the target page table corresponding to the target virtual address, and stores it in the internal memory based on preset storage rules. Then, the basic physical address is determined through the address management module, and the verification module compares the desired physical address and the basic physical address to generate the verification result.
The verification efficiency and accuracy of the replacement addresses generated based on RISC-V are improved, and the flexible control of the page table and the accuracy of the verification process are enhanced.
Smart Images

Figure CN119621607A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data verification, and in particular to a substitution address verification method and system based on a dynamic page table. Background Art
[0002] With the development of central processing unit (CPU) manufacturing technology, the scale of CPU internal applications is getting larger and larger. As a result, the demand for virtual memory space by applications is growing, so that the substitution between the corresponding virtual addresses and physical addresses is also developing. The fifth-generation Reduced Instruction Set Computing-V (RISC-V) has become a popular processor instruction set architecture, which is used to implement the substitution between virtual addresses and physical addresses and generate substitution addresses. However, since RISC-V adopts a paging-based virtual address scheme, typically a four-level page substitution, the verification of the substitution address generated based on RISC-V has become an important part of the chip front-end verification.
[0003] In the prior art, it is usually necessary to generate a multi-level page table in advance according to the test or software application requirements, and write the page table into the memory, and then initiate the virtual address stimulus to verify the replacement address generated based on RSIC-V. However, if the address substitution verification method with a pre-written page table is adopted, the application requirements and the virtual address space range need to be determined in advance. Once the page table is written in the main memory, it becomes extremely inconvenient to modify a single page table entry or perform an error test, and for the unit test (Unit Test, UT) level verification of some address substitutions, the constraints of writing virtual address incentives will also become more complicated, which reduces flexibility and reduces the verification efficiency and accuracy of the replacement address. Therefore, how to verify the replacement address generated based on RSIC-V and improve the verification efficiency and accuracy of the replacement address is a problem that needs to be solved urgently. Summary of the invention
[0004] The present invention provides a substitution address verification method and system based on a dynamic page table, which can solve the problem of low verification efficiency and accuracy when verifying a substitution address generated based on RSIC-V in the prior art.
[0005] According to one aspect of the present invention, a method for verifying a substitution address based on a dynamic page table is provided, comprising:
[0006] Obtaining the target virtual address and basic variables corresponding to the current instance through the page table generation component, determining the target constraint conditions corresponding to the basic variables based on the preset configuration specification, and randomly processing the basic variables based on the target constraint conditions to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table;
[0007] The target page table is stored in the target storage address of the internal memory by the page table generation component based on the preset storage rule, and the expected physical address corresponding to the target virtual address is determined based on the target page table, and the expected physical address is sent to the verification module;
[0008] Obtaining a target virtual address corresponding to the current instance through an address management module, determining a corresponding target page table in an internal memory based on the target virtual address, and determining a basic physical address corresponding to the target virtual address based on a preset reduced instruction set substitution rule and the target page table, and sending the basic physical address to a verification module;
[0009] The expected physical address and the basic physical address are compared and processed by a verification module to generate a verification result corresponding to the current instance.
[0010] According to another aspect of the present invention, a substitution address checking system based on a dynamic page table is provided, comprising:
[0011] A page table generation component is used to obtain a target virtual address and a basic variable corresponding to the current instance, determine a target constraint condition corresponding to the basic variable based on a preset configuration specification, and randomly process the basic variable based on the target constraint condition to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table;
[0012] A page table generation component, used for storing a target page table to a target storage address of an internal memory based on a preset storage rule, and determining an expected physical address corresponding to the target virtual address based on the target page table, and sending the expected physical address to a verification module;
[0013] An address management module is used to obtain a target virtual address corresponding to the current instance, determine a corresponding target page table in the internal memory based on the target virtual address, determine a basic physical address corresponding to the target virtual address based on a preset reduced instruction set substitution rule and the target page table, and send the basic physical address to a verification module;
[0014] The verification module is used to compare and process the expected physical address and the basic physical address to generate a verification result corresponding to the current instance.
[0015] The technical solution of the embodiment of the present invention is to obtain the target virtual address and basic variables corresponding to the current instance through a page table generation component, determine the target constraint conditions corresponding to the basic variables based on a preset configuration specification, and randomly process the basic variables based on the target constraint conditions to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table; store the target page table to the target storage address of the internal memory based on a preset storage rule through the page table generation component, and determine the expected physical address corresponding to the target virtual address based on the target page table, and send the expected physical address to a verification module; obtain the target virtual address corresponding to the current instance through an address management module, determine the corresponding target page table in the internal memory based on the target virtual address, and determine the basic physical address corresponding to the target virtual address based on the preset reduced instruction set substitution rule and the target page table, and send the basic physical address to the verification module; compare and process the expected physical address and the basic physical address through the verification module to generate a verification result corresponding to the current instance. Since a multi-level page table is dynamically generated based on a single virtual address and the constraints for generating the page table can be controlled, the problem of low verification efficiency and accuracy when verifying the substitution address generated based on RSIC-V in the prior art is solved. The substitution address generated based on RSIC-V can be verified, thereby improving the verification efficiency and accuracy of the substitution address.
[0016] 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
[0017] 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.
[0018] Figure 1 is a flow chart of a substitution address verification method based on a dynamic page table provided according to the first embodiment of the present invention;
[0019] Figure 2 is a flow chart of a substitution address verification method based on a dynamic page table provided according to Embodiment 2 of the present invention;
[0020] Figure 3 is a schematic diagram of a page table generation component provided according to Embodiment 2 of the present invention;
[0021] Figure 4 is a flow chart of a target page table generation process provided according to Embodiment 2 of the present invention;
[0022] Figure 5 is a flow chart of an optional substitution address verification method based on a dynamic page table provided according to Embodiment 2 of the present invention;
[0023] Figure 6 It is a structural diagram of a substitution address verification system based on a dynamic page table provided according to Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0024] 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.
[0025] It should be noted that the terms "objective", "basis", 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 interchangeable 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.
[0026] Embodiment 1
[0027] Figure 1 The flowchart of a substitution address verification method based on a dynamic page table provided in the first embodiment of the present invention is applicable to the case where a substitution address generated based on RSIC-V is verified. The method can be executed by a substitution address verification system based on a dynamic page table. The substitution address verification system based on a dynamic page table can be implemented in the form of hardware and / or software. Figure 1 As shown, the method includes:
[0028] S110. Obtain the target virtual address and basic variables corresponding to the current instance through the page table generation component, determine the target constraints corresponding to the basic variables based on the preset configuration specifications, and randomly process the basic variables based on the target constraints to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table.
[0029] Among them, the page table may refer to a data table that stores the conversion relationship between virtual addresses and physical addresses. The page table generation component may refer to a pre-built component for generating a page table. Exemplarily, the page table generation component may include a class for generating a page table. In an embodiment of the present invention, the dynamic page table generation component may be a software package written in a programming language, which is imported into a RISC-V-based chip that needs to be verified when used, and is used to input virtual addresses and constraints, dynamically generate a single page table entry, and provide some functional interfaces. The current instance may refer to the instantiation result that needs to be constructed based on the page table generation component under the current verification environment.
[0030] Among them, the target virtual address may refer to the virtual address corresponding to the current instance at the current moment. Generally, the target virtual address can be determined according to actual on-site requirements or user settings. It is worth noting that in an embodiment of the present invention, the number of target virtual addresses is at least one. The basic variable may refer to a random variable corresponding to a class used to generate a page table in a page table generation component. Exemplarily, the basic variable may be a single page table entry (Page Table Entry, PTE). Generally, the basic variable corresponding to the current instance can be determined based on the various pre-declared variables.
[0031] Among them, the target constraint condition may refer to the prerequisite that needs to be followed when randomly processing the basic variable. In an optional embodiment, the target constraint condition may include: an initial constraint condition and a set constraint condition. The initial constraint condition may refer to a default basic constraint. Exemplarily, the initial constraint condition may be a value within the value range of the basic variable. The set constraint condition may refer to a constraint set manually according to the actual needs of the user. Exemplarily, the set constraint condition may be equal to, greater than, or less than the basic variable. The preset configuration specification may refer to a preset constraint configuration specification. Generally, the preset configuration specification may be set according to the priority relationship between the initial constraint condition and the set constraint condition. Exemplarily, the preset configuration specification may be that if there is no set constraint condition, the initial constraint condition is used as the target constraint condition. Conversely, if there is a set constraint condition, the set constraint condition is used as the target constraint condition. It is worth noting that if there is a substitution fault tolerance test requirement, the set constraint condition may also include an abnormal constraint condition, which is not specifically limited in the embodiment of the present invention.
[0032] Among them, randomization processing may refer to an operation of randomly assigning values to basic variables. Exemplarily, randomization processing may be implemented based on predefined data types. The target page table may refer to a page table containing multi-level PTE information generated based on target constraints. Exemplarily, the target page table may be a page table containing three-level PTE information. The target storage address may refer to a storage address corresponding to the target page table. Exemplarily, the output form of the target storage address may be determined based on a predefined dynamic array.
[0033] S120, storing the target page table to the target storage address of the internal memory based on the preset storage rule through the page table generation component, determining the expected physical address corresponding to the target virtual address based on the target page table, and sending the expected physical address to the verification module.
[0034] Among them, the preset storage rule may refer to a preset page table storage rule. Exemplarily, the preset storage rule may be storage at the software level or storage at the hardware level. Usually, it can be determined according to the actual needs of the user. Memory (Mem) may refer to a memory used to store the target page table. The expected physical address may refer to the corresponding physical address generated by the page table generation component according to the target virtual address.
[0035] In an optional embodiment, if the preset storage rule is a front-door storage rule; the target page table is stored to the target storage address of the internal memory based on the preset storage rule by the page table generation component, which may include: obtaining the target communication protocol corresponding to the current instance through the page table generation component, and storing the target page table to the target storage address of the internal memory based on the target communication protocol. Among them, the front-door storage rule may refer to the storage rule at the simulated hardware level. Exemplarily, the front-door storage rule may be a rule for writing data according to the communication protocol. The target communication protocol may refer to the data transmission protocol corresponding to the current instance. Generally, the target communication protocol corresponding to the current instance can be determined according to the communication protocol between the page table generation component and the internal memory. Specifically, after generating the target page table, the preset storage rule may be obtained. If the preset storage rule is a front-door storage rule, the target communication protocol corresponding to the current instance is obtained, and the target page table is stored to the target storage address of the internal memory based on the target communication protocol. Thus, the storage of the target page table is realized, providing an effective basis for subsequent operations.
[0036] In an optional embodiment, if the preset storage rule is a backdoor storage rule; the target page table is stored to the target storage address of the internal memory based on the preset storage rule by the page table generation component, which may include: obtaining the basic array variable of the target storage address in the internal memory through the page table generation component, and performing an assignment operation on the basic array variable based on the target page table. Among them, the backdoor storage rule may refer to a storage rule at the software level. Exemplarily, the backdoor storage rule may be a rule for directly accessing the array variable of the internal memory and performing an assignment operation. The basic array variable may refer to an array in the internal memory used to implement page table storage. Specifically, after generating the target page table, the preset storage rule may be obtained. If the preset storage rule is a backdoor storage rule, the basic array variable of the target storage address in the internal memory is determined, and then the target page table is assigned to the basic array variable. In this way, the storage of the target page table is achieved, providing an effective basis for subsequent operations.
[0037] It is worth noting that if there are multiple virtual addresses corresponding to the current instance, after storing the target page table corresponding to the target virtual address to the target storage address of the internal memory based on the preset storage rules, the above operation can be repeated with the next virtual address as the target virtual address until the remaining number of virtual addresses is zero.
[0038] S130. Obtain the target virtual address corresponding to the current instance through the address management module, determine the corresponding target page table in the internal memory based on the target virtual address, and determine the basic physical address corresponding to the target virtual address based on the preset reduced instruction set replacement rule and the target page table, and send the basic physical address to the verification module.
[0039] Among them, the address management module (Memory Management Unit, MMU) may refer to a module that implements the address substitution function inside the chip. The preset reduced instruction set may refer to a pre-selected reduced instruction set. Exemplarily, the preset reduced instruction set may be RISC-V. The preset reduced instruction set substitution rule may refer to the substitution rule between the virtual address and the physical address specified by the preset reduced instruction set. Exemplarily, the preset reduced instruction set substitution rule may be a page-based substitution rule. The basic physical address may refer to the physical address corresponding to the target virtual address obtained by substitution based on the preset reduced instruction set substitution rule and the target page table.
[0040] S140: Compare and process the expected physical address and the basic physical address through a verification module to generate a verification result corresponding to the current instance.
[0041] Among them, the verification module may refer to a module that performs verification processing on the substitution result. The comparison processing may refer to an operation of comparing the expected physical address with the basic physical address for consistency. The verification result may refer to the result obtained after the comparison processing between the expected physical address and the basic physical address. Exemplarily, the verification result may be a verification success indicating that the expected physical address is consistent with the basic physical address, or a verification failure indicating that the expected physical address is inconsistent with the basic physical address.
[0042] The technical solution of the embodiment of the present invention is to obtain the target virtual address and basic variables corresponding to the current instance through a page table generation component, determine the target constraint conditions corresponding to the basic variables based on a preset configuration specification, and randomly process the basic variables based on the target constraint conditions to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table; store the target page table to the target storage address of the internal memory based on a preset storage rule through the page table generation component, and determine the expected physical address corresponding to the target virtual address based on the target page table, and send the expected physical address to a verification module; obtain the target virtual address corresponding to the current instance through an address management module, determine the corresponding target page table in the internal memory based on the target virtual address, and determine the basic physical address corresponding to the target virtual address based on the preset reduced instruction set substitution rule and the target page table, and send the basic physical address to the verification module; compare and process the expected physical address and the basic physical address through the verification module to generate a verification result corresponding to the current instance. Since a multi-level page table is dynamically generated based on a single virtual address and the constraints for generating the page table can be controlled, the problem of low verification efficiency and accuracy when verifying the substitution address generated based on RSIC-V in the prior art is solved. The substitution address generated based on RSIC-V can be verified, thereby improving the verification efficiency and accuracy of the substitution address.
[0043] Embodiment 2
[0044] Figure 2 A flowchart of a substitution address verification method based on a dynamic page table is provided for the second embodiment of the present invention. This embodiment is refined based on the above embodiment. In this embodiment, the operation of randomly processing the basic variables based on the target constraint conditions by the page table generation component to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table is specifically refined. Specifically, it may include: determining the basic page table corresponding to the basic variable based on a preset page table generation function by the page table generation component; randomly processing the basic page table based on the target constraint conditions by the page table generation component to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table. Figure 2 As shown, the method includes:
[0045] S210. Obtain a target virtual address and basic variables corresponding to the current instance through a page table generation component, and determine a target constraint condition corresponding to the basic variables based on a preset configuration specification.
[0046] In an optional embodiment, before the target virtual address and basic variables corresponding to the current instance are obtained through the page table generation component, the following may also be included: obtaining the target interface information corresponding to the target virtual address through the page table generation component, and configuring the target call interface corresponding to the target virtual address based on the target interface information. Among them, the interface information may refer to the interface name in the page table generation component that needs to be used for data transmission. The target interface information may refer to the interface information corresponding to the target virtual address. Generally, the target interface information corresponding to the target virtual address can be determined according to the actual needs of the user. The target call interface may refer to the data transmission interface corresponding to the target interface information. The configuration process may refer to the operation of setting the target call interface according to the target interface information. Specifically, before the target virtual address and basic variables corresponding to the current instance are obtained through the page table generation component, the target interface information corresponding to the target virtual address may be obtained first, and the target call interface corresponding to the target virtual address may be configured according to the target interface information. Thus, it can be ensured that the target virtual address can smoothly perform data transmission on the target call interface, providing an effective basis for the subsequent acquisition of the target virtual address. It is worth noting that in the example of the present invention, the interface information corresponding to each virtual address corresponding to the current instance may be inconsistent, and the embodiment of the present invention does not specifically limit this.
[0047] In an optional embodiment, before the target interface information corresponding to the target virtual address is obtained through the page table generation component, and the target call interface corresponding to the target virtual address is configured based on the target interface information, it may also include: obtaining the instance information and basic component class corresponding to the current instance through the page table generation component, and instantiating the basic component class based on the instance information to generate the current instance. Among them, the instance information may refer to the instance name corresponding to the current instance. The basic component class may refer to the class used to generate the page table in the page table generation component. The instantiation process may refer to the operation of setting the class name of the basic component class according to the instance information. Specifically, before obtaining the target interface information corresponding to the target virtual address and configuring the target call interface corresponding to the target virtual address based on the target interface information, the instance information and basic component class corresponding to the current instance may be determined, and then, the basic component class may be instantiated according to the instance information. Thus, a current instance that is easy to integrate into various verification environments is obtained, providing an effective basis for subsequent operations.
[0048] S220 , determining, by a page table generation component, a basic page table corresponding to the basic variable based on a preset page table generation function.
[0049] The preset page table generation function may refer to a pre-selected function for generating a page table. Exemplarily, the preset page table generation function may be a GEN function. The basic page table may refer to a preliminarily generated page table that does not contain information data.
[0050] Specifically, after determining the basic variables corresponding to the current instance based on the pre-declared variables, the basic variables can be constructed using a preset page table generation function to generate a basic page table corresponding to the basic variables, providing an effective basis for the subsequent generation of a target page table.
[0051] S230, randomly processing the basic page table based on the target constraint condition through a page table generation component to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table.
[0052] Specifically, after generating the basic page table, the target constraint conditions can be used to provide a variety of substitution mapping relationships from virtual addresses to physical addresses, generate specific information data randomly, and fill the basic page table with data according to the predefined structure type to obtain the target page table corresponding to the target virtual address. At the same time, the storage address is randomly assigned to the target page table to obtain the target storage address corresponding to the target page table, and output it in the form of a predefined dynamic array. In this way, a multi-level page table can be dynamically generated based on a single virtual address, and precise control of page table generation can be achieved.
[0053] S240. Store the target page table to the target storage address of the internal memory based on the preset storage rule through the page table generation component, determine the expected physical address corresponding to the target virtual address based on the target page table, and send the expected physical address to the verification module.
[0054] Figure 3The figure shows a schematic diagram of a page table generation component provided by an embodiment of the present invention. Specifically, the page table generation component may include: a data type definition module and a single page table entry class. Among them, the data type definition module includes a predefined single page table entry structure type, a single page table entry information dynamic array and a single page table entry storage address dynamic array. The single page table entry structure type is used to facilitate the identification and control of the fields in a single page table entry. The single page table entry information dynamic array and the single page table entry storage address dynamic array are used to determine the output type of the single page table entry interface. Exemplarily, each time a single virtual address is generated for multiple levels of PTE, the generated PTE information of each level and the storage address of the PTE in the internal memory are output in the form of an array, and the Nth element in the array represents the information or address of the Nth level PTE, and usually, N starts from 0. The single page table entry class is composed of variable declaration, default constraints, configuration interface, preset page table generation function, such as GEN function, PTE interface and printing interface. Among them, variable declaration is used to declare basic variables. For example: PTE. The default constraint is used to ensure the accuracy of the generated PTE. The configuration interface is used to configure the basic behavior of the class. Exemplarily, the basic behavior may include the Satp.ppn root page number or the maximum number of substitution levels. The GEN function is used to randomly generate PTEs. The PTE interface is used to facilitate external acquisition of multi-level PTE data information and PTE storage addresses corresponding to a single virtual address after the PTE is generated. The print interface is used to print redundant information during debugging.
[0055] S250. Obtain a target virtual address corresponding to the current instance through an address management module.
[0056] S260. Determine, through an address management module, a target storage address corresponding to the target virtual address in an internal memory based on the target virtual address.
[0057] Specifically, after obtaining the target virtual address corresponding to the current instance through the address management module, the corresponding virtual address can be matched in the internal memory according to the specific address content of the target virtual address, and then the storage address of the page table corresponding to the virtual address is determined as the target storage address of the target page table corresponding to the target virtual address, providing an effective basis for subsequent operations.
[0058] S270. Obtain a target page table corresponding to the target storage address based on the target storage address through an address management module.
[0059] Specifically, after the target storage address corresponding to the target virtual address is determined in the internal memory based on the target virtual address by the address management module, the target page table stored in the target storage address can be obtained according to the target storage address, providing an effective basis for subsequent operations.
[0060] S280. Determine, by the address management module, a basic physical address corresponding to the target virtual address based on a preset reduced instruction set substitution rule and the target page table, and send the basic physical address to a verification module.
[0061] Specifically, after obtaining the target page table corresponding to the target storage address based on the target storage address through the address management module, the substitution relationship corresponding to the target virtual address can be determined based on the target page table, and then the target virtual address can be subjected to address substitution processing based on the preset reduced instruction set substitution rules and substitution relationship to generate the basic physical address corresponding to the target virtual address.
[0062] S290. Compare and process the expected physical address and the basic physical address through a verification module to generate a verification result corresponding to the current instance.
[0063] Specifically, after generating the expected physical address corresponding to the target virtual address through the page table generation component and generating the basic physical address corresponding to the target virtual address through the address management module, the expected physical address and the basic physical address are compared for consistency through the verification module to determine whether there is a difference between the expected physical address and the basic physical address, and generate a verification result corresponding to the current instance.
[0064] In an optional embodiment, after the verification module compares and processes the expected physical address and the basic physical address to generate a verification result corresponding to the current instance, it may also include: determining corresponding verification information based on the verification result through the verification module, and displaying the verification information. Among them, the verification information may refer to prompt information corresponding to the verification result. Exemplarily, if the verification result is a verification failure, the verification information may include the cause of failure and the type of failure. If the verification result is a verification success, the verification information may be directly the verification result. Therefore, when the verification result is a verification failure, prompt information including the cause of failure and the type of failure may be generated, providing an effective basis for the subsequent work process of the staff and improving work efficiency.
[0065] The technical solution of the embodiment of the present invention obtains the target virtual address and basic variables corresponding to the current instance through the page table generation component, and determines the target constraint conditions corresponding to the basic variables based on the preset configuration specifications. Afterwards, the page table generation component determines the basic page table corresponding to the basic variables based on the preset page table generation function, and the page table generation component randomly processes the basic page table based on the target constraint conditions, generates the target page table corresponding to the target virtual address and the target storage address corresponding to the target page table, and stores the target page table to the target storage address of the internal memory based on the preset storage rule through the page table generation component, and determines the expected physical address corresponding to the target virtual address based on the target page table, and sends the expected physical address to the verification module. Further, the target virtual address corresponding to the current instance is obtained through the address management module, and the target storage address corresponding to the target virtual address is determined in the internal memory based on the target virtual address through the address management module, and the target page table corresponding to the target storage address is obtained through the address management module based on the target storage address, and the basic physical address corresponding to the target virtual address is determined by the address management module based on the preset reduced instruction set substitution rule and the target page table, and the basic physical address is sent to the verification module. Finally, the verification module compares and processes the expected physical address and the basic physical address to generate the verification result corresponding to the current instance. Since a multi-level page table is dynamically generated based on a single virtual address and the constraints for generating the page table can be controlled, the problem of low verification efficiency and accuracy when verifying the substitution address generated based on RSIC-V in the prior art is solved. The substitution address generated based on RSIC-V can be verified, thereby improving the verification efficiency and accuracy of the substitution address.
[0066] Figure 4The flowchart of a target page table generation process provided by an embodiment of the present invention is shown. Specifically, first, the instance information and basic component class corresponding to the current instance in the verification environment are obtained through the page table generation component, and the basic component class is instantiated based on the instance information to generate the current instance. After that, the target interface information corresponding to the target virtual address is obtained through the page table generation component, and the target call interface corresponding to the target virtual address is configured based on the target interface information. Further, the target virtual address corresponding to the current instance is obtained through the target call interface, the basic variables are determined through the variable declaration in the page table generation component, and the target constraint conditions corresponding to the basic variables are determined based on the preset configuration specification. After that, the basic variables are randomly processed based on the target constraint conditions by the page table generation component to generate the target page table corresponding to the target virtual address and the target storage address corresponding to the target page table. The target page table is stored in the target storage address of the internal memory based on the preset storage rules by the page table generation component. Finally, it is determined whether the target virtual address is the last virtual address. If so, the target page table generation process is terminated; if not, the next virtual address is used as the target virtual address, and the above process is repeated until the target virtual address is the last virtual address. Therefore, after generating a page table for the current virtual address, a page table is generated for subsequent virtual addresses, thereby realizing a dynamic page table generation process.
[0067] Figure 5 The flowchart of an optional substitution address verification method based on a dynamic page table provided by an embodiment of the present invention is shown. Specifically, when a target virtual address is input into the address management module, the target virtual address is also input into the page table generation component. In the page table generation component: on the one hand, a target page table corresponding to the target virtual address is generated by the page table generation component, and the target page table is stored in the target storage address of the internal memory for reading by the address management module; on the other hand, an expected physical address corresponding to the target virtual address is generated by the page table generation component. At the same time, the target page table corresponding to the target virtual address is read in the internal memory by the address management module, and the basic physical address corresponding to the target virtual address is determined based on the preset reduced instruction set substitution rule and the target page table. Afterwards, the expected physical address and the basic physical address are compared and processed by the verification module to verify the accuracy of the basic physical address and generate the verification result corresponding to the current instance.
[0068] Embodiment 3
[0069] Figure 6 The structural diagram of a substitution address verification system based on a dynamic page table provided in the third embodiment of the present invention. Figure 6 As shown, the system includes: a page table generation component 310, an internal memory 320, an address management module 330 and a verification module 340;
[0070] The page table generation component 310 is used to obtain the target virtual address and basic variables corresponding to the current instance, determine the target constraint conditions corresponding to the basic variables based on the preset configuration specification, and randomly process the basic variables based on the target constraint conditions to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table;
[0071] The page table generation component 310 is used to store the target page table to the target storage address of the internal memory 320 based on the preset storage rule, and determine the expected physical address corresponding to the target virtual address based on the target page table, and send the expected physical address to the verification module 340;
[0072] Internal memory 320, used for storing the target page table;
[0073] The address management module 330 is used to obtain a target virtual address corresponding to the current instance, determine a corresponding target page table in the internal memory 320 based on the target virtual address, determine a basic physical address corresponding to the target virtual address based on a preset reduced instruction set substitution rule and the target page table, and send the basic physical address to the verification module 340;
[0074] The verification module 340 is used to compare and process the expected physical address and the basic physical address to generate a verification result corresponding to the current instance.
[0075] The technical solution of the embodiment of the present invention is to obtain the target virtual address and basic variables corresponding to the current instance through the page table generation component 310, determine the target constraints corresponding to the basic variables based on the preset configuration specifications, and randomly process the basic variables based on the target constraints to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table; store the target page table to the target storage address of the internal memory 320 based on the preset storage rules through the page table generation component 310, and determine the expected physical address corresponding to the target virtual address based on the target page table, and send the expected physical address to the verification module 340; obtain the target virtual address corresponding to the current instance through the address management module 330, determine the corresponding target page table in the internal memory 320 based on the target virtual address, and determine the basic physical address corresponding to the target virtual address based on the preset reduced instruction set substitution rules and the target page table, and send the basic physical address to the verification module 340; compare and process the expected physical address and the basic physical address through the verification module 340 to generate a verification result corresponding to the current instance. Since a multi-level page table is dynamically generated based on a single virtual address and the constraints for generating the page table can be controlled, the problem of low verification efficiency and accuracy when verifying the substitution address generated based on RSIC-V in the prior art is solved. The substitution address generated based on RSIC-V can be verified, thereby improving the verification efficiency and accuracy of the substitution address.
[0076] Optionally, the target constraints may include: initial constraints and set constraints.
[0077] Optionally, the page table generation component 310 may be specifically used for:
[0078] Determine the basic page table corresponding to the basic variable based on a preset page table generation function;
[0079] The basic page table is randomly processed based on the target constraint condition to generate a target page table corresponding to a target virtual address and a target storage address corresponding to the target page table.
[0080] Optionally, if the preset storage rule is a front-door storage rule; the page table generation component 310 can be specifically used to: obtain the target communication protocol corresponding to the current instance, and store the target page table to the target storage address of the internal memory 320 based on the target communication protocol.
[0081] Optionally, the preset storage rule is a backdoor storage rule; the page table generation component 310 can be specifically used to: obtain a basic array variable of a target storage address in the internal memory 320, and perform an assignment operation on the basic array variable based on the target page table.
[0082] Optionally, the address management module 330 may be specifically used for:
[0083] Determining a target storage address corresponding to the target virtual address in the internal memory 320 based on the target virtual address;
[0084] A target page table corresponding to the target storage address is obtained based on the target storage address.
[0085] Optionally, the page table generation component 310 can also be used to: before obtaining the target virtual address and basic variables corresponding to the current instance through the page table generation component 310, obtain the target interface information corresponding to the target virtual address, and configure the target call interface corresponding to the target virtual address based on the target interface information.
[0086] Optionally, the page table generation component 310 can also be used to: before obtaining the target interface information corresponding to the target virtual address through the page table generation component 310, and configuring the target call interface corresponding to the target virtual address based on the target interface information, obtain the instance information and basic component class corresponding to the current instance, and instantiate the basic component class based on the instance information to generate the current instance.
[0087] Optionally, the verification module 340 can also be used to: after the verification module 340 compares and processes the expected physical address and the basic physical address to generate a verification result corresponding to the current instance, determine corresponding verification information based on the verification result and display the verification information.
[0088] The substitution address verification system based on dynamic page table provided in the embodiment of the present invention can execute the substitution address verification method based on dynamic page table provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0089] 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.
[0090] 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 substitution address verification method based on a dynamic page table, characterized in that: include: Obtaining the target virtual address and basic variables corresponding to the current instance through the page table generation component, determining the target constraint conditions corresponding to the basic variables based on the preset configuration specification, and randomly processing the basic variables based on the target constraint conditions to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table; The target page table is stored in the target storage address of the internal memory by the page table generation component based on the preset storage rule, and the expected physical address corresponding to the target virtual address is determined based on the target page table, and the expected physical address is sent to the verification module; Obtaining a target virtual address corresponding to the current instance through an address management module, determining a corresponding target page table in an internal memory based on the target virtual address, and determining a basic physical address corresponding to the target virtual address based on a preset reduced instruction set substitution rule and the target page table, and sending the basic physical address to a verification module; The expected physical address and the basic physical address are compared and processed by a verification module to generate a verification result corresponding to the current instance.
2. The method according to claim 1, characterized in that The target constraint conditions include: initial constraint conditions and set constraint conditions.
3. The method according to claim 1, characterized in that The basic variable is randomly processed based on the target constraint condition by a page table generation component to generate a target page table corresponding to a target virtual address and a target storage address corresponding to the target page table, including: Determine, by a page table generation component, a basic page table corresponding to the basic variable based on a preset page table generation function; The basic page table is randomly processed based on the target constraint condition by a page table generation component to generate a target page table corresponding to a target virtual address and a target storage address corresponding to the target page table.
4. The method according to claim 1, characterized in that: If the preset storage rule is a front-door storage rule, storing the target page table to the target storage address of the internal memory based on the preset storage rule by the page table generation component includes: The target communication protocol corresponding to the current instance is obtained through the page table generation component, and the target page table is stored in the target storage address of the internal memory based on the target communication protocol.
5. The method according to claim 1, characterized in that If the preset storage rule is a backdoor storage rule, storing the target page table to the target storage address of the internal memory based on the preset storage rule by the page table generation component includes: The basic array variable of the target storage address in the internal memory is obtained through the page table generation component, and the basic array variable is assigned a value based on the target page table.
6. The method according to claim 1, characterized in that Determining a corresponding target page table in the internal memory based on the target virtual address by an address management module includes: Determining, by an address management module, a target storage address corresponding to the target virtual address in an internal memory based on the target virtual address; A target page table corresponding to the target storage address is obtained based on the target storage address through an address management module.
7. The method according to claim 1, characterized in that Before obtaining the target virtual address and basic variables corresponding to the current instance through the page table generation component, it also includes: The target interface information corresponding to the target virtual address is obtained through the page table generation component, and the target calling interface corresponding to the target virtual address is configured based on the target interface information.
8. The method according to claim 7, characterized in that Before obtaining the target interface information corresponding to the target virtual address through the page table generation component and configuring the target call interface corresponding to the target virtual address based on the target interface information, the method further includes: The instance information and the basic component class corresponding to the current instance are obtained through the page table generation component, and the basic component class is instantiated based on the instance information to generate the current instance.
9. The method according to claim 1, characterized in that: After the verification module compares and processes the expected physical address and the basic physical address to generate a verification result corresponding to the current instance, the method further includes: The verification module determines corresponding verification information based on the verification result, and displays the verification information.
10. A substitution address verification system based on a dynamic page table, characterized in that: include: A page table generation component is used to obtain a target virtual address and a basic variable corresponding to the current instance, determine a target constraint condition corresponding to the basic variable based on a preset configuration specification, and randomly process the basic variable based on the target constraint condition to generate a target page table corresponding to the target virtual address and a target storage address corresponding to the target page table; A page table generation component, used for storing a target page table to a target storage address of an internal memory based on a preset storage rule, and determining an expected physical address corresponding to the target virtual address based on the target page table, and sending the expected physical address to a verification module; An internal memory, used for storing a target page table; An address management module is used to obtain a target virtual address corresponding to the current instance, determine a corresponding target page table in the internal memory based on the target virtual address, determine a basic physical address corresponding to the target virtual address based on a preset reduced instruction set substitution rule and the target page table, and send the basic physical address to a verification module; The verification module is used to compare and process the expected physical address and the basic physical address to generate a verification result corresponding to the current instance.
Citation Information
Cited By
Page table generation method and device, electronic equipment and storage medium
CN121542194A
Table of contents generation method and device, electronic equipment and storage medium
CN121542194B