File generation method and device, computer equipment and readable storage medium

By automatically generating the target original file of the device and verifying environment files, the problem of low efficiency of manual writing files in traditional device testing is solved, and efficient device testing process and rapid simulation time are achieved.

CN119129559APending Publication Date: 2024-12-13SHANGHAI HEXIN DIGITAL TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410802332.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-12-13

Smart Images

  • Figure CN119129559A_ABST
    Figure CN119129559A_ABST
Patent Text Reader

Abstract

The invention relates to a file generation method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the steps of obtaining a cutting configuration file of to-be-tested equipment; according to the cutting configuration file, updating an original file of the to-be-tested equipment to obtain a target original file of the to-be-tested equipment; the target original file comprises an original file of a to-be-tested module in the to-be-tested equipment and an empty file corresponding to an original file of a non-to-be-tested module in the to-be-tested equipment; performing rendering processing on a verification environment file template of the to-be-tested equipment according to the cutting configuration file to obtain a verification environment file of the to-be-tested equipment; and according to the target original file and the verification environment file, obtaining a file for compiling simulation of the to-be-tested device. By adopting the method, the equipment testing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a file generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] After the design of a device (such as a chip) is completed, it needs to be functionally tested to ensure that the device can be put into use normally.

[0003] In traditional technology, when testing a device, the device is mainly tested by manually writing files used for compiling and simulating the entire module of the device. However, each time a device is tested, it is necessary to manually write files used for compiling and simulating the entire module of the device, which is a cumbersome process and results in low device testing efficiency. Summary of the invention

[0004] Based on this, it is necessary to provide a file generation method, device, computer equipment, computer-readable storage medium and computer program product that can improve equipment testing efficiency in response to the above technical problems.

[0005] In a first aspect, the present application provides a file generation method, comprising:

[0006] Get the cropping configuration file of the device under test;

[0007] According to the tailored configuration file, the original file of the device under test is updated to obtain the target original file of the device under test; the target original file includes the original file of the module under test in the device under test and the empty file corresponding to the original file of the non-module under test in the device under test;

[0008] Rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test;

[0009] According to the target original file and the verification environment file, a file used for compiling and simulating the device under test is obtained.

[0010] In one embodiment, the updating of the original file of the device under test according to the cropping configuration file to obtain the target original file of the device under test includes:

[0011] According to the tailored configuration file, identifying the modules to be tested and the modules not to be tested in the device to be tested;

[0012] In the original file of the device under test, the original file of the module under test is retained, and the original file of the module not under test is replaced with an empty file to obtain the target original file of the device under test.

[0013] In one embodiment, the step of identifying the modules to be tested and the modules not to be tested in the device to be tested according to the tailored configuration file includes:

[0014] Extracting module trimming configuration information of the device under test from the trimming configuration file;

[0015] According to the module cutting configuration information, the modules to be retained and the modules to be cut in the device to be tested are determined, which are used as the modules to be tested and the modules not to be tested, respectively.

[0016] In one embodiment, rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test includes:

[0017] Determining verification environment configuration information of the device under test according to the tailored configuration file;

[0018] The verification environment configuration information is added to a corresponding position in a verification environment file template of the device under test to obtain a verification environment file of the device under test.

[0019] In one embodiment, determining the verification environment configuration information of the device under test according to the tailored configuration file includes:

[0020] Extracting module trimming configuration information of the device under test from the trimming configuration file;

[0021] Acquire verification environment configuration information corresponding to the module tailoring configuration information as the verification environment configuration information of the device under test.

[0022] In one of the embodiments, before rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test, the method further includes:

[0023] Finding a verification environment file template corresponding to the tailored configuration file from a verification environment file template library;

[0024] The verification environment file template corresponding to the tailored configuration file is used as the verification environment file template of the device under test.

[0025] In one of the embodiments, after obtaining the files used for compiling and simulating the device under test according to the target original file and the verification environment file, the method further includes:

[0026] Compiling the target original file to obtain a first working library including design information of the device under test, and compiling the verification environment file to obtain a second working library including verification environment information of the device under test;

[0027] Obtaining a simulation output result of the device under test according to the first working library, the second working library and the simulation stimulus of the device under test;

[0028] A test result for the device under test is obtained according to the simulation output result of the device under test and the expected output result of the device under test.

[0029] In one embodiment, the method further comprises:

[0030] When the original file of the device under test is updated, regenerating the target original file of the device under test;

[0031] or,

[0032] When the verification environment file template of the device under test is updated, regenerating the verification environment file of the device under test;

[0033] or,

[0034] When the tailoring configuration file of the device under test is updated, the target original file and the verification environment file of the device under test are regenerated.

[0035] In a second aspect, the present application also provides a file generation device, including:

[0036] A file acquisition module is used to obtain a cropping configuration file of the device under test;

[0037] A file updating module, configured to update the original file of the device under test according to the tailored configuration file to obtain a target original file of the device under test; the target original file includes the original file of the module under test in the device under test and an empty file corresponding to the original file of the non-module under test in the device under test;

[0038] A template rendering module, used for rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test;

[0039] The file generation module is used to obtain the files used for compiling and simulating the device under test according to the target original file and the verification environment file.

[0040] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0041] Get the cropping configuration file of the device under test;

[0042] According to the tailored configuration file, the original file of the device under test is updated to obtain the target original file of the device under test; the target original file includes the original file of the module under test in the device under test and the empty file corresponding to the original file of the non-module under test in the device under test;

[0043] Rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test;

[0044] According to the target original file and the verification environment file, a file used for compiling and simulating the device under test is obtained.

[0045] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0046] Get the cropping configuration file of the device under test;

[0047] According to the tailored configuration file, the original file of the device under test is updated to obtain the target original file of the device under test; the target original file includes the original file of the module under test in the device under test and the empty file corresponding to the original file of the non-module under test in the device under test;

[0048] Rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test;

[0049] According to the target original file and the verification environment file, a file used for compiling and simulating the device under test is obtained.

[0050] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0051] Get the cropping configuration file of the device under test;

[0052] According to the tailored configuration file, the original file of the device under test is updated to obtain the target original file of the device under test; the target original file includes the original file of the module under test in the device under test and the empty file corresponding to the original file of the non-module under test in the device under test;

[0053] Rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test;

[0054] According to the target original file and the verification environment file, a file used for compiling and simulating the device under test is obtained.

[0055] The above-mentioned file generation method, device, computer equipment, computer-readable storage medium and computer program product first obtain the tailoring configuration file of the device under test, and then update the original file of the device under test according to the tailoring configuration file to obtain the target original file of the device under test; the target original file includes the original file of the module under test in the device under test, and the empty file corresponding to the original file of the non-module under test in the device under test; then, according to the tailoring configuration file, the verification environment file template of the device under test is rendered to obtain the verification environment file of the device under test, and finally, according to the target original file and the verification environment file, the file used for compilation and simulation of the device under test is obtained. In this way, in the device testing process, the original file of the device under test is directly updated according to the tailoring configuration file of the device under test to obtain the target original file of the device under test, and the verification environment file template of the device under test is rendered to obtain the verification environment file of the device under test, so as to achieve the purpose of automatically generating the target original file and the verification environment file of the device under test, that is, automatically generating the file used for compilation and simulation of the device under test, without manually writing the file used for compilation and simulation of the device under test, thereby simplifying the device testing process and improving the device testing efficiency. At the same time, in the process of generating the target original file of the device under test, only the original file of the module under test in the device under test is retained, and the original file of the non-module under test in the device under test is replaced with an empty file, which can reduce the load of the simulator compilation simulation, thereby speeding up the simulation time and further improving the equipment testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0057] Figure 1 A schematic diagram of a process flow of a file generation method in an embodiment;

[0058] Figure 2 A schematic diagram of a cutting process in one embodiment;

[0059] Figure 3A flowchart of steps for determining a test result for a device under test in one embodiment;

[0060] Figure 4 A schematic diagram of a compiling process in one embodiment;

[0061] Figure 5 A schematic diagram of a flow chart of a file generation method in another embodiment;

[0062] Figure 6 It is a structural block diagram of a file generating device in one embodiment;

[0063] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0065] In one embodiment, Figure 1 As shown, a file generation method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be but not limited to various personal computers, laptops, smart phones, tablet computers, etc.; the server can be implemented as an independent server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps S101 to S104. Among them:

[0066] Step S101, obtaining a cropping configuration file of the device to be tested.

[0067] Among them, the device under test (DUT) refers to the device that needs to undergo functional testing, such as a chip under test, a circuit under test, an electronic product under test, etc.; the circuit under test can refer to an RTL (Register Transfer Level) design circuit, etc.

[0068] The trimming configuration file refers to a file that records the module trimming configuration information of the device under test. The module trimming configuration information refers to the configuration information required to trim the modules of the device under test, specifically used to describe which modules of the device under test need to be trimmed and which modules need to be retained.

[0069] Exemplarily, in response to a test request for the device under test, the terminal obtains a tailoring configuration file of the device under test from a database, such as obtaining a tailoring configuration file of an RTL design circuit from a database.

[0070] Step S102, updating the original file of the device under test according to the tailored configuration file to obtain the target original file of the device under test; the target original file includes the original file of the module under test in the device under test and the empty file corresponding to the original file of the non-module under test in the device under test.

[0071] The original file refers to a design description file written in a hardware description language, such as a Verilog (hardware description language) original file.

[0072] The device under test includes modules under test and modules not under test; modules under test refer to modules that need to be tested currently, that is, modules that need to be retained; modules not under test refer to modules that do not need to be tested currently, that is, modules that need to be trimmed.

[0073] The original file of the device under test refers to the Verilog original file of the device under test, specifically including the original file of the module under test in the device under test and the original file of the non-module under test in the device under test.

[0074] The target original file of the device under test refers to the target Verilog original file of the device under test, specifically including the original file of the module under test in the device under test, and the empty file corresponding to the original file of the non-module under test in the device under test. In actual scenarios, the target original file of the device under test refers to the original file that is partially hollowed out.

[0075] Among them, updating the original file of the device under test means that in the original file of the device under test, the original file of the module under test is retained, and the original file of the non-module under test is replaced with an empty file, so as to obtain the target original file of the device under test. It should be noted that replacing the original file of the non-module under test with an empty file can reduce the load of the simulator compilation simulation, thereby speeding up the simulation time and improving the equipment testing efficiency.

[0076] Exemplarily, the terminal identifies the modules to be tested and the modules not to be tested in the device to be tested according to the cropping configuration file of the device to be tested; then the original file of the device to be tested is obtained, and the original file of the device to be tested is updated using the original file processing script to retain the original file of the module to be tested and replace the original file of the module not to be tested with an empty file, thereby obtaining the target original file of the device to be tested.

[0077] For example, see Figure 2After obtaining the cropping configuration file of the device under test, the terminal obtains the original file of the device under test (such as the RTL original file), and processes the original file of the device under test based on the cropping configuration file of the device under test through the original file processing script (such as the RTL processing script), that is, retains the original file of the module under test in the device under test, and replaces the original file of the non-module under test in the device under test with an empty file, so as to obtain a partially hollowed-out original file (such as a partially hollowed-out RTL original file).

[0078] Step S103 : Rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test.

[0079] The verification environment file template refers to a template used to generate a verification environment file. The verification environment file template of the device under test refers to a verification environment file template required for the device under test; for different tailored configuration files, the verification environment file template required for the device under test is different.

[0080] The verification environment file refers to a file that records the verification environment information of the device under test.

[0081] Exemplarily, the terminal determines the verification environment configuration information of the device under test based on the cropping configuration file of the device under test; then filters out the verification environment file template of the device under test from the template library, and uses the template rendering script to render the verification environment file template of the device under test based on the verification environment configuration information of the device under test, so as to obtain the verification environment file of the device under test.

[0082] For example, see Figure 2 After obtaining the cropping configuration file of the device under test, the terminal selects the verification environment file template of the device under test from the template library according to the cropping configuration file of the device under test, and renders the verification environment file template of the device under test based on the cropping configuration file of the device under test through the template rendering script to obtain the verification environment file of the device under test.

[0083] Step S104, obtaining files used for compiling and simulating the device under test according to the target original files and the verification environment files.

[0084] The files used for compiling and simulating the device under test refer to the files needed for compiling and simulating the device under test, specifically including the target original files and verification environment files of the device under test.

[0085] Exemplarily, the terminal combines the target original file of the device under test and the verification environment file to obtain the file used for compilation simulation of the device under test. Figure 2 .

[0086] In the above file generation method, the cutting configuration file of the device under test is first obtained, and then the original file of the device under test is updated according to the cutting configuration file to obtain the target original file of the device under test; the target original file includes the original file of the module under test in the device under test, and the empty file corresponding to the original file of the non-module under test in the device under test; then, according to the cutting configuration file, the verification environment file template of the device under test is rendered to obtain the verification environment file of the device under test, and finally, according to the target original file and the verification environment file, the file used for compilation and simulation of the device under test is obtained. In this way, during the device testing process, the original file of the device under test is directly updated according to the cutting configuration file of the device under test to obtain the target original file of the device under test, and the verification environment file template of the device under test is rendered to obtain the verification environment file of the device under test, so as to achieve the purpose of automatically generating the target original file and the verification environment file of the device under test, that is, automatically generating the file used for compilation and simulation of the device under test, without manually writing the file used for compilation and simulation of the device under test, thereby simplifying the device testing process and improving the device testing efficiency. At the same time, in the process of generating the target original file of the device under test, only the original file of the module under test in the device under test is retained, and the original file of the non-module under test in the device under test is replaced with an empty file, which can reduce the load of the simulator compilation simulation, thereby speeding up the simulation time and further improving the equipment testing efficiency.

[0087] In one of the embodiments, the above step S102, according to the cropping configuration file, updates the original file of the device under test to obtain the target original file of the device under test, specifically including the following contents: according to the cropping configuration file, identifies the module under test and the non-module under test in the device under test; in the original file of the device under test, retains the original file of the module under test, and replaces the original file of the non-module under test with an empty file, to obtain the target original file of the device under test.

[0088] Among them, replacing the original file of the non-test module with an empty file means replacing the non-test module with an empty module.

[0089] Exemplarily, the terminal identifies the module to be tested and the module not to be tested in the device to be tested according to the module cropping configuration information in the cropping configuration file; then the original file of the device to be tested is obtained, and the original file of the module to be tested and the original file of the module not to be tested are identified from the original file of the device to be tested through the original file processing script; finally, the original file of the module to be tested is retained in the original file of the device to be tested, and the original file of the module not to be tested is replaced with an empty file, thereby obtaining the target original file of the device to be tested.

[0090] In this embodiment, the modules to be tested and the modules not to be tested in the device to be tested are first identified according to the trimming configuration file, and then in the original file of the device to be tested, the original file of the module to be tested is retained, and the original file of the module not to be tested is replaced with an empty file to obtain the target original file of the device to be tested; in this way, the target original file of the device to be tested is automatically generated without manual writing, thereby simplifying the device testing process and improving the device testing efficiency. At the same time, in the process of generating the target original file of the device to be tested, only the original file of the module to be tested in the device to be tested is retained, and the original file of the module not to be tested in the device to be tested is replaced with an empty file, which can reduce the load of the simulator compilation simulation, thereby accelerating the simulation time and further improving the device testing efficiency.

[0091] In one of the embodiments, modules to be tested and modules not to be tested in the device to be tested are identified according to a trimming configuration file, which specifically includes the following contents: extracting module trimming configuration information of the device to be tested from the trimming configuration file; and determining modules to be retained and modules to be trimmed in the device to be tested according to the module trimming configuration information, corresponding to the modules to be tested and modules not to be tested.

[0092] The module to be retained refers to the module to be retained, that is, the module to be tested. The module to be cut refers to the module to be cut, that is, the module not to be tested.

[0093] Exemplarily, the terminal extracts instructions based on the module cropping configuration information, extracts the module cropping configuration information of the device under test from the cropping configuration file, and determines the modules to be retained and the modules to be cropped in the device under test based on the module cropping configuration information, and finally uses the modules to be retained as the modules to be tested, and the modules to be cropped as the modules not to be tested.

[0094] In this embodiment, the module cropping configuration information of the device under test is first extracted from the cropping configuration file, and then the modules to be retained and the modules to be cropped in the device under test are determined according to the module cropping configuration information, which correspond to the modules to be tested and the modules not to be tested. In this way, the modules to be tested and the modules not to be tested in the device under test are identified according to the cropping configuration file, which is conducive to the subsequent accurate retention of the original files of the modules to be tested and the replacement of the original files of the modules not to be tested with empty files, so that the target original files of the device under test that are finally obtained are more accurate, thereby improving the accuracy of determining the target original files of the device under test.

[0095] In one of the embodiments, the above step S103, according to the cropping configuration file, renders the verification environment file template of the device under test to obtain the verification environment file of the device under test, which specifically includes the following contents: according to the cropping configuration file, determining the verification environment configuration information of the device under test; adding the verification environment configuration information to the corresponding position in the verification environment file template of the device under test to obtain the verification environment file of the device under test.

[0096] The verification environment configuration information refers to the configuration information required to create a verification environment for the device under test.

[0097] Exemplarily, the terminal identifies the tailored configuration file, obtains the verification environment configuration information of the device under test, and then adds the verification environment configuration information to the position corresponding to the verification environment configuration information in the verification environment file template of the device under test to obtain the verification environment file as the verification environment file of the device under test.

[0098] In this embodiment, the verification environment configuration information of the device under test is first determined based on the tailored configuration file, and then the verification environment configuration information is added to the corresponding position in the verification environment file template of the device under test to obtain the verification environment file of the device under test; in this way, the verification environment file of the device under test is automatically generated by using the tailored configuration file and the verification environment file template, without the need for manual writing, thereby simplifying the device testing process and further improving the equipment testing efficiency.

[0099] In one of the embodiments, verification environment configuration information of the device under test is determined based on the tailoring configuration file, which specifically includes the following contents: extracting module tailoring configuration information of the device under test from the tailoring configuration file; obtaining verification environment configuration information corresponding to the module tailoring configuration information as the verification environment configuration information of the device under test.

[0100] Among them, the module tailoring configuration information corresponds to the verification environment configuration information one by one, and different module tailoring configuration information corresponds to different verification environment configuration information, that is, different modules require different verification environment configuration information.

[0101] Exemplarily, the terminal extracts the module tailoring configuration information of the device under test from the tailoring configuration file according to the module tailoring configuration information extraction instruction; then, according to the module tailoring configuration information of the device under test, the correspondence between the module tailoring configuration information and the verification environment configuration information is queried, and the verification environment configuration information corresponding to the module tailoring configuration information of the device under test is obtained as the verification environment configuration information of the device under test.

[0102] In this embodiment, the module tailoring configuration information of the device under test is first extracted from the tailoring configuration file, and then the verification environment configuration information corresponding to the module tailoring configuration information is obtained as the verification environment configuration information of the device under test; in this way, the verification environment configuration information of the device under test is determined by utilizing the module tailoring configuration information in the tailoring configuration file and combining the correspondence between the module tailoring configuration information and the verification environment configuration information, which is conducive to improving the accuracy of determining the verification environment configuration information, and thereby improving the accuracy of the subsequent verification environment files generated based on the verification environment configuration information.

[0103] In one of the embodiments, the above-mentioned step S103, before rendering the verification environment file template of the device to be tested according to the tailoring configuration file to obtain the verification environment file of the device to be tested, also includes the step of obtaining the verification environment file template of the device to be tested, which specifically includes the following contents: searching for the verification environment file template corresponding to the tailoring configuration file from the verification environment file template library; using the verification environment file template corresponding to the tailoring configuration file as the verification environment file template of the device to be tested.

[0104] The verification environment file template library includes verification environment file templates corresponding to multiple tailoring configuration files, specifically including verification environment file templates corresponding to multiple module tailoring configuration information.

[0105] Among them, the tailoring configuration files correspond to the verification environment file templates one by one, and different tailoring configuration files correspond to different verification environment file templates, that is, different modules require different verification environment file templates.

[0106] Exemplarily, the terminal extracts the module tailoring configuration information of the device under test from the tailoring configuration file according to the module tailoring configuration information extraction instruction; then, according to the module tailoring configuration information of the device under test, the terminal searches for the verification environment file template corresponding to the module tailoring configuration information of the device under test from the verification environment file template library, and uses it as the verification environment file template corresponding to the tailoring configuration file; finally, the verification environment file template corresponding to the tailoring configuration file is used as the verification environment file template of the device under test.

[0107] In this embodiment, the verification environment file template corresponding to the tailored configuration file is first found from the verification environment file template library, and then the verification environment file template corresponding to the tailored configuration file is used as the verification environment file template for the device to be tested; in this way, the verification environment file template corresponding to the tailored configuration file in the verification environment file template library is used as the verification environment file template for the device to be tested, which facilitates the subsequent generation of the corresponding verification environment file directly based on the verification environment file template, without the need to write the verification environment file from scratch, thereby improving the generation efficiency of the verification environment file and further improving the equipment testing efficiency.

[0108] In one embodiment, if Figure 3 As shown, the above step S104, after obtaining the files used for compiling and simulating the device under test according to the target original file and the verification environment file, also includes the step of determining the test results for the device under test, specifically including the following steps S301 to S303. Among them:

[0109] Step S301 , compile the target original file to obtain a first working library including design information of the device under test, and compile the verification environment file to obtain a second working library including verification environment information of the device under test.

[0110] Step S302, obtaining a simulation output result of the device under test according to the first working library, the second working library and the simulation stimulus of the device under test.

[0111] Step S303: obtaining a test result for the device under test according to the simulation output result of the device under test and the expected output result of the device under test.

[0112] The design information of the device under test may refer to circuit design information, such as RTL design information, which is obtained by compiling the target original file of the device under test. The first working library refers to a working library containing the design information of the device under test.

[0113] The verification environment information refers to the description information of the verification environment. The second working library refers to the working library containing the verification environment information of the device under test.

[0114] The simulation stimulus of the device under test is used to represent the input signal of the device under test and can be obtained through firmware compilation.

[0115] Exemplarily, the terminal first compiles the target original file to obtain a first working library including the design information of the device under test, and compiles the verification environment file to obtain a second working library including the verification environment information of the device under test, then obtains the simulation stimulus of the device under test, and obtains the simulation output result of the device under test based on the first working library, the second working library and the simulation stimulus of the device under test, that is, when the first working library and the second working library are configured, the simulation stimulus is applied to the device under test to obtain the simulation output result of the device under test, and finally obtains the expected output result of the device under test, and compares the simulation output result of the device under test with the expected output result of the device under test to obtain the test result for the device under test; for example, if the simulation output result of the device under test is the same as the expected output result of the device under test, then it is confirmed that the verification of the device under test has passed; if the simulation output result of the device under test is different from the expected output result of the device under test, then it is confirmed that the verification of the device under test has failed.

[0116] For example, see Figure 4 After obtaining the cropping configuration file, the terminal follows Figure 2A cutting process is performed to generate a partially hollowed-out original file of the device under test and a verification environment file of the device under test, and then the partially hollowed-out original file of the device under test is compiled (such as compiling RTL) to obtain a first working library including design information of the device under test, and the verification environment file is compiled (such as compiling a verification environment) to obtain a second working library including verification environment information of the device under test, and finally firmware compilation, simulation and other processes are performed to obtain a simulation output result of the device under test.

[0117] In this embodiment, the target original file is first compiled to obtain a first working library including the design information of the device under test, and the verification environment file is compiled to obtain a second working library including the verification environment information of the device under test, and then the simulation output result of the device under test is obtained according to the first working library, the second working library and the simulation stimulus of the device under test, and finally the test result for the device under test is obtained according to the simulation output result of the device under test and the expected output result of the device under test; in this way, in the process of using the target original file and the verification environment file of the device under test to test the device, the target original file and the verification environment file of the device under test are automatically generated without manual writing, which can greatly reduce the device testing time, thereby simplifying the device testing process, and then improving the device testing efficiency. At the same time, only processing the target original file of the device under test can reduce the load of the simulator compilation simulation, thereby accelerating the simulation time and further improving the device testing efficiency.

[0118] In one of the embodiments, the file generation method provided by the present application also includes a file updating step, which specifically includes the following contents: when the original file of the device under test is updated, regenerating the target original file of the device under test; or, when the verification environment file template of the device under test is updated, regenerating the verification environment file of the device under test; or, when the trimming configuration file of the device under test is updated, regenerating the target original file and the verification environment file of the device under test.

[0119] Exemplarily, if the terminal recognizes that the original file of the device under test is updated, step S102 is re-executed to regenerate the target original file of the device under test; if it recognizes that the verification environment file template of the device under test is updated, step S103 is re-executed to regenerate the verification environment file of the device under test; if it recognizes that the cropping configuration file of the device under test is updated, step S102 and step S103 are re-executed to regenerate the target original file and verification environment file of the device under test.

[0120] For example, see Figure 4When the original file of the device under test is updated, the terminal only regenerates the partially hollowed-out original file and executes subsequent steps; when the verification environment file template of the device under test is updated, the terminal only regenerates the verification environment file of the device under test and executes subsequent steps; when the cropped configuration file of the device under test is updated, the terminal regenerates the partially hollowed-out original file and the verification environment file of the device under test and executes subsequent steps.

[0121] In this embodiment, when the original file of the device under test is updated, the target original file of the device under test is regenerated; when the verification environment file template of the device under test is updated, the verification environment file of the device under test is regenerated; when the tailored configuration file of the device under test is updated, the target original file and the verification environment file of the device under test are regenerated; in this way, when the original file, the verification environment file template or the tailored configuration file of the device under test are updated, the target original file and the verification environment file of the device under test are automatically regenerated, which can ensure the normal progress of the device testing process, thereby ensuring the accuracy of the test results of the device under test, thereby improving the accuracy of the device testing.

[0122] In an exemplary embodiment, Figure 5 As shown, another file generation method is provided, which is described by taking the method applied to a terminal as an example, and specifically includes the following steps S501 to S508. Among them:

[0123] Step S501, obtaining a cropping configuration file of the device to be tested.

[0124] Step S502: extracting module tailoring configuration information of the device under test from the tailoring configuration file.

[0125] Step S503: Determine the modules to be retained and the modules to be cut in the device under test according to the module cutting configuration information, which correspond to the modules to be tested and the modules not to be tested in the device under test.

[0126] Step S504 , in the original files of the device under test, the original files of the module under test are retained, and the original files of the modules not under test are replaced with empty files, so as to obtain the target original files of the device under test.

[0127] Step S505: searching for a verification environment file template corresponding to the tailored configuration file from the verification environment file template library; using the verification environment file template corresponding to the tailored configuration file as the verification environment file template of the device under test.

[0128] Step S506: Acquire verification environment configuration information corresponding to the module tailoring configuration information as the verification environment configuration information of the device under test.

[0129] Step S507: Add the verification environment configuration information to the corresponding position in the verification environment file template of the device under test to obtain the verification environment file of the device under test.

[0130] Step S508, obtaining the files used for compiling and simulating the device under test according to the target original files and the verification environment files.

[0131] In the above-mentioned file generation method, during the device testing process, the original file of the device under test is directly updated according to the cropping configuration file of the device under test to obtain the target original file of the device under test, and the verification environment file template of the device under test is rendered to obtain the verification environment file of the device under test, thereby achieving the purpose of automatically generating the target original file and verification environment file of the device under test, that is, automatically generating the files used for the compilation and simulation of the device under test, without manually writing the files used for the compilation and simulation of the device under test, thereby simplifying the device testing process and improving the device testing efficiency. At the same time, in the process of generating the target original file of the device under test, only the original files of the modules under test in the device under test are retained, and the original files of the non-modules under test in the device under test are replaced with empty files, which can reduce the load of the simulator compilation and simulation, thereby accelerating the simulation time and further improving the device testing efficiency.

[0132] In an exemplary embodiment, in order to more clearly illustrate the file generation method provided in the embodiment of the present application, the file generation method is specifically described below with a specific embodiment. Figure 2 The present application also provides a method for automatically tailoring RTL and the corresponding verification environment and compiling on demand for multi-instance modules. Figure 2 In a complete SOC (system on chip) RTL (register transfer level) design circuit, cutting some modules and replacing them with empty modules, while retaining the modules of interest, can reduce the simulator compilation and simulation load, speed up the simulation time, and improve the verification efficiency. At the same time, in the early stage of the project, when some modules have not been designed yet and other modules need to be verified, you can also cut them to keep only the modules that need to be verified in the DUT, and carry out the system-level verification work early.

[0133] refer to Figure 2, the configuration information required for tailoring is recorded in an independent tailoring configuration file as the only input of the tailoring process. The RTL processing script reads the tailoring configuration file, retains the original Verilog file for the modules that need to be retained, and replaces the modules that need to be tailored with empty modules and adds them to the file list. In the verification environment, some VIPs (verification IPs) are integrated into the verification environment in the form of sub env (subsystem environment). Multiple sub envs (subsystem environments) of the same type of VIP will be instantiated in sve (the verification component where VIP's env is centrally instantiated), while sve is directly instantiated under top_env (top environment). For different tailoring configurations, the number of envs (environments) and specific parameters that need to be instantiated in sve are also different. The template of sve will be prepared in advance. After writing the tailoring configuration file for the configuration tailoring situation, the template rendering script will render the template according to the tailoring configuration file to generate the actual required sve file. Similarly, some other verification components can also be instantiated and connected in the verification environment by rendering templates, such as scoreboard (comparator), coveragecollector (coverage collector), etc. The interface connecting each VIP to the DUT can also be instantiated in this way by tailoring the configuration file.

[0134] As mentioned above, all configurable parts of the verification environment can be rendered into a plug-and-play environment through a simple tailoring configuration file, that is, a single configuration file is used to concisely describe the tailoring information, and a set of environment files that can be directly used for simulation is generated by rendering templates. In addition, the tailoring configuration file corresponds to each test case one by one, and each test case needs to be considered in what tailoring situation when planning. Test cases with the same tailoring configuration are considered to be simulated based on the same elaboration (compilation verification environment), so in regression testing, each type of tailoring configuration test case only needs to be compiled once.

[0135] refer to Figure 4 After generating the partially hollowed-out original file and the verification environment file based on the trimming configuration file, you can use Figure 4 The compilation process shown in the figure executes all subsequent processes. Among them, if there is any update to the verification environment file template or template rendering script, only the process of generating the environment verification file is rerun, and then the elaboration (compilation verification environment) is continued; if there is any update to the RTL original file or RTL processing script, only the process of generating the partially hollowed original file is rerun, and then the compilation (compile RTL, that is, compile the original file) is continued; if there is any update to the cropping configuration file, rerun Figure 4 All processes.

[0136] The above method for automatically cutting RTL and the corresponding verification environment for multi-instantiated modules and compiling on demand only requires cutting the configuration file as the input of each test case, and only a few lines need to be filled in; after completion, the corresponding DUT and verification environment can be generated instantly with one click, and the simulation case can be run without any post-processing and debugging. In addition, compared with manually writing a set of verification environments, which requires a lot of repetitive similar work and is very prone to errors, and instantiation, connection, etc. require long debugging work, this method can greatly improve the efficiency of equipment testing.

[0137] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0138] Based on the same inventive concept, the embodiment of the present application also provides a file generation device for implementing the file generation method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more file generation device embodiments provided below can refer to the limitations on the file generation method above, and will not be repeated here.

[0139] In an exemplary embodiment, Figure 6 As shown, a file generation device is provided, including: a file acquisition module 610, a file update module 620, a template rendering module 630 and a file generation module 640, wherein:

[0140] The file acquisition module 610 is used to acquire a cropping configuration file of the device under test.

[0141] The file update module 620 is used to update the original file of the device under test according to the tailored configuration file to obtain the target original file of the device under test; the target original file includes the original file of the module under test in the device under test and the empty file corresponding to the original file of the non-module under test in the device under test.

[0142] The template rendering module 630 is used to render the verification environment file template of the device under test according to the tailoring configuration file to obtain the verification environment file of the device under test.

[0143] The file generation module 640 is used to obtain the files used for compiling and simulating the device under test according to the target original files and the verification environment files.

[0144] In an exemplary embodiment, the file update module 620 is also used to identify the modules to be tested and the modules not to be tested in the device to be tested according to the cropping configuration file; in the original files of the device to be tested, the original files of the modules to be tested are retained, and the original files of the modules not to be tested are replaced with empty files to obtain the target original files of the device to be tested.

[0145] In an exemplary embodiment, the file update module 620 is also used to extract module trimming configuration information of the device under test from the trimming configuration file; and determine the modules to be retained and the modules to be trimmed in the device under test according to the module trimming configuration information, corresponding to the modules to be tested and the modules not to be tested.

[0146] In an exemplary embodiment, the template rendering module 630 is also used to determine the verification environment configuration information of the device under test based on the cropped configuration file; add the verification environment configuration information to the corresponding position in the verification environment file template of the device under test to obtain the verification environment file of the device under test.

[0147] In an exemplary embodiment, the template rendering module 630 is further used to extract module clipping configuration information of the device under test from the clipping configuration file; and obtain verification environment configuration information corresponding to the module clipping configuration information as the verification environment configuration information of the device under test.

[0148] In an exemplary embodiment, the file generation device also includes a template determination module, which is used to find out the verification environment file template corresponding to the tailored configuration file from the verification environment file template library; and use the verification environment file template corresponding to the tailored configuration file as the verification environment file template of the device under test.

[0149] In an exemplary embodiment, the file generation device also includes a result determination module, which is used to compile the target original file to obtain a first working library including design information of the device under test, and compile the verification environment file to obtain a second working library including verification environment information of the device under test; obtain a simulation output result of the device under test based on the first working library, the second working library and the simulation stimulus of the device under test; and obtain a test result for the device under test based on the simulation output result of the device under test and the expected output result of the device under test.

[0150] In an exemplary embodiment, the file generation device also includes a regeneration module, which is used to regenerate the target original file of the device under test when the original file of the device under test is updated; or, to regenerate the verification environment file of the device under test when the verification environment file template of the device under test is updated; or, to regenerate the target original file and the verification environment file of the device under test when the trimming configuration file of the device under test is updated.

[0151] Each module in the above-mentioned file generation device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0152] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a file generation method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0153] Those skilled in the art will understand that Figure 7The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0154] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0155] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0156] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0157] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0158] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0159] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0160] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A file generation method, characterized in that: The method comprises: Get the cropping configuration file of the device under test; According to the tailored configuration file, the original file of the device under test is updated to obtain the target original file of the device under test; the target original file includes the original file of the module under test in the device under test and the empty file corresponding to the original file of the non-module under test in the device under test; Rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test; According to the target original file and the verification environment file, a file used for compiling and simulating the device under test is obtained.

2. The method according to claim 1, characterized in that The updating process of the original file of the device under test according to the cropping configuration file to obtain the target original file of the device under test includes: According to the tailored configuration file, identifying the modules to be tested and the modules not to be tested in the device to be tested; In the original file of the device under test, the original file of the module under test is retained, and the original file of the module not under test is replaced with an empty file to obtain the target original file of the device under test.

3. The method according to claim 2, characterized in that The step of identifying the modules to be tested and the modules not to be tested in the device to be tested according to the tailored configuration file comprises: Extracting module trimming configuration information of the device under test from the trimming configuration file; According to the module cutting configuration information, the modules to be retained and the modules to be cut in the device to be tested are determined, which are used as the modules to be tested and the modules not to be tested, respectively.

4. The method according to claim 1, characterized in that: The step of rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test includes: Determining verification environment configuration information of the device under test according to the tailored configuration file; The verification environment configuration information is added to a corresponding position in a verification environment file template of the device under test to obtain a verification environment file of the device under test.

5. The method according to claim 4, characterized in that Determining the verification environment configuration information of the device under test according to the tailored configuration file includes: Extracting module trimming configuration information of the device under test from the trimming configuration file; Acquire verification environment configuration information corresponding to the module tailoring configuration information as the verification environment configuration information of the device under test.

6. The method according to claim 1, characterized in that Before rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test, the method further includes: Finding a verification environment file template corresponding to the tailored configuration file from a verification environment file template library; The verification environment file template corresponding to the tailored configuration file is used as the verification environment file template of the device under test.

7. The method according to any one of claims 1 to 6, characterized in that: After obtaining the files used for compiling and simulating the device under test according to the target original file and the verification environment file, the method further includes: Compiling the target original file to obtain a first working library including design information of the device under test, and compiling the verification environment file to obtain a second working library including verification environment information of the device under test; Obtaining a simulation output result of the device under test according to the first working library, the second working library and the simulation stimulus of the device under test; A test result for the device under test is obtained according to the simulation output result of the device under test and the expected output result of the device under test.

8. The method according to claim 7, characterized in that The method further comprises: When the original file of the device under test is updated, regenerating the target original file of the device under test; or, When the verification environment file template of the device under test is updated, regenerating the verification environment file of the device under test; or, When the tailoring configuration file of the device under test is updated, the target original file and the verification environment file of the device under test are regenerated.

9. A file generating device, characterized in that: The device comprises: A file acquisition module is used to obtain a cropping configuration file of the device under test; A file updating module, configured to update the original file of the device under test according to the tailored configuration file to obtain a target original file of the device under test; the target original file includes the original file of the module under test in the device under test and an empty file corresponding to the original file of the non-module under test in the device under test; A template rendering module, used for rendering the verification environment file template of the device under test according to the clipping configuration file to obtain the verification environment file of the device under test; The file generation module is used to obtain the files used for compiling and simulating the device under test according to the target original file and the verification environment file.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.