Embodiments of the invention relate to methods and apparatuses based on machine learning for placing circuit blocks with flexible aspect ratios on a semiconductor chip.
Floor planning is an early stage in integrated circuit (IC) design. During the floor-planning stage, circuit designers explore options for placing circuit blocks on a chip canvas. The register-transfer language (RTL) code and netlist of the circuit block may not have been generated.
Macro placement comes after the floor-planning stage after one or more placement options are selected. A macro contains post-synthesized descriptions of a circuit block. The logic and electronic behavior of the macro are given but the internal structural description may or may not be known. Mixed-size macro placement is the problem of placing macros of various sizes on a chip canvas to optimize an objective such as the wirelength, congestion, etc.
Regardless of which stage in the IC design flow, the number of circuit blocks involved in the placement can be on the order of hundreds or thousands. The placement of circuit blocks is a complicated and time-consuming process and typically relies on the manual efforts of human experts. The reliance on manual efforts severely limits the number of placement options that can be explored within a reasonable time. As a result, the manual placement may be suboptimal. If the chip design later calls for a different placement, the high iteration cost and impact on the schedule and resources would be prohibitive. Thus, there is a need to improve the quality and efficiency of circuit block placement.
In one embodiment, a method is provided for placing flexible blocks on a chip canvas in an integrated circuit (IC) design. A neural network receives an input describing geometric features of a flexible block to be placed on the chip canvas. The geometric features includes an area size and multiple aspect ratios. The neural network generates a probability distribution over locations on the chip canvas and the aspect ratios of the flexible block. Based on the probability distribution, a location on the chip canvas is selected for placing the flexible block with a chosen aspect ratio.
In another embodiment, a system is provided for placing flexible blocks on a chip canvas in an IC design. The system includes memory to store descriptions of the flexible blocks. The system further includes one or more processors coupled to the memory. At least one of the processors performs operations of a neural network. The one or more processors are operative to receive an input to the neural network, where the input describes geometric features of a flexible block to be placed on the chip canvas. The geometric features include an area size and multiple aspect ratios. The neural network generates a probability distribution over locations on the chip canvas and the aspect ratios of the flexible block. The one or more processors are operative to select a location on the chip canvas for placing the flexible block with a chosen aspect ratio based on the probability distribution.
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.
A learning-based neural network is described for placing flexible blocks on a chip canvas in an integrated circuit (IC) design process. The term “flexible block” as used herein refers to a circuit block that has a fixed area and a flexible shape. In one embodiment, the shape is defined by an aspect ratio, which is the ratio of width to height of a rectangle. When placing a flexible block, a placement tool that uses the neural network not only determines the placement location but also the shape of the flexible block. The placement tool may be part of an electronic design automation (EDA) tool.
In one embodiment, a flexible block may be described by schematics for which register-transfer level (RTL) code has not been written or completed. For example, a flexible block may be a proprietary intellectual property (IP) core; e.g., a hardware subsystem (microprocessor, controller, universal serial bus (USB), image processor, etc.). Automating the floor planning and placement of flexible blocks can significantly shorten the time spent on design exploration and the overall IC design process. For example, a placement tool based on a reinforcement-learning (RL) neural network can place hundreds of flexible blocks within a few hours with reasonable quality. The increased placement speed allows a circuit designer to explore more design choices within a limited design time frame.
Alternatively, a flexible block may be an RTL-coded circuit module or a post-synthesized circuit module such as a macro (e.g., a memory circuit such as static random access memory (SRAM)). Thus, the placement of flexible blocks described herein may be performed in any stage of an IC design process including an early exploration stage of floor planning and a post-synthesis stage.
Embedding vector 425 is also fed into a third FC network 440 to generate a value function (VF). The value function outputs a predicted reward value for the action, which is used to update the coefficients of neural network 400. For example, the neural network's coefficients can be updated using a Proximal Policy Optimization (PPO) gradient estimator with generalized advantage estimation.
For each flexible block to be placed, multiple action masks may be generated to block out grid cells based on a density constraint. For density threshold=1, a grid cell is blocked out if placing a given block on the grid cell would cause the sum of occupied areas in the grid cell to exceed 1. An action mask is a function of the aspect ratio of a given block to be placed. That is, different aspect ratios of a given block correspond to different action masks. The action masks may be indicated by gt(x, y, r), which spans over a space of size M×N×|S|. In one embodiment, when the action masks gt(x, y, r)=0, it means that the grid cell (x, y) is blocked for a flexible block with aspect ratio index r, and when gt(x, y, r)=1, it means that the grid cell (x, y) is not blocked for placing the flexible block with aspect ratio index r. A placement tool sets gt(x, y, r)=0 if the flexible block placed at the center of grid cell (x, y) with the r-th aspect ratio in set S causes the density of any grid cell to exceed the density threshold. Otherwise, the placement tool sets the action masks gt(x, y, r)=1.
The action masks gt(x, y, r) may be applied to the probability distribution P(x, y, r) to set the blocked areas to a zero probability value. A masked distribution {tilde over (P)}(x, y, r) 460 of size is M×N×|S| is calculated by applying action masks 470 to the probability distribution P(x, y, r). In one embodiment, masked distribution 460 spans over the action space formed by the valid placement locations and the available aspect ratios of a flexible block. With a deterministic policy, the highest probability according to masked distribution 460 may be chosen to place the flexible block. With a stochastic policy, an action may be sampled according to masked distribution 460.
After the placement of the flexible block, the state of the chip canvas is updated and a next flexible block is to be placed on the updated canvas. After all flexible blocks are placed, a reward is calculated. In one embodiment, the reward may be expressed as an objective function that minimizes the wirelength subject to a non-overlapping constraint. An example of the reward may be formulated as follows:
R
p,g
=−W(p,g) s.t. density(p,g)≤density threshold
where g: graph (design input), p: placement, and W is the wirelength measurement.
The design input (g) describes the fixed blocks and the flexible blocks on the chip canvas, and the placement (p) describes the blocks' placement on the chip canvas. The placement process may iterate a predetermined number of times or for a predetermined time period, or when the reward has reached a steady state or a given goal. After neural network 400 is trained with a training set, the trained neural network 400 can be used to place flexible blocks on a given chip canvas. In the present embodiment, the fixed block is a circuit block being placed at the fixed location on the given chip canvas. The fixed block has a fixed area and a fixed shape as well.
Method 600 starts with step 610 when a neural network executed by a computing system receives an input that indicates the geometric features of a flexible block to be placed on the chip canvas. The geometric features include an area size and multiple aspect ratios. At step 620, the neural network generates a probability distribution over locations on the chip canvas and the aspect ratios of the flexible block. At step 630, a location on the chip canvas is selected for placing the flexible block with a chosen aspect ratio based on the probability distribution.
In one embodiment, the computing system generates action masks for the respective aspect ratios of the flexible block. Each action mask is to block out a region of the chip canvas for a corresponding aspect ratio of the flexible block. Each action mask is to block out the region in which the placement of the flexible block violates a non-overlapping constraint. The computing system applies the action masks to the probability distribution to generate a masked distribution. Regions of the chip canvas that are blocked out by the action masks are set to a probability value of zero.
In one embodiment, after the placement of all of the flexible blocks on the chip canvas, the computing system calculates a wirelength measurement based on wire connections of the flexible blocks. The computing system may generate multiple floorplans, with each floorplan corresponding to a different placement of the flexible blocks and fixed blocks on the chip canvas. The computing system calculates a wirelength measurement for each floorplan, and selects one of the floorplans that minimizes the wirelength measurement.
In one embodiment, the chip canvas is represented by a grid of equal-sized grid cells. The computing system generates an action mask to block out the grid cells in which the placement of the flexible block violates a density threshold that specifies a maximum sum of occupied areas in each grid cell. The occupied areas in each grid cell include areas occupied by fixed blocks and the flexible blocks. The computing system generates the probability distribution over an action space. The size of the action space is defined by the size of the grid and the number of aspect ratios of the flexible block.
In one embodiment, the neural network includes a graph neural network, fully-connected networks, and deconvolution networks. In one embodiment, the flexible block is described by schematics without an RTL description. In one embodiment, the flexible block is described by an RTL description or a synthesized netlist.
System 700 further includes memory 720 coupled to processing hardware 710. Memory 720 may include memory devices such as dynamic random access memory (DRAM), SRAM, flash memory, and other non-transitory machine-readable storage media; e.g., volatile or non-volatile memory devices. Memory 720 may further include storage devices, for example, any type of solid-state or magnetic storage device. In one embodiment, memory 720 may store one or more EDA tools 740 and a placement tool 760 for placing flexible blocks. Placement tool 760 may include one or more neural networks (e.g., neural network 400 in
In some embodiments, system 700 may also include a network interface 730 to connect to a wired and/or wireless network. It is understood the embodiment of
The operations of the flow diagram 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/343,111 filed on May 18, 2022, and U.S. Provisional Application No. 63/373,207 filed on Aug. 23, 2022, the entirety of both which is incorporated by reference herein.
Number | Date | Country | |
---|---|---|---|
63373207 | Aug 2022 | US | |
63343111 | May 2022 | US |