A chip prototype verification method, apparatus, equipment, and medium
The chip verification system, which uses user-mode and kernel-mode driver subsystems, communicates directly with the target chip, solving the problems of performance loss, high learning cost, and time-consuming debugging in FPGA prototype verification of NVMe interface chips, and achieving efficient and accurate chip performance verification.
Patent Information
- Application Number
- CN202311851472.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2043-12-28
AI Technical Summary
Existing FPGA prototyping methods for NVMe interface chips suffer from performance loss, high learning costs, high debugging difficulty, and inefficient debugging time.
The chip verification system employs both user-mode and kernel-mode driver subsystems. The user-mode driver subsystem obtains the application's call commands and generates verification commands for the logical device interface specification. The kernel-mode driver subsystem communicates directly with the target chip to obtain and parse the processing results, thus avoiding the optimization path of data in the file system and BIO framework.
This enabled accurate verification of chip performance, reduced learning costs and debugging difficulty, improved verification efficiency, and shortened the verification cycle.
Smart Images

Figure CN117669443B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a chip prototype verification method, apparatus, device, and medium. Background Technology
[0002] Currently, the basic method for prototyping existing traditional NVMe (NVM Express, Non-Volatile Memory Host Controller Interface Specification) interface chips using FPGAs (Field Programmable Gate Arrays) is as follows: Utilizing the standard Linux driver architecture, the application sends NVMe commands. These commands, after system calls, reach the virtual file system and are then transmitted to the specific file system. The file system processes the commands and sends them to the Linux block driver standard architecture's BIO (Block-IO) layer and Request layer. The BIO and Request layers perform appropriate optimization on the IO (input / output) before sending it to the Linux NVMe driver. The driver then works with the hardware to process the IO commands, specifically... Figure 1 The diagram shown is a flowchart of a traditional chip prototype verification method.
[0003] However, the above verification method has the following drawbacks: First, during verification, since IO data has to pass through the file system, BIO framework, and then be sent to the driver and hardware, the original IO may be disassembled, merged, and optimized before being sent to the hardware. The resulting performance may be the optimized performance rather than the original IO performance. Second, the learning cost is high. Standard Linux device drivers involve a lot of complex content. FPGA prototype verification personnel need to learn about the large and complex Linux BIO architecture and its code, as well as file systems, which increases the learning cost for verification personnel and lengthens the verification cycle. Third, the debugging difficulty increases. Standard Linux device drivers involve a lot of complex content, and problems may occur at various stages, which directly increases the difficulty of locating problems and extends the verification cycle. Fourth, debugging is time-consuming and inefficient. Modifying driver code is a common operation during debugging. If standard Linux drivers are used, modifying driver code means recompiling the system, restarting the computer, and other time-consuming operations, which will undoubtedly reduce debugging efficiency and extend the chip FPGA prototype verification cycle.
[0004] In conclusion, accurately verifying chip performance and improving efficiency are pressing issues that need to be addressed. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a chip prototype verification method, apparatus, device, and medium that can accurately verify chip performance and improve efficiency. The specific solution is as follows:
[0006] In a first aspect, this application discloses a chip prototype verification method, applied to a chip verification system including a user-mode driver subsystem and a kernel-mode driver subsystem, comprising:
[0007] The user-mode driver subsystem obtains the invocation command sent by the application, generates a target verification command in the form of a logical device interface specification based on the invocation command, and sends the verification command to the kernel-mode driver subsystem; the invocation command includes verification requirement information.
[0008] The kernel-mode driver subsystem sends the verification instruction to the target chip based on the target direct memory access resource, obtains the processing result returned by the target chip based on the target direct memory access resource, and sends the obtained processing result to the user-mode driver subsystem; the processing result is the result obtained by the target chip in processing the verification instruction and sent to the kernel-mode driver subsystem; the target direct memory access resource is the resource pre-allocated for data transmission between the target chip and the kernel-mode driver subsystem;
[0009] The user-mode driver subsystem parses the received processing results to obtain the verification results, and sends the verification results to the application for display, so that chip prototype verification personnel can analyze the verification results.
[0010] Optionally, before obtaining the invocation command sent by the application through the user-mode driver subsystem, the method further includes:
[0011] The user-mode driver subsystem is initialized through the user-mode driver subsystem;
[0012] The kernel-mode driver subsystem and the target chip are initialized through the kernel-mode driver subsystem.
[0013] Optionally, before sending the verification instruction to the target chip via the kernel-mode driver subsystem based on the target direct memory access resource, the method further includes:
[0014] The user-mode driver subsystem calls the direct memory access resource management interface in the kernel-mode driver subsystem to request the target direct memory access resource for data transmission between the kernel-mode driver subsystem and the target chip, so that the verification instruction and the processing result can be transmitted between the kernel-mode driver subsystem and the target chip.
[0015] Accordingly, the chip prototype verification method further includes:
[0016] The target direct memory access resources are managed through the kernel-mode driver subsystem.
[0017] Optionally, before obtaining the invocation command sent by the application through the user-mode driver subsystem, the method further includes:
[0018] The kernel-mode driver subsystem requests the interrupt resources required by the target chip to initiate an interrupt and maintains the interrupt resources so that the target chip can send interrupt information while sending the processing result.
[0019] Optionally, before obtaining the invocation command sent by the application through the user-mode driver subsystem, the method further includes:
[0020] The kernel-mode driver subsystem requests the resources required by the target chip for command processing, excluding interrupt resources and direct memory access resources.
[0021] Optionally, before obtaining the invocation command sent by the application through the user-mode driver subsystem, the method further includes:
[0022] Through the kernel-mode driver subsystem, target operations are performed on the kernel-mode device corresponding to the kernel-mode driver subsystem; the target operations include creating, opening, closing and removing.
[0023] Optionally, the chip prototype verification method further includes:
[0024] After the user-mode driver subsystem sends the verification command to the kernel-mode driver subsystem, the user-mode driver subsystem detects in real time whether it has obtained the processing result within a preset time interval.
[0025] Accordingly, the step of parsing the received processing result through the user-mode driver subsystem to obtain the verification result, and sending the verification result to the application for display, so that chip prototype verification personnel can analyze the verification result, includes:
[0026] If the user-mode driver subsystem detects that the user-mode driver subsystem has obtained the processing result within the preset time interval, the user-mode driver subsystem parses the received processing result to obtain the verification result, and sends the verification result to the application for display, so that the chip prototype verification personnel can analyze the verification result;
[0027] Accordingly, the chip prototype verification method further includes:
[0028] If the user-mode driver subsystem detects that it has not obtained the processing result within the preset time interval, or has obtained abnormal information, then the abnormal situation in the kernel-mode driver subsystem is handled by the kernel-mode driver subsystem.
[0029] Accordingly, the chip prototype verification method further includes:
[0030] The user-mode driver subsystem handles abnormal situations within the user-mode driver subsystem.
[0031] Secondly, this application discloses a chip prototype verification device, applied to a chip verification system including a user-mode driver subsystem and a kernel-mode driver subsystem, comprising:
[0032] The verification command generation module is used to obtain the call command sent by the application through the user-mode driver subsystem, generate a target verification command in the form of a logical device interface specification based on the call command, and send the verification command to the kernel-mode driver subsystem; the call command includes verification requirement information;
[0033] The command and result transmission module is used to send the verification instruction to the target chip through the kernel-mode driver subsystem based on the target direct memory access resources, obtain the processing result returned by the target chip based on the target direct memory access resources, and send the obtained processing result to the user-mode driver subsystem; the processing result is the result obtained by the target chip in processing the verification instruction and sent to the kernel-mode driver subsystem; the target direct memory access resources are resources pre-allocated for data transmission between the target chip and the kernel-mode driver subsystem;
[0034] The result processing module is used to parse the received processing result through the user-mode driver subsystem to obtain the verification result, and send the verification result to the application for display so that chip prototype verification personnel can analyze the verification result.
[0035] Thirdly, this application discloses an electronic device, comprising:
[0036] Memory, used to store computer programs;
[0037] A processor is used to execute the computer program to implement the aforementioned disclosed chip prototype verification method.
[0038] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed chip prototype verification method.
[0039] The beneficial effects of this application are as follows: This application obtains the call command sent by the application through the user-mode driver subsystem, generates a target verification command in the form of a logical device interface specification based on the call command, and sends the verification instruction to the kernel-mode driver subsystem; the call command includes verification requirement information; the kernel-mode driver subsystem sends the verification instruction to the target chip based on the target direct memory access resource, obtains the processing result returned by the target chip based on the target direct memory access resource, and sends the obtained processing result to the user-mode driver subsystem; the processing result is the result obtained by the target chip in processing the verification instruction and sent to the kernel-mode driver subsystem; the target direct memory access resource is a resource pre-allocated for data transmission between the target chip and the kernel-mode driver subsystem; the user-mode driver subsystem parses the received processing result to obtain the verification result, and sends the verification result to the application for display, so that chip prototype verification personnel can analyze the verification result. Therefore, this application constructs a chip verification system that includes a user-mode driver subsystem and a kernel-mode driver subsystem. The system does not follow the path of passing through the file system and BIO framework before being sent to the driver and hardware. It does not optimize commands and can accurately verify chip performance. With the user-mode driver subsystem and kernel-mode driver subsystem of this application, users do not need to learn the huge and complex Linux BIO architecture and its code, nor do they need to locate and modify it when errors occur. This reduces the user's learning cost, lowers the difficulty of modification, and improves efficiency. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0041] Figure 1 This is a schematic diagram of a traditional chip prototype verification method disclosed in this application;
[0042] Figure 2 This is a flowchart of a chip prototype verification method disclosed in this application;
[0043] Figure 3 This is a schematic diagram of a chip verification system, application, and hardware disclosed in this application;
[0044] Figure 4 This is a flowchart of a specific chip prototype verification method disclosed in this application;
[0045] Figure 5This is a schematic diagram of the structure of a chip prototype verification device disclosed in this application;
[0046] Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] The above verification method has the following drawbacks: First, during verification, since IO data must pass through the file system and BIO framework before being sent to the driver and hardware, the original IO may be disassembled, merged, and optimized before being sent to the hardware. The resulting performance may be the optimized performance rather than the original IO performance. Second, the learning cost is high. Standard Linux device drivers involve a lot of complex content, and FPGA prototype verification personnel need to learn about the large and complex Linux BIO architecture and its code, as well as file systems, which increases the learning cost for verification personnel and prolongs the verification cycle. Third, the debugging difficulty increases. Standard Linux device drivers involve a lot of complex content, and problems may occur at various stages, which directly increases the difficulty of locating problems and prolongs the verification cycle. Fourth, debugging is time-consuming and inefficient. Modifying driver code is a common operation during debugging. If using standard Linux drivers, modifying driver code means recompiling the system, restarting the computer, and other time-consuming operations, which undoubtedly reduces debugging efficiency and prolongs the chip FPGA prototype verification cycle.
[0049] Therefore, this application proposes a chip prototype verification scheme, which is applied to a chip verification system including a user-mode driver subsystem and a kernel-mode driver subsystem, and can accurately verify chip performance and improve efficiency.
[0050] This application discloses a chip prototype verification method. See also Figure 2 As shown, the method, applied to a chip verification system including a user-mode driver subsystem and a kernel-mode driver subsystem, includes:
[0051] Step S11: Obtain the call command sent by the application through the user-mode driver subsystem, generate a target verification command in the form of a logical device interface specification based on the call command, and send the verification command to the kernel-mode driver subsystem; the call command includes verification requirement information.
[0052] In this embodiment, the chip can be an FPGA chip, and the command is an NVMe command. It should be noted that the electronic information industry, with integrated circuits at its core, has surpassed traditional industries such as automobiles, oil, and steel to become the largest industry and a focal point of global economic competition. As the carrier of integrated circuits, chips inevitably become increasingly complex in architecture, higher in frequency, more powerful in function, and higher in integration. Complex architecture, higher frequency, higher integration, and more powerful functions all present challenges in terms of time and money for chip prototype verification. As a semi-custom circuit in the field of application-specific integrated circuits (ASICs), FPGAs not only provide RTL (Register Transfer Level) verification functions for chip hardware developers but also improve simulation speed. Simultaneously, they provide a platform for software developers to develop embedded and related application software in advance. The explosive growth of big data has led to increasingly higher user demands for I / O throughput, giving rise to NVMe applications. NVMe is a register-level interface used for communication between host software (corresponding to the APP in this application) and non-volatile memory subsystems. It is primarily designed for solid-state storage devices (SSDs, Solid State Disks, or Solid State Drives) using the PCIe (peripheral component interconnect express, high-speed serial computer expansion bus standard) interface in enterprise, data center, and client systems. Its goal is to maximize the potential of flash memory and features high bandwidth and low latency.
[0053] In this embodiment, kernel-mode drivers have advantages such as high privileges and good stability, but they also have inherent drawbacks such as high system call overhead, steep learning curve, poor interface stability, difficult debugging, fatal bugs, and limited programming language choices. User-mode drivers have advantages such as flexible programming, convenient debugging, and no risk of system-wide suspension, but they have natural disadvantages in interrupt handling, DMA operations, and managing device dependencies, and they cannot use kernel services. Therefore, it is considered to utilize both kernel-mode and user-mode driver subsystems simultaneously.
[0054] In this embodiment, see Figure 3The diagram shows a chip verification system, an application, and hardware. The chip verification system includes a user-mode driver subsystem and a kernel-mode driver subsystem. The user-mode driver subsystem includes a first initialization unit, a DMA (Direct Memory Access) resource allocation unit, a command sending unit, a command receiving unit, a command processing unit, and a first exception handling unit. The kernel-mode driver subsystem includes a second initialization unit, an interrupt handling unit, a DMA resource management unit, a device management unit, other resource management units, and a second exception handling unit. The specific transmitted commands are NVMe commands, and the interrupts are MSI-X (Message Signaled Interrupt-X) interrupts.
[0055] Specifically, the user-space subsystem units are described as follows: The first initialization unit is primarily responsible for initializing the user-space subsystem. The DMA resource allocation unit primarily provides the verification module with the required DMA resources by calling the kernel-level DMA resource management interface. The command sending module is primarily responsible for encapsulating I / O operations on the NVMe device into appropriate NVMe commands and sending the commands to the driver. The command receiving module is primarily responsible for receiving responses to NVMe commands. The command processing unit is primarily responsible for parsing the received NVMe command responses and performing corresponding processing. The first exception handling module is primarily responsible for handling various exceptions during the operation of the user-space subsystem.
[0056] Specifically, the kernel-mode subsystem units are described as follows: The Second Initialization Unit primarily initializes the kernel-mode subsystem, putting it into a ready state. The Device Management Unit is primarily responsible for managing kernel-mode devices, including creating, opening, closing, and removing devices. The DMA Resource Management Unit is primarily responsible for requesting and managing the memory required for DMA transfers and NVMe queues for NVMe devices, and providing corresponding interfaces for user-mode drivers. The Interrupt Handling Unit is primarily responsible for requesting and maintaining the interrupt resources required for PCIe to initiate MSI-X interrupts. The Other Resource Management Unit is primarily responsible for requesting and releasing other PCIe hardware resources. The Second Exception Handling Unit is primarily responsible for handling various exceptions that occur during the operation of the kernel-mode subsystem.
[0057] In this embodiment, the user-mode driver subsystem obtains the call command sent by the application, generates a target verification command in the form of a logical device interface specification based on the call command, and sends the verification instruction to the kernel-mode driver subsystem. The call instruction includes verification requirement information. Specifically, the user-mode driver subsystem obtains the call command sent by the application through the command sending unit, generates a target verification command in the form of a logical device interface specification based on the call command, and sends the verification instruction to the kernel-mode driver subsystem. The call instruction includes verification requirement information.
[0058] In this embodiment, before the host loads the kernel-mode driver subsystem and performs chip prototype verification, it needs to complete the initialization to be verified, the application for interrupt resources, DMA resources, and other hardware resources, so that the device is in a state that can perform NVMe command processing. Specifically, before obtaining the call command sent by the application through the user-mode driver subsystem, the process includes: initializing the user-mode driver subsystem through the first initialization unit in the user-mode driver subsystem; initializing the kernel-mode driver subsystem and the target chip through the kernel-mode driver subsystem through the second initialization unit in the user-mode driver subsystem; applying for interrupt resources required by the target chip to initiate an interrupt through the kernel-mode driver subsystem (specifically through the interrupt handling unit in the user-mode driver subsystem), and maintaining the interrupt resources so that the target chip can send interrupt information while sending the processing result; and applying for other resources required by the target chip for command processing, excluding interrupt resources and direct memory access resources, through the kernel-mode driver subsystem through other resource management units in the user-mode driver subsystem.
[0059] In this embodiment, before the verification instruction is sent to the target chip via the kernel-mode driver subsystem based on the target direct memory access resource, the method further includes: the user-mode driver subsystem (specifically, the direct memory access resource request unit within the user-mode driver subsystem) calls the direct memory access resource management interface (provided by the direct memory access resource management unit) within the kernel-mode driver subsystem to request the target direct memory access resource for data transmission between the kernel-mode driver subsystem and the target chip, so that the verification instruction and the processing result can be transmitted between the kernel-mode driver subsystem and the target chip. It should be noted that after requesting the target direct memory access resource, the kernel-mode driver subsystem manages the target direct memory access resource, specifically through the direct memory access resource management unit within the kernel-mode driver subsystem.
[0060] In this embodiment, before obtaining the call command sent by the application through the user-mode driver subsystem, the method further includes: performing a target operation on the kernel-mode device corresponding to the kernel-mode driver subsystem through the kernel-mode driver subsystem, specifically through the device management unit in the kernel-mode driver subsystem; the target operation includes creating, opening, closing, and removing.
[0061] Step S12: The kernel-mode driver subsystem sends the verification instruction to the target chip based on the target direct memory access resource, obtains the processing result returned by the target chip based on the target direct memory access resource, and sends the obtained processing result to the user-mode driver subsystem; the processing result is the result obtained by the target chip in processing the verification instruction and sent to the kernel-mode driver subsystem; the target direct memory access resource is the resource pre-allocated for data transmission between the target chip and the kernel-mode driver subsystem.
[0062] Step S13: The user-mode driver subsystem parses the received processing result to obtain the verification result, and sends the verification result to the application for display so that chip prototype verification personnel can analyze the verification result.
[0063] In this embodiment, the step of parsing the received processing result to obtain the verification result through the user-mode driver subsystem and sending the verification result to the application for display specifically involves receiving the processing result through the command receiving unit in the user-mode driver subsystem, parsing the received processing result through the command processing unit in the user-mode driver subsystem to obtain the verification result, and sending the verification result to the application for display.
[0064] In summary, this application proposes a method for FPGA prototype verification of NVMe interface chips by designing the NVMe interface chip FPGA prototype verification module into two parts: a kernel-mode subsystem and a user-mode subsystem. The kernel-mode subsystem implements basic PCIe functions, and the user-mode subsystem implements basic NVMe functions. Specifically, the NVMe verification system is designed as follows: the kernel-mode subsystem mainly implements basic PCIe functions, and the user-mode subsystem mainly implements basic NVMe functions. When verifying the performance of the NVMe interface chip device, the user-level APP calls the user-mode subsystem, which directly sends NVMe commands to the kernel-mode subsystem. The kernel-mode subsystem then directly sends the commands to the chip under verification. This reduces the verification complexity for FPGA prototype verification personnel and shortens the FPGA prototype verification cycle. This method can significantly bring the following beneficial effects:
[0065] First, we can perform precise FPGA prototype verification by using a self-designed verification module. This allows us to directly operate the kernel subsystem through the user-mode subsystem, avoiding data optimization by kernel BIO and other functional modules. This enables us to accurately verify hardware performance and achieve the goal of FPGA prototype verification.
[0066] Secondly, the learning cost for FPGA prototype verification personnel is reduced. Since they use their own designed verification modules (systems), they are spared the process of learning the Linux kernel about complex block device driver frameworks such as BIO, which reduces the verification cost for verification personnel, can effectively shorten the verification cycle, thereby shortening the project cycle and further improving efficiency.
[0067] Third, debugging is convenient. Using the verification framework proposed in this solution, verification personnel can modify the verification code at any time, avoiding a series of time-consuming operations such as recompiling the system and restarting the computer during traditional debugging. This can effectively shorten the chip FPGA prototype verification cycle and further improve efficiency.
[0068] The beneficial effects of this application are as follows: This application obtains the call command sent by the application through the user-mode driver subsystem, generates a target verification command in the form of a logical device interface specification based on the call command, and sends the verification instruction to the kernel-mode driver subsystem; the call command includes verification requirement information; the kernel-mode driver subsystem sends the verification instruction to the target chip based on the target direct memory access resource, obtains the processing result returned by the target chip based on the target direct memory access resource, and sends the obtained processing result to the user-mode driver subsystem; the processing result is the result obtained by the target chip in processing the verification instruction and sent to the kernel-mode driver subsystem; the target direct memory access resource is a resource pre-allocated for data transmission between the target chip and the kernel-mode driver subsystem; the user-mode driver subsystem parses the received processing result to obtain the verification result, and sends the verification result to the application for display, so that chip prototype verification personnel can analyze the verification result. Therefore, this application constructs a chip verification system that includes a user-mode driver subsystem and a kernel-mode driver subsystem. The system does not involve a path through the file system and BIO framework before being sent to the driver and hardware, and does not optimize commands, thus accurately verifying chip performance. Furthermore, with this application's user-mode and kernel-mode driver subsystems, users do not need to learn the massive and complex Linux BIO architecture and its code, nor do they need to locate and modify errors. Error handling modules can be used directly, reducing user learning costs, lowering modification difficulty, and improving efficiency.
[0069] This application discloses a specific chip prototype verification method, applied to a chip verification system including a user-mode driver subsystem and a kernel-mode driver subsystem. Compared to the previous embodiment, this embodiment further explains and optimizes the technical solution. See also Figure 4 As shown, it specifically includes:
[0070] Step S21: After the user-mode driver subsystem sends the verification command to the kernel-mode driver subsystem, the user-mode driver subsystem detects in real time whether the user-mode driver subsystem has obtained the processing result within a preset time interval.
[0071] In this embodiment of the application, a detection unit can be added to the user-mode driver subsystem to detect in real time whether the user-mode driver subsystem has obtained the processing result within a preset time interval.
[0072] Step S22: If the user-mode driver subsystem detects that the user-mode driver subsystem has obtained the processing result within the preset time interval, the user-mode driver subsystem parses the received processing result to obtain the verification result, and sends the verification result to the application for display, so that the chip prototype verification personnel can analyze the verification result.
[0073] Step S23: If the user-mode driver subsystem detects that it has not obtained the processing result within the preset time interval, or has obtained abnormal information, then the abnormal situation in the kernel-mode driver subsystem is handled by the kernel-mode driver subsystem.
[0074] In this embodiment, exceptions in the kernel-mode driver subsystem are handled specifically through the second exception handling unit in the kernel-mode driver subsystem.
[0075] In this embodiment, if an abnormal situation occurs in the user-mode driver subsystem, the abnormal situation in the user-mode driver subsystem is handled through the first abnormal handling unit in the kernel-mode driver subsystem.
[0076] The beneficial effect of this application is that, after the user-mode driver subsystem sends the verification command to the kernel-mode driver subsystem, the user-mode driver subsystem continuously monitors whether it has obtained the processing result within a preset time interval. If the user-mode driver subsystem detects that it has obtained the processing result within the preset time interval, it parses the received processing result to obtain the verification result and sends the verification result to the application for display, so that chip prototype verification personnel can analyze the verification result. If the user-mode driver subsystem detects that it has not obtained the processing result within the preset time interval, or has obtained abnormal information, the kernel-mode driver subsystem handles the abnormal situation in the kernel-mode driver subsystem. Therefore, this application, by continuously monitoring whether the user-mode driver subsystem has obtained the processing result within the preset time interval, can promptly identify system problems, respond accordingly, and handle abnormal situations in a timely manner, thus improving efficiency.
[0077] Accordingly, this application also discloses a chip prototype verification device, applied to a chip verification system including a user-mode driver subsystem and a kernel-mode driver subsystem, see [link to relevant documentation]. Figure 5 As shown, the device includes:
[0078] The verification command generation module 11 is used to obtain the call command sent by the application through the user-mode driver subsystem, generate a target verification command in the form of a logical device interface specification based on the call command, and send the verification command to the kernel-mode driver subsystem; the call command includes verification requirement information;
[0079] The command and result transmission module 12 is used to send the verification instruction to the target chip through the kernel-mode driver subsystem based on the target direct memory access resource, obtain the processing result returned by the target chip based on the target direct memory access resource, and send the obtained processing result to the user-mode driver subsystem; the processing result is the result obtained by the target chip in processing the verification instruction and sent to the kernel-mode driver subsystem; the target direct memory access resource is a resource pre-allocated for data transmission between the target chip and the kernel-mode driver subsystem;
[0080] The result processing module 13 is used to parse the received processing result through the user-mode driver subsystem to obtain the verification result, and send the verification result to the application for display so that chip prototype verification personnel can analyze the verification result.
[0081] As can be seen, this application obtains the call command sent by the application through the user-mode driver subsystem, generates a target verification command in the form of a logical device interface specification based on the call command, and sends the verification command to the kernel-mode driver subsystem; the call command includes verification requirement information; the kernel-mode driver subsystem sends the verification command to the target chip based on the target direct memory access resource, obtains the processing result returned by the target chip based on the target direct memory access resource, and sends the obtained processing result to the user-mode driver subsystem; the processing result is the result obtained by the target chip in processing the verification command and sent to the kernel-mode driver subsystem; the target direct memory access resource is a resource pre-allocated for data transmission between the target chip and the kernel-mode driver subsystem; the user-mode driver subsystem parses the received processing result to obtain the verification result, and sends the verification result to the application for display, so that chip prototype verification personnel can analyze the verification result. Therefore, this application constructs a chip verification system that includes a user-mode driver subsystem and a kernel-mode driver subsystem. The system does not follow the path of passing through the file system and BIO framework before being sent to the driver and hardware. It does not optimize commands and can accurately verify chip performance. With the user-mode driver subsystem and kernel-mode driver subsystem of this application, users do not need to learn the huge and complex Linux BIO architecture and its code, nor do they need to locate and modify it when errors occur. This reduces the user's learning cost, lowers the difficulty of modification, and improves efficiency.
[0082] In one specific embodiment, the chip prototype verification device further includes:
[0083] The first initialization module is used to initialize the user-mode driver subsystem through the user-mode driver subsystem;
[0084] The second initialization module is used to initialize the kernel-mode driver subsystem and the target chip through the kernel-mode driver subsystem.
[0085] In one specific embodiment, the chip prototype verification device further includes:
[0086] The direct memory access resource request module is used to call the direct memory access resource management interface in the kernel-mode driver subsystem through the user-mode driver subsystem to request the target direct memory access resource for data transmission between the kernel-mode driver subsystem and the target chip, so that the verification instruction and the processing result can be transmitted between the kernel-mode driver subsystem and the target chip;
[0087] Accordingly, the chip prototype verification device further includes:
[0088] The direct memory access resource management module is used to manage the target direct memory access resource through the kernel-mode driver subsystem.
[0089] In one specific embodiment, the chip prototype verification device further includes:
[0090] The interrupt handling module is used to request interrupt resources required by the target chip to initiate an interrupt through the kernel-mode driver subsystem, and to maintain the interrupt resources so that the target chip sends interrupt information at the same time as sending the processing result.
[0091] In one specific embodiment, the chip prototype verification device further includes:
[0092] Other resource request modules are used to request, through the kernel-mode driver subsystem, other resources required by the target chip for command processing, excluding interrupt resources and direct memory access resources.
[0093] In one specific embodiment, the chip prototype verification device further includes:
[0094] The device management module is used to perform target operations on the kernel-mode device corresponding to the kernel-mode driver subsystem through the kernel-mode driver subsystem; the target operations include creating, opening, closing and removing.
[0095] The chip prototype verification device further includes:
[0096] The detection module is used to detect in real time whether the user-mode driver subsystem has obtained the processing result within a preset time interval after the user-mode driver subsystem sends the verification command to the kernel-mode driver subsystem;
[0097] Accordingly, the result processing module is specifically used to, if the user-mode driver subsystem detects that the user-mode driver subsystem has obtained the processing result within the preset time interval, parse the received processing result through the user-mode driver subsystem to obtain the verification result, and send the verification result to the application for display, so that chip prototype verification personnel can analyze the verification result;
[0098] Accordingly, the chip prototype verification device further includes:
[0099] A kernel-mode exception handling module is used to handle the exception situation in the kernel-mode driver subsystem if the user-mode driver subsystem detects that the user-mode driver subsystem has not obtained the processing result within the preset time interval, or has obtained exception information.
[0100] Accordingly, the chip prototype verification device further includes:
[0101] The user-mode exception handling module is used to handle exceptions in the user-mode driver subsystem through the user-mode driver subsystem.
[0102] Furthermore, embodiments of this application also provide an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0103] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a display screen 23, an input / output interface 24, a communication interface 25, a power supply 26, and a communication bus 27. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the chip prototype verification method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0104] In this embodiment, the power supply 26 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 24 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0105] Furthermore, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored thereon may include computer programs 221, and the storage method may be temporary storage or permanent storage. In addition to including computer programs capable of performing the chip prototype verification method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 221 may further include computer programs capable of performing other specific tasks.
[0106] Furthermore, embodiments of this application also disclose a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed chip prototype verification method.
[0107] The specific steps of this method can be found in the relevant content disclosed in the foregoing embodiments, and will not be repeated here.
[0108] The various embodiments in this application are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. For the same or similar parts between the various embodiments, refer to each other. As for the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and relevant parts can be referred to in the method section.
[0109] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0110] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0111] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0112] The above provides a detailed description of a chip prototype verification method, apparatus, device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A chip prototype verification method, characterized in that, Applications include chip verification systems that include user-mode driver subsystems and kernel-mode driver subsystems, including: The user-mode driver subsystem obtains the invocation command sent by the application, generates a verification instruction in the form of a logical device interface specification based on the invocation command, and sends the verification instruction to the kernel-mode driver subsystem; the invocation command includes verification requirement information; The kernel-mode driver subsystem sends the verification instruction to the target chip based on the target direct memory access resource, obtains the processing result returned by the target chip based on the target direct memory access resource, and sends the obtained processing result to the user-mode driver subsystem; the processing result is the result obtained by the target chip in processing the verification instruction and sent to the kernel-mode driver subsystem; the target direct memory access resource is the resource pre-allocated for data transmission between the target chip and the kernel-mode driver subsystem; The user-mode driver subsystem parses the received processing result to obtain the verification result, and sends the verification result to the application for display, so that chip prototype verification personnel can analyze the verification result; The chip prototype verification method further includes: After the user-mode driver subsystem sends the verification command to the kernel-mode driver subsystem, the user-mode driver subsystem detects in real time whether it has obtained the processing result within a preset time interval. Accordingly, the step of parsing the received processing result through the user-mode driver subsystem to obtain the verification result, and sending the verification result to the application for display, so that chip prototype verification personnel can analyze the verification result, includes: If the user-mode driver subsystem detects that the user-mode driver subsystem has obtained the processing result within the preset time interval, the user-mode driver subsystem parses the received processing result to obtain the verification result, and sends the verification result to the application for display, so that the chip prototype verification personnel can analyze the verification result; Accordingly, the chip prototype verification method further includes: If the user-mode driver subsystem detects that it has not obtained the processing result within the preset time interval, or has obtained abnormal information, then the abnormal situation in the kernel-mode driver subsystem is handled by the kernel-mode driver subsystem. Accordingly, the chip prototype verification method further includes: The user-mode driver subsystem handles abnormal situations within the user-mode driver subsystem.
2. The chip prototype verification method according to claim 1, characterized in that, Before obtaining the invocation command sent by the application through the user-mode driver subsystem, the method further includes: The user-mode driver subsystem is initialized through the user-mode driver subsystem; The kernel-mode driver subsystem and the target chip are initialized through the kernel-mode driver subsystem.
3. The chip prototype verification method according to claim 1, characterized in that, Before the kernel-mode driver subsystem sends the verification instruction to the target chip based on the target direct memory access resource, the process further includes: The user-mode driver subsystem calls the direct memory access resource management interface in the kernel-mode driver subsystem to request the target direct memory access resource for data transmission between the kernel-mode driver subsystem and the target chip, so that the verification instruction and the processing result can be transmitted between the kernel-mode driver subsystem and the target chip. Accordingly, the chip prototype verification method further includes: The target direct memory access resources are managed through the kernel-mode driver subsystem.
4. The chip prototype verification method according to claim 1, characterized in that, Before obtaining the invocation command sent by the application through the user-mode driver subsystem, the method further includes: The kernel-mode driver subsystem requests the interrupt resources required by the target chip to initiate an interrupt and maintains the interrupt resources so that the target chip can send interrupt information while sending the processing result.
5. The chip prototype verification method according to claim 1, characterized in that, Before obtaining the invocation command sent by the application through the user-mode driver subsystem, the method further includes: The kernel-mode driver subsystem requests the resources required by the target chip for command processing, excluding interrupt resources and direct memory access resources.
6. The chip prototype verification method according to claim 1, characterized in that, Before obtaining the invocation command sent by the application through the user-mode driver subsystem, the method further includes: Through the kernel-mode driver subsystem, target operations are performed on the kernel-mode device corresponding to the kernel-mode driver subsystem; the target operations include creating, opening, closing and removing.
7. A chip prototype verification device, characterized in that, Applications include chip verification systems that include user-mode driver subsystems and kernel-mode driver subsystems, including: The verification command generation module is used to obtain the call command sent by the application through the user-mode driver subsystem, generate a verification instruction in the form of a logical device interface specification based on the call command, and send the verification instruction to the kernel-mode driver subsystem; the call command includes verification requirement information; The command and result transmission module is used to send the verification instruction to the target chip through the kernel-mode driver subsystem based on the target direct memory access resources, obtain the processing result returned by the target chip based on the target direct memory access resources, and send the obtained processing result to the user-mode driver subsystem; the processing result is the result obtained by the target chip in processing the verification instruction and sent to the kernel-mode driver subsystem; the target direct memory access resources are resources pre-allocated for data transmission between the target chip and the kernel-mode driver subsystem; The result processing module is used to parse the received processing result through the user-mode driver subsystem to obtain the verification result, and send the verification result to the application for display so that chip prototype verification personnel can analyze the verification result; The device is further configured to, after the user-mode driver subsystem sends the verification instruction to the kernel-mode driver subsystem, detect in real time whether the user-mode driver subsystem has obtained the processing result within a preset time interval through the user-mode driver subsystem; The result processing module is used to, if the user-mode driver subsystem detects that the user-mode driver subsystem has obtained the processing result within the preset time interval, parse the received processing result through the user-mode driver subsystem to obtain the verification result, and send the verification result to the application for display so that chip prototype verification personnel can analyze the verification result; The device is further configured to handle the abnormal situation in the kernel-mode driver subsystem if the user-mode driver subsystem detects that the user-mode driver subsystem has not obtained the processing result within the preset time interval, or has obtained abnormal information; The device is also used to handle abnormal situations in the user-mode driving subsystem through the user-mode driving subsystem.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the chip prototype verification method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Used to store a computer program; wherein, when the computer program is executed by a processor, it implements the chip prototype verification method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Data communication method and device, electronic equipment and readable storage medium
CN113849238A
File exporting method and system for FPGA prototype verification system
CN114757134A
