Embodiments of the invention relate to analog design space search using deep reinforcement learning.
The annual increment of computing power described by Moore's law is pioneering unprecedented possibilities. This remarkable progress has been accompanied by collinearity with tremendous increases in chip design complexity. One example of this complexity is the growth in the process, voltage, and temperature (PVT) conditions. Although the majority of a system-on-a-chip (SoC) area is occupied by digital circuitry, analog circuits are essential for the chip to communicate with and sense the rest of the world. However, the design effort of the analog counterpart is more onerous due to the required intervention of human expertise and scarcity of automation tools.
Transistor sizing is a labor-intensive and time-consuming task in analog design. Currently, transistor sizing is mostly done by trial and error. The designers begin by applying their knowledge about the characteristics of analog circuits and transistors to select a reasonable range of candidate solutions. Afterwards, the designers explore the design space with a grid search and receive feedback from SPICE (Simulation Program with Integrated Circuit Emphasis) circuit simulations. The procedure of the designers' actions and SPICE circuit simulations is repeated until the specifications are met. Due to the very large design space, known techniques for automating transistor sizing often suffer from convergence problems or scalability issues.
Known circuit sizing solutions, such as Bayesian optimization (BO), model-free agents, sequence-to-sequence modeling using an encoder-decoder technique, graph convolutional neural networks, etc., suffer from various types of drawbacks such as scalability, general feasibility, efficiency, and reusability.
Furthermore, to guarantee that a chip can work under variations of fabrication processes, power supplies, and environments, a number of PVT conditions have to be signed off before tape-out. A conventional strategy for exploring the PVT conditions is to test all PVT conditions every time a new set of circuit sizing assignments is obtained. This strategy is wasteful of computing resources and electronic design automation (EDA) tool licenses.
Thus, improvement to analog sizing automation is needed to address the existing problems.
In one embodiment, a method is provided for analog circuit sizing. The method includes the steps of: receiving an input indicating a specification of an analog circuit and a plurality of design parameters; and iteratively searching a design space until a circuit size is found to satisfy the specification and the design parameters. The iteratively searching further includes the steps of: calculating, by a neural network agent, a measurement estimate for each of a plurality of samples randomly generated in a trust region to identify a candidate size that optimizes a value metric, where the trust region is a portion of the design space; and calculating updates to weights of the neural network agent and the trust region for a next iteration based on, at least in part, a simulation measurement by a circuit simulator on the candidate size.
In another embodiment, a system includes processors and a memory coupled to the processors. The memory stores instructions which, when executed by the processors, cause the processors to perform operations of a neural network agent and a circuit simulator for analog circuit sizing. The processors are operative to: receive an input indicating a specification of an analog circuit and a plurality of design parameters; and iteratively search a design space until a circuit size is found to satisfy the specification and the design parameters. The processors are further operative to: calculate, using the neural network agent, a measurement estimate for each of a plurality of samples randomly generated in a trust region to identify a candidate size that optimizes a value metric, where the trust region is a portion of the design space; and calculate updates to weights of the neural network agent and the trust region for a next iteration based on, at least in part, a simulation measurement by the circuit simulator on the candidate size.
Other aspects and features will become apparent to those ordinarily skilled in the art upon review of the following description of specific embodiments in conjunction with the accompanying figures.
The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that different references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at least one. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the art to effect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.
In the following description, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In other instances, well-known circuits, structures, and techniques have not been shown in detail in order not to obscure the understanding of this description. It will be appreciated, however, by one skilled in the art, that the invention may be practiced without such specific details. Those of ordinary skill in the art, with the included descriptions, will be able to implement appropriate functionality without undue experimentation.
Analog circuit sizing, also referred to as transistor sizing, is an iterative process for determining the values of a set of sizing variables, such as the length, width, and multiplicities for each transistor in a given topology to satisfy a given specification. There are usually trade-offs among design choices. For example, larger transistor sizes typically lead to greater performance but consume more power and area.
A model-based reinforcement learning (RL) framework is disclosed for analog circuit sizing. The framework automates analog circuit sizing under design constraints and incorporates a PVT exploration strategy. The framework includes RL agents, which can quickly adapt to an environment based on learned experiences and can evolve to approach optimality over time.
One aspect of the framework explores PVT conditions with high efficiency. At the system level, the framework increases R&D productivity during analog front-end sizing. Experiment results demonstrate that RL agents in the framework can efficiently search the design space of state-of-the-art designs with superior performance. At the algorithm level, the framework can directly mimic the dynamics of a circuit simulator, such as the SPICE simulator. At the verification level, the framework explores the input PVT conditions and verifies that a chosen circuit size satisfies the specification for all of the input PVT conditions.
In one embodiment, the designers' input to the framework 100 includes a topology, a specification, transistor size ranges, and PVT conditions. The topology, transistor size ranges, and PVT conditions are collectively referred to as a set of design parameters. The term “designers” as used herein refers to design engineers. The framework 100 may initialize multiple RL agents, with each RL agent for a different PVT condition. To simplify the description, the scenario of multiple RL agents is described later with reference to
A design space is the space of all sizing values that may be chosen to size an analog circuit. Thus, the circuit sizing problem is a search problem in a given design space. Each sample in the design space is a vector of sizing variables with respective sizing values. For each sample in the design space, the RL agent 110 calculates a measurement estimate, which estimates the simulation measurement of the circuit simulator 120. The RL agent 110 can generate a measurement estimate much faster than the circuit simulator 120 generates a simulation measurement.
The search problem is solved iteratively. In each iteration, the platform 100 applies a value function to each measurement estimate generated by the RL agent 110 to obtain a corresponding value metric. The sample corresponds to the measurement estimate having the highest value metric is selected as a candidate size. The candidate size is a set of assignments; i.e., the assignments of sizing values to corresponding sizing variables. The circuit simulator 120 receives the candidate size and generates a simulation measurement to verify whether the candidate size satisfies the specification. A PVT condition manager 160 keeps track of the PVT conditions that have been verified by the circuit simulator 120 as satisfying the specification, and causes the platform 100 to initialize more RL agents for the PVT conditions that fail to meet the specification.
In one embodiment, the framework 100 further includes a gradient module 130, which calculates updates to the weights of the RL agent 110. The gradient module 130 performs the updates iteratively using a gradient method based on a loss function that measures a difference (e.g., the mean square error (MSE)) between the circuit simulator's 120 simulation measurement and the RL agent's 110 measurement estimate. The framework 100 further includes a trust region update module 140, which updates a trust region iteratively for the RL agent 110 to conduct a search. The trust region is a portion of the design space. In one embodiment, the trust region is an area of a circle centered at a candidate size with a radius that may dynamically expand or shrink in each iteration. In each iteration, the RL agent 110 receives random samples in the trust region as input, and generates measurement estimates as output. The samples may be generated by a random sample generator 150 using a Monte Carlo method. As the search for a candidate size in each iteration is confined to a trust region instead of the entire design space, the search can be performed with high speed and efficiency.
Thus, the RL agent 110 identifies a candidate size among random samples for the circuit simulator 120, and the circuit simulator 120 feeds back a simulation measurement to update the RL agent 110 and the trust region in which random samples are generated for the next iteration. The framework 100 outputs a circuit size when a candidate size is found to satisfy the specification. The circuit size is referred to as the “final circuit size” when a candidate size is found to satisfy the specification and all of the input PVT conditions.
The interactions between the RL agent 110 and the circuit simulator 120 (“agent-simulator loop”) replaces the conventional designer-simulator loop in which designers interact with a circuit simulator to fine-tune a circuit size by trial-and-error. The agent-simulator loop is much more efficient and fast than the designer-simulator loop. The RL agent 110 can efficiently identify and reject unqualified samples so that the circuit simulator 120 can focus on candidate sizes that potentially may satisfy the specification.
The following description provides a mathematical formulation of analog circuit sizing. Generally, analog circuit sizing can be formulated as a constrained multi-objective optimization problem, defined in (1).
Minimize Fm,c(X), m=1,2, . . . ,Nm, c=1,2, . . . ,Nc,
subject to Cd,c(X)<0, d=1,2, . . . ,Nd, c=1,2, . . . ,Nc, (1)
X∈
s
where X is a vector of variables to be optimized; s is the design space; Fm,c(X) is the mth objective function (e.g., power, performance, and area) under the cth PVT condition; and Cd,c(X) is the dth constraint under the cth PVT condition.
With the exponential growth in PVT conditions during fast technological advances, finding the global optimal solution for (1) is often infeasible. In contrast, meeting the constraints assigned by designers is more practical. Thus, the optimization problem described in (1) can be reduced to a constraint satisfaction problem (CSP). More generally, a CSP is defined as a triple X, , C in (2).
X={x
1
,x
2
, . . . ,x
n}
={D1,D2, . . . ,Dn}, Di={b1,b2, . . . ,bl}
C={C
1
,C
2
, . . . ,C
n
}, C
j=(tj,rj) (2)
where X is a finite set of sizing variables to be searched. Each sizing variable has a non-empty domain Di, namely a design space, and {b1, b2, . . . , bl} are the possible values. C is a set of constraints. A constraint is a pair that consists of a constraint scope tj and a relation rj over the variables in the scope, limiting feasible permutations of assignments. The simulation performed by a circuit simulator (e.g., a SPICE simulator) is denoted as the Spice function.
One effective approach for solving a CSP in (2) is a local search. Local search performed by the model-based RL framework 100 (
The model-based RL framework 100 provides a direct modeling of a compact design space DL. Imitating the behavior of a SPICE simulator, the model maps transistor sizes X to estimates of simulation measurements Spice(X). In one embodiment, the model (e.g., the RL agent 110 in
ŷ=f
N,N(X;θ)≈Spice(X),X∈DL (3)
where ŷ is a vector of predicted measurements (e.g., gain, phase margin, etc.) with respect to a vector of sizes X estimated with weights θ.
The loss function J(θ) may be obtained by the mean squared error (MSE) as shown in (4).
A model-based RL agent (e.g., the RL agent 110 in
A value function is used to evaluate the merit of simulation measurements and measurement estimates. The output of the value function is referred to as a value metric. The value function does not participate in training the RL agents and, therefore, does not affect the convergence of the neural network model. A non-limiting example of the value function (Value) is the sum of normalized measurements. Such a value function can be evaluated with readily available information. However, in terms of the trade-off between constraints, an alternative value function may be implemented to encode (e.g., weigh) the importance of each measurement.
One key factor to the performance of the neural network agent is the transition of search space size from a global landscape to a local area. Thus, the definition of the local properties plays a role in the algorithm's efficiency. The local area, also referred to as the trust region, is dynamically updated throughout the search.
The trust region method defines an iteration-dependent trust region radius Δrj where the model Value ∘fN,N is trusted to be an adequate representation of the objective function Value ∘Spice. At each iteration i, a trust region algorithm first solves the trust region sub-problem (5) to obtain d*(i). In one embodiment, this is realized by Monte Carlo sampling.
D
TR
i
={X∈D|∥X−X
i
∥≤Δr
i} (5)
where d*(i) is a vector of optimal trial steps from the current center point, ∥⋅∥ is a norm, DTRi is the trust region.
The trust region method computes the ratio ρi of an estimated reduction and an actual reduction. The estimated reduction is a difference between an estimate function value at the current center point of the trust region and an estimate function value at a trial point (which is trial steps away from the current center point). The estimated function value is the value metric of the measurement estimate Value ∘fN,N. Similarly, the actual function value is the value metric of the simulation measurement Value ∘Spice. The actual reduction is defined as a difference between an actual function value at the current center point of the trust region and an actual function value at a trial point. A trial point is accepted or denied based on the ratio ρi. The radius expands if the neural network closely approximates the objective function Value ∘Spice. A close approximation is indicated by the ratio being close to 1 (e.g., within a predetermined threshold). Otherwise, the radius shrinks. The radius update is calculated based on the ratio.
Conceptually, a trust region is a circular area characterized by a center and a radius. The center is at the best sample identified at initialization or during each iteration. The trust-region radius is dynamically changed based on the accuracy of the model in a trust region with the current radius. The aforementioned ratio is a measurement or estimate of the accuracy. The radius is chosen such that it is not too large for modeling the neural network, and not so small as to require searching more local regions. The trust-region method balances this trade-off. If the neural network can sufficiently model a trust region (i.e., closely approximates the objective function), then the radius can expand to allow searching in a larger space. If the neural network cannot sufficiently model the current trust region, then the radius is not changed or is reduced to allow for easier modeling.
In the algorithm of
The PVT exploration 460 maintains and updates a condition pool as part of a PVT exploration strategy. Initially, the condition pool may include only one PVT condition, which is the worst PVT condition (i.e., the most difficult condition for an analog circuit to meet the specification according to prior knowledge or experiences) among all PVT conditions specified in the designers' input. The condition pool may progressively expand to include additional PVT conditions. Each PVT condition has its own independent model. That is, each PVT condition in the condition pool has a corresponding RL agent 410 in an agent pool, and each RL agent 410 in the agent pool is trained to model a different PVT condition in the condition pool. Multiple RL agents 410 can concurrently perform measurement estimates on the same set of random samples in the same trust region. In each iteration, the gradient update 430 updates the weights of each RL agent 410 based on an agent-specific loss function (e.g., the MSE function), and the trust region method 440 determines a common trust region for all of the RL agents 410.
In each iteration, the Monte Carlos sampling 450 generates a set of random samples in the trust region for all of the RL agents 410. Each RL agent 410 calculates a measurement estimate for each random sample. The platform 400 includes a value function module 470 that evaluates a value metric of each measurement estimate from each RL agent 410. The sample corresponding to the measurement estimate having the maximum value metric is selected as a candidate size. For a multi-agent case, each RL agent 410 in the agent pool first calculates its best candidate size. Then, the worst candidate size is chosen among all of the best candidate sizes as the candidate size and is sent to the SPICE environment 420. The “best” and the “worst” candidate sizes are chosen to maximize and minimize, respectively, the value metrics of the corresponding measurement estimates. The SPICE environment 420 runs a circuit simulation on the candidate size and the simulation measurement is used to update the RL agents 410 and the trust region. The iterative process between the RL agents 410 and the SPICE environment 420 continues until a final circuit size is found that satisfies the specification under all PVT conditions specified in the designers' input.
Referring to
If a circuit size is found that meets the specification for all PVT condition(s) in the condition pool, the circuit simulator at step 570 tests the circuit size under all other PVT conditions, i.e., all PVT conditions that are not in the condition pool. If, at step 580, the test indicates that all PVT conditions meet the specification, the circuit size is output as the final circuit size. If, at step 580, the test indicates that not all PVT conditions meet the specification, the process 500 returns to step 510 with an incremented index i to initialize a next RL agent for the next worst PVT condition that fails to meet the specification. The process 500 continues until the final circuit size is found.
Suppose that the second candidate size fails to meet the specification under PVT9 only. A third RL agent is initialized and trained to search for a candidate size under PVT9 concurrently with the first RL agent searching under PVT3 and the second RL agent searching under PVT6. After all three RL agents jointly identify a third candidate size that meets the specification under PVT3, PVT6, and PVT9, the circuit simulator tests the third candidate size for all other PVT conditions. Suppose that the third candidate size meets the specification under all other PVT conditions, the third candidate size is output as the final circuit size solution for the analog circuit sizing problem.
In one embodiment, the value metric at step 730 is the output of a value function applied to the measurement estimate generated by the neural network agent taking the candidate size as input.
In one embodiment, at initialization of the neural network agent, the system selects an initial candidate size that optimizes simulation measurements generated by the circuit simulator on initial samples in the design space. The system initializes a trust region centered at the initial candidate size. The system also initializes the neural network agent, which is trained with at least the initial candidate size and a corresponding simulation measurement. In one embodiment, the trust region searched in a current iteration is centered at the candidate size identified in a previous iteration.
The model-based RL frameworks 100 and 400 may be implemented on one or more processors that execute instructions to perform the methods of the frameworks 100 and 400.
The memory 820 is coupled to the processing hardware 810. The memory 820 may include dynamic random access memory (DRAM), SRAM, flash memory, and other non-transitory machine-readable storage medium; e.g., volatile or non-volatile memory devices. The memory 820 may further include storage devices, for example, any type of solid-state or magnetic storage device. In one embodiment, the memory 820 may store instructions which, when executed by the processing hardware 810, cause the processing hardware 810 to perform the aforementioned analog sizing operations, such as the method 500 in
The system 800 may also include a user interface 830 to acquire information from designers. Designers may provide input via the user interface 830 to indicate one or more of the following: transistor sizes to tune, the ranges of sizing variables, the circuit topology, the measurements to observe from SPICE simulations, and the specifications for each PVT condition. The memory 820 may store an automatic script, which when executed by the processing hardware 810, constructs the neural network agents and hyper-parameters of the neural network.
In some embodiments, the system 800 may also include a network interface 850 to connect to a wired and/or wireless network for transmitting and/or receiving voice, digital data, and/or media signals. It is understood the embodiment of
The operations of the flow diagrams of
Various functional components or blocks have been described herein. As will be appreciated by persons skilled in the art, the functional blocks will preferably be implemented through circuits (either dedicated circuits or general-purpose circuits, which operate under the control of one or more processors and coded instructions), which will typically comprise transistors that are configured in such a way as to control the operation of the circuitry in accordance with the functions and operations described herein.
While the invention has been described in terms of several embodiments, those skilled in the art will recognize that the invention is not limited to the embodiments described, and can be practiced with modification and alteration within the spirit and scope of the appended claims. The description is thus to be regarded as illustrative instead of limiting.
This application claims the benefit of U.S. Provisional Application No. 63/109,890 filed on Nov. 5, 2020, the entirety of which is incorporated by reference herein.
Number | Date | Country | |
---|---|---|---|
63109890 | Nov 2020 | US |