Chip verification method and device, equipment and medium
By determining the dependencies between multi-core chip processing cores and generating constraints, the problem of random instruction flow generation in the prior art is solved, which can easily lead to dependency deadlocks, improving the efficiency and comprehensiveness of chip verification.
Patent Information
- Application Number
- CN202410998995.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-11-12
AI Technical Summary
Existing chip verification technologies are difficult to achieve comprehensive verification of multi-core chips, and the generation of random instruction streams can easily lead to dependence deadlocks, reducing verification efficiency and randomness.
By determining the dependencies between multiple processing cores, constraints are generated to avoid dependency deadlocks, and a random instruction generator is used to generate new instructions that do not depend on the dependency core, improving the generation efficiency of verification incentives.
Without affecting the randomness of verification incentives, the efficiency and comprehensiveness of chip verification are improved, relying on deadlocks is avoided, and more comprehensive chip verification is achieved.
Smart Images

Figure CN118940686A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of chip verification technology, and specifically to a chip verification method, device, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0003] In order to adapt to the development of artificial intelligence technology, the chip scale and process used to execute artificial intelligence-based algorithms need to be further improved, and more accurate and efficient chip verification technology needs to be applied.
[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention
[0005] The present disclosure provides a chip verification method, device, electronic device, computer-readable storage medium and computer program product.
[0006] According to one aspect of the present disclosure, a chip verification method is provided, wherein the chip includes multiple processing cores, and the method includes: determining a first dependency relationship between the multiple processing cores, wherein the first dependency relationship is determined based on a second dependency relationship between multiple initial instructions and a correspondence relationship between the multiple initial instructions and the multiple processing cores; in response to determining that a random instruction is to be added for a first processing core among the multiple processing cores, generating a first newly added instruction using a random instruction generator, wherein the generation process of the first newly added instruction includes: in response to determining that the first dependency relationship indicates that there is at least one first dependent core among the multiple processing cores that depends on the first processing core, determining a constraint condition for the random instruction generator, wherein, according to the constraint condition, a random instruction generation result of the random instruction generator does not depend on the instruction corresponding to the at least one first dependent core; and generating a first newly added instruction by running the random instruction generator based on the constraint condition; and determining a verification result for the chip by executing the multiple initial instructions and the first newly added instruction using the chip.
[0007] According to another aspect of the present disclosure, a chip verification device is provided, wherein the chip includes multiple processing cores, and the device includes: a first determination unit, configured to determine a first dependency relationship between the multiple processing cores, wherein the first dependency relationship is determined based on a second dependency relationship between multiple initial instructions and a correspondence relationship between the multiple initial instructions and the multiple processing cores; a generation unit, configured to generate a first newly added instruction using a random instruction generator in response to determining that a random instruction is to be added for a first processing core among the multiple processing cores, wherein the generation unit includes: a determination subunit, configured to determine a constraint condition for the random instruction generator in response to determining that the first dependency relationship indicates that there is at least one first dependent core among the multiple processing cores that depends on the first processing core, wherein according to the constraint condition, a random instruction generation result of the random instruction generator does not depend on an instruction corresponding to the at least one first dependent core; and a generation subunit, configured to generate a first newly added instruction by running the random instruction generator based on the constraint condition; and a verification unit, configured to determine a verification result for the chip by executing the multiple initial instructions and the first newly added instruction using the chip.
[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 above-mentioned chip verification method.
[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the above chip verification method.
[0010] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program can implement the above chip verification method when executed by a processor.
[0011] According to one or more embodiments of the present disclosure, chip verification efficiency can be improved and more comprehensive chip verification can be achieved.
[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 exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0014] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an exemplary embodiment of the present disclosure;
[0015] Figure 2 A flow chart of a chip verification method according to an exemplary embodiment of the present disclosure is shown;
[0016] Figure 3 A schematic diagram showing an instruction generation process according to an exemplary embodiment of the present disclosure is shown;
[0017] Figure 4 A schematic diagram showing a process of solving a first dependency relationship according to an exemplary embodiment of the present disclosure is shown;
[0018] Figure 5 A structural block diagram of a chip verification device according to an exemplary embodiment of the present disclosure is shown;
[0019] Figure 6 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0020] 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 of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0021] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.
[0022] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.
[0023] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0024] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
[0025] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the chip authentication method to be performed.
[0026] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0027] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
[0028] The user may use client devices 101, 102, 103, 104, 105 and / or 106 to send a verification request. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.
[0029] Client devices 101, 102, 103, 104, 105 and / or 106 may include various categories of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various categories and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (eg, email applications), short message service (SMS) applications, and may use various communication protocols.
[0030] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0031] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0032] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0033] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
[0034] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.
[0035] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different categories. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.
[0036] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different categories of databases, such as a key-value store, an object store, or a conventional store backed by a file system.
[0037] Figure 1 The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.
[0038] Deep learning algorithms have been increasingly widely used in recent years. Based on the demand for larger-scale computing power of deep learning algorithms, DSA (Domain-Specific Architecture) processors for specific fields have been developed to accelerate the hardware implementation of deep learning algorithms. For example, various processing cores with corresponding functions can be implemented according to various types of operators in deep learning algorithms (such as activation operators, convolution operators, pooling operators, data handling operators, etc.). In this case, each processing core maps a different instruction execution stream. Since different instructions may have data dependencies, there may be complex synchronization relationships between instruction execution streams.
[0039] In actual application scenarios, the chip's instruction set to be verified usually contains a large number of instructions, that is, corresponding to a variety of different chip functions, or corresponding to different parameters under the same functional mode, such as data processing of different data sizes. Understandably, the cost of traversing the chip's instruction set to be verified is high, and it is difficult to achieve complete verification. Therefore, it is usually through the execution of specific random configuration instructions to continuously randomly select target instructions from the instruction set to be verified to form multiple random instruction streams corresponding to multiple processing cores, so that multiple processing cores in the chip to be verified can be used to execute multiple random instruction streams respectively, and the verification result of the chip is determined based on the execution result of the random instruction stream. It should be understood that when verifying a chip, the more chip functions are verified, that is, the higher the randomness of the random instruction stream, the more comprehensive and reliable the verification result obtained.
[0040] In the related art, in order to improve the verification effect, a random instruction generator can be used to randomly generate verification stimuli for multiple instruction streams. However, generating multiple instruction streams based on a completely random method can easily lead to a deadlock loop between the instruction streams. For example, when instruction a in instruction stream A depends on instruction b in instruction stream B, and instruction c in instruction stream B depends on instruction d in instruction stream A, the dependency deadlock between the two will cause both instruction stream A and instruction stream B to be unable to continue to execute. In order to avoid dependency deadlock, one way is to generate verification stimuli for multiple instruction streams based on relatively simple dependencies. However, this method greatly reduces the randomness of the verification stimulus and cannot generate verification stimuli with complex dependencies, that is, it cannot achieve comprehensive verification, which reduces the verification efficiency.
[0041] Based on this, the present disclosure provides a verification method for multi-core chips, which first determines the first dependency relationship between multiple processing cores. When it is necessary to add random instructions for the first processing core, constraints are generated for the random instruction generator based on the first dependency relationship to constrain the random generation results and avoid the formation of dependency deadlocks between the processing cores, thereby improving the generation efficiency of verification incentives without affecting the randomness of the verification incentives, thereby improving the verification efficiency.
[0042] Figure 2 FIG. 2 shows a flow chart of a chip verification method 200 according to an exemplary embodiment of the present disclosure, wherein the chip includes multiple processing cores. Figure 2 As shown, the method 200 includes:
[0043] Step S210: determining a first dependency relationship between the plurality of processing cores, wherein the first dependency relationship is determined based on a second dependency relationship between the plurality of initial instructions and a correspondence relationship between the plurality of initial instructions and the plurality of processing cores;
[0044] Step S220: In response to determining that a random instruction is to be added to a first processing core among the plurality of processing cores, a first newly added instruction is generated by using a random instruction generator, wherein the process of generating the first newly added instruction includes:
[0045] Step S221, in response to determining that the first dependency relationship indicates that there is at least one first dependent core among the plurality of processing cores that is dependent on the first processing core, determining a constraint condition for the random instruction generator, wherein, according to the constraint condition, a random instruction generation result of the random instruction generator does not depend on an instruction corresponding to the at least one first dependent core; and
[0046] Step S222, generating a first newly added instruction by running the random instruction generator based on the constraint condition; and
[0047] Step S230: Determine a verification result for the chip by using the chip to execute the multiple initial instructions and the first newly added instruction.
[0048] When verification is required for a chip including multiple processing cores, by applying the above method 200, the first dependency relationship between the multiple processing cores can be determined first. When a random instruction needs to be added to the first processing core, constraints are generated for the random instruction generator based on the dependent core information that depends on the first processing core, so as to constrain the random generation result and avoid the new instructions being dependent on the dependent core, thereby preventing a mutual dependence deadlock between the first processing core and the dependent core, thereby improving the generation efficiency of the verification incentive without affecting the randomness of the verification incentive, thereby improving the verification efficiency.
[0049] It can be understood that the correspondence between the multiple initial instructions and the multiple processing cores is the correspondence between each processing core and the initial instruction stream of the processing core. For example, when the initial instruction stream of processing core A includes initial instruction a, and the initial instruction stream of processing core B includes initial instruction b, and initial instruction b is dependent on initial instruction a, it can be determined that processing core B is dependent on processing core A.
[0050] In some examples, the chip to be verified can be various types of chips, especially data processing chips, such as chips for executing deep learning algorithms, voice processing chips, image processing chips, etc.
[0051] In some examples, the initial instruction and the first newly added instruction can be randomly selected from a pre-configured instruction set to be verified. The instruction set to be verified can include various types such as data processing instructions, data transmission instructions, data reading and writing instructions, etc., to ensure that the chip to be verified can normally perform data processing, data transmission, data reading and writing and other functions.
[0052] In some examples, the first processing core may be any one of a plurality of processing cores. After determining the first newly added instruction for the first processing core, corresponding steps may be repeatedly performed for other processing cores to achieve comprehensive verification of the multi-core chip.
[0053] In some examples, in step S230, by using the chip to execute the multiple initial instructions and the first newly added instructions, determining the verification result for the chip can be implemented based on software or hardware. For example, hardware description languages such as Verilog, VHDL (Veri-High-Speed Integrate Circuit Hardware Description Language, ultra-high-speed integrated circuit hardware description language) can be used in a software environment to design and configure the chip circuit, and after compiling and generating chip circuit netlist information that can be used for simulation, the simulation verification of the chip circuit is performed based on this. In some examples, the RTL (Register Transfer Level) code of the chip circuit to be verified can be obtained in the software environment to describe the data flow of the chip circuit, thereby realizing the RTL simulation for the chip. In some examples, other languages (such as C language) can also be used to write and generate the corresponding code of the hardware description language, thereby obtaining the chip circuit netlist information that can be used for simulation. For another example, the corresponding hardware circuit can be implemented according to the hardware description language or circuit netlist information, and the hardware circuit can be verified.
[0054] According to some embodiments, the at least one dependent core is determined in the following manner: based on the first dependency relationship, determining the processing core that each of the multiple processing cores depends on; and recursively traversing the processing cores that each processing core depends on to determine at least one first dependent core that depends on the first processing core. Thus, the dependent core corresponding to each processing core can be maintained respectively for the processing core, and the dependent relationship can be checked by recursive traversal, so that the dependent core can be determined more conveniently.
[0055] In some examples, a map structure may be used to store the corresponding dependent cores of each processing core. For example, when the processor includes processing core A, processing core B, processing core C, and processing core D, it may be recorded that processing core A depends on B and C, and processing core B depends on D. In this case, recursion may be performed based on the corresponding dependency relationship of each processing core. For example, when it is determined that A depends on B and C, the dependency information of B and C may be further traversed to determine that A also indirectly depends on D. Based on this, it may be determined that the processing cores that depend on D include processing core A and processing core B, and then the constraint conditions may be determined so that the random instruction generation result for D does not include instructions that depend on A and B.
[0056] According to some embodiments, the processing cores that each processing core depends on are stored in a dependent core queue corresponding to the processing core. By using a queue to manage dependent core information, the data structure can be simplified, and a simpler and more efficient chip verification can be achieved.
[0057] In some examples, the dependency core information may be managed based on other forms. For example, other data structures may be used to store the dependency core, which is not limited in the present disclosure.
[0058] In some examples, when a queue is used to manage dependent core information, it is also possible to easily and quickly check whether the dependent core queue corresponding to each processing core is an empty queue, thereby determining whether the instruction stream corresponding to the processing core can continue to execute. When the dependent core queue is not empty, it means that the instruction stream corresponding to the processing core needs to wait for the triggering of other processing cores. In this way, the execution of the instruction stream can be managed more easily and efficiently to ensure that the instruction execution of the multi-core chip satisfies a specific synchronization relationship and ensures the correctness of the instruction execution order.
[0059] In actual application scenarios, when generating random instruction streams for multi-core chips, the instruction generation order of multiple processing cores is usually fixed. For example, the Dangdang processor includes processing core A, processing core B, processing core C, and processing core D. The conventional random stimulus generation order may be to generate new instructions for each processing core in the order of ABCD. It can be seen that in this case, the initial generation process of processing core A does not need to consider the dependencies between processing cores, which limits the randomness of the verification stimulus to a certain extent.
[0060] Based on this, according to some embodiments, in response to determining that a random instruction is to be added to a first processing core among the multiple processing cores, generating a first newly added instruction using a random instruction generator in step S220 includes: in response to determining that a random instruction is to be added to the first processing core, and in response to determining that a first time interval has passed, generating the first newly added instruction using the random instruction generator, wherein the first time interval is randomly determined. By randomly adding a delay during the instruction generation process, the randomness of multiple instruction streams can be improved to achieve more comprehensive verification and improve verification efficiency.
[0061] According to some embodiments, the method 200 further includes: in response to determining that the first processing core will be executed by at least one dependent instruction on which the at least one first dependent core depends, updating the first dependency relationship, wherein, according to the updated first dependency relationship, the at least one first dependent core no longer depends on the first processing core. Thus, the dependency relationship can be updated in real time during the execution of the instruction, and the first dependency relationship between the processing cores can be recursively updated after the dependent instruction (trigger instruction) is launched, so as to achieve more accurate and comprehensive multi-core chip verification based on a more accurate first dependency relationship. .
[0062] According to some embodiments, method 200 further includes: in response to determining that a preset trigger condition is met, causing the first processing core to execute at least one target instruction of the at least one dependent instruction; and updating the first dependency relationship based on the at least one target instruction. Thus, the dependency relationship between the processing cores can be released by actively executing the dependent instructions, avoiding the overly complex mutual dependency between multiple processing cores, thereby reducing the complexity of the constraint conditions, simplifying the calculation amount of the random instruction generator, and facilitating the solution of the verification result.
[0063] According to some embodiments, in response to determining that a preset trigger condition is met, causing the first processing core to execute at least one target instruction in the at least one dependent instruction includes: in response to determining that the randomly generated trigger information satisfies a preset condition, causing the first processing core to execute at least one target instruction in the at least one dependent instruction. Thus, the generation of actively generated dependent instructions can be controlled by random triggering, and the verification efficiency can be improved by improving the randomness.
[0064] In some examples, the trigger conditions for actively generating dependent instructions and releasing the dependency relationship may be set in other ways, for example, a fixed threshold may be set to control the generation interval of adjacent dependent instructions, or the complexity of the first dependency relationship between multiple processing cores may be checked and compared with a preset threshold to determine whether it is necessary to actively generate the dependent instruction. The present disclosure does not limit the specific setting method of the trigger condition.
[0065] Figure 3 FIG. 1 is a schematic diagram showing a process of generating instructions according to an exemplary embodiment of the present disclosure. Figure 3 As shown, the operation of adding random instructions corresponding to each processing core may include the following steps:
[0066] Step S31, recursively query the current first dependency.
[0067] Step S32: Determine whether to continue executing step S33 or step S34 to step S36 based on the randomly generated trigger information.
[0068] Step S33: Based on the dependency relationship, the processing core is instructed to execute the target instruction that is depended on by any other processing core.
[0069] Step S34: determine the constraint conditions based on the recursive query result.
[0070] Step S35: Generate new instructions by executing a random instruction generator based on the constraint conditions.
[0071] Step S36: Update the first dependency relationship based on the newly added instruction.
[0072] Figure 4 FIG. 1 is a schematic diagram showing a process of solving a first dependency relationship according to an exemplary embodiment of the present disclosure. In this example, each processing core may have a corresponding core ID. Figure 4 As shown, the process of solving the first dependency may include the following steps:
[0073] Step S41: Determine the source core ID and target core ID currently being checked.
[0074] Step S42: Check whether the source core ID exists in the dependent core queue corresponding to the target core ID. If the detection result is yes, execute step S43; if the detection result is no, execute step S44.
[0075] Step S43: Determine whether a dependency deadlock will be formed between the source core ID and the target core ID.
[0076] Step S44: Update the source core id and the target core id, and use the core id in the dependent core queue corresponding to the target core id as the new target core id.
[0077] On the basis of step S44, step S42 may be continued to be executed to implement traversal of the first dependency relationships among all the multiple processing cores.
[0078] By executing the above recursive solution process, the core ID information that can form a dependency deadlock with the source core ID can be determined conveniently and efficiently, and then the constraints of the random instruction generator can be determined based on this. By running the random instruction generator based on the constraints, it is possible to avoid the random instruction generation results containing instructions that can cause dependency deadlocks, and to improve the randomness of the verification incentives while ensuring the smooth execution of the instruction flow, thereby improving the verification effect.
[0079] According to one aspect of the present disclosure, a chip verification device is also provided. Figure 5 FIG. 5 shows a block diagram of a chip verification device 500 according to an exemplary embodiment of the present disclosure, wherein the chip includes multiple processing cores. Figure 5 As shown, the device 500 includes:
[0080] A first determining unit 510 is configured to determine a first dependency relationship between the plurality of processing cores, wherein the first dependency relationship is determined based on a second dependency relationship between the plurality of initial instructions and a correspondence relationship between the plurality of initial instructions and the plurality of processing cores;
[0081] The generating unit 520 is configured to generate a first newly added instruction using a random instruction generator in response to determining that a random instruction is to be added for a first processing core among the plurality of processing cores, wherein the generating unit comprises:
[0082] a determining subunit 521 configured to, in response to determining that the first dependency relationship indicates that there is at least one first dependent core among the plurality of processing cores that is dependent on the first processing core, determine a constraint condition for the random instruction generator, wherein, according to the constraint condition, a random instruction generation result of the random instruction generator does not depend on an instruction corresponding to the at least one first dependent core; and
[0083] A generating subunit 522, configured to generate a first newly added instruction by running the random instruction generator based on the constraint condition; and
[0084] The verification unit 530 is configured to determine a verification result for the chip by executing the multiple initial instructions and the first newly added instruction using the chip.
[0085] According to some embodiments, the at least one dependent core is determined in the following manner: based on the first dependency relationship, determining the processing core on which each of the multiple processing cores depends; and determining at least one first dependent core that depends on the first processing core by recursively traversing the processing cores on which each processing core depends.
[0086] According to some embodiments, the processing cores that each processing core depends on are stored in a dependent core queue corresponding to the processing core.
[0087] According to some embodiments, the generation unit 520 is configured to: in response to determining that a random instruction is to be added for the first processing core, and in response to determining that a first time interval has passed, generate the first newly added instruction using the random instruction generator, wherein the first time interval is randomly determined.
[0088] According to some embodiments, the device 500 also includes: an updating unit, configured to update the first dependency relationship in response to determining that the first processing core will complete execution of at least one dependent instruction on which the at least one first dependent core depends, wherein, according to the updated first dependency relationship, the at least one first dependent core no longer depends on the first processing core.
[0089] According to some embodiments, the device 500 also includes: an execution unit, configured to cause the first processing core to execute at least one target instruction among the at least one dependent instruction in response to determining that a preset trigger condition has been met, and the update unit is also configured to update the first dependency relationship based on the at least one target instruction.
[0090] According to some embodiments, the execution unit is configured to: in response to determining that the randomly generated trigger information satisfies a preset condition, cause the first processing core to execute at least one target instruction among the at least one dependent instruction.
[0091] It should be understood that Figure 5 The operations of the various units of the chip verification apparatus 500 shown in FIG. 5 can be similar to those of FIG. Figure 2 The steps in the chip verification method 200 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 200 are also applicable to the device 500 and the various units included therein. For the sake of brevity, some operations, features and advantages are not repeated here.
[0092] According to another aspect of the present disclosure, an electronic device is also 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 above-mentioned chip verification method.
[0093] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is further provided, wherein the computer instructions are used to enable the computer to execute the above-mentioned chip verification method.
[0094] According to another aspect of the present disclosure, a computer program product is also provided, including a computer program, wherein the computer program implements the above chip verification method when executed by a processor.
[0095] refer to Figure 6 , a block diagram of an electronic device 600 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, 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.
[0096] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0097] Multiple components in the device 600 are connected to the I / O interface 605, including: an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. The input unit 606 can be any type of device that can input information to the device 600. The input unit 606 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 607 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 608 can include but is not limited to a disk, an optical disk. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0098] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 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 601 performs the various methods and processes described above, such as a chip verification method. For example, in some embodiments, the chip verification method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the chip verification method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the chip verification method in any other appropriate manner (e.g., by means of firmware).
[0099] 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.
[0100] 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.
[0101] 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.
[0102] 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) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or 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).
[0103] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can 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), the Internet, and a blockchain network.
[0104] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0105] 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 this disclosure can be performed 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.
[0106] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples. Various elements in the embodiments or examples may be omitted or may be replaced by their equivalent elements. In addition, each step may be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples may be combined in various ways. It is important that with the evolution of technology, many elements described herein may be replaced by equivalent elements that appear after the present disclosure.
Claims
1. A chip verification method, wherein: The chip includes multiple processing cores, and the method includes: Determining a first dependency relationship between the plurality of processing cores, wherein the first dependency relationship is determined based on a second dependency relationship between a plurality of initial instructions and a correspondence relationship between the plurality of initial instructions and the plurality of processing cores; In response to determining that a random instruction is to be added for a first processing core among the plurality of processing cores, a first newly added instruction is generated by using a random instruction generator, wherein the generation process of the first newly added instruction includes: In response to determining that the first dependency relationship indicates that there is at least one first dependent core among the plurality of processing cores that is dependent on the first processing core, determining a constraint condition for the random instruction generator, wherein, according to the constraint condition, a random instruction generation result of the random instruction generator does not depend on an instruction corresponding to the at least one first dependent core; and Generate a first newly added instruction by running the random instruction generator based on the constraint condition; and A verification result for the chip is determined by executing the plurality of initial instructions and the first newly added instruction using the chip.
2. The method of claim 1, wherein: The at least one dependent core is determined by: Based on the first dependency, determining a processing core on which each of the plurality of processing cores depends; At least one first dependent core that depends on the first processing core is determined by recursively traversing the processing cores that each processing core depends on.
3. The method of claim 2, wherein: The processing cores that each processing core depends on are stored in a dependent core queue corresponding to the processing core.
4. The method according to any one of claims 1 to 3, wherein: In response to determining that a random instruction is to be added to a first processing core among the plurality of processing cores, generating a first newly added instruction by using a random instruction generator comprises: In response to determining that a random instruction is to be added for the first processing core and in response to determining that a first time interval has passed, the first newly added instruction is generated using the random instruction generator, wherein the first time interval is randomly determined.
5. The method according to any one of claims 1 to 4, further comprising: In response to determining that the first processing core will complete execution of at least one dependent instruction on which the at least one first dependent core depends, the first dependency relationship is updated, wherein according to the updated first dependency relationship, the at least one first dependent core is no longer dependent on the first processing core.
6. The method of claim 5, further comprising: In response to determining that a preset trigger condition is met, causing the first processing core to execute at least one target instruction among the at least one dependent instruction; as well as Based on the at least one target instruction, the first dependency is updated.
7. The method of claim 6, wherein: In response to determining that a preset trigger condition is met, causing the first processing core to execute at least one target instruction in the at least one dependent instruction includes: In response to determining that the randomly generated trigger information satisfies a preset condition, the first processing core is caused to execute at least one target instruction among the at least one dependent instruction.
8. A chip verification device, wherein: The chip includes multiple processing cores, and the device includes: A first determining unit is configured to determine a first dependency relationship between the plurality of processing cores, wherein the first dependency relationship is determined based on a second dependency relationship between a plurality of initial instructions and a correspondence relationship between the plurality of initial instructions and the plurality of processing cores; A generating unit is configured to generate a first newly added instruction using a random instruction generator in response to determining that a random instruction is to be added for a first processing core among the plurality of processing cores, wherein the generating unit comprises: a determining subunit configured to determine a constraint condition for the random instruction generator in response to determining that the first dependency relationship indicates that there is at least one first dependent core among the plurality of processing cores that is dependent on the first processing core, wherein, according to the constraint condition, a random instruction generation result of the random instruction generator does not depend on an instruction corresponding to the at least one first dependent core; and a generating subunit configured to generate a first newly added instruction by running the random instruction generator based on the constraint condition; and The verification unit is configured to determine a verification result for the chip by executing the multiple initial instructions and the first newly added instruction using the chip.
9. The device of claim 8, wherein: The at least one dependent core is determined by: Based on the first dependency, determining a processing core on which each of the plurality of processing cores depends; At least one first dependent core that depends on the first processing core is determined by recursively traversing the processing cores that each processing core depends on.
10. The device of claim 9, wherein: The processing cores that each processing core depends on are stored in a dependent core queue corresponding to the processing core.
11. The device according to any one of claims 8 to 10, wherein: The generating unit is configured to: In response to determining that a random instruction is to be added for the first processing core and in response to determining that a first time interval has passed, the first newly added instruction is generated using the random instruction generator, wherein the first time interval is randomly determined.
12. The apparatus according to any one of claims 8 to 11, further comprising: An updating unit is configured to update the first dependency relationship in response to determining that the first processing core will complete execution of at least one dependent instruction on which the at least one first dependent core depends, wherein according to the updated first dependency relationship, the at least one first dependent core is no longer dependent on the first processing core.
13. The apparatus of claim 12, further comprising: an execution unit, configured to, in response to determining that a preset trigger condition is met, cause the first processing core to execute at least one target instruction among the at least one dependent instruction, The updating unit is further configured to update the first dependency relationship based on the at least one target instruction.
14. The device of claim 13, wherein: The execution unit is configured to: In response to determining that the randomly generated trigger information satisfies a preset condition, the first processing core is caused to execute at least one target instruction among the at least one dependent instruction.
15. An electronic device, comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in 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 7.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-7.
17. A computer program product comprising a computer program, wherein: The computer program implements the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Cited By
Instruction stream generation method and device, electronic equipment and storage medium
CN119806652A
Chip random test method and device, equipment and storage medium
CN120044379A
Chip verification method based on multi-core constraint solution, electronic equipment and medium
CN120068795A
Chip verification method and apparatus, device and medium
WO2026021002A1
