Firmware problem positioning method and device of chip, equipment and storage medium

By converting the original excitation file of the chip into a compileable data structure and generating binary test files, the problem of test excitation automation adjustment in chip firmware development is solved, and the speed of firmware problem positioning and analysis is improved.

CN118917260APending Publication Date: 2024-11-08SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411124311.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

During the chip firmware development process, automated adjustment of test incentives is difficult to achieve, resulting in chip verification taking time and the hardware acceleration simulation platform cannot be used directly. Manual compilation and adjustment are required, affecting the speed of positioning analysis.

Method used

By obtaining the original excitation file of the chip to be verified, converting its text content into a compileable data structure in a preset data format, replacing it with the content of the target element, generating a binary test file, and downloading it to the chip to trigger execution, obtaining a firmware problem verification report .

Benefits of technology

It realizes automatic adjustment of test excitation and automatic adaptation of chip operating environment, significantly improving the positioning and analysis speed of firmware problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118917260A_ABST
    Figure CN118917260A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware problem positioning method and device for a chip, equipment and a storage medium, and relates to the technical field of chip development, and the method comprises the steps: obtaining an original excitation file of a to-be-verified chip; converting text content in the original excitation file into a compilable data structure in a preset data format; replacing element content at a preset position in the compilable data structure with target element content to obtain a target data structure; generating a binary test file according to the target data structure and a preset programming template, and downloading the binary test file to the to-be-verified chip; triggering the to-be-verified chip to execute the binary test file to obtain a firmware problem verification report corresponding to the original excitation file; according to the method, the test excitation for reproducing the problem is converted into the data structure which can be recognized by the compiler, so that the test excitation can be adjusted and converted into the binary file which can be recognized by the chip, the automatic adaptation of the chip operation environment is realized, and the positioning analysis speed of the firmware problem is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip development technology, and in particular to a method, device, equipment and storage medium for locating firmware problems of a chip. Background Art

[0002] In the complete chip development process, in addition to hardware circuit design, it also includes chip firmware development. The chip firmware code is usually used to program control and manage the functions and behaviors of the chip. It works with the hardware circuit to ensure that the chip can operate normally and meet the design requirements. Chip verification is part of chip design. In addition to testing the hardware circuit function, chip verification also needs to locate the problems encountered in firmware development.

[0003] Since firmware development is done by an independent team, when outputs that do not match the chip design are found during firmware development, the chip verification team needs to locate and analyze the problem. The location analysis process requires reproducing the problem, but when reproducing the problem, the firmware test stimulus cannot be used directly, and it is difficult to adapt to the hardware acceleration simulation platform. Manual compilation and adjustment of the test stimulus are required, which makes chip verification very time-consuming. Therefore, how to achieve automatic adjustment of the test stimulus to automatically adapt to the chip's operating environment and improve the location analysis speed of chip firmware problems is an urgent problem that needs to be solved today. Summary of the invention

[0004] The purpose of the present invention is to provide a method, device, equipment and computer-readable storage medium for locating firmware problems of a chip, so as to realize automatic adjustment of test stimuli, automatically adapt to the operating environment of the chip, and improve the location and analysis speed of chip firmware problems.

[0005] In order to solve the above technical problems, the present invention provides a method for locating firmware problems of a chip, comprising:

[0006] Obtaining an original stimulus file of the chip to be verified; wherein the original stimulus file includes memory data when the firmware of the chip to be verified triggers a problem;

[0007] Converting the text content in the original stimulus file into a compilable data structure in a preset data format;

[0008] Replacing the element content at a preset position in the compilable data structure with the target element content to obtain a target data structure; wherein the target element content includes operating environment memory information;

[0009] Generate a binary test file according to the target data structure and a preset programming template, and download the binary test file to the chip to be verified;

[0010] The chip to be verified is triggered to execute the binary test file to obtain a firmware problem verification report corresponding to the original stimulus file.

[0011] On the other hand, the data structure of the compilable data structure is an array, and the converting of the text content in the original stimulus file into the compilable data structure in a preset data format includes:

[0012] Identify and segment the text content in the original stimulus file to obtain a segmentation array in a preset segmentation format;

[0013] The element contents in the segmented array are converted into the preset data format to obtain the compilable data structure.

[0014] On the other hand, the format of the text content in the original incentive file is hexadecimal, and each line of the original incentive file stores 4 bytes of text content; the content of each element in the segmentation array is 32 bits, and the preset data format is hexadecimal.

[0015] On the other hand, generating a binary test file according to the target data structure and a preset programming template includes:

[0016] Generate a test stimulus code according to the target data structure and the target programming template; wherein the target programming template is any preset programming template, different preset programming templates use different programming languages, and the element content in the target data structure in the test stimulus code is written to the target position, and the target position includes the position of the chip memory address corresponding to the original stimulus file;

[0017] According to the test stimulus code, the binary test file is generated using a compilation framework corresponding to the target programming template; wherein the compilation framework and the target programming template use the same programming language.

[0018] On the other hand, triggering the chip to be verified to execute the binary test file to obtain a firmware problem verification report corresponding to the original stimulus file includes:

[0019] The chip memory address corresponding to the target data structure is written into the chip to be verified, so as to trigger the chip to be verified to read the content in the chip memory address to verify the firmware problem.

[0020] In another aspect, the method further comprises:

[0021] Obtain a firmware configuration file and a chip configuration file; wherein the firmware configuration file includes chip configuration parameters when the firmware of the chip to be verified triggers a problem, and the chip configuration file includes preset chip configuration parameters;

[0022] Classify the module operations in the firmware configuration file and the chip configuration file according to the preset module memory address range to obtain the module operations corresponding to each module in the chip to be verified; wherein the module operations are configuration operations performed on the modules;

[0023] The module operations of the firmware configuration files corresponding to the modules are respectively compared with the module operations of the chip configuration files to obtain a differential comparison report.

[0024] On the other hand, the comparing the module operations of the firmware configuration files corresponding to the modules with the module operations of the chip configuration files to obtain a differentiated comparison report includes:

[0025] Identify the module operation of the current memory address corresponding to the current module in the firmware configuration file and the module operation of the current memory address corresponding to the current module in the chip configuration file; wherein the current module is any of the modules, and the current memory address is any memory address within the preset module memory address range corresponding to the current module;

[0026] If the current module operation exists in the firmware configuration file, determine whether the current module operation exists in the module operation of the current memory address corresponding to the current module in the chip configuration file; wherein the current module operation is any module operation in the module operation of the current memory address corresponding to the current module in the firmware configuration file;

[0027] If the current module operation does not exist, determine whether there is a similar module operation corresponding to the current module operation in the module operation of the current memory address corresponding to the current module in the chip configuration file; wherein the similar module operation and the current module operation can both configure the current module to implement the same function;

[0028] If the same type of module operation does not exist, generating error configuration information corresponding to the current module operation; wherein the difference comparison report includes the error configuration information;

[0029] If the current module operation or the same type of module operation exists, it is determined that the current module operation is not an incorrect configuration.

[0030] The present invention also provides a device for locating firmware problems of a chip, comprising:

[0031] An acquisition unit, used to acquire an original stimulus file of the chip to be verified; wherein the original stimulus file includes memory data when the firmware of the chip to be verified triggers a problem;

[0032] A stimulus generating unit, used for converting the text content in the original stimulus file into a compilable data structure in a preset data format;

[0033] The stimulus adaptation unit is used to replace the element content at a preset position in the compilable data structure with the target element content to obtain a target data structure; wherein the target element content includes the operating environment memory information;

[0034] A compiling and generating unit, used for generating a binary test file according to the target data structure and a preset programming template, and downloading the binary test file to the chip to be verified;

[0035] The stimulus issuing unit is used to trigger the chip to be verified to execute the binary test file to obtain a firmware problem verification report corresponding to the original stimulus file.

[0036] The present invention also provides a device for locating firmware problems of a chip, comprising:

[0037] Memory for storing computer programs;

[0038] The processor is used to implement the steps of the method for locating firmware problems of a chip as described above when executing the computer program.

[0039] In addition, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for locating firmware problems of a chip as described above are implemented.

[0040] A method for locating a firmware problem of a chip provided by the present invention comprises: obtaining an original stimulus file of a chip to be verified; wherein the original stimulus file comprises memory data when the firmware of the chip to be verified triggers a problem; converting text content in the original stimulus file into a compilable data structure in a preset data format; replacing element content at a preset position in the compilable data structure with target element content to obtain a target data structure; wherein the target element content comprises operating environment memory information; generating a binary test file according to the target data structure and a preset programming template, and downloading the binary test file to the chip to be verified; triggering the chip to be verified to execute the binary test file, and obtaining a firmware problem verification report corresponding to the original stimulus file;

[0041] It can be seen that the present invention can convert the test stimulus of the recurring problem into a compilable data structure recognizable by the compiler by converting the text content in the original stimulus file into a compilable data structure in a preset data format, so that the test stimulus can be automatically adjusted and converted into a binary file recognizable by the chip, realizing automatic adaptation of the chip operating environment and improving the location and analysis speed of chip firmware problems. In addition, the present invention also provides a chip firmware problem location device, equipment and computer-readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] Figure 1 A flowchart of a method for locating a firmware problem of a chip provided by an embodiment of the present invention;

[0044] Figure 2 A schematic diagram of the system structure of another chip firmware problem locating method provided by an embodiment of the present invention;

[0045] Figure 3 for Figure 2 A schematic diagram of the structure of the excitation device shown;

[0046] Figure 4 for Figure 2 The structural schematic diagram of the test device shown;

[0047] Figure 5 A schematic diagram of a system operation flow of another chip firmware problem locating method provided by an embodiment of the present invention;

[0048] Figure 6 A flowchart of another chip firmware problem locating method provided by an embodiment of the present invention;

[0049] Figure 7 A structural block diagram of a device for locating firmware problems of a chip provided by an embodiment of the present invention;

[0050] Figure 8 A simplified structural diagram of a device for locating firmware problems of a chip provided by an embodiment of the present invention;

[0051] Fig. 9 A schematic diagram of the specific structure of a device for locating firmware problems of a chip provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] Please refer to Figure 1 , Figure 1 A flowchart of a method for locating a firmware problem of a chip provided by an embodiment of the present invention. The method may include:

[0054] Step 101: Obtain an original stimulus file of the chip to be verified; wherein the original stimulus file includes memory data when the firmware of the chip to be verified triggers a problem.

[0055] It is understandable that the chip to be verified in this embodiment may be a chip that needs to be analyzed for firmware issues, such as a chip whose firmware triggers an issue during a previous chip test. The firmware of a chip is usually a program code between hardware and software that is used to control and manage the functions and behaviors of the chip.

[0056] Accordingly, this embodiment does not limit the specific chip type of the chip to be verified. For example, the chip to be verified may be a storage management chip, such as a disk array (Redundant Arrays of Independent Disks, RAID) management chip, or other chips; the chip to be verified may also be other chips, such as a charging management chip or a BMC (Baseboard Management Controller) chip, etc.

[0057] Correspondingly, the original stimulus file in this embodiment can be the valid memory data of the firmware of the chip to be verified when the problem is triggered, such as the data of the operations performed on the memory address in the chip to be verified (i.e., the chip memory address) monitored when the firmware triggers the problem during the chip testing process of the chip to be verified, such as the data required for the test written to the memory address.

[0058] Among them, this embodiment does not limit the specific content of the original stimulus file. For example, due to the particularity of the prototype verification platform of the chip design, the memory data of the chip cannot be directly exported from the chip, and the data in the chip memory needs to be stored in text form. That is, in this embodiment, the original stimulus file can store the memory data (that is, text content) written into the memory in text form; for example, the format of the text content in the original stimulus file can be hexadecimal, and each line in the original stimulus file stores 4 bytes of text content, for example, the first line is 000AF8C1, and the second line is 000AF8C2; the format of the text content in the original stimulus file can also be other formats such as 32-decimal.

[0059] Correspondingly, in the process of reproducing the problem of chip verification in this embodiment, the memory data in text form cannot be directly imported into the memory of the chip to be verified; therefore, Figure 2 and Figure 3As shown, in this embodiment, the stimulus device is used to adjust and convert the original stimulus file (ie, the test stimulus) into a Bin file (binary file) recognizable by the chip, thereby realizing automatic adaptation, modification and conversion of the original stimulus file.

[0060] It should be noted that the specific method of obtaining the original stimulus file of the chip to be verified in this embodiment can be set by the designer according to the practical scenario and user needs. For example, the processor can directly receive the original stimulus file of the chip to be verified input by the user; for example, the user can operate the prototype verification platform to input the original stimulus file of the chip to be verified, so that the processor can directly receive the original stimulus file input by the user. The processor can also monitor the memory data written into the memory of the chip to be verified during the test process; when a firmware trigger problem is detected, the original stimulus file is generated using the currently monitored memory data. As long as the processor can obtain the original stimulus file of the chip to be verified for use in the chip verification problem reproduction process in this embodiment, this embodiment does not impose any restrictions on this.

[0061] Step 102: Convert the text content in the original stimulus file into a compilable data structure in a preset data format.

[0062] It is understandable that in this step, the processor can convert the text content in the original incentive file into a data structure (i.e., a compilable data structure) that can be recognized and compiled by the compiler in a preset data format to facilitate subsequent content modification and code compilation.

[0063] Correspondingly, for the specific data structure of the compilable data structure, it can be set by the designer according to the practical scenario and user needs. For example, the data structure of the compilable data structure can be an array or other data structure such as a list. As long as the compilable data structure can be recognized and compiled by the compiler, this embodiment does not impose any restrictions on this. Similarly, this embodiment does not limit the specific format type of the preset data format. For example, the preset data format can be hexadecimal or 32-decimal.

[0064] Accordingly, the specific way in which the processor converts the text content in the original incentive file into a compilable data structure in a preset data format in this step can be set by the designer according to practical scenarios and user needs. For example, when the data structure of the compilable data structure is an array, the processor can identify and segment the text content in the original incentive file to obtain a segmented array; and convert the element content in the segmented array into a preset data format to obtain a compilable data structure. For example, the format of the text content in the original incentive file is hexadecimal, and each line in the original incentive file stores 4 bytes of text content. The content of each element in the segmented array is 32 bits. When the preset data format is hexadecimal, Figure 3 and Figure 5 As shown, the processor can use the stimulus generation unit to read the text content of the original stimulus file, segment it, generate an array in the form of 32-bit array elements (i.e., segment the array), and modify the array elements to a hexadecimal data format recognizable by the compiler, such as 0x000AF8C1 and 0x000AF8C2, to obtain a compilable data structure (i.e., a compilable array). The processor can also directly segment the text content in the original stimulus file to obtain a compilable data structure in a preset data format, and this embodiment does not impose any restrictions on this.

[0065] Step 103: Replace the element content at a preset position in the compilable data structure with the target element content to obtain a target data structure; wherein the target element content includes the operating environment memory information.

[0066] It is understandable that in this step, the processor can replace the element content at a preset position in the compilable data structure to achieve dynamic modification of specific content in the test stimulus, so that the modified test stimulus can fully match the current chip verification process.

[0067] Among them, the preset position in this embodiment can be a pre-set position where element content needs to be replaced, such as a position in the compilable data structure used to store the operating environment memory information during the test; accordingly, the target element content in this embodiment can be the element content that needs to be replaced to the preset position, such as the current operating environment memory information of the chip to be verified. For example, since the chip to be verified is deployed on a server, when performing SOC (system on chip) verification, the resources required for the test stimulus include chip internal resources and chip external resources. The chip external resources are related to the operating environment (i.e., the server) where the chip is deployed. For example, the test stimulus requires a memory address on the server side, but the memory address on the server side changes each time the test stimulus is executed; therefore, in this step, the processor can directly apply for the memory address of the server memory space (i.e., the operating environment memory information), and replace the memory address with the element content of the corresponding preset position in the compilable data structure, such as Figure 3 and Figure 5 As shown, assuming that the memory space address is 0xAAAABBBB, the 20th element of the compilable data structure stores the previous server memory information. The corresponding element content can be replaced with 0xAAAABBBB through the stimulus adaptation unit to achieve adaptive modification of the test stimulus.

[0068] Correspondingly, this embodiment does not limit the specific location setting of the preset position. For example, the preset position may include the location of the operating environment memory information (such as the memory address); it may also include any other location that needs to be modified to ensure that the modified test stimulus can fully match the current chip verification process.

[0069] Step 104: Generate a binary test file according to the target data structure and the preset programming template, and download the binary test file to the chip to be verified.

[0070] It can be understood that the preset programming template in this embodiment can be a template that is pre-set and uses a programming language to verify the memory data of the target data structure, so that the processor can write the element content in the target data structure to the position in the template corresponding to the corresponding chip memory address in the chip to be verified, thereby generating a corresponding binary file (i.e., a binary test file), so that after the binary test file is downloaded to the chip to be verified, the element content in the target data structure can be written to the corresponding chip memory address in the chip to be verified. For example, the target data structure has 100 elements, and the chip memory address corresponding to the original stimulus file is 0x43000000. The binary test file generated by the target data structure will write the first element to 0x43000000, the second element to 0x43000004, the third element to 0x43000008, and so on.

[0071] Correspondingly, the specific method of generating a binary test file according to the target data structure and the preset programming template in this step can be set by the designer according to the practical scenario and user needs. For example, the processor can generate a test stimulus code according to the target data structure and the target programming template; according to the test stimulus code, a binary test file is generated using the compilation framework corresponding to the target programming template; wherein the target programming template is any preset programming template, and different preset programming templates use different programming languages, and the element content in the target data structure in the test stimulus code is written to the target position, and the target position includes the position of the chip memory address corresponding to the original stimulus file; the compilation framework and the target programming template use the same programming language.

[0072] For example, when the number of preset programming templates is greater than 1, such as Figure 3 and Figure 5As shown, preset programming templates of different programming languages ​​can be preset in the code generation unit, such as preset programming templates of programming languages ​​such as C language, C++ (a programming language) and Rust (a programming language). The processor can use the code generation unit to select a preset programming template (i.e., a target programming template) from the preset programming templates of different programming languages, call the target data structure in the preset programming template, and write the element content in the target data structure to the position (i.e., the target position) corresponding to the specified memory address in the template (i.e., the chip memory address corresponding to the original stimulus file), thereby generating a test stimulus code of a programming language.

[0073] Moreover, since the data of the chip operation is a binary file, after the test stimulus code is generated by the code generation unit, it needs to be compiled into a binary code that can be recognized by the chip; and a complete verification system has more than just the above-mentioned test stimulus code. The processor can use the compilation unit to add the test stimulus code to the original compilation framework, that is, according to the different programming languages, select the corresponding compilation framework, generate the compilation options of the test stimulus code in the compilation framework, and generate the compilation command to automatically execute the compilation, so as to obtain the binary test file corresponding to the compilation framework containing the test stimulus code; that is, the selected compilation framework and the selected preset programming template use the same programming language.

[0074] Correspondingly, the number of preset programming templates can also be 1, that is, the processor can generate a test stimulus code based on the target data structure and the preset programming template; based on the test stimulus code, a binary test file is generated using a preset compilation framework; the preset programming template and the compilation framework can use the same programming language.

[0075] Among them, this embodiment does not limit the specific method of downloading the binary test file to the chip to be verified. For example, the binary test file can be downloaded to the chip to be verified through serial communication; the binary test file can also be downloaded to the chip to be verified through SPI (Serial Peripheral Interface) communication or other communication methods.

[0076] Step 105: trigger the chip to be verified to execute the binary test file to obtain a firmware problem verification report corresponding to the original stimulus file.

[0077] It can be understood that in this embodiment, after the binary test file is downloaded to the chip to be verified, a trigger operation can also be performed to trigger the chip to be verified to execute the binary test file, start the execution of the test stimulus (such as the above-mentioned test stimulus code), obtain the firmware problem verification report corresponding to the original stimulus file, and complete the recovery of the firmware problem corresponding to the original stimulus file.

[0078] Correspondingly, the specific content of the firmware problem verification report corresponding to the original stimulus file in this step can be set by the designer according to practical scenarios and user needs. For example, the firmware problem verification report can be a log, such as a chip log during or after the execution of the above-mentioned test stimulus code, to detect whether the firmware problem occurs again; it can also be memory data in text form, such as the memory data written into the memory of the chip to be verified monitored during the execution of the above-mentioned test stimulus code, to compare with the original stimulus file. This embodiment does not impose any restrictions on this.

[0079] Among them, the specific method of triggering the chip to be verified to execute the binary test file in this step can be set by the designer, such as the processor writes the chip memory address corresponding to the target data structure to the chip to be verified, so as to trigger the chip to be verified to read the content in the chip memory address to verify the firmware problem; for example, the processor can write the target data structure to the chip to be verified at the chip memory address of the chip to be verified (such as the above 0x43000000), so that after the chip to be verified detects the write action of the chip memory address, it will read the content in the memory of the chip memory address to verify the firmware problem, so that the processor can obtain the firmware problem verification report corresponding to the original stimulus file; Figure 3 and Figure 5 The triggering incentive process of the incentive sending unit is utilized.

[0080] In this embodiment, the embodiment of the present invention can convert the test stimulus for reproducing the problem into a compilable data structure recognizable by the compiler by converting the text content in the original stimulus file into a compilable data structure in a preset data format, thereby being able to automatically adjust the test stimulus and convert it into a binary file recognizable by the chip, thereby achieving automatic adaptation of the chip operating environment and improving the speed of locating and analyzing chip firmware problems.

[0081] Based on the above embodiment, the present invention also provides another method for locating firmware problems of a chip, so as to realize the classification and comparison of configuration errors, thereby quickly locating the module with errors in the chip. Figure 6 , Figure 6 A flowchart of another method for locating a firmware problem of a chip provided by an embodiment of the present invention. The method may include:

[0082] Step 201: Obtain a firmware configuration file and a chip configuration file; wherein the firmware configuration file includes chip configuration parameters when the firmware of the chip to be verified triggers a problem, and the chip configuration file includes preset chip configuration parameters.

[0083] It can be understood that the firmware configuration file in this embodiment may include chip configuration parameters of the firmware of the chip to be verified when the problem is triggered, such as the operations performed on the memory of the chip to be verified that are monitored and recorded during the initialization process of the chip test in which the firmware of the chip to be verified triggers the problem (i.e., chip configuration parameters); the chip configuration file in this embodiment may include preset chip configuration parameters, such as the operations performed on the memory of the chip to be verified during the initialization process of the chip to be verified that are preset; for example, the operations performed on the memory of the chip to be verified that are monitored and recorded during the initialization process of the chip verification of the chip to be verified this time (such as Figure 5 For example, before issuing the test stimulus in step 105 in the above embodiment, the processor can use the control chip to run the chip configuration code, and the running configuration process of the chip configuration code can be an operation of writing corresponding memory data to different memory addresses (i.e., chip memory addresses) in the chip to be verified, such as Figure 4 and Figure 5 As shown, the processor can use the configuration collection unit to monitor the entire configuration process, record the operation of the memory during the chip initialization process (i.e., preset chip configuration parameters), and obtain the chip configuration file to compare the chip configuration file with the firmware configuration file.

[0084] Correspondingly, the processor can also monitor the entire test process during the chip test before the chip to be verified. When a firmware triggering problem of the chip to be verified is detected, the processor generates a firmware configuration file using the operations on the memory during the recorded initialization process (i.e., chip configuration parameters), generates an original stimulus file using the recorded valid memory data of the firmware when the problem is triggered, and triggers the chip verification instruction to perform the adaptive adjustment execution process of the test stimulus in the previous embodiment, verify the design errors, and perform the classification and comparison process of the configuration errors in this embodiment to verify the configuration errors; thereby realizing automatic chip verification after the firmware triggering problem during chip testing to further meet user needs.

[0085] That is to say, for quickly locating firmware problems in chip verification, the problem can be divided into configuration errors and hardware design errors. Configuration errors can be classified and compared through the method provided in this embodiment, and the differences can be found and checked item by item; design errors can be executed through the method provided in the previous embodiment. Test stimulus for firmware and analysis of test results.

[0086] Step 202: Classify the module operations in the firmware configuration file and the chip configuration file according to the preset module memory address range to obtain the module operations corresponding to each module in the chip to be verified; wherein the module operations are configuration operations performed on the modules.

[0087] It is understandable that, since the chip to be verified includes multiple modules, which together constitute the hardware circuit, the address space of each module will be divided during the design process. For example, assuming that the chip has 10 modules, namely A to J, each module is allocated 1M space, the memory address corresponding to A is 0x00000000-0x000FFFFF, and the memory address corresponding to B is 0x00100000-0x0x001FFFFF, and this is inferred internally; and when the chip is configured, each module configuration code calls each other, resulting in a discontinuous memory operation sequence, and it is not convenient to view the operation of each module. Therefore, in this embodiment, the operation of the module can be classified according to the different memory addresses, such as classifying the operation between the address range of 0x00000000-0x000FFFFF into the A module, and the operation between 0x00100000-0x0x001FFFFF into the B module.

[0088] Accordingly, the preset module memory address range in this embodiment can be a preset memory address range corresponding to each module in the chip to be verified. In this step, the processor can classify the configuration operations (i.e., module operations) of each module in the firmware configuration file and the chip configuration file according to the preset module memory address range, and obtain the module operations of each module in the firmware configuration file and the module operations in the chip configuration file, so as to facilitate subsequent classification comparison; Figure 4 and Figure 5 As shown, the processor can utilize the classification detection unit to take the received firmware configuration file and chip configuration file as input, classify the operations of each module according to the different memory addresses, perform module classification comparison, and finally output a differentiated comparison report based on module classification.

[0089] Step 203: Compare the module operations of the firmware configuration files corresponding to each module with the module operations of the chip configuration files to obtain a differential comparison report.

[0090] Among them, in this step, the processor can perform differential comparison on the module operations of the firmware configuration files corresponding to each module and the module operations of the chip configuration files, find inconsistent module operations, generate corresponding differential comparison reports, and realize rapid positioning of error modules.

[0091] Correspondingly, in this step, the module operations of the firmware configuration files corresponding to each module are compared with the module operations of the chip configuration files to obtain the specific method of differential comparison report, which can be set by the designer according to practical scenarios and user needs. For example, the processor can directly determine the inconsistent module operations corresponding to the same module in the firmware configuration file and the chip configuration file as incorrect configurations, and generate incorrect configuration information corresponding to the inconsistent module operations in the differential comparison report. Since the configuration of some functions in the chip is not unique, such as configuring the address 0x000FFFFF as 0x1 or 0x2, etc. can achieve the same function, such differences obtained by classification and comparison can be determined as not incorrect configurations, so as to automatically exclude non-erroneous differential configurations and improve the accuracy of locating the error module.

[0092] For example, the processor can identify the module operation of the current memory address corresponding to the current module in the firmware configuration file and the module operation of the current memory address corresponding to the current module in the chip configuration file; wherein, the current module is any module, and the current memory address is any memory address within the preset module memory address range corresponding to the current module; if the current module operation exists in the firmware configuration file, then it is determined whether the current module operation exists in the module operation of the current memory address corresponding to the current module in the chip configuration file; wherein, the current module operation is any module operation among the module operations of the current memory address corresponding to the current module in the firmware configuration file; if there is no current module operation, then it is determined whether there is a similar module operation corresponding to the current module operation in the module operation of the current memory address corresponding to the current module in the chip configuration file; wherein, the similar module operation and the current module operation can both configure the current module to implement the same function; if there is no similar module operation, then the error configuration information corresponding to the current module operation is generated; wherein, the differential comparison report includes the error configuration information; if the current module operation or the similar module operation exists, then it is determined that the current module operation is not an error configuration, and the comparison of the next module operation can continue until all module operations corresponding to all modules are compared.

[0093] In this embodiment, the embodiment of the present invention classifies the module operations in the firmware configuration file and the chip configuration file according to the preset module memory address range, obtains the module operations corresponding to each module in the chip to be verified, and can use classification comparison to quickly locate the erroneous module, thereby improving the locating speed of configuration errors.

[0094] Corresponding to the above method embodiment, an embodiment of the present invention further provides a device for locating a firmware problem of a chip. The device for locating a firmware problem of a chip described below and the method for locating a firmware problem of a chip described above can refer to each other.

[0095] Please refer to Figure 7 , Figure 7 This is a structural block diagram of a device for locating firmware problems of a chip provided by an embodiment of the present invention. The device may include:

[0096] The acquisition unit 10 is used to acquire the original stimulus file of the chip to be verified; wherein the original stimulus file includes the memory data when the firmware of the chip to be verified triggers the problem;

[0097] The stimulus generating unit 20 is used to convert the text content in the original stimulus file into a compilable data structure in a preset data format;

[0098] The stimulus adaptation unit 30 is used to replace the element content at a preset position in the compilable data structure with the target element content to obtain a target data structure; wherein the target element content includes the operating environment memory information;

[0099] A compiling and generating unit 40 is used to generate a binary test file according to a target data structure and a preset programming template, and download the binary test file to the chip to be verified;

[0100] The stimulus issuing unit 50 is used to trigger the chip to be verified to execute the binary test file and obtain a firmware problem verification report corresponding to the original stimulus file.

[0101] In some embodiments, the stimulus generating unit 20 may include:

[0102] The segmentation subunit is used to segment the text content in the original stimulus file to obtain a segmentation array in a preset segmentation format;

[0103] The conversion subunit is used to convert the element content in the segmented array into a preset data format to obtain a compilable data structure.

[0104] In some embodiments, the format of the text content in the original incentive file is hexadecimal, and each line in the original incentive file stores 4 bytes of text content; the content of each element in the segmentation array is 32 bits, and the preset data format is hexadecimal.

[0105] In some embodiments, the compilation generation unit 40 may include:

[0106] A code generation subunit is used to generate a test stimulus code according to a target data structure and a target programming template; wherein the target programming template is any preset programming template, and different preset programming templates use different programming languages. The element content in the target data structure in the test stimulus code is written to a target location, and the target location includes the location of the chip memory address corresponding to the original stimulus file;

[0107] The compiling subunit is used to generate a binary test file according to the test stimulus code by using the compiling framework corresponding to the target programming template; wherein the compiling framework and the target programming template adopt the same programming language.

[0108] In some embodiments, the incentive issuing unit 50 may include:

[0109] The trigger subunit is used to write the chip memory address corresponding to the target data structure into the chip to be verified, so as to trigger the chip to be verified to read the content in the chip memory address to verify the firmware problem.

[0110] In some embodiments, the apparatus may further include:

[0111] A configuration collection unit is used to obtain a firmware configuration file and a chip configuration file; wherein the firmware configuration file includes chip configuration parameters when the firmware of the chip to be verified triggers a problem, and the chip configuration file includes preset chip configuration parameters;

[0112] A classification unit, used to classify the module operations in the firmware configuration file and the chip configuration file according to the preset module memory address range, and obtain the module operations corresponding to each module in the chip to be verified; wherein the module operation is a configuration operation performed on the module;

[0113] The comparison unit is used to compare the module operation of the firmware configuration file corresponding to each module with the module operation of the chip configuration file to obtain a differentiated comparison report.

[0114] In some embodiments, the comparison unit may include:

[0115] An identification subunit, used to identify the module operation of the current memory address corresponding to the current module in the firmware configuration file and the module operation of the current memory address corresponding to the current module in the chip configuration file; wherein the current module is any module, and the current memory address is any memory address within the preset module memory address range corresponding to the current module;

[0116] A first judgment subunit is used to judge whether there is a current module operation in the module operation of the current memory address corresponding to the current module in the chip configuration file if there is a current module operation in the firmware configuration file; wherein the current module operation is any module operation in the module operation of the current memory address corresponding to the current module in the firmware configuration file;

[0117] The second judgment subunit is used to judge whether there is a similar module operation corresponding to the current module operation in the module operation of the current memory address corresponding to the current module in the chip configuration file if there is no current module operation; wherein the similar module operation and the current module operation can both configure the current module to implement the same function;

[0118] A generating subunit, for generating error configuration information corresponding to the current module operation if there is no similar module operation; wherein the difference comparison report includes the error configuration information;

[0119] The determination subunit is used to determine whether the current module operation is an incorrect configuration if the current module operation or a similar module operation exists.

[0120] In this embodiment, the embodiment of the present invention converts the text content in the original stimulus file into a compilable data structure in a preset data format through the stimulus generation unit 20, and can convert the test stimulus of the reproduction problem into a compilable data structure recognizable by the compiler, so that the test stimulus can be automatically adjusted and converted into a binary file recognizable by the chip, thereby realizing automatic adaptation of the chip operating environment and improving the speed of locating and analyzing chip firmware problems.

[0121] Corresponding to the above method embodiment, an embodiment of the present invention further provides a device for locating a firmware problem of a chip. The device for locating a firmware problem of a chip described below and the method for locating a firmware problem of a chip described above can refer to each other.

[0122] Please refer to Figure 8 , Figure 8 A simplified structural diagram of a device for locating a firmware problem of a chip provided by an embodiment of the present invention. The device for locating a firmware problem may include:

[0123] A memory D1, for storing computer programs;

[0124] The processor D2 is used to implement the steps of the chip firmware problem locating method provided by the above method embodiment when executing a computer program.

[0125] For details, please refer to Fig. 9 , Fig. 9A schematic diagram of the specific structure of a firmware problem location device for a chip provided by an embodiment of the present invention. The firmware problem location device 310 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 322 (for example, one or more processors) and a memory 332, and one or more storage media 330 (for example, one or more mass storage devices) storing application programs 342 or data 344. Among them, the memory 332 and the storage medium 330 can be short-term storage or permanent storage. The program stored in the storage medium 330 may include one or more units (not shown in the figure), and each unit may include a series of instruction operations in the data processing device. Furthermore, the central processor 322 can be configured to communicate with the storage medium 330 to execute a series of instruction operations in the storage medium 330 on the firmware problem location device.

[0126] The firmware problem locating device 310 may further include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input and output interfaces 358, and / or one or more operating systems 341. For example, Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0127] The firmware problem locating device 310 provided in this embodiment may be specifically a device for performing chip verification on the deployed chip to be verified, such as a computer or a server; for example, a server running a hardware acceleration simulation platform and / or a prototype verification platform.

[0128] The steps in the chip firmware problem locating method described above can be implemented by the structure of a chip firmware problem locating device.

[0129] Corresponding to the above method embodiment, the embodiment of the present invention further provides a computer program product. The computer program product described below and the method for locating a firmware problem of a chip described above can be referred to each other.

[0130] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of the method for locating a firmware problem of a chip provided in the above method embodiment.

[0131] Corresponding to the above method embodiment, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium described below and the method for locating a firmware problem of a chip described above can refer to each other.

[0132] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the device method for locating a firmware problem of a chip in the above method embodiment.

[0133] The computer-readable storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which can store program codes.

[0134] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the devices, equipment, computer program products and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0135] The above is a detailed introduction to the firmware problem locating method, device, equipment and storage medium of a chip provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A method for locating a firmware problem of a chip, characterized in that: include: Obtaining an original stimulus file of the chip to be verified; wherein the original stimulus file includes memory data when the firmware of the chip to be verified triggers a problem; Converting the text content in the original stimulus file into a compilable data structure in a preset data format; Replacing the element content at a preset position in the compilable data structure with the target element content to obtain a target data structure; wherein the target element content includes operating environment memory information; Generate a binary test file according to the target data structure and a preset programming template, and download the binary test file to the chip to be verified; The chip to be verified is triggered to execute the binary test file to obtain a firmware problem verification report corresponding to the original stimulus file.

2. The method for locating a firmware problem of a chip according to claim 1, characterized in that: The data structure of the compilable data structure is an array, and the converting of the text content in the original stimulus file into the compilable data structure in a preset data format includes: Identify and segment the text content in the original stimulus file to obtain a segmentation array; The element contents in the segmented array are converted into the preset data format to obtain the compilable data structure.

3. The method for locating a firmware problem of a chip according to claim 2, characterized in that: The format of the text content in the original incentive file is hexadecimal, and each line in the original incentive file stores 4 bytes of text content; the content of each element in the segmentation array is 32 bits, and the preset data format is hexadecimal.

4. The method for locating a firmware problem of a chip according to claim 1, characterized in that: The step of generating a binary test file according to the target data structure and the preset programming template includes: Generate a test stimulus code according to the target data structure and the target programming template; wherein the target programming template is any preset programming template, different preset programming templates use different programming languages, and the element content in the target data structure in the test stimulus code is written to the target position, and the target position includes the position of the chip memory address corresponding to the original stimulus file; According to the test stimulus code, the binary test file is generated using a compilation framework corresponding to the target programming template; wherein the compilation framework and the target programming template use the same programming language.

5. The method for locating a firmware problem of a chip according to claim 1, characterized in that: The triggering the chip to be verified to execute the binary test file to obtain a firmware problem verification report corresponding to the original stimulus file includes: The chip memory address corresponding to the target data structure is written into the chip to be verified, so as to trigger the chip to be verified to read the content in the chip memory address to verify the firmware problem.

6. The method for locating a firmware problem of a chip according to any one of claims 1 to 5, characterized in that: Also includes: Obtain a firmware configuration file and a chip configuration file; wherein the firmware configuration file includes chip configuration parameters when the firmware of the chip to be verified triggers a problem, and the chip configuration file includes preset chip configuration parameters; Classify the module operations in the firmware configuration file and the chip configuration file according to the preset module memory address range to obtain the module operations corresponding to each module in the chip to be verified; wherein the module operations are configuration operations performed on the modules; The module operations of the firmware configuration files corresponding to the modules are respectively compared with the module operations of the chip configuration files to obtain a differential comparison report.

7. The method for locating a firmware problem of a chip according to claim 6, characterized in that: The comparing the module operations of the firmware configuration files corresponding to the modules with the module operations of the chip configuration files to obtain a differentiated comparison report includes: Identify the module operation of the current memory address corresponding to the current module in the firmware configuration file and the module operation of the current memory address corresponding to the current module in the chip configuration file; wherein the current module is any of the modules, and the current memory address is any memory address within the preset module memory address range corresponding to the current module; If the current module operation exists in the firmware configuration file, it is determined whether the current module operation exists in the module operation of the current memory address corresponding to the current module in the chip configuration file; wherein the current module operation is any module operation in the module operation of the current memory address corresponding to the current module in the firmware configuration file; If the current module operation does not exist, determine whether there is a similar module operation corresponding to the current module operation in the module operation of the current memory address corresponding to the current module in the chip configuration file; wherein the similar module operation and the current module operation can both configure the current module to implement the same function; If the same type of module operation does not exist, generating error configuration information corresponding to the current module operation; wherein the difference comparison report includes the error configuration information; If the current module operation or the same type of module operation exists, it is determined that the current module operation is not an incorrect configuration.

8. A device for locating firmware problems of a chip, characterized in that: include: An acquisition unit, used to acquire an original stimulus file of the chip to be verified; wherein the original stimulus file includes memory data when the firmware of the chip to be verified triggers a problem; A stimulus generating unit, used for converting the text content in the original stimulus file into a compilable data structure in a preset data format; The stimulus adaptation unit is used to replace the element content at a preset position in the compilable data structure with the target element content to obtain a target data structure; wherein the target element content includes the operating environment memory information; A compiling and generating unit, used for generating a binary test file according to the target data structure and a preset programming template, and downloading the binary test file to the chip to be verified; The stimulus issuing unit is used to trigger the chip to be verified to execute the binary test file to obtain a firmware problem verification report corresponding to the original stimulus file.

9. A device for locating firmware problems of a chip, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method for locating a firmware problem of a chip as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for locating a firmware problem of a chip according to any one of claims 1 to 7 are implemented.