Multi-objective chip layout optimization method based on hierarchical reinforcement learning
Through hierarchical reinforcement learning and graph neural networks, we decompose the chip layout problem and optimize multiple goals, solving the problems of low efficiency and single goal of traditional methods, and achieving efficient and balanced chip design.
Patent Information
- Application Number
- CN202311842531.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-12-28
AI Technical Summary
Traditional chip layout methods are inefficient when dealing with large-scale or high-complexity designs. They are difficult to flexibly cope with the diversity and complexity of layouts, cannot accurately capture the complex interactions between components, and focus on a single goal while ignoring other key factors.
A multi-objective chip layout optimization method based on hierarchical reinforcement learning is adopted. By constructing a hierarchical reinforcement learning framework, the layout problem is decomposed into subtasks, a graph neural network is used to improve the state representation, a multi-objective optimization strategy is designed, the dynamic weight coefficient is adjusted, and Introduce a strategy fine-tuning mechanism and a cross-scale coordination mechanism to optimize the layout strategy.
It improves the efficiency and accuracy of handling large-scale wiring problems, achieves balanced optimization of multiple goals such as energy efficiency, signal integrity, wiring density, etc., and improves the quality and flexibility of the overall layout.
Smart Images

Figure CN117787186B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of chip technology, and in particular relates to a multi-objective chip layout optimization method based on hierarchical reinforcement learning. Background Art
[0002] Chip layout refers to the process of arranging various functional modules and circuits on the chip according to certain rules and methods in integrated circuit design. In chip design, layout is a very important link, which is directly related to the performance, power consumption, heat dissipation and other aspects of the circuit. Good chip layout can ensure the stability, reliability and performance optimization of the circuit.
[0003] Chip layout is a critical step in integrated circuit design, which involves efficiently placing circuit components within a limited physical space. Traditional chip layout methods are usually based on rule-driven or heuristic algorithms, but these methods have significant limitations in the face of growing design complexity.
[0004] The shortcomings of existing research are as follows:
[0005] 1. Scale limitation: Traditional methods are inefficient when dealing with large-scale or highly complex designs and are difficult to adapt to the increasing scale of designs.
[0006] 2. Single decision-making strategy: Existing methods usually adopt a single decision-making strategy, which is difficult to flexibly cope with the diversity and complexity of layouts.
[0007] 3. Simplified state representation: In terms of state representation, these methods often cannot accurately capture the complex interactions between components.
[0008] 4. Single-objective optimization: Most traditional approaches focus on optimizing a single objective, such as wiring density or performance, while ignoring other key factors.
[0009] Therefore, there is an urgent need for a chip layout method that can solve the above defects. Summary of the invention
[0010] The purpose of this invention is to propose a multi-objective chip layout optimization method based on hierarchical reinforcement learning. By adopting an innovative reinforcement learning framework, the complex chip layout problem is decomposed into smaller and more manageable subtasks, thereby improving the efficiency and accuracy of handling large-scale wiring problems. Not only does it optimize the wiring process, but it also ensures the comprehensive consideration of multiple objectives such as energy efficiency, signal integrity, and wiring density, achieving efficient and balanced chip design.
[0011] In order to achieve the above object, the present invention provides a multi-objective chip layout optimization method based on hierarchical reinforcement learning, the method comprising:
[0012] S1: Build the basic framework of hierarchical reinforcement learning, determine the optimization goal, and define the state space, action space, and reward function;
[0013] S2: Decompose the layout problem into subtasks and construct a hierarchical reinforcement learning framework based on subtasks, which includes a high-level network based on model predictive control and progress-based reward adjustment mechanism and a low-level network based on an attention mechanism-enhanced deep Q network and an adaptive learning rate adjustment mechanism. At the same time, the reward signal and loss function are used to adjust the network parameters of the high-level network and the low-level network as a comprehensive training strategy for the hierarchical reinforcement learning framework.
[0014] S3: Introduce graph neural networks to improve state representation, design multi-level graph neural networks, and combine graph neural networks with reinforcement learning for training;
[0015] S4: Design multi-objective optimization strategy and adjust dynamic weight coefficients;
[0016] S5: Adjust the reward mechanism according to the multi-objective optimization strategy, introduce the strategy fine-tuning mechanism to fine-tune the strategy, and then adjust the dynamic weight coefficient to an adaptive weight coefficient;
[0017] S6: Design cross-scale strategies for cross-scale coordination and synchronization and optimize layout strategies.
[0018] Furthermore, the optimization target is a performance indicator including energy efficiency, wiring density, signal integrity and heat distribution uniformity.
[0019] Furthermore, the state space is defined as a layout state S, which is expressed as follows:
[0020] S = f(Pos, Path, Heat)
[0021] Among them, Pos represents the component position, Path represents the wiring path, Heat represents the heat distribution, and the function f() represents the mapping function defined by the graph neural network;
[0022] The action space is a layout adjustment action A, which is expressed as follows:
[0023] A=g(Move,Reroute)
[0024] Among them, Move means moving components, Reroute means changing routing, and g() means action generation function;
[0025] The reward function R shown is expressed as follows:
[0026] R=w1E+w2D+w3G+w4T
[0027] Among them, w1, w2, w3, and w4 are weight factors used to balance different optimization objectives, E represents energy efficiency, D represents wiring density, G represents signal integrity, and T represents heat distribution uniformity.
[0028] Furthermore, both the high-level network and the low-level network use deep neural networks as policy models. The high-level network uses the high-level policy model, combines the policy gradient and model predictive control methods to perform policy gradient optimization, introduces a progress-based reward adjustment mechanism to optimize policy exploration, takes the overall layout state and design goals as input, and the guidance signal of the low-level policy as output. The loss function L of the high-level network high It is expressed as follows:
[0029]
[0030] Among them, R t is the reward at time step t, βH(π high ) is the entropy regularization term, π high represents the high-level policy model, π high (a t |s t ) indicates that the high-level policy model is in state s t Next select action a t The probability of , t represents the time step, R t represents the reward at time step t, log(π high (a t |s t )) represents the logarithm of the policy model output, β represents the coefficient of the entropy regularization term, H(π high ) represents the entropy of the high-level policy model.
[0031] Furthermore, the low-level network uses a low-level strategy model, takes the signals received by the high-level strategy and the local layout state as input, takes the specific wiring actions and component placement decisions as output, and uses the deep Q network enhanced by the attention mechanism to process the key elements and complex interactions in the layout. At the same time, an adaptive learning rate adjustment mechanism is introduced to dynamically adjust the learning rate according to the complexity of the layout task and the performance of the current strategy. The loss function of the low-level network is expressed as follows:
[0032]
[0033] Among them, r t is the immediate reward, γ is the discount factor, Q(s t , a t ) means in state s t Take action t The expected return value, r t represents the immediate reward, max a′ Q(st+ 1, a′) means in the next state s t+1 The maximum expected reward from all possible actions.
[0034] Furthermore, the S3 specifically includes:
[0035] S301, constructing a layout-oriented graph structure; wherein the nodes and edges of the graph structure are components and wirings on the chip;
[0036] S302. Design a multi-level graph neural network structure for adaptive feature learning and optimize state representation;
[0037] S303, training a multi-level graph neural network, and integrating the trained multi-level graph neural network with reinforcement learning, wherein the integration means using the output of the multi-level graph neural network as the input of reinforcement learning.
[0038] Furthermore, the S4 specifically includes:
[0039] S401. Define a multi-objective optimization function O(E, D, G, T), and use the weighted sum method so that each objective has a weight coefficient, which is expressed as follows:
[0040] O(E, D, G, T) = w E ·E+w D ·D+w G .G+w T ·T
[0041] Among them, w E , w D , w G , w T They are the weight coefficients of energy efficiency, wiring density, signal integrity, and thermal distribution uniformity;
[0042] S402, dynamically adjusting the weight coefficient using an adaptive algorithm according to the layout design stage and the current priority, and then optimizing the weight value based on historical data and real-time feedback;
[0043] 403. Integrate the multi-objective optimization function into the reinforcement learning framework, use the multi-objective optimization function to evaluate the effects of different layout schemes during reinforcement learning training and decision-making, and use the multi-objective optimization function to adjust the agent's strategy during reinforcement learning training to maximize the value of the optimization function;
[0044] S404. Use the value of the multi-objective optimization function O(E, D, G, T) as a reward signal to guide the agent to learn to make the best layout decision, and then optimize the multi-objective optimization function in combination with the state representation provided by the graph neural network.
[0045] Furthermore, the S5 specifically includes:
[0046] S501. Define reward function:
[0047] Define the reward function R(t, s, a), where t represents the time, s represents the state, and a represents the behavior, as follows:
[0048] R(t,s,a)=w E (t)·E(s,a)+w D (t)·D(s,a)+w G (t)·G(s,a)+w T (t)·T(s,a)
[0049] Among them, w E (t), w D (t), w G (t), w T (t) represents the weight coefficient of energy efficiency, wiring density, signal integrity and thermal distribution uniformity at time t, E(s, a), D(s, a), G(s, a), T(s, a) represent the energy efficiency, wiring density, signal integrity and thermal distribution uniformity after action a is performed in state s;
[0050] S502: Introduce an adaptive weight adjustment mechanism based on performance feedback to perform adaptive weight adjustment:
[0051] Define an adaptive weight adjustment formula:
[0052] w i (t) = λ·w i (t-1)+(1-λ)·ΔPerf i (t)
[0053] Among them, ΔPerf i (t) represents the performance deviation function, which reflects the gap between the target i in the current state and the expected performance. λ represents a smoothing parameter used to find a balance between the historical weight and the current performance feedback. The performance deviation function ΔPerf i (t) is calculated based on the difference between the actual performance index and the preset target performance index, expressed as follows:
[0054] Perf i (t) = Target i -Actual i (t)
[0055] Among them, Target i Indicates the preset performance indicator target of the i-th target, Actual i (t) represents the actual performance index;
[0056] S503, introduce the Actor-Critic framework to implement the strategy fine-tuning mechanism:
[0057] According to the real-time performance feedback, the strategy is adjusted and the Actor-Critic architecture is constructed to achieve fine-tuning. The Actor-Critic architecture includes the Actor network and the Critic network to generate the layout strategy and evaluate the decision value of the current layout. If the actual performance of the current i-th target is i (t) is lower than the preset performance indicator target of i targets i , then fine-tuning the Actor network prioritizes improving this performance indicator.
[0058] Furthermore, the fine-tuning method of the Actor-Critic framework is expressed as follows:
[0059] Fine-tune the policy gradient update formula of the Actor network:
[0060]
[0061] Among them, θ is the parameter of the Actor network, α is the learning rate, and A(s, a) is the advantage function of behavior a, which is evaluated by the Critic network. When the performance indicator i is detected to be lower than the target, the advantage function A(s, a) will increase, thereby encouraging the Actor network to choose the behavior that improves the performance indicator.
[0062] Furthermore, the S6 specifically includes:
[0063] S601. Design an information exchange mechanism to enable high-level network strategies and low-level network strategies to share key information.
[0064] S602, define the coordination function C(s high ,s low ), where s high is a high-level state, S low is a low-level state, and the coordination function is used to evaluate the consistency of the high-level network strategy and the low-level network strategy, and adjust the low-level network strategy according to the needs;
[0065] S603, using a synchronization algorithm to ensure the consistency of layout strategies at different levels, and updating the synchronization algorithm formula to adjust the low-level state, as shown below:
[0066]
[0067] Among them, δ is the step size of synchronization update, Indicates a new low-level state.
[0068] The beneficial technical effects of the present invention are at least as follows:
[0069] (1) A hierarchical reinforcement learning strategy is used to decompose the complex chip layout problem into multiple small-scale, more manageable subtasks. This decomposition not only improves the efficiency of problem handling, but also improves the quality of the overall layout by focusing on local optimization.
[0070] (2) Design an adaptive multi-level decision-making mechanism to achieve independent decision-making at each subtask level, which can dynamically adapt to different layout challenges and effectively handle the diversity and complexity of layouts.
[0071] (3) Use graph neural networks to deeply express the chip layout state, effectively capture the complex interactions between components, and provide a more accurate state representation than traditional methods.
[0072] (4) Develop multi-objective collaborative optimization algorithms for multiple design goals (such as energy consumption, performance, and wiring density) to achieve balanced optimization of these goals.
[0073] (5) Dynamically adjust the reward function according to different design stages and goals. Design a dynamic reward adjustment mechanism to adapt to changes in the design process and improve the flexibility and adaptability of the algorithm.
[0074] (6) Design cross-scale layout strategies, implement layout strategies from macro to micro, comprehensively deal with overall layout and detailed layout issues, and provide comprehensive optimization solutions. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] The present invention is further described using the accompanying drawings, but the embodiments in the accompanying drawings do not constitute any limitation to the present invention. A person skilled in the art can obtain other drawings based on the following drawings without creative work.
[0076] Figure 1 This is a flow chart of the multi-objective chip layout optimization method based on hierarchical reinforcement learning of the present invention. DETAILED DESCRIPTION
[0077] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0078] like Figure 1As shown, the present invention innovatively solves the core problems of existing chip layout methods by introducing hierarchical reinforcement learning, improves the ability to handle complex layout tasks, and optimizes multiple key performance indicators. Through this method, chip design can be more efficient and accurate, meeting the high requirements of modern integrated circuit design. The method provided by the embodiment of the present invention includes:
[0079] S1: Build the basic framework of hierarchical reinforcement learning, determine the optimization objectives, and define the state space, action space, and reward function. The main purpose of this step is to clarify the specific challenges and optimization objectives of chip layout, and then build the basic framework of hierarchical reinforcement learning, including state space, action space, and preliminary reward function, to set goals and frameworks for the entire method. The main challenge of chip layout is that in integrated circuit design, chip layout involves the optimization of component location, wiring path, and thermal distribution. The optimization objectives are performance indicators, including energy efficiency, wiring density, signal integrity, and thermal distribution uniformity.
[0080] Mathematically converting the above indicators, we have:
[0081] Energy efficiency E: The goal is to minimize total energy consumption, expressed as E = ∑P i , where P i is the power consumption of the ith component.
[0082] Wiring density D: expressed as the ratio of total wiring length to chip area. Among them, L wire is the wiring length.
[0083] Signal integrity S: quantifies signal interference and delay, which can be expressed as S = ∑ (Crosstalk i +Dela yi ).
[0084] Thermal distribution T: expressed as the standard deviation of temperature gradient, Where T i is the local temperature, is the average temperature.
[0085] Specifically, the state space is defined as the layout state S, which is expressed as follows:
[0086] S = f(Pos, Path, Heat)
[0087] Among them, Pos represents the component position, Path represents the wiring path, Heat represents the heat distribution, and the function f() represents the mapping function defined by the graph neural network;
[0088] The action space is a layout adjustment action A, which is expressed as follows:
[0089] A=g(Move,Reroute)
[0090] Among them, Move means moving components, Reroute means changing routing, and g() means action generation function;
[0091] The reward function R shown is expressed as follows:
[0092] R=w1E+w2D+w3G+w4T
[0093] Among them, w1, w2, w3, and w4 are weight factors used to balance different optimization objectives, E represents energy efficiency, D represents wiring density, G represents signal integrity, and T represents heat distribution uniformity.
[0094] Specifically, the basic framework of hierarchical reinforcement learning includes the high-level strategy π high and the low-level strategy π low , high-level strategy π high Responsible for overall layout decisions, such as the location of component groups. Low-level strategy π low Focus on specific routing and fine-tuning.
[0095] S2: Decompose the layout problem into subtasks and construct a hierarchical reinforcement learning framework based on subtasks, which includes a high-level network based on model predictive control and progress-based reward adjustment mechanism and a low-level network based on attention mechanism-enhanced deep Q network and adaptive learning rate adjustment mechanism. At the same time, the reward signal and loss function are used to adjust the network parameters of the high-level network and the low-level network as a comprehensive training strategy for the hierarchical reinforcement learning framework. The purpose is to decompose the complex layout problem into smaller and more manageable subtasks, so the framework of step S1 is further refined into specific tasks and strategies.
[0096] For the chip layout task, this paper proposes an innovative hierarchical reinforcement learning (HRL) framework that combines deep learning technology and hierarchical decision-making mechanism to optimize the chip layout process and meet multiple design goals at the same time.
[0097] Specifically, the hierarchical reinforcement learning (HRL) framework includes a high-level network (high-level strategy) and a low-level network (low-level strategy), where the high-level network (high-level strategy) is responsible for the overall layout and component grouping, and a deep neural network (DNN) is used as the high-level strategy model π high The input includes the overall layout state and design goals, and the output is the guidance signal of the low-level strategy, such as the grouping of components and macro layout decisions. The low-level network (low-level strategy) is responsible for the specific component layout and detailed wiring design, and also uses the DNN model π low ,The input includes signals received from high-level strategies and local ,placement states, and the output includes specific routing actions and ,component placement decisions.
[0098] Training is done using reinforcement learning (RL), where the agent learns optimal behavior by interacting with the environment. During training, the agent adjusts its strategy based on the rewards it receives for its actions.
[0099] Wherein, both the high-level network and the low-level network use deep neural networks as strategy models.
[0100] The high-level network uses a high-level strategy model, with the goal of optimizing the overall layout, focusing on long-term rewards and macro layout strategies. The policy gradient optimization is performed by combining the policy gradient and model predictive control methods, and the reward adjustment mechanism based on progress is introduced to optimize the strategy exploration. The overall layout state and design goals are used as inputs, and the guidance signal of the low-level strategy is used as output. The loss function L of the high-level network high It is expressed as follows:
[0101]
[0102] Among them, L high Represents the loss function of the high-level network. This is a quantity that needs to be minimized to optimize the high-level policy model.
[0103] Represents the expectation operator. It is used here to calculate the expected value of all items in the loss function to reflect the average performance of the entire training process.
[0104] ∑ t Represents the summation operator. It is used here to accumulate the contribution of each time step, thus considering the entire decision process.
[0105] R t represents the reward at time step t. This is a key component in reinforcement learning and is used to evaluate the effect of taking an action at a given time step.
[0106] π high (a t |s t ) indicates that the high-level policy model is in state s t Next select action a t This is the output of the policy model, indicating the probability of taking a certain action in a specific state.
[0107] log(π high (a t |s t )) represents the logarithm of the policy model output. In the policy gradient method, this helps to convert the probability into an optimizable form.
[0108] β represents the coefficient of the entropy regularization term. This parameter is used to balance the relationship between maximizing reward and maximizing policy entropy to encourage exploration.
[0109] H(π high ) represents the entropy of the high-level policy model. Entropy is an indicator that measures the randomness of a policy. A high entropy means that the policy is more exploratory and helps prevent premature convergence to the local optimum.
[0110] The loss function of the high-level network considers the long-term reward and the entropy of the strategy to encourage exploration.
[0111] High-level network hybrid policy gradient optimization, the present invention combines the policy gradient and model predictive control (MPC) methods. This hybrid method can introduce the long-term vision and efficient decision-making of model predictive control while maintaining the advantages of the policy gradient method. This method uses model predictive control to generate a series of potential layout schemes, and optimizes them through the policy gradient method, thereby improving the quality of decision-making while maintaining exploratory nature. At the same time, dynamic adjustment of long-term rewards is introduced, and a progress-based reward adjustment mechanism is introduced. As the layout process progresses, the emphasis on long-term rewards is gradually increased. Through this dynamic adjustment, the strategy can focus on rapid exploration in the initial stage, and pay more attention to the optimization of the overall layout in the later stage.
[0112] The low-level network uses a low-level strategy (bottom-level network) that focuses on specific component layout and detailed wiring, and attaches importance to immediate feedback and the completion of micro-tasks. The present invention designs an innovative training method, introducing Q learning based on an attention mechanism and an adaptive learning rate for local layout optimization. Using a deep Q network (DQN) enhanced by an attention mechanism, the method can more effectively handle key elements and complex interactions in the layout. Using a deep Q network (DQN) enhanced by an attention mechanism, the method can more effectively handle key elements and complex interactions in the layout. An adaptive learning rate adjustment mechanism is introduced in low-level strategy training. The learning rate is dynamically adjusted according to the complexity of the layout task and the performance of the current strategy. This adaptive mechanism can accelerate the learning of complex local layout tasks while ensuring learning stability.
[0113] At the same time, the low-level network uses the low-level strategy model, takes the signals received by the high-level strategy and the local layout state as input, takes the specific wiring actions and component placement decisions as output, and uses the deep Q network enhanced by the attention mechanism to process the key elements and complex interactions in the layout. At the same time, an adaptive learning rate adjustment mechanism is introduced to dynamically adjust the learning rate according to the complexity of the layout task and the performance of the current strategy. The loss function of the low-level network is expressed as follows:
[0114]
[0115] Among them, L low Represents the loss function of the low-level network. It is used to evaluate and optimize the low-level strategy model, especially in terms of specific routing actions and component placement decisions.
[0116] Q(s t , a t ) means in state s t Take action t This is estimated by the low-level strategy model and reflects the benefit of performing a specific routing action under a specific placement state.
[0117] r t Represents an immediate reward. In chip layout optimization, this might be performance feedback based on the current layout decisions, such as the efficiency of routing or the rationality of component placement.
[0118] γ represents the discount factor. It is used to adjust the current value of future rewards and determines the importance of future rewards relative to immediate rewards.
[0119] max a′ Q(s t+1 , a′) means in the next state s t+1 The maximum expected reward of all possible actions. This represents the best possible reward that can be obtained at the next step.
[0120] Represents the expectation operator. It is used to calculate the expected value of all items in the loss function, indicating the average loss of the entire training process.
[0121] Among them, the loss function of the low-level network focuses on the prediction accuracy of the instantaneous Q value.
[0122] Specifically, the high-level network and the low-level network adopt interactive training strategies. The high-level and low-level strategies are interactively learned at the same time, and the output of the high-level strategy is used as the input of the low-level strategy. Training is carried out in a simulated chip layout environment, and the strategy is optimized through continuous iteration. The training process combines exploration and utilization to achieve the optimization of the strategy. The network parameters of the two levels are continuously adjusted using reward signals and loss functions.
[0123] The loss function combines the two objectives of maximizing reward and maximizing policy entropy. By optimizing this loss function, the high-level policy model not only learns how to choose the best action in each state to maximize the cumulative reward, but also encourages a certain degree of behavioral diversity to explore more possible solutions.
[0124] The high-level policy loss function focuses on the accumulation of rewards and the entropy of the policy. This loss function aims to optimize long-term layout decisions, such as component grouping and macro layout direction. The entropy term encourages the exploration of new layout strategies and increases the diversity of strategies. The low-level policy loss function focuses on optimizing the value estimation of immediate rewards and behaviors. This loss function is used to guide specific routing actions and component placement, focusing on the details of local layout. It focuses on reducing the difference between expected rewards and actual rewards, ensuring that each action is as close to the optimal as possible. The high-level policy loss function innovatively balances long-term planning and policy exploration by combining reward maximization and entropy maximization. This design helps avoid high-level policies from being fixed on local optimal solutions too early and ensures extensive search in the entire layout space. The low-level policy loss function effectively handles complex interactions and key elements in layout through deep Q-learning methods.
[0125] At the same time, the introduction of the attention mechanism enables the low-level network to focus more on the elements that have the greatest impact on the current layout decision, improving the accuracy and efficiency of local layout. Applying two different loss functions to the hierarchical reinforcement learning framework innovatively solves the complex challenges in multi-objective chip layout optimization. This synergy of high-level and low-level strategies helps to achieve optimization at both the macro and micro levels, thereby improving the performance and efficiency of the overall layout.
[0126] S3: In reinforcement learning, state representation is the basis for understanding the environment and making decisions. For chip layout tasks, the state needs to accurately reflect the location, relationship and connectivity of each component on the chip, as well as any other factors that may affect the layout decision (such as heat distribution, power consumption, etc.). Graph neural network (GNN) is an effective deep learning tool for processing graph structured data. In chip layout, GNN can be used to represent the complex relationships and dependencies between components. In view of the chip layout and routing scenarios and the subsequent access to reinforcement learning, the present invention proposes a new multi-level GNN method: introducing graph neural networks to improve state representation, designing multi-level graph neural networks, and combining graph neural networks with reinforcement learning for training, accurately capturing the complex relationships between components in chip layout, starting from task decomposition, optimizing the state representation for each subtask to improve the accuracy of decision-making, specifically including:
[0127] S301, constructing a layout-oriented graph structure, wherein the nodes and edges of the graph structure are components and wiring on the chip. In the chip layout problem, constructing a graph structure means treating the components and wiring on the chip as nodes and edges in the graph.
[0128] The chip layout is modeled as a graph G = (V, E), where each node v∈V represents a component or wiring path on a chip, and each edge e∈E represents the electrical connection or physical proximity between components.
[0129] Node features include component type, size, power consumption, and other electrical characteristics. Edge features include connection type, length, and width. Special representations of nodes and edges are to introduce special nodes to represent key components, such as processor cores, memory modules, etc., to highlight their importance in layout.
[0130] The representation of edges should include not only physical properties but also electrical characteristics such as signal integrity and noise coupling.
[0131] S302. Design a multi-level graph neural network structure for adaptive feature learning and optimize state representation. Multi-level graph neural networks (GNNs) can learn complex relationships and interactions between nodes (components). Adaptive feature learning means that GNNs can adjust the learning focus according to the characteristics of the layout (such as the importance of components or the tightness of connections).
[0132] Design multi-layer GNNs, where each layer focuses on a different level of layout features, from detailed interactions between components to overall layout patterns. The first layer may focus on interactions between local components, while higher layers focus on global features of the entire layout.
[0133] GNN learns the importance of nodes and edges through an adaptive mechanism, automatically adjusting the focus to optimize the layout-related feature representation. For example, if thermal distribution is a key issue, GNN will automatically enhance the representation weights of nodes and edges related to thermal characteristics.
[0134] For the optimized state representation, specifically: the output of the GNN is the state vector S, which captures the comprehensive characteristics of the current layout. S contains comprehensive information about the chip layout, such as the effectiveness of component layout, potential thermal bottlenecks, signal transmission efficiency, etc. Optimization for reinforcement learning. The state vector S is designed to be directly used in reinforcement learning algorithms to guide layout decisions. For example, in reinforcement learning, the state S will be used to estimate the long-term rewards and benefits of different layout decisions.
[0135] S303, train a multi-level graph neural network, and integrate the trained multi-level graph neural network with reinforcement learning, wherein the integration means using the output of the multi-level graph neural network as the input of reinforcement learning. The trained GNN can provide deep insights into the current layout state, and during integration, the output of the multi-level graph neural network is directly used as the input of reinforcement learning.
[0136] GNNs are trained using simulation and historical data to optimize graph features used to represent chip layout states. GNN training is supervised using real layout cases and their performance labels to ensure accurate and practical state representation.
[0137] Among them, the integration with reinforcement learning is to integrate the trained GNN into the reinforcement learning framework to provide detailed environmental information for layout decisions. The state information provided by GNN is used in reinforcement learning to estimate the value and potential reward of each possible layout decision.
[0138] This paper provides a new state representation method for complex chip layout problems by combining deep graph neural networks with multi-level feature learning and adaptive importance evaluation. The tight integration with reinforcement learning algorithms makes layout optimization more efficient and accurate.
[0139] S4: Design multi-objective optimization strategies and adjust dynamic weight coefficients to balance and optimize multiple design goals. Based on specific tasks and improved state representation, fine-grained multi-objective optimization is achieved, including:
[0140] S401. The core goal of designing multi-objective optimization is to consider multiple key performance indicators simultaneously in chip layout optimization, including but not limited to:
[0141] Energy efficiency E: Reduce the total energy consumption of the chip.
[0142] Wiring density D: Minimize the ratio of total wiring length to chip area.
[0143] Signal Integrity G: Maximize signal quality and reduce signal delay and noise.
[0144] Heat distribution uniformity T: Optimize heat distribution and avoid overheating areas.
[0145] Therefore, define a multi-objective optimization function O(E, D, G, T), use the weighted sum method, so that each objective has a weight coefficient, expressed as follows:
[0146] O(E, D, G, T) = w E ·E+w D ·D+w G .G+w T ·T
[0147] Among them, w E , w D , w G , w T are the weight coefficients of energy efficiency, wiring density, signal integrity and thermal distribution uniformity. O(E, D, G, T): a multi-objective optimization function that comprehensively considers energy efficiency, wiring density, signal integrity and thermal distribution uniformity. E represents energy efficiency, which reflects the total energy consumption of the chip. D represents wiring density, which represents the ratio of the total wiring length to the chip area. G represents signal integrity, which quantifies signal interference and delay. T represents thermal distribution uniformity, which measures the uniformity of heat distribution on the chip. w E , wD , w G , w T Represents the weight coefficient of each goal, which is adjusted dynamically according to the design stage and priority.
[0148] S402. Dynamically adjust the weight coefficient using an adaptive algorithm according to the layout design stage and the current priority, and then optimize the weight value based on historical data and real-time feedback.
[0149] Dynamically adjust the weight coefficient according to the layout design stage and current priority to reflect the design requirements at different stages. Use an adaptive algorithm to adjust the weight and optimize the weight value based on historical data and real-time feedback.
[0150] The layout design stage and current priority refer to that the weight coefficient will be dynamically adjusted according to the different stages of layout design (e.g., early, middle, late) and the current priority (e.g., whether the current stage focuses more on energy efficiency or wiring density). For example, in the early stage of layout, wiring density (w D higher), while in the later stage, more attention may be paid to energy efficiency (w E improve).
[0151] Specifically, adaptive algorithms refer to algorithms that dynamically adjust weight coefficients based on real-time feedback and historical trends. This can be achieved through machine learning methods, such as using linear regression or neural networks to predict the most effective weight configuration for the current layout task. For example, if historical data shows that signal integrity is more susceptible to certain layout conditions, the adaptive algorithm will improve w G The value of , so that under similar conditions, layout behaviors that improve signal integrity are more rewarded.
[0152] 403. Integrate the multi-objective optimization function into the reinforcement learning framework, and use the multi-objective optimization function to evaluate the effects of different layout schemes during the reinforcement learning training and decision-making process. At the same time, during the reinforcement learning training process, use the multi-objective optimization function to adjust the agent's strategy to maximize the value of the optimization function.
[0153] The multi-objective optimization function is integrated into the reinforcement learning framework. During the training and decision-making process, the function is used to evaluate the effects of different layout solutions. During the reinforcement learning training process, the agent's strategy is adjusted to maximize the value of the optimization function.
[0154] S404. Use the value of the multi-objective optimization function O(E, D, G, T) as a reward signal to guide the agent to learn to make the best layout decision, and then optimize the multi-objective optimization function in combination with the state representation provided by the graph neural network.
[0155] Use a multi-objective optimization function as the number of reward signals O(E, D, G, T) = w E ·E+w D ·D+w G ·G+w T T takes into account multiple key performance indicators of chip layout: energy efficiency E, wiring density D, signal integrity G, and thermal distribution uniformity T. Each indicator has a corresponding weight coefficient w E , w D , w G , w T ,These weight coefficients determine the relative importance of each performance metric in the placement decision process.
[0156] In reinforcement learning, an agent learns the best behavior by maximizing the cumulative reward. In this case, the value of a multi-objective optimization function is used as a reward signal. Every time the agent takes an action, it receives a reward signal based on the value of the multi-objective optimization function corresponding to the current action. This value reflects how effective the current action is in satisfying all the layout objectives.
[0157] Graph neural networks (GNNs) are used to provide detailed information about the current chip layout state. This may include information such as the relationship between components, wiring conditions, thermal distribution, etc. It can capture complex interactions and dependencies between components, providing a comprehensive and in-depth state representation for the intelligent agent.
[0158] The agent not only relies on reward signals to learn, but also needs to understand the environment (i.e., layout state) in which it is located. The state representation provided by GNN is a description of this environment. With this detailed state representation, the agent can better understand the potential impact of each possible layout decision, thereby making more informed decisions.
[0159] Combining the multi-objective optimization function with the state representation provided by GNN can achieve more accurate and efficient layout optimization. The multi-objective optimization function provides a clear goal direction as a reward signal, that is, optimizing specific performance indicators, while the state information provided by GNN helps the agent understand how to achieve these goals through specific layout decisions. This approach makes the reinforcement learning process not only rely on trial and error, but is based on a deep understanding of the current layout state and a comprehensive consideration of multiple performance goals.
[0160] In the reinforcement learning algorithm, the value of the optimization function is used as a reward signal to guide the agent to learn how to make the best layout decision. Combined with the state representation provided by the graph neural network, the optimization function helps the agent to more accurately evaluate the effects of different layout decisions.
[0161] The present invention provides a flexible and efficient optimization strategy for chip layout through dynamic weight adjustment and comprehensive multi-objective optimization. Combined with the reinforcement learning algorithm, the layout optimization process is adaptive and intelligent, and the optimal solution can be found in the changing design requirements.
[0162] S5: Adjust the reward mechanism according to the multi-objective optimization strategy, introduce the strategy fine-tuning mechanism to fine-tune the strategy, and then adjust the dynamic weight coefficient to the adaptive weight coefficient to enhance the adaptability and flexibility of the model. This step is a further iteration and optimization of the previous steps to ensure that the strategy adapts to changes as the task progresses. Specifically, it includes:
[0163] S501. Define reward function:
[0164] Define the reward function R(t, s, a), where t represents the time, s represents the state, and a represents the behavior, as follows:
[0165] R(t,s,a)=w E (t)·E(s,a)+w D (t)·D(s,a)+w G (t)·G(s,a)+w T (t)·T(s,a)
[0166] Among them, w E (t), w D (t), w G (t), w T (t) represents the weight coefficient of energy efficiency, wiring density, signal integrity and thermal distribution uniformity at time t, E(s, a), D(s, a), G(s, a), T(s, a) represent the energy efficiency, wiring density, signal integrity and thermal distribution uniformity of action a in state s.
[0167] S502: Introduce an adaptive weight adjustment mechanism based on performance feedback to perform adaptive weight adjustment:
[0168] Define an adaptive weight adjustment formula:
[0169] w i (t) = λ·w i (t-1)+(1-λ)·ΔPerf i (t)
[0170] Among them, ΔPerf i (t) represents the performance deviation function, which reflects the gap between the target i in the current state and the expected performance. λ represents a smoothing parameter used to find a balance between the historical weight and the current performance feedback. The performance deviation function ΔPerf i(t) is calculated based on the difference between the actual performance index and the preset target performance index, expressed as follows:
[0171] Perf i (t) = Target i -Actual i (t)
[0172] Among them, Target i Indicates the preset performance indicator target of the i-th target, Actual i (t) represents the actual performance index.
[0173] Instead of simply changing weights at fixed moments, an adaptive weight adjustment mechanism based on performance feedback is used. The weight adjustment depends on the performance and historical trends of the current layout, rather than a preset moment.
[0174] The adaptive weight adjustment mechanism based on performance feedback is a method of dynamically adjusting the weight of the strategy, which is particularly suitable for complex problems that need to consider multiple optimization objectives at the same time, such as multi-objective chip layout optimization. In this mechanism, the weight of each optimization objective is not fixed, but adjusted according to actual performance feedback to better adapt to the current task requirements and environmental conditions.
[0175] S503, introduce the Actor-Critic framework to implement the policy fine-tuning mechanism. The Actor-Critic framework is a reinforcement learning method that combines the advantages of value function methods (such as Q learning) and policy gradient methods. This framework consists of two parts: Actor and Critic.
[0176] According to the real-time performance feedback, the strategy is adjusted and the Actor-Critic architecture is constructed to achieve fine-tuning. The Actor-Critic architecture includes the Actor network and the Critic network to generate the layout strategy and evaluate the decision value of the current layout. If the actual performance of the current i-th target is i (t) Target that is continuously lower than the preset performance indicator of i targets i , then fine-tuning the Actor network prioritizes improving this performance indicator.
[0177] Adjust policies based on real-time performance feedback to respond immediately if a performance metric is not being met.
[0178] For example, if it is detected that the actual performance of signal integrity S is continuously below the target threshold, the system will automatically increase the reward value weight of the signal integrity target.
[0179] Among them, in the chip layout optimization problem, several key performance indicators are defined, such as energy efficiency E, wiring density D, signal integrity G, and thermal distribution uniformity T. The fine-tuning method of the Actor-Critic framework is expressed as follows:
[0180] The Actor network is responsible for making layout decisions. It receives the current layout state s and outputs a layout action a. The output of the Actor network is a probability distribution representing the probability of taking each possible action in a given state.
[0181] The Critic network evaluates the value of the current layout decision. It receives the current state s and the action a taken by the Actor, and outputs an estimate of the value of that action. The output of the Critic network helps guide the training of the Actor network, especially during fine-tuning.
[0182] In each training iteration, the system evaluates the performance of the current layout, including E, D, G, and T. The performance evaluation is based on simulation or analysis, and can be real-time or approximate. i Continue to be below the target Target, i , then fine-tune the Actor network to prioritize improving that performance metric. The implementation of the fine-tuning strategy relies on the collaborative work of the Actor-Critic architecture. By adjusting the strategy of the Actor network, we can increase the probability of improving behaviors with low performance metrics.
[0183] Mathematical representation: Fine-tuning the policy gradient update formula of the Actor network:
[0184]
[0185] Among them, θ is the parameter of the Actor network, α is the learning rate, and A(s, a) is the advantage function of behavior a, which is evaluated by the Critic network. When it is detected that the performance indicator i is lower than the target, the advantage function A(s, a) will increase accordingly, thereby encouraging the Actor network to choose the behavior that improves the performance indicator.
[0186] S6: Design cross-scale strategies for cross-scale coordination and synchronization, optimize layout strategies, ensure consistency and coordination from macro to micro, ensure the coordination of the entire system, and achieve the ultimate goal of integration, including:
[0187] S601. Design an information exchange mechanism to enable high-level network strategies and low-level network strategies to share key information. The core goal of cross-scale coordination is to ensure that high-level (macro) strategies and low-level (micro) strategies maintain consistency and coordination in layout decisions. High-level strategies focus on overall layout and component grouping, while low-level strategies focus on specific component layout and detailed wiring design. Therefore, designing an information exchange mechanism is to enable high-level and low-level strategies to share key information, such as layout constraints, priorities, and goals. For example, the component grouping and layout guidance information generated by the high-level strategy is used as input to the low-level strategy.
[0188] Specifically, the information exchange mechanism is designed to promote mutual understanding and coordination between high-level (macro layout) strategies and low-level (micro layout) strategies. Sharing of key information from high-level to low-level: high-level networks may generate information about overall layout goals, component groupings, layout priorities, etc. This information is critical for low-level networks because they directly affect the specific placement and routing decisions of components. Sharing of key information from low-level to high-level: The insights gained by low-level networks when dealing with specific layout problems (such as efficiency improvements or problems caused by certain layout choices) can be fed back to high-level networks to help high-level networks optimize their macro strategies.
[0189] S602, define the coordination function C(s high ,s low ), where s high is a high-level state, s low It is a low-level state, and the coordination function is used to evaluate the consistency of the high-level network strategy and the low-level network strategy, and adjust the low-level network strategy according to the needs.
[0190] S603, using a synchronization algorithm to ensure the consistency of layout strategies of different hierarchical levels. The synchronization algorithm compares the layout decisions of the high-level and low-level levels, identifies inconsistencies, and makes necessary adjustments. At the same time, the synchronization algorithm formula is updated to adjust the low-level state, as shown below:
[0191]
[0192] Among them, δ is the step size of synchronization update, Represents a new low-level state. This formula is used to adjust the low-level state to better conform to the high-level layout guidance. The present invention innovatively solves the coordination problem between different levels of strategies by introducing special coordination functions and synchronization algorithms. The coordination function and synchronization update formula ensure the consistency of decisions at different levels, thereby improving the efficiency and quality of the overall layout. In complex chip layout tasks, strategies at different levels may conflict. This solution effectively solves this problem by ensuring the consistency and synchronization of decisions. The coordination mechanism makes the entire layout process more efficient because it reduces unnecessary conflicts and readjustments, ensuring fast and consistent decision making.
[0193] Although embodiments of the present invention have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A multi-objective chip layout optimization method based on hierarchical reinforcement learning, characterized in that: The method comprises: S1: Construct the basic framework of hierarchical reinforcement learning, determine the optimization goal, define the state space, action space, and reward function; the optimization goal is performance indicators, including energy efficiency, wiring density, signal integrity, and thermal distribution uniformity; the state space is defined as the layout state , which is expressed as follows: ; in, Indicates the component position, Indicates the wiring path, Represents heat distribution, function represents the mapping function defined by the graph neural network; The action space is a layout adjustment action A, which is expressed as follows: ; in, represents a moving element, Indicates a change in wiring. represents the action generation function; The reward function R shown is expressed as follows: ; in, is a weight factor used to balance different optimization objectives. E represents energy efficiency, D represents wiring density, G represents signal integrity, and T represents heat distribution uniformity. S2: Decompose the layout problem into subtasks and construct a hierarchical reinforcement learning framework based on subtasks, which includes a high-level network based on model predictive control and progress-based reward adjustment mechanism and a low-level network based on an attention mechanism-enhanced deep Q network and an adaptive learning rate adjustment mechanism. At the same time, the reward signal and loss function are used to adjust the network parameters of the high-level network and the low-level network as a comprehensive training strategy for the hierarchical reinforcement learning framework. S3: Introduce graph neural networks to improve state representation, design multi-level graph neural networks, and combine graph neural networks with reinforcement learning for training; S4: Design multi-objective optimization strategy and adjust dynamic weight coefficients; S5: Adjust the reward mechanism according to the multi-objective optimization strategy, introduce the strategy fine-tuning mechanism to fine-tune the strategy, and then adjust the dynamic weight coefficient to an adaptive weight coefficient; S6: Design cross-scale strategies for cross-scale coordination and synchronization and optimize layout strategies; Wherein, the S3 specifically includes: S301, constructing a layout-oriented graph structure; wherein the nodes and edges of the graph structure are components and wirings on the chip; S302. Design a multi-level graph neural network structure for adaptive feature learning and optimize state representation; S303, training a multi-level graph neural network, and integrating the trained multi-level graph neural network with reinforcement learning, wherein the integration means using the output of the multi-level graph neural network as the input of reinforcement learning.
2. The multi-objective chip layout optimization method based on hierarchical reinforcement learning according to claim 1, characterized in that: Both the high-level network and the low-level network use deep neural networks as policy models. The high-level network uses the high-level policy model, combines the policy gradient and model predictive control methods to perform policy gradient optimization, introduces a progress-based reward adjustment mechanism to optimize policy exploration, takes the overall layout state and design goals as input, and the guidance signal of the low-level policy as output. The loss function of the high-level network It is expressed as follows: ; in, is the reward at time step t, is the entropy regularization term, represents the high-level policy model, Indicates that the high-level policy model is in state Next select action The probability of , t represents the time step, represents the reward at time step t, represents the logarithm of the policy model output, represents the coefficient of the entropy regularization term, Represents the entropy of the high-level policy model.
3. The multi-objective chip layout optimization method based on hierarchical reinforcement learning according to claim 1, characterized in that: The low-level network uses a low-level strategy model, takes the signals received by the high-level strategy and the local layout state as input, takes the specific wiring actions and component placement decisions as output, and uses the deep Q network enhanced by the attention mechanism to process the key elements and complex interactions in the layout. At the same time, an adaptive learning rate adjustment mechanism is introduced to dynamically adjust the learning rate according to the complexity of the layout task and the performance of the current strategy. The loss function of the low-level network is expressed as follows: ; in, It’s an instant reward. is the discount factor, Indicates in status Next Action The expected return value, Indicates immediate reward, Indicates that in the next state The maximum expected reward from all possible actions.
4. The multi-objective chip layout optimization method based on hierarchical reinforcement learning according to claim 1, characterized in that: The S4 specifically includes: S401. Define a multi-objective optimization function , using the weighted sum method, each target has a weight coefficient, expressed as follows: ; in, They are the weight coefficients of energy efficiency, wiring density, signal integrity, and thermal distribution uniformity; S402, dynamically adjusting the weight coefficient using an adaptive algorithm according to the layout design stage and the current priority, and then optimizing the weight value based on historical data and real-time feedback; S403, integrating the multi-objective optimization function into the reinforcement learning framework, using the multi-objective optimization function to evaluate the effects of different layout solutions during the reinforcement learning training and decision-making process, and at the same time, using the multi-objective optimization function to adjust the strategy of the intelligent agent during the reinforcement learning training process to maximize the value of the optimization function; S404: multi-objective optimization function The value of is used as a reward signal to guide the agent to learn to make the best layout decision, and then combined with the state representation provided by the graph neural network to optimize the multi-objective optimization function.
5. The multi-objective chip layout optimization method based on hierarchical reinforcement learning according to claim 1, characterized in that: The S5 specifically includes: S501. Define reward function: Defining the reward function , where t represents the time, s represents the state, Indicates behavior, as follows: ; in, Represents the weight coefficients of energy efficiency, wiring density, signal integrity, and thermal distribution uniformity at time t, Indicates taking action in state s energy efficiency, wiring density, signal integrity and thermal uniformity; S502: Introduce an adaptive weight adjustment mechanism based on performance feedback to perform adaptive weight adjustment: Define an adaptive weight adjustment formula: ; in, Represents the performance deviation function, reflecting the target The gap between the current state and the expected performance, represents a smoothing parameter used to find a balance between historical weights and current performance feedback. The performance deviation function It is calculated based on the difference between the actual performance index and the preset target performance index, expressed as follows: ; in, Indicates The preset performance indicator targets for each goal, Indicates actual performance indicators; S503, introduce the Actor-Critic framework to implement the strategy fine-tuning mechanism: Adjust the strategy based on real-time performance feedback and build an Actor-Critic architecture to achieve fine-tuning. The Actor-Critic architecture includes an Actor network and a Critic network to generate layout strategies and evaluate the decision value of the current layout. Actual performance of the target Lower than Preset performance indicator targets for each goal , then fine-tuning the Actor network prioritizes improving this performance indicator.
6. The multi-objective chip layout optimization method based on hierarchical reinforcement learning according to claim 5, characterized in that: The fine-tuning method of the Actor-Critic framework is expressed as follows: Fine-tune the policy gradient update formula of the Actor network: ; in, are the parameters of the Actor network, is the learning rate, It is behavior The advantage function is evaluated by the Critic network. When the performance index is detected Below the target, the advantage function will increase, thereby encouraging the Actor network to choose behaviors that improve this performance metric.
7. The multi-objective chip layout optimization method based on hierarchical reinforcement learning according to claim 1, characterized in that: The S6 specifically includes: S601. Design an information exchange mechanism to enable high-level network strategies and low-level network strategies to share key information. S602, define coordination function ,in, It is a high-level state. is a low-level state, and the coordination function is used to evaluate the consistency of the high-level network strategy and the low-level network strategy, and adjust the low-level network strategy according to the needs; S603, using a synchronization algorithm to ensure the consistency of layout strategies at different levels, and updating the synchronization algorithm formula to adjust the low-level state, as shown below: ; in, is the step size of synchronization update, Indicates a new low-level state.
