Python-based simulation test method, device and equipment, medium and program product
Through Python-based simulation management tools and UVM framework, the simulation testing process of digital integrated circuits is simplified, and the problem of lengthy, complex and inefficient simulation processes in the existing technology is solved, and an efficient, flexible and easy-to-maintenance simulation testing environment is achieved.
Patent Information
- Application Number
- CN202411951910.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-25
AI Technical Summary
The simulation test process of digital integrated circuits is lengthy and complicated. When compiling and simulating using Makefile, there are problems such as high learning costs, complex writing, difficult to debug, and frequent updates that affect the simulation efficiency.
Based on Python, we build simulation management tools, manage the simulation test process of digital integrated circuits, and build a simulation test platform in combination with UVM framework. We also receive user input command parameters through simulation management tools, generate corresponding simulation software instructions, and control the simulation test platform for simulation testing.
Simplified the simulation process, reduced learning costs, improved simulation efficiency, enhanced flexibility and adaptability, simplified debugging and maintenance, and improved team collaboration efficiency.
Smart Images

Figure CN119885994A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic design automation, and in particular to a Python-based simulation test method, device, equipment, medium and program product. Background Art
[0002] After the RTL of digital integrated circuits is written, building a verification platform to simulate and verify it is an essential part of digital IC design. Taking the three-step compilation method for digital circuit simulation commonly used in the industry as an example, in addition to the basic simulation instructions in the three stages of Analyzing, Elaborating, and Simulating, it is usually necessary to specify various simulation options of the simulation software to control the simulation behavior. Different design files and even different test cases often require different simulation options to be specified, and for complex medium and large designs, the number of simulation options that need to be specified will also increase significantly. This requires users to enter a large number of commands in the Linux terminal when performing RTL simulation directly through simulation software instructions. The simulation process is lengthy and complicated, which is not conducive to timely modification and improvement of the circuit.
[0003] At present, the Makefile tool can be used to write these repeated instructions into the makefile file, and the simulation software instructions can be replaced by make instructions to simplify the simulation process, realize automatic compilation and simulation, and reduce repetitive work to a certain extent. Improve efficiency. However, in addition to the certain learning cost of Makefile itself, writing Makefile may become very complicated for highly complex designs. On the other hand, as the design version changes, Makefile also needs to be updated frequently, especially when it is used and updated by multiple developers, it is easy to have difficult-to-debug problems. These situations require extra time and effort to solve, affecting the simulation efficiency. Summary of the invention
[0004] The purpose of the present invention is to provide a simulation test method based on Python, aiming to solve the problems in the prior art that the simulation test process of digital integrated circuits is lengthy and complicated, and when using Makefile for compilation and simulation, there are high learning costs, complex writing, difficult debugging, and frequent updates that affect simulation efficiency.
[0005] The present invention is achieved through the following technical solutions:
[0006] A simulation test method based on Python, comprising the steps of:
[0007] Build a simulation management tool based on Python; the simulation management tool is used to manage the simulation test process of digital integrated circuits;
[0008] Build a simulation test platform based on the UVM framework and simulation management tools, and configure the environment of the simulation test platform;
[0009] Receive instruction parameters input by the user through the simulation management tool, generate corresponding simulation software instructions according to the instruction parameters, and control the simulation test platform to perform simulation testing according to the simulation software instructions;
[0010] After the simulation test is completed, the simulation log and the absolute path of the waveform file are printed on the terminal interface through the simulation management tool, and the simulation management tool receives user instructions to perform corresponding operations.
[0011] Optionally, the specific process of building the simulation management tool based on Python is:
[0012] Define the file framework structure of the simulation management tool, including the UVM verification platform file path, simulation path, environment configuration file, and script configuration file;
[0013] Set up a main program based on several Python libraries and custom functions. The main program is used to parse the command parameters entered by the user.
[0014] Set the instruction parameter template, which is used to identify the instruction parameters input by the user through regular matching and generate corresponding simulation software instructions according to the instruction parameters.
[0015] Optionally, the specific process of building a simulation test platform based on the UVM framework and the simulation management tool, and performing environmental configuration on the simulation test platform is as follows:
[0016] According to the UVM framework standard, write the verification component and place it in the specified file path;
[0017] By editing the environment configuration file, configuring the environment variables, and writing the script configuration file, the script configuration file stores the relevant configuration parameters of the test project;
[0018] According to the specific requirements of the test project, configure the relevant parameters corresponding to the test project in the simulation test platform.
[0019] Optionally, the specific process of receiving instruction parameters input by the user through the simulation management tool, generating corresponding simulation software instructions according to the instruction parameters, and controlling the simulation test platform to perform simulation testing according to the simulation software instructions is:
[0020] The simulation management tool provides a user interaction interface or command line interface for the user to input instruction parameters required for simulation testing;
[0021] Through the main program of the simulation management tool, regular recognition and analysis of the instruction parameters input by the user are performed;
[0022] According to the instruction parameters obtained by parsing, a corresponding option is selected from the instruction parameter template of the simulation management tool, and a corresponding simulation software instruction is generated;
[0023] The system call function provided by the operating system is called through the simulation management tool, and the simulation test platform is called to perform simulation testing through the simulation software instructions and the script configuration parameters in the script configuration file.
[0024] Optionally, after the simulation test is completed, the specific process of printing the simulation log and the absolute path of the waveform file on the terminal interface through the simulation management tool is as follows:
[0025] After the simulation test platform completes the simulation test, the simulation management tool captures the simulation result file generated by the simulation test platform;
[0026] Construct the storage path of the simulation result file according to the environment variables defined in the environment configuration file and the instruction parameters entered by the user;
[0027] Parse the storage path and obtain the absolute path of the simulation result file;
[0028] The absolute path of the simulation result file is printed on the terminal interface through the simulation management tool, so that users can directly access and view the simulation result file.
[0029] Optionally, according to the test cases and simulation times specified by the user, several relatively independent simulation paths are set, and corresponding simulation tests are performed simultaneously through the several relatively independent simulation paths.
[0030] Based on the same inventive concept, the present invention also provides a Python-based simulation test device for implementing the Python-based simulation test method, comprising:
[0031] Simulation management tool module, used to manage the simulation test process of digital integrated circuits;
[0032] A simulation test platform construction module is used to build a simulation test platform based on the UVM framework and simulation management tools, and to configure the environment of the simulation test platform;
[0033] The simulation test control module is used to receive the instruction parameters input by the user, generate corresponding simulation software instructions according to the instruction parameters, and control the simulation test platform to perform simulation testing;
[0034] The simulation result processing module is used to process the simulation results after the simulation test is completed, and print the simulation log and the absolute path of the waveform file on the terminal interface.
[0035] Based on the same inventive concept, the present invention also provides a computer device, including a processor, a memory and a network interface, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the Python-based simulation test method is implemented.
[0036] Based on the same inventive concept, 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 Python-based simulation test method is implemented.
[0037] Based on the same inventive concept, the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the Python-based simulation test method.
[0038] The technical solution of the present invention has at least the following advantages and beneficial effects:
[0039] Simplify the simulation process and improve efficiency: Through the simulation management tool built on Python, users do not need to manually enter a large number of simulation instructions and options in the Linux terminal. They only need to enter concise instruction parameters through the simulation management tool to automatically generate and execute complex simulation software instructions, thereby significantly simplifying the simulation process, reducing repetitive work, and improving simulation efficiency.
[0040] Reduced learning cost and easy to use: Compared with traditional tools such as Makefile, users only need to use the simulation management tool to call the corresponding simulation software for simulation. By simply learning the prescribed file structure and the simulation instructions defined by the simulation management tool, they can build a verification environment. Even non-professional developers can quickly master and get started, which reduces the learning cost.
[0041] Enhanced flexibility and strong adaptability: The simulation management tool can dynamically generate simulation software instructions based on the instruction parameters entered by the user, and can flexibly adapt to different design files, test cases and simulation option requirements; for complex medium and large designs, the simulation management tool can also easily cope with it, without the need to frequently update and maintain complex Makefile files; for different verification projects, the simulation management tool can be directly ported and reused. For different projects, only the UVM verification environment, simulation environment configuration file, simulation file list and script configuration file need to be modified, without modifying the tool itself.
[0042] Easy debugging and maintenance: Since the simulation management tool is built based on Python, it has powerful debugging functions and rich error information output capabilities. When the user makes an error in modifying the environment configuration file, script configuration file, etc., which causes the simulation management tool to fail to work properly, the user can more easily locate and solve the problem. At the same time, the readability and maintainability of Python code also make it easier to update and maintain the simulation management tool.
[0043] Improve team collaboration efficiency: When multiple developers use and update simulation management tools together, the standardization and readability of Python code and the centralized management features of simulation management tools can greatly reduce the difficulty of debugging and communication costs in team collaboration, thereby improving team collaboration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 Schematic diagram of a flow chart of a simulation test method based on Python according to an embodiment of the present invention;
[0045] Figure 2 It is a schematic diagram of the structure of a Python-based simulation test device according to an embodiment of the present invention;
[0046] Figure 3 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following is a specific implementation method in conjunction with the drawings.
[0048] Reference Figure 1 , a simulation test method based on Python, comprising the steps of:
[0049] Step 1: Build a simulation management tool based on Python; the simulation management tool is used to manage the simulation test process of digital integrated circuits.
[0050] In some embodiments, the specific process of building a simulation management tool based on Python is:
[0051] Define the file framework structure of the simulation management tool, including the UVM verification platform file path, simulation path, environment configuration file and script configuration file; set up the main program based on several Python libraries and custom functions, and the main program is used to parse the instruction parameters entered by the user; set the instruction parameter template, and the instruction parameter template is used to identify the instruction parameters entered by the user through regular matching, and generate corresponding simulation software instructions according to the instruction parameters.
[0052] In some embodiments, the file framework structure of the simulation management tool is shown in Table 1 below:
[0053] Table 1 File framework structure of simulation management tool
[0054]
[0055]
[0056] When defining the file framework structure of the simulation management tool, the UVM verification platform file can be stored in the specified path, and the path can be specified in the verification platform file list tb_fl in the simulation file list filelist; the simulation path sim is used to store the intermediate files generated during the simulation process, and the intermediate files will be classified according to the test case name and random seed number specified by the simulation to create a path; the environment configuration file set_env.csh is used to specify the environment variables such as the UVM library path, simulation software path, RTL path, and current simulation path; the script configuration file config.yaml is used to store the compilation and simulation options required by the user in this project simulation, and configuration parameters such as test vector grouping. When setting the main program based on several Python libraries and custom functions, introduce necessary Python libraries such as sys, os, re, random, time, fileinput, csv, yaml, configparser, openpyxl, and a custom library self_define; define some functions / tasks needed in the main program in the custom library self_define, including opening the script configuration file config.yaml, retrieving the simulation process name, identifying environment variables, checking file paths, etc. Design instruction parameter templates. The instruction parameter templates identify the instruction parameters input by the user through regular matching, and generate corresponding simulation software instructions according to the identified instruction parameters. The instruction parameters include test case name, test case group name, number of simulations, compilation options, simulation stage instructions, waveform saving, coverage collection, random seed specification, simulation type (pre-simulation / post-simulation), standard timing file specification, waveform file loading, breakpoint debug, UVM information printing redundancy specification, regression test result summary, coverage file merging, cleanup of waveform files, cleanup of coverage files, and cleanup of all simulation intermediate files. The designed instruction parameters and brief description are shown in Table 2 below:
[0057] Table 2. Comparison table of command parameters and parameter meanings
[0058]
[0059]
[0060] The main program of the present invention is designated by tsim as an alias. The following are examples of instruction parameters:
[0061] Example 1:
[0062] tsim--comp--elab-t test_name_A--wave--seed=123456
[0063] Compile and simulate: specify the simulation case as test_name_A, the simulation random seed as 123456, and load the waveform;
[0064] tsim--fsdb--ssf=user / project_path / sim / build / sim / test_group_A / test_name_A / 123456 / wave_0.fsdb
[0065] Specify the waveform file path and open it with the waveform loading software.
[0066] Example 2:
[0067] tsim--comp--elab-t test_name_B--wave--seed=654321--post--sdf=1
[0068] Compile and simulate, specify the simulation type as post-simulation, specify the back-annotated standard timing file as the sdf file corresponding to the first macro name in sdf_macro_fl, specify the simulation case as test_name_B, the simulation random seed as 654321, and load the waveform;
[0069] tsim--fsdb--ssf=user / project_path / sim / build / sim / test_group_A / test_name_B / 654321 / wave_0.fsdb
[0070] Specify the waveform file path and open it with the waveform loading software.
[0071] Example 3:
[0072] tsim--comp--elab-g test_group_A--rtimes=100--cov
[0073] Compile and simulate, specify the simulation cases as all cases in group test_group_A, random seed number, no waveform loading, simulation times as 100, and collect coverage for each simulation;
[0074] tsim--regr
[0075] Summarize all the above simulation result information, and list the simulation logs of the simulations that passed and failed in a txt file, in which the simulation logs and simulation instructions of the simulation cases that failed are printed for easy copying;
[0076] tsim --merge_cov
[0077] Merge all coverage vdb files of this regression test into the time_merged.vdb file (time is the merging time) and open it through the waveform loading software to view the coverage situation;
[0078] tsim--clean
[0079] Delete the simulation intermediate files under sim and clean up the memory.
[0080] Step 2: Build a simulation test platform based on the UVM framework and simulation management tools, and configure the environment of the simulation test platform.
[0081] In some embodiments, a simulation test platform is constructed based on the UVM framework and the simulation management tool, and the specific process of configuring the environment of the simulation test platform is as follows:
[0082] According to the standards of the UVM framework, write verification components such as driver, sequencer, monitor, scoreboard, etc., and place them in the specified file path, which can be a tb path; configure environment variables by editing the environment configuration file set_env.csh, which include UVM library path, simulation software path, RTL path, current simulation path, etc. These configurations will ensure that all necessary paths and libraries are correctly referenced during the simulation process; write the script configuration file config.yaml, which stores the relevant configuration parameters of the test project, including the grouping of test cases, compilation and simulation options, test vector grouping, etc.; according to the specific needs of the test project, configure the relevant parameters corresponding to the test project in the simulation test platform, including the specified test case name, test case group name, simulation times, random seed number, etc. These relevant parameters will be entered through the user interface or command line interface of the simulation management tool. Ensure that all necessary software and libraries have been installed correctly and the environment variables have been set correctly. In addition, it is necessary to check whether the UVM verification platform files, RTL files and other related files have been placed in the correct path. Create a specified simulation path (such as sim path). When calling the main program for simulation under this path, the main program will automatically create a path of "test case group name / test case name / random seed number" according to the input instructions, and store the intermediate and result files generated by the simulation here, without manually creating a sub-path.
[0083] Step three: receive the instruction parameters input by the user through the simulation management tool, generate corresponding simulation software instructions according to the instruction parameters, and control the simulation test platform to perform simulation testing according to the simulation software instructions.
[0084] In some embodiments, the specific process of receiving instruction parameters input by the user through the simulation management tool, generating corresponding simulation software instructions according to the instruction parameters, and controlling the simulation test platform to perform simulation testing according to the simulation software instructions is as follows:
[0085] The simulation management tool provides a user interaction interface or command line interface for the user to input the instruction parameters required for the simulation test; the user inputs the required simulation test instruction parameters through the user interaction interface (such as command line interface) provided by the simulation management tool. For example, the user inputs -t test_name_A--wave--seed=123456 to specify the simulation case, generate a waveform file, and set a random seed.
[0086] Through the main program of the simulation management tool, the command parameters entered by the user are regularly identified and parsed; the main program will match the instructions entered by the user according to the predefined command parameter template and extract the corresponding parameter values.
[0087] According to the instruction parameters obtained by parsing, corresponding options are selected from the instruction parameter template of the simulation management tool, and corresponding simulation software instructions are generated; the simulation software instructions include compilation instructions, simulation instructions, waveform generation instructions, etc.
[0088] The simulation management tool calls the system call functions provided by the operating system, such as the function os.system() or the function subprocess.run(), and calls the simulation test platform for simulation testing through the simulation software instructions and the script configuration parameters in the script configuration file; in this process, the simulation management tool will ensure that the environment variables and paths are set correctly so that the simulation software can find the required files and perform corresponding operations. The simulation test platform starts to perform simulation testing according to the instructions received, including compiling RTL code, running test cases, generating waveform files, and other steps. The simulation test platform will save the generated simulation result files to the specified directory. The naming of these directories and files is determined according to the instruction parameters entered by the user and the settings of the simulation management tool.
[0089] Step 4: After the simulation test is completed, the simulation log and the absolute path of the waveform file are printed on the terminal interface through the simulation management tool, and the simulation management tool receives user instructions to perform corresponding operations.
[0090] In some embodiments, after the simulation test is completed, the specific process of printing the simulation log and the absolute path of the waveform file on the terminal interface through the simulation management tool is as follows:
[0091] After the simulation test platform completes the simulation test, the simulation management tool captures the simulation result files generated by the simulation test platform. The simulation result files include but are not limited to simulation log files and waveform files.
[0092] The storage path of the simulation result file is constructed according to the environment variables defined in the environment configuration file (such as set_env.csh) and the instruction parameters (such as test case name, random seed number, etc.) entered by the user through the simulation management tool.
[0093] The simulation management tool parses the storage path to determine the exact location of the simulation result file. This can be achieved by parsing the path string and extracting the directory and file name where the file is located.
[0094] After determining the storage location of the simulation result files, the simulation management tool converts these relative paths into absolute paths, which are the complete paths of the files in the file system, allowing users to directly access and view the simulation result files.
[0095] The absolute path of the simulation result file is printed on the terminal interface through the simulation management tool, so that the user can directly access and view the simulation result file for subsequent analysis and debugging.
[0096] In some embodiments, it also includes summarizing and processing simulation results, and receiving user instructions through a simulation management tool to perform corresponding operations, including but not limited to simulation result summary analysis, merging coverage and other operations.
[0097] In some embodiments, a number of relatively independent simulation paths are set according to the test cases and simulation times specified by the user, and corresponding simulation tests are performed simultaneously through the number of relatively independent simulation paths.
[0098] The total number of simulation tasks that need to be performed can be calculated based on the test cases and simulation times specified by the user. A relatively independent simulation path is assigned to each simulation task. These paths can be implemented by creating subdirectories under the specified simulation directory (such as the sim directory). The naming of the subdirectories can include information such as the test case name, test case group name, and random seed number to ensure the uniqueness and identifiability of the path. For example, for the test case test_name_A, the number of simulations is 10, and the path structure shown in Table 3 below can be created.
[0099] Table 3 Simulation path structure table
[0100]
[0101] Each seed_000000x in Table 3 corresponds to the random seed number of each simulation. When not specified, it is randomly generated by the tool to ensure the randomness of the test stimulus.
[0102] According to the instruction parameters obtained by parsing and the assigned simulation path, the corresponding simulation software instructions are generated for each simulation task; the simulation software instructions include compilation instructions, simulation instructions, waveform generation instructions, etc., and the corresponding simulation path needs to be specified. Using multi-threading or multi-process technology, multiple simulation tasks are started at the same time; each simulation task performs simulation tests under its independent simulation path, including compiling RTL code, running test cases, generating waveform files, etc.; the simulation management tool is responsible for monitoring and managing these parallel simulation tasks to ensure that they can run correctly and generate expected simulation results. After the simulation test is completed, the simulation management tool captures the simulation result files generated by each simulation task, including simulation log files and waveform files; according to the environment configuration file and the instruction parameters entered by the user, the storage path of the simulation result file is constructed and converted into an absolute path; the absolute paths of all simulation result files are printed on the terminal interface for users to directly access and view. Users can use tools such as waveform loading software to analyze and debug waveform files based on the printed simulation result file path. The simulation management tool can also provide additional functions, such as regression test result summary and coverage file merging, to help users conduct subsequent analysis and debugging more conveniently.
[0103] Based on the same inventive concept, corresponding to any of the above embodiments, refer to Figure 2 The present application also provides a Python-based simulation test device for implementing the Python-based simulation test method, including:
[0104] Simulation management tool module, used to manage the simulation test process of digital integrated circuits;
[0105] A simulation test platform construction module is used to build a simulation test platform based on the UVM framework and simulation management tools, and to configure the environment of the simulation test platform;
[0106] The simulation test control module is used to receive the instruction parameters input by the user, generate corresponding simulation software instructions according to the instruction parameters, and control the simulation test platform to perform simulation testing;
[0107] The simulation result processing module is used to process the simulation results after the simulation test is completed, and print the simulation log and the absolute path of the waveform file on the terminal interface.
[0108] In some embodiments, the simulation management tool module includes:
[0109] The file framework definition unit is used to define the organizational structure of the files required for the simulation test, including the storage locations of the UVM verification platform file path, simulation path, environment configuration file, and auxiliary script configuration file;
[0110] The main program unit is built based on several Python libraries and custom functions, which is used to parse the command parameters input by the user and generate the corresponding simulation software commands according to the command parameters;
[0111] The instruction parameter template unit is used to identify the instruction parameters input by the user through regular matching, and generate specific simulation software instructions according to the instruction parameter template;
[0112] The system call interface unit is used to call the system call function provided by the operating system and execute the generated simulation software instructions to control the simulation test process of the simulation test platform.
[0113] The simulation test bench building blocks include:
[0114] The verification component writing unit is used to write the verification component according to the standard of the UVM framework and place it in the specified file path;
[0115] An environment configuration unit is used to configure environment variables by editing an environment configuration file and to write an auxiliary script configuration file, wherein the auxiliary script configuration file stores relevant configuration parameters of the test project;
[0116] The parameter configuration unit is used to configure the relevant parameters corresponding to the test items in the simulation test platform according to the specific requirements of the test items.
[0117] The simulation test control module includes:
[0118] A user interaction interface unit, providing a user interaction interface or a command line interface for a user to input instruction parameters required for simulation testing;
[0119] An instruction parsing unit, used for regular expression recognition and parsing of instruction parameters input by the user;
[0120] An instruction generation unit, used to select corresponding options from an instruction parameter template according to the instruction parameters obtained through analysis, and generate corresponding simulation software instructions;
[0121] The simulation calling unit is used to call the system calling interface unit, and call the simulation test platform for simulation testing through the simulation software instructions and the script configuration parameters in the auxiliary script configuration file.
[0122] The simulation result processing module includes:
[0123] A file capture unit, used for capturing simulation log files and waveform files generated by the simulation test platform;
[0124] A path building unit, used to build a storage path for a simulation log file and a waveform file according to environment variables defined in an environment configuration file and instruction parameters input by a user;
[0125] A path parsing unit, used to parse the storage path and obtain the absolute path of the simulation log file and the waveform file;
[0126] The result printing unit is used to print out the absolute paths of the simulation log files and waveform files on the terminal interface so that users can directly access and view them.
[0127] It also includes a parallel simulation management module, which is used to set up several relatively independent simulation paths according to the test cases and simulation times specified by the user, and perform corresponding simulation tests simultaneously through these relatively independent simulation paths to improve simulation efficiency.
[0128] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides a computer device, including a processor, a memory and a network interface, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method described in any of the above-mentioned embodiments is implemented.
[0129] Figure 3 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0130] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0131] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0132] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0133] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0134] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0135] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0136] The electronic device of the above embodiment is used to implement the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0137] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the computer program is used to enable the computer to execute the method described in any of the above-mentioned embodiments.
[0138] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0139] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0140] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the computer executes the method described in any of the above-mentioned embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0141] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application is limited to these examples. Based on the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations in different aspects of the embodiments of the present application as described above.
Claims
1. A simulation test method based on Python, characterized in that: Includes steps: Build a simulation management tool based on Python; the simulation management tool is used to manage the simulation test process of digital integrated circuits; Build a simulation test platform based on the UVM framework and simulation management tools, and configure the environment of the simulation test platform; Receive instruction parameters input by the user through the simulation management tool, generate corresponding simulation software instructions according to the instruction parameters, and control the simulation test platform to perform simulation testing according to the simulation software instructions; After the simulation test is completed, the simulation log and the absolute path of the waveform file are printed on the terminal interface through the simulation management tool, and the simulation management tool receives user instructions to perform corresponding operations.
2. The Python-based simulation test method according to claim 1, characterized in that: The specific process of building a simulation management tool based on Python is as follows: Define the file framework structure of the simulation management tool, including the UVM verification platform file path, simulation path, environment configuration file, and script configuration file; Set up a main program based on several Python libraries and custom functions. The main program is used to parse the command parameters entered by the user. Set the instruction parameter template, which is used to identify the instruction parameters input by the user through regular matching and generate corresponding simulation software instructions according to the instruction parameters.
3. The Python-based simulation test method according to claim 2, characterized in that: The specific process of building a simulation test platform based on the UVM framework and the simulation management tool and configuring the environment of the simulation test platform is as follows: According to the UVM framework standard, write the verification component and place it in the specified file path; By editing the environment configuration file, configuring the environment variables, and writing the script configuration file, the script configuration file stores the relevant configuration parameters of the test project; According to the specific requirements of the test project, configure the relevant parameters corresponding to the test project in the simulation test platform.
4. The Python-based simulation test method according to claim 2, characterized in that: The specific process of receiving the instruction parameters input by the user through the simulation management tool, generating corresponding simulation software instructions according to the instruction parameters, and controlling the simulation test platform to perform simulation testing according to the simulation software instructions is as follows: The simulation management tool provides a user interaction interface or command line interface for the user to input instruction parameters required for simulation testing; Through the main program of the simulation management tool, regular recognition and analysis of the instruction parameters input by the user are performed; According to the instruction parameters obtained by parsing, a corresponding option is selected from the instruction parameter template of the simulation management tool, and a corresponding simulation software instruction is generated; The system call function provided by the operating system is called through the simulation management tool, and the simulation test platform is called to perform simulation testing through the simulation software instructions and the script configuration parameters in the script configuration file.
5. The Python-based simulation test method according to claim 1, characterized in that: After the simulation test is completed, the specific process of printing the simulation log and the absolute path of the waveform file on the terminal interface through the simulation management tool is as follows: After the simulation test platform completes the simulation test, the simulation management tool captures the simulation result file generated by the simulation test platform; Construct the storage path of the simulation result file according to the environment variables defined in the environment configuration file and the instruction parameters entered by the user; Parse the storage path and obtain the absolute path of the simulation result file; The absolute path of the simulation result file is printed on the terminal interface through the simulation management tool, so that users can directly access and view the simulation result file.
6. The Python-based simulation test method according to claim 1, characterized in that: According to the test cases and simulation times specified by the user, several relatively independent simulation paths are set, and corresponding simulation tests are performed simultaneously through the several relatively independent simulation paths.
7. A Python-based simulation test device, used to implement the Python-based simulation test method as described in any one of claims 1 to 6, characterized in that: include: Simulation management tool module, used to manage the simulation test process of digital integrated circuits; A simulation test platform construction module is used to build a simulation test platform based on the UVM framework and simulation management tools, and to configure the environment of the simulation test platform; The simulation test control module is used to receive the instruction parameters input by the user, generate corresponding simulation software instructions according to the instruction parameters, and control the simulation test platform to perform simulation testing; The simulation result processing module is used to process the simulation results after the simulation test is completed, and print the simulation log and the absolute path of the waveform file on the terminal interface.
8. A computer device, characterized in that: It comprises a processor, a memory and a network interface, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the Python-based simulation test method as described in any one of claims 1 to 6 is implemented.
9. 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 the processor, the Python-based simulation test method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the Python-based simulation test method as described in any one of claims 1 to 6.