Simulation verification method and device for timer and electronic equipment

By determining the master-slave timer type in the chip and automating test cases, the problem of large simulation verification workload in the prior art is solved, and efficient timer simulation verification is achieved.

CN119066866APending Publication Date: 2024-12-03BEIJING TONGFANG MICROELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411177474.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In the prior art, the simulation verification of timers is large and inefficient, and multiple different verification environments are required to adapt to different types of timers and their associated scenarios.

Method used

By determining the master timer and slave timer types in the chip, using conditional compilation instructions to instantiate and automate functional test cases, simulation verification of different timer types and associated scenarios is achieved, and the number of verification environments is reduced.

Benefits of technology

It improves the efficiency of simulation verification, meets the simulation verification needs of diverse timer types and associated scenarios, and reduces workload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066866A_ABST
    Figure CN119066866A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of chip verification, and discloses a simulation verification method and device for a timer and electronic equipment, and the method comprises the steps: determining a master timer type and / or a slave timer type in candidate timer types of a chip; determining a master timer in the timers belonging to the master timer type, and / or determining a slave timer in the timers belonging to the slave timer type; instantiating each determined timer through a condition compiling instruction, and determining a function test case of each timer; and performing simulation verification on the corresponding timer by using each function test case. According to the method, simulation verification is performed on different timer types and associated scenes between timers based on one verification environment, so that the number of verification environments required for simulation verification is reduced, the workload of simulation verification is reduced, and the simulation verification efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of chip verification, for example, to a simulation verification method, device, and electronic device for a timer. Background Art

[0002] As an important counting, filtering and waveform output module, the timer is widely used in various chips. In order to ensure that the timer can function normally in the chip, simulation verification of the timer is an important step.

[0003] Chips usually include different types of timers, and the timers have complex associations, which requires simulation verification using corresponding verification environments for each type of timer and the association scenarios between timers. In related technologies, it is necessary to build multiple different verification environments to complete the simulation verification of timers, which results in a large workload and low efficiency.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0006] The embodiments of the present disclosure provide a simulation verification method, device, and electronic device for a timer, which can reduce the workload of simulation verification and improve the efficiency of simulation verification.

[0007] According to a first aspect of the present disclosure, a simulation verification method for a timer is provided, the simulation verification method comprising:

[0008] Determine a master timer type and / or a slave timer type from candidate timer types of the chip;

[0009] Determine a master timer from among timers belonging to a master timer type, and / or determine a slave timer from among timers belonging to a slave timer type;

[0010] Instantiate each timer determined by conditional compilation instructions, and determine the functional test case of each timer;

[0011] Use each functional test case to simulate and verify the corresponding timer.

[0012] In some embodiments, the candidate timer types include a first timer type and a second timer type, and the timer belonging to the second timer type is obtained by extending the function of the timer belonging to the first timer type.

[0013] In some embodiments, determining a master timer type and / or a slave timer type from candidate timer types of a chip includes:

[0014] Adding compilation options to the first variable and the second variable defined in the configuration file of the chip, wherein the compilation option added to the first variable is used to indicate the master timer type, and the compilation option added to the second variable is used to indicate the slave timer type;

[0015] The type of the master timer is determined according to the compilation option added to the first variable, and / or the type of the slave timer is determined according to the compilation option added to the second variable.

[0016] In some embodiments, the candidate timer types include a first timer type and a second timer type, and the compilation options include a first compilation option indicating that the first timer type is a master timer type, a second compilation option indicating that the second timer type is a master timer type, a third compilation option indicating that the first timer type is a slave timer type, a fourth compilation option indicating that the second timer type is a slave timer type, and a fifth compilation option indicating that the slave timer type is not set.

[0017] In some embodiments, determining the master timer type according to the compilation option added to the first variable, and / or determining the slave timer type according to the compilation option added to the second variable includes:

[0018] When the compilation option added to the first variable is the first compilation option, determining the first timer type to be the main timer type;

[0019] When the compilation option added to the first variable is the second compilation option, determining the second timer type to be the main timer type;

[0020] When the compilation option added to the second variable is the third compilation option, determining that the first timer type is a slave timer type;

[0021] When the compilation option added to the second variable is the fourth compilation option, determining that the second timer type is a slave timer type;

[0022] When the compilation option added by the second variable is the fifth compilation option, it is determined that the slave timer type is not set.

[0023] In some embodiments, the simulation verification method also includes: adding a check condition in the interface of the master timer and / or the slave timer, wherein the check condition is used to indicate turning off non-check items of the master timer and the slave timer, and the content of the check condition depends on the candidate timer type to which the master timer belongs and / or the candidate timer type to which the slave timer belongs.

[0024] In some embodiments, when the master timer and the slave timer are determined, the simulation verification method further includes: cascading the master timer and the slave timer.

[0025] In some embodiments, a master timer and a slave timer are cascaded, including:

[0026] Define intermediate variables;

[0027] Connect the output port of the main timer to the interface variable, and the interface variable to the intermediate variable;

[0028] Connect the intermediate variable to the input of the slave timer to realize the cascade connection between the master timer and the slave timer.

[0029] According to a second aspect of the present disclosure, a simulation verification device for a timer is provided, the simulation verification device comprising:

[0030] A timer type determination module, configured to determine a master timer type and / or a slave timer type from candidate timer types of the chip;

[0031] The to-be-instantiated timer determination module is configured to determine a master timer from timers belonging to a master timer type, and / or determine a slave timer from timers belonging to a slave timer type;

[0032] A timer pre-configuration module is configured to instantiate each timer determined by a conditional compilation instruction and to determine a functional test case for each timer;

[0033] The simulation verification module is configured to use each functional test case to perform simulation verification on the corresponding timer.

[0034] According to a third aspect of the present disclosure, an electronic device is provided, the electronic device comprising a processor and a memory storing program instructions, the processor being configured to execute the simulation verification method for a timer provided in the first aspect of the present disclosure when running the program instructions.

[0035] The simulation verification method, device, and electronic device for a timer provided by the embodiments of the present disclosure can achieve the following technical effects:

[0036] The simulation verification method for timers provided by the embodiments of the present disclosure allows the user to select the main timer type and the sub-timer type according to the simulation verification requirements, as well as the matching of timers to be simulated and verified. This process can meet the simulation verification requirements of various timer types and the simulation verification requirements of various related scenarios between timers. After determining the timers that need to be simulated and verified, each timer is automatically instantiated and the functional test case of each timer is determined, and each functional test case is used to simulate and verify the corresponding timer. The above method simulates and verifies different timer types and related scenarios between timers based on a verification environment, which reduces the number of verification environments required for simulation verification, helps to reduce the workload of simulation verification, and improves the efficiency of simulation verification.

[0037] The foregoing general description and the following description are exemplary and explanatory only and are not intended to limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:

[0039] Figure 1 It is a flowchart of a simulation verification method for a timer provided by an embodiment of the present disclosure;

[0040] Figure 2 It is a flowchart of another simulation verification method for a timer provided by an embodiment of the present disclosure;

[0041] Figure 3 It is a flowchart of another simulation verification method for a timer provided by an embodiment of the present disclosure;

[0042] Figure 4 It is a flowchart of another simulation verification method for a timer provided by an embodiment of the present disclosure;

[0043] Figure 5 It is a structural diagram of a simulation verification device for a timer provided by an embodiment of the present disclosure;

[0044] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0045] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.

[0046] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0047] Unless otherwise stated, the term "plurality" means two or more.

[0048] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.

[0049] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.

[0050] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.

[0051] The disclosed embodiment provides an electronic device, which may be a device with computing capabilities, such as a computer, a server, a mobile phone, a PAD, etc., or a terminal device specifically used for simulation verification. The electronic device may be connected to a chip for register simulation verification, and execute the simulation verification method for a timer provided in the disclosed embodiment, wherein the chip may be a smart card chip, a vehicle-mounted microcontroller chip, a general-purpose microcontroller chip, etc. Of course, the type of chip is not limited thereto.

[0052] In conjunction with the electronic device provided by the embodiment of the present disclosure, the embodiment of the present disclosure provides a simulation verification method for a timer, such as Figure 1 As shown, the simulation verification method includes:

[0053] S101 : The electronic device determines a master timer type and / or a slave timer type from candidate timer types of a chip.

[0054] The chip includes different types of timers, and the embodiments of the present disclosure use various timer types in the chip as candidate timer types. The electronic device allows the user to select at least one of a master timer type and a slave timer type from the candidate timer type according to the simulation verification requirements. The electronic device can select only the master timer type from the candidate timer type, or select the master timer type and the slave timer type from the candidate timer type according to the simulation verification requirements of the user.

[0055] Here, in the case where the master timer type and the slave timer type are simultaneously selected from the candidate timer types, the master timer type and the slave timer type may be different candidate timer types, or the master timer type and the slave timer type may be the same candidate timer type. Taking the candidate timer types including the first timer type and the second timer type as an example, the master timer type and the slave timer type are the first timer type and the second timer type, respectively, or the master timer type and the slave timer type may both be the first timer type, or the master timer type and the slave timer type may both be the second timer type.

[0056] S102: The electronic device determines a master timer from timers belonging to a master timer type, and / or determines a slave timer from timers belonging to a slave timer type.

[0057] In the embodiment of the present disclosure, each timer type in the chip includes one or more timers. When the master timer type has been determined, the master timer is determined from the timers belonging to the master timer type; when the slave timer type has been determined, the slave timer is determined from the timers belonging to the slave timer type. It can be understood that if only the master timer type is selected from the candidate timer type and the slave timer type is not determined, there is no need to determine the slave timer.

[0058] S103, the electronic device instantiates each determined timer through a conditional compilation instruction, and determines a functional test case for each timer.

[0059] In the disclosed embodiment, instantiating a timer means creating an instance of a timer module, configuring its parameters (such as period, initial delay, etc.), connecting its signals to the corresponding interfaces of the timer module, and then controlling and monitoring these signals during simulation.

[0060] S104, the electronic device performs simulation verification on the corresponding timer using each functional test case.

[0061] The simulation verification method for timers provided by the embodiments of the present disclosure allows the user to select the main timer type and the slave timer type according to the simulation verification requirements, as well as the matching of timers to be simulated and verified. This process can meet the simulation verification requirements of various timer types and the simulation verification requirements of various related scenarios between timers (such as timer cascades). After determining the timers that need to be simulated and verified, each timer is automatically instantiated and the functional test case of each timer is determined, and each functional test case is used to simulate and verify the corresponding timer. The above method simulates and verifies different timer types and related scenarios between timers based on a verification environment, which reduces the number of verification environments required for simulation verification, helps to reduce the workload of simulation verification, and improves the efficiency of simulation verification.

[0062] In some embodiments, the candidate timer types include a first timer type and a second timer type, and the timer belonging to the second timer type is obtained by extending the function of the timer belonging to the first timer type.

[0063] In some embodiments, determining a master timer type and / or a slave timer type from candidate timer types of a chip includes: adding compilation options to a first variable and a second variable defined in a configuration file of the chip; determining the master timer type according to the compilation options added to the first variable, and / or determining the slave timer type according to the compilation options added to the second variable. Here, the compilation options added to the first variable are used to indicate the master timer type, and the compilation options added to the second variable are used to indicate the slave timer type.

[0064] The present disclosure provides another simulation verification method for a timer, such as Figure 2 As shown, the simulation verification method includes:

[0065] S201, the electronic device adds compilation options for the first variable and the second variable defined in the configuration file of the chip.

[0066] In the embodiment of the present disclosure, the compilation option added to the first variable is used to indicate the master timer type, and the compilation option added to the second variable is used to indicate the slave timer type.

[0067] In some embodiments, the candidate timer types include a first timer type and a second timer type, and the compilation options include a first compilation option indicating that the first timer type is a master timer type, a second compilation option indicating that the second timer type is a master timer type, a third compilation option indicating that the first timer type is a slave timer type, a fourth compilation option indicating that the second timer type is a slave timer type, and a fifth compilation option indicating that the slave timer type is not set.

[0068] Take the Makefile of the chip as an example. Makefile is a configuration file used to automate the compilation and building process. Define the variables M_TIMER_TY and S_TIMER_TY in Makefile. The compilation options configured in Makefile include M_TIMER_A, M_TIMER_B, S_TIMER_A, S_TIMER_B, and NO_S_TIMER. Here, M_TIMER_TY is used as the first variable, S_TIMER_TY is used as the second variable, M_TIMER_A is used as the first compilation option, M_TIMER_B is used as the second compilation option, S_TIMER_A is used as the third compilation option, S_TIMER_B is used as the fourth compilation option, and NO_S_TIMER is used as the fifth compilation option.

[0069] S202: The electronic device determines a master timer type according to a compilation option added to the first variable, and / or determines a slave timer type according to a compilation option added to the second variable.

[0070] When the compilation option added to the first variable is the first compilation option, the first timer type is determined to be the main timer type. For example, when M_TIMER_A is added to M_TIMER_TY, the first timer type is determined to be the main timer type.

[0071] When the compilation option added to the first variable is the second compilation option, the second timer type is determined to be the main timer type. For example, when M_TIMER_B is added to M_TIMER_TY, the second timer type is determined to be the main timer type.

[0072] When the compilation option added to the second variable is the third compilation option, the first timer type is determined to be a slave timer type. For example, when S_TIMER_A is added to S_TIMER_TY, the first timer type is determined to be a slave timer type.

[0073] When the compilation option added to the second variable is the fourth compilation option, the second timer type is determined to be a slave timer type. For example, when S_TIMER_B is added to S_TIMER_TY, the second timer type is determined to be a slave timer type.

[0074] When the compilation option added to the second variable is the fifth compilation option, it is determined that the slave timer type is not set. For example, when NO_S_TIMER is added to S_TIMER_TY, it is determined that the slave timer type is not set.

[0075] Taking the candidate timer types including the first timer type and the second timer type as an example, the result types of determining the master timer type and the slave timer type in the candidate timer types are shown in Table 1:

[0076] Table 1

[0077] S_TIMER_A S_TIMER_B NO_S_TIMER M_TIMER_A A and A Cascade A and B Cascade A M_TIMER_B B and A Cascade B and B Cascade B

[0078] In Table 1, the first column indicates the compilation options added by M_TIMER_TY, the first row indicates the compilation options added by S_TIMER_TY, A indicates the first timer type, and B indicates the second timer type.

[0079] The electronic device allows the user to select at least one of the master timer type and the slave timer type from the candidate timer type according to the simulation verification requirements. The electronic device can select only the master timer type from the candidate timer type, or select the master timer type and the slave timer type from the candidate timer type according to the simulation verification requirements of the user. When it is necessary to determine the master timer type, the first compilation option or the second compilation option can be added to the first variable to determine the first timer type or the second timer type as the master timer type. When it is necessary to determine the slave timer type, the third compilation option or the fourth compilation option can be added to the second variable to determine the first timer type or the second timer type as the slave timer type. When it is not necessary to determine the slave timer type, the fifth compilation option can be added to the second variable.

[0080] When a master timer type and a slave timer type are simultaneously selected from the candidate timer types, the master timer type and the slave timer type are respectively the first timer type and the second timer type, or the master timer type and the slave timer type can both be the first timer type, or the master timer type and the slave timer type can both be the second timer type.

[0081] S203: The electronic device determines a master timer from timers belonging to a master timer type, and / or determines a slave timer from timers belonging to a slave timer type.

[0082] In the embodiment of the present disclosure, each timer type in the chip includes one or more timers. When the master timer type has been determined, the master timer is determined from the timers belonging to the master timer type; when the slave timer type has been determined, the slave timer is determined from the timers belonging to the slave timer type. It can be understood that if only the master timer type is selected from the candidate timer type and the slave timer type is not determined, there is no need to determine the slave timer.

[0083] S204, the electronic device instantiates each determined timer through a conditional compilation instruction, and determines a functional test case for each timer.

[0084] In some embodiments, the specific content of the conditional compilation instruction depends on the actual scenario. When the first timer type is the master timer type, the conditional compilation instruction `ifdef M_TIMER_A in the top test bench (top_tb) completes the instantiation of the master timer. When the second timer type is the master timer type, the conditional compilation instruction `ifdef M_TIMER_B in the top test bench completes the instantiation of the master timer. When the first timer type is the slave timer type, the conditional compilation instruction `ifdef S_TIMER_A in the top test bench completes the instantiation of the slave timer. When the second timer type is the slave timer type, the conditional compilation instruction `ifdef S_TIMER_B in the top test bench completes the instantiation of the slave timer. When NO_S_TIMER is added to S_TIMER_TY, the conditional compilation instruction `ifdef NO_S_TIMER is used to ensure that the slave timer is not instantiated.

[0085] S205, the electronic device performs simulation verification on the corresponding timer using each functional test case.

[0086] In some embodiments, the simulation verification method also includes: adding a check condition in the interface of the master timer and / or the slave timer, wherein the check condition is used to indicate turning off non-check items of the master timer and the slave timer, and the content of the check condition depends on the candidate timer type to which the master timer belongs and / or the candidate timer type to which the slave timer belongs.

[0087] The present disclosure provides another simulation verification method for a timer, such as Figure 3 As shown, the simulation verification method includes:

[0088] S301: The electronic device determines a master timer type and / or a slave timer type from candidate timer types of a chip.

[0089] S302: The electronic device determines a master timer from timers belonging to a master timer type, and / or determines a slave timer from timers belonging to a slave timer type.

[0090] S303, the electronic device adds a check condition in the interface of the master timer and / or the slave timer.

[0091] In the disclosed embodiment, the check condition is used to indicate the non-check items of closing the master timer and the slave timer, and the content of the check condition is determined according to the candidate timer type to which the master timer belongs and / or the candidate timer type to which the slave timer belongs. After adding the check condition to the interface of the master timer and / or the slave timer, specific assertion check items can be dynamically enabled or disabled through conditional judgment to avoid running these checks in unnecessary test scenarios, thereby reducing simulation time and improving verification efficiency. Each timer may have its own unique functions and constraints, and the check condition can ensure that the corresponding verification logic is executed only under the corresponding timer type and scenario. In this way, the function of each timer can be tested more accurately, and the pertinence and accuracy of the verification can be improved. It also avoids triggering erroneous assertion warnings under inappropriate configurations, reduces noise in the verification process, and makes real errors easier to identify and fix.

[0092] In some embodiments, the candidate timer types include a first timer type and a second timer type. The timer belonging to the second timer type is obtained by expanding the functions of the timer belonging to the first timer type. Therefore, the functions of the timer belonging to the second timer type include the functions of the timer belonging to the first timer type. At this time, the check items that are not needed for the timer of the first timer type can be closed by adding check conditions in the interface of the master timer and / or the slave timer.

[0093] In the embodiments of the present disclosure, interfaces for passing parameter parameter are defined for the master timer and the slave timer, respectively, and the interfaces are represented as interface m_if#(parameter M_TYPE) and interface s_if#(parameter S_TYPE), wherein interface m_if#(parameter M_TYPE) is the interface of the master timer, interface s_if#(parameter S_TYPE) is the interface of the slave timer, M_TYPE indicates the master controller type, and S_TYPE indicates the slave controller type, and check conditions for M_TYPE and S_TYPE can be added respectively in the m_if and s_if assertion disable iff.

[0094] S304, the electronic device instantiates each determined timer through a conditional compilation instruction, and determines a functional test case for each timer.

[0095] In some embodiments, when each timer determined by conditional compilation instructions is instantiated, appropriate parameters can be passed to the master timer and / or the slave timer according to the corresponding compilation options in M_TIMER_A, M_TIMER_B, S_TIMER_A and S_TIMER_B, so as to realize assertion check multiplexing. In addition, the slave timer can be selected not to be instantiated through the compilation option NO_S_TIMER.

[0096] S305, the electronic device performs simulation verification on the corresponding timer using each functional test case.

[0097] In some embodiments, when the master timer and the slave timer are determined, the simulation verification method further includes: cascading the master timer and the slave timer.

[0098] The present disclosure provides another simulation verification method for a timer, such as Figure 4 As shown, the simulation verification method includes:

[0099] S401: The electronic device determines a master timer type and a slave timer type from candidate timer types of a chip.

[0100] S402: The electronic device determines a master timer from timers belonging to a master timer type, and determines a slave timer from timers belonging to a slave timer type.

[0101] S403, the electronic device instantiates each determined timer through a conditional compilation instruction, and determines a functional test case for each timer.

[0102] S404, the electronic device cascades the master timer and the slave timer.

[0103] In the embodiment of the present disclosure, after the master timer and the slave timer are cascaded, simulation verification of the timer cascade scenario can be implemented.

[0104] In some embodiments, a master timer and a slave timer are cascaded, including: defining an intermediate variable, connecting the output port of the master timer to an interface variable, connecting the interface variable to the intermediate variable, connecting the intermediate variable to the input of the slave timer, thereby cascading the master timer and the slave timer.

[0105] Optionally, define master_out_* variables as intermediate variables in the top-level file (top_tb.sv), connect the master_out_* variables to the m_out_* output port of the master timer, connect the master_out_* variables to the input port s_in_* of the slave timer, and assign the output of the m_out_* output port of the master timer to the master_out_* variables through the assign statement to realize the cascading of the master timer and the slave timer.

[0106] In the embodiments of the present disclosure, an interface variable is an interface variable, which generally refers to a variable used to connect different components. The interface variable can be expressed as a signal or a wire. The main function of the interface variable is to serve as a bridge for signal transmission, so that the output of the master timer can be recognized and processed by the slave timer. Specifically, the output of the master timer is recognized and processed by the slave timer in turn through the interface variable and the intermediate variable.

[0107] In the disclosed embodiment, the output of the master timer is connected to the input of the slave timer through interface variables and intermediate variables, so that the master timer and the slave timer can be designed and tested independently without considering each other's internal details, thereby improving the maintainability and scalability of the system. In addition, the interface variables and intermediate variables can be used as signal isolation points to help prevent signal interference or signal integrity problems.

[0108] S405, the electronic device performs simulation verification on the corresponding timer using each functional test case.

[0109] In some embodiments, the master timer may be first simulated and verified using a functional test case of the master timer, and then the slave timer may be simulated and verified using a functional test case of the slave timer.

[0110] In some embodiments, a timer belonging to the second timer type is obtained by functionally expanding a timer belonging to the first timer type. When the master timer belongs to the first timer type and the slave timer belongs to the second timer type, the slave timer is first simulated and verified using the functional test case of the slave timer. When it is determined that the slave timer passes, it is not necessary to simulate and verify the master timer using the functional test case of the master timer, but it is directly determined that the master timer passes. When the master timer belongs to the second timer type and the slave timer belongs to the first timer type, the master timer is first simulated and verified using the functional test case of the master timer. When it is determined that the master timer passes, it is not necessary to simulate and verify the slave timer using the functional test case of the slave timer, but it is directly determined that the slave timer passes.

[0111] Combination Figure 5As shown, an embodiment of the present disclosure provides a simulation verification device 500 for a timer, and the simulation verification device 500 includes a timer type determination module 501, a timer to be instantiated determination module 502, a timer preconfiguration module 503 and a simulation verification module 504.

[0112] The timer type determination module 501 is configured to determine a master timer type and / or a slave timer type from candidate timer types of the chip.

[0113] The to-be-instantiated timer determination module 502 is configured to determine a master timer from timers belonging to a master timer type, and / or determine a slave timer from timers belonging to a slave timer type.

[0114] The timer pre-configuration module 503 is configured to instantiate each timer determined by a conditional compilation instruction, and determine a functional test case for each timer.

[0115] The simulation verification module 504 is configured to perform simulation verification on the corresponding timer using each functional test case.

[0116] The simulation verification device for timers provided by the embodiments of the present disclosure allows the user to select the main timer type and the sub-timer type according to the simulation verification requirements, as well as the matching of timers to be simulated and verified. This process can meet the simulation verification requirements of various timer types and the simulation verification requirements of various related scenarios between timers. After determining the timers that need to be simulated and verified, each timer is automatically instantiated and the functional test case of each timer is determined, and each functional test case is used to simulate and verify the corresponding timer. The above method simulates and verifies different timer types and related scenarios between timers based on a verification environment, which reduces the number of verification environments required for simulation verification, helps to reduce the workload of simulation verification, and improves the efficiency of simulation verification.

[0117] In some embodiments, the candidate timer types include a first timer type and a second timer type, and the timer belonging to the second timer type is obtained by extending the function of the timer belonging to the first timer type.

[0118] In some embodiments, the timer type determination module 501 is configured to:

[0119] Adding compilation options to the first variable and the second variable defined in the configuration file of the chip, wherein the compilation option added to the first variable is used to indicate the master timer type, and the compilation option added to the second variable is used to indicate the slave timer type;

[0120] The type of the master timer is determined according to the compilation option added to the first variable, and / or the type of the slave timer is determined according to the compilation option added to the second variable.

[0121] In some embodiments, the candidate timer types include a first timer type and a second timer type, and the compilation options include a first compilation option indicating that the first timer type is a master timer type, a second compilation option indicating that the second timer type is a master timer type, a third compilation option indicating that the first timer type is a slave timer type, a fourth compilation option indicating that the second timer type is a slave timer type, and a fifth compilation option indicating that the slave timer type is not set.

[0122] In some embodiments, the timer type determination module 501 is configured to:

[0123] When the compilation option added to the first variable is the first compilation option, determining the first timer type to be the main timer type;

[0124] When the compilation option added to the first variable is the second compilation option, determining the second timer type to be the main timer type;

[0125] When the compilation option added to the second variable is the third compilation option, determining that the first timer type is a slave timer type;

[0126] When the compilation option added to the second variable is the fourth compilation option, determining that the second timer type is a slave timer type;

[0127] When the compilation option added by the second variable is the fifth compilation option, it is determined that the slave timer type is not set.

[0128] In some embodiments, the timer preconfiguration module 503 is configured to: add a check condition in the interface of the master timer and / or the slave timer, wherein the check condition is used to indicate a non-check item for shutting down the master timer and the slave timer, and the content of the check condition depends on the candidate timer type to which the master timer belongs and / or the candidate timer type to which the slave timer belongs.

[0129] In some embodiments, the timer pre-configuration module 503 is configured to: when a master timer and a slave timer are determined, cascade the master timer and the slave timer.

[0130] In some embodiments, the timer pre-configuration module 503 is configured to:

[0131] Define intermediate variables;

[0132] Connect the output port of the main timer to the interface variable, and the interface variable to the intermediate variable;

[0133] Connect the intermediate variable to the input of the slave timer to realize the cascade connection between the master timer and the slave timer.

[0134] Combination Figure 6 As shown, an embodiment of the present disclosure provides an electronic device 600, which includes a processor 601 and a memory 602. Optionally, the electronic device 600 may also include a communication interface 603 and a bus 604. The processor 601, the communication interface 603, and the memory 602 may communicate with each other through the bus 604. The communication interface 603 may be used for information transmission. The processor 601 may call the logic instructions in the memory 602 to execute the simulation verification method for the timer of the above embodiment.

[0135] In addition, the logic instructions in the memory 602 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.

[0136] The memory 602 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 601 executes the functional application and data processing by running the program instructions / modules stored in the memory 602, that is, the simulation verification method for the timer in the above embodiment is implemented.

[0137] The memory 602 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 602 may include a high-speed random access memory and may also include a non-volatile memory.

[0138] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned simulation verification method for a timer.

[0139] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.

[0140] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0141] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0142] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0143] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A simulation verification method for a timer, characterized in that: include: Determine a master timer type and / or a slave timer type from candidate timer types of the chip; Determine a master timer from among timers belonging to a master timer type, and / or determine a slave timer from among timers belonging to a slave timer type; Instantiate each timer determined by conditional compilation instructions, and determine the functional test case of each timer; Use each functional test case to simulate and verify the corresponding timer.

2. The simulation verification method according to claim 1, characterized in that: The candidate timer types include a first timer type and a second timer type. The timer belonging to the second timer type is obtained by extending the function of the timer belonging to the first timer type.

3. The simulation verification method according to claim 1, characterized in that: Determining a master timer type and / or a slave timer type from candidate timer types of the chip includes: Adding compilation options to the first variable and the second variable defined in the configuration file of the chip, wherein the compilation option added to the first variable is used to indicate the master timer type, and the compilation option added to the second variable is used to indicate the slave timer type; The type of the master timer is determined according to the compilation option added to the first variable, and / or the type of the slave timer is determined according to the compilation option added to the second variable.

4. The simulation verification method according to claim 3, characterized in that: The candidate timer types include a first timer type and a second timer type, and the compilation options include a first compilation option indicating that the first timer type is a master timer type, a second compilation option indicating that the second timer type is a master timer type, a third compilation option indicating that the first timer type is a slave timer type, a fourth compilation option indicating that the second timer type is a slave timer type, and a fifth compilation option indicating that the slave timer type is not set.

5. The simulation verification method according to claim 4, characterized in that: Determining the type of the master timer according to the compilation option added by the first variable, and / or determining the type of the slave timer according to the compilation option added by the second variable, including: When the compilation option added to the first variable is the first compilation option, determining the first timer type to be the main timer type; When the compilation option added to the first variable is the second compilation option, determining the second timer type to be the main timer type; When the compilation option added to the second variable is the third compilation option, determining that the first timer type is a slave timer type; When the compilation option added to the second variable is the fourth compilation option, determining that the second timer type is a slave timer type; When the compilation option added by the second variable is the fifth compilation option, it is determined that the slave timer type is not set.

6. The simulation verification method according to claim 1, characterized in that: The simulation verification method also includes: adding a check condition in the interface of the master timer and / or the slave timer, wherein the check condition is used to indicate turning off non-check items of the master timer and the slave timer, and the content of the check condition depends on the candidate timer type to which the master timer belongs and / or the candidate timer type to which the slave timer belongs.

7. The simulation verification method according to claim 1, characterized in that: When the master timer and the slave timer are determined, the simulation verification method further includes: cascading the master timer and the slave timer.

8. The simulation verification method according to claim 7, characterized in that: Cascade the master and slave timers, including: Define intermediate variables; Connect the output port of the main timer to the interface variable, and the interface variable to the intermediate variable; Connect the intermediate variable to the input of the slave timer to realize the cascade connection between the master timer and the slave timer.

9. A simulation verification device for a timer, characterized in that: include: A timer type determination module, configured to determine a master timer type and / or a slave timer type from candidate timer types of the chip; The to-be-instantiated timer determination module is configured to determine a master timer from timers belonging to a master timer type, and / or determine a slave timer from timers belonging to a slave timer type; A timer pre-configuration module is configured to instantiate each timer determined by a conditional compilation instruction and to determine a functional test case for each timer; The simulation verification module is configured to perform simulation verification on the corresponding timer using each functional test case.

10. An electronic device comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the simulation verification method for a timer according to any one of claims 1 to 8 when running program instructions.