CN116595932A - Log printing method and related device - Google Patents

Log printing method and related device Download PDF

Info

Publication number
CN116595932A
CN116595932A CN202310869251.2A CN202310869251A CN116595932A CN 116595932 A CN116595932 A CN 116595932A CN 202310869251 A CN202310869251 A CN 202310869251A CN 116595932 A CN116595932 A CN 116595932A
Authority
CN
China
Prior art keywords
log
component
level
printing
control file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310869251.2A
Other languages
Chinese (zh)
Other versions
CN116595932B (en
Inventor
王晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xinyaohui Technology Co ltd
Original Assignee
Xinyaohui Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xinyaohui Technology Co ltd filed Critical Xinyaohui Technology Co ltd
Priority to CN202310869251.2A priority Critical patent/CN116595932B/en
Publication of CN116595932A publication Critical patent/CN116595932A/en
Application granted granted Critical
Publication of CN116595932B publication Critical patent/CN116595932B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/36Circuit design at the analogue level
    • G06F30/367Design verification, e.g. using simulation, simulation program with integrated circuit emphasis [SPICE], direct methods or relaxation methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a log printing method and a related device, which are applied to the field of chip verification. The method and the system can run the verification environment aiming at the target chip to obtain the log control file, wherein the log control file comprises log printing levels of a plurality of components. By updating the log print level of the first component in the log control file, the degree of detail of the log information about the first component in the printed log can be controlled, for example, the kind of information printed by the log can be increased. The log printing device can print the log according to the updated log control file to obtain a first log, and the detail degree of the log information about the first component in the first log meets the requirement of a user. The log printing level of some components is accurately controlled, the log scale is reduced, the disk space is saved to the maximum extent, the simulation efficiency is effectively improved, and the problem is conveniently positioned.

Description

Log printing method and related device
Technical Field
The application relates to the field of chip verification, in particular to a log printing method and a related device.
Background
In the general verification methodology (Universal Verification Methodology, UVM)/VMM verification methodology (Verification Methodology Manual, VMM)/open verification methodology (Open Verification Methdology, OVM) methodologies, a series of log controlled classes, command functions, macros are encapsulated for log printing, facilitating the user in ranking, tracking and screening information in an integrated circuit (Integrated Circuit, IC) verification environment.
In a complex verification environment, such as a subsystem or even an entire System On Chip (SOC) verification environment, components of the entire verification environment are very huge, and since components in the verification environment may come from module components provided by an IP provider, developed by a user or inherited by the user, the setting rules of these components with different sources may be different for the log print level, when debugging of a use case fails, when the log print level needs to be reduced to be re-imitated, a large amount of log information is printed from the inherited module components or VIP components provided by the IP provider, which causes the log to become huge, the simulation efficiency to be low, and the invalid information to be large, which is unfavorable for problem location.
Disclosure of Invention
The embodiment of the application provides a log printing method and a related device, which can accurately control log printing levels of certain components, reduce log scale, save disk space to the maximum extent, effectively improve simulation efficiency and facilitate positioning of problems.
In a first aspect, an embodiment of the present application provides a log printing method, where the method includes:
running an authentication environment aiming at a target chip to obtain a first log control file, wherein the authentication environment aiming at the target chip is used for carrying out functional authentication on the target chip, the authentication environment aiming at the target chip comprises a plurality of components, and the components form a plurality of layers in a tree structure; the first log control file comprises a component name of at least one component in the plurality of components, a level of at least one component in the plurality of components and a log printing level corresponding to at least one component in the plurality of components, wherein the log printing level corresponding to at least one component is an initial level;
Updating the log printing level of a first component in the first log control file to a first level to obtain a second log control file, wherein the first component belongs to the at least one component, and the types of information printed at the first level are more than those printed at the initial level;
and re-operating the verification environment aiming at the target chip according to the second log control file to obtain a first log.
In the embodiment of the application, a log control file is obtained by running a verification environment aiming at a target chip, wherein the log control file comprises log printing levels of a plurality of components. By updating the log print level of the first component in the log control file, the degree of detail of the log information about the first component in the printed log can be controlled, for example, the kind of information printed by the log can be increased. The log printing device can print the log according to the updated log control file to obtain a first log, and the detail degree of the log information about the first component in the first log meets the requirement of a user. The log printing level of some components is accurately controlled, the log scale is reduced, the disk space is saved to the maximum extent, the simulation efficiency is effectively improved, and the problem is conveniently positioned.
In a possible implementation manner of the first aspect, the at least one component is a component with a level higher than a first threshold value, and/or the at least one component is a component with a category of the plurality of components being a preset category and/or a user-selected category.
Therefore, the first log control file is convenient for the subsequent user to operate, and the first log control file can be operated more efficiently through the script.
In a further possible implementation manner of the first aspect, the first level is lower than the initial level, wherein the lower the log print level is, the more information types of the log print are.
In this way, the log printing level of the related problem component is reduced, and more information types are printed as much as possible, so that detailed log information of the related problem component is printed, and the problem can be conveniently positioned.
Alternatively, for the case where the first level is higher than the initial level, the higher the log print level is, the more the kind of information log printed is.
In a further possible implementation manner of the first aspect, before the re-running the verification environment for the target chip according to the second log control file to obtain the first log, the method further includes:
And running the verification environment aiming at the target chip to obtain a second log, wherein the second log is used for indicating log information generated by the plurality of components in the running process, and the log information comprises the name of the component with the error and the error type of the component with the error.
In a further possible implementation manner of the first aspect, the method further includes:
inputting the second log into a log information identification model to obtain the identification of an interested component, wherein the interested component is a component for recommending a user to adjust the log printing level;
the log information identification model is obtained by training according to a training sample, the training sample comprises the name of a component, the type of the component, the level of the component, the log information of the component and the component of interest selected by a user, the log information of the component is generated in the operation process of the component, and the log information of the component belongs to the second log.
In one possible implementation, the training device may input training samples into the model to be trained and annotate user-selected components of interest in the samples. The annotated data may be input to the model to be trained, which outputs an identification of the predicted component of interest. The sample predicted interested component and the corresponding real interested component are further used for training the model to be trained, the training target is to enable the sample predicted interested component to be as close to the corresponding real interested component as possible, and the log information identification model is obtained after training is finished. The training device may be a server, a host, or the like, and may optionally be integrated with the log printing apparatus of the present application.
Optionally, the related information of the interested component can be distinguished from other components on the interface by means of font amplification, setting striking color, brightness enhancement and the like.
Therefore, the identification of the interested component can be automatically obtained according to the log information identification model, the interested component can be the error reporting component or the user focusing component, the user does not need to select the interested component from a large number of components, the interested component of the user is automatically identified, the relevant information of the interested component is set up remarkably, the user can conveniently select, and the user experience is improved.
In a further possible implementation manner of the first aspect, the method further includes:
inputting the second log into a log information identification model to obtain a recommended adjustment level of the interested component, wherein the recommended adjustment level is a log printing level of a recommended user after the interested component is adjusted;
the log information recognition model is trained according to training samples, and the training samples further comprise recommended adjustment levels of interested components selected by users.
Optionally, the training sample is input into a model to be trained, and recommended adjustment levels of the interesting components selected by the user in the sample are marked. The annotated data may be input to the model to be trained, which outputs a recommended adjustment level for the predicted component of interest. The recommended adjustment level of the sample predicted interested component and the recommended adjustment level of the corresponding real interested component are further used for training the model to be trained, the training target is to enable the recommended adjustment level of the sample predicted interested component to be as close as possible to the recommended adjustment level of the corresponding real interested component, and the log information identification model is obtained after training is finished.
Optionally, when the verification environment for the target chip is actually run, verification regression is generally performed through each test case, and the log printing device may reserve log files of each test case, so components included in the log file corresponding to each test case may have different log printing levels. The training sample of the log information identification model also comprises log files of each test case, and the log files or the log files generated in the whole verification regression process are analyzed, counted and trained, so that the recommended adjustment level of the interested component predicted by the sample is as close as possible to the recommended adjustment level of the corresponding real interested component, and the log information identification model is obtained after the training is finished. Therefore, the recommended adjustment level of the interested component can be automatically output according to the log information identification model, the log information identification model is obtained by training for many times according to the training sample, the output recommended adjustment level is the log printing level of recommending certain components accurately while meeting the requirements of users, the log scale is reduced, the disk space is saved to the maximum extent, the user can conveniently set the first level, and the user experience is improved.
In a further possible implementation manner of the first aspect, the second log includes log information of the first component, where the log information of the first component includes an error type of the first component and a number of calls of the first component. The method further comprises the steps of:
determining the attention level of the first component according to the error type of the first component and the calling times of the first component, wherein the attention level of the first component is positively related to the calling times of the first component;
the first level is determined according to the attention level and the initial level of the first component, and the level difference between the first level and the initial level is positively correlated with the attention level of the first component. Optionally, the log printing device may preset weights of each component in the verification environment for the target chip, classify and count the components with problems in each regression, and for the components with high weights and high error reporting frequency, automatically adjust the log printing level.
Therefore, the attention level of the component can be determined according to the calling times of the component, when the error types of the component are the same, the more the calling times of the component are, the higher the attention level of the component is, so that the level difference between the first level and the initial level is larger, the first level can be automatically determined, the user operation is not needed, the log printing level of the related problem component is conveniently and flexibly controlled, the log scale is reduced, the disk space is saved to the maximum extent, the verification regression operation occupies fewer resources, the higher efficiency regression is realized, the simulation efficiency is effectively improved, and the user experience is improved.
In a further possible implementation manner of the first aspect, updating the log print level of the first component in the first log control file to the first level includes:
and updating the log printing level of the first component in the first log control file to the first level according to the first level of the first component input by the user.
Therefore, the user can conveniently and rapidly operate the first log control file, update of the log printing level of the problem component is achieved, operation is simple, and user experience is improved.
In a further possible implementation manner of the first aspect, the updating the initial log print level of the first component in the first log control file to the first level further includes:
analyzing a first log through a script, and determining an error-reporting component, wherein the first log is generated when a verification environment aiming at a target chip is operated for the first time, and the script is a pre-written program;
and updating the log printing level of the error-reported component in the first log control file to a first level according to the script and the error-reported component.
Therefore, scripting operation can be realized in regression, log printing levels of related problem components can be conveniently and flexibly controlled through scripts in places where simulation fails, log scale is reduced, disk space is saved to the maximum extent, verification regression operation occupies fewer resources, regression is more efficient, and simulation efficiency is effectively improved.
In a further possible implementation manner of the first aspect, the first component is a component that reports errors in the second log, and the component that reports errors is a component that generates log information of Error or Fatal level when the verification environment for the target chip is first executed.
In a further possible implementation manner of the first aspect, the second log further includes a reporting error time point of the first component, and the method further includes:
determining a log printing start time and a log printing end time of the first component, wherein the second log control file also comprises the log printing start time and the log printing end time of the first component;
the re-running the verification environment for the target chip according to the second log control file includes:
when the running time of the verification environment for the target chip is between the log printing start time and the log printing end time of the first component, the log information of the first component is printed at the first level.
In a further possible implementation manner of the first aspect, the error reporting time point is located between the log printing start time and the log printing end time.
In a further possible implementation manner of the first aspect, the first log includes log information of the first component printed between a log printing start time of the first component and the log printing end time.
Therefore, the verification environment of the target chip can print the log information of the corresponding problem component by using the updated log printing level in the time period when the problem occurs, and print the log information of the corresponding problem component by using the initial level in other time periods, because the updated log printing level is lower than the initial level, more detailed log information can be printed, and the log information of the corresponding problem component is printed by using the initial level in the time period when no problem occurs, so that the possibility of printing invalid log information can be effectively reduced, the log scale is reduced as much as possible, the disk space is saved to the maximum extent, and the simulation efficiency is effectively improved.
In yet another possible implementation manner of the first aspect, the log print level includes a plurality of levels, and a higher level of the plurality of levels corresponds to a lower number of printed information types, and the level of the first level is lower than the level of the initial level.
In a further possible implementation manner of the first aspect, the re-running the verification environment for the target chip is performed without re-compiling the verification environment for the target chip.
And repeated compiling is not needed, so that the disk space is saved to the maximum extent, and the simulation efficiency is effectively improved.
In a further possible implementation manner of the first aspect, the re-running the verification environment for the target chip according to the second log control file to obtain a first log includes:
and re-running the verification environment aiming at the target chip according to the second log control file to obtain a first log and a target waveform, wherein the first log and the target waveform are used for positioning problems of a user.
In a second aspect, an embodiment of the present application provides a log printing apparatus, including an execution unit and a processing unit,
the operation unit is used for:
running an authentication environment aiming at a target chip to obtain a first log control file, wherein the authentication environment aiming at the target chip is used for carrying out functional authentication on the target chip, the authentication environment aiming at the target chip comprises a plurality of components, and the components form a plurality of layers in a tree structure; the first log control file comprises a component name of at least one component in the plurality of components, a level of at least one component in the plurality of components and a log printing level corresponding to at least one component in the plurality of components, wherein the log printing level corresponding to at least one component is an initial level;
Re-running the verification environment aiming at the target chip according to the second log control file to obtain a first log;
the processing unit is used for updating the log printing level of a first component in the first log control file to a first level to obtain a second log control file, the first component belongs to the at least one component, and the information types obtained by printing at the first level are more than the information types obtained by printing at the initial level.
In a possible implementation manner of the second aspect, the at least one component is a component with a level higher than the first threshold value, and/or the at least one component is a component with a category of the plurality of components being a preset category and/or a category selected by a user.
In a further possible implementation manner of the second aspect, the first level is lower than the initial level, wherein the lower the log print level is, the more information types of the log print are.
In a further possible implementation manner of the second aspect, before the re-running the verification environment for the target chip according to the second log control file to obtain a first log, the running unit is further configured to run the verification environment for the target chip to obtain a second log, where the second log is used to indicate log information generated by the multiple components during the running process, where the log information includes names of components reporting errors and error types of the components reporting errors.
In a further possible implementation manner of the second aspect, the processing unit is further configured to input the second log into a log information identification model, to obtain an identification of an interested component, where the interested component is a component for recommending that a user adjust a log print level;
the log information identification model is obtained by training according to a training sample, the training sample comprises the name of a component, the type of the component, the level of the component, the log information of the component and the component of interest selected by a user, the log information of the component is generated in the operation process of the component, and the log information of the component belongs to the second log.
In a further possible implementation manner of the second aspect, the processing unit is further configured to input the second log into a log information identification model, to obtain a recommended adjustment level of the interested component, where the recommended adjustment level is a log printing level after the recommended user adjusts the interested component;
the log information recognition model is trained according to training samples, and the training samples further comprise recommended adjustment levels of interested components selected by users.
In a further possible implementation manner of the second aspect, the second log includes log information of the first component, the log information of the first component includes an error type of the first component and a number of calls of the first component, and the processing unit is further configured to:
Determining the attention level of the first component according to the error type of the first component and the calling times of the first component, wherein the attention level of the first component is positively related to the calling times of the first component;
the first level is determined according to the attention level and the initial level of the first component, and the level difference between the first level and the initial level is positively correlated with the attention level of the first component.
In a further possible implementation manner of the second aspect, the processing unit is further configured to update a log print level of a first component in the first log control file to the first level according to the first level of the first component input by a user.
In a further possible implementation manner of the second aspect, the operation unit is further configured to:
and running the verification environment aiming at the target chip to obtain a second log.
In a further possible implementation manner of the second aspect, the processing unit is further configured to parse the second log to determine components that report errors in the second log.
In a further possible implementation manner of the second aspect, the processing unit is further configured to:
analyzing a first log through a script, determining the name of a component with an error, wherein the first log is generated when a verification environment aiming at a target chip is operated for the first time, and the script is a pre-written program;
And updating the log printing level of the error-reported component in the first log control file to a first level according to the script and the error-reported component.
In a further possible implementation manner of the second aspect, the first component is a component that reports errors in the second log, and the component that reports errors is a component that generates log information of Error or Fatal level when the verification environment for the target chip is first executed.
In a further possible implementation manner of the second aspect, the processing unit is further configured to determine a log printing start time and a log printing end time of the first component, and the second log control file further includes the log printing start time and the log printing end time of the first component.
In a further possible implementation manner of the second aspect, the execution unit is further configured to print the log information of the first component at the first level when the execution time of the verification environment for the target chip is between a log print start time and the log print end time of the first component.
In a further possible implementation manner of the second aspect, the error reporting time point is located between the log printing start time and the log printing end time.
In a further possible implementation manner of the second aspect, the first log includes log information of the first component printed between a log printing start time of the first component and the log printing end time.
In yet another possible implementation manner of the second aspect, the log print level includes a plurality of levels, a higher level of the plurality of levels corresponds to a lesser variety of printed information, and a level of the first level is lower than a level of the initial level.
In a further possible implementation manner of the second aspect, the re-running the verification environment for the target chip is performed without re-compiling the verification environment for the target chip.
In a further possible implementation manner of the second aspect, the execution unit is further configured to re-execute the verification environment for the target chip according to the second log control file, to obtain a first log and a target waveform, where the first log and the target waveform are used for problem localization by a user.
In a third aspect, an embodiment of the present application provides a log printing apparatus, including a processor and a memory; the processor executes instructions stored in the memory to cause the log printing device to implement the method described in any one of the preceding first aspects.
Optionally, the log printing device further comprises a communication interface for receiving and/or transmitting data and/or for providing input and/or output to the processor.
The above embodiment is described taking a processor (or general-purpose processor) for executing a method by calling a computer specification as an example. In particular implementations, the processor may also be a special purpose processor in which the computer instructions are already preloaded in the processor. In the alternative, the processor may include both a special purpose processor and a general purpose processor.
In the alternative, the processor and memory may be integrated in one device, i.e., the processor and memory may be integrated.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having instructions stored therein that, when executed by a log printing device, cause the log printing device to implement the method described in any one of the preceding aspects.
In a fifth aspect, the present application provides a computer program product comprising computer instructions which, when run by a log printing device, cause the log printing device to implement the method described in any of the preceding first aspects.
Alternatively, the computer program product may be a software installation package or an image file, which may be retrieved and executed on a computing device in case the aforementioned method is required.
The advantages of the technical solutions provided in the second to fifth aspects of the present application may refer to the advantages of the technical solutions in the first aspect, and are not described herein.
Drawings
The drawings that are used in the description of the embodiments will be briefly described below.
Fig. 1 is a schematic flow chart of a log printing method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a hierarchy of components in a verification environment according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a first log control file according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an exemplary log print control component in an authentication environment provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a log print level of an update component provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram of a log printing device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a log printing device according to an embodiment of the present application.
Detailed Description
Some technical terms used in the embodiments of the present application are exemplarily explained below.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
After the design of the target chip is completed, functional verification needs to be performed on the target chip, and whether the target chip can complete the function designed by a developer is detected. In this process, the target chip needs to be simulated, and the verification environment for the target chip is used to simulate the target chip. Much log information is printed during the simulation. Simulation refers to the reproduction of an intrinsic process occurring in an actual system by using a model, and the existing or designed system is researched through experiments on the system model, which is also called simulation. Wherein the model may be a verification environment for the target chip.
Taking UVM as an example, the log information in UVM includes levels such as Fatal, error, warning, info, etc. for representing the severity of different problems during simulation: fatal indicates that the environment has serious and cannot run, and the simulation is directly terminated; error indicates that the environment has a problem, but the simulation is performed, and the simulation result is failure after the simulation is finished; warning indicates that the environment has an alarm, but the severity is lower than Error; info is common information that can track and debug various information and data streams that occur in an IC verification environment. Among them, an IC is an integrated circuit, also called a chip, formed from a large number of microelectronic components (transistors, resistors, capacitors, etc.).
The UVM can set the log printing level of the components in the verification environment, and the types of information printed under different log printing levels are different. For example, the log print level may include levels of UVM_NONE, UVM_LOW, UVM_MEDIUM, UVM_HIGH, UVM_DEBUG, and the like. The level of uvm_none is highest, and the level of information is always printed, but may be only rough printed information, the information types obtained by printing are less, the uvm_low print level is lower than uvm_none, and the lower print level means that more detailed printed information is printed in the log, that is, the information types obtained by printing at the uvm_low print level are more.
In the process of verifying regression, more log information is printed so that the speed of simulation is reduced and the disk occupied by the simulation is enlarged, therefore, when the first simulation is carried out, the initial log printing level of the components in the verification environment is usually set higher, the regression efficiency is improved, and the disk consumption is reduced. If the use case passes, the verification environment does not need to be checked, and if the verification environment runs, log information of an Error or Fatal level appears, at this time, in order to facilitate positioning of a component with a problem, the log printing level is lowered to print more log information when the verification environment runs again. After the log printing level of the component is reduced, the use case is subjected to repeated simulation for the second time, so that more log information is printed, and the problem can be conveniently positioned. Wherein a use case is the definition and description of a certain coherent functional unit of a system or subsystem without revealing the internal structure of the system or subsystem. In other words, a use case describes a system function, and a use case describes a part of the whole system function, which is a logically relatively complete functional flow.
In a complex verification environment, such as a subsystem or even a verification environment of the entire chip, the object under test (Design under test, DUT) has many inputs and outputs, and the verification environment generally simulates all inputs and samples and outputs for detection, i.e. the verification environment provided by the IP provider for verifying VIP components, integrated subsystems or chip sub-modules is used for overall simulation, and the components of the entire verification environment are very large. In addition, since the setting rules of the VIP component, the verification component developed by the user, and the verification environment of the inherited module may be different for the log print level, (for example, the VIP component sets uvm_high as the log print level of the detailed DEBUG information, and the verification environment of the inherited module adopts uvm_debug or other levels as the log print level of the detailed DEBUG information), when the use case DEBUG fails, a great amount of log information is printed from other module components or VIP components when the log print level is required to be reduced for re-simulation, and in this way, the log becomes huge, the simulation efficiency is low, and the invalid information is much, which is unfavorable for problem location. Wherein IP is also commonly referred to as an IP core. IP core refers to the mature design of circuit modules with independent functions in the chip. The authentication VIP component may be included in the IP core. The circuit module design can be applied to other chip design projects comprising the circuit module, so that the design workload is reduced, the design period is shortened, and the success rate of chip design is improved.
In view of this, the embodiment of the present application provides a log printing method, which can run an authentication environment for a target chip to obtain a log control file, where the log control file includes log printing levels of a plurality of components. By updating the log print level of the first component in the log control file, the degree of detail of the log information about the first component in the printed log can be controlled, for example, the kind of information printed by the log can be increased. The log printing device can print the log according to the updated log control file to obtain a first log, and the detail degree of the log information about the first component in the first log meets the requirement of a user. The log printing level of some components is accurately controlled, the log scale is reduced, the disk space is saved to the maximum extent, the simulation efficiency is effectively improved, and the problem is conveniently positioned.
The method according to the embodiment of the present application will be described in detail.
Referring to fig. 1, fig. 1 is a flowchart of a log printing method according to an embodiment of the present application.
The log printing method as shown in fig. 1 may include a plurality of steps among steps S101 to S103. It should be understood that the present application is described by the order of steps S101-S103 for convenience of description, and is not intended to be limited to being necessarily performed by the above order. The embodiment of the application is not limited to the execution sequence, execution time, execution times and the like of the one or more steps. The steps S101-S103 are specifically as follows:
S101: the log printing device runs the verification environment aiming at the target chip to obtain a first log control file.
The log printing device is a device with processing capability, which may be a physical device such as a server, cloud, or host, or a virtual device such as a virtual machine, software, program code, or container.
The verification environment (simply referred to as verification environment) for the target chip is used for performing functional verification on the target chip, and checking whether the target chip can complete the function designed by the developer. For example, the verification environment for the target chip may be mainly used for chip EDA front-end verification, where the verification environment for the target chip includes a plurality of components, and the plurality of components form a plurality of layers in a tree structure. Taking UVM methodology as an example, please refer to fig. 2, fig. 2 is a schematic diagram illustrating a hierarchy of components in a verification environment according to an embodiment of the present application. As shown in fig. 2, the components in fig. 2 form a plurality of layers in a tree structure, and fig. 2 includes a plurality of components, for example, the first component 1 is located at layer 1, and the seventh component 7 is located at layer 4. The UVM is a verification platform development framework taking a SystemVerilog class function library as a main body, and a verification engineer can construct a functional verification environment with a standardized hierarchical structure and interfaces by using reusable components of the verification engineer. UVM is formed by fusing previous authentication methodologies (OVM, VMM, etc.).
As one possible embodiment, the first log control file is obtained by directly running the verification environment by the log printing apparatus, and the log printing apparatus sets the log print level of the plurality of components in the verification environment in the first log control file. The first log control file contains component names of a plurality of components in the verification environment, a hierarchy where the components are located and a log print level of the components.
As yet another possible embodiment, the first log control file is a file formed by intermediate processing of a first file generated when the log printing device runs the log printing control component. When the log printing device runs the log printing control component, the component names of the components in the verification environment and the hierarchy where the components are located are printed in the file to form the first file.
The first log control file is obtained by intermediate processing, as a possible implementation manner, the intermediate processing includes: the log printing device filters components in the first file having a hierarchy of components below a first threshold. Optionally, the log printing device deletes the component name of the component and the level where the component is located in the first file, where the component is lower than the first threshold, or annotates the component name of the component and the level where the component is located in the first file, where the component is lower than the first threshold, to form the second file. The annotation is used for annotating and describing the program, and the annotated program code usually appears in the program source code and is not compiled and executed by the program. Therefore, the first log control file is convenient for the subsequent user to operate, and the first log control file can be operated more efficiently through the script.
Optionally, the first threshold is used to represent a condition that the hierarchy of components in the first file needs to satisfy. Wherein the first threshold is predefined or predefined. For example, the first threshold may be a value higher than α.
For example, the first threshold is a value higher than 2, as shown in fig. 2, the first component 1 is in a layer 1, the second component 2 is in a layer 2, the layer is lower than the first threshold, the log printing device deletes the component names of the first component 1 and the second component 2 and the layer of the component in the first file or the log printing device annotates the component names of the first component 1 and the second component 2 and the layer of the component in the first file to form the second file.
As yet another possible implementation, the intermediate processing further includes: the log printing device sets an initial log printing level corresponding to each component in the second file to form a first log control file. Wherein, the initial log print level is simply referred to as initial level.
Optionally, the setting, by the log printing device, the initial log printing level corresponding to each component in the second file may include the following embodiments:
embodiment one:
the log printing device sets the initial log printing level of the component whose class is the preset class in the second file to be highest. For example, the preset category is a VIP component provided by an IP provider, and at this time, the log printing device sets an initial log print level of the VIP component to be highest, and the information category obtained at the highest log print level is small. Alternatively, the same applies to the case where the higher the log print level is, the more the kind of information log printed is.
Embodiment two:
the log printing device sets an initial log printing level of the component of the category selected by the user for the category of the component in the second file according to the requirement of the user. The log print level includes a plurality of levels, and the higher the level among the plurality of levels, the smaller the kind of information to be printed is. For example, the user selects a category of "user developed verification component", the user's demand is to set the initial log print level of the user developed verification component to the highest, at which time the log printing apparatus sets the initial log print level of the component of the second file, the category of which is the "user developed verification component", to the highest, and the kind of information printed at the highest log print level is the smallest.
It should be understood that the above embodiments are exemplary examples, and that many more embodiments may be implemented in the specific implementation, and that many more embodiments may be combined.
Referring to fig. 3, fig. 3 is a schematic diagram of a first log control file according to an embodiment of the present application. As shown in fig. 3, the first log control file includes a component name (also referred to as a component path name in fig. 3) of at least one of the plurality of components, a hierarchy at which the at least one of the plurality of components is located (also referred to as a hierarchy at which the component is located in fig. 3), and a log print level corresponding to the at least one of the plurality of components. At least one component is a component with a hierarchy higher than a first threshold value, and/or at least one component is a component with a category which is a preset category and/or a category selected by a user in a plurality of components. Alternatively, the hierarchy in which the components reside may also be represented numerically. Illustratively, as shown in fig. 3, the first component 1 (i.e., the component having the component path name of component path 1) is at level 1, the log print level is uvm_none, the second component 2 (i.e., the component having the component path name of component path 2) is at level 3, the log print level is uvm_low, the third component 3 (i.e., the component having the component path name of 3) is at level 1, the log print level is uvm_high, the fourth component 4 (i.e., the component having the component path name of component path 4) is at level 1, the log print level is uvm_none, the fifth component 5 (i.e., the component having the component path name of component path 5) is at level 2, the log print level is uvm_low, and 14/15/16/17/18 in fig. 3 is the number of lines of program codes.
As one possible implementation, the log print control component is added by the user in the verification environment.
As yet another possible implementation manner, when the log print control component is in the emulation operation, the verification environment checks that the log print control component does not exist in the verification environment, and the log print control component is added in the verification environment.
As a possible implementation manner, the log printing device instantiates the log printing control component in the verification environment, starts the log printing control component (the first file is generated when the log printing control component runs) before the task phase runs, compiles the verification environment to generate the SIMV executable file, runs the verification environment and obtains the first log control file. Wherein the SIMV executable file is used to parse the print level of the component of the non-annotated line in the first log control file. The parsing may be to parse the data of the file into an object, obtain information such as package name, application name, version number, etc., and may form the running file after parsing. In UVM methodology, each component needs to use a phase mechanism, and the phase overall can be divided into two major categories, namely a function phase and a task phase, wherein the function phase does not consume simulation time, and the task phase needs to consume simulation time. Compilation is the conversion of high-level language into a binary language that can be recognized by a computer.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating an exemplary log print control component in a verification environment according to an embodiment of the present application. The log printing device instantiates the log printing control component in the verification environment, and the mode has strong adaptability in different UVM verification environments and can be directly instantiated for use. Instantiation refers to the process of converting an abstract concept into a concrete instance. In programming, it is often necessary to describe an object by class, and each object is an instance of that class. This process is to create objects by classes, also known as instantiations. As shown in fig. 4, the log print control component is instantiated in the environment by the corresponding program code (e.g., the pseudo code "log print control component" in fig. 4 is instantiated in the environment "), and the log print control component can also be started in the environment by the corresponding program code (e.g., the pseudo code" log print control component "in fig. 4 is started in the environment"), 16 and 94 in fig. 4 being the number of lines where the program code is located.
As a possible implementation, the second log may also be obtained after running the verification environment for the target chip. The second log is used for indicating log information generated by the plurality of components in the running process, and the log information can comprise names of the components with errors, error types of the components with errors and error time points of the components with errors.
S102: the log printing device updates the log printing level of the first component in the first log control file to the first level to obtain a second log control file.
The first component belongs to the aforementioned at least one component. The first component may be any one or more of the components in the first log control file.
Referring to fig. 5, fig. 5 is a schematic diagram of a log print level of an update component according to an embodiment of the present application. As shown in fig. 5, the log print level of the first component 1 (i.e., the component whose component path name is the component path 1) is updated to uvm_high, and the log print level of the second component 2 (i.e., the component whose component path name is the component path 2) is updated to uvm_low.
The log printing device may update the initial log printing level of the first component in the first log control file to the first level in the following embodiments:
embodiment one:
the log printing device updates the log printing level of the first component in the first log control file to the first level according to the first level of the first component input by the user. The information types printed at the first level are more than the information types printed at the initial log print level. Optionally, the first level is lower than the initial log print level, and the information printed at the first level is more detailed.
Illustratively, the initial log print level of the first component is uvm_none, and the user wants to update the log print level of the first component to uvm_debug, and the log printing apparatus updates the initial log print level uvm_none of the first component to the first level uvm_debug according to the uvm_debug input by the user. The information category printed at the uvm_debug level is more than the information category printed at the uvm_none level. Therefore, the user can conveniently and rapidly operate the first log control file, update of the log printing level of the problem component is achieved, operation is simple, and user experience is improved.
In one possible implementation, the log printing apparatus may determine an interested component, which is a component that recommends a user to adjust a log printing level, based on the log information recognition model. Optionally, the log printing device can distinguish other components of the related information of the interested component on the interface in a mode of font amplification, setting striking color, brightness enhancement and the like. The related information may be a name of the component of interest, a category of the component of interest, a hierarchy in which the component of interest is located, log information of the component of interest, and the like. Accordingly, the user may select some or all of the components to adjust their print level based on the presented components of interest. Of course, the user may not select the component of interest at the time of selection (i.e., the first component may not belong to the component of interest), and the present application is equally applicable to the case where the first component does not belong to the component of interest. The identification of the interested component can be intelligently obtained, the interested component can be a wrong component or a component focused by a user, the user does not need to select the interested component from a large number of components, the interested component of the user is automatically identified, the related information of the interested component is set up remarkably, the user can select conveniently, and the user experience is improved.
Optionally, the log printing device may input a second log obtained by running the verification environment into the log information identification model to obtain the identification of the component of interest.
In some scenarios, the log information recognition model may be trained from training samples. Specifically, the training device inputs the training sample into the model to be trained, and labels the interesting components selected by the user in the sample. The annotated data may be input to the model to be trained, which outputs an identification of the predicted component of interest. The sample predicted interested component and the corresponding real interested component are further used for training the model to be trained, the training target is to enable the sample predicted interested component to be as close to the corresponding real interested component as possible, and the log information identification model is obtained after training is finished. The training sample may include a name of the component, a class of the component, a level of the component, log information of the component, and a component of interest selected by a user, where the log information of the component is log information generated in the running process of the component, and the log information of the component belongs to the second log.
Further, the log information identifying module may further determine a recommended adjustment level of the interested component, where the recommended adjustment level is a log print level of the interested component adjusted by the recommended user. Illustratively, the initial log print level of the second component 2 is uvm_none, the log printing device inputs the second log into the log information recognition model to obtain the recommended adjustment level of the second component 2 as uvm_medium, the log printing device displays the relevant information of the second component 2 on the interface in a striking manner, and the user can update the initial log print level (uvm_none) of the second component 2 in the first log control file to the recommended adjustment level (uvm_medium) of the second component 2 according to the recommended adjustment level (uvm_medium) of the second component 2.
Therefore, the recommended adjustment level of the interested component can be automatically output according to the log information identification model, the log information identification model is obtained by training for many times according to the training sample, the output recommended adjustment level is the log printing level of recommending certain components accurately while meeting the requirements of users, the log scale is reduced, the disk space is saved to the maximum extent, the user can conveniently set the first level, and the user experience is improved.
It will be appreciated that the training sample of the log information recognition model also contains recommended adjustment levels for the user-selected component of interest. And inputting the training sample into a model to be trained, and labeling the recommended adjustment level of the interested component selected by the user in the sample. The annotated data may be input to the model to be trained, which outputs a recommended adjustment level for the predicted component of interest. The recommended adjustment level of the sample predicted interested component and the recommended adjustment level of the corresponding real interested component are further used for training the model to be trained, the training target is to enable the recommended adjustment level of the sample predicted interested component to be as close as possible to the recommended adjustment level of the corresponding real interested component, and the log information identification model is obtained after training is finished.
Furthermore, when the verification environment for the target chip is actually operated, verification regression is generally performed through each test case, and the log printing device can reserve log files of each test case, so that components contained in the log files corresponding to each test case may have different log printing levels. The training sample of the log information identification model also comprises log files of each test case, and the log files or the log files generated in the whole verification regression process are analyzed, counted and trained, so that the recommended adjustment level of the interested component predicted by the sample is as close as possible to the recommended adjustment level of the corresponding real interested component, and the log information identification model is obtained after the training is finished.
Optionally, when the verification environment for the target chip is operated, the log printing device may further call the log printing level corresponding to the component included in the log file corresponding to each test case to print log information, and more customized printing level may be used, so that the problem positioning is more efficient.
As yet another possible implementation, the first component may be a component that reports errors in the second log, where the component that reports errors is a component that generates log information at the Error or Fatal level when the verification environment for the target chip is first run.
Embodiment two:
the log printing device inputs the second log into the log information identification model, determines the interested component and the recommended adjustment level of the interested component, and adjusts the log printing level of the interested component to the recommended adjustment level. The related description refers to the description of the first embodiment.
Thus, the components needing to be adjusted can be intelligently identified, and then the log printing level can be intelligently adjusted.
Embodiment III:
the log printing device determines the component that reported the error in the second log, for example, the component that reported the error in the second log may be determined by script parsing the second log. And the log printing device updates the log printing level of the first component in the first log control file to a first level according to the error reporting component, wherein the first component belongs to the error reporting component.
The script is a pre-written program, the Error reporting is log information of Error or Fatal level when the verification environment is operated, the component name of the first component is the same as the component name of the Error reporting, and the first level is lower than the initial log printing level. The log printing device automatically analyzes the second log through the script to determine that the component with the error report is the first component 1, the initial log printing level of the first component 1 is uvm_low, and the log printing device updates the log printing level of the first component 1 in the first log control file to uvm_debug according to the script and the first component 1. The information types printed at the uvm_debug level are more than the information types printed at the uvm_low level. Therefore, scripting operation can be realized in regression, log printing levels of related problem components can be conveniently and flexibly controlled through scripts in places where simulation fails, log scale is reduced, disk space is saved to the maximum extent, verification regression operation occupies fewer resources, regression is more efficient, and simulation efficiency is effectively improved.
For example, the log printing device may also prominently display the components that reported errors, for example, by distinguishing other components by font enlargement, setting a conspicuous color, brightness enhancement, and the like.
Embodiment four:
the log printing device determines a first level according to the attention level and the initial level of the first component, and updates the log printing level of the first component in the first log control file to the first level.
Specifically, the log printing device determines the attention level of the first component according to the error type of the first component and the call times of the first component, and the log printing device determines the first level according to the attention level and the initial level of the first component and updates the log printing level of the first component in the first log control file to the first level.
The second log comprises log information of the first component, the log information of the first component comprises error types of the first component and calling times of the first component, the attention level of the first component is positively correlated with the calling times of the first component, and the level difference between the first level and the initial level is positively correlated with the attention level of the first component.
Optionally, the log printing device may preset weights of each component in the verification environment for the target chip, classify and count the components with problems in each regression, and for the components with high weights and high error reporting frequency, automatically adjust the log printing level.
For example, the initial level of the third component 3 is uvm_medium, the more the call number of the third component 3 is, the higher the attention level is, the lower the log print level is, the more the types of information printed are, the level difference between the initial level and the first level is increased along with the increase of the attention level, at this time, the log printing device may set the level difference between the first level of the third component 3 and the initial level of the third component 3 to be greater, for example, the first level is uvm_debug, and the log printing device updates the initial level (uvm_medium) of the third component 3 in the first log control file to the first level (uvm_debug).
Therefore, the attention level of the component can be determined according to the calling times of the component, when the error types of the component are the same, the more the calling times of the component are, the higher the attention level of the component is, so that the level difference between the first level and the initial level is larger, the first level can be automatically determined, the user operation is not needed, the log printing level of the related problem component is conveniently and flexibly controlled, the log scale is reduced, the disk space is saved to the maximum extent, the verification regression operation occupies fewer resources, the higher efficiency regression is realized, the simulation efficiency is effectively improved, and the user experience is improved.
It should be understood that the above embodiments are exemplary examples, and that many more embodiments may be implemented in the specific implementation, and that many more embodiments may be combined. The method is simple and convenient, convenient for user operation and capable of improving user experience.
As a possible implementation manner, the log printing device determines a log printing start time and a log printing end time of the first component, and the second log control file further includes the log printing start time and the log printing end time of the first component.
Wherein the log print start time and the log print end time of the first component may be user entered or automatically generated by a script. Further, when the log print start time and the log print end time of the first component are automatically generated by the script, the error reporting time point is located between the log print start time and the log print end time.
Illustratively, when there is a case report error in the simulation regression, the component in which the report error is the first component 1, the first component 1 reports the error at the simulation time of 300ns, at this time, the log printing device determines the log printing start time and the log printing end time of the first component 1, optionally, as shown in fig. 5, the log printing start time of the first component 1 (i.e., the component whose component path name is component path 1) is set to 100ns, the log printing end time is set to 500ns, the log printing start time of the second component 2 (i.e., the component whose component path name is component path 2) is set to 100ns, the log printing end time is set to 1500ns, and 70 and 71 in fig. 5 are the number of lines where the program code is located. The setting of the log printing start time and the log printing end time may be manually set by a user or set by a log printing apparatus through a script.
S103: and the log printing device reruns the verification environment aiming at the target chip according to the second log control file to obtain a first log.
The second log control file is obtained after the first log control file is updated. The log printing device does not recompile the verification environment when re-running the verification environment for the target chip. The first log is synchronously generated when the verification environment is rerun, and the first log is used for problem positioning by a user. The first log includes log information printed at a first level by the first component.
As a possible implementation manner, the log printing device reruns the verification environment according to the second log control file to obtain the first log and the target waveform. The waveform is a signal waveform formed by combining vector data, the position of rising/falling edges and an input voltage value, and is used for a user to locate a problem.
As one possible embodiment, the log printing means prints the log information of the first component at the first level when the running time of the verification environment is between the log printing start time and the log printing end time of the first component. Illustratively, the first component 1 (i.e., component path name is a component of component path 1) shown in fig. 5 prints log information of the first component 1 using uvm_high level when the verification environment is re-run for a run period of 100ns-500ns, and the second component 2 (i.e., component path name is a component of component path 2) shown in fig. 5 prints log information of the second component 2 using uvm_low level when the verification environment is re-run for a run period of 100ns-1500 ns.
Alternatively, when the verification environment is re-run, the log printing apparatus may run the first component using the initial log print level of the first component for a period of time other than when the run period of time of the verification environment is between the log print start time and the log print end time of the first component.
Therefore, the verification environment can use the updated log printing level to run the corresponding problem component in the time period when the problem occurs, and use the initial log printing level to run the problem component in other time periods, because the updated log printing level is lower than the initial log printing level, more detailed log information can be printed, and the initial log printing level is used to run the problem component in the time period when no problem occurs, so that the possibility of printing invalid log information can be effectively reduced, the log scale is reduced as much as possible, the disk space is saved to the maximum extent, and the simulation efficiency is effectively improved.
It can be understood by those skilled in the art that the method can be applied to UVM scenes, but is also applicable to other application scenes such as VMM scenes, OVM scenes, SV scenes, and the like, and the technical scheme provided by the application is also applicable to similar technical problems with the appearance of new service scenes.
The foregoing details of the method according to the embodiments of the present application and the apparatus according to the embodiments of the present application are provided below.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a log printing device according to an embodiment of the present application. The log printing apparatus 60 may include a running unit 601 and a processing unit 602. The log printing device 60 is used to implement the log printing method described above, such as the log printing method in the embodiment shown in fig. 1.
The division of the plurality of units is merely a logical division according to functions, and is not limited to a specific configuration of the log printing apparatus 60. In a specific implementation, some of the functional modules may be subdivided into more tiny functional modules, and some of the functional modules may be combined into one functional module.
In a possible embodiment, the running unit 601 is configured to:
running an authentication environment aiming at a target chip to obtain a first log control file, wherein the authentication environment aiming at the target chip is used for carrying out functional authentication on the target chip, the authentication environment aiming at the target chip comprises a plurality of components, and the components form a plurality of layers in a tree structure; the first log control file comprises a component name of at least one component in the plurality of components, a level of at least one component in the plurality of components and a log printing level corresponding to at least one component in the plurality of components, wherein the log printing level corresponding to at least one component is an initial level;
Re-running the verification environment aiming at the target chip according to the second log control file to obtain a first log;
the processing unit 602 is configured to update a log print level of a first component in the first log control file to a first level, to obtain a second log control file, where the first component belongs to the at least one component, and the types of information printed at the first level are greater than the types of information printed at the initial level.
In a possible implementation manner, the at least one component is a component with a level higher than a first threshold value, and/or the at least one component is a component with a category of the plurality of components being a preset category and/or a category selected by a user.
In one possible embodiment, the first level is lower than the initial level, wherein the lower the log print level, the more information is of the type log printed.
In a possible implementation manner, before the re-running the verification environment for the target chip according to the second log control file to obtain a first log, the running unit 601 is further configured to run the verification environment for the target chip to obtain a second log, where the second log is used to indicate log information generated by the multiple components during the running process, where the log information includes names of components reporting errors and error types of the components reporting errors.
In a possible implementation manner, the processing unit 602 is further configured to input the second log into a log information identification model, so as to obtain an identification of an interested component, where the interested component is a component for recommending that a user adjust a log print level;
the log information identification model is obtained by training according to a training sample, the training sample comprises the name of a component, the type of the component, the level of the component, the log information of the component and the component of interest selected by a user, the log information of the component is generated in the operation process of the component, and the log information of the component belongs to the second log.
In a possible implementation manner, the processing unit 602 is further configured to input the second log into a log information identification model, to obtain a recommended adjustment level of the component of interest, where the recommended adjustment level is a log print level after the user is recommended to adjust the component of interest;
the log information recognition model is trained according to training samples, and the training samples further comprise recommended adjustment levels of interested components selected by users.
In a possible implementation manner, the second log includes log information of the first component, where the log information of the first component includes an error type of the first component and a number of calls of the first component, and the processing unit 602 is further configured to:
Determining the attention level of the first component according to the error type of the first component and the calling times of the first component, wherein the attention level of the first component is positively related to the calling times of the first component;
the first level is determined according to the attention level and the initial level of the first component, and the level difference between the first level and the initial level is positively correlated with the attention level of the first component.
In a possible implementation manner, the processing unit 602 is further configured to update a log print level of a first component in the first log control file to the first level according to the first level of the first component input by a user.
In a possible implementation manner, the running unit 601 is further configured to run the verification environment for the target chip to obtain a second log.
In a possible implementation manner, the processing unit 602 is further configured to parse the second log, and determine a component that reports an error in the second log.
In a possible implementation manner, the processing unit 602 is further configured to:
analyzing a first log through a script, determining the name of a component with an error, wherein the first log is generated when a verification environment aiming at a target chip is operated for the first time, and the script is a pre-written program;
And updating the log printing level of the error-reported component in the first log control file to a first level according to the script and the error-reported component.
In one possible implementation manner, the first component is a component that reports errors in the second log, and the component that reports errors is a component that generates log information of Error or Fatal level when the verification environment for the target chip is first executed.
In a possible implementation manner, the processing unit 602 is further configured to determine a log printing start time and a log printing end time of the first component, and the second log control file further includes the log printing start time and the log printing end time of the first component.
In a possible implementation manner, the running unit 601 is further configured to print the log information of the first component at the first level when the running time of the verification environment for the target chip is between the log print start time and the log print end time of the first component.
In one possible embodiment, the error reporting time point is located between the log printing start time and the log printing end time.
In one possible embodiment, the first log includes log information of the first component printed between a log print start time of the first component and the log print end time.
In one possible embodiment, the log print level includes a plurality of levels, and a higher level of the plurality of levels corresponds to a smaller variety of printed information, and the level of the first level is lower than the level of the initial level.
In one possible implementation, the re-running the verification environment for the target chip is performed without re-compiling the verification environment for the target chip.
In a possible implementation manner, the running unit 601 is further configured to re-run the verification environment for the target chip according to the second log control file, to obtain a first log and a target waveform, where the first log and the target waveform are used for the user to locate the problem.
It should be noted that the above units (the operation unit 601 and the processing unit 602) are configured to perform relevant steps of the above method. For example, the running unit 601 is used for executing the related contents of steps S101 and S103, and the processing unit 602 is used for executing the related contents of S102.
Fig. 7 is a schematic structural diagram of a log printing device according to an embodiment of the present application. The log printing device is a device with processing capabilities, where the device may be an entity device, such as a server (e.g., a rack-mounted server), a host, etc., or may be a virtual device, such as a virtual machine, container, etc.
As shown in fig. 7, the log printing apparatus 70 includes: the processor 701 and the memory 702, as well as one or more programs, may include a communication interface 703. It should be understood that the present application is not limited to the number of processors, memories in the log printing device 70.
The processor 701 is a module for performing operations, and may include a central processing unit (central processing unit, CPU), a graphics processor (graphics processing unit, GPU), a microprocessor (micro processor, MP), a digital signal processor (digital signal processor, DSP), a micro control unit (Microcontroller Unit, MCU), or one or more integrated circuits for controlling the execution of the above program.
The memory 702 is used to provide storage space in which application data, user data, operating systems, computer programs, and the like may be optionally stored. The Memory 702 may include, but is not limited to, read-Only Memory (ROM) or other types of static storage devices that can store static information and instructions, random access Memory (random access Memory, RAM) or other types of dynamic storage devices that can store information and instructions, but may also be electrically erasable programmable read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), compact disc read-Only Memory (Compact Disc Read-Only Memory) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 702 may be implemented independently and coupled to the processor 701 via a bus. Memory 702 may also be integrated with processor 701.
The communication interface 703 is used to provide information input or output to the at least one processor. And/or the communication interface 703 may be used to receive externally transmitted data and/or to transmit data to the outside. The communication interface 703 may be a wired link interface including, for example, an ethernet cable, or may be a wireless link (Wi-Fi, bluetooth, general wireless transmission, other wireless communication technologies, etc.) interface. Optionally, the communication interface 703 may further include a transmitter (e.g., radio frequency transmitter, antenna, etc.) or a receiver, etc. coupled to the interface.
In the embodiment of the present application, the above-described one or more programs are stored in the above-described memory 702 in the form of program codes and configured to be executed by the above-described processor 701, the programs including instructions for implementing the steps in the above-described log printing method. Such as the log printing method shown in fig. 1. That is, the memory 702 stores executable instructions that the processor 701 executes to implement the aforementioned log printing method, such as the log printing method in the embodiment of fig. 1. That is, the memory 702 has stored thereon instructions for executing the log printing method.
Alternatively, the memory 702 stores therein executable instructions that are executed by the processor 701 to implement the functions of one or more of the foregoing execution units and processing units (or devices), respectively, to implement the log printing method.
Embodiments of the present application also provide a computer program product comprising instructions. The computer program product may be software or a program product containing instructions capable of running on a computing device or stored in any useful medium. The computer program instructions are for implementing the aforementioned log printing method, such as the log printing method in the embodiment of fig. 1.
The embodiment of the application also provides a computer readable storage medium. The computer readable storage medium includes instructions for implementing the aforementioned log printing method, such as the log printing method in the embodiment of fig. 1.
The computer readable storage medium may be any available medium that can be stored by the log printing device, or a data storage device such as a data center containing one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), etc.
In embodiments of the application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
Reference to "at least one" in embodiments of the application means one or more, and "a plurality" means two or more. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a. b, c, (a and b), (a and c), (b and c), or (a and b and c), wherein a, b, c may be single or plural. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: three cases of a alone, a and B together, and B alone, wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship.
And, unless otherwise indicated, the use of ordinal numbers such as "first," "second," etc., by embodiments of the present application is used for distinguishing between multiple objects and is not used for limiting a sequence, timing, priority, or importance of the multiple objects. For example, the first content providing apparatus and the second content providing apparatus are merely for convenience of description, and are not indicative of differences in apparatus structures, deployment orders, importance degrees, and the like of the first content providing apparatus and the first content providing apparatus.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read only memory, a magnetic disk or an optical disk, etc.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical schemes described in the foregoing embodiments may be updated or some technical features thereof may be replaced equivalently; these updates or substitutions do not depart from the essence of the corresponding technical solutions from the protection scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method of log printing, the method comprising:
running an authentication environment aiming at a target chip to obtain a first log control file, wherein the authentication environment aiming at the target chip is used for carrying out functional authentication on the target chip, the authentication environment aiming at the target chip comprises a plurality of components, and the components form a plurality of layers in a tree structure; the first log control file comprises a component name of at least one component in the plurality of components, a level of at least one component in the plurality of components and a log printing level corresponding to at least one component in the plurality of components, wherein the log printing level corresponding to at least one component is an initial level;
updating the log printing level of a first component in the first log control file to a first level to obtain a second log control file, wherein the first component belongs to the at least one component, and the types of information printed at the first level are more than those printed at the initial level;
and re-operating the verification environment aiming at the target chip according to the second log control file to obtain a first log.
2. The method according to claim 1, wherein the at least one component is a component having a hierarchy above a first threshold, and/or wherein the at least one component is a component of the plurality of components having a category that is a preset category and/or a user-selected category.
3. The method according to claim 1 or 2, wherein before said re-running the verification environment for the target chip based on the second log control file, the method further comprises:
and running the verification environment aiming at the target chip to obtain a second log, wherein the second log is used for indicating log information generated by the plurality of components in the running process, and the log information comprises the name of the component with the error and the error type of the component with the error.
4. A method according to claim 3, characterized in that the method further comprises:
inputting the second log into a log information identification model to obtain an identification of an interested component and a recommended adjustment level of the interested component, wherein the interested component is a component for adjusting the log printing level of a recommended user, and the recommended adjustment level is the log printing level of the recommended user after the interested component is adjusted;
The log information identification model is obtained by training according to a training sample, the training sample comprises a name of a component, a category of the component, a level of the component, log information of the component, an interested component selected by a user and a recommended adjustment level of the interested component selected by the user, the log information of the component is generated in the running process of the component, and the log information of the component belongs to the second log.
5. The method of claim 3, wherein the second log includes log information of the first component, the log information of the first component including an error type of the first component and a number of calls of the first component, the method further comprising:
determining the attention level of the first component according to the error type of the first component and the calling times of the first component, wherein the attention level of the first component is positively related to the calling times of the first component;
the first level is determined according to the attention level and the initial level of the first component, and the level difference between the first level and the initial level is positively correlated with the attention level of the first component.
6. The method of claim 1 or 4, wherein updating the log print level of the first component in the first log control file to the first level comprises:
and updating the log printing level of the first component in the first log control file to the first level according to the first level of the first component input by the user.
7. The method of claim 3, wherein the second log further includes a reporting error time point of the first component, the method further comprising:
determining the log printing starting time and the log printing ending time of the first component, wherein the error reporting time point is positioned between the log printing starting time and the log printing ending time, and the second log control file also comprises the log printing starting time and the log printing ending time of the first component;
the re-running the verification environment for the target chip according to the second log control file includes:
when the running time of the verification environment for the target chip is between the log printing start time and the log printing end time of the first component, the log information of the first component is printed at the first level.
8. The method of claim 1, wherein the log print level comprises a plurality of levels, a higher one of the plurality of levels corresponding to a lesser variety of printed information, the level of the first level being lower than the level of the initial level.
9. A log printing device is characterized in that the log printing device comprises an operation unit and a processing unit,
the operation unit is used for:
running an authentication environment aiming at a target chip to obtain a first log control file, wherein the authentication environment aiming at the target chip is used for carrying out functional authentication on the target chip, the authentication environment aiming at the target chip comprises a plurality of components, and the components form a plurality of layers in a tree structure; the first log control file comprises a component name of at least one component in the plurality of components, a level of at least one component in the plurality of components and a log printing level corresponding to at least one component in the plurality of components, wherein the log printing level corresponding to at least one component is an initial level;
re-running the verification environment aiming at the target chip according to the second log control file to obtain a first log;
The processing unit is used for updating the log printing level of a first component in the first log control file to a first level to obtain a second log control file, the first component belongs to the at least one component, and the information types obtained by printing at the first level are more than the information types obtained by printing at the initial level.
10. A log printing device comprising a processor and a memory, the memory having stored therein a program comprising instructions for performing the method of any of claims 1 to 8.
CN202310869251.2A 2023-07-17 2023-07-17 Log printing method and related device Active CN116595932B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310869251.2A CN116595932B (en) 2023-07-17 2023-07-17 Log printing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310869251.2A CN116595932B (en) 2023-07-17 2023-07-17 Log printing method and related device

Publications (2)

Publication Number Publication Date
CN116595932A true CN116595932A (en) 2023-08-15
CN116595932B CN116595932B (en) 2023-10-20

Family

ID=87608488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310869251.2A Active CN116595932B (en) 2023-07-17 2023-07-17 Log printing method and related device

Country Status (1)

Country Link
CN (1) CN116595932B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110067008A1 (en) * 2009-09-14 2011-03-17 Deepti Srivastava Techniques for adaptive trace logging
WO2016197768A1 (en) * 2016-01-04 2016-12-15 中兴通讯股份有限公司 Chip verification method, device, and system
CN115017022A (en) * 2022-05-30 2022-09-06 蚂蚁区块链科技(上海)有限公司 Log level adjusting method and device
CN115630036A (en) * 2022-11-14 2023-01-20 英诺达(成都)电子科技有限公司 Error information processing method, apparatus, device, storage medium and program product
CN115657981A (en) * 2022-11-10 2023-01-31 北京物芯科技有限责任公司 Method for setting print level of print information in authentication environment and authentication method
CN115758963A (en) * 2022-11-17 2023-03-07 眸芯科技(上海)有限公司 Device, method and system for processing printing information in chip EDA simulation
CN115757157A (en) * 2022-11-24 2023-03-07 芯动微电子科技(武汉)有限公司 Method and device for realizing efficient regression and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110067008A1 (en) * 2009-09-14 2011-03-17 Deepti Srivastava Techniques for adaptive trace logging
WO2016197768A1 (en) * 2016-01-04 2016-12-15 中兴通讯股份有限公司 Chip verification method, device, and system
CN115017022A (en) * 2022-05-30 2022-09-06 蚂蚁区块链科技(上海)有限公司 Log level adjusting method and device
CN115657981A (en) * 2022-11-10 2023-01-31 北京物芯科技有限责任公司 Method for setting print level of print information in authentication environment and authentication method
CN115630036A (en) * 2022-11-14 2023-01-20 英诺达(成都)电子科技有限公司 Error information processing method, apparatus, device, storage medium and program product
CN115758963A (en) * 2022-11-17 2023-03-07 眸芯科技(上海)有限公司 Device, method and system for processing printing information in chip EDA simulation
CN115757157A (en) * 2022-11-24 2023-03-07 芯动微电子科技(武汉)有限公司 Method and device for realizing efficient regression and storage medium

Also Published As

Publication number Publication date
CN116595932B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
US10409712B2 (en) Device based visual test automation
US20210279577A1 (en) Testing of Computing Processes Using Artificial Intelligence
US11914933B2 (en) Generation of dynamic design flows for integrated circuits
US6941546B2 (en) Method and apparatus for testing a software component using an abstraction matrix
US8214192B2 (en) Resource remapping in a hardware emulation environment
US10671785B1 (en) Framework for reusing cores in simulation
CN106909498A (en) A kind of java applet injects the method and system of failure
US20090240457A1 (en) Testing in a hardware emulation environment
US8347278B2 (en) Instrumenting a compiled software routine for augmentation
US11055208B1 (en) Systems and methods for automatically assessing and conforming software development modules to accessibility guidelines in real-time
CN113901745A (en) Chip testing method and device, electronic equipment and computer readable storage medium
US20220244931A1 (en) Image file obtaining method and apparatus
US10830818B2 (en) Ensuring completeness of interface signal checking in functional verification
US10380313B1 (en) Implementation and evaluation of designs for heterogeneous computing platforms with hardware acceleration
US11526429B1 (en) Identifying critical methods and critical paths in software code
CN109284222B (en) Software unit, project testing method, device and equipment in data processing system
CN113515348A (en) Simulator modeling method and device based on opportunity action flow
CN116595932B (en) Log printing method and related device
US9280627B1 (en) GUI based verification at multiple abstraction levels
CN111382065B (en) Verification flow management system and method based on test template
CN112241370A (en) Verification method, system and device for API (application program interface) interface class
CN115599618A (en) Register dynamic relocation verification method and device, storage medium and processor
CN113779918A (en) SoC simulation method, device, computing equipment and computer storage medium
US20200349304A1 (en) Method, apparatus, device, and medium for implementing simulator
US10635766B2 (en) Simulation employing level-dependent multitype events

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant