Digital circuit test fan-in decision method based on relational graph convolution and reinforcement learning
By combining graph structure modeling of the circuit netlist with reinforcement learning models, the fan-in decision is optimized, solving the problems of invalid search and high backtracking in the ATPG method, and achieving efficient and stable test vector generation.
Patent Information
- Application Number
- CN202611096393.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2046-07-23
AI Technical Summary
Existing ATPG methods suffer from numerous invalid searches, high backtracking times, and low search efficiency in large-scale complex circuits. They are unable to effectively represent circuit topology relationships and reflect dynamic state changes, and online learning models may affect test generation efficiency and stability.
We employ a graph-based approach using relational graph convolution and reinforcement learning to model the circuit netlist into a graph structure. We extract node features and obtain low-dimensional node embedding vectors through a relational graph convolutional network. We then combine this with a reinforcement learning model to make fan-in decisions, construct a fan-in selection lookup table, and introduce confidence gating and heuristic backoff mechanisms to optimize the search path.
It significantly reduces the number of backtracking steps, improves fault coverage, reduces test generation time, and enhances search efficiency and stability, making it suitable for test vector generation in large-scale digital circuits.
Smart Images

Figure CN122613138B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of integrated circuit testability design, specifically relating to a digital circuit test fan-in decision method based on relational graph convolution and reinforcement learning. Background Technology
[0002] Automatic Test Vector Generation (ATPG) is a key technology in integrated circuit testing and design for testability. Its main function is to generate effective test vectors for target faults in a circuit, enabling the fault to be activated and propagated to observable outputs, thereby achieving fault detection. With the continuous increase in the scale of integrated circuits and the growing complexity of their logic structures, the search space for ATPG is rapidly expanding, significantly increasing the difficulty of test vector generation.
[0003] Traditional ATPG methods typically rely on heuristic search strategies, such as the D algorithm, PODEM algorithm, and FAN algorithm. These methods are well-suited for simple circuits, but are prone to numerous collisions and backtracking in complex circuits. Excessive backtracking not only significantly increases test generation time but can also reduce test generation efficiency and fault coverage.
[0004] In recent years, some studies have attempted to introduce machine learning methods into the ATPG process to assist in determining backtracking fan-in selection or optimizing search paths. However, existing methods still have the following problems: First, some methods rely on manually designed features, which are difficult to fully express the topological relationships in the circuit netlist; second, simplifying ATPG into a static classification or regression problem makes it difficult to reflect the dynamic changes in state during the backtracking search process; third, online invocation of the learning model may bring additional inference overhead, affecting the efficiency of actual test generation; and fourth, if the confidence of the model's recommendation results is insufficient, it may mislead the search process and affect the stability of ATPG. Summary of the Invention
[0005] To address the issues of numerous invalid searches, high backtracking times, and low search efficiency in existing ATPG algorithms during backtracking, this application proposes a fan-in decision method for digital circuit testing based on relational graph convolution and reinforcement learning. Without altering the basic search framework and correctness of ATPG, a pre-trained fan-in decision model (i.e., a pre-trained reinforcement learning model) is introduced into each fan-in decision node during the backtracking process. The model selects a superior fan-in path based on the current node's state characteristics, significantly reducing backtracking times, improving fault coverage, and reducing resource consumption.
[0006] To achieve the above objectives, this application employs the following technical solution:
[0007] This application discloses a digital circuit testing fan-in decision method based on relational graph convolution and reinforcement learning, characterized in that the digital circuit testing fan-in decision method specifically includes the following steps:
[0008] Step 1: Perform graph structure modeling on the training circuit netlist, and divide the circuit connections into two types of relation edges: the first type is the forward signal propagation edge, and the second type is the reverse backtracking edge. Extract the node features of each node in the circuit, and input the node features into the relation graph convolutional network with attention mechanism to obtain the low-dimensional node embedding vector of each circuit node.
[0009] Step 2: Concatenate the low-dimensional node embedding vectors of each circuit node obtained in Step 1 with the extracted node features to form the state representation of the reinforcement learning model, and use it as the input for training the reinforcement learning model.
[0010] Step 3: In the reinforcement learning model training phase, the real ATPG backtracking search process is used as the reinforcement learning interaction environment. Reinforcement learning decision-making is introduced, and the state representation formed in Step 2 is used as the input for each fan-in selection decision of the reinforcement learning model. A reward and punishment mechanism is designed based on the ATPG backtracking search path to guide the reinforcement learning model to select a search path with less information than the number of fault backtracking times. The training of the reinforcement learning model is completed, and the trained reinforcement learning model (ppo.pt) is obtained.
[0011] Step 4: Using the reinforcement learning model (ppo.pt) trained in Step 3, execute the ATPG backtracking search process again to perform inference tests on the circuit under test, generate recommended fan-in nodes for each target node, and construct a fan-in selection lookup table for fast decision-making.
[0012] Step 5: During the ATPG backtracking search, the fan-in path is selected by querying the fan-in selection lookup table to determine whether the recommended fan-in node meets the preset conditions. If it does, the recommended fan-in node is used; if it does not, the search is backtracked to the original heuristic ATPG method, and the test performance such as fault coverage and backtracking count is evaluated.
[0013] A further improvement in this application is that step 1 specifically includes the following steps:
[0014] Step 1.1: Parse the circuit netlist and perform graph structure modeling: The circuit input file, i.e., the circuit netlist, is in bench format. The circuit netlist is parsed, and after completion, corresponding node objects are created based on the obtained signal name identifiers. The input signal name identifiers of each logic gate are mapped to the corresponding input node objects, thereby establishing the predecessor and successor relationships between nodes. If the circuit's nodes... The output is connected to the successor node. Given the input, a directed edge is defined. and nodes Add successor node The input gates (input_gates) also include nodes. Add node The output gates are represented as a directed graph in the circuit netlist. ,in For the set of all logical nodes, For a directed graph, the set of connections along the direction of signal propagation is... Two types of edge relationships are constructed: the first type is the forward signal propagation edge, and the second type is the reverse backtracking edge;
[0015] Step 1.2: Extract the node features of each node in the circuit. The node features include: gate type features, logic level features, fan-out features, SCOAP index, and fault backtracking number information.
[0016] Step 1.3: The relational graph convolutional network with attention mechanism (RGCN-Attn) aggregates the node features extracted from the circuit netlist into a low-dimensional node embedding vector representation.
[0017] A further improvement in this application is that step 1.2 extracts the node features of each node in the circuit, specifically including:
[0018] Extracting gate type features: Current gate type set For nodes If node The door type characteristics are a set of door types. The first in Class, then gate type feature number One dimension is 1, and the rest are 0, that is = ;in , ;
[0019] Extracting logical hierarchy features, i.e., the hierarchy value of each node itself. The logical hierarchy starts from all main input nodes. Starting with a breadth-first traversal, the algorithm calculates the level of all nodes by setting the initial level to 0 and adding all main input nodes to the queue. When traversing to a node... At that time, for the node Each successor node Perform the update: The main input node has a level of 0, and the logic gates directly driven by the main input node are at level 1, with subsequent nodes increasing in level sequentially.
[0020] Extracting Fan-Out Features: The fan-out feature of a node is defined as the successor node directly driven by that node. Quantity, i.e. The original fan-out value is obtained by counting the length of the output_gates list;
[0021] The SCOAP metric measures the ease with which a node can be controlled to either logic 0 or logic 1. Observability represents the difficulty of propagating a node's value to the master output. The controllability of the master input is defined as follows: Controllability of main output ;
[0022] Fault backtracking count information is , Specifically, two types of fixed faults are constructed at the output position of each node, namely, fixed type 0 fault. and fixed type 1 fault .
[0023] A further improvement in this application is that: in step 2, the state representation includes node features and low-dimensional node embedding vectors; the node features and low-dimensional node embedding vectors are concatenated sequentially to form the state representation. This ensures that the dimension of the state representation is consistent with the dimension of the state input of the reinforcement learning model.
[0024] A further improvement in this application is that, in step 3, the search results of the backtracking search process are quantitatively fed back through a reward mechanism, which includes backtracking increment, single-step reward, and termination reward for faulty rounds, specifically:
[0025] The backtracking increment is: for each fan-in selection decision in the backtracking search process, record the number of backtracking iterations before that fan-in selection decision. And the number of backtracking steps required to return successfully or backtrack when the corresponding search subtree terminates. The backtracking increment is defined as: ,in , ,and ;, Represents positive integers;
[0026] To limit the impact of a single abnormal search path on training stability, the original backtracking increment is set to a preset upper limit. Cut off, get =min( );
[0027] Single-step reward is defined as:
[0028]
[0029]
[0030] in, With a zero backtracking reward coefficient, For indicator functions, This indicates whether the subtree successfully initiated the backtracking search. The base reward for the fan-in selection decision behavior at the end of the subtree. This is the normalized value of the current backtracking depth relative to the maximum backtracking depth. The backtracking penalty coefficient, , For the cost of a single decision, ; This is the depth cost coefficient. ; Represents the original backtracking increment With preset upper limit The minimum of the two is the backtracking penalty used to calculate the reward function;
[0031] The termination reward for a fault round is defined as follows:
[0032]
[0033] in, Indicates a success reward. This indicates a penalty for failure.
[0034] A further improvement in this application is that: the reasoning test of the circuit under test in step 4 is specifically as follows: read the meta-information of the policy network and the dynamic scorer weight parameters from the trained reinforcement learning model (ppo.pt), and use the dynamic scorer weight parameters as the scoring function of the candidate fan-in to output a score for each candidate fan-in and determine the recommended fan-in.
[0035] A further improvement in this application is that, in step 4, constructing the fan-in selection lookup table specifically includes the following steps:
[0036] Step 4.1: Obtain the state representation of each node in the circuit under test, and at the same time parse the netlist of the circuit under test to establish the fanin set of each node, and establish the output pin node of the circuit output terminal consistent with the netlist parsing, so that the node set of the lookup table is aligned with the circuit structure.
[0037] Step 4.2: For each successor node , with this successor node The embedding vector is used as the target embedding. and embedding the target candidate fan-in set Take the corresponding embedding vectors to form a candidate embedding matrix ;
[0038] Step 4.3, after obtaining ( After that, ( The dynamicscorer scores each candidate fan-in, resulting in a candidate fan-in score vector. The node with the highest score is selected as the recommended fan-in node for that node. And calculate the confidence interval. That is, the difference between top1 and top2: To obtain the successor node With successor nodes Recommended fan-in nodes Mapping relationship between , To score first, Second place in the score;
[0039] Step 4.4: The successor node obtained in Step 4.3 With successor nodes Recommended fan-in nodes Mapping relationship and confidence interval between them Write to the lookup table file, and retain compatible fields for different fixed fault types, while also appending... / as well as / An extended field is used to store the top 3 candidate rankings and confidence intervals for each node. This forms a fan-in selection lookup table that can be directly called during the testing phase, where... For the target node In the event of a fault, the model ranks the candidate fan-ins for that node from highest to lowest score. For the target node In the event of a fault, the score difference between the top 1 and top 2 candidate fan-in inputs. For the target node In the event of a fault, the model ranks the candidate fan-ins for that node from highest to lowest score. For the target node In the event of a fault, the score difference between candidate fan-in top1 and top2.
[0040] A further improvement in this application is that step 5 specifically includes the following steps:
[0041] Step 5.1: During the ATPG backtracking search process, if there are multiple unassigned candidate fan-in nodes for the current target node, first query the fan-in selection lookup table generated in step 4 to obtain the recommended fan-in node and its confidence interval margin corresponding to the target node.
[0042] Step 5.2: To determine whether the recommended fan-in of the target node has discriminative power, set a threshold for the number of fan-ins of the current target node. When margin ≥ If the selection of the sector-in from the lookup table is deemed to have discriminative power, then the sector-in recommendation is considered to have insufficient confidence and will not be adopted. Basic confidence threshold The penalty coefficient for the number of fan-in inputs. This represents the number of candidate fan-ins that the current node can participate in selecting;
[0043] Step 5.3: To ensure the online reliability of the lookup table recommendation results, maintain the number of successful recommendations and the number of failed recommendations for each node, and calculate the online reliability score after prior smoothing. ,in, For successor nodes The number of times that the fan-in selection lookup table was used to recommend and successfully generate test vectors. This represents the number of times the fan-in selection lookup table was recommended but ultimately failed. Let be the prior smoothing parameter, when If the value exceeds the preset reliability threshold, the recommended fan-in in the fan-in selection lookup table is considered reliable.
[0044] Step 5.4: After the test is completed, calculate the test indicators such as fault coverage, number of backtracking steps, and running time for different circuits.
[0045] The beneficial effects of this application are:
[0046] This application models the digital circuit netlist as a relational graph containing forward signal propagation edges and backward backtracking edges, enabling the model to simultaneously describe the circuit logic propagation structure and the backtracking search structure in the ATPG target reverse propagation process, thereby improving the completeness of the circuit topology representation.
[0047] This application employs a relational graph convolutional network with an attention mechanism to extract node embedding representations. By setting independent transformation parameters for different relation types and assigning attention weights to different neighbor nodes within the same relation, the model can identify key fan-in nodes that have a significant impact on fault activation, fault propagation, and backtracking conflicts, thereby enhancing the node feature representation capability.
[0048] This application uses node embedding representation, gate type, logical level, fan-out number, SCOAP testability index, and fault backtracking statistics as reinforcement learning state representations, enabling the fan-in path selection to be optimized based on ATPG search feedback, reducing invalid searches and repeated backtracking that may occur in traditional heuristic rules.
[0049] This application employs a fan-in selection lookup table for rapid decision-making during the test vector generation stage, avoiding frequent calls to the neural network model during the ATPG search process, thereby reducing online inference overhead.
[0050] This application introduces confidence gating and a heuristic backoff mechanism. When the confidence of the model's recommendation results is insufficient, candidate fan-in is unavailable, or online reliability is low, it automatically backoffs to a SCOAP-based heuristic selection strategy, thereby improving search efficiency while maintaining the stability and integrity of the ATPG search process.
[0051] Therefore, this application can reduce the number of backtracking steps, lower the average test generation time, and improve the fault coverage without changing the basic search framework of ATPG and the correctness of fault determination. It is applicable to test vector generation and backtracking path optimization of large-scale digital circuits. Attached Figure Description
[0052] Figure 1 This is the overall framework diagram of this application.
[0053] Figure 2 This is a schematic diagram of the node features of the circuit node in the embodiments of this application.
[0054] Figure 3 This is a schematic diagram of the RGCN-Attn network in the embodiments of this application.
[0055] Figure 4 This is a schematic diagram of the fan-in selection lookup table generation and confidence gating fallback mechanism in the embodiments of this application.
[0056] Figure 5 This is a schematic representation of the fan-in selection lookup in the embodiments of this application.
[0057] Figure 6 This is a comparison of ablation experiments between RGCN-Attn and GraphSAGE in this application.
[0058] Figure 7 This is a schematic diagram of the average reward convergence curves of RGCN-Attn and GraphSAGE during the reinforcement learning training process. Detailed Implementation
[0059] The embodiments of this application will be disclosed below with reference to the drawings. For clarity, many practical details will be described in the following description. However, it should be understood that these practical details should not be used to limit this application. That is, in some embodiments of this application, these practical details are not necessary. In addition, for the sake of simplicity, some conventional structures and components will be shown in the drawings in a simple schematic manner.
[0060] like Figure 1 As shown, this application discloses a digital circuit testing fan-in decision method based on relational graph convolution and reinforcement learning. The digital circuit testing fan-in decision method specifically includes the following steps:
[0061] Step 1: Perform graph structure modeling on the training circuit netlist, dividing the circuit connections into two types of relation edges: the first type is forward signal propagation edges, and the second type is backward backtracking edges. Extract the node features of each node in the circuit, and input the node features into a relational graph convolutional network with attention mechanism (RGCN-Attn) to obtain the low-dimensional node embedding vector of each circuit node. The specific steps include the following:
[0062] Step 1.1: Parse the circuit netlist and perform graph structure modeling: The circuit input file, i.e., the circuit netlist, adopts the bench format, where... Indicates the main input node. Indicates the main output node. To represent a logic gate and its input-output relationships, the circuit netlist is parsed. After parsing, corresponding node objects are created based on the obtained signal name identifiers. The input signal name identifiers of each logic gate are mapped to corresponding input node objects, thus establishing the predecessor and successor relationships between nodes. If the circuit's nodes... The output is connected to the successor node. Given the input, a directed edge is defined. and nodes Add successor node Input gate At the same time, the nodes Add node output gate Therefore, the circuit netlist is represented as a directed graph. ,in For the set of all logical nodes, Let be the set of connections along the direction of signal propagation, for any node Its fan-in set is denoted as Fan-out set denoted as Subsequent layers, fan-out, SCOAP, and graph neural network features are all calculated based on this graph structure; the circuit netlist is converted into a graph structure, in a directed graph. Two types of edge relationships are constructed: the first type is the forward signal propagation edge, used to represent the logical propagation relationship of the signal from the fan-in node to the gate output node, and its edge type is denoted as... =0; The second type is the backtracking edge, used to represent the search relationship of ATPG backtracking from the output node to the fan-in node during the target backtracking process. Its edge type is denoted as =1.
[0063] like Figure 2 As shown, step 1.2 involves extracting the node features of each node in the circuit. These node features include: gate type features, logic level features, fan-out features, SCOAP metrics, and fault backtracking count information. The SCOAP metrics corresponding to each node include... , and The Relational Graph Convolutional Network with Attention Mechanism (RGCN-Attn) extracts node embeddings from the circuit netlist for backtracking fan-in selection oriented towards Automatic Test Vector Generation (ATPG). Specifically, it extracts node features for each node in the circuit, including:
[0064] Extracting gate type features: Current gate type set For nodes If node The door type characteristics are a set of door types. The first in Class, then gate type feature number One dimension is 1, and the rest are 0, that is = ;in , ;
[0065] Extracting logical hierarchy features, i.e., the hierarchy value of each node itself. The logical hierarchy starts from all main input nodes. Starting with a breadth-first traversal, the algorithm calculates the level of all nodes by setting the initial level to 0 and adding all main input nodes to the queue. When traversing to a node... At that time, for the node Each successor node Perform the update: Therefore, the level value of the main input node is 0, and the logic gates directly driven by the main input node are usually at level 1, with the subsequent node levels increasing sequentially.
[0066] Extracting Fan-Out Features: The fan-out feature of a node is defined as the successor node directly driven by that node. Quantity, i.e. The original fan-out value is obtained by counting the length of the output_gates list; for example, if a node drives three subsequent gates at the same time, its fan-out value is 3; the virtual master output node has no successor, so its fan-out value is 0.
[0067] The SCOAP metric measures the ease with which a node can be controlled to either logic 0 or logic 1. Observability represents the difficulty of propagating a node's value to the master output. The controllability of the master input is defined as follows: Controllability of main output For an AND gate, the output is 0 if any one of the inputs is 0. If the output is 1, then all inputs must be 1. Observability is calculated as Regarding NAND gates: , For NOR gates: , For a two-input XOR gate For the output to be 0, the two inputs must be identical. ,for For gate types, the corresponding SCOAP recursive rules can be used to calculate the SCOAP characteristics based on their Boolean logic relationships. Then, the SCOAP features are standardized. For each node... First, construct a three-dimensional SCOAP vector. Then within each node , and Averaging these three values Normalized to standard deviation, the standard deviation is: The final standardized result is Standardization can reduce the impact of differences in feature dimensions on model training and improve model convergence stability.
[0068] Fault backtracking count information is , Specifically, two types of fixed faults are constructed at the output position of each node, namely, fixed type 0 fault. and fixed type 1 fault For nodes The corresponding faults are represented as follows: and If the circuit has N nodes, then theoretically the total number of faults that can occur is: =2N. These faults are then sequentially fed into the PODEM algorithm to generate test vectors and count the number of search backtracking steps. For each or For fault detection, the algorithm first determines the current fault activation target, then selects the propagation target based on the D-frontier and SCOAP metrics, and subsequently finds the main input that needs to be assigned a value through backtracking. If the recursive search fails after the first assignment of the main input, a backtracking occurs, and the backtracking count of the corresponding node is incremented by 1. and Statistically, they can be represented as follows:
[0069] ,
[0070] Step 1.3: The Relational Graph Convolutional Network with Attention Mechanism (RGCN-Attn) aggregates the node features extracted from the circuit netlist into low-dimensional node embedding vector representations. The Relational Graph Convolutional Network with Attention Mechanism (RGCN-Attn) is as follows... Figure 3 As shown.
[0071] Step 2: Concatenate the low-dimensional node embedding vectors of each circuit node obtained in Step 1 with the extracted node features to form the state representation of the reinforcement learning model, which serves as the input for training the reinforcement learning model and subsequent policy training. The state representation includes node features and low-dimensional node embedding vectors. The node features and low-dimensional node embedding vectors are concatenated sequentially to form the state representation. This ensures that the dimension of the state representation matches the dimension of the state input of the reinforcement learning model. Additionally, four search process features are used to assist in model training.
[0072] Step 3: During the reinforcement learning model training phase, the real ATPG backtracking search process is used as the reinforcement learning interaction environment. Reinforcement learning decision-making is introduced, and the state representation formed in Step 2 is used as the input for each fan-in selection decision of the reinforcement learning model. A reward and punishment mechanism is designed based on the ATPG backtracking search path to guide the reinforcement learning model to select a search path with fewer backtracking times than the fault. The training of the reinforcement learning model is completed, and the trained reinforcement learning model (ppo.pt) is obtained. During the ATPG backtracking process, when there are X candidate fan-ins for a target node, X≥2, the system inputs the state representation corresponding to the target node into the reinforcement learning model. The reinforcement learning model outputs the fan-in selection action according to the state representation. Then, ATPG continues to search along the fan-in path and calculates the reward according to the search result. Finally, the reinforcement learning model parameters are updated using the sample of "state features - fan-in selection action - reward result".
[0073] In this step, the search results of the backtracking search process are quantified and fed back through a reward mechanism, and used as a learning signal to affect the update of policy network parameters, so that the model can continuously adjust the fan-in selection strategy under different state features.
[0074] The reward mechanism includes backtracking increments, single-step rewards, and termination rewards for faulty rounds (global feedback for success / failure), specifically:
[0075] The backtracking increment is: for each fan-in selection decision in the backtracking search process, record the number of backtracking iterations before that fan-in selection decision. And the number of backtracking steps required to return successfully or backtrack when the corresponding search subtree terminates. The backtracking increment is defined as: ,in , , It is a positive integer, and usually... Larger This indicates that the current decision has triggered a wider backtracking search and more serious conflicts. In the reward design, a larger negative reward is assigned to it. Here, the subtree refers to the search tree branch structure formed by the complete search expansion process (including subsequent logical propagation, D-frontier expansion, and possible backtracking branch searches) that starts from a certain fan-in selection decision point and continues to expand along that fan-in path during the ATPG backtracking search process.
[0076] To limit the impact of a single abnormal search path on training stability, the original backtracking increment is set to a preset upper limit. Cut off, get =min( ).
[0077] Single-step reward is defined as:
[0078]
[0079]
[0080] in, With a zero backtracking reward coefficient, For indicator functions, This indicates whether the subtree successfully initiated the backtracking search. The base reward for the fan-in selection decision behavior at the end of the subtree. This is the normalized value of the current backtracking depth relative to the maximum backtracking depth. The backtracking penalty coefficient, , For the cost of a single decision, ; This is the depth cost coefficient. ; Represents the original backtracking increment With preset upper limit Minimum value between the two In this embodiment, a preset upper limit is used. The optimal value is 80, which is the backtracking penalty amount used for reward function calculation. The purpose of introducing this parameter is to prevent individual search branches from generating excessive backtracking increments, causing excessive fluctuations in reward values, thereby improving the stability of reinforcement learning training.
[0081] The termination reward for a fault round is defined as follows:
[0082]
[0083] in, Indicates a success reward. This indicates a penalty for failure.
[0084] Step 4: Using the reinforcement learning model (ppo.pt) trained in Step 3 as the fan-in selector for inference, execute the ATPG backtracking search process again to perform inference testing on the circuit under test, generate recommended fan-in nodes corresponding to each target node, and construct a fan-in selection lookup table for fast decision-making.
[0085] Step 4, specifically the inference test of the circuit under test, involves reading the meta-information of the policy network and the dynamic scorer weight parameters from the trained reinforcement learning model (ppo.pt). The meta-information includes the state vector dimension. With node embedding dimension The dynamic scorer weight parameter is used as the scoring function for candidate fan-ins, which is used to output a score for each candidate fan-in and determine the recommended fan-in.
[0086] like Figure 4 As shown, step 4, constructing the fan-in selection lookup table, specifically includes the following steps:
[0087] Step 4.1: Obtain the state representation of each node in the circuit under test, and at the same time parse the netlist (.bench file) of the circuit under test to establish the fanin set of each node, and establish the output pin node of the circuit output terminal consistent with the netlist parsing, so that the node set of the lookup table is aligned with the circuit structure.
[0088] Step 4.2: For each successor node (Corresponding to a gate output node in the netlist), with this successor node The embedding vector is used as the target embedding. and embedding the target candidate fan-in set Take the corresponding embedding vectors to form a candidate embedding matrix If a candidate fan-in lacks an embedding vector in the node state file, it is preferable not to include it in the candidate set and to trigger a fallback strategy in the subsequent guided phase to ensure inference robustness and availability.
[0089] Step 4.3, after obtaining ( After that, ( The dynamicscorer scores each candidate fan-in, resulting in a candidate fan-in score vector. The node with the highest score is selected as the recommended fan-in node for that node. Meanwhile, to improve the interpretability and security of the inference phase, this embodiment not only outputs the top-3 rankings and their corresponding scores, but also calculates the confidence interval. That is, the difference between top1 and top2: When the margin is small or the recommended fan-in conflicts with the currently available fan-in set, a backtracking strategy can be triggered during the reinforcement learning bootstrapping phase to reduce invalid backtracking caused by unconfident decisions and obtain the successor node. With successor nodes Recommended fan-in nodes Mapping relationship between ;
[0090] Step 4.4: The successor node obtained in Step 4.3 With successor nodes Recommended fan-in nodes Mapping relationship and confidence interval between them Write to the lookup table file and retain compatible fields for different fixed fault types (e.g.) / and / ), and additional / as well as / An extended field is used to store the top 3 candidate rankings and confidence intervals for each node. This creates a fan-in selection lookup table that can be directly called during the testing phase. For the target node In the event of a fault, the model ranks the candidate fan-ins for that node from highest to lowest score. For the target node In the event of a fault, the score difference between the top 1 and top 2 candidate fan-in inputs. For the target node In the event of a fault, the model ranks the candidate fan-ins for that node from highest to lowest score. For the target node In the event of a fault, the score difference between candidate fan-in top1 and top2. Figure 5 This is a schematic representation of the fan-in selection lookup in the embodiments of this application.
[0091] Step 5: During the ATPG backtracking search, the fan-in path is selected by querying the fan-in selection lookup table to determine whether the recommended fan-in node meets the preset conditions. The preset conditions include two parts: one is that the node's margin is greater than the threshold; the other is that the node's reliability score is greater than the preset threshold. If these conditions are met, the recommended fan-in node is adopted; if not, the search reverts to the original heuristic ATPG method, and the performance of tests such as fault coverage and backtracking count is evaluated. The specific steps include the following:
[0092] Step 5.1: During the ATPG backtracking search, when there are multiple unassigned candidate fan-in nodes for the current target node, first query the fan-in selection lookup table generated in Step 4 to obtain the recommended fan-in node and its confidence interval margin corresponding to the target node. The confidence interval margin is the difference between the top 1 candidate fan-in score and the top 2 candidate fan-in score. The larger the margin, the more certain the model is that the top 1 candidate fan-in has a more obvious advantage over the top 2 candidate fan-in; the smaller the margin, the less clear the model is about which one is better.
[0093] Step 5.2: To determine whether the recommended fan-in of the target node has sufficient discriminative power, set a threshold for the number of fan-ins of the current target node. When margin ≥ If the selection of the sector-in from the lookup table is deemed sufficiently discriminative, then the recommendation is considered to have insufficient confidence and is not adopted. Basic confidence threshold The penalty coefficient for the number of fan-in inputs. This represents the number of candidate fan-ins that the current node can participate in selecting;
[0094] Step 5.3: To ensure the online reliability of the lookup table recommendation results, maintain the number of successful recommendations and the number of failed recommendations for each node, and calculate the online reliability score after prior smoothing. ,in, For successor nodes The number of times that the fan-in selection lookup table was used to recommend and successfully generate test vectors. This represents the number of times the fan-in selection lookup table was recommended but ultimately failed. Let be the prior smoothing parameter, when If the margin exceeds a preset reliability threshold, the recommended fan-in in the fan-in selection lookup table is considered reliable. Furthermore, if the reliability score is higher than the preset reliability threshold, it is called high confidence, and the recommended fan-in node in the lookup table is considered reliable. The reinforcement learning recommended fan-in node is then used as the next node in the current backtracking path. If any of the above conditions are not met, it is called low confidence, and the lookup table recommendation result is not used. Instead, the traditional heuristic ATPG method is regressed.
[0095] Step 5.4: Simultaneously, to achieve the adaptive conservatism of the lookup table, at the end of each fault search, based on whether the fault was successfully detected by the lookup table-guided path, the nodes recommended by the lookup table used in this instance are recorded as successful or unsuccessful, and the online reliability statistics are updated. When a node's lookup table performs poorly in multiple faults, its reliability decreases, and subsequent fault searches will tend to revert to SCOAP heuristic selection, thereby further improving overall test stability. Finally, during the test vector generation process of the circuit under test, the aforementioned trust gating mechanism assists in the selection of fan-in nodes during the backtracking phase, and after the test, the test metrics of fault coverage, backtracking times, and runtime for different circuits are statistically analyzed. Fault coverage = ×100%.
[0096] To verify the technical effectiveness of this application, this embodiment compares the proposed digital circuit testing fan-in decision method based on relational graph convolution and reinforcement learning with the heuristic rule-based PODEM algorithm. ISCAS'85, ISCAS'89, and ITC'99 reference circuits were selected as test objects, and tests were conducted under the same fault model, fixed fault type, and same search constraints. The number of backtracking steps, fault coverage, and runtime were used as evaluation criteria to comprehensively assess the improvements and advantages of this invention in testing efficiency and quality. The results are shown in Tables 1 and 2 below.
[0097] Table 1. Digital Circuit Test Fan-in Decision Method Based on Relational Graph Convolution and Reinforcement Learning
[0098]
[0099] Table 2 Heuristic PODEM Algorithm
[0100]
[0101] Comparative analysis of experimental results:
[0102] 1. Number of backtracking iterations:
[0103] The number of backtracking iterations is a key indicator for measuring the search efficiency and decision accuracy of the ATPG algorithm. Fewer backtracking iterations indicate more accurate decision-making during fan-in selection and fewer conflicts. As shown in Table 1, the method in this application significantly reduces the number of backtracking iterations in most benchmark circuits compared to the traditional PODEM algorithm. The average number of backtracking iterations is reduced from 14,163 in PODEM to 6,056 in this invention, a reduction of approximately 57.24%. Particularly in the large-scale circuit b14, the number of backtracking iterations is reduced from 78,757 to 14,170, a decrease of over 82%; in c5315, it is also reduced from 1,617 to 389, demonstrating the method's strong pruning and guidance capabilities in complex search spaces. This indicates that the circuit structure features extracted by RGCN-Attn introduced in this application, combined with the reward and punishment mechanism of reinforcement learning, can effectively guide fan-in selection in the ATPG process, effectively avoiding the blindness of traditional heuristic strategies, thereby significantly reducing invalid search and backtracking paths.
[0104] 2. Fault coverage:
[0105] Fault coverage is the most critical metric for evaluating the quality of test vector generation. This application achieves improved fault coverage in all test circuits, with the average fault coverage increasing from 90.32% to 95.96%, a 5.64 percentage point improvement. Specifically, the fault coverage of C7552 increased from 86.03% to 97.44%, and B14 from 84.25% to 95.37%, both exceeding 11 percentage points. These improvements demonstrate that this invention possesses stronger activation and generalization capabilities for difficult-to-detect faults, generates higher-quality test vectors, and can more effectively detect potential defects in circuits.
[0106] 3. Running time:
[0107] Regarding runtime, because this application uses a lookup table, it avoids excessive time overhead from online model inference, reducing the average runtime from 886.97s to 573.67s, a reduction of approximately 35.32%. This indicates that when the number of backtracking steps is significantly reduced, the overall search time also decreases significantly. For small-scale circuits such as s1196 and b13, this invention can also maintain a low runtime, demonstrating good search efficiency.
[0108] To clarify the contribution of the proposed digital circuit testing fan-in decision method based on relational graph convolution and reinforcement learning, this application conducted GraphSAGE ablation experiments within the same framework. After replacing RGCN-Attn with GraphSAGE, the model performance showed a continuous decline, such as... Figure 6As shown. In comparison, the method in this application reduces the average number of backtracking attempts from 9574 to 6056, a reduction of 36.75%; the average runtime is reduced by 3.36%; and the average fault coverage is increased from 94.86% to 95.96%, a relative improvement of 1.16%. These results indicate that relation-aware message passing plays a crucial role in learning effective backtracking decisions, and that RGCN-Attn can more effectively suppress invalid backtracking and reduce search overhead.
[0109] Figure 7 These are the average reward convergence curves of RGCN-Attn and GraphSAGE during reinforcement learning training, illustrating the differences in learning dynamics between the two representations. It can be observed that RGCN-Attn converges to a higher reward level, indicating that its policy optimization process is more stable and its credit allocation for backtracking decisions is more effective.
[0110] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.
Claims
1. A digital circuit test fan-in decision method based on relational graph convolution and reinforcement learning, characterized in that: The digital circuit test fan-in decision method specifically includes the following steps: Step 1: Perform graph structure modeling on the training circuit netlist, and divide the circuit connections into two types of relation edges: the first type is the forward signal propagation edge, and the second type is the reverse backtracking edge. Extract the node features of each node in the circuit, and input the node features into the relation graph convolutional network with attention mechanism to obtain the low-dimensional node embedding vector of each circuit node. Step 2: Concatenate the low-dimensional node embedding vectors of each circuit node obtained in Step 1 with the extracted node features to form the state representation of the reinforcement learning model, and use it as the input for training the reinforcement learning model. Step 3: During the reinforcement learning model training phase, the real ATPG backtracking search process is used as the reinforcement learning interaction environment. Reinforcement learning decision-making is introduced, and the state representation formed in Step 2 is used as the input for each fan-in selection decision of the reinforcement learning model. A reward and punishment mechanism is designed based on the ATPG backtracking search path to guide the reinforcement learning model to select a search path with fewer backtracking times than the fault. The training of the reinforcement learning model is completed, and the trained reinforcement learning model ppo.pt is obtained. The search results of the backtracking search process are quantitatively fed back through a reward mechanism, which includes backtracking increment, single-step reward, and termination reward for fault rounds, specifically: The backtracking increment is: for each fan-in selection decision in the backtracking search process, record the number of backtracking iterations before that fan-in selection decision. And the number of backtracking steps required to return successfully or backtrack when the corresponding search subtree terminates. The backtracking increment is defined as: ,in , ,and , Represents positive integers; To limit the impact of a single abnormal search path on training stability, the original backtracking increment is set to a preset upper limit. Cut off, get =min( ); Single-step reward Defined as: in, With a zero backtracking reward coefficient, For indicator functions, This indicates whether the subtree successfully initiated the backtracking search. The base reward for the fan-in selection decision behavior at the end of the subtree. This is the normalized value of the current backtracking depth relative to the maximum backtracking depth. The backtracking penalty coefficient, , For the cost of a single decision, ; This is the depth cost coefficient. ; Represents the original backtracking increment With preset upper limit The minimum of the two is the backtracking penalty used to calculate the reward function; The termination reward for a fault round is defined as follows: in, Indicates a success reward. Indicates a penalty for failure; Step 4: Using the reinforcement learning model ppo.pt trained in Step 3, execute the ATPG backtracking search process again to perform inference testing on the circuit under test, generate recommended fan-in nodes for each target node, and construct a fan-in selection lookup table for fast decision-making. This includes the following steps: Step 4.1: Obtain the state representation of each node in the circuit under test, and at the same time parse the netlist of the circuit under test to establish the fanin set of each node, and establish the output pin node of the circuit output terminal consistent with the netlist parsing, so that the node set of the lookup table is aligned with the circuit structure. Step 4.2: For each successor node , with this successor node The embedding vector is used as the target embedding. and embedding the target candidate fan-in set Take the corresponding embedding vectors to form a candidate embedding matrix ; Step 4.3, after obtaining ( After that, ( The dynamic scorer is input to score each candidate fan-in, resulting in a candidate fan-in score vector. The node with the highest score is selected as the recommended fan-in node for that node. And calculate the confidence interval. That is, the difference between top1 and top2: To obtain the successor node With successor nodes Recommended fan-in nodes Mapping relationship between , To score first, To score second, State representation; Step 4.4: The successor node obtained in Step 4.3 With successor nodes Recommended fan-in nodes Mapping relationship and confidence interval between them Write to the lookup table file, and retain compatible fields for different fixed fault types, while also appending... / as well as / An extended field is used to store the top 3 candidate rankings and confidence intervals for each node. This forms a fan-in selection lookup table that can be directly called during the testing phase, where... For the target node In the event of a fault, the model ranks the candidate fan-ins for that node from highest to lowest score. For the target node In the event of a fault, the score difference between the top 1 and top 2 candidate fan-in inputs. For the target node In the event of a fault, the model ranks the candidate fan-ins for that node from highest to lowest score. For the target node In the event of a fault, the score difference between the top 1 and top 2 candidate fan-in inputs; Step 5: During the ATPG backtracking search, the fan-in path is selected by querying the fan-in selection lookup table to determine whether the recommended fan-in node meets the preset conditions. If it does, the recommended fan-in node is used; if it does not, the search is backtracked to the original heuristic ATPG method, and the fault coverage and backtracking count are evaluated.
2. The digital circuit test fan-in decision method based on relational graph convolution and reinforcement learning according to claim 1, characterized in that: Step 1 specifically includes the following steps: Step 1.1: Parse the circuit netlist and perform graph structure modeling: The circuit input file, i.e., the circuit netlist, is in bench format. The circuit netlist is parsed, and after completion, corresponding node objects are created based on the obtained signal name identifiers. The input signal name identifiers of each logic gate are mapped to the corresponding input node objects, thereby establishing the predecessor and successor relationships between nodes. If the circuit's nodes... The output is connected to the successor node. Given the input, a directed edge is defined. and nodes Add successor node The input gates (input_gates) will also include the successor nodes. Add node The output gates are represented as a directed graph in the circuit netlist. ,in For the set of all logical nodes, For a directed graph, the set of connections along the direction of signal propagation is... Two types of edge relationships are constructed: the first type is the forward signal propagation edge, and the second type is the reverse backtracking edge; Step 1.2: Extract the node features of each node in the circuit. The node features include: gate type features, logic level features, fan-out features, SCOAP index, and fault backtracking number information. Step 1.3: The relational graph convolutional network with attention mechanism aggregates the node features extracted from the circuit netlist into a low-dimensional node embedding vector representation.
3. The digital circuit test fan-in decision method based on relational graph convolution and reinforcement learning according to claim 1, characterized in that: Step 1.2 extracts the node features of each node in the circuit, specifically including: gate type features, logic level features, fan-out features, SCOAP index, and fault backtracking count information. Fault backtracking count information is , Specifically, two types of fixed faults are constructed at the output position of each node, namely, fixed type 0 fault. and fixed type 1 fault .
4. The digital circuit test fan-in decision method based on relational graph convolution and reinforcement learning according to claim 1, characterized in that: In step 2, the state representation includes node features and low-dimensional node embedding vectors; the node features and low-dimensional node embedding vectors are concatenated in sequence to form the state representation. Ensure state representation The dimension is consistent with the state input dimension of the reinforcement learning model.
5. The digital circuit test fan-in decision method based on relational graph convolution and reinforcement learning according to claim 1, characterized in that: In step 4, the inference test of the circuit under test is specifically performed as follows: read the meta-information of the policy network and the dynamic scorer weight parameters from the trained reinforcement learning model ppo.pt, and use the dynamic scorer weight parameters as the scoring function for the candidate fan-in to output a score for each candidate fan-in and determine the recommended fan-in.
6. The digital circuit test fan-in decision method based on relational graph convolution and reinforcement learning according to claim 1, characterized in that: Step 5 specifically includes the following steps: Step 5.1: During the ATPG backtracking search process, if there are multiple unassigned candidate fan-in nodes for the current target node, first query the fan-in selection lookup table generated in step 4 to obtain the recommended fan-in node and its confidence interval margin corresponding to the target node. Step 5.2: To determine whether the recommended fan-in of the target node has discriminative power, set a threshold for the number of fan-ins of the current target node. When margin ≥ If the selection of the sector-in from the lookup table is deemed to have discriminative power, then the sector-in recommendation is considered to have insufficient confidence and is not adopted. Basic confidence threshold The penalty coefficient for the number of fan-in inputs. This represents the number of candidate fan-ins that the current node can participate in selecting; Step 5.3: To ensure the online reliability of the lookup table recommendation results, maintain the number of successful recommendations and the number of failed recommendations for each node, and calculate the online reliability score after prior smoothing: ,in, For successor nodes The number of times that the fan-in selection lookup table was used to recommend and successfully generate test vectors. This represents the number of times the fan-in selection lookup table was recommended but ultimately failed. Let be the prior smoothing parameter, when If the value exceeds the preset reliability threshold, the recommended fan-in in the fan-in selection lookup table is considered reliable. Step 5.4: After the test is completed, calculate the test indicators such as fault coverage, number of backtracking steps, and running time for different circuits.
Citation Information
Patent Citations
Network node representation method and device based on node importance
CN111079058A
Test pattern generation for logic circuits with reduced backtracking operations
US5602856A
