Automatic filing method, device, electronic device, storage medium and computer program product
By generating mapped files and packaging them into archive files, the problem of time-consuming and resource consumption in integrated circuit design is solved, and scripts are automatically run from archive files are realized, which improves the efficiency of integrated circuit design.
Patent Information
- Application Number
- CN202411047166.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-01
AI Technical Summary
During the integrated circuit design process, when using EDA tools, a large number of additional files need to be read. Traditional technology collects and packages these files and consumes a lot of resources. The packaged files need to be manually matched when running the unpacked new file path. , reducing design efficiency.
It provides an automatic archiving method, which stores file reference information in the target script file by generating a mapping file, packages it into a target archive file, and supports automatically running scripts from the archive file without additional script adaptation processing.
It effectively reduces the time and resources required for file archiving, improves the efficiency of EDA tool development, testing and use, and simplifies the file path matching process.
Smart Images

Figure CN118568053B_ABST
Abstract
Description
Technical Field
[0001] The present application generally relates to the field of document archiving technology, and more specifically, to an automatic archiving method, device, electronic device, storage medium and computer program product. Background Art
[0002] With the advancement of manufacturing technology and design technology, the design methods of electronic systems have undergone profound changes, from computer-aided design (CAD), computer-aided engineering (CAE) to electronic design automation (EDA), the degree of design automation is getting higher and higher, and the complexity of design is getting stronger and stronger.
[0003] Integrated circuit EDA refers to the design method that uses computer-aided design software to complete the functional design, synthesis, verification, physical design (including layout, wiring, layout, design rule checking, etc.) of ultra-large-scale integrated circuit chips. At present, EDA technology has become a powerful tool for modern electronic design. Without the support of EDA technology, it is unimaginable to complete the design and manufacture of ultra-large-scale integrated circuits. Integrated circuit designers need to use EDA tools to design complex integrated circuits with hundreds of thousands to tens of billions of transistors to reduce design deviations, improve the success rate of tape-out and save tape-out costs.
[0004] During the development, testing, and use of EDA tools, relevant personnel interact with EDA tools by writing and executing TCL (Tool Command Language) scripts. During the execution of these scripts, a large number of additional files (such as circuit design files, library files, design constraint files, etc.) are often required to be read. In order to facilitate various related tasks of EDA tools, these files that need to be read additionally are often collected and packaged for emergency use.
[0005] As integrated circuit design becomes more and more complex, a large number of files need to be read additionally during the execution of related TCL scripts. In addition, in order to serve diversified design purposes, these files are often stored in different file directories, that is, the storage paths of various files are different. Therefore, if traditional technology is used directly to collect and package these files, it will take a lot of time and resources. Moreover, when it is necessary to run the script through the packaged file, it will take a lot of time to manually match the new file path after unpacking, which greatly reduces the overall efficiency of EDA tool development, testing and use. Summary of the invention
[0006] An exemplary embodiment of the present application is to provide an automatic archiving method, apparatus, electronic device, storage medium and computer program product, which can effectively reduce the time and resources required for file archiving, and the packaged archive file supports automatically running the corresponding script from the archive file without spending a lot of time manually matching the new file path after unpacking.
[0007] According to a first aspect of an embodiment of the present application, an automatic archiving method is provided, comprising: in response to an archive file creation instruction, determining, according to a target script file specified by the archive file creation instruction, the various files required to run the target script file, and generating a mapping file; packaging the target script file, the various files, and the mapping file into a target archive file; wherein the mapping file is used to store: file reference information used to refer to the various files in the commands included in the target script file, and the file names of the various files; wherein the step of determining, according to the target script file specified by the archive file creation instruction, the various files required to run the target script file, and generating a mapping file in response to the archive file creation instruction comprises: in response to a first archive file creation instruction, determining the various files by actually executing a part of special commands and parsing another part of special commands, and generating the mapping file; wherein the special commands include: commands related to file archiving among the commands included in the target script file.
[0008] According to a second aspect of an embodiment of the present application, an automatic archiving device is provided, comprising: a determining unit, configured to respond to an archive file creation instruction, determine the various files required to run the target script file according to the target script file specified by the archive file creation instruction, and generate a mapping file; a packaging unit, configured to package the target script file, the various files and the mapping file into a target archive file; wherein the mapping file is used to store: file reference information used to refer to the various files in the commands included in the target script file, and the file names of the various files; wherein the determining unit is specifically configured to: respond to a first archive file creation instruction, determine the various files by actually executing a part of special commands and parsing another part of special commands, and generate the mapping file; wherein the special commands include: commands related to file archiving among the commands included in the target script file.
[0009] According to a third aspect of an embodiment of the present application, a computer-readable storage medium storing instructions is provided. When the instructions are executed by a processor of an electronic device, the electronic device can perform the automatic archiving method as described above.
[0010] According to a fourth aspect of an embodiment of the present application, an electronic device is provided, comprising: at least one processor; and at least one memory storing computer executable instructions, wherein when the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to execute the automatic archiving method as described above.
[0011] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer executable instructions, which, when executed by at least one processor, implement the automatic archiving method as described above.
[0012] According to the automatic archiving method, device, electronic device, storage medium and computer program product of the exemplary embodiments of the present application, it is possible to effectively reduce the time and resources required for file archiving, and the packaged archive file supports automatically running the corresponding script from the archive file without the need for additional script adaptation processing.
[0013] Other aspects and / or advantages of the general inventive concept of the present application will be set forth in part in the following description, and some will be clear from the description or may be learned through practice of the general inventive concept of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The above and other objects and features of the exemplary embodiments of the present application will become more apparent through the following description in conjunction with the accompanying drawings which exemplarily illustrate the embodiments, wherein:
[0015] Figure 1 A flowchart showing an automatic archiving method according to an exemplary embodiment of the present application;
[0016] Figure 2 A flowchart showing a method for automatically running an archive file according to an exemplary embodiment of the present application;
[0017] Figure 3 A structural block diagram showing an automatic filing device according to an exemplary embodiment of the present application;
[0018] Figure 4 A structural block diagram of an electronic device according to an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0019] Reference will now be made in detail to embodiments of the present application, examples of which are shown in the accompanying drawings, wherein like reference numerals refer to like parts throughout. The embodiments will be described below with reference to the accompanying drawings in order to explain the present application.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0021] It should be noted that the phrase "at least one of the items" in this application includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.
[0022] Figure 1 A flow chart of an automatic archiving method according to an exemplary embodiment of the present application is shown. The method can be implemented by a computer program, and as an example, the method can be executed by application software (e.g., an EDA tool) installed in an electronic device, for example, the method can be executed by an archive function module embedded in the EDA tool.
[0023] Reference Figure 1 In step S100, in response to the archive file creation instruction, according to the target script file specified by the archive file creation instruction, various files required to run the target script file are determined, and a mapping file is generated.
[0024] As an exemplary embodiment, the target script file may be a test case script file of an integrated circuit. It should be understood that it may also be other types of script files, and the present application does not limit this.
[0025] In step S200, the target script file, the various files and the mapping file are packaged into a target archive file.
[0026] Packing refers to filing a large number of files or directories into a total file, and compression refers to simplifying a large file into a small file through some compression algorithms. As an exemplary embodiment, the target archive file after packing can also be compressed, that is, the final form of the target archive file can be a compressed package form.
[0027] The mapping file is used to store: file reference information used to refer to each file in the commands included in the target script file, and the file name of each file.
[0028] The commands included in the target script file can be understood as the commands involved in the content of the target script file. For example, they may specifically include: commands in the target script file, and commands in other files (for example, other tcl script files, UPF files, etc.) read or loaded by executing commands in the target script file (for example, source command, read_upf command, load_upf command, etc.).
[0029] As an exemplary embodiment, a mapping file may include: a first mapping file and a second mapping file.
[0030] The first mapping file (for example, may be named compare_name.txt) is used to store in association: file reference information in the form of file names in commands included in the target script file, and the file name of the file referred to by the file reference information in the target archive file.
[0031] As an example, in the first mapping file, file reference information in the form of a file name and the file name of the file referred to by the file reference information in the target archive file can be recorded in a key-value pair format, wherein the key is the file reference information in the form of a file name (that is, the original file name of the file), and the value is the file name of the file in the target archive file (for example, it can be the original file name or a new file name different from the original file name).
[0032] The second mapping file (for example, may be named map_glob.txt) is used to store in association: file reference information in a non-file name format in commands included in the target script file, and an original file name of at least one file referred to by the file reference information.
[0033] As an example, in the second mapping file, the file reference information in a non-file name format and the original file name of at least one file referred to by the file reference information may be recorded in a key-value pair, wherein the key is the file reference information in a non-file name format (for example, the file path / path / ), the value (value) is the original file name of the at least one file (for example, the original file names av, bv, cv of the three files contained in the directory " / path / ").
[0034] As an exemplary embodiment, whenever a file is determined to be a file required to run the target script file, if the original file name of the file is the same as the file name of an existing file in the target archive file, a new file name is designed for the file, and the file is saved in the target archive file with the new file name; if the original file name of the file is different from the file names of the existing files in the target archive file, there is no need to design a new file name for the file, and the file is directly saved in the target archive file with the original file name.
[0035] The new file name of the file can be obtained based on the original file name of the file. As an exemplary embodiment, the new file name of the file may be: the file name obtained by adding a random number or a timestamp to the original file name of the file to ensure that the file names of the files in the target archive file are different. As an example, assuming that the original file name of the file is av, the new file name may be a.v_random number to prevent file name conflicts. The reason for this setting is that the various files in the archive file are usually collected from different paths, and it is difficult to avoid the situation where files with the same name will appear. In addition, as another example, another optional naming method may be: assuming that the original file name is av, the new file name is a.v_timestamp. However, considering that the use of timestamp naming is prone to trigger bugs, because the computer runs faster, it may be necessary to package many files within 1s. If the same timestamp is attached to the files with the same name, problems will arise, so the preferred method is to use random numbers to name the new file name.
[0036] In addition, it should be understood that only one mapping file may be provided, that is, the contents stored in the first mapping file and the second mapping file are stored in one mapping file without distinguishing between the first mapping file and the second mapping file.
[0037] As an exemplary embodiment, the archive file creation instruction may include two types of instructions, namely, a first archive file creation instruction and a second archive file creation instruction. In response to the first archive file creation instruction, an archive file can be quickly generated; in response to the second archive file creation instruction, in addition to being able to archive files, a golden file can also be generated, and the golden file can be packaged into a target archive file together with a target script file, various files required to run the target script file, and a mapping file. The golden file is used to record the expected output results during testing.
[0038] As an exemplary embodiment, in response to the first archive file creation instruction, by actually executing a part of the special commands and parsing another part of the special commands, the various files required to run the target script file are determined, and a mapping file is generated. Hereinafter, the mode of this exemplary embodiment is also referred to as a packaging mode, and an exemplary embodiment of the packaging mode will be described below, which will not be expanded here.
[0039] As an exemplary embodiment, in response to the second archive file creation instruction, by actually running the target script file, the various files required to run the target script file are determined, and a mapping file and a golden file are generated. Hereinafter, the mode of this exemplary embodiment is also referred to as golden mode 1. The exemplary embodiment of golden mode 1 will be described below, which will not be expanded here.
[0040] The special commands include: commands related to file archiving among the commands included in the target script file.
[0041] As an exemplary embodiment, the command related to file archiving is a command related to reading or searching for files, and may include but is not limited to: a file reading command, a file loading command, and a file searching command. As an example, the command related to file archiving may include but is not limited to at least one of the following items:
[0042] read_library: read library file;
[0043] read_design: reads design files, such as Verilog files;
[0044] read_upf: reads UPF (Unified Power Format) files;
[0045] load_upf: loads UPF file. This command has the same function as read_upf and is a command nested in UPF.
[0046] read_spef: reads SPEF (Standard Parasitic Exchange Format) files;
[0047] read_fsdb: read FSDB (Fast Signal Database) file;
[0048] read_saif: reads SAIF (Switching Activity Interchange Format) files;
[0049] read_tc: reads the test case file;
[0050] source: read and run tcl script files;
[0051] glob: find and return the file path;
[0052] read_golden: read golden file;
[0053] read_gui_file: Read GUI (Graphical User Interface) file.
[0054] As an exemplary embodiment, the file reference information used to refer to a file in a special command may include: file reference information in the form of a file name and file reference information in the form of a non-file name. As an example, the file reference information in the form of a file name may include: a specific file name in the path / to / file parameter. As an example, the file reference information in the form of a non-file name may include: a path default form (for example, containing wildcards) , for example, file reference information in the glob command.
[0055] The following are examples of glob command usage: is a wildcard character):
[0056] glob / path / , search for all files in the directory " / path / ";
[0057] glob / path / .txt, search for all files with the extension .txt in the directory " / path / ";
[0058] glob -recursive / path / , search for all files in the directory " / path / " and its subdirectories;
[0059] glob / path / abc , search for all files starting with "abc" in the directory " / path / ".
[0060] In the above example, the file reference information in non-file name form includes: / path / 、 / path / .txt, -recursive / path / 、 / path / abc .
[0061] In addition, it is worth noting that: for the case where two special commands are nested, for example, similar to read_design[glob / path / ] is nested with another special command (glob command). The non-file name file reference information in the glob command is " / path / " The original file name of at least one file referred to is: av, bv, cv. Correspondingly, the file reference information in the file name format in the read_design command is: av, bv, cv.
[0062] Figure 2 A flowchart of a method for automatically running an archive file according to an exemplary embodiment of the present application is shown. The method can be implemented by a computer program, and as an example, the method can be executed by application software (e.g., an EDA tool) installed in an electronic device, for example, the method can be executed by an archive function module embedded in the EDA tool.
[0063] Reference Figure 2 In step S300, in response to the archive file execution instruction, the target script file is executed based on the target archive file specified by the archive file execution instruction.
[0064] Step S300 includes: reading a target script file and a mapping file from a target archive file; executing the commands included in the target script file in sequence, wherein, if the executed command includes file reference information in the mapping file, obtaining the target file name corresponding to the file reference information in the command from the mapping file, and performing operations on the file with the target file name in the target archive file according to the command.
[0065] As an exemplary embodiment, if the executed command includes file reference information in a non-file name form in a mapping file, the original file name corresponding to the file reference information in a non-file name form in the command is obtained from the mapping file; if the executed command includes file reference information in a file name form in a mapping file, the target file name corresponding to the file reference information in a file name form in the command is obtained from the mapping file, and the operation is performed on the file with the target file name in the target archive file according to the command.
[0066] That is, for the case where two commands (both of which include file reference information in the mapping file) are nested, for example, similar to read_design [glob / path / ] is nested with another special command (glob command), the glob command is executed first to obtain the file reference information in the non-file name form in the command from the mapping file " / path / "Then execute the read_design command. Since the read_design command includes the file reference information "av, bv, cv" in the file name format obtained by the glob command, the target file name corresponding to the file reference information "av, bv, cv" in the file name format in the command is obtained from the mapping file, and the operation is performed on the file with the target file name in the target archive file according to the command.
[0067] As an exemplary embodiment, it can be determined whether the command includes file reference information in the form of a file name in the mapping file or file reference information in the form of a non-file name according to the type of the executed command. For example, if the executed command is a special command that is not a glob command, it is determined that the command includes file reference information in the form of a file name in the mapping file; if the executed command is a glob command, it is determined that the command includes file reference information in the form of a non-file name in the mapping file.
[0068] As an exemplary embodiment, in the case where the mapping file includes a first mapping file and a second mapping file, in step S100, the file reference information in the glob command can be saved in the second mapping file, and the file reference information in the special command that is not a glob command can be saved in the first mapping file. Accordingly, in step S300, if the executed command is a glob command, the original file name corresponding to the file reference information in the command is obtained from the second mapping file; if the executed command is a special command that is not a glob command, the target file name corresponding to the file reference information in the command is obtained from the first mapping file.
[0069] As an exemplary embodiment, the archive file running instruction may include two types of instructions, namely, a first archive file running instruction and a second archive file running instruction. In response to the first archive file running instruction, the target script file can be automatically run; in response to the second archive file running instruction, in addition to being able to automatically run the target script file, a golden file can also be generated, and the generated golden file can be added to the target archive file to update the target archive file. For example, if there is an original golden file in the target archive file, the original golden file can be replaced with the newly generated golden file, that is, the golden file in the target archive file is updated.
[0070] As an exemplary embodiment, the target script file can be run based on the target archive file in response to the first archive file run instruction. Hereinafter, the mode of this exemplary embodiment is also referred to as the extract and run mode, and an exemplary embodiment of the extract and run mode will be described below, which will not be expanded here.
[0071] As an exemplary embodiment, in response to the second archive file execution instruction, based on the target archive file, the target script file can be executed to generate a golden file, and the generated golden file can be added to the target archive file to update the target archive file. Hereinafter, the mode of this exemplary embodiment is also referred to as golden mode 2. The exemplary embodiment of golden mode 2 will be described below, which will not be expanded here.
[0072] In addition, as an exemplary embodiment, if the target archive file is in a compressed package form, the target archive file is first decompressed and unpacked, and then the target script file and the mapping file are read from the target archive file.
[0073] The exemplary embodiment of the present application provides a method for automatic packaging and immediate execution of programs, and clarifies the technical specifications for automatically creating corresponding archive files from scripts (e.g., test case scripts), and automatically running scripts directly from archive files. Through the exemplary embodiments of the present application, the time and resources required for file archiving can be effectively reduced, and archive files created using traditional technologies cannot support automatic running of scripts from archive files. The scripts need to be manually modified to make the script commands match the path information of each file required to run the script in the archive file before the script can be run normally from the archive file. The present application supports automatic running of scripts from archive files by automatically setting a mapping file in the archive file without the need for additional script adaptation processing.
[0074] Example 1: Packaging mode
[0075] The first archive file creation instruction can be: elpc -archive tc.tar.gz -s tc.tcl, which can trigger the call to execute the archive function of the EDA tool, and generate an archive file named tc.tar.gz (or abbreviated as tc.tgz) (i.e., the target archive file) from a single test case script tc.tcl (i.e., the target script file). The elpc in this command represents the EDA tool, and the name can be customized by setting environment variables; the option -archive indicates that the archive file corresponding to the parameter (path or file name) following it is generated in the packaging mode; the full name of the option -s is -script_file, which means running the file corresponding to the parameter (path or file name) following it and automatically exiting.
[0076] As an exemplary embodiment, the execution logic in response to the first archive file creation instruction may include: by running the target script file in a simulated manner, determining the various files needed to run the script under actual testing conditions and generating a mapping file, which is equivalent to the EDA tool running the target script file in a simulated manner in packaging mode.
[0077] Specifically, as an example, in response to the first archive file creation instruction, the target script file is read, and the type of each command included in the target script file is determined in turn according to the execution order;
[0078] If the command belongs to the first special command set, the command is parsed to determine that the target file referred to by the file reference information in the command belongs to the file required to run the target script file, and the file reference information and the file name of the target file in the target archive file are associated and saved in the mapping file;
[0079] If the command belongs to the second special command set, the command is actually executed to determine that the target file referred to by the file reference information in the command belongs to the file required to run the target script file, and the file reference information and the file name of the target file in the target archive file are associated and saved in the mapping file;
[0080] If the command belongs to the third special command set, the command is actually executed to determine the original file name of at least one file referred to by the file reference information in the command, and the file reference information and the original file name of the at least one file are associated and saved in the mapping file.
[0081] The third special command set may include but is not limited to: glob command. As an example, the original file name of at least one file referred to by the file reference information in the non-file name form may be determined by actually executing the glob command, for example, by actually executing glob / path / , confirm " / path / " refers to the original file names of the three files av, bv and cv contained in the directory " / path / ".
[0082] The special commands in the second special command set are commands that need to be actually executed in the packaging mode except for the third special command set. As an example, the special commands in the second special command set may include but are not limited to: read_upf, load_upf, source. For example, by actually executing the read_upf command to read the UPF file, each special command in the UPF file can be further executed or parsed to determine the files required by the UPF file. And, by analogy, if there is a special command belonging to the second special command set in the UPF file (for example, the load_upf command), it is necessary to further actually execute the special command to continue to load another nested UPF file, and then execute or parse each special command in the other UPF file.
[0083] The special commands in the first special command set may include: special commands other than the second special command set and the third special command set. As an example, the special commands in the first special command set may include but are not limited to: read_library, read_design, read_spef, read_fsdb, read_saif, read_tc, read_golden, and read_gui_file.
[0084] As an example, when the first archive file creation instruction includes an exclude option, when the target file is not a file limited by the exclude option, it is determined that the target file is a file required to run the target script file, and the exclude option is used to exclude files or directories.
[0085] As an example, when the first archive file creation instruction includes a specified option, when the target file belongs to the file defined by the specified option, it is determined that the target file belongs to the file required to run the target script file, and the specified option is used to specify the file or directory.
[0086] As an example, an exclude option might be of the form: -exclude_archive<paths:...> , used to exclude the specified path when packaging the archive (parameter<paths:...> ) to exclude files that do not need to be packaged.
[0087] As an example, the option might be specified as: -include_archive<paths:...> , used to package only the files with the specified path (parameter<paths:...> The path indicated by ) matches the file or file in the directory, thus providing the function of specifying the files that need to be packaged.
[0088] In addition, as an exemplary embodiment, the execution logic in response to the first archive file creation instruction may further include: after reading the target script file, re-registering the non-special commands included in the target script file as empty commands. For example, after reading the target script file and before parsing or executing the target script file content, the non-special commands included in the target script file may be re-registered as empty commands.
[0089] In the packaging mode, when the type of each command included in the target script file is determined in turn according to the execution order, if the command is a common command (common commands, as opposed to special commands, refer to commands that are not related to the archiving function), the command will be skipped silently, that is, it is not necessary to execute the command or parse it. For example, the common commands can be skipped silently in the packaging mode in the following manner: when entering the packaging mode, these common commands are reset to empty commands before starting to parse or execute the script commands, so that no operation is performed on the command.
[0090] In packaging mode, when determining the type of each command included in the target script file in the order of execution, if the command is a special command, the following operations are performed:
[0091] 1) If the path / to / file parameter in the command matches the specified path in the exclude option, the packaging logic of the command is not executed. For example, if the path / to / file parameter following the command (that is, the path / to / file parameter in the command) is recognized as the specified path in the exclude option, the packaging logic of the command is not executed, that is, it is not recorded in the mapping file, and the file it refers to is not saved in the target archive file.
[0092] 2) If the path / to / file parameter in the command does not match the specified path in the exclusion option, or is identified as matching the specified path in the specified option (for example, the path / to / file parameter that follows is not the specified path in the exclusion option, or is identified as the specified path in the specified option), the file on the path will be recorded in the mapping file in a key-value pair, where the key is the original file name (that is, the specific parameter value of the file parameter in the path / to / file parameter), and the value is its original file name or a new file name designed for it (if its original file name is the same as the file name of an existing file in the target archive file, a new file name is designed for the file); and the file on the path will also be saved in the target archive file with the original file name or the new file name (if a new file name is designed for the file, the new file name is used). Taking the read_design av command as an example, the relative path of the av file will be automatically processed and converted into an absolute path, and then the av file will be found in the system, copied with the original file name or the new file name, and added to the target archive file.
[0093] 3) If the command is a glob command, then the command containing wildcards will be The path (for example, / path / ) is recorded in the mapping file as a key-value pair, where the key is a wildcard The file reference information is a value that is an original file name (for example, av, bv, cv) of the at least one file.
[0094] In addition, taking the elpc tool as an example, the order in which the tool reads files is read_library a.lib, read_design av, and read_upf a.upf. In fact, in the packaging mode of the archiving function, the tool does not actually read the library (library) and circuit design (design) files, so that no circuit diagram (circuitdiagram) data is generated in the program memory, but the tool will actually read the UPF file. This is because the content of the UPF file may contain a load_upf command, which also needs to read files. These files also need to be packaged. Therefore, if it is not processed, it will occur in the process of executing the read_upf command to read the UPF file. When running the UPF command to obtain the library and design circuit diagram data, the tool will crash due to a program exception. In order to solve the problem of program crash, in packaging mode, commands not related to packaging will be re-registered as empty commands before executing read_upf (for example, these commands are re-registered when entering packaging mode at the beginning). On the one hand, this is to prevent the UPF command from failing to read data and causing the program to crash. On the other hand, it can also smoothly allow the load_upf command to collect files in packaging mode. In addition, another benefit is that it saves the running time of packaging.
[0095] In addition, as an exemplary embodiment, in packaging mode, the EDA tool will rename the source and glob commands of the TCL interpreter to ennoSource and ennoGlob, and register a new source and glob command. The newly registered source and glob commands will be used to replace the original source and glob commands of the TCL interpreter to complete the file collection function.
[0096] In addition, as an exemplary embodiment, if there is a command read_golden goldenPath in the target script file, it indicates that the target script file corresponds to a golden file, where glodenPath is a variable, and glodenPath can be assigned to / Path / golden.txt in advance through setgoldenPath / Path / golden.txt, so that when the read_golden command is encountered in packaging mode, the golden.txt file will be collected into the target archive file.
[0097] Example 2: Extract and run mode
[0098] The first archive file running instruction can be: elpc -s tc.tar.gz | -init tc.tar.gz. This command can be used to run the EDA tool, extract the target script file in the target archive file tc.tar.gz, and run the extracted target script file. The running result is equivalent to the result of running the original target script file tc.tcl. The elpc and option -s in this command are the same as above; the full name of option -init is -init_file, which means running the file corresponding to the parameter (path or file name) following it, but not exiting. You can choose between -s tc.tar.gz and -init tc.tar.gz as needed.
[0099] As an exemplary embodiment, the execution logic in response to the first archive file execution instruction may include: firstly detecting whether the target archive file exists, if so, unpacking the target archive file, and then opening and reading the target script file and mapping file in the package. When sequentially executing the commands included in the target script file, if the executed command is a common command, the command will be executed as usual; if the executed command is a special command, the following operations will be performed:
[0100] 1) If the path / to / file parameter in the command matches the specified path in the exclude option, the command will be executed as usual.
[0101] 2) If the path / to / file parameter in the command does not match the specified path in the exclude option, or is identified as matching the specified path in the specified option, the target file name corresponding to the file reference information is obtained from the mapping file in memory, and then the file corresponding to the target file name is found in the unpacked location of the target archive file, and the operation that the command should perform on it is performed.
[0102] 3) If the command is a glob command, the original file name corresponding to the file reference information in the non-file name format in the command will be obtained from the mapping file in the memory.
[0103] golden mode (-archive_golden)
[0104] With the -archive_golden option, the EDA tool supports generating a golden file in golden mode, and then packages the golden file with other necessary files. A golden file is a file that records the expected output results during testing, and is used to compare whether the actual output is consistent with the expected output. Here, generating a golden file in golden mode means that the original golden file is outdated, and a new golden file is generated again with the current EDA tool to facilitate subsequent comparison.
[0105] Example 3: golden mode 1 (running script files and packaging)
[0106] The second archive file creation instruction can be: elpc -init tc.tcl -archive_golden tc.tgz, which runs the EDA tool, executes the target script file tc.tcl, generates the golden file, and packages it with other necessary files into the target archive file tc.tgz. The elpc and option -init in the command are the same as above; the option -archive_golden indicates that the target archive file corresponding to the parameter (path or file name) following it is generated in the golden mode.
[0107] As an exemplary embodiment, the execution logic in response to the second archive file creation instruction may include: generating a mapping file and a new golden file by actually running the target script file tc.tcl, and packaging and compressing the golden file together with various other files and mapping files needed when running the target script file into a target archive file tc.tgz, which is equivalent to being in golden mode, and the EDA tool will actually run the target script file tc.tcl.
[0108] Specifically, as an example, in response to the second archive file creation instruction, the target script file is read, each command included in the target script file is executed sequentially and the type of the command is determined; if the command belongs to the first special command set or the second special command set, it is determined that the target file referred to by the file reference information in the command belongs to the file required to run the target script file, and the file reference information and the file name of the target file in the target archive file are associated with each other and saved in the mapping file; if the command belongs to the third special command set, the original file name of at least one file referred to by the file reference information in the command is determined, and the file reference information and the original file name of the at least one file are associated with each other and saved in the mapping file.
[0109] As an example, in golden mode, the files that are actually read in the tcl script, such as library and design files, will be executed to read the circuit into the EDA tool. In addition, except for the source and glob commands, the EDA tool will not re-register other commands. The reason for using the newly registered source and glob commands is that only the new source and glob commands have the archiving function, and other commands related to packaging will not be re-registered. All will run as usual, but the files will be collected and packaged during the operation, and the mapping file will still be generated. Finally, the generated golden files, mapping files, and .v, .lib, .tcl and other files are packaged into the target archive file. Compared with the original process of generating golden files first and then packaging, this application combines the generation of golden files and packaging into one step, saving time and with a higher degree of automation.
[0110] Example 4: golden mode 2 (running archive files and packaging again)
[0111] The second archive file running command can be: elpc -init tc.tgz -archive_golden tc.tgz. This command is used to run the EDA tool, which can decompress and execute the target archive file tc.tgz, generate the golden file, and repackage it with other necessary files into a new target archive file tc.tgz. The elpc, option -init, and option -archive_golden in this command are the same as above. If the parameters (path or file name) following option -init and option -archive_golden are the same, the new target archive file will replace the old target archive file.
[0112] As an exemplary embodiment, the execution logic in response to the second archive file running instruction may include: decompressing the target archive file tc.tgz, actually running the extracted target script file (assuming the file name is still tc.tcl), generating a new golden file, and packaging and compressing the golden file together with various other files into a new tc.tgz, which is equivalent to that in golden mode two, the EDA tool will actually run the target script file tc.tcl.
[0113] As an example, in golden mode 2, the target archive file will be decompressed and executed, and files such as library and design will be actually read, so that the circuit can be read into the EDA tool. In addition, except for the source and glob commands, the EDA tool will not re-register other commands. Finally, the EDA tool will repackage the generated golden files, mapping files, and .v, .lib, .tcl and other files into a new target archive file. If the new target archive file has the same name and path as the old archive file, the old archive file will be replaced with the new one, which is equivalent to completing the function of resetting the golden file of the target archive file. Compared with unpacking, running, and then packaging, it saves time and has a higher degree of automation.
[0114] Manual archiving of files using the Linux tar and gzip commands is fully compatible with the application's archiving functionality, but archiving files that are incompatible with tar and gzip is not supported.
[0115] According to an exemplary embodiment of the present application, no intermediate files are generated during the processing; in the packaging mode, no redundant files are generated; in the extract and run mode, after running the archive file, the tool will generate a "tc" directory under the directory where tc.tar.gz is located, which contains all the files in the archive file. The reason for retaining the directory where the archive file is decompressed is to make the unpacking logic consistent with the unpacking logic of the Linux tar command, so that the generated archive file can be moved to other locations or other Linux machines and then run.
[0116] The program automatic packaging and instant execution method provided in the present application is an archiving function module for collecting files embedded in the EDA tool. If the target command elpc -init tc.tcl -archive tc.tgz -exclude_archive / path / a is executed, various files read by the program (such as library, design, gui files, etc., as well as source files and golden files in tcl) will be put into a compressed package tc.tgz (but the parameters following -exclude_archive will be excluded). Then, the tc.tgz can be directly executed by the EDA tool through the target command elpc -init tc.tgz. The result is the same as elpc -init tc.tcl. Its function is to automatically package and compress a bunch of files into a package, which is convenient for moving, uploading and downloading to the server.
[0117] Specifically, in order to maintain the correctness of a large number of original functions, EDA tools will retain a large number of test cases on the code server. Before merging new codes, these original functional test cases are run on the new codes. Usually, there are dozens of files for one test case. If one test case corresponds to a folder, and each folder contains relevant required files, it will be very redundant, resulting in low search efficiency and waste of disk space. After using the archiving function, these tens of thousands of test cases are all in the form of compressed packages on the code server, which is convenient for query and saves space. If there is a problem that cannot be found at other sites, the archiving function can be used to compress the relevant files into a compressed package. When working in the packaging mode of the archiving function, the library and design files will not be actually read. The packaging will be very fast and save resources. Relevant personnel can easily put the archived files in a production environment with better debugging, reproduce the on-site situation, find problems and solve them. In addition, this application supports automatic running of scripts from archived files by automatically setting mapping files in archived files without the need for additional script adaptation processing.
[0118] Figure 3 A structural block diagram of an automatic filing device according to an exemplary embodiment of the present application is shown.
[0119] like Figure 3 As shown, the automatic filing device according to the exemplary embodiment of the present application includes: a determination unit 100 and a packaging unit 200 .
[0120] Specifically, the determination unit 100 is configured to respond to an archive file creation instruction, determine various files required to run the target script file according to the target script file specified by the archive file creation instruction, and generate a mapping file.
[0121] The packaging unit 200 is configured to package the target script file, the various files and the mapping file into a target archive file.
[0122] The mapping file is used to store: file reference information used to refer to each file in the commands included in the target script file, and the file name of each file.
[0123] As an exemplary embodiment, the automatic archiving device according to the exemplary embodiment of the present application may also include: an operation unit (not shown), which is configured to respond to an archive file operation instruction and execute the target script file based on the target archive file specified by the archive file operation instruction.
[0124] As an example, the running unit may be configured to: read the target script file and the mapping file from the target archive file; and execute the commands included in the target script file in sequence, wherein, if the executed command includes file reference information in the mapping file, the target file name corresponding to the file reference information in the command is obtained from the mapping file, and the operation is performed on the file with the target file name in the target archive file according to the command.
[0125] As an exemplary embodiment, the mapping file may include: a first mapping file and a second mapping file; wherein the first mapping file is used to associatively store: file reference information in the form of a file name in the commands included in the target script file, and the file name of the file referred to by the file reference information in the target archive file; the second mapping file is used to associatively store: file reference information in the form of a non-file name in the commands included in the target script file, and the original file name of at least one file referred to by the file reference information.
[0126] As an exemplary embodiment, the determination unit 100 may be configured to: in response to a first archive file creation instruction, determine the various files and generate the mapping file by actually executing a portion of special commands and parsing another portion of special commands; and / or, in response to a second archive file creation instruction, determine the various files and generate the mapping file and the golden file by actually running the target script file; wherein the special commands include: commands related to file archiving among the commands included in the target script file; wherein the golden file is used to record expected output results during testing, and the golden file is added to the target archive file.
[0127] As an exemplary embodiment, the determination unit 100 may be configured to: read the target script file, and determine the type of each command included in the target script file in sequence according to the execution order; if the command belongs to the first special command set, parse the command to determine that the target file referred to by the file reference information in the command belongs to the file required to run the target script file, and save the file reference information and the file name of the target file in the target archive file in association with each other in the mapping file; if the command belongs to the second special command set, actually execute the command to determine that the target file referred to by the file reference information in the command belongs to the file required to run the target script file, and save the file reference information and the file name of the target file in the target archive file in association with each other in the mapping file.
[0128] As an exemplary embodiment, the determination unit 100 may be configured to: after reading the target script file, re-register non-special commands among the commands included in the target script file as empty commands.
[0129] As an exemplary embodiment, the determination unit 100 may be configured to: read the target script file, sequentially execute each command included in the target script file and determine the type of the command; if the command belongs to the first special command set or the second special command set, determine that the target file referred to by the file reference information in the command belongs to the file required to run the target script file, and save the file reference information and the file name of the target file in the target archive file in association with each other in the mapping file; if the command belongs to the third special command set, determine the original file name of at least one file referred to by the file reference information in the command, and save the file reference information and the original file name of the at least one file in association with each other in the mapping file.
[0130] As an exemplary embodiment, the determination unit 100 may be configured to: in a case where the archive file creation instruction includes an exclusion option, when the target file is not a file defined by the exclusion option, determine that the target file is a file required to run the target script file; in a case where the archive file creation instruction includes a specified option, when the target file is a file defined by the specified option, determine that the target file is a file required to run the target script file; wherein the specified option is used to specify a file or directory, and the exclusion option is used to exclude a file or directory.
[0131] As an exemplary embodiment, if the original file name of the target file is the same as the file name of an existing file in the target archive file, the file name of the target file in the target archive file is: the file name obtained by adding a random number or a timestamp to the original file name of the target file, so that the file names of the files in the target archive file are different from each other.
[0132] As an exemplary embodiment, the running unit may be configured to: in response to a first archive file running instruction, run the target script file based on the target archive file; and / or, in response to a second archive file running instruction, run the target script file based on the target archive file to generate a golden file, and add the generated golden file to the target archive file to update the target archive file; wherein the golden file is used to record expected output results during testing.
[0133] It should be understood that the specific processing performed by the automatic filing device according to the exemplary embodiment of the present application has been referred to. Figure 1 to Figure 2 The details have been described in detail and will not be repeated here.
[0134] It should be understood that each unit in the automatic archiving device according to the exemplary embodiment of the present application may be implemented as a hardware component and / or a software component.
[0135] Figure 4 A structural block diagram of an electronic device according to an exemplary embodiment of the present application is shown.
[0136] Reference Figure 4 The electronic device includes: at least one memory 400 and at least one processor 500, wherein the at least one memory 400 stores a set of computer executable instructions, and when the set of computer executable instructions is executed by the at least one processor 500, the automatic archiving method as described in the above exemplary embodiment is executed.
[0137] As an example, the electronic device may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above instruction set. Here, the electronic device is not necessarily a single electronic device, but may also be any device or circuit collection capable of executing the above instructions (or instruction sets) individually or in combination. The electronic device may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.
[0138] In an electronic device, the processor 500 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. As an example and not limitation, the processor 500 may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.
[0139] The processor 500 may execute instructions or codes stored in the memory 400, wherein the memory 400 may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may employ any known transmission protocol.
[0140] The memory 400 may be integrated with the processor 500, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 400 may include a separate device, such as an external disk drive, a storage array, or any other storage device that may be used by a database system. The memory 400 and the processor 500 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 500 can read files stored in the memory.
[0141] In addition, the electronic device may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device may be connected to each other via a bus and / or a network.
[0142] According to an exemplary embodiment of the present application, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are executed by at least one processor, the at least one processor is prompted to perform the automatic archiving method as described in the above exemplary embodiment. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.
[0143] According to an exemplary embodiment of the present application, a computer program product may also be provided. Instructions in the computer program product may be executed by at least one processor to implement the automatic archiving method as described in the above exemplary embodiment.
[0144] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.
[0145] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. An automatic archiving method, characterized in that: include: In response to an archive file creation instruction, according to a target script file specified by the archive file creation instruction, determining various files required to run the target script file, and generating a mapping file; Packing the target script file, the individual files and the mapping file into a target archive file; The mapping file is used to store: file reference information used to refer to each file in the commands included in the target script file, and the file name of each file; The step of responding to the archive file creation instruction, determining various files required to run the target script file according to the target script file specified by the archive file creation instruction, and generating a mapping file comprises: In response to the first archive file creation instruction, the respective files are determined by actually executing a part of the special commands and parsing another part of the special commands, and the mapping file is generated; The special commands include: commands related to file archiving among the commands included in the target script file; Wherein, the target script file is a test case script file of the integrated circuit; The target archive file supports running the target script file directly from the target archive file in response to an archive file running instruction without requiring additional script adaptation processing.
2. The automatic filing method according to claim 1, characterized in that: Also includes: In response to an archive file execution instruction, executing the target script file based on the target archive file specified by the archive file execution instruction; Wherein, the step of running the target script file based on the target archive file specified by the archive file running instruction includes: Read the target script file and the mapping file from the target archive file; Execute the commands included in the target script file in sequence, wherein, if the executed command includes the file reference information in the mapping file, obtain the target file name corresponding to the file reference information in the command from the mapping file, and perform operations on the file with the target file name in the target archive file according to the command.
3. The automatic filing method according to claim 1, characterized in that: The mapping file includes: a first mapping file and a second mapping file; The first mapping file is used to store in association: file reference information in the form of file names in the commands included in the target script file, and the file name of the file referred to by the file reference information in the target archive file; The second mapping file is used to store in association: file reference information in a non-file name format among commands included in the target script file, and an original file name of at least one file referred to by the file reference information.
4. The automatic filing method according to claim 1, characterized in that: The step of determining, in response to the archive file creation instruction, the files required to run the target script file and generating a mapping file according to the target script file specified by the archive file creation instruction also includes: In response to a second archive file creation instruction, by actually running the target script file, determining the various files, and generating the mapping file and the golden file; The golden file is used to record expected output results during testing, and the golden file is added to the target archive file.
5. The automatic filing method according to claim 1, characterized in that: The step of determining the various files and generating the mapping file by actually executing a part of the special commands and parsing another part of the special commands comprises: Read the target script file, and determine the type of each command included in the target script file in order of execution; If the command belongs to the first special command set, the command is parsed to determine that the target file referred to by the file reference information in the command belongs to the file required to run the target script file, and the file reference information and the file name of the target file in the target archive file are associated and saved in the mapping file; If the command belongs to the second special command set, the command is actually executed to determine that the target file referred to by the file reference information in the command belongs to the file required to run the target script file, and the file reference information and the file name of the target file in the target archive file are associated and saved in the mapping file; If the command belongs to the third special command set, the command is actually executed to determine the original file name of at least one file referred to by the file reference information in the command, and the file reference information and the original file name of the at least one file are associated and saved in the mapping file.
6. The automatic filing method according to claim 5, characterized in that: The step of determining the respective files and generating the mapping file by actually executing a part of the special commands and parsing another part of the special commands also includes: After reading the target script file, non-special commands among the commands included in the target script file are re-registered as empty commands.
7. The automatic filing method according to claim 4, characterized in that: The step of actually running the target script file, determining each file, and generating the mapping file comprises: Read the target script file, execute each command included in the target script file in sequence and determine the type of the command; If the command belongs to the first special command set or the second special command set, determining that the target file referred to by the file reference information in the command belongs to a file required to run the target script file, and saving the file reference information and the file name of the target file in the target archive file in association with each other in the mapping file; If the command belongs to the third special command set, the original file name of at least one file referred to by the file reference information in the command is determined, and the file reference information and the original file name of the at least one file are associated and saved in the mapping file.
8. The automatic filing method according to claim 5 or 7, characterized in that: The step of determining that the target file referred to by the file reference information in the command belongs to a file required to run the target script file comprises: In the case where the archive file creation instruction includes an exclusion option, when the target file is not a file limited by the exclusion option, determining that the target file is a file required to run the target script file; In the case where the archive file creation instruction includes a specified option, when the target file belongs to the file defined by the specified option, determining that the target file belongs to the file required to run the target script file; The specified option is used to specify files or directories, and the excluded option is used to exclude files or directories.
9. The automatic filing method according to claim 5 or 7, characterized in that: If the original file name of the target file is the same as the file name of an existing file in the target archive file, the file name of the target file in the target archive file is: the file name obtained by adding a random number or a timestamp to the original file name of the target file, so that the file names of the files in the target archive file are different.
10. The automatic filing method according to claim 2, characterized in that: The step of executing the target script file in response to the archive file execution instruction and based on the target archive file specified by the archive file execution instruction comprises: In response to a first archive file execution instruction, executing the target script file based on the target archive file; and / or, in response to a second archive file execution instruction, executing the target script file based on the target archive file to generate a golden file, and adding the generated golden file to the target archive file to update the target archive file; The golden file is used to record the expected output results during testing.
11. An automatic filing device, characterized in that: include: a determination unit configured to, in response to an archive file creation instruction, determine various files required to run the target script file according to the target script file specified by the archive file creation instruction, and generate a mapping file; A packaging unit, configured to package the target script file, the individual files and the mapping file into a target archive file; The mapping file is used to store: file reference information used to refer to each file in the commands included in the target script file, and the file name of each file; The determining unit is specifically configured to: in response to the first archive file creation instruction, determine the various files by actually executing a part of the special commands and parsing another part of the special commands, and generate the mapping file; The special commands include: commands related to file archiving among the commands included in the target script file; Wherein, the target script file is a test case script file of the integrated circuit; The target archive file supports running the target script file directly from the target archive file in response to an archive file running instruction without requiring additional script adaptation processing.
12. A computer-readable storage medium storing instructions, characterized in that: When the instructions are executed by a processor of an electronic device, the electronic device is enabled to execute the automatic filing method according to any one of claims 1 to 10.
13. An electronic device, characterized in that: The electronic device comprises: at least one processor; at least one memory storing computer executable instructions, Wherein, when the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to perform the automatic archiving method according to any one of claims 1 to 10.
14. A computer program product comprising computer executable instructions, characterized in that: When the computer executable instructions are executed by at least one processor, the automatic archiving method according to any one of claims 1 to 10 is implemented.
