Verification method of target computing unit, computing unit, processor and electronic equipment

By executing loading tasks and operations in the computing unit, using the delay of the external storage unit to increase the probability of out-of-order behavior, and verifying whether the processor complies with weak memory consistency rules, it solves the problem of difficulty in detecting out-of-order execution in the existing technology. , improving the verification accuracy.

CN118567887APending Publication Date: 2024-08-30KUNLUNXIN TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310200014.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In processors, computing units based on weak memory consistency rules are difficult to verify whether they comply with out-of-order execution, and related program errors are difficult to detect, which may lead to system crashes.

Method used

Provide a verification method for the target computing unit. By executing loading tasks and operations, the high latency of the external storage unit is used to increase the time for register data preparation to be completed, thereby increasing the probability of out-of-order behavior, and determining the verification of the computing unit based on the operation results. result.

Benefits of technology

Effectively verify whether the computing unit complies with weak memory consistency rules, reduce misjudgments, and improve the accuracy of verification results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567887A
    Figure CN118567887A
Patent Text Reader

Abstract

The invention provides a verification method of a target computing unit, and relates to the technical field of computers, in particular to the technical field of chip verification and the technical field of integrated circuit chips. According to the specific implementation scheme, in response to a received verification request of a target computing unit, a first loading task is executed, and the first loading task comprises the step of loading first data at a first address of an external storage unit to a first register; executing a second loading task, the second loading task comprising loading a second address to a second register; in response to determining that the first loading task is completed, executing a first operation based on the third register and the first data; in response to determining that the second loading task is completed, executing a second operation based on the fourth register and the second address; and determining a verification result of the target calculation unit according to the execution result of the first operation and the execution result of the second operation. The invention further provides a computing unit, a processor, electronic equipment and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to the field of chip verification technology and integrated circuit chip technology. More specifically, the present disclosure provides a verification method of a target computing unit, a computing unit, an electronic device, and a storage medium. Background Art

[0002] With the development of computer technology and integrated circuit technology, a processor may include multiple computing units, and the operation of the computing units may comply with weak memory ordering (WMO). Summary of the invention

[0003] The present disclosure provides a method for verifying a target computing unit, a computing unit, a processor, and a storage medium.

[0004] According to one aspect of the present disclosure, a verification method for a target computing unit is provided, the method comprising: in response to receiving a verification request for the target computing unit, executing a first loading task, wherein the target computing unit comprises a first register, a second register, a third register and a fourth register, and the first loading task comprises loading first data at a first address of an external storage unit into the first register; executing a second loading task, wherein the second loading task comprises loading a second address into the second register; in response to determining that the first loading task is completed, executing a first operation based on the third register and the first data; in response to determining that the second loading task is completed, executing a second operation based on the fourth register and the second address; and determining a verification result of the target computing unit according to the execution result of the first operation and the execution result of the second operation.

[0005] According to another aspect of the present disclosure, a computing unit is provided, which includes: a first register; a second register; a third register; a fourth register; and a controller, wherein the controller is configured to: in response to receiving a computing unit verification request, execute a first loading task, wherein the first loading task includes loading first data at a first address of an external storage unit into the first register; execute a second loading task, wherein the second loading task includes loading a second address into the second register; in response to determining that the first loading task is completed, execute a first operation based on the third register and the first data; in response to determining that the second loading task is completed, execute a second operation based on the fourth register and the second address; and determine a verification result of the computing unit according to the execution result of the first operation and the execution result of the second operation.

[0006] According to another aspect of the present disclosure, an electronic device is provided, including: a plurality of computing units provided according to the present disclosure; a cache unit; and a main storage unit.

[0007] According to another aspect of the present disclosure, an electronic device is provided, including: a plurality of computing units provided according to the present disclosure; and a cache unit.

[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method provided according to the present disclosure.

[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method provided according to the present disclosure.

[0010] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method provided according to the present disclosure is implemented.

[0011] According to another method of the present disclosure, a processor is provided, the processor comprising: a plurality of computing units provided according to the present disclosure; and a cache unit.

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0014] Figure 1 is a schematic diagram of an exemplary system architecture to which a verification method of a target computing unit can be applied according to an embodiment of the present disclosure;

[0015] Figure 2 is a flow chart of a method for verifying a target computing unit according to an embodiment of the present disclosure;

[0016] Figure 3 is a schematic diagram of a processor according to one embodiment of the present disclosure;

[0017] Figure 4A is a preset flow chart of a verification method of a target computing unit according to another embodiment of the present disclosure;

[0018] Figure 4B is an execution flow chart of a verification method of a target computing unit according to an embodiment of the present disclosure;

[0019] Figure 5Ais a preset flow chart of a verification method of a target computing unit according to another embodiment of the present disclosure;

[0020] Figure 5B is an execution flow chart of a verification method of a target computing unit according to an embodiment of the present disclosure;

[0021] Fig. 6A is a preset flow chart of a verification method of a target computing unit according to another embodiment of the present disclosure;

[0022] Figure 6B is an execution flow chart of a verification method of a target computing unit according to an embodiment of the present disclosure

[0023] Figure 7 is a schematic diagram of a processor according to one embodiment of the present disclosure;

[0024] Figure 8 is a schematic block diagram of a computing unit according to an embodiment of the present disclosure; and

[0025] Fig. 9 is a block diagram of an electronic device to which a verification method of a target computing unit can be applied according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0027] The open source instruction set architecture based on the reduced instruction set (RISC-V) can follow weak memory consistency rules. The model can be a weak memory order model, which can have fewer memory access order constraints, providing more relaxed conditions for hardware implementation and performance optimization. The processor based on the open source instruction set architecture based on the reduced instruction set can include multiple computing units (cores). The computing unit may include a memory access unit (Load and Store Unit, LSU). The memory access unit can handle the out-of-order sending of memory access requests, and can be a key unit for implementing weak memory consistency rules, which is crucial to hardware functions and performance.

[0028] The memory access unit can constrain the memory access order of a single core and the memory access order of multiple cores. For the memory access order of multiple cores, the litmus test can be used for verification. For the memory access order of a single core, if the hardware architecture supports instruction out-of-order and branch prediction, the memory access out-of-order scenario may be difficult to trigger, and it is also difficult to verify whether the memory access unit complies with the weak consistency rules. In addition, program errors (bugs) related to memory access out-of-order are difficult to detect and may cause the entire system to crash.

[0029] Figure 1 is a schematic diagram of an exemplary system architecture to which a verification method of a computing unit can be applied according to an embodiment of the present disclosure. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0030] like Figure 1 As shown, the processor 10 may include a computing unit 100 and a computing unit 101. The computing unit of the processor 10 may be a processing core of the processor. The computing unit 100 may be used as a target computing unit. The computing unit 101 may be used as an additional computing unit.

[0031] The computing unit 100 may have an internal cache 1001, and the computing unit 101 may have an internal cache 1011. The computing unit 100 may read data from the internal cache 1001, and may also write data to the internal cache 1001. The computing unit 101 may read data from the internal cache 1011, and may also write data to the internal cache 1011. It can be understood that the internal cache may be a first-level cache (L1 cache, L1) of the processor.

[0032] The internal cache 1001 and the internal cache 1011 can read data from the external cache 102, and can also write data to the external cache 102. It can be understood that the external cache can be a second-level cache (L2 cache, L2) of the processor.

[0033] The external cache 102 can read data from the main memory unit (Main Memory) 11, and can also write data to the main memory unit 11. It can be understood that, when the amount of data is consistent, the computing unit reads and writes data from the internal cache faster, reads and writes data from the external cache slower, and reads and writes data from the main memory unit even slower.

[0034] In some embodiments, the computing unit may include a first register, a second register, a third register, and a fourth register. The computing unit may perform operations S1a to S1d. In operation S1a, address addr_0 is loaded to the first register. In operation S1b, address addr_1 is loaded to the second register. In operation S1c, the value of the third register is stored to address addr_0 stored in the first register. In operation S1d, the value in address addr_1 stored in the second register is loaded to the fourth register. In the case where there is no actual address overlap between addresses addr_0 and addr_1, according to the weak consistency memory rule, operation S1d can be performed before operation S1c to generate disorder. However, in the actual verification process, disorder is difficult to occur. The reason is that operation S1a and operation S1b can be completed almost at the same time, resulting in the values ​​in the first register and the second register being in a ready state almost at the same time, making disorder behavior difficult to achieve.

[0035] In some embodiments, the computing unit may include a first register, a second register, a third register, and a fourth register. The computing unit may perform operations S2a to S2e. In operation S2a, address addr_0 is loaded into the first register. In operation S2b, the value in the first register is added to a preset value (e.g., 8). In operation S2c, address addr_1 is loaded into the second register. In operation S1d, the value of the third register is stored in address addr_0 stored in the first register. In operation S1e, the value in address addr_1 stored in the second register is loaded into the fourth register. Operation S2b is added, which increases the time required for the value of the first register to be ready. In the case where there is no actual address overlap between addresses addr_0 and addr_1, according to the weak consistency memory rule, operation S2e can be performed before operation S2d to generate disorder. However, in the actual verification process, disorder is difficult to occur. The reason is that the time required to perform operation S2b is very short, resulting in the values ​​in the first register and the second register being almost in the ready state at the same time, making disorder behavior difficult to achieve. In an embodiment of the present disclosure, in order to verify whether a computing unit that exhibits out-of-order execution behavior is normal, a verification method for a target computing unit is provided, which will be described in detail below.

[0036] Figure 2 is a flowchart of a method for verifying a target computing unit according to an embodiment of the present disclosure.

[0037] like Figure 2 As shown, the method 200 may include operations S210 to S250.

[0038] In operation S210 , in response to receiving a target computing unit verification request, a first load task is executed.

[0039] In an embodiment of the present disclosure, the target computing unit may include a first register, a second register, a third register, and a fourth register.

[0040] In the disclosed embodiment, the first load task includes loading first data at a first address of an external storage unit into a first register. The external storage unit may be a main storage unit and may be located outside the processor. For example, the address addr_3 of the external storage unit may be used as the first address. The first data at the address addr_3 may include a source operand. The first data may indicate the address addr_T.

[0041] In operation S220 , a second loading task is performed.

[0042] In the embodiment of the present disclosure, the second loading task may include loading the second address into the second register. For example, the address addr_1 mentioned above may be used as the second address. The address addr_1 may be determined by an immediate value.

[0043] In operation S230 , in response to determining that the first load task is completed, a first operation is performed based on the third register and the first data.

[0044] In an embodiment of the present disclosure, the first operation may include: storing the target data in the third register to the target address indicated by the first data. The third register may store the target data. The address addr_T may be used as the target address. The target data may be stored at the address addr_T to perform the first operation.

[0045] In operation S240 , in response to determining that the second load task is completed, a second operation is performed based on the fourth register and the second address.

[0046] In the embodiment of the present disclosure, the second operation may include: loading the second data stored at the second address into the fourth register. For example, the second data may be loaded into the fourth register to perform the second operation.

[0047] In operation S250 , a verification result of the target computing unit is determined according to an execution result of the first operation and an execution result of the second operation.

[0048] In the disclosed embodiment, the execution order of the first operation and the second operation can be determined according to the execution result of the first operation and the execution result of the second operation. According to the execution order, the verification result is determined. For example, if the execution result of the second operation is obtained first, the execution order can be determined as: the second operation is executed first, and the first operation is executed later. Based on this, it can be determined that the memory access unit disorder is triggered during this verification process. If the execution result is correct, it can be determined that the verification result is successful.

[0049] Through the embodiment of the present disclosure, a first loading task of loading data from an external storage unit is executed. The high latency of accessing the external storage unit can be utilized to increase the time required for the data to be loaded in the first register to be in a ready state, thereby increasing the probability of out-of-order behavior occurring, which helps to effectively verify the computing unit for out-of-order behavior.

[0050] It should be noted that operation S230 and operation S240 may be performed sequentially, but the embodiments of the present disclosure are not limited thereto, and the two groups of operations may also be performed in other orders, such as performing operation S240 first and then performing operation S230, or performing operation S230 and operation S240 in parallel.

[0051] It can be understood that the verification method disclosed in the present invention is described above. Figure 3 The verification method of the present disclosure is further explained.

[0052] Figure 3 is a schematic diagram of a processor according to another embodiment of the present disclosure.

[0053] In some embodiments, executing the first load task may include: determining whether the first data exists in an external cache of the target computing unit when it is determined that the first data does not exist in an internal cache of the target computing unit. Requesting the first data at the first address from an external storage unit when it is determined that the first data does not exist in the external cache. Loading the first data at the first address to the first register via the external cache and the internal cache of the target computing unit.

[0054] In the embodiment of the present disclosure, executing the first loading task may include: loading the first address into the fifth register; and obtaining the first address from the fifth register.

[0055] For example, Figure 3As shown, the address addr3311 may be located in the main storage unit 31. The address addr_3311 may be used as the first address. The first address may be loaded into the fifth register x33006. The computing unit 300 may obtain the first address from the fifth register x3. The computing unit 300 may initiate a request to load the first data at the first address. In response to the request, it may be determined whether the first data exists in the internal cache 3001. In the case of determining that the first data does not exist in the internal cache 3001, it may be determined whether the first data exists in the external cache 302. In the case of determining that the first data does not exist in the external cache 302, the first data at the first address may be requested from the main storage unit 31.

[0056] Next, the main storage unit 31 may return the first data to the external cache 302. The external cache 302 may return the first data to the internal cache 3001. The internal cache 3001 may return the first data to the computing unit 300. The first data may indicate a target address. The target address may be addr_T. Next, the first data may be loaded into the first register x13002. Through the disclosed embodiment, the first data is loaded into the first register via the external cache and the internal cache. Thus, it takes a long time for the value in the first register to switch to the ready-to-complete state, so that the second operation is executed before the first operation, rather than the first operation being executed before the first operation, which helps the out-of-order behavior to occur, and then helps to verify whether the computing unit operates normally when the out-of-order behavior occurs.

[0057] It can be understood that some methods of executing the first loading task in the present disclosure are described above, and some methods of executing the second loading task will be further described below.

[0058] In the embodiment of the present disclosure, in the above operation S220, the second address may be loaded into the second register. For example, the second address may correspond to an immediate number. According to the immediate number, the address addr_1 as the second address may be determined. The address addr_1 may be loaded into the second register x23003.

[0059] It can be understood that some methods of executing the second loading task are described above, and some methods of executing the first operation and the second operation will be described below.

[0060] It can also be understood that when the first address is located in the main storage unit, the execution time of the first load task is longer because the time required to load data from the main storage unit to the first register is longer. Since the second address is determined by an immediate number, the execution time of the second load task is shorter. Therefore, the value in the second register x23003 can be in the ready state first. In this case, for operation S230 and operation S240, the above operation S240 will be performed first.

[0061] In some embodiments, in the above operation S240, a second operation for loading the second data stored at the second address into the fourth register a2 3005 may be performed. Next, during or after the execution of the second operation, the value of the first register x1 3002 may be in a ready state, and the above operation S230 may be performed.

[0062] In some embodiments, in the above operation S230, a first operation of storing the target data in the third register a13004 to the target address indicated by the first data may be performed. The current value at the target address may be the target data.

[0063] It can be understood that some methods of performing the first operation and the second operation are described above, and some methods of determining the verification result will be further described below. After the first operation and the second operation are completed, the above operation S250 can be performed.

[0064] In some embodiments, in the above operation S250, determining the verification result of the target computing unit according to the execution result of the first operation and the execution result of the second operation may include: obtaining the first target execution result when the second operation and the first operation are executed in sequence. As described above, the second operation is executed first and then the first operation is executed, and the current value in the relevant address can be used as the first target execution result.

[0065] In the embodiment of the present disclosure, the second target execution result can be obtained when the first operation and the second operation are executed in sequence. For example, if the first operation is executed first and then the second operation is executed, the current value in the relevant address can be used as the second target execution result.

[0066] Next, it may be determined whether the first target execution result is consistent with the second target execution result.

[0067] In an embodiment of the present disclosure, when the first target execution result is consistent with the second target execution result, the verification result of the target computing unit is determined to be that the operation of the target computing unit complies with the weak memory consistency rule.

[0068] For example, taking the non-overlap between the target address and the second address as an example, when the second operation is executed first and the first operation is executed later, the first target execution result may include: the current value at the target address is the target data, and the current value of the second address is the second data. The second data may be loaded into the fourth register a23005. When the first operation is executed first and the second operation is executed later, the second target execution result may include: the current value at the target address is the target data, and the current value of the second address is the second data. The second data may be loaded into the fourth register a23005. Thus, it can be determined that the first target execution result and the second target execution result are consistent, and then it can be determined that the computing unit 300 complies with the weak memory consistency rule. Through the embodiment of the present disclosure, when out-of-order behavior occurs and the two target execution results are consistent, it is determined that the verification result is that the computing unit complies with the weak memory consistency rule, which can reduce misjudgment and improve the accuracy of the verification result.

[0069] It can be understood that the verification result of the present disclosure is described above by taking the consistency between the first target execution result and the second target execution result as an example. However, in the case where the second operation is executed first and the first operation is executed later, an error may occur in the computing unit 300 itself, resulting in an abnormality in the first target execution result, which in turn causes the first target execution result and the second target execution result to be inconsistent. In an embodiment of the present disclosure, when it is determined that the first target execution result and the second target execution result are inconsistent, it can be determined that the verification result of the target computing unit is that the operation of the target computing unit does not comply with the weak memory consistency rule.

[0070] It can be understood that the verification method of the present disclosure is described above in conjunction with a processor including a target computing unit, and the verification method of the present disclosure will be further described below in conjunction with relevant flow charts.

[0071] Figure 4A is a preset flow chart of a method for verifying a target computing unit according to another embodiment of the present disclosure.

[0072] like Figure 4A As shown, the preset process M400 may include: firstly executing a first operation for storing target data to a target address, and then executing a second operation for loading second data stored at a second address into a fourth register.

[0073] In the embodiment of the present disclosure, when the first operation and the second operation are sequentially executed according to the preset process M400, the target computing unit can operate normally. In the case of complying with the weak memory consistency rule, even if the preset process M400 is not executed, the execution of the first operation and the execution of the second operation can not interfere with each other.

[0074] To verify the target computing unit, you can execute Figure 4B The following will combine Figure 4B Provide further explanation.

[0075] Figure 4B is a flowchart of an execution of a verification method of a target computing unit according to an embodiment of the present disclosure.

[0076] like Figure 4B As shown, the execution process M401 may include operations S410 to S450.

[0077] In operation S410, a first loading task is performed. For example, the target address indicated by the first data may be loaded into a first register. The target address may be address A0.

[0078] In operation S420, a second loading task is performed. For example, address A1 as the second address may be loaded into the second register.

[0079] As described above, the first data is located at the first address of the external storage unit. The second address can be determined by an immediate value. Since the time required to load the first data from the external storage unit is long and the time required to determine the second address according to the immediate value is short, the value of the second register (address A1) can be in a ready state first compared to the first register, and the second operation related to the second register will be executed first, and then the first operation related to the first register will be executed.

[0080] In operation S441, a second operation for loading the second data stored at the second address into the fourth register is performed. For example, the second data may be loaded into the fourth register to perform the second operation. It is understood that during the execution of the second operation, the value of the first register (address A0) may be switched to a ready state. After the second operation is completed, operation S431 may be performed.

[0081] In operation S431, a first operation for storing target data in a target address is performed. For example, the target data of the third register may be stored in address A0.

[0082] After the first operation and the second operation are performed, operation S450 may be performed.

[0083] In operation S450, the verification result of the target computing unit is determined according to the execution result of the first operation and the execution result of the second operation. For example, the second operation and the first operation are executed successively, and the first target execution result may include: the current value at address A0 is the target data, and the current value at address A1 is the second data. The second data may be loaded into the fourth register. In the case where the first operation is executed first and the second operation is executed later, the second target execution result may include: the current value at address A0 is the target data, and the current value at address A1 is the second data. The second data may be loaded into the fourth register. Thus, it can be determined that the first target execution result and the second target execution result are consistent, and then it can be determined that the computing unit complies with the weak memory consistency rule.

[0084] It can be understood that the above description uses the example of non-overlapping addresses to illustrate some methods of determining verification results. The following description will further illustrate the method of determining verification results by using the example of overlapping addresses.

[0085] Figure 5A is a preset flow chart of a method for verifying a target computing unit according to another embodiment of the present disclosure.

[0086] like Figure 5A As shown, the preset process M500 may include: firstly executing a first operation for storing target data to a target address, and then executing a second operation for loading second data stored at a second address into a fourth register.

[0087] In the embodiment of the present disclosure, when the first operation and the second operation are sequentially executed according to the preset process M500, if there is overlap (for example, the same) between address A2 and address A2', the target computing unit can also operate normally. In order to verify the operating state of the target computing unit when out-of-order behavior occurs, Figure 5B The execution flow shown.

[0088] Figure 5B is a flowchart of an execution of a verification method of a target computing unit according to an embodiment of the present disclosure.

[0089] like Figure 5B As shown, the execution process M501 may include operations S510 to S550.

[0090] In operation S510, a first loading task is performed. The address A2 indicated by the first data can be loaded into the first register. The address A2 can be used as the target address

[0091] In operation S520, the second loading task is performed. The address A2' as the second address may be loaded into the second register. In the embodiment of the present disclosure, if there is an overlap between the target address and the second address, the target address and the second address are both address A2.

[0092] As described above, the first data is located at the first address of the external storage unit. The second address can be determined by an immediate value. Since the time required to load the first data from the external storage unit is long and the time required to determine the second address according to the immediate value is short, the value of the second register (address A2) can be in a ready state first compared to the first register, and the second operation related to the second register will be executed first.

[0093] In operation S541, a second operation for loading the second data stored at the second address into the fourth register is performed. For example, the second data may be loaded into the fourth register to perform the second operation. It is understood that during the execution of the second operation, the value of the first register (address A2) may be switched to a ready state. In the case where there is an overlap between the target address and the second address, operation S542 is performed.

[0094] In operation S542, the second operation is terminated. For example, the loading of the second data into the fourth register may be terminated. Next, operation S531 may be performed.

[0095] In operation S531, a first operation for storing target data in a target address is performed. For example, the target data of the third register may be stored in address A2. After the first operation is completed, operation S543 may be performed.

[0096] In operation S543, the second operation for loading the second data stored at the second address into the fourth register is re-executed. For example, the data of address A2 may be loaded into the fourth register to perform the second operation.

[0097] In operation S550, the verification result of the target computing unit is determined according to the execution result of the first operation and the execution result of the second operation. As described above, in the case where there is an overlap between address A2 and address A2', the second operation is terminated when the second operation is first executed. After the first operation is completed, the second operation is re-executed. Thus, the execution order is that the first operation is executed first and the second operation is executed later, and it can be determined that the verification result is a verification failure.

[0098] It can be understood that the method of the present disclosure is described above by taking the first operation including the storage operation and the second operation including the load operation as an example. However, the present disclosure is not limited thereto, the first operation may also include the load operation, and the second operation may also include the storage operation. The following description will be given by taking the second operation including the storage operation and the load operation as an example.

[0099] Fig. 6A is a preset flow chart of a method for verifying a target computing unit according to another embodiment of the present disclosure.

[0100] like Fig. 6A As shown, the preset process M600 may include: first executing a second operation for storing third data to a third address, then executing a first operation for storing target data to a target address, and finally executing a second operation for loading second data at a second address to a fourth register.

[0101] For example, the third data D3 may be first stored in address A3' as the third address. Then the target data Dt may be stored in address A3 as the target address. Finally, the second data D2 at address A3" as the second address may be loaded into the fourth register. If there is overlap between multiple addresses, address A3' and address A3" may be address A3. After the third data D3 is stored in address A3 as the target address, the value of address A3 may be the target data D3. After the target data Dt is stored in address A3 as the target address, the value of address A3 may be the target data Dt. Thus, the value loaded from address A3 to the fourth register may be the target data Dt.

[0102] In the embodiment of the present disclosure, when the first operation and the two second operations are executed in sequence according to the preset process M600, if there is overlap (for example, the same) between the multiple addresses, the target computing unit can also operate normally. In the operation state when the out-of-order behavior occurs, in order to verify the target computing unit, you can execute Figure 6B The execution flow shown.

[0103] Figure 6B is a flowchart of an execution of a verification method of a target computing unit according to an embodiment of the present disclosure.

[0104] like Figure 6B As shown, the execution process M601 may include operations S610 to S650.

[0105] In operation S610, a first loading task is performed. Address A3 indicated by first data may be loaded into a first register. Address A3 may be used as a target address.

[0106] In operation S621, multiple second loading tasks are performed. The second address may be loaded into the second register, and the third address may be loaded into the sixth register. In the embodiment of the present disclosure, since there is overlap between the multiple addresses, the target address, the second address, and the third address are all address A3.

[0107] As described above, the first data is located at the first address of the external storage unit. The second address and the third address can be determined by an immediate number. Since the time required to load the first data from the external storage unit is long and the time required to determine the second address or the third address according to the immediate number is short, the value of the second register (address A3) and the value of the sixth register (address A3) can be in the ready state first. Therefore, operation S644 will be performed first.

[0108] In operation S644, a second operation for storing the third data of the seventh register to the third address is performed. For example, the third data D3 of the seventh register may be stored to address A3 to perform the first second operation. It is understood that during the execution of the second operation, the value of the first register (address A3) may be in a preparation unfinished state. In the case where there is overlap between multiple addresses, the value of address A3 may be the third data D3.

[0109] In operation S645, a second operation for loading the second data stored at the second address into the fourth register is performed. For example, the value of address A3 (third data D3) can be loaded into the fourth register to perform the second second operation. After the execution of the second second operation is completed, the value of the first register (address A3) can be switched to the preparation unfinished state.

[0110] In operation S632, a first operation for storing target data in a target address is performed. For example, the target data of the third register may be stored in address A3. After the first operation is completed, operation S650 may be performed.

[0111] In operation S650, the verification result of the target computing unit is determined according to the execution result of the first operation and the execution result of the second operation. As described above, in the case where there is overlap between multiple addresses, the first target execution result may include: the value of the fourth register is the third data D3. As described above, in the case where the first operation and the second operation are performed in a preset process sequence, the second target execution result may include: the value of the fourth register is the target data Dt. After the preset process and the execution process, respectively, the value of the fourth register is different. That is, the first target execution result and the second target execution result are inconsistent. The inconsistency is caused by the overlap between multiple addresses, so the verification result may be a verification failure.

[0112] It is understandable that after the first data is loaded into the first register, the first data may exist in the internal cache of the target computing unit. If the verification method is executed multiple times, during the second execution, the target computing unit may load the first data from its internal cache, resulting in the first loading task being completed faster, thereby causing an out-of-order failure.

[0113] Based on this, in the embodiment of the present disclosure, executing the first loading task may also include: controlling the additional computing unit to write the first data to the first address. When it is determined that the first data does not exist in the internal cache of the target computing unit, determining whether the first data exists in the external cache of the target computing unit. When it is determined that the first data does not exist in the external cache, controlling the external cache to send a detection request for the first data to the internal cache of the additional computing unit. Loading the first data from the internal cache of the additional computing unit to the first register via the external cache and the internal cache of the target computing unit. Figure 7 Provide detailed explanation.

[0114] Figure 7 is a schematic diagram of a processor according to one embodiment of the present disclosure.

[0115] like Figure 7 As shown, computing unit 700 may be used as a target computing unit, and computing unit 701 may be used as an additional computing unit.

[0116] The computing unit 701 may be controlled to write the first data to the first address. Based on the cache consistency rule, the first data in the internal cache 7001 in the computing unit 700 may be deleted.

[0117] In the case where it is determined that the first data does not exist in the internal cache 7001, it can be determined whether the first data exists in the external cache 702. In the case where it is determined that the first data does not exist in the external cache 702, the external cache 702 is controlled to send a probe request for the first data to the internal cache 7011 of the computing unit 701. In response to the request, the internal cache 7011 can release the first data to the external cache 702. The external cache 702 can return the first data to the internal cache 7001, and the internal cache 7001 can return the first data to the computing unit 700, so that the first data can be loaded into the first register. Through the embodiment of the present disclosure, the additional computing unit is used to write the first data to the external storage unit multiple times. In this case, in order to maintain the cache consistency rule, the first data in the internal cache is deleted. In the process of multiple loop verifications, the first data can be made to not exist in the target computing unit, thereby triggering multiple occurrences of out-of-order execution, and it can be verified whether the computing unit complies with the weak memory consistency rule under long-term out-of-order operation.

[0118] Figure 8 is a schematic block diagram of a computing unit according to an embodiment of the present disclosure.

[0119] like Figure 8 As shown, the computing unit 800 may include a first register 810 , a second register 820 , a third register 830 , a fourth register 840 and a controller 850 .

[0120] The controller 850 is configured to:

[0121] In response to receiving the computing unit verification request, a first load task is executed. For example, the first load task includes loading first data at a first address of an external storage unit into a first register.

[0122] A second load task is executed. For example, the second load task includes loading a second address into a second register.

[0123] In response to determining that the first load task is completed, a first operation is performed based on the third register and the first data.

[0124] In response to determining that the second load task is completed, a second operation is performed based on the fourth register and the second address.

[0125] The verification result of the computing unit is determined according to the execution result of the first operation and the execution result of the second operation. For a detailed description of the controller 850, reference may be made to the verification method of the target computing unit described above. For example, the controller 850 may be disposed in the computing unit 300 described above.

[0126] In some embodiments, the first operation includes storing the target data in the third register to a target address indicated by the first data.

[0127] In some embodiments, the second operation includes loading the second data stored at the second address into the fourth register.

[0128] In some embodiments, an internal cache is also included. The controller is further configured to: determine whether the first data exists in the external cache of the computing unit when it is determined that the internal cache does not exist. When it is determined that the first data does not exist in the external cache, request the first data at the first address from the external storage unit, and load the first data at the first address into the first register via the external cache and the internal cache.

[0129] In some embodiments, a fifth register is further included, wherein the controller is further configured to: load the first address into the fifth register and obtain the first address from the fifth register.

[0130] In some embodiments, the controller is further configured to: control the additional computing unit to write the first data to the first address. If it is determined that the first data does not exist in the internal cache, determine whether the first data exists in the external cache. If it is determined that the first data does not exist in the external cache, control the external cache to send a detection request for the first data to the internal cache of the additional computing unit. Thereafter, the first data from the internal cache of the additional computing unit is loaded into the first register via the external cache and the internal cache.

[0131] In some embodiments, the controller is further configured to: obtain a first target execution result when the second operation and the first operation are executed in sequence. When the first target execution result is consistent with the second target execution result, determine that the verification result of the computing unit is that the operation of the computing unit complies with the weak memory consistency rule, wherein the second target execution result is obtained when the first operation and the second operation are executed in sequence. When the first target execution result is inconsistent with the second target execution result, determine that the verification result of the computing unit is that the operation of the computing unit does not comply with the weak memory consistency rule.

[0132] In some embodiments, the controller is further configured to: when the first operation and the second operation are performed sequentially, determine that the verification result of the computing unit is a verification failure.

[0133] According to an embodiment of the present disclosure, the present disclosure further provides a processor, which may include multiple computing units provided by the present disclosure; a cache unit. For example, the processor may include a cache unit and multiple computing units 800 described above. The cache unit may include the external cache 302 described above.

[0134] According to an embodiment of the present disclosure, the present disclosure further provides an electronic device, which may include: a plurality of computing units provided by the present disclosure; a cache unit; and a main storage unit. For example, the computing unit may be the computing unit 800 described above. The cache unit may include the external cache 302 described above. The main storage unit may be the main storage unit 31 described above.

[0135] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0136] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0137] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure 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, 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 disclosure described and / or required herein.

[0138] like Fig. 9As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0139] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0140] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as the verification method of the target computing unit. For example, in some embodiments, the verification method of the target computing unit may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the verification method of the target computing unit described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the verification method of the target computing unit by any other appropriate means (e.g., by means of firmware).

[0141] 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), complex 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.

[0142] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code 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.

[0143] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. 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.

[0144] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) display or an LCD (liquid crystal display)) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0145] The systems and techniques described herein may be implemented in a computing system that includes back-end 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 front-end 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 back-end components, middleware components, or front-end 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), and the Internet.

[0146] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0147] 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 recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0148] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. 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 disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for verifying a target computing unit, comprising: In response to receiving a target computing unit verification request, executing a first load task, wherein the target computing unit includes a first register, a second register, a third register, and a fourth register, and the first load task includes loading first data at a first address of an external storage unit into the first register; Executing a second load task, wherein the second load task includes loading a second address into the second register; In response to determining that the first load task is completed, performing a first operation based on the third register and the first data; In response to determining that the second load task is completed, performing a second operation based on the fourth register and the second address; and A verification result of the target computing unit is determined according to an execution result of the first operation and an execution result of the second operation.

2. The method according to claim 1, wherein: The first operation includes storing the target data in the third register to a target address indicated by the first data.

3. The method according to claim 1, wherein: The second operation includes loading second data stored at the second address into the fourth register.

4. The method according to claim 1, wherein: The executing the first loading task comprises: In the case where it is determined that the first data does not exist in the internal cache of the target computing unit, determining whether the first data exists in the external cache of the target computing unit; If it is determined that the first data does not exist in the external cache, requesting the first data at the first address from the external storage unit; and The first data at the first address is loaded into the first register via the external cache and the internal cache of the target computing unit.

5. The method according to claim 1, wherein: The executing the first loading task also includes: loading the first address into a fifth register; and The first address is obtained from the fifth register.

6. The method according to claim 5, wherein: The executing the first loading task also includes: Controlling the additional computing unit to write the first data to the first address; In the case where it is determined that the first data does not exist in the internal cache of the target computing unit, determining whether the first data exists in the external cache of the target computing unit; If it is determined that the first data does not exist in the external cache, controlling the external cache to send a detection request for the first data to the internal cache of the additional computing unit; and The first data from the internal cache of the additional computing unit is loaded into the first register via the external cache and the internal cache of the target computing unit.

7. The method according to claim 1, wherein: Determining the verification result of the target computing unit according to the execution result of the first operation and the execution result of the second operation includes: When the second operation and the first operation are performed in sequence, a first target execution result is obtained; When the first target execution result is consistent with the second target execution result, determining that the verification result of the target computing unit is that the operation of the target computing unit complies with a weak memory consistency rule, wherein the second target execution result is obtained when the first operation and the second operation are executed in sequence; and When the first target execution result is inconsistent with the second target execution result, it is determined that the verification result of the target computing unit is that the operation of the target computing unit does not comply with the weak memory consistency rule.

8. The method according to claim 1, wherein: Determining the verification result of the target computing unit according to the execution result of the first operation and the execution result of the second operation includes: When the first operation and the second operation are performed sequentially, it is determined that the verification result of the target computing unit is a verification failure.

9. A computing unit, comprising: First register; Second register; The third register; Fourth register; as well as A controller, wherein the controller is configured as: In response to receiving the computing unit verification request, executing a first load task, wherein the first load task includes loading first data at a first address of an external storage unit into the first register; Executing a second load task, wherein the second load task includes loading a second address into the second register; In response to determining that the first load task is completed, performing a first operation based on the third register and the first data; In response to determining that the second load task is completed, performing a second operation based on the fourth register and the second address; and A verification result of the calculation unit is determined according to an execution result of the first operation and an execution result of the second operation.

10. The method according to claim 9, wherein: The first operation includes storing the target data in the third register to a target address indicated by the first data.

11. The method according to claim 9, wherein: The second operation includes loading second data stored at the second address into the fourth register.

12. The computing unit according to claim 9, further comprising an internal cache; in, The controller is also configured to: In a case where it is determined that the internal cache does not contain the first data, determining whether the external cache of the computing unit contains the first data; In a case where it is determined that the first data does not exist in the external cache, requesting the first data at the first address from the external storage unit; as well as The first data at the first address is loaded into the first register via the external cache and the internal cache.

13. The computing unit according to claim 9 further comprises a fifth register; wherein, The controller is also configured to: loading the first address into a fifth register; and The first address is obtained from the fifth register.

14. The computing unit according to claim 13, wherein: The controller is also configured to: Controlling the additional computing unit to write the first data to the first address; If it is determined that the first data does not exist in the internal cache, determining whether the first data exists in the external cache; When it is determined that the first data does not exist in the external cache, controlling the external cache to send a detection request for the first data to the internal cache of the additional computing unit; as well as First data from an internal cache of the additional computing unit is loaded into the first register via the external cache and the internal cache.

15. The computing unit according to claim 9, wherein: The controller is also configured to: When the second operation and the first operation are performed in sequence, a first target execution result is obtained; When the first target execution result is consistent with the second target execution result, determining that the verification result of the computing unit is that the operation of the computing unit complies with the weak memory consistency rule, wherein the second target execution result is obtained when the first operation and the second operation are executed in sequence; as well as When the first target execution result is inconsistent with the second target execution result, it is determined that the verification result of the computing unit is that the operation of the computing unit does not comply with the weak memory consistency rule.

16. The computing unit according to claim 9, wherein: The controller is also configured to: When the first operation and the second operation are performed sequentially, it is determined that the verification result of the computing unit is a verification failure.

17. An electronic device comprising: A plurality of computing units according to any one of claims 9 to 16; Cache unit; as well as Primary storage unit.

18. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

19. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 8.

20. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 8.

21. A processor, comprising: A plurality of computing units according to any one of claims 9 to 16; Cache unit.