Device, method and equipment based on software and hardware joint verification and storage medium

Through the joint verification method of software and hardware, NPU is configured and verified by software language, the problems of late start time and high communication cost in the existing technology of NPU operator verification are solved, and a more efficient operator verification process is realized.

CN119003260AActive Publication Date: 2024-11-22AXERA SEMICON (SHANGHAI) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410989522.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-22
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

The existing NPU operator verification method has a late start time since hardware personnel need to be responsible for module verification, and increases the communication cost between software personnel and hardware personnel, reducing verification efficiency.

Method used

Using a joint software and hardware verification method, obtain and transmit configuration information through software language, directly configure and verify NPUs, reduce the participation of hardware personnel, improve the flexibility and independence of software personnel, and thus start operator verification in advance and reduce communication costs. .

Benefits of technology

The operator verification is started in advance, which reduces the communication cost between software and hardware personnel, improves the efficiency and rate of NPU operator verification, and makes it easier to modify modules when problems are discovered, further improving the verification rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003260A_ABST
    Figure CN119003260A_ABST
Patent Text Reader

Abstract

The invention provides a device, method and equipment based on software and hardware joint verification and a storage medium, and the device comprises a verification platform which is provided with an interface and is electrically connected with a to-be-verified NPU based on the interface; the verification platform is used for acquiring configuration information; transmitting the configuration information to the NPU through the interface; the configuration information is obtained based on a software language; the configuration information comprises a clock parameter, an interrupt parameter, a mode parameter and a processing parameter; the verification platform is also used for obtaining a verification result based on the interface; the verification result indicates whether the NPU is normal or not, the verification result is obtained by analyzing a running result by the software language, the running result is obtained by the NPU based on the interrupt source and a processing result, and the processing result is obtained by processing verification data by the NPU based on the clock, the working mode and the data processing mode. According to the technical scheme, the operator verification efficiency of the NPU can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chip verification technology, and in particular to an apparatus, method, device and storage medium based on software and hardware joint verification. Background Art

[0002] NPU (Natural Processing Unit) verification usually includes two parts: module verification and operator verification. These two parts of verification are of great significance to ensure the accuracy of NPU code. Among them, operator verification refers to verifying whether the algorithm of actual application runs correctly on NPU. Therefore, the configuration information required for NPU operation in operator verification needs to be provided by software personnel. Module verification is used to ensure the accuracy of each single module, but the operation of NPU requires the synergy of multiple modules, and the synergy of multiple modules requires operator verification to ensure its correctness.

[0003] In related technologies, most operator verification environments are pure hardware environments. Hardware personnel are responsible for building the operator verification environment, while software personnel provide the configuration information files required for operator operation.

[0004] However, in the above verification method, since hardware personnel are also responsible for module verification, the operator verification starts at a later time. At the same time, the increase in communication costs between software personnel and hardware personnel will also slow down the speed of operator verification. Summary of the invention

[0005] The embodiment of the present application provides a device, method, equipment and storage medium based on software and hardware joint verification, which can start operator verification in advance and reduce the communication cost between software personnel and hardware personnel, thereby improving the efficiency of operator verification. The technical solution is as follows:

[0006] According to a first aspect of an embodiment of the present application, a device based on software and hardware joint verification is provided, the device comprising:

[0007] A verification platform, the verification platform having an interface, the verification platform being electrically connected to the NPU to be verified based on the interface; the interface being obtained based on a hardware language;

[0008] The verification platform is used to obtain configuration information; transmit the configuration information to the NPU through the interface; the configuration information is obtained based on the software language; the configuration information includes clock parameters, interrupt parameters, mode parameters and processing parameters; the clock parameters are used to configure the clock of the NPU, the interrupt parameters are used to configure the interrupt source of the NPU, the mode parameters are used to configure the working mode of the NPU, and the processing parameters are used to configure the data processing method of the NPU;

[0009] The verification platform is also used to obtain a verification result based on the interface; the verification result indicates whether the NPU is normal, the verification result is obtained by parsing and running the software language, the running result is obtained by the NPU based on the interrupt source and the processing result, and the processing result is obtained by the NPU processing the verification data based on the clock, the working mode and the data processing method.

[0010] In a possible implementation, the interface is a basic interface function, and the basic interface function is obtained based on the hardware language.

[0011] In a possible implementation, the verification platform is also used to obtain the write address and write information of the register based on the software language, obtain the configuration information, and call the write function to process the write address and write information; the register is set in the NPU.

[0012] In a possible implementation, the verification platform is further used to obtain a preset configuration file, parse the preset configuration file based on the software language, and obtain the processing parameter.

[0013] In a possible implementation, the NPU includes a clock module, a synchronization management module, and an execution module;

[0014] The clock module is electrically connected to the synchronization management module and the execution module respectively, and the synchronization management module is electrically connected to the execution module;

[0015] The clock module is used to provide a clock signal to the synchronization management module and the execution module based on the clock parameter;

[0016] The execution module is used to process the verification data based on the processing parameter to obtain the processing result;

[0017] The synchronization management module is used to obtain the processing result and coordinate the work of each execution module; generate an interrupt enable signal based on the interrupt source, and generate the operation result based on the processing result and the interrupt enable signal.

[0018] In a possible implementation, the NPU is electrically connected to the CPU; the NPU further includes a control module;

[0019] The mode parameters include the first mode and the second mode;

[0020] The first mode is that the CPU, the control module and the execution module are electrically connected in sequence; the CPU is used to control the control module, and the control module is used to control the execution module;

[0021] The second mode is that the CPU is electrically connected to the execution module; the CPU is used to control the execution module.

[0022] In a possible implementation, the execution module includes a plurality of execution units;

[0023] The processing result of the execution module includes the calculation result of each execution unit and the execution interruption.

[0024] In a possible implementation, the operation result is obtained based on the execution interrupt of each execution unit and the corresponding interrupt enable signal.

[0025] In a possible implementation, the configuration information also includes reset parameters and startup parameters;

[0026] The reset parameter is used to reset the NPU;

[0027] The startup parameter is used to start the NPU.

[0028] According to a second aspect of an embodiment of the present application, a method based on software-hardware joint verification is provided, which is applied to the above-mentioned device based on software-hardware joint verification, and the method includes:

[0029] Acquire configuration information; transmit the configuration information to the NPU through an interface; the configuration information is obtained based on a software language; the configuration information includes clock parameters, interrupt parameters, mode parameters and processing parameters; the clock parameters are used to configure the clock of the NPU, the interrupt parameters are used to configure the interrupt source of the NPU, the mode parameters are used to configure the working mode of the NPU, and the processing parameters are used to configure the data processing method of the NPU; the interface is obtained based on a hardware language;

[0030] The verification platform is also used to obtain a verification result based on the interface; the verification result indicates whether the NPU is normal, the verification result is obtained by parsing and running the software language, the running result is obtained by the NPU based on the interrupt source and the processing result, and the processing result is obtained by the NPU processing the verification data based on the clock, the working mode and the data processing method.

[0031] According to a third aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein the memory is used to store at least one program, and the at least one program is loaded by the processor and executes the method based on joint software and hardware verification as described above.

[0032] According to the fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, characterized in that at least one program is stored in the computer-readable storage medium, and the at least one program is loaded and executed by a processor to implement the method based on joint verification of software and hardware as described above.

[0033] In an embodiment of the present application, an embodiment of the present application provides a device based on joint verification of software and hardware, and configures and verifies operators based on software language. Hardware personnel only need to provide an interface for data interaction between NPU and verification platform, so that software personnel can independently verify operators, thereby reducing the communication between software personnel and hardware personnel, reducing the communication cost between software personnel and hardware personnel, and improving the verification rate of NPU operators. In addition, since software personnel are more flexible in configuration than hardware personnel, when software personnel perform operator verification on NPU based on software language, they do not need to wait for about 80% of module verification to be completed before starting operator verification, but can start operator verification after a small part of modules have completed verification, so that the start time of operator verification is earlier than that of related technologies. When problems are found in the operator verification process, module verification is far from over, so it is easier to modify the problematic modules at this time, thereby further improving the rate of operator verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0035] Figure 1 is a schematic diagram of an implementation environment provided according to an embodiment of the present application;

[0036] Figure 2 It is a schematic diagram of the principle of operator verification in NPU verification in the related art;

[0037] Figure 3 It is a structural diagram of a device based on software and hardware joint verification provided according to an embodiment of the present application;

[0038] Figure 4 It is a schematic diagram of a principle of configuring an NPU according to an embodiment of the present application;

[0039] Figure 5 It is a schematic diagram of the first structure of the NPU provided according to an embodiment of the present application.

[0040] Figure 6 It is a schematic diagram of the second structure of the NPU provided according to an embodiment of the present application.

[0041] Figure 7 It is a schematic diagram of a principle of processing verification results provided according to an embodiment of the present application;

[0042] Figure 8It is a flowchart of a method based on software and hardware joint verification provided according to an embodiment of the present application;

[0043] Fig. 9 is a schematic diagram of the structure of a terminal provided according to an embodiment of the present application;

[0044] Fig.10 It is a structural diagram of a server provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0046] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.

[0047] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limitation on the quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms.

[0048] These terms are only used to distinguish one element from another element. For example, without departing from the scope of various examples, a first action can be referred to as a second action, and similarly, a second action can also be referred to as a first action. Both the first action and the second action can be actions, and in some cases, can be separate and different actions.

[0049] Here, at least one means one or more than one, for example, at least one action can be one action, two actions, three actions, or any other action that is an integer greater than or equal to one. And multiple means two or more than two, for example, multiple actions can be two actions, three actions, or any other action that is an integer greater than or equal to two.

[0050] Figure 1 It is a schematic diagram of an implementation environment provided according to an embodiment of the present application, and the implementation environment may include a terminal 101 and a server 102.

[0051] In the terminal 101, a device based on software-hardware joint verification is provided, which is used to perform operator verification in NPU verification through the device based on software-hardware joint verification.

[0052] For example, the operator may be a convolution operator, a pooling operator, a fully connected operator, etc.

[0053] The terminal 101 may be a smart phone, a wearable device, a personal computer, a laptop computer, a tablet computer, a smart TV, a vehicle-mounted terminal, etc., which has a device based on software and hardware joint authentication.

[0054] The server 102 may be a single server, a server cluster consisting of multiple servers, or a cloud processing center.

[0055] The terminal 101 is connected to the server 102 via a wired or wireless network.

[0056] In some embodiments, the wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to any combination of local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, wired or wireless network, private network or virtual private network. In some embodiments, the data exchanged through the network is represented by technology and / or format including HyperText Mark-up Language (HTML), Extensible Markup Language (XML), etc. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technology can also be used to replace or supplement the above data communication technology.

[0057] Figure 2 It is a schematic diagram of the principle of operator verification in NPU verification in the related technology.

[0058] In the related art, when performing operator verification in NPU verification, start the verification platform and enter the main program. Configure the phase-locked loop and clock frequency of the NPU based on the hardware language, then reset the NPU, and turn on the clocks of each module in the NPU. Configure the interrupt source of each module based on the hardware language. Configure the working mode of the NPU based on the hardware language. Parse the preset configuration file based on the hardware language, and the preset configuration file is used to configure each execution unit. Obtain the execution results of each execution unit, and obtain the verification results based on the execution results of each execution unit. Parse the verification results based on the hardware language. The preset configuration file is obtained based on the software language. End the main program and the verification platform ends its operation.

[0059] In the above verification method, since the configuration and verification of the NPU are both implemented based on the hardware language, the configuration and verification of the NPU require the participation of hardware personnel.

[0060] However, due to the scarcity of hardware personnel and the inability to flexibly allocate them, the allocated hardware personnel often need to complete a project before being allocated to the next project. Therefore, hardware personnel need to wait until about 80% of the module verification is completed before starting operator verification. As a result, the operator verification starts late, and the operator verification involves a large number of modules. When problems are found during the operator verification process, the module verification has basically ended. Therefore, it is very difficult to modify the problematic modules at this time, which reduces the rate of operator verification.

[0061] In addition, the communication cost between software personnel and hardware personnel is high, which further reduces the rate of operator verification.

[0062] In order to solve the above-mentioned technical problems existing in the related art, the embodiments of the present application provide the following technical solutions.

[0063] Figure 3 : is a structural diagram of a device based on software and hardware joint verification provided according to an embodiment of the present application, the device comprising:

[0064] The verification platform 300 is provided with an interface 301 . The verification platform 300 is electrically connected to the NPU 400 to be verified based on the interface 301 . The interface 301 is obtained based on the hardware language.

[0065] The verification platform 300 is built based on software language, and the NPU 400 is also built based on hardware language.

[0066] It should be noted that the hardware language can be obtained from relevant technologies and will not be described in detail in the embodiments of the present application.

[0067] Figure 4It is a schematic diagram of a configuration principle of NPU 400 provided according to an embodiment of the present application.

[0068] By comparing Figure 3 as well as Figure 4 It can be known that the embodiment of the present application performs NPU 400 configuration and operator verification in NPU 400 verification based on software language, while the related art performs NPU 400 configuration and operator verification in NPU 400 verification based on hardware language. That is, in the embodiment of the present application, software personnel can independently perform operator NPU 400 configuration and operator verification based on software language, which greatly reduces the communication between software personnel and hardware personnel compared to the related art, thereby greatly reducing the communication cost between software personnel and hardware personnel, and thus improving the rate of operator verification.

[0069] Combine the following Figure 4 The principle of configuring the NPU 400 is exemplarily described.

[0070] In some embodiments, the verification platform 300 is used to obtain configuration information; the configuration information is transmitted to the NPU 400 through the interface 301; the configuration information is obtained based on the software language; the configuration information includes clock parameters, interrupt parameters, mode parameters and processing parameters; the clock parameters are used to configure the clock of the NPU 400, the interrupt parameters are used to configure the interrupt source of the NPU 400, the mode parameters are used to configure the working mode of the NPU 400, and the processing parameters are used to configure the data processing method of the NPU 400.

[0071] In one example, software personnel obtain configuration information based on the software language.

[0072] For example, the software language may be C language or C++.

[0073] In one example, the interface 301 is a basic interface 301 function, and the basic interface 301 function is obtained based on a hardware language.

[0074] In one example, hardware personnel may configure the basic interface 301 function through hardware language.

[0075] In the embodiment of the present application, only the hardware personnel need to configure the interface 301. After the interface 301 is configured, it basically does not need to be changed. Therefore, after the interface 301 is configured, the hardware personnel do not need to participate in the configuration and verification of the NPU 400, thereby reducing the communication cost between the software personnel and the hardware personnel, and further improving the operator verification rate.

[0076] In one example, since the configuration information is obtained based on the software language, and the NPU 400 is hardware, the NPU 400 cannot directly identify the configuration information configured by the software language. Therefore, in order to facilitate the NPU 400 to identify the configuration information, the embodiment of the present application introduces a DPI (Direct Programming Interface, DPI interface 301) mechanism.

[0077] The DPI mechanism can be understood as: used to interact with external C / C++ code in Verilog or System Verilog; wherein interface 301 is the DPI interface. After interface 301 obtains the configuration information, it calls the basic interface 301 function to convert the data format of the configuration information to obtain the configuration information that can be recognized by NPU 400. That is, data interaction between NPU 400 and verification platform 300 is realized based on the DPI mechanism.

[0078] In one example, the interrupt source may include an error interrupt and an end interrupt of each module in the NPU 400. The error interrupt indicates that an error occurs in the operation of the corresponding module, and the end interrupt indicates that the operation of the corresponding module ends.

[0079] It is understandable that during the actual operation of the NPU 400, at least one situation may cause an error in the operation of the module. At least one situation may cause the operation of the module to end.

[0080] In some embodiments, the verification platform 300 is also used to obtain the write address and write information of the register based on the software language, obtain the configuration information, and call the write function to process the write address and write information; the register is set in the NPU.

[0081] In one example, the verification platform 300 writes a write address into a write address location of a write function and writes write information into a write information location of the write function based on a software language.

[0082] It should be noted that the write function can be obtained from the relevant technology and will not be described in detail in the embodiments of the present application.

[0083] In one example, the clock parameters may include a clock write address and clock write information of a write write function.

[0084] In one example, the interrupt parameter may include an interrupt write address of a write function and interrupt write information.

[0085] In one example, the mode parameters may include a mode write address and mode write information of a write function.

[0086] In one example, the process parameters may include a process write address and process write information of a write write function.

[0087] Figure 5 4 is a schematic diagram of a first structure of an NPU 400 provided according to an embodiment of the present application.

[0088] Combine the following Figure 5 A first structure of the NPU 400 is exemplarily described.

[0089] In some embodiments, the NPU 400 includes a clock module 403 , a synchronization management module 401 , and an execution module 402 .

[0090] The clock module 403 is electrically connected to the synchronization management module 401 and the execution module 402 respectively, and the synchronization management module 401 is electrically connected to the execution module 402 .

[0091] The clock module 403 is used to provide a clock signal to the synchronization management module 401 and the execution module 402 based on the clock parameters.

[0092] The execution module 402 is used to process the verification data based on the processing parameters to obtain a processing result.

[0093] The synchronization management module 401 is used to obtain the processing result and coordinate the work of each execution module 402; generate an interrupt enable signal based on the interrupt source, and generate an operation result based on the processing result and the interrupt enable signal.

[0094] The functions of the synchronization management module 401 are described below in conjunction with two examples.

[0095] In the first example, the synchronization management module 401 performs a synchronization function. The synchronization management module 401 is electrically connected to the first function module and the second function module. The first function module and the second function module are arranged in the NPU 400. The second function module runs based on the output result of the first function module. At least one enable register is arranged in the synchronization management module 401. The NPU 400 may be provided with a plurality of function registers. The first function module and the second function module correspond to at least one function register respectively.

[0096] For example, the second functional module executes the waiting instruction, that is, the second functional module is waiting for the output result of the first functional module. After the first functional module obtains the output result, it writes "1" to the first register in the synchronization management module 401. When the second functional module recognizes that the value of the first register in the synchronization management module 401 is updated to "1", it obtains the value in the corresponding functional register. After the second functional module completes the configuration, the second functional module is started.

[0097] In the second example, the synchronization management module 401 performs an interruption function, wherein the synchronization management module 401 operates on the interruption of each module in the NPU 400 to obtain an operation result.

[0098] The operation result can be understood as the NPU 400 being interrupted.

[0099] For example, the synchronization management module 401 obtains the error interrupt or end interrupt of each module of the NPU 400, performs an OR operation on the error interrupt or end interrupt of each module, and obtains the NPU 400 interrupt.

[0100] The NPU 400 interrupt may include an NPU 400 error interrupt and an NPU 400 end interrupt. The NPU 400 error interrupt indicates that an error occurs during the operation of the NPU 400. The NPU 400 end interrupt indicates that the operation of the NPU 400 ends.

[0101] For example, the synchronization management module 401 may be a SM (Sync Manager).

[0102] The configuration of each module in the NPU 400 is exemplarily described below with reference to several examples.

[0103] It can be understood that the clock module 403 , the synchronization management module 401 and the execution module 402 respectively correspond to at least one function register.

[0104] In the first example, after obtaining the configuration information, the NPU 400 identifies the configuration information and obtains the clock parameters. Based on the clock write address, the corresponding function register is determined, and the clock write information is written into the function register corresponding to the clock parameter. The write information corresponding to the clock parameter may include a phase-locked loop and a clock frequency, etc.

[0105] In the second example, after acquiring the configuration information, the NPU 400 identifies the configuration information and obtains the interruption parameter, determines the corresponding enable register based on the interruption write address, and writes the interruption write information into the enable register corresponding to the interruption parameter.

[0106] For example, the interrupt write information may be "0" or "1".

[0107] In the third example, after acquiring the configuration information, the NPU 400 identifies the configuration information and obtains the mode parameter, determines the corresponding function register based on the mode write address, and writes the mode write information into the function register corresponding to the mode parameter.

[0108] In the fourth example, after acquiring the configuration information, the NPU 400 identifies the configuration information and obtains the processing parameters, determines the corresponding function register based on the processing write address, and writes the processing write information into the function register corresponding to the processing parameter.

[0109] In some embodiments, the execution module 402 includes multiple execution units (EUs). The processing result of the execution module 402 includes the calculation result of each execution unit and the execution interrupt.

[0110] In one example, each execution unit obtains a calculation result and an execution interrupt after processing corresponding verification data.

[0111] For one execution unit, the execution unit writes the calculation result into the corresponding function register and sends the execution interrupt to the synchronization management module 401 .

[0112] In some embodiments, the execution result is obtained based on the execution interrupt of each execution unit and the corresponding interrupt enable signal.

[0113] In one example, an execution unit is used as an example for explanation. After acquiring the execution interrupt of an execution unit, the synchronization management module 401 generates an interrupt enable signal based on the interrupt write information in the corresponding enable register. The synchronization management module 401 performs a first operation on the execution interrupt corresponding to the execution unit and the interrupt enable signal to obtain a first operation result. Among them, when the interrupt write information is "1", the interrupt enable signal is enabled.

[0114] Similarly, the first operation result of each execution unit can be obtained.

[0115] Then, the synchronization management module 401 performs a second operation on the operation result corresponding to each execution unit, obtains an NPU 400 interrupt, and outputs it to the NPU 400 .

[0116] For example, the first operation may be an AND operation, and the second operation may be an OR operation.

[0117] For example, the execution interrupt corresponding to the execution unit and the interrupt enable signal are ANDed to obtain the interrupt enable signal. That is, when the interrupt enable signal is enabled, the first operation result is enabled. When the interrupt enable signal is not enabled, the first operation result is not enabled.

[0118] Next, the NPU 400 outputs the NPU 400 interrupt to the verification platform 300 through the interface 301 , and the verification platform 300 parses the NPU 400 interrupt based on the software language to obtain a verification result.

[0119] Figure 64 is a second structural diagram of the NPU 400 provided according to an embodiment of the present application.

[0120] Combine the following Figure 6 The second structure of the NPU 400 is exemplarily described.

[0121] In some implementations, the NPU 400 is electrically connected to a CPU 500 (Central Processing Unit). The NPU 400 also includes a control module 404 .

[0122] Mode parameters include the first mode and the second mode.

[0123] The first mode is that the CPU 500 , the control module 404 , and the execution module 402 are electrically connected in sequence; the CPU 500 is used to control the control module 404 , and the control module 404 is used to control the execution module 402 .

[0124] The second mode is that the CPU 500 is electrically connected to the execution module 402. The CPU 500 is used to control the execution module 402.

[0125] The control module 404 is electrically connected to the clock module 403. During the operation of the NPU, the clock module 403 provides a clock signal to the control module 404.

[0126] It is understood that in the first mode, the control module 404 is not started. In the second mode, the control module 404 is started.

[0127] For example, the control module 404 may be a dsptch module. The dsptch module may be used to configure the running information and startup information of the execution module 402.

[0128] It should be noted that, in addition to the modules mentioned above, the NPU 400 may also include other modules, which will not be described in detail in the embodiments of the present application.

[0129] In some embodiments, the verification platform 300 is further used to obtain a preset configuration file, parse the preset configuration file based on the software language, and obtain processing parameters.

[0130] In one example, the preset configuration file may include processing information required for the operator to run. The preset configuration file is parsed based on the software language to obtain processing information, and the processing information includes a processing write address and processing write information. The verification platform 300 writes the processing write address into the write address position of the write function based on the software language, and writes the processing write information into the write information position of the write function to obtain processing parameters.

[0131] The processing parameters are used to instruct the execution unit how to run.

[0132] For example, the preset configuration file may include information required for the operator to run and verification data, wherein the verification data may include the size of the image, etc.

[0133] In some embodiments, the configuration information also includes reset parameters and startup parameters;

[0134] The reset parameter is used to reset the NPU 400;

[0135] The startup parameters are used to start the NPU 400 .

[0136] In an example, the NPU 400 writes the reset write information in the reset parameters into the function register corresponding to each module, and then each module can call the reset write information in the corresponding function register to achieve reset.

[0137] In one example, the NPU 400 writes the startup write information in the startup parameters into the function register corresponding to each module, and then each module can call the startup write information in the corresponding function register to start each module, thereby starting the NPU 400.

[0138] For example, the startup write information can be used to start the clock module 403, the synchronization management module 401, and the execution module 402.

[0139] In some embodiments, the verification platform 300 is also used to obtain a verification result based on the interface 301; the verification result indicates whether the NPU 400 is normal, the verification result is obtained by parsing the software language and running the result, the running result is obtained by the NPU 400 based on the interrupt source and the processing result, and the processing result is obtained by the NPU 400 based on the clock, working mode and data processing method, by processing the verification data.

[0140] In one example, the verification platform 300 is started and the main program is entered. The NPU 400 resets the clock module 403, the synchronization management module 401, the control module 404, and the execution module 402 based on the reset write information in at least one function register. The NPU 400 configures the first mode based on the mode write information in at least one function register, and then starts the clock module 403, the synchronization management module 401, the control module 404, and each execution unit.

[0141] In one example, after each execution unit is started, each execution unit processes the configured verification data based on the configured data processing method under the clock signal provided by the clock module 403 and the control of the control module 404 to obtain the calculation result and the execution interrupt. Each execution unit sends the execution interrupt to the synchronization management module 401.

[0142] In one example, for an execution unit, the synchronization management module 401 calls the interrupt write information in the enable register corresponding to the execution unit to generate a corresponding interrupt enable signal. The synchronization management module 401 performs an AND operation on the execution interrupt and the interrupt enable signal of the execution unit to obtain the first operation result corresponding to the execution unit. The synchronization management module 401 performs an OR operation on all the first operation results to obtain the NPU 400 interrupt and output it to the NPU 400. After obtaining the NPU 400 interrupt, the NPU 400 sends the NPU 400 interrupt to the verification platform 300 through the interface 301.

[0143] In one example, the verification platform 300 parses the NPU 400 interrupt based on the software language, obtains the verification result, terminates the main program, and the verification platform 300 terminates operation. When the NPU 400 interrupt is an error interrupt, the verification result indicates that the operator verification fails. When the NPU 400 interrupt is an end interrupt, the verification result indicates that the operator verification succeeds.

[0144] In one example, when the verification result indicates that the operator verification fails, the cause of the failure is parsed based on the software language to obtain the cause of the failure, which may include software errors and hardware errors.

[0145] When the failure is caused by a software error, the failure is fed back to the software personnel for resolution. When the failure is caused by a hardware error, the failure is fed back to the hardware personnel for resolution.

[0146] In one example, the verification platform 300 may generate a verification pass rate table based on the verification results of multiple operator verifications, wherein the verification pass rate is the probability of successful operator verification.

[0147] In one example, the verification platform 300 may display the verification pass rate table on a user interface so that software personnel or hardware personnel can view the verification results.

[0148] Figure 7 It is a schematic diagram of the principle of processing verification results provided according to an embodiment of the present application.

[0149] Combine the following Figure 7 The principle of processing the verification result is exemplified.

[0150] In one example, an operator verification test / regression is used as an example for explanation. When the operator verification test / regression passes, that is, the operator verification is successful, the main program ends, and the verification platform 300 ends running.

[0151] In one example, the test / regression of an operator verification is still used as an example for explanation. When the test / regression of the operator verification fails, that is, the operator verification fails, it is determined whether it is a software error or a hardware error based on the software language.

[0152] If it is a software error, the software error is fed back to the software personnel. After the software personnel solve the software error, the verification platform 300 re-executes the operator verification.

[0153] If it is a hardware error, the hardware error is fed back to the hardware personnel. After the hardware personnel solve the hardware error, the verification platform 300 re-executes the operator verification.

[0154] For example, the software error may be an error in the software language parsing preset configuration file, and the hardware error may be an NPU400 error.

[0155] After the operator verification is completed, the main program ends and the verification platform 300 ends its operation.

[0156] In the embodiment of the present application, the NPU is configured and the operator is verified based on the software language. The hardware personnel only need to provide an interface for data interaction between the NPU and the verification platform, so that the software personnel can independently perform the operator verification, thereby reducing the communication between the software personnel and the hardware personnel, reducing the communication cost between the software personnel and the hardware personnel, and improving the NPU operator verification rate. In addition, since the software personnel are more flexible in configuration than the hardware personnel, when the software personnel perform operator verification on the NPU based on the software language, they do not need to wait for about 80% of the module verification to be completed before starting the operator verification, but can start the operator verification after a small part of the modules have completed the verification, so that the start time of the operator verification is earlier than that of the related technology. When a problem is found during the operator verification process, the module verification is far from over, so it will be easier to modify the module with the problem at this time, thereby further improving the rate of operator verification.

[0157] Figure 8 is a flowchart of a method based on software and hardware joint verification provided in an embodiment of the present application, such as Figure 8 As shown, in the embodiment of the present application, a terminal having a device based on software and hardware joint verification is used as an example for explanation. The method includes the following steps:

[0158] In step 801, the terminal obtains configuration information; transmits the configuration information to the NPU through an interface; the configuration information is obtained based on a software language; the configuration information includes clock parameters, interrupt parameters, mode parameters and processing parameters; the clock parameters are used to configure the clock of the NPU, the interrupt parameters are used to configure the interrupt source of the NPU, the mode parameters are used to configure the working mode of the NPU, and the processing parameters are used to configure the data processing method of the NPU; the interface is obtained based on a hardware language;

[0159] In step 802, the verification platform of the terminal is also used to obtain a verification result based on the interface; the verification result indicates whether the NPU is normal, the verification result is obtained by parsing and running the software language, the running result is obtained by the NPU based on the interrupt source and the processing result, and the processing result is obtained by the NPU based on the clock, the working mode and the data processing method, by processing the verification data.

[0160] In some embodiments, the interface is a basic interface function, which is obtained based on the hardware language.

[0161] In some embodiments, the method further includes: acquiring a write address and write information of a register based on the software language, obtaining the configuration information, and calling a write function to process the write address and write information; the register is set in the NPU.

[0162] In some embodiments, the method further includes: obtaining a preset configuration file, parsing the preset configuration file based on the software language, and obtaining the processing parameters.

[0163] In some embodiments, the method further includes: providing a clock signal to the synchronization management module and the execution module based on the clock parameter;

[0164] Process the verification data based on the processing parameter to obtain the processing result;

[0165] Obtain the processing result and coordinate the work of each execution module; generate an interrupt enable signal based on the interrupt source, and generate the operation result based on the processing result and the interrupt enable signal.

[0166] In some embodiments, the mode parameter includes a first mode and a second mode;

[0167] The first mode is that the CPU, the control module and the execution module are electrically connected in sequence; the CPU is used to control the control module, and the control module is used to control the execution module;

[0168] The second mode is that the CPU is electrically connected to the execution module; the CPU is used to control the execution module.

[0169] In some embodiments, the processing result of the execution module includes the calculation result of each of the execution units and the execution interrupt.

[0170] In some embodiments, the execution result is obtained based on the execution interrupt of each execution unit and the corresponding interrupt enable signal.

[0171] In some embodiments, the configuration information also includes reset parameters and startup parameters;

[0172] The reset parameter is used to reset the NPU;

[0173] The startup parameter is used to start the NPU.

[0174] It should be noted that the device based on software and hardware joint verification provided in the above embodiment and the method embodiment based on software and hardware joint verification belong to the same concept, and the specific implementation process is detailed in the device embodiment and will not be repeated here.

[0175] In the embodiment of the present application, the NPU is configured and the operator is verified based on the software language. The hardware personnel only need to provide an interface for data interaction between the NPU and the verification platform, so that the software personnel can independently perform the operator verification, thereby reducing the communication between the software personnel and the hardware personnel, reducing the communication cost between the software personnel and the hardware personnel, and improving the NPU operator verification rate. In addition, since the software personnel are more flexible in configuration than the hardware personnel, when the software personnel perform operator verification on the NPU based on the software language, they do not need to wait for about 80% of the module verification to be completed before starting the operator verification, but can start the operator verification after a small part of the modules have completed the verification, so that the start time of the operator verification is earlier than that of the related technology. When a problem is found during the operator verification process, the module verification is far from over, so it will be easier to modify the module with the problem at this time, thereby further improving the rate of operator verification.

[0176] An embodiment of the present application further provides a computer device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the above method when executing the computer program.

[0177] Taking computer equipment as the terminal as an example, Fig. 9 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application, see Fig. 9The terminal 900 may be a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a notebook computer or a desktop computer. The terminal 900 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

[0178] Typically, the terminal 900 includes a processor 901 and a memory 902 .

[0179] The processor 901 may include one or more processing cores, such as a 4-core processor, a 9-core processor, etc. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0180] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one program code, which is used to be executed by the processor 901 to implement the process of terminal execution in the method for mixed-precision floating-point multiplication and accumulation operations provided in the method embodiment of the present application.

[0181] In some embodiments, the terminal 900 may further optionally include: a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902 and the peripheral device interface 903 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 903 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a display screen 904, a camera assembly 905, an audio circuit 906 and a power supply 907.

[0182] The peripheral device interface 903 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 may be implemented on a separate chip or circuit board, which is not limited in the embodiments of the present application.

[0183] The display screen 904 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 904 is a touch display screen, the display screen 904 also has the ability to collect touch signals on the surface or above the surface of the display screen 904. The touch signal can be input to the processor 901 as a control signal for processing. At this time, the display screen 904 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 904 can be one, set on the front panel of the terminal 900; in other embodiments, the display screen 904 can be at least two, respectively set on different surfaces of the terminal 900 or in a folding design; in other embodiments, the display screen 904 can be a flexible display screen, set on the curved surface or folding surface of the terminal 900. Even, the display screen 904 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 904 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0184] The camera assembly 905 is used to capture images or videos. In some embodiments, the camera assembly 905 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 905 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0185] The audio circuit 906 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 901 for processing. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 900. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 901 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 906 may also include a headphone jack.

[0186] The power supply 907 is used to power various components in the terminal 900. The power supply 907 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 907 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0187] Those skilled in the art will understand that Fig. 9 The structure shown in the figure does not constitute a limitation on the terminal 900, and the terminal 900 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.

[0188] Take the computer device as a server as an example. Fig.10It is a structural diagram of a server provided in an embodiment of the present application. The server 1000 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1001 and one or more memories 1002, wherein the one or more memories 1002 store at least one computer program, and the at least one computer program is loaded and executed by the one or more processors 1001 to implement the above-mentioned method based on joint verification of software and hardware. Of course, the server 1000 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server 1000 may also include other components for implementing device functions, which will not be repeated here.

[0189] The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned method for generating an image processing model. Optionally, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0190] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0191] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A device based on software and hardware joint verification, characterized in that: include: A verification platform, wherein the verification platform is provided with an interface, and the verification platform is electrically connected to the NPU to be verified based on the interface; the interface is obtained based on a hardware language; The verification platform is used to obtain configuration information; transmit the configuration information to the NPU through the interface; the configuration information is obtained based on the software language; the configuration information includes clock parameters, interrupt parameters, mode parameters and processing parameters; the clock parameters are used to configure the clock of the NPU, the interrupt parameters are used to configure the interrupt source of the NPU, the mode parameters are used to configure the working mode of the NPU, and the processing parameters are used to configure the data processing method of the NPU; The verification platform is also used to obtain a verification result based on the interface; the verification result indicates whether the NPU is normal, the verification result is obtained by parsing and running the software language, the running result is obtained by the NPU based on the interrupt source and the processing result, and the processing result is obtained by the NPU processing the verification data based on the clock, the working mode and the data processing method.

2. The device according to claim 1, characterized in that The interface is a basic interface function, and the basic interface function is obtained based on the hardware language.

3. The device according to claim 1, characterized in that The verification platform is also used to obtain the write address and write information of the register based on the software language, obtain the configuration information, and call the write function to process the write address and write information; the register is set in the NPU.

4. The device according to claim 1, characterized in that The verification platform is further used to obtain a preset configuration file, parse the preset configuration file based on the software language, and obtain the processing parameters.

5. The device according to claim 1, characterized in that The NPU includes a clock module, a synchronization management module and an execution module; The clock module is electrically connected to the synchronization management module and the execution module respectively, and the synchronization management module is electrically connected to the execution module; The clock module is used to provide a clock signal to the synchronization management module and the execution module based on the clock parameter; The execution module is used to process the verification data based on the processing parameters to obtain the processing result; The synchronization management module is used to obtain the processing results and coordinate the work of each execution module; An interrupt enable signal is generated based on the interrupt source, and the operation result is generated based on the processing result and the interrupt enable signal.

6. The device according to claim 5, characterized in that The NPU is electrically connected to the CPU; the NPU also includes a control module; The mode parameters include a first mode and a second mode; The first mode is that the CPU, the control module and the execution module are electrically connected in sequence; the CPU is used to control the control module, and the control module is used to control the execution module; The second mode is that the CPU is electrically connected to the execution module; the CPU is used to control the execution module.

7. The device according to claim 5, characterized in that The execution module includes a plurality of execution units; The processing result of the execution module includes a calculation result of each of the execution units and an execution interrupt.

8. The device according to claim 7, characterized in that The operation result is obtained based on the execution interrupt of each execution unit and the corresponding interrupt enable signal.

9. The device according to claim 1, characterized in that The configuration information also includes reset parameters and startup parameters; The reset parameter is used to reset the NPU; The startup parameters are used to start the NPU.

10. A method based on software and hardware joint verification, applied to the device based on software and hardware joint verification as described in any one of claims 1 to 9, characterized in that: include: Get configuration information; transmitting the configuration information to the NPU via an interface; The configuration information is obtained based on the software language; The configuration information includes clock parameters, interrupt parameters, mode parameters and processing parameters; the clock parameters are used to configure the clock of the NPU, the interrupt parameters are used to configure the interrupt source of the NPU, the mode parameters are used to configure the working mode of the NPU, and the processing parameters are used to configure the data processing method of the NPU; the interface is obtained based on the hardware language; The verification platform is also used to obtain a verification result based on the interface; the verification result indicates whether the NPU is normal, the verification result is obtained by parsing and running the software language, the running result is obtained by the NPU based on the interrupt source and the processing result, and the processing result is obtained by the NPU processing the verification data based on the clock, the working mode and the data processing method.

11. A computer device, characterized in that: The computer device includes a processor and a memory, the memory is used to store at least one program, and the at least one program is loaded by the processor and executes the method based on software and hardware joint verification as claimed in claim 10.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program, and the at least one program is loaded and executed by the processor to implement the method based on software and hardware joint verification as claimed in claim 10.

Citation Information

Patent Citations

  • Apparatus and method for generating assertion, and apparatus and method for verifying processor

    CN103678114A

  • Chip verification method, system and device, computer equipment and storage medium

    CN113032202A

  • Universal testing system and method for hardware language codes

    CN114676064A

  • Register verification method and device, electronic equipment and computer storage medium

    CN116860589A

  • Multi-language compatible method and device for chip verification, equipment and storage medium

    CN118245309A