A method for repairing gds2 / oasis layout drc violation based on reinforcement learning
By introducing reinforcement learning agents into the GDS2/OASIS layout, DRC violation repair is performed directly in the real physical coordinate space, solving the problems of low repair efficiency and poor adaptability in existing technologies. This achieves efficient and accurate automated repair, applicable to various process nodes and design rules.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA UNIV OF TECH
- Filing Date
- 2025-06-05
- Publication Date
- 2026-05-12
AI Technical Summary
In existing integrated circuit design, manual repair of DRC errors in circuit layouts is inefficient and has limited quality. Automated repair methods are difficult to adapt to complex layout violation scenarios and suffer from high computational complexity and slow convergence speed.
A reinforcement learning-based approach is adopted to directly perform DRC violation repair in the GDS2/OASIS layout. By parsing the target layer graph in the layout, an agent is constructed to perform repair in the real physical coordinate space. The reward function is constructed using DRC detection feedback to form a self-learning and self-optimizing repair process.
It achieves efficient and accurate layout repair without format conversion, improves the intelligence and scalability of automated repair, avoids information loss, adapts to different process rules and layout structures, and has good versatility and engineering feasibility.
Smart Images

Figure CN120724964B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of electronic design automation (EDA) and integrated circuit physical layout repair technology, and more specifically, to a reinforcement learning-based method for repairing DRC violations in GDS2 / OASIS layouts. Background Technology
[0002] In the current integrated circuit design field, error correction in design rule checks (DRC) of circuit layouts mainly relies on manual adjustments by engineers, who balance area, timing, and other factors based on experience. Manual correction is highly reliable but inefficient, and the quality is limited by individual experience, making it difficult to guarantee efficiency in very large-scale layouts. Automated correction scripts, through predefined rules, can make local adjustments to DRC violations such as linewidth and wrapping in the layout. Currently, there are two main methods for automated correction:
[0003] One approach involves engineers writing automated scripts for DRC (Device Controller Compatibility) repair in the digital IC backend. These scripts primarily rely on predefined rules and employ a series of fixed graphical operation templates to attempt to eliminate DRC errors. However, due to the static nature and limited coverage of the rule base, it struggles to adapt to complex layout scenarios, often resulting in iterative repairs or failure to converge.
[0004] Secondly, DRC hotspot prediction tools use convolutional neural networks [1][2] or graph neural networks [3] to predict the probability of DRC violation after routing the current layout. In this way, the probability of DRC error can be reduced by optimizing the initial layout or routing. However, they cannot handle real DRC errors in the generated layout, nor can they directly manipulate GDS2 / OASIS layout files.
[0005] However, regardless of the method, their limitations lie in the static nature and limited coverage of the rule base, making it difficult to adapt to complex violation scenarios and often resulting in repeated iterative repairs or failure to converge. Other studies have employed global optimization algorithms such as genetic algorithms and simulated annealing to search for feasible solutions, but these suffer from high computational complexity and slow convergence speed.
[0006] References:
[0007] [1]LIANG R J,XIANG H,PANDEY D,REDDY L,RAMJI S,NAM G J,HU J.Designrule violation prediction at sub-10-nm process nodes using customizedconvolutional networks[J].IEEE Transactions on Computer-Aided Design ofIntegrated Circuits and Systems,2022.https: / / ieeexplore.ieee.org / document / 9608975.
[0008] [2]LIN J G,CHEN Y G,YANG YW,HUNG W T,TSAI C H,FU D S,CHAO M C T.DRCviolation prediction withpre-global-routing features through convolutionalneural network[C] / / Proceedings ofthe Great Lakes Symposium on VLSI 2023(GLSVLSI'23).2023:
[0009] 313-319.https: / / doi.org / 10.1145 / 3583781.3590216.
[0010] [3]BAEK K,PARK H,KIM S,CHOI K,KIM T.Pin accessibility and routingcongestion aware DRC hotspotprediction using graph neural network and U-Net[C] / / 2022IEEE / ACM International Conference On ComputerAided Design(ICCAD).2022.https: / / ieeexplore.ieee.org / document / 10070024. Summary of the Invention
[0011] The technical problem this invention aims to solve is to address the shortcomings of existing technologies by providing a reinforcement learning-based method for repairing DRC violations in GDS2 / OASIS layouts. This method proposes using GDS2 / OASIS format layouts as the foundation for a reinforcement learning environment without converting them to image formats. By analyzing the target layer graphics in the layout, an operable and feedback-enabled layout repair environment is established in the real physical coordinate space. This method possesses strong versatility, accuracy, and scalability, and can effectively improve the automation and intelligence level of backend design.
[0012] The present invention discloses a reinforcement learning-based method for DRC violation repair in GDS2 / OASIS layouts. The method is as follows:
[0013] Read the GDS2 / OASIS layout file and extract the graphics set of the target layer;
[0014] The number of DRC violations in the GDS2 / OASIS layout is calculated using the DRC detection module to obtain the areas to be repaired in the GDS2 / OASIS layout.
[0015] The graphic set of the areas to be repaired in the GDS2 / OASIS layout is converted into a state representation of the layout;
[0016] A repair strategy module is constructed to generate graphic adjustment actions based on the state representation of the layout.
[0017] The graphic adjustment action is applied to the target graphic in the GDS2 / OASIS layout.
[0018] Preferably, the repair strategy module includes the following steps:
[0019] Step 1: Extract the current map state s from the map state representation. t ;
[0020] Step 2: Define an action space A, based on the current map state s. t Extract action a from action space A t and perform action a t To obtain the new state s t+1 ;
[0021] Step 3: Invoke the DRC detection module to obtain the execution action a. t The number of DRC violations afterward;
[0022] Step 4: Based on the current map state s t New state s t+1 Execute action a t Calculate the reward r based on the number of DRC violations. t ;
[0023] Step 5: Based on the current map state s t New state s t+1 Execute action a t Rewards r t Constructing samples (s) t ,a t ,r t ,s t+1 ), and the sample (s) t ,a t ,r t ,s t+1 Store it in the experience pool and use it in subsequent training;
[0024] Step 6: Repeat steps 1 to 5 until the number of DRC violations stabilizes below the set threshold or the repair strategy converges or reaches the training cycle limit.
[0025] This invention utilizes the above methods to construct an intelligent agent, namely a repair strategy module, through reinforcement learning. This allows the layout to be modified directly at the GDS2 / OASIS graphics level without being converted into image data. The change in the number of DRC violations in the layout is used as a reward feedback, thus realizing a self-learning and self-optimizing layout repair process.
[0026] Preferably, in the fourth step, the reward r t Calculated using the following formula:
[0027] r t =R(s) t a t )=γ·[E(s t )-E(s t+1 )];
[0028] In the formula, E(s) t ) represents the total number of DRC errors in the current state; γ represents the variable coefficient.
[0029] Preferably, in the second step, action a is performed. t Then, the new state s t+1 Represented as:
[0030] s t+1 =T(s) t a t );
[0031] In the formula, T is the state transition function.
[0032] Preferably, in the second step, the action space A is represented as:
[0033]
[0034] in, This indicates that for the i-th rectangular metal pattern P i Along direction Translation distance Δ; Represents a subregion R in the j-th complex polygonal metal graphic. j (The rectangular segment marked as a violation by the DRC detection module) is locally translated;
[0035] ResizeBox(i, edge, Δ) represents adjusting the i-th rectangular metal graphic P. i Specify the side size, increase or decrease Δ; ResizeSubPolygon(j, R) j (edge, Δ) represents the sub-rectangular region R of the j-th complex polygonal metal graphic. j Adjust the size of the specified edge; NoOp means keep the current graphic unchanged.
[0036] Preferably, in step six, the convergence of the repair strategy specifically involves:
[0037] The reward r t The fluctuation range is lower than the preset range.
[0038] Preferably, the preset range is ±1% to ±2%.
[0039] Preferably, in the sixth step, the set threshold is 3 to 10.
[0040] Preferably, the graphic adjustment action is applied to the target graphic in the GDS2 / OASIS layout via KLayout's Python API or the gdspy library.
[0041] Preferably, if the GDS2 / OASIS layout still has DRC violations after the graphic adjustment action, then the GDS2 / OASIS layout file after the graphic adjustment action is read again and the violation repair is performed on it.
[0042] Beneficial effects
[0043] The advantages of this invention are:
[0044] 1. The repair strategy possesses intelligence and self-optimization capabilities:
[0045] By introducing a reinforcement learning framework, the agent continuously optimizes its strategy during the process of "observing the layout status → executing repair actions → receiving DRC feedback". It can adapt to different types of DRC errors and different process rules, and has self-learning and transfer capabilities, and can continuously improve the repair effect from historical experience.
[0046] 2. Directly affects GDS2 / OASIS layout files, avoiding information loss:
[0047] Compared to solutions that rasterize or convert GDS2 / OASIS layouts into image processing, this invention directly operates and repairs based on GDS2 / OASIS format files, preserving the true physical size, accuracy, and hierarchical information of the layout, and avoiding the problem of layout accuracy loss caused by discretization or pixelation.
[0048] 3. Motion space modeling closely matches actual engineering needs:
[0049] This invention abstracts common human graphic restoration actions, such as fine-tuning graphic boundaries and adjusting local polygon regions, and defines these actions in a parameterized form within the algorithm. This satisfies the requirements of reinforcement learning algorithms for discrete actions while closely resembling the real restoration process, thus improving operability.
[0050] 4. A DRC-feedback-driven reinforcement learning closed loop was constructed:
[0051] By constructing a reward function based on the change in the number of DRC violations after each action is executed, a reinforcement learning closed loop of "graphic modification - verification - reward feedback" is formed, which enables the repair behavior to be guided in real time and the repair effect to be gradually optimized, which is significantly better than traditional static heuristic methods.
[0052] 5. The system has an open architecture, facilitating integration and expansion:
[0053] This invention is based on programmable layout interfaces such as KLayout and gdspy. The reinforcement learning model is not bound to the platform and can be embedded into any layout processing flow. It is applicable to automatic repair tasks of various process nodes, layers and design rules, and has strong versatility and engineering feasibility. Attached Figure Description
[0054] Figure 1 This is a block diagram of the overall structure of the reinforcement learning-based GDS2 / OASIS layout DRC violation repair method of the present invention;
[0055] Figure 2 This is a schematic diagram of the repair strategy module flow structure of the present invention. Detailed Implementation
[0056] The present invention will be further described below with reference to embodiments, but this does not constitute any limitation on the present invention. Any limited modifications made by any person within the scope of the claims of the present invention are still within the scope of the claims of the present invention.
[0057] The present invention discloses a reinforcement learning-based method for repairing DRC violations in GDS2 / OASIS layouts. The core of this method lies in training an agent to construct a reinforcement learning environment compatible with GDS2 / OASIS files. This enables the agent to perceive DRC violation states and perform legal modifications in the GDS2 / OASIS format layout. Feedback is then obtained through a DRC engine provided by an EDA tool (such as KLayout) to construct a reward function that drives learning, thereby automatically repairing DRC violations in the layout.
[0058] like Figure 1 As shown, the reinforcement learning-based GDS2 / OASIS layout DRC violation repair method is described in detail through the following modular process.
[0059] GDS2 / OASIS parsing module: Reads GDS2 / OASIS layout files, extracts the graphic set of the target layer, and converts it into operable objects.
[0060] DRC Detection Module: After each action, the internal DRC detection function (based on the KLayout Python interface) calculates the number of DRC violations in the current GDS2 / OASIS layout (hereinafter referred to as the layout) in real time.
[0061] State coding module: Transforms the set of graphics of the area to be repaired in the layout into a state representation acceptable to the agent, such as feature vectors, image matrices, topology graphs, etc., to represent the spatial layout and violation location of the metal graphics in the area.
[0062] To achieve automatic repair of DRC errors in the layout, this invention constructs an agent training framework based on reinforcement learning. This framework enables the agent to learn repair strategies in a simulated environment and output modification actions that are directly applied to the GDS2 / OASIS layout. This framework has advantages such as strong versatility, flexible structure, and good scalability, and is adaptable to various types of layout graphics and design rules.
[0063] In this invention, the reinforcement learning agent is mainly embodied in the repair strategy module. The repair strategy of this invention can be implemented based on any mainstream reinforcement learning algorithm, including but not limited to value function-based algorithms (such as DQN), policy optimization-based algorithms (such as PPO), and combined algorithms based on the Actor-Critic architecture (such as A2C, TD3, etc.). Specifically, value function-driven algorithms (such as DQN) select the optimal action by estimating the action value function Q(s,a); policy optimization algorithms (such as PPO) improve the overall reward by optimizing the action distribution policy π(a|s); and Actor-Critic algorithms (such as A2C, TD3) combine a policy network and a value network to improve training stability and policy accuracy. The specific model structure can be flexibly set according to training efficiency, state dimension, and project scale. The agent can continuously improve the performance of its repair strategy through sampling and training.
[0064] In this embodiment, the repair strategy module generates corresponding graphic adjustment actions based on the positional relationships, orientation, and size of the non-compliant graphics. Depending on the type of DRC violation, the adjustment actions can be rule-driven or output by a reinforcement learning model. Furthermore, this invention abstracts basic actions (such as translating local graphics and fine-tuning boundaries) from manual repair behavior, combines them with design rule feedback information, and constructs a reinforcement learning training framework. This allows the agent to continuously optimize its repair strategy through a process of "observing the layout state—executing repair actions—receiving DRC feedback," thereby achieving a fully automatic and generalizable DRC violation repair process.
[0065] This invention models layout DRC repair as a Markov decision process (MDP), such as... Figure 2 As shown, the specific process is as follows:
[0066] Step 1: Observe the current map status. t Current map status s t The state generator extracts the boundaries and positional relationships of all graphics in the target layer of the layout, as well as DRC violations, to generate a state representation that can be used as input to the model.
[0067] Each layout state s∈S represents the set of positions of all metal graphics in the target layer of the current layout:
[0068] s t ={P1, P2, ..., P n}
[0069] Among them, P i Let S represent the boundary coordinates of the i-th metal figure. S is the state space.
[0070] Step 2: Output repair action a t And execute, to obtain the new state st+1 .
[0071] To better reflect the actual map repair scenario, the action space A is defined as:
[0072]
[0073] in, This indicates that for the i-th rectangular metal pattern P i Along direction Translation distance Δ; Represents a subregion R in the j-th complex polygonal metal graphic. j (The rectangular segment marked as a violation by the DRC detection module) is locally translated;
[0074] ResizeBox(i, edge, Δ) represents adjusting the i-th rectangular metal graphic P. i Specify the side size, increase or decrease Δ; ResizeSubPolygon(j, R) j (edge, Δ) represents the sub-rectangular region R of the j-th complex polygonal metal graphic. j The specified edge is resized; NoOp means keep the current shape unchanged, used for action exploration or placeholder in reinforcement learning training.
[0075] Action a t For an agent at time t, based on the current state s t The specific action selected from action space A, namely a t ∈A. Action a t From the policy network π(a t |s t It is determined by the action selection mechanism (ε-greedy, softmax, etc.).
[0076] Action a t The execution is achieved through an action executor. The action executor performs coordinate transformations on the target graphic (rectangle or polygon) based on the action output by the agent. Specifically, it executes action a. t After that, the state changes from s t Transition to the new state:
[0077] s t+1 =T(s) t a t ).
[0078] This involves performing coordinate transformations on the corresponding polygons in the layout. Here, T is the state transition function.
[0079] Step 3: Call the DRC detection module to obtain the execution action a. t Subsequent DRC violations.
[0080] Step 4: Calculate the reward function. Specifically, the reward value is calculated based on the changes in DRC violations, which guides the agent to optimize its repair strategy.
[0081] The reward is determined by the change in the number of DRC violations:
[0082] r t =R(s) t a t )=γ·[E(s t )-E(s t+1 )).
[0083] Among them, E(s) t ) represents the total number of DRC errors in the current state; γ is a variable coefficient whose value depends on E(s). t )-E(s t+1 The value of ).
[0084] Step 5: Transfer the sample (s) t ,a t ,r t ,s t+1 It is stored in the experience pool and used in subsequent batch training.
[0085] In this step, the sample (s) t ,a t ,r t ,s t+1 These samples (s) serve as one of the inputs to the repair strategy module during the training phase and participate in the subsequent policy update process. More specifically, these samples (s) t ,a t ,r t ,s t+1 The samples will be stored in the experience pool. In each batch training, the system will randomly sample a certain number of historical samples from the experience pool to calculate the loss function of the current policy network and update the network parameters through optimization methods such as gradient descent.
[0086] Step 6: Repeat the above process, i.e., steps 1 to 5, until the number of DRC violations stabilizes below the set threshold, or the agent's repair strategy converges, or the training cycle limit is reached. More specifically, the training termination conditions are: ① Training is terminated when the number of DRC violations stabilizes below the preset threshold, for example, less than 5, or when errors are completely eliminated; ② The fluctuation range of the average reward value within the sliding window is lower than the preset range (e.g., ±1%), and the agent's repair strategy converges; training can be terminated; ③ The training cycle limit is reached.
[0087] This invention models the rule repair process as a Markov Decision Process (MDP), defines the modified graph as the agent's action, and assigns different rewards based on changes in DRC violations, constructing a complete reinforcement learning solution process. Furthermore, the action space design considers the differences between various graphs in the layout, constructing an action space similar to manual repair operations to simulate manual repair actions and improve action effectiveness and interpretability. More importantly, the efficient environment-agent interaction framework proposed in this invention supports rapid layout updates, DRC detection, and reward feedback after each action step, ensuring data consistency and layout integrity during reinforcement learning training. Theoretically, this method can adapt to DRC rule types and layout structures under any process, does not rely on specific rule templates, and has good generalization and industrial applicability.
[0088] After the agent is trained, the repair strategy module can be deployed into the automatic repair process of GDS2 / OASIS layout DRC errors, directly performing repair operations on the layout. This involves executing the layout operation and write modules. Because the action space and state representation are deeply bound to the GDS2 / OASIS data structure, this method has strong engineering adaptability.
[0089] Layout Operation and Write Module: The graphic adjustment actions generated by the repair strategy module are all applied directly to the layout graphics through KLayout's Python API or gdspy library, thereby modifying the original layout file and writing it back.
[0090] This invention not only overcomes the limitations of existing DRC repair methods in terms of strategy and intelligence, but also, for the first time, realizes a reinforcement learning-based automatic DRC repair strategy modeling and execution mechanism on a real GDS2 / OASIS data structure, demonstrating significant technological innovation value and broad application prospects in the field of EDA automation. Furthermore, the method of this invention can be applied to the back-end design flow of digital and analog circuits, playing a crucial role in process migration, chip iteration, or batch optimization, and is particularly suitable for the automatic optimization and DRC repair of layouts such as standard cell libraries and IP modules.
[0091] The above description is only a preferred embodiment of the present invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention, and these will not affect the effectiveness of the implementation of the present invention or the practicality of the patent.
Claims
1. A reinforcement learning-based method for fixing DRC violations in GDS2 / OASIS layouts, characterized in that, The method is as follows: Read the GDS2 / OASIS layout file and extract the graphics set of the target layer; The number of DRC violations in the GDS2 / OASIS layout is calculated using the DRC detection module to obtain the areas to be repaired in the GDS2 / OASIS layout. The graphic set of the areas to be repaired in the GDS2 / OASIS layout is converted into a state representation of the layout; A repair strategy module is constructed to generate graphic adjustment actions based on the state representation of the layout. The graphic adjustment action is applied to the target graphic in the GDS2 / OASIS layout; The repair strategy module includes the following steps: Step 1: Extract the current map state s from the map state representation. t ; Step 2: Define an action space A, based on the current map state s. t Extract action a from the action space A t and perform action a t To obtain the new state s t+1 ; Wherein, the action space A is represented as: ; in, This indicates that for the i-th rectangular metal pattern P i Along direction Translation distance Δ; Represents a subregion R in the j-th complex polygonal metal graphic. j Perform a local translation, where the sub-region R j This indicates a rectangular segment that has been marked as a violation by the DRC detection module; This indicates adjusting the i-th rectangular metal graphic P. i Specify the side dimensions, increase or decrease. ; Represents the sub-rectangular region R of the j-th complex polygonal metal graphic. j Adjust the size of the specified edge; NoOp means keep the current graphic unchanged; Step 3: Invoke the DRC detection module to obtain the execution action a. t The number of DRC violations afterward; Step 4: Based on the current map state s t New state s t+1 Execute action a t Calculate the reward r based on the number of DRC violations. t ; Wherein, the reward r t Calculated using the following formula: ; In the formula, E(s) t ) represents the total number of DRC errors in the current state; γ represents the variable coefficient; Step 5: Based on the current map state s t New state s t+1 Execute action a t Rewards r t Constructing samples (s) t ,a t ,r t ,s t+1 ), and the sample (s) t ,a t ,r t ,s t+1 Store it in the experience pool and use it in subsequent training; Step 6: Repeat steps 1 to 5 until the number of DRC violations stabilizes below the set threshold or the repair strategy converges or reaches the training cycle limit.
2. The reinforcement learning-based GDS2 / OASIS layout DRC violation repair method according to claim 1, characterized in that, In the second step, the action a is performed. t Then, the new state s t+1 Represented as: ; In the formula, T is the state transition function.
3. The reinforcement learning-based GDS2 / OASIS layout DRC violation repair method according to claim 1, characterized in that, In step six, the convergence of the repair strategy specifically refers to: The reward r t The fluctuation range is lower than the preset range.
4. The reinforcement learning-based GDS2 / OASIS layout DRC violation repair method according to claim 3, characterized in that, The preset range is ±1% to ±2%.
5. The reinforcement learning-based GDS2 / OASIS layout DRC violation repair method according to claim 1, characterized in that, In step six, the set threshold is 3 to 10.
6. The reinforcement learning-based GDS2 / OASIS layout DRC violation repair method according to claim 1, characterized in that, The graphic adjustment action is applied to the target graphic in the GDS2 / OASIS layout via the KLayout Python API or the gdspy library.
7. The reinforcement learning-based GDS2 / OASIS layout DRC violation repair method according to claim 1, characterized in that, If DRC violations still exist in the GDS2 / OASIS layout after the graphic adjustment action, the modified GDS2 / OASIS layout file will continue to be read and the violation repair will be performed.