Diagnostic coverage rate determination method and device, electronic equipment and readable medium
By obtaining and processing the output points of the security mechanism in the target file, identifying the input points and intermediate structure of the circuit module, and calculating the diagnostic coverage of components layer by layer, it solves the problem that the coverage ratio of multiple security mechanism coverage components in the prior art cannot be accurately calculated. The problem has improved the accuracy of safety assessment of electronic systems.
Patent Information
- Application Number
- CN202410839163.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-11-05
AI Technical Summary
The prior art cannot accurately calculate the diagnostic coverage of components that are covered by multiple safety mechanisms simultaneously, resulting in errors in the safety evaluation of electronic systems.
By obtaining the output points of the security mechanism in the target file, identifying the input points, output points and intermediate structures on the circuit module, extracting the first diagnostic coverage, and performing layer-by-layer calculations based on the hierarchical relationship between components, determining the circuit module and each The second diagnostic coverage of the component ensures that the impact of multiple safety mechanisms on the component is considered.
Accurate calculation of diagnostic coverage of components covered by multiple safety mechanisms simultaneously is achieved, and the accuracy and comprehensiveness of safety evaluation of electronic systems is improved.
Smart Images

Figure CN118897793A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of security analysis technology, and in particular to a method, device, electronic device and readable medium for determining diagnostic coverage. Background Art
[0002] Diagnostic coverage is a critical performance indicator in the development and safety assessment of electronic systems, especially in applications such as automotive electronic control units. High diagnostic coverage means that the system can detect and respond to faults in a timely and accurate manner, thereby improving the safety of the entire system. Currently, when calculating diagnostic coverage, most of the time, only the diagnostic coverage of the entire circuit can be obtained. In addition, when a component is covered by multiple safety mechanisms at the same time, it is difficult to simultaneously consider the impact of multiple safety mechanisms on the diagnostic coverage of the component, that is, it is impossible to accurately calculate the diagnostic coverage of components covered by multiple mechanisms at the same time.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The present application provides a method, device, electronic device and readable medium for determining diagnostic coverage to solve the above-mentioned technical problem of "inability to accurately calculate the diagnostic coverage of components covered by multiple mechanisms at the same time".
[0005] According to one aspect of an embodiment of the present application, the present application provides a method for determining diagnostic coverage, including: obtaining a target file provided by a target object, and determining an output point of a safety mechanism based on the target file; identifying an input point and an intermediate structure corresponding to the output point on a circuit module, wherein a plurality of safety mechanisms are covered on the circuit module, and the intermediate structure is a connecting portion between the output point and the input point; extracting a first diagnostic coverage corresponding to the safety mechanism from the target file, and mapping the first diagnostic coverage to components corresponding to the input point, the output point, and the intermediate structure, wherein the first diagnostic coverage is the diagnostic coverage defined for the input point, the output point, and the intermediate structure of the safety mechanism, respectively; determining a second diagnostic coverage of the circuit module and each component based on the hierarchical relationship between the components and the first diagnostic coverage.
[0006] Optionally, the second diagnostic coverage of the circuit module and each component is determined based on the hierarchical relationship between the components and the first diagnostic coverage, including: mapping the first diagnostic coverage of each component from a high level to a low level in sequence to obtain the third diagnostic coverage of each component, wherein the circuit module belongs to the highest first level, and the circuit module includes the second level and the third level from high to low; obtaining the number of transistors of each component; and calculating the third diagnostic coverage of each component layer by layer from a low level to a high level according to the number of transistors to obtain the second diagnostic coverage of the circuit module and each component.
[0007] Optionally, the first diagnostic coverage of each component is mapped from a high level to a low level in sequence to obtain the third diagnostic coverage of each component, including: determining the first diagnostic coverage of the first level as the third diagnostic coverage of the first level; determining the third diagnostic coverage of each first component according to the third diagnostic coverage of the first level and the first diagnostic coverage of each first component on the second level; determining the third diagnostic coverage of each second component according to the third diagnostic coverage of each first component and the first diagnostic coverage of each second component on the third level.
[0008] Optionally, the third diagnostic coverage of each first component is determined based on the third diagnostic coverage of the first level and the first diagnostic coverage of each first component on the second level, including: comparing the first diagnostic coverage of the first components with the third diagnostic coverage of the first level respectively; if the first diagnostic coverage of the first components is greater than or equal to the third diagnostic coverage of the first level, determining the first diagnostic coverage of the first components as the third diagnostic coverage of the first components; if the first diagnostic coverage of the first components is less than the third diagnostic coverage of the first level, determining the third diagnostic coverage of the first level as the third diagnostic coverage of the first components.
[0009] Optionally, the third diagnostic coverage of each component is calculated layer by layer from a low level to a high level according to the number of transistors to obtain the second diagnostic coverage of the circuit module and each component, including: determining the third diagnostic coverage of each second component on the third level as the second diagnostic coverage of the second component; determining the second diagnostic coverage of the first component on the second level that has a corresponding relationship with the second component according to the number of transistors of each second component and the second diagnostic coverage, wherein the first component with a corresponding relationship includes at least one second component; determining the second diagnostic coverage of the circuit module according to the number of transistors of each first component on the second level and the second diagnostic coverage.
[0010] Optionally, the second diagnostic coverage of the circuit module is determined based on the number of transistors of each first component on the second level and the second diagnostic coverage, including: counting the total number of transistors of each first component; adding the products obtained by multiplying the second diagnostic coverage of each first component by the transistor to obtain an addition result; and dividing the addition result by the total number of transistors to obtain the second diagnostic coverage of the circuit module.
[0011] Optionally, identifying the input point and the intermediate structure corresponding to the output point on the circuit module includes: constructing an empty node list, an area set and a node queue respectively, wherein the node list is used to store the state nodes on the traced path, the area set is used to store the circuit area jointly covered by the identified output point and the input point, and the node queue is used to store the state nodes to be traced; searching for the first state node that directly drives the output point, and storing the first state node in the node queue; tracing back the predecessor state nodes of each first state node in turn, and storing the first state nodes that have completed tracing in the node list and the area set respectively, and storing the predecessor state nodes that are not in the node list in the node queue in the node queue, wherein there is no state node between the predecessor state node in the node queue and the corresponding first state node; when all the first state nodes in the node queue are traced, obtaining the node list and the area set; determining the input point corresponding to the output point according to the node list, and determining the intermediate structure corresponding to the output point according to the area set.
[0012] According to another aspect of an embodiment of the present application, the present application provides a device for determining diagnostic coverage, including: an acquisition unit, used to acquire a target file provided by a target object, and determine an output point of a safety mechanism based on the target file; an identification unit, used to identify an input point and an intermediate structure corresponding to the output point on a circuit module, wherein a plurality of safety mechanisms are covered on the circuit module, and the intermediate structure is a connecting part between the output point and the input point; a mapping unit, used to extract a first diagnostic coverage corresponding to the safety mechanism from the target file, and map the first diagnostic coverage to components corresponding to the input point, the output point and the intermediate structure, wherein the first diagnostic coverage is the diagnostic coverage defined for the input point, the output point and the intermediate structure of the safety mechanism respectively; a determination unit, used to determine a second diagnostic coverage of the circuit module and each component based on the hierarchical relationship between the components and the first diagnostic coverage.
[0013] According to another aspect of an embodiment of the present application, the present application provides an electronic device, including a memory, a processor, a communication interface and a communication bus, wherein the memory stores a computer program that can be run on the processor, the memory and the processor communicate through the communication bus and the communication interface, and the steps of the above method are implemented when the processor executes the computer program.
[0014] According to another aspect of an embodiment of the present application, the present application also provides a computer-readable medium having a non-volatile program code executable by a processor, and the program code enables the processor to execute the above method.
[0015] The above technical solution provided by the embodiment of the present application has the following advantages compared with the related art:
[0016] The present application adopts a method for determining diagnostic coverage, including: obtaining a target file provided by a target object, and determining the output point of a safety mechanism according to the target file; identifying the input point and the intermediate structure corresponding to the output point on the circuit module, wherein the circuit module covers multiple safety mechanisms, and the intermediate structure is the connection part between the output point and the input point; extracting the first diagnostic coverage corresponding to the safety mechanism from the target file, and mapping the first diagnostic coverage to the components corresponding to the input point, the output point and the intermediate structure, wherein the first diagnostic coverage is the diagnostic coverage defined for the input point, the output point and the intermediate structure of the safety mechanism respectively; determining the second diagnostic coverage of the circuit module and each component according to the hierarchical relationship between each component and the first diagnostic coverage. By using the pre-defined first diagnostic coverage to map the components corresponding to the input point, the output point and the intermediate structure covered by multiple safety mechanisms separately, giving the components an initial diagnostic coverage, and then calculating the diagnostic coverage layer by layer according to the hierarchical relationship between different components, the problem of being unable to accurately calculate the diagnostic coverage of components covered by multiple safety mechanisms at the same time is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 A flowchart of an optional method for determining diagnostic coverage provided according to an embodiment of the present application;
[0020] Figure 2 A schematic diagram of component distribution on an optional circuit module provided according to an embodiment of the present application;
[0021] Figure 3-a A schematic diagram of a circuit before an optional identification input point and an intermediate structure provided according to an embodiment of the present application;
[0022] Figure 3-b A schematic diagram of an optional circuit after identifying an input point and an intermediate structure according to an embodiment of the present application;
[0023] Figure 4 A block diagram of an optional device for determining diagnostic coverage provided according to an embodiment of the present application;
[0024] Figure 5 A schematic diagram of an optional electronic device structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0026] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.
[0027] Diagnostic coverage is a critical performance indicator in the development and safety assessment of electronic systems, especially in applications such as automotive electronic control units. High diagnostic coverage means that the system can detect and respond to faults in a timely and accurate manner, thereby improving the safety of the entire system. Currently, when calculating diagnostic coverage, most of the time, only the diagnostic coverage of the entire circuit can be obtained. In addition, when a component is covered by multiple safety mechanisms at the same time, it is difficult to simultaneously consider the impact of multiple safety mechanisms on the diagnostic coverage of the component, that is, it is impossible to accurately calculate the diagnostic coverage of components covered by multiple mechanisms at the same time.
[0028] In order to solve the problem mentioned in the background technology, according to one aspect of the embodiment of the present application, a method for determining a diagnostic coverage is provided, such as Figure 1 As shown, including:
[0029] Step 101, obtaining a target file provided by a target object, and determining an output point of a security mechanism according to the target file;
[0030] Step 103, identifying an input point and an intermediate structure on the circuit module corresponding to the output point, wherein the circuit module is covered with multiple safety mechanisms, and the intermediate structure is a connection part between the output point and the input point;
[0031] Step 105, extracting a first diagnostic coverage rate corresponding to the safety mechanism from the target file, and mapping the first diagnostic coverage rate to components corresponding to the input point, the output point, and the intermediate structure, wherein the first diagnostic coverage rate is a diagnostic coverage rate defined for the input point, the output point, and the intermediate structure of the safety mechanism respectively;
[0032] Step 107 , determining the second diagnostic coverage of the circuit module and each component according to the hierarchical relationship between the components and the first diagnostic coverage.
[0033] The target file of this application is provided by the target object (i.e., the user). The content of the target file includes, but is not limited to, the name of the safety mechanism, the circuit components involved in the safety mechanism declaration, and the fault coverage data of each component. This information is used to ensure that the scope of each safety mechanism declaration can be accurately defined and its diagnostic coverage capability can be evaluated based on the fault coverage data.
[0034] The fault coverage data of the target file includes the coverage value of each safety mechanism statement, which can come from the default safety mechanism data file or a user-defined file. Different safety mechanism statements may have different coverage capabilities for permanent faults and transient faults. This application uses the diagnostic coverage of transient faults for illustration.
[0035] The first diagnostic coverage can be extracted from the fault coverage data of the target file. The first diagnostic coverage is the diagnostic coverage of each safety mechanism on the component. The first diagnostic coverage is mapped to the components corresponding to the input points, output points and intermediate structures. The purpose is to accurately consider the impact of each safety mechanism on the circuit components when determining the diagnostic coverage.
[0036] In a circuit, a component may be affected by multiple safety mechanisms at the same time. The present application provides a method for calculating the diagnostic coverage to deal with such situations, allowing the safety mechanism with the highest DC (diagnostic coverage) value to be selected to calculate the diagnostic coverage of a specific component, which ensures accuracy and comprehensiveness when facing overlapping components and multiple safety mechanism declarations.
[0037] Next, the calculation of the diagnostic coverage that covers multiple safety mechanisms simultaneously is explained.
[0038] Figure 2A schematic diagram of the component distribution of the circuit module provided for the present application, wherein TOP represents the circuit module, which belongs to the first level covered by the first mechanism (the highest level, the circuit module is the output point); MOD_3, MOD_2 and MOD_3 are all first components, belonging to the second level covered by the second mechanism (MOD_1 is the input point, MOD_3 is the output point, and MOD_2 is the intermediate structure); MOD_A, MOD_B, MOD_C and MOD_D are all second components, belonging to the third level covered by the third mechanism, and have a corresponding relationship with MOD_3 of the second level (MOD_A is the output point, MOD_C and MOD_D are the input points, and MOD_B is the intermediate structure); in addition, a single MOD_C can also be used as a component of the fourth level covered by the fourth security mechanism, and MOD_C is the output point.
[0039] It should be noted that the present application can be applied to multiple levels, but in the following step description, only three levels are used for description. Since the fourth level may be used to calculate the data of the third level, it will also be involved.
[0040] For example, the first diagnostic coverage is first mapped to the components corresponding to the input points, output points and intermediate structures. At this time, each component has a first diagnostic coverage DC1, for example:
[0041] First level: DC1 TOP =60%;
[0042] Second level: DC1 MOD_3 =90%, DC1 MOD_1 =0%, DC1 MOD_2 =99%;
[0043] Third level: DC1 MOD_A =99%, DC1 MOD_C =DC1 MOD_D =60%, DC1 MOD_B =0%;
[0044] Level 4: DC1 MOD_C =99%>60%, the coverage of MOD_C at the fourth level is higher than that at the third level, and this application uses a higher value for calculation, therefore, the original first diagnostic coverage of MOD_C, 60%, is replaced by 99%.
[0045] As an optional embodiment, the second diagnostic coverage of the circuit module and each component is determined according to the hierarchical relationship between the components and the first diagnostic coverage, including: mapping the first diagnostic coverage of each component from a high level to a low level in sequence to obtain the third diagnostic coverage of each component, wherein the circuit module belongs to the highest level, the first level, and the circuit module includes the second level and the third level from high to low; obtaining the number of transistors of each component; and calculating the third diagnostic coverage of each component from a low level to a high level layer by layer according to the number of transistors to obtain the second diagnostic coverage of the circuit module and each component.
[0046] Based on the pre-definition of diagnostic coverage of each component, this application maps coverage from high-level to low-level and calculates coverage from low-level to high-level, and finally obtains the second diagnostic coverage that a component is most likely to have. The second diagnostic coverage is close to the actual diagnostic coverage, and the second diagnostic coverage can be regarded as the actual diagnostic coverage.
[0047] As an optional embodiment, the first diagnostic coverage of each component is mapped from a high level to a low level in sequence to obtain the third diagnostic coverage of each component, including: determining the first diagnostic coverage of the first level as the third diagnostic coverage of the first level; determining the third diagnostic coverage of each first component according to the third diagnostic coverage of the first level and the first diagnostic coverage of each first component on the second level; determining the third diagnostic coverage of each second component according to the third diagnostic coverage of each first component and the first diagnostic coverage of each second component on the third level.
[0048] For each component on a level, find all higher-level components that contain it, and take out the highest first diagnostic coverage as its third diagnostic coverage.
[0049] Specifically, the third diagnostic coverage of the first level is determined first. Since the first level is already the highest level and there is no upper level, the first diagnostic coverage of the first level can be used as the third diagnostic coverage of the first level.
[0050] Based on the third diagnostic coverage of the first level, the third diagnostic coverage of each component on the second level can be calculated. Similarly, the third diagnostic coverage of the current level is calculated by the third diagnostic coverage of the previous level until the lowest level is calculated.
[0051] This application is described by calculating the third diagnostic coverage of the first component on the second level.
[0052] As an optional embodiment, the third diagnostic coverage of each first component is determined according to the third diagnostic coverage of the first level and the first diagnostic coverage of each first component on the second level, including: comparing the first diagnostic coverage of the first components with the third diagnostic coverage of the first level respectively; if the first diagnostic coverage of the first components is greater than or equal to the third diagnostic coverage of the first level, determining the first diagnostic coverage of the first components as the third diagnostic coverage of the first components; if the first diagnostic coverage of the first components is less than the third diagnostic coverage of the first level, determining the third diagnostic coverage of the first level as the third diagnostic coverage of the first components.
[0053] Combination Figure 2 The component names in the figure are described.
[0054] For example, DC3 TOP =60%. Since there is no upper level in the first level, the first diagnosis coverage rate of 60% is directly used as the third diagnosis coverage rate;
[0055] DC3 MOD_3 =90%>60%=DC3 TOP , the first diagnosis coverage of MOD_3 is higher than the third diagnosis coverage of the previous level (TOP), so the first diagnosis coverage of MOD_3 is directly determined as the third diagnosis coverage;
[0056] DC3 MOD_1 =60% = DC3 TOP >0%, the first diagnostic coverage of MOD_1 is equal to the third diagnostic coverage of the previous level, so the first diagnostic coverage of MOD_1 is directly determined as the third diagnostic coverage;
[0057] DC3 MOD_2 =99%>60%=DC3 TOP ; Same as MOD_3;
[0058] DC3 MOD_A =99%>90%=DC3 MOD_3 , the first diagnostic coverage of MOD_A is higher than the third diagnostic coverage of the previous level (MOD_3), so the first diagnostic coverage of MOD_A is directly determined as the third diagnostic coverage;
[0059] DC3 MOD_C =99%>90%=DC3 MOD_3 , the same as MOD_A;
[0060] DC3 MOD_D =90% = DC3 MOD_3>60%, the first diagnostic coverage of MOD_D is less than the third diagnostic coverage of the previous level (MOD_3), so the third diagnostic coverage of MOD_3 is directly determined as the third diagnostic coverage;
[0061] DC3 MOD_B =90% = DC3 MOD_3 >0%, same as MOD_D.
[0062] At this point, the third diagnostic coverage of the components at all levels is calculated, and the third diagnostic coverage is used as a calculation parameter for further calculating the second diagnostic coverage.
[0063] As an optional embodiment, the third diagnostic coverage of each component is calculated layer by layer from a low level to a high level according to the number of transistors to obtain the second diagnostic coverage of the circuit module and each component, including: determining the third diagnostic coverage of each second component on the third level as the second diagnostic coverage of the second component; determining the second diagnostic coverage of the first component on the second level that has a corresponding relationship with the second component according to the number of transistors of each second component and the second diagnostic coverage, wherein the first component with a corresponding relationship includes at least one second component; determining the second diagnostic coverage of the circuit module according to the number of transistors of each first component on the second level and the second diagnostic coverage.
[0064] When calculating from the lower layer to the higher layer to obtain the second diagnostic rate, the calculation of the number of transistors is introduced. Through this calculation method, the system can consider the impact of different safety mechanisms and circuit structures on the diagnostic coverage rate according to the number of transistors. The final second diagnostic coverage rate is based on the maximum value of multiple cases, which ensures the accuracy and comprehensiveness of the calculation results.
[0065] Starting from the components on the lowest level, each time the components on a higher level are calculated, the highest third diagnostic coverage is taken as the second diagnostic coverage of the components on the upper level.
[0066] As an optional embodiment, the second diagnostic coverage of the circuit module is determined based on the number of transistors of each first component on the second level and the second diagnostic coverage, including: counting the total number of transistors of each first component; adding the products obtained by multiplying the second diagnostic coverage of each first component by the transistor to obtain an addition result; and dividing the addition result by the total number of transistors to obtain the second diagnostic coverage of the circuit module.
[0067] Combination Figure 2 The component names in the figure are described.
[0068] For example, the number of transistors N of the components at each level is determined, such as: TOP =120, NMOD_3 =40, N MOD_1 =40, N MOD_2 =40, N MOD_A =10, N MOD_C =10, N MOD_D =10, N MOD_B =10.
[0069] Calculate the second diagnostic coverage: Since there is only one MOD_C at the third level, it will not affect the third level. Therefore, the second diagnostic coverage of each component at the third level is: DC2 MOD_A =99%, DC2 MOD_C =99%, DC2 MOD_D =90%, DC MOD_B =90%.
[0070] The second diagnostic coverage of the second level needs to be calculated in combination with the second diagnostic coverage of the third level and the number of transistors. The specific calculation formula is:
[0071] DC2 MOD_3 =(99%*10+99%*10+90%*10+90%*10) / 40=94.5%>90%;
[0072] MOD_1 and MOD_2 have no next-level components, so the third diagnostic coverage of MOD_1 and MOD_2 is the second diagnostic coverage, DC2 MOD_1 =60%, DC2 MOD_2 =99%;
[0073] The second diagnostic coverage of the first level needs to be calculated in combination with the second diagnostic coverage of the second level and the number of transistors. The specific calculation formula is:
[0074] DC2 TOP =(60%*40+99%*40+94.5%*40) / 120=84.5%>60%.
[0075] At this point, the calculation of the second diagnostic coverage of the circuit module and each component on the circuit module is completed.
[0076] According to the step-by-step calculation method, the diagnostic coverage of the safety mechanism is mapped from the highest layer to the lower layer, and then calculated from the lowest layer to the higher layer, so as to obtain the final diagnostic coverage of each component at each layer. This method takes into account the impact of the safety mechanism at different levels and ensures the accuracy of the diagnostic coverage through step-by-step calculation.
[0077] In actual circuit analysis, this method can help determine the diagnostic coverage of the entire circuit, thereby evaluating the safety and reliability of the circuit.
[0078] As an optional embodiment, identifying the input point and the intermediate structure corresponding to the output point on the circuit module includes: constructing an empty node list, an area set and a node queue respectively, wherein the node list is used to store the state nodes on the traced path, the area set is used to store the circuit area jointly covered by the identified output point and the input point, and the node queue is used to store the state nodes to be traced; searching for the first state node that directly drives the output point, and storing the first state node in the node queue; tracing back the predecessor state nodes of each first state node in turn, and storing the first state nodes that have completed tracing in the node list and the area set respectively, and storing the predecessor state nodes that are not in the node list in the node queue in the node queue, wherein there is no state node between the predecessor state node in the node queue and the corresponding first state node; when all the first state nodes in the node queue are traced, obtaining the node list and the area set; determining the input point corresponding to the output point according to the node list, and determining the intermediate structure corresponding to the output point according to the area set.
[0079] In order to better understand and analyze the organizational structure of the circuit, this application introduces the End point (output point), Start point (input point) and Cone (intermediate structure) model to define the different hierarchical structures of the circuit to more clearly define the input, output and intermediate structure of the circuit. This structured approach improves the efficiency of the entire security assessment.
[0080] For example, the specific steps of identifying the input point and the intermediate structure corresponding to the output point on the circuit module include:
[0081] Step 1, determine the target state node (i.e., output point): determine the target state node (flip-flop) that needs to be traced, denoted as `FF_target`;
[0082] Step 2, initialize the trace path and coverage area: create an empty list `trace_path` to store the state nodes in the trace path, create an empty set `covered_area` to store the covered circuit area, and create an empty queue `queue` to store the state nodes to be processed;
[0083] Step 3, add the direct predecessor state node of the target state node to the queue: find and add all state nodes that directly drive `FF_target` and store them in the queue `queue`;
[0084] Step 4, iteratively process the status nodes in the queue: take a current status node `FF_current` from the queue `queue`, if `FF_current` is already in `trace_path`, skip it, if `FF_current` is not in `trace_path`, add `FF_current` to `trace_path` and `covered_area`;
[0085] Find the input signal of `FF_current` and identify its directly driven predecessor state node `FF_prev`. If `FF_prev` is not in `trace_path` and `queue` and has not passed through other state nodes, add `FF_prev` to `queue`, otherwise skip;
[0086] When `queue` is empty (i.e., all state nodes in the queue have been traced once), terminate the tracing operation and execute step 5;
[0087] Step 5, output results: Output `trace_path`, that is, a list of all predecessor state nodes that can reach the target state node without passing through other state nodes (corresponding to input points); output `covered_area`, that is, the circuit area covered by all these predecessor state nodes (corresponding to the middle structure).
[0088] Through the above method, the predecessor state node of a state node can be effectively traced, and the circuit areas covered by all state nodes that can be reached without passing through other state nodes can be identified. This method ensures that other state nodes are not included in the tracing path, thereby accurately determining the predecessor components that affect the state node.
[0089] Figure 3-aThe schematic diagram before the identification input point and the intermediate structure provided for this application, as shown in the figure, SP1, SP2, SP3, SP4, INPUT1, INPUT2, INPUT3 and INPUT4 in the figure can all be used as Startpoint, Startpoint is the output of the state device, the output of the black box block and the top-level input of the design, EP1, EP2, OUTPUT1, OUTPUT2, OUTPUT3, OUTPUT4 and Top.module2 (STATE) in the figure can all be used as Endpoint, Endpoint is the input of all state devices (flip-flops and latches), the input of the black box block and the top-level output of the design. In addition, the figure also includes multiple logic gates (G1~G8) and hierarchical components that do not contain state nodes (Top.module1 (NOTSTATE) in the figure), and Top.module2 (STATE) is a hierarchical component that contains state nodes. Cone is a structure between Startpoint and Endpoint. The gates involved in Cone can intersect and overlap, but they will not be repeatedly calculated during calculation and analysis.
[0090] In the circuit structure diagram provided in this application, the components of the current level will be distinguished at the lower level whether they contain state nodes (DFF, DLATCH, RS, etc.), that is, marked as STATE or NOTSTATE (such as TOP.module2(STATE) and TOP.module1(NOTSTATE) in the figure). State nodes are usually storage elements, such as triggers, which have state information, while non-state nodes are usually combinational logic gates, etc., which do not store states. In addition, if it is an internally invisible black box BlackBox component, it is assumed to have a state node, marked as STATE, such as Top.module1.BlackBox(STATE).
[0091] exist Figure 3-a Based on this, this application provides Figure 3-b As a schematic diagram of the input points and intermediate structures obtained by specifying EP1 as the output point for identification, the figure uses EP1 as the output point to identify the corresponding input points and intermediate structures. SP1, INPUT1, INPUT2 and INPUT4 in the figure are the input points corresponding to EP1 identified by the above method, and the circuit structures between SP1 and EP1, between INPUT1 and EP1, between INPUT2 and EP1, and between INPUT4 and EP1 are the identified intermediate structures (i.e., Cone).
[0092] The present application adopts a method for determining diagnostic coverage, including: obtaining a target file provided by a target object, and determining the output point of a safety mechanism according to the target file; identifying the input point and the intermediate structure corresponding to the output point on the circuit module, wherein the circuit module covers multiple safety mechanisms, and the intermediate structure is the connection part between the output point and the input point; extracting the first diagnostic coverage corresponding to the safety mechanism from the target file, and mapping the first diagnostic coverage to the components corresponding to the input point, the output point and the intermediate structure, wherein the first diagnostic coverage is the diagnostic coverage defined for the input point, the output point and the intermediate structure of the safety mechanism respectively; determining the second diagnostic coverage of the circuit module and each component according to the hierarchical relationship between each component and the first diagnostic coverage. By using the pre-defined first diagnostic coverage to map the components corresponding to the input point, the output point and the intermediate structure covered by multiple safety mechanisms separately, giving the components an initial diagnostic coverage, and then calculating the diagnostic coverage layer by layer according to the hierarchical relationship between different components, the problem of being unable to accurately calculate the diagnostic coverage of components covered by multiple safety mechanisms at the same time is solved.
[0093] According to another aspect of the embodiment of the present application, the present application provides a device for determining diagnostic coverage, such as Figure 4 As shown, including:
[0094] The acquisition unit 402 is used to acquire the target file provided by the target object and determine the output point of the security mechanism according to the target file;
[0095] An identification unit 404, used to identify an input point and an intermediate structure on a circuit module corresponding to an output point, wherein the circuit module is covered with multiple safety mechanisms, and the intermediate structure is a connection part between the output point and the input point;
[0096] A mapping unit 406 is used to extract a first diagnostic coverage rate corresponding to the safety mechanism from the target file, and map the first diagnostic coverage rate to components corresponding to the input point, the output point, and the intermediate structure, wherein the first diagnostic coverage rate is a diagnostic coverage rate defined for the input point, the output point, and the intermediate structure of the safety mechanism, respectively;
[0097] The determining unit 408 is configured to determine the second diagnostic coverage of the circuit module and each component according to the hierarchical relationship between the components and the first diagnostic coverage.
[0098] It should be noted that the acquisition unit 402 in this embodiment can be used to execute step 101 in the embodiment of the present application, the identification unit 404 in this embodiment can be used to execute step 103 in the embodiment of the present application, the mapping unit 406 in this embodiment can be used to execute step 105 in the embodiment of the present application, and the determination unit 408 in this embodiment can be used to execute step 107 in the embodiment of the present application.
[0099] Optionally, the determining unit 408 includes:
[0100] The first processing sub-unit is used to map the first diagnostic coverage of each component from a high level to a low level in sequence to obtain a third diagnostic coverage of each component, wherein the circuit module belongs to the first level with the highest level, and the circuit module includes the second level and the third level from high to low;
[0101] An acquisition subunit, used to obtain the number of transistors of each component;
[0102] The second processing sub-unit is used to calculate the third diagnostic coverage of each component from a low level to a high level layer by layer according to the number of transistors, so as to obtain the second diagnostic coverage of the circuit module and each component.
[0103] Optionally, the first processing subunit is also used to determine the first diagnostic coverage of the first level as the third diagnostic coverage of the first level; determine the third diagnostic coverage of each first component according to the third diagnostic coverage of the first level and the first diagnostic coverage of each first component on the second level; determine the third diagnostic coverage of each second component according to the third diagnostic coverage of each first component and the first diagnostic coverage of each second component on the third level.
[0104] Optionally, the first processing subunit is also used to compare the first diagnostic coverage of the first component with the third diagnostic coverage of the first level; if the first diagnostic coverage of the first component is greater than or equal to the third diagnostic coverage of the first level, the first diagnostic coverage of the first component is determined as the third diagnostic coverage of the first component; if the first diagnostic coverage of the first component is less than the third diagnostic coverage of the first level, the third diagnostic coverage of the first level is determined as the third diagnostic coverage of the first component.
[0105] Optionally, the second processing sub-unit is also used to determine the third diagnostic coverage of each second component on the third level as the second diagnostic coverage of the second component; determine the second diagnostic coverage of the first components on the second level that have a corresponding relationship with the second components based on the number of transistors of each second component and the second diagnostic coverage, wherein the first components with a corresponding relationship include at least one second component; determine the second diagnostic coverage of the circuit module based on the number of transistors of each first component on the second level and the second diagnostic coverage.
[0106] Optionally, the second processing sub-unit is also used to count the total number of transistors of each first component; add the products obtained by multiplying the second diagnostic coverage of each first component by the transistor to obtain an addition result; and divide the addition result by the total number of transistors to obtain the second diagnostic coverage of the circuit module.
[0107] Optionally, the identification unit 404 is also used to construct an empty node list, an area set and a node queue respectively, wherein the node list is used to store the state nodes on the traced path, the area set is used to store the circuit area jointly covered by the identified output point and input point, and the node queue is used to store the state nodes to be traced; find the first state node that directly drives the output point, and store the first state node in the node queue; trace the predecessor state nodes of each first state node in turn, and store the first state nodes that have completed tracing in the node list and the area set respectively, and store the predecessor state nodes that are not in the node list in the node queue in the node queue, wherein there is no state node between the predecessor state node in the node queue and the corresponding first state node; when all the first state nodes in the node queue are traced, obtain the node list and the area set; determine the input point corresponding to the output point according to the node list, and determine the intermediate structure corresponding to the output point according to the area set.
[0108] It should be noted here that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments.
[0109] According to another aspect of the embodiments of the present application, the present application provides an electronic device, such as Figure 5 As shown, it includes a memory 501, a processor 503, a communication interface 505 and a communication bus 507. The memory 501 stores a computer program that can be run on the processor 503. The memory 501 and the processor 503 communicate through the communication interface 505 and the communication bus 507. When the processor 503 executes the computer program, the steps of the above method are implemented.
[0110] The memory and processor in the above electronic device communicate via a communication bus and a communication interface. The communication bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc.
[0111] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0112] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0113] According to another aspect of the embodiments of the present application, a computer-readable medium having a non-volatile program code executable by a processor is provided.
[0114] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0115] When the embodiments of the present application are specifically implemented, reference may be made to the above-mentioned embodiments, which have corresponding technical effects.
[0116] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.
[0117] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0118] Those of ordinary skill 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 depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0120] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0121] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0122] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0123] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk. It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.
[0124] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A method for determining diagnostic coverage, characterized in that: include: Obtaining a target file provided by the target object, and determining an output point of the security mechanism according to the target file; Identify an input point and an intermediate structure on a circuit module corresponding to the output point, wherein the circuit module is covered with a plurality of safety mechanisms, and the intermediate structure is a connecting portion between the output point and the input point; Extracting a first diagnostic coverage rate corresponding to the safety mechanism from the target file, and mapping the first diagnostic coverage rate to components corresponding to the input point, the output point, and the intermediate structure, wherein the first diagnostic coverage rate is a diagnostic coverage rate defined for the input point, the output point, and the intermediate structure of the safety mechanism, respectively; The second diagnostic coverage of the circuit module and the components is determined according to the hierarchical relationship between the components and the first diagnostic coverage.
2. The method according to claim 1, characterized in that: The determining the second diagnostic coverage of the circuit module and the components according to the hierarchical relationship between the components and the first diagnostic coverage includes: Mapping the first diagnostic coverage of each component from a high level to a low level in sequence to obtain a third diagnostic coverage of each component, wherein the circuit module belongs to the first level with the highest level, and the circuit module includes a second level and a third level from high to low; Obtaining the number of transistors of each of the components; The third diagnostic coverage of each component is calculated layer by layer from a low level to a high level according to the number of transistors to obtain the second diagnostic coverage of the circuit module and each component.
3. The method according to claim 2, characterized in that The mapping of the first diagnostic coverage of each component from a high level to a low level in sequence to obtain a third diagnostic coverage of each component includes: determining the first diagnostic coverage of the first level as the third diagnostic coverage of the first level; Determine the third diagnostic coverage of each of the first components according to the third diagnostic coverage of the first level and the first diagnostic coverage of each of the first components on the second level; The third diagnostic coverage of each of the second components is determined according to the third diagnostic coverage of each of the first components and the first diagnostic coverage of each of the second components on the third level.
4. The method according to claim 3, characterized in that The determining the third diagnostic coverage of each first component according to the third diagnostic coverage of the first level and the first diagnostic coverage of each first component at the second level includes: comparing the first diagnostic coverage of the first component with the third diagnostic coverage of the first level respectively; If the first diagnostic coverage of the first component is greater than or equal to the third diagnostic coverage of the first level, determining the first diagnostic coverage of the first component as the third diagnostic coverage of the first component; If the first diagnostic coverage of the first component is less than the third diagnostic coverage of the first level, the third diagnostic coverage of the first level is determined as the third diagnostic coverage of the first component.
5. The method according to claim 2, characterized in that: The step of calculating the third diagnostic coverage of each component from a low level to a high level according to the number of transistors to obtain the second diagnostic coverage of the circuit module and each component includes: determining the third diagnostic coverage of each second component on the third level as the second diagnostic coverage of the second component; Determine the second diagnostic coverage of first components on the second level that have a corresponding relationship with the second components according to the number of transistors of each second component and the second diagnostic coverage, wherein the first components that have the corresponding relationship include at least one second component; The second diagnostic coverage of the circuit module is determined according to the number of transistors of each of the first components at the second level and the second diagnostic coverage.
6. The method according to claim 5, characterized in that The determining the second diagnostic coverage of the circuit module according to the number of transistors of each of the first components at the second level and the second diagnostic coverage includes: Counting the total number of transistors of each of the first components; Adding products of the second diagnostic coverage of each of the first components and the transistor to obtain an addition result; The second diagnostic coverage of the circuit module is obtained by dividing the addition result by the total number of transistors.
7. The method according to claim 1, characterized in that The input point and the intermediate structure corresponding to the output point on the identification circuit module include: Constructing an empty node list, an area set, and a node queue respectively, wherein the node list is used to store the state nodes on the traced path, the area set is used to store the circuit area jointly covered by the identified output point and the input point, and the node queue is used to store the state nodes to be traced; Find a first state node that directly drives the output point, and store the first state node in the node queue; Tracing back the predecessor state nodes of each of the first state nodes in sequence, and storing the first state nodes that have been traced back into the node list and the region set respectively, and storing the predecessor state nodes that are not in the node list into the node queue, wherein there is no state node between the predecessor state node in the node queue and the corresponding first state node; When all the first-state nodes in the node queue are traced back, the node list and the region set are acquired; The input point corresponding to the output point is determined according to the node list, and the intermediate structure corresponding to the output point is determined according to the region set.
8. A device for determining diagnostic coverage, characterized in that: include: An acquisition unit, used for acquiring a target file provided by a target object, and determining an output point of a security mechanism according to the target file; an identification unit, used for identifying an input point and an intermediate structure on a circuit module corresponding to the output point, wherein the circuit module is covered with a plurality of safety mechanisms, and the intermediate structure is a connection portion between the output point and the input point; a mapping unit, configured to extract a first diagnostic coverage rate corresponding to the safety mechanism from the target file, and map the first diagnostic coverage rate to components corresponding to the input point, the output point, and the intermediate structure, wherein the first diagnostic coverage rate is a diagnostic coverage rate defined for the input point, the output point, and the intermediate structure of the safety mechanism, respectively; A determining unit is used to determine a second diagnostic coverage of the circuit module and each of the components according to a hierarchical relationship between the components and the first diagnostic coverage.
9. An electronic device, comprising a memory, a processor, a communication interface and a communication bus, wherein the memory stores a computer program that can be run on the processor, and the memory and the processor communicate through the communication bus and the communication interface, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer readable medium having a non-volatile program code executable by a processor, characterized in that: The program code enables the processor to execute the method according to any one of claims 1 to 7.
