PCB component layout optimization methods, devices, equipment, media, and products
By employing a multi-level priority strategy and an external constraint contour expansion method, the problem of compact layout in PCB layout design is solved, improving space utilization and the accuracy of component placement, while reducing manual adjustment costs.
Patent Information
- Application Number
- CN202611333456.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies make it difficult to achieve compact layouts under multiple constraints in PCB layout design, resulting in poor layout space utilization.
A multi-level priority strategy is adopted to reason about the functional modules to which member devices belong, obtain the network connection relationship between anchor devices and member devices, generate the outer constraint profile and expand the candidate placement area layer by layer, optimize the preliminary placement scheme by combining multiple constraints, and obtain the final placement scheme.
It significantly improves the utilization rate of layout space and the accuracy of device placement, while reducing manual adjustment costs.
Smart Images

Figure CN123116995A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic information technology, and in particular to a method, apparatus, equipment, medium and product for optimizing the layout of PCB devices. Background Technology
[0002] In PCB (Printed Circuit Board) layout design, layout engineers need to arrange the components on the circuit board in a reasonable spatial manner and divide them into functional modules to ensure electrical performance and manufacturability.
[0003] Currently, the automatic placement function in electronic design automation tools is mainly used. The device is grouped by a clustering algorithm based on physical distance and candidate placement areas are generated by a rectangular outline scattering method, which can handle the conventional placement requirements of a moderate number of devices.
[0004] However, this type of solution is difficult to achieve a compact layout under multiple constraints, resulting in poor utilization of layout space. Summary of the Invention
[0005] This application provides a method, apparatus, device, medium, and product for optimizing the layout of PCB devices, which can significantly improve the accuracy of cross-page circuit module identification and the utilization rate of layout space.
[0006] In a first aspect, embodiments of this application provide a PCB device layout optimization method, comprising:
[0007] Obtain the circuit board design data of the target circuit. The circuit board design data shall include at least the component information and the network connection relationship between the pins of each component.
[0008] Based on the circuit board design data, obtain multiple anchor point devices and multiple member devices in the target circuit to be laid out.
[0009] Based on the network connection relationship between anchor devices and member devices, a multi-level priority strategy is used to reason about the functional modules to which each member device belongs, so as to obtain each functional module, which includes anchor devices and corresponding member devices.
[0010] For any functional module, obtain the prohibited placement areas of each device within the functional module, perform polygon union on multiple prohibited placement areas to obtain the outer constraint contour; the outer constraint contour is a polygon.
[0011] Based on the outer constraint contour, the system expands outward layer by layer in order from near to far to obtain a multi-layer candidate placement area. For each layer of candidate placement area, the candidate position and placement angle of each member device are determined along multiple preset directions to obtain a set of candidate positions.
[0012] Based on multiple preset constraints, a target placement location is selected for each member device from the set of candidate placement locations corresponding to each member device to obtain a preliminary placement scheme.
[0013] The initial placement plan is optimized to obtain the final placement plan.
[0014] In one possible implementation, for each candidate placement area, the candidate position and placement angle corresponding to each member device are determined along multiple preset directions to obtain a set of candidate positions, including:
[0015] For any candidate placement area in any layer, sampling is performed near the boundary of the candidate placement area along multiple preset directions to obtain the candidate center point corresponding to each direction; the multiple preset directions include up, down, left and right directions;
[0016] Based on the size of the member devices and the preset safety spacing, determine the tangential spacing between adjacent candidate center points in the same layer of candidate placement area;
[0017] Based on each candidate center point and the corresponding tangential interval, the candidate positions of the member devices are determined.
[0018] The placement angle is determined based on the coordinate difference between the pins of the member device and the pins of the target connection component. The target connection component is an anchor device or other member device that has an electrical connection with the member device.
[0019] The corresponding set of candidate positions is determined based on the candidate positions and placement angles of each member device.
[0020] In one possible implementation, determining the placement angle based on the coordinate difference between the member device pin and the target connection component pin includes:
[0021] If the coordinate difference is greater in the horizontal direction than in the vertical direction, then the placement angle is determined to be the first preset angle.
[0022] If the coordinate difference is greater in the vertical direction than in the horizontal direction, then the placement angle is determined to be the second preset angle.
[0023] In one possible implementation, before determining the corresponding candidate position set based on the candidate positions and placement angles of each member device, the method further includes:
[0024] In response to the fact that the number of candidate placement positions in the candidate placement position set of any member device is greater than a preset number threshold, a preset number of target candidate placement positions and corresponding target placement angles are filtered.
[0025] The corresponding set of candidate positions is determined based on the candidate positions and placement angles of each member device, including:
[0026] The corresponding candidate position set is determined based on the target candidate position and the corresponding target placement angle of each member device.
[0027] In one possible implementation, a multi-level priority strategy is used to reason about the functional modules to which each member device belongs, in order to obtain each functional module, including:
[0028] Obtain the network connection relationship between each anchor device and each member device;
[0029] A multi-level priority strategy is adopted, and at least one candidate anchor device is determined for each member device based on the network connection relationship.
[0030] For any member device, if there are multiple candidate anchor devices, the affiliation score corresponding to each candidate anchor device is calculated according to multiple preset dimension parameters.
[0031] Based on the attribution scores, the target anchor device corresponding to the member device is determined from each candidate anchor device to obtain the functional module.
[0032] In one possible implementation, a multi-level priority strategy is employed, and at least one candidate anchor device is determined for each member device based on network connectivity, including:
[0033] For the first member device, determine whether there is a first candidate anchor device that is on the same page as the member device and has a direct network connection relationship according to the first priority strategy; the first member device can be any member device.
[0034] For a second member device that does not have a first candidate anchor device, determine whether there is a second candidate anchor device that is on the same page as the second member device and has a network connection relationship with a lower than the preset level according to the second priority strategy;
[0035] For a third member device that does not have a second candidate anchor device, if the third member device is a preset type device, the third candidate anchor device is determined according to the third priority strategy and the functional path and connection direction of the third member device.
[0036] For a fourth member device that does not have a third candidate anchor device, the existence of a fourth candidate anchor device is determined according to the fourth priority strategy and based on the reference network or page information of the fourth member device and the anchor point.
[0037] For a fifth member device that does not have a fourth candidate anchor device, if the fifth member device does not have a candidate anchor device on the same page, then according to the fifth priority strategy and using the multi-source shortest path search algorithm, the fifth candidate anchor device is searched in the global network topology across pages.
[0038] In one possible implementation, the preset dimension parameters include: the topological connection strength between devices, the distance between devices, the relationship between the pages where the devices are located, and the priority of candidate anchor point device types.
[0039] The attribution score for each candidate anchor device is calculated based on multiple preset dimension parameters, including:
[0040] For any candidate anchor device, obtain the parameters of each dimension and the corresponding weights;
[0041] The parameters of each dimension are weighted and summed according to their weights to obtain the belonging score of the corresponding candidate anchor device.
[0042] In one possible implementation, determining the target anchor device corresponding to the member device from each candidate anchor device based on each attribution score includes:
[0043] The candidate anchor device with the highest affiliation score is determined as the target anchor device corresponding to the member device.
[0044] In one possible implementation, based on multiple preset constraints, a target placement location is selected for each member device from a set of candidate placement locations corresponding to each member device to obtain a preliminary placement scheme, including:
[0045] For any given functional module, based on preset spatial constraints, a set of candidate placement locations is determined for the member devices within the functional module.
[0046] Obtain a pre-constructed target optimization function, which includes cost parameters in multiple dimensions;
[0047] The target optimization function is solved based on multiple preset constraints to obtain the target placement position of each member device, thereby obtaining a preliminary placement scheme.
[0048] Among them, several preset constraints include: spatial constraints and allocation constraints.
[0049] In one possible implementation, the preliminary placement plan is optimized to obtain the final placement plan, including:
[0050] Based on the initial placement plan, a local iterative adjustment strategy is used to optimize the initial placement plan to obtain an optimized placement plan;
[0051] Based on the optimized placement scheme, a multi-stage adjustment method is adopted to adjust the position of the components in order to obtain the final placement scheme.
[0052] In one possible implementation, based on the initial placement scheme, a local iterative adjustment strategy is used to optimize the initial placement scheme to obtain an optimized placement scheme, including:
[0053] The initial placement scheme is divided into multiple initial sub-placement schemes, and the cost corresponding to each initial sub-placement scheme is determined.
[0054] For each preliminary sub-placement scheme, local adjustments are made by moving and / or exchanging devices to obtain each adjusted sub-placement scheme, and the cost corresponding to each adjusted sub-placement scheme is calculated.
[0055] In response to the fact that the cost of the adjusted sub-placement scheme is less than the cost of the initial sub-placement scheme, the adjusted sub-placement scheme is determined as the optimized sub-placement scheme, and the optimized placement scheme is determined based on each optimized sub-placement scheme.
[0056] If the cost of the adjusted sub-placement scheme is greater than or equal to the cost of the initial sub-placement scheme, return to the step of making local adjustments to each initial sub-placement scheme by means of device movement and / or device exchange, until the preset maximum number of iterations is reached.
[0057] In one possible implementation, based on the optimized placement scheme, a multi-stage adjustment method is used to adjust the position of the device to obtain the final placement scheme, including:
[0058] The coordinates of each component in the optimized placement scheme are converted to coordinates in the PCB coordinate system;
[0059] In the first stage, the first functional module with overlapping or insufficient distance is determined based on the coordinates in the PCB coordinate system, and the repulsive force between the first functional modules is calculated and the position of the first functional module is updated based on the repulsive force.
[0060] In the second stage, all functional modules are traversed, and the second functional modules that have collisions or whose distance does not meet the requirements are globally relaxed and adjusted so that all functional modules have no collisions and the distance meets the requirements.
[0061] In the third stage, under the premise of meeting the requirements of no collision and sufficient distance, the device is compacted for any functional module.
[0062] Secondly, embodiments of this application provide a PCB device layout optimization apparatus, comprising:
[0063] The acquisition module is used to acquire the circuit board design data of the target circuit. The circuit board design data includes at least component information and network connection relationships between the pins of each component. Based on the circuit board design data, it acquires multiple anchor devices and multiple member devices in the target circuit to be laid out.
[0064] The inference module is used to infer the functional modules to which each member device belongs based on the network connection relationship between the anchor device and the member device, using a multi-level priority strategy, so as to obtain each functional module, which includes the anchor device and the corresponding member device.
[0065] The first processing module is used to obtain the prohibited placement areas of each device within any functional module, perform polygonal union on multiple prohibited placement areas, and obtain the outer constraint contour; the outer constraint contour is a polygon.
[0066] The second processing module is used to expand outward layer by layer from near to far based on the outer constraint contour to obtain a multi-layer candidate placement area. For each layer of candidate placement area, the candidate position and placement angle of each member device are determined along multiple preset directions to obtain a set of candidate positions.
[0067] The third processing module is used to select a target placement position for each member device from the set of candidate placement positions corresponding to each member device based on multiple preset constraints, so as to obtain a preliminary placement scheme.
[0068] The optimization module is used to optimize the initial placement plan to obtain the final placement plan.
[0069] Thirdly, embodiments of this application provide a layout optimization device for PCB devices, including: a memory and a processor;
[0070] The memory stores instructions that the computer executes;
[0071] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0072] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0073] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0074] This application provides a PCB device layout optimization method, apparatus, device, medium, and product. The method involves: acquiring multiple anchor devices and multiple member devices in the target circuit to be laid out; employing a multi-level priority strategy to reason about the functional modules to which each member device belongs, thus obtaining each functional module, which includes anchor devices and corresponding member devices; for any given functional module, obtaining the prohibited placement areas for each device within that module; performing a polygonal union on multiple prohibited placement areas to obtain an outer constraint contour; the outer constraint contour is a polygon; based on the outer constraint contour, expanding outward layer by layer in a near-to-far order to obtain multiple candidate placement areas; for each layer of candidate placement areas, determining the candidate positions and placement angles corresponding to each member device along multiple preset directions to obtain a candidate position set; based on multiple preset constraints, selecting target placement positions for each member device from the candidate placement position set corresponding to each member device to obtain a preliminary placement scheme; and optimizing the preliminary placement scheme to obtain a final placement scheme. Based on the above steps, this application adopts a multi-level priority strategy to infer the affiliation of member devices, uses polygon union sets and concentric shell expansion to generate candidate positions, and then combines multi-constraint collaborative optimization to obtain the final placement scheme, thereby significantly improving the utilization rate of layout space. Attached Figure Description
[0075] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0076] Figure 1 A schematic diagram illustrating a layout optimization scenario for a PCB device provided in an embodiment of this application;
[0077] Figure 2 A schematic flowchart illustrating a PCB device layout optimization method according to an embodiment of this application;
[0078] Figure 3 This application provides a superclustering diagram illustrating device affiliation determination based on electrical network topology and hierarchical priority rules, as an embodiment of the present application.
[0079] Figure 4 This is a schematic diagram illustrating a method for generating concentric shell candidate placement positions based on merging peripheral constraint contours, as provided in an embodiment of this application.
[0080] Figure 5 A schematic diagram illustrating collision resolution and compaction processing based on the overall movement of a module, provided in an embodiment of this application;
[0081] Figure 6 A flowchart illustrating a PCB device layout optimization method according to another embodiment of this application;
[0082] Figure 7 A flowchart illustrating a PCB device layout optimization method according to another embodiment of this application;
[0083] Figure 8 A schematic diagram of the layout optimization device for PCB devices provided in this application;
[0084] Figure 9 A schematic diagram of the structure of the electronic device provided in this application.
[0085] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0086] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0087] To clearly understand the technical solution of this application, the solutions of the prior art will be described in detail first.
[0088] This application relates to the field of electronic information technology, particularly to the field of PCB automatic placement and computer-aided circuit design, and is mainly applied to high-density, multi-page schematic design scenarios such as mobile phone motherboards, wearable devices, automotive control boards, and industrial control circuits. In such scenarios, PCB component placement optimization devices typically need to combine component information, network connection relationships, keep-away rules, and board frame space constraints to complete module division and position arrangement of a large number of components to meet subsequent routing, manufacturing, and assembly requirements.
[0089] Current PCB automatic placement solutions typically cluster components based on their physical distance or direct network connections, and generate candidate placement positions within a rectangular bounding box using a point-scattering method. Finally, the components are placed according to a preset optimization goal. The basic idea is to first infer the module affiliation based on the spatial proximity or direct connection between components, and then allocate positions by combining the component outline boundaries, spacing rules, and available area within the board.
[0090] However, in high-density, multi-page designs, relying solely on geometric proximity or direct connections often fails to accurately reflect the multi-level electrical connections between devices. This is especially true for passive devices, connector-peripheral devices, and indirectly connected devices distributed across multiple pages, which can easily lead to functional module identification errors and incorrect member device assignments. Inaccurate assignment results in a lack of effective module boundary constraints in subsequent point-scattering based on rectangular contours, leading to scattered and uneven candidate positions, insufficient compactness in the layout, and increased costs associated with repeated manual adjustments and corrections.
[0091] In light of this, improving the accuracy of identifying cross-page components and modules in complex PCBs, while simultaneously ensuring the quality of candidate position generation and subsequent placement effectiveness, has become a pressing technical challenge. To address this issue, a PCB component layout optimization method is proposed. This method involves acquiring anchor devices and member devices in the target circuit, employing a multi-level priority strategy to infer the functional module to which each member device belongs. Subsequently, polygonal unions are performed on the prohibited placement areas of each component within the functional module to obtain the outer constraint contour. Based on this outer constraint contour, multiple candidate placement areas are then expanded outwards layer by layer to determine the candidate positions and placement angles for member devices. Finally, target placement positions are selected based on preset constraints, and the initial placement scheme is optimized to obtain the final placement scheme. This technology can be implemented collaboratively with functional modules such as data preprocessing, modular clustering, candidate slot generation, multi-constraint optimization, and post-layout processing, thereby providing more reliable layout support for complex PCB designs and significantly improving the utilization rate of layout space.
[0092] Below, in conjunction with Figure 1 The layout optimization scenarios of PCB devices in the embodiments of this application will be described in detail. Figure 1 For a schematic diagram of a PCB device layout optimization scenario provided in this application, please refer to [link / reference]. Figure 1 ,include:
[0093] The rectangle on the left represents the PCB substrate, with the solid square at its center serving as the anchor point device and the layout reference for the functional modules. The hollow squares surrounding the anchor point device represent the member devices, together forming a complete functional module. The forbidden areas for all devices within the module are merged to form a polygonal outer constraint contour, the area enclosed by which placement is prohibited. Multiple dashed rings are extended layer by layer from the outer constraint contour outwards, forming candidate placement areas. These areas are used to traverse the feasible placement positions and angles of the member devices to obtain a set of candidate positions. Based on multiple preset constraints, a target placement position is selected for each member device from the candidate placement position set to obtain a preliminary placement scheme. This preliminary placement scheme is then optimized to obtain the final placement scheme. This scheme relies on anchor point devices to achieve modular layout, first defining the constraint boundaries and then expanding the layout space, completing device layout optimization while meeting process and electrical constraints.
[0094] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0095] Figure 2 A flowchart illustrating a PCB device layout optimization method provided in this application is shown below. Figure 2 As shown, the execution subject of this embodiment is a PCB device layout optimization device. The layout optimization of the PCB device can be implemented through a computer program, or through a medium storing the relevant computer program, such as a USB flash drive and / or optical disc, or through a physical device integrating or installing the relevant computer program, such as a chip or electronic device. The electronic device can be a server, server cluster, etc. The PCB device layout optimization method provided in this embodiment includes the following steps:
[0096] S201. Obtain the circuit board design data of the target circuit. The circuit board design data shall include at least the component information and the network connection relationship between the pins of each component.
[0097] Among them, circuit board design data refers to structured data exported from circuit board design tools. The structured data is used to describe the component composition of the target circuit and the electrical connection relationship between the components.
[0098] For example, component information may include at least one of the component name, reference number, package type, external dimensions, and pin definitions; network connection relationships may include network identifiers, a list of component pins connected to each network, and network type.
[0099] It should be understood that network connectivity is the core basis for subsequent attribution reasoning and layout optimization, used to determine the electrical connection paths between various components.
[0100] It should be understood that circuit board design data can be obtained by reading and parsing from circuit board design files, or by directly importing from an existing design database. This application embodiment does not specifically limit this method.
[0101] S202. Based on the circuit board design data, obtain multiple anchor point devices and multiple member devices in the target circuit to be laid out.
[0102] Anchor devices can refer to core devices in the target circuit used to characterize the center of functional modules.
[0103] For example, anchor devices may include at least one of the following: a main control chip, a connector, a core RF front-end device, a core power management device, and other macro-devices capable of characterizing the center of a functional module. It should be understood that, as a positioning reference for the functional module, the position of the anchor device typically remains fixed or undergoes only minor adjustments during layout optimization.
[0104] Among them, member devices refer to subordinate devices in the target circuit that need to be attributed to the functional modules of each anchor device.
[0105] For example, member devices may include at least one of resistors, capacitors, inductors, ferrite beads, diodes, surge protection devices, matching devices, and other passive devices that have an electrical affiliation with the anchor device.
[0106] Specifically, during the layout optimization process, member devices need to be placed around the anchor devices of the corresponding functional modules.
[0107] It should be understood that before obtaining multiple anchor devices and multiple member devices in the target circuit to be laid out, it is also necessary to read the circuit board design file and load the rule configuration to provide a unified data foundation and rule constraints for subsequent processing.
[0108] For example, after reading the circuit board design file, information such as components, pins, networks, boundary areas, device occupied areas, and prohibited placement areas can be parsed, and the parsed raw data can be converted into a unified data object.
[0109] Specifically, a unified data object can include a set of components, a set of networks, a set of pins, a board outline area, and a set of rule configurations.
[0110] The component set stores the identification information and attributes of all components in the target circuit; the network set stores the electrical connection relationships between the pins of each component; the pin set stores the pin definitions and coordinate information of each component; the board outline area defines the physical boundaries for layout optimization; and the rule configuration set stores the rule parameters required for subsequent attribution inference and layout optimization.
[0111] For example, a set of components can be represented as C= , , ..., The network set can be represented as N = , , ..., The pin set can be represented as P = , , ..., The board frame area can be represented as B; the rule configuration set can be represented as R.
[0112] Where m represents the total number of components in the target circuit, k represents the total number of networks in the target circuit, and l represents the total number of pins in the target circuit. It should be understood that m, k, and l are all positive integers, and their specific values are determined by the size of the target circuit.
[0113] For example, the rule configuration set may include at least one of the following: a reference network name set, a power supply network name set, a network name set to be ignored, a threshold for judging high connectivity networks, device role identification rules, device affiliation inference rules, and layout optimization weight parameters.
[0114] Specifically, the reference network name set can include ground network names such as GND (Ground), AGND (Analog Ground), and DGND (Digital Ground); the power supply network name set can include power network names such as VBus (Voltage Bus), VDD (Voltage Drain Drain), and VDDC (CoreVoltage Drain Drain); the network name set to be ignored can include NC (No Connection) or other networks that do not participate in module affiliation inference; the high connectivity network judgment threshold is used to determine that a network is a high connectivity network when the number of devices connected to an electrical network exceeds the threshold, and it is not used as evidence for strong affiliation across pages; the device role identification rule is used to distinguish anchor devices, member devices, and excluded devices; the device affiliation inference rule is used to control the activation and configuration of each priority strategy; the layout optimization weight parameter is used to adjust the weight of each cost term in the objective optimization function.
[0115] High-connectivity networks refer to electrical networks with more than a preset threshold number of connected devices. Examples include global clock networks, power supply networks, or data bus networks. These networks are characterized by being connected to a large number of devices, having low distinguishability, and are not suitable as strong evidence for cross-page attribution. The threshold for determining high-connectivity networks is used to quantify this preset threshold.
[0116] The cost term measures the performance of the layout scheme across different dimensions. For example, it may include trace length cost (total wiring length), anchor distance cost (distance between a device and its anchor point), pin distance cost (distance between a device pin and its target connection point), spacing cost (uniformity of spacing between adjacent devices), geometric rule cost (degree of violation of manufacturability design rules), and rejection cost (degree of entry of a device into a safe spacing warning zone). Each cost term is multiplied by its corresponding weighting coefficient in the objective optimization function and then summed to obtain the total cost that comprehensively evaluates the merits of the layout scheme.
[0117] It should be understood that the specific content of the above rule configuration can be flexibly adjusted according to actual design needs and different PCB scenarios to achieve customized layout optimization effects.
[0118] It should also be understood that while acquiring multiple anchor devices and multiple member devices in the target circuit to be laid out, multiple exclusion devices of the target circuit will also be acquired.
[0119] Specifically, excluded devices refer to those devices in the target circuit that do not participate in the functional module attribution reasoning and layout optimization.
[0120] For example, excluded devices may include at least one of the following: marker points, test points, mechanical structural components, and devices that are constrained by fixed positions and do not participate in module aggregation. It should be understood that although excluded devices are excluded in the subsequent layout optimization process, their occupied areas are treated as prohibited placement areas during the candidate position generation stage, meaning that other devices cannot be placed in the positions of excluded devices.
[0121] It should be understood that after obtaining the above data, it is also necessary to identify the role of each component.
[0122] For example, let the role of component c be role(c), which can be represented as:
[0123] role(c)∈{anchor device, member device, excluded device}
[0124] For example, the role recognition function can be represented as:
[0125]
[0126] in, This indicates the component attributes, which may include component name, package type, reference identifier, etc., extracted from the component set obtained from the above parsing. The set of networks connected to the device can be obtained from the set of networks obtained from the above analysis by matching the signal networks connected to the device pins; The component type is indicated, which may include chips, resistors, capacitors, connectors, etc., and is identified from the type field or package information in the component attributes; R represents the rule configuration set. It should be understood that all parameters in this function are derived from the unified data object read and converted in step S201.
[0127] It should be understood that the role recognition function can determine whether each component belongs to an anchor device, a member device, or an excluded device, thereby determining how it should be processed in subsequent processes.
[0128] It should be noted that the role recognition function can be implemented based on the device role recognition rules in the rule configuration, using multi-level matching logic for judgment. For example, the function can be executed in the following order:
[0129] First, a match is made based on keywords in the device name. If the device name begins with the first preset character, it is identified as an anchor device; if the device name begins with the second preset character, it is identified as a member device; and if the device name begins with the third preset character, it is identified as an excluded device.
[0130] For example, if the device name begins with U or IC, it is determined to be an anchor device; if the device name begins with R, C, L, FB, D or ESD, it is determined to be a member device; if the device name begins with TP, FID, MARK or MT, it is determined to be an excluded device.
[0131] Secondly, for devices whose names do not match the above keywords, further identification is performed based on the device type field. If the device type belongs to a preset chip type set, it is identified as an anchor device; if the device type belongs to a preset passive device type set, it is identified as a member device; if the device type belongs to a preset fixed device type set, it is identified as an excluded device.
[0132] Next, for devices whose roles cannot be determined based on their device name and type, auxiliary judgment is made based on the characteristics of the network they are connected to. For example, if a device is connected to a power supply network or ground network and has no signal network connection, it can be identified as a member device; if a device is not connected to any valid signal network, it can be identified as an excluded device.
[0133] Finally, if the role still cannot be determined, a fallback decision is made based on the default rules in the rule configuration set. For example, the default rules may classify an unknown device as a member device, or classify it as an excluded device based on whether the device has a fixed location attribute.
[0134] It should be understood that the above-mentioned sets of preset characters and preset types can be configured and expanded according to actual circuit design rules.
[0135] For anchor device a, its set of logic overlay pages can be represented as:
[0136]
[0137] in, Indicates anchor point device A collection of components that are logically related. Indicates components The page number of the schematic diagram. Anchor point device The set of all schematic page numbers covered.
[0138] For example, if the anchor device U1 (main control chip) is logically associated with resistor R1, capacitor C5 (page 2) and resistor R8, chip U3 (page 5), then Pages(U1) = {page 2, page 5}.
[0139] It should be understood that the logical overlay page set is used to determine the page relationship between member devices and anchor devices in subsequent attribution reasoning. When the schematic page number of a member device belongs to the logical overlay page set of a certain anchor device, there is a same-page association between the member device and the anchor device, which can be used as the basis for attribution reasoning.
[0140] S203. Based on the network connection relationship between the anchor device and the member device, a multi-level priority strategy is used to reason about the functional module to which each member device belongs, so as to obtain each functional module, which includes the anchor device and the corresponding member device.
[0141] Among them, the network connection relationship between anchor devices and member devices refers to the association index between devices and networks established by extracting the signal network connected to the pins of each anchor device and each member device from the circuit design data.
[0142] The purpose of using a multi-level priority strategy to reason about the functional modules to which each member device belongs is to accurately identify the anchor device to which each member device should belong in a complex electrical network topology, thereby forming functional module groups and providing a modular basis for subsequent layout optimization.
[0143] For example, an electrical network topology may include a graph structure consisting of anchor devices, member devices, and a signal network connecting the pins of each device, wherein the signal network serves as the connection relationship of edges, and the device pins serve as nodes.
[0144] It should be understood that the multi-level priority strategy is triggered step by step according to reliability from high to low. The next level is only activated when the previous level cannot determine the attribution, so as to ensure the accuracy of attribution while covering all member devices as much as possible.
[0145] In one possible implementation, a multi-level priority strategy is used to reason about the functional modules to which each member device belongs, in order to obtain each functional module. This includes: using a multi-level priority strategy and determining at least one candidate anchor device corresponding to each member device based on network connection relationships; for any member device, if there are multiple candidate anchor devices, calculating the attribution score corresponding to each candidate anchor device according to multiple preset dimension parameters; and determining the target anchor device corresponding to the member device from each candidate anchor device based on each attribution score, in order to obtain the functional module.
[0146] Specifically, using a multi-level priority strategy to determine candidate anchor devices means searching step by step from high to low according to a preset priority level. Each level uses a different attribution judgment criterion. The search ends when the previous level can determine a candidate anchor; otherwise, it proceeds to the next level.
[0147] It should be understood that there can be one or more candidate anchor devices. When there is only one candidate anchor device, it can be directly identified as the target anchor device; when there are multiple candidate anchor devices, further screening is required through multi-dimensional scoring.
[0148] Specifically, in the attribution reasoning process, it is necessary to obtain the network connection relationship between each anchor device and each member device as input data for the multi-level priority strategy.
[0149] Network connectivity relationships can be quickly queried based on network indexes. For any network... Its set of connecting components can be represented as:
[0150]
[0151] in, Indicates components A collection of connected networks.
[0152] For example, different types of networks have different search costs in attribution reasoning. Network cost It can be defined as:
[0153]
[0154] in, To ignore networks, such as NC, they are not involved in attribution reasoning; For power supply networks, such as VDD; This is a typical signal network; it usually has > This indicates that the ability of a power supply network to distinguish ownership is weaker than that of a regular signal network, thus its search cost is higher.
[0155] It should be understood that by setting different search costs for different types of networks, the connectivity of ordinary signal networks can be prioritized in attribution inference, avoiding interference from power supply networks and ignored networks in attribution judgment.
[0156] For example, preset dimension parameters can be used to comprehensively evaluate the degree of belonging between member devices and candidate anchor devices from different perspectives.
[0157] Specifically, after calculating the attribution score for each candidate anchor device, all candidate anchor devices are sorted from high to low according to their attribution scores, and the candidate anchor device with the highest attribution score is determined as the target anchor device corresponding to that member device, thereby ensuring that each member device is uniquely assigned to a functional module.
[0158] It should be understood that, through the above method, each anchor device and all its member devices together constitute a functional module, and the devices in each functional module do not overlap.
[0159] In this embodiment, based on network connectivity, the range of candidate anchor points is narrowed down through multiple priority levels. Then, multi-dimensional parameters are used to comprehensively evaluate the suitability of candidate anchor point devices, ultimately determining the target anchor point device. This allows cross-page, indirectly connected, and type-restricted member devices to obtain module affiliations that better conform to electrical relationships, providing stable functional module boundaries for subsequent layout constraint generation. Consequently, the matching degree between the module identification results of member devices and electrical connection links is higher, the selection of target anchor point devices is more stable, and the functional module division is more accurate, thereby improving the constraint consistency of subsequent candidate placement area generation and layout optimization.
[0160] In one possible implementation, a multi-level priority strategy is adopted to determine at least one candidate anchor device corresponding to each member device based on network connection relationships. This includes: for a first member device, determining whether there exists a first candidate anchor device on the same page as the member device and with a direct network connection relationship according to a first priority strategy; the first member device can be any member device; for a second member device that does not have a first candidate anchor device, determining whether there exists a second candidate anchor device on the same page as the second member device and with a network connection relationship lower than a preset level according to a second priority strategy; for a third member device that does not have a second candidate anchor device, if the third member device is a preset type device, then determining a third candidate anchor device according to a third priority strategy and based on the functional path and connection direction of the third member device; for a fourth member device that does not have a third candidate anchor device, determining whether there exists a fourth candidate anchor device according to a fourth priority strategy and based on the reference network where the fourth member device and the anchor point are located or the page information where the fourth member device is located; for a fifth member device that does not have a fourth candidate anchor device, if the fifth member device does not have a candidate anchor device on the same page, then searching for a fifth candidate anchor device in the cross-page global network topology according to a fifth priority strategy and using a multi-source shortest path search algorithm.
[0161] The first member device, the second member device, the third member device, the fourth member device, and the fifth member device are divided based on the processing status of the member devices at different priority levels. Once the same member device finds a candidate anchor device at a certain priority level, it terminates the search for subsequent levels and is no longer a processing object for the next level.
[0162] The first member device is any member device; the second member device is a member device that has not been identified as a first candidate anchor device according to the first priority strategy, i.e., a member device that has not been found to have a direct network connection relationship with a candidate anchor device on the same page; the third member device is a member device that has not been identified as a second candidate anchor device according to the second priority strategy, i.e., a member device that has not been found to have a network connection relationship with a lower than the preset level on the same page; the fourth member device is a member device that has not been identified as a third candidate anchor device according to the third priority strategy, i.e., a member device that does not belong to the preset type of device, or a member device that belongs to the preset type of device but has not been identified as a candidate anchor device based on the functional path and connection direction; the fifth member device is a member device that has not been identified as a fourth candidate anchor device according to the fourth priority strategy, i.e., a member device that has not been identified as a candidate anchor device based on the reference network or information on the same page.
[0163] It should be understood that the multi-level priority strategy is ordered from highest to lowest reliability: direct signal connections on the same page have the highest reliability and are given the first priority; passive chain tracing on the same page has the next highest reliability and is given the second priority; connector functional paths are only applicable to devices of a preset type and are given the third priority; reference networks or fallback information on the same page have lower reliability and are given the fourth priority; and cross-page global search has the lowest reliability and is given the fifth priority. Each priority level is triggered sequentially, and the next level is only entered when the previous level cannot determine a candidate anchor device.
[0164] For example, in the first priority strategy, "same page and direct network connection" means that the member device and the candidate anchor device are located on the same page of the schematic diagram, and they are directly connected through the same signal network without passing through other devices. This strategy is based on schematic design conventions, namely that devices of the same functional module are usually drawn on the same page, and direct connection on the same page is the strongest evidence for attribution.
[0165] For example, in the second priority strategy, the network connection relationship on the same page and with a level lower than the preset level refers to a member device and a candidate anchor device being located on the same page of the schematic diagram, and forming a chain connection between them through passive devices such as resistors, capacitors, inductors, or ferrite beads, with the number of chain connection levels being less than the preset level. This strategy can handle multi-level passive device chain tracing scenarios such as resistors, jumpers, capacitors, and chips. The preset level can be set according to the actual circuit complexity; for example, the preset level threshold can be set to 3 or 4 levels.
[0166] Specifically, the second priority strategy uses a breadth-first search algorithm to expand outwards along the network topology from candidate anchor devices, with each passive device passed through counting as a layer, until the target member device is found or the preset layer is reached.
[0167] For example, the preset type of device in the third priority strategy may include connectors, jumpers, or shorting devices. These devices connect both the functional signal path and the ground path, and cannot be simply assigned based on direct connection or ground fallback; their assignment must be determined according to their functional path and connection direction. The functional path can be the transmission path of a signal from the source to the destination, and the connection direction can be the propagation direction of the functional signal transmitted by the device in the network.
[0168] Specifically, for a preset type of device, determining the landing scheme for the third candidate anchor device based on its functional path and connection direction may include the following steps:
[0169] First, identify all connection networks of the preset type of device and distinguish between functional signal networks and reference networks.
[0170] In this system, the functional signal network represents the transmission path of a signal from the source to the destination, while the reference network represents a grounding or power supply loop. Preset devices connect to both the functional signal network and the reference network simultaneously. If only direct connections are used, the device will establish connections with both anchor devices on the functional signal path and anchor devices on the reference network, leading to confusion in attribution. Therefore, attribution must be determined according to the principle that the functional path takes precedence over the reference network.
[0171] For example, for a connector, a signal is input from a pin on one side of the connector and output from a pin on the other side, with its functional path pointing to the target anchor device driven by the signal; for a jumper or shorting device, a signal is input from one side, shorted, and output from the other side, with its functional path pointing to the target anchor device to which the signal is connected.
[0172] For example, for a shorting device, if one end is connected to a functional signal network (such as SPI_CLK, USB_D+, ENABLE, etc.) and the other end is connected to a reference network (such as GND), then the anchor device connected to the functional signal network is considered as the candidate destination. For a connector, if its data signal pins are connected to the functional signal network and its shield or ground pins are connected to the reference network, then the destination is determined based on the anchor device connected to the functional signal network.
[0173] Secondly, trace along the functional signal network to identify the core devices connected to the functional signal network.
[0174] Specifically, starting from the functional signal pins of a preset type of device, the network topology is expanded outwards to find anchor devices that are directly or indirectly connected to the network. If the functional signal network is directly connected to the signal pin of an anchor device, then that anchor device is directly identified as the third candidate anchor device. If the functional signal network connects to an anchor device after passing through one or more passive devices, then that anchor device is also identified as the third candidate anchor device.
[0175] Finally, the affiliation is determined based on the connection direction. For example, for a jumper device, if its functional signal path originates from the first anchor device, passes through the jumper device, and reaches the second anchor device, its affiliation is determined based on the direction of signal propagation. For example, if one side of the jumper device is connected to the signal pin of the first anchor device and the other side is connected to the enable pin of the second anchor device, then the function of the jumper device is to transmit the control signal from the first anchor device to the second anchor device. In this case, the jumper device belongs to the second anchor device (signal receiver, i.e., the functional module where the controlled device is located).
[0176] It should be understood that the core of determining the attribution of jumper devices lies in identifying the functional module they serve, that is, which core device's normal operation is directly affected by the presence of the jumper device. The signal emitting end is only used to trace the signal source; the final attribution should be based on the controlled device or configured object.
[0177] For example, for a connector, its functional signal path is usually sent from the main control chip and transmitted to the external device through the connector, then the connector belongs to the functional module where the main control chip is located.
[0178] It should be understood that a preset type device is only identified as the third candidate anchor device if its functional signal path points to a clearly defined core device. If the functional signal path cannot be traced back to any core device, or if the functional signal path has connections to multiple core devices and their order cannot be determined, the third priority strategy cannot identify a third candidate anchor device, and the member device will proceed to the fourth priority strategy for further processing.
[0179] For example, taking the shorting device SH12 as an example, one end of it is connected to the functional signal network connected to the general purpose input / output pins of the main control chip U1, and the other end is connected to the reference network GND. During the attribution inference process, SH12 has a connection relationship with both U1 and GND. According to the third priority strategy, the functional signal network has a higher priority than the reference network. The functional signal transmitted by SH12 points to U1. Therefore, U1 is determined as the third candidate anchor device for SH12, rather than attributing it to the module where GND is located.
[0180] For example, taking connector J1 as an example, its signal pins D+ and D- are connected to the USB interface of the main control chip U1, and its ground pin is connected to the reference network GND. During the attribution inference process, according to the principle that the functional path takes precedence over the reference network, the functional signal path of J1 points to U1, so U1 is determined as the third candidate anchor device of J1.
[0181] For example, the reference network in the fourth priority strategy may include a ground network, such as GND, AGND, or DGND. When a member device is only connected to an anchor device through the reference network, and its affiliation cannot be determined by the first three priority strategies, the reference network is used for fallback affiliation. Same-page information refers to member devices and candidate anchor devices being located on the same page of the schematic; even if there is no direct signal connection between them, weak affiliation can be performed based on the same-page relationship.
[0182] Specifically, determining whether there is a landing scheme for the fourth candidate anchor device based on the fourth member device and the reference network where the anchor point is located may include the following steps:
[0183] Specifically, for a fourth member device that cannot be identified as a candidate anchor device through the first three priority strategies, it is first determined whether the fourth member device is connected to a reference network. If the fourth member device is connected to a reference network, then candidate anchor devices that are connected to the same reference network and located on the same schematic page as the fourth member device are obtained.
[0184] For example, if the fourth member device is a decoupling capacitor, with one end connected to the power supply network (VDD) and the other end connected to the reference network (GND), then the anchor device that is connected to the same GND network as the decoupling capacitor and is located on the same page is obtained. The anchor device that meets the above conditions is determined as the fourth candidate anchor device.
[0185] Specifically, if the fourth member device is not connected to the reference network, or the reference network fails to determine the candidate anchor device as a fallback, then all anchor devices on the schematic page where the fourth member device is located are obtained.
[0186] For example, if the fourth member device is located on page 5 of the schematic, then all anchor devices on page 5 are obtained. If there are multiple anchor devices on the same page, then the number of pins or signal connections of each anchor device on that page is further obtained, and the anchor device with the most pins or signal connections on that page is selected as the fourth candidate anchor device.
[0187] Specifically, the fourth priority strategy prioritizes the reference network fallback assignment, and only when the reference network fallback cannot determine the candidate anchor device will the same page information fallback assignment be performed.
[0188] It should be understood that although the reference network in the fourth priority strategy has low discrimination, it can serve as the final basis for same-page attribution when stronger evidence is lacking; same-page information, as weak attribution evidence, is less reliable than direct links and passive link tracing, but more reliable than cross-page global search.
[0189] For example, the multi-source shortest path search algorithm in the fifth priority strategy refers to using all anchor devices as source points, simultaneously expanding the search outward in the global electrical network topology, with each source point expanding in parallel and accumulating the path cost, and selecting the anchor device with the minimum accumulated cost as the fifth candidate anchor device.
[0190] For example, during the search process, different types of networks have different path costs: ordinary signal networks have the lowest cost, power supply networks have a higher cost, and ignoring networks incurs an infinite cost (unworkable). Cross-page connections add an additional cross-page cost. The anchor device with the lowest cumulative cost is the candidate anchor device with the tightest electrical connection to the member devices.
[0191] For high-connectivity networks, identification is based on a high-connectivity network judgment threshold configured in the rules. For example, if the number of devices connected to an electrical network exceeds this threshold, the network is determined to be a high-connectivity network. In the fifth-priority multi-source shortest path search, a higher path cost is set for high-connectivity networks, preventing them from being used as strong cross-page attribution evidence, but allowing them to participate in the search as weak attribution evidence. It should be understood that when the fifth priority is used as a fallback, high-connectivity networks can still be included in the path search, but due to their higher path cost, they will only be used when other lower-cost paths are unavailable, ensuring that all member devices can eventually find candidate anchor devices.
[0192] It should be understood that the fifth priority strategy, as a last resort, can ensure that each member device can eventually find at least one candidate anchor device, avoiding the situation where a device cannot be assigned a location.
[0193] In the specific implementation, for any member device, a first-level screening is performed based on same-page constraints and one-hop connections. If no match is found, a second-level candidate is searched within the same page according to the preset connection level. When the device belongs to a preset type, the anchor point consistent with the path direction is determined as the third candidate, based on the upstream and downstream connection directions of its functional path. If still not determined, the reference network matching module is called to perform a fourth-level judgment based on the association between the reference network where the anchor point is located and the page where the member device is located. If none of the above results are found and the device does not have a same-page candidate anchor point, a multi-source shortest path search is initiated on the cross-page global network graph, expanding in parallel from multiple known anchor points to obtain the fifth candidate anchor point device with the minimum path cost and satisfying the constraints. The output of this process is a set of candidate anchor points corresponding to each member device, which can be used to determine the module affiliation of member devices.
[0194] Figure 3 This illustration shows a superclustering diagram of a method for determining device affiliation based on electrical network topology and hierarchical priority rules, as provided in an embodiment of this application. Figure 3 As shown, when determining the functional modules to which each discrete small component (e.g., resistor, capacitor, shorting component, etc.) on the circuit board belongs, it is not simply grouped based on physical distance, but rather by analyzing the electrical connections between the components for precise clustering. In specific implementation, the PCB component layout optimization device pre-establishes multiple anchor point components (e.g., ... Figure 3The PCB layout optimization device uses a candidate assignment model (first anchor device, second anchor device, and third anchor device) to search for electrical connection evidence between each small device and the candidate anchor points according to a preset priority order. This priority order includes: devices on the same page with direct network connections, devices on the same page with network connections at a level lower than a preset level, devices determined based on functional paths and connection directions, devices based on reference networks or page information as a fallback, and breadth-first search of the global network topology across pages. Through the sequential determination of the above multi-level evidence, the PCB layout optimization device can accurately determine the final anchor device to which each small device belongs, and based on the anchor device, combine small devices with the same electrical subordination to form a clear device functional module. This avoids logical confusion caused by grouping based solely on physical location and lays an accurate modular foundation for subsequent physical layout.
[0195] In this embodiment, the multi-level priority strategy prioritizes direct connections within the same page, then gradually expands to lower-level connections, functional paths and connection directions, reference networks, and cross-page global topology search. This ensures that member devices with different connection configurations can obtain interpretable candidate anchor devices. The resulting set of candidate anchors better matches the electrical relationships in the schematic diagram, providing stable input for subsequent functional module partitioning and maintaining consistency in the attribution of cross-page devices.
[0196] In one possible implementation, the preset dimension parameters include: the topological connection strength between devices, the distance between devices, the relationship between the pages where the devices are located, and the priority of the candidate anchor device type; the attribution score corresponding to each candidate anchor device is calculated according to multiple preset dimension parameters, including: for any candidate anchor device, obtaining each dimension parameter and its corresponding weight; and performing weighted summation of each dimension parameter according to its weight to obtain the attribution score of the corresponding candidate anchor device.
[0197] The topology connection strength between devices refers to the tightness of the connection between member devices and candidate anchor devices in the electrical network topology. It can be measured by the number of shared networks and the cost of each network. The more shared networks and the lower the network cost, the higher the topology connection strength.
[0198] For example, the calculation of topology connectivity strength may include: obtaining the set of all signal networks connected to the pins of member devices, obtaining the set of all signal networks connected to the pins of candidate anchor devices, determining the intersection of the two sets, and using the number of networks in the intersection as the topology connectivity strength value.
[0199] The distance between devices refers to the physical distance or electrical topology distance between member devices and candidate anchor devices on the circuit board. The closer the physical distance or the shorter the topology distance, the higher the value of the distance dimension parameter, indicating that the two should belong to the same functional module in space.
[0200] The "page relationship" refers to whether the member device and the candidate anchor device are located on the same page in the schematic diagram. When they are on the same page, this dimension parameter takes a higher value; when they are on different pages, this dimension parameter takes a lower value or zero. For example, the higher value can be 0.8, and the lower value can be 0.2. It should be understood that the specific values of the higher and lower values can be configured according to actual design requirements, and this application embodiment does not specifically limit them.
[0201] The candidate anchor device type priority refers to the priority of different types of anchor devices, used to distinguish the attribution tendency when multiple anchor devices exist on the same page. For example, the priority of the main control chip can be higher than that of the connector, and the priority of the connector can be higher than that of other types of macro devices.
[0202] Specifically, the weights corresponding to each dimension parameter can be configured according to actual design requirements to adjust the importance of different dimension factors in the attribution decision.
[0203] For example, the formula for calculating the attribution score for member device c and candidate anchor device a can be expressed as:
[0204]
[0205] in, This indicates the shared network or topology connection strength between the two. Indicates the geometric or topological distance between devices; This indicates whether the two have the same design page or logical page relationship; Indicates the priority of candidate anchor device types; Configurable weights.
[0206] Specifically, The value of is related to the number of networks shared between member devices and candidate anchor devices, as well as the network cost. The more common signal networks shared, the higher the network cost. The higher the value, the better. The value of is related to the physical distance between the two on the circuit board or the path length in the electrical topology; the closer the distance, the higher the value. The smaller the value, the more important it is, because the formula is... Therefore, the closer the distance, the greater the contribution to the score. The higher value is taken when both are on the same schematic page, and the lower value or zero value is taken when they are on different pages. The priority is determined based on the type of candidate anchor device; for example, the main control chip may have a higher priority than the connector.
[0207] The final attribution result can be expressed as:
[0208]
[0209] in, This represents the set of all candidate anchor devices. Indicates member device The final anchor point device; This means finding the independent variable 'a' in set A that makes the Score function reach its maximum value.
[0210] It should be understood that after the attribution priority strategy selects the set of candidate anchor devices, the attribution score is calculated for each candidate anchor device in the candidate set, and the candidate anchor device with the highest score is selected as the target anchor device, thereby making the optimal decision among multiple candidate attributions.
[0211] In this embodiment, by incorporating topological connection strength, distance between devices, relationship between devices on different pages, and priority of candidate anchor device types into the attribution score calculation, the scoring results of candidate anchor devices can simultaneously reflect electrical association, spatial association, and page topological association, thereby making the attribution determination of functional modules more consistent. Since the attribution score is controlled by configurable weights, the degree of influence on cross-page devices, neighboring devices, or high-priority anchors in different projects can be flexibly adjusted, thereby improving the adaptability of candidate anchor device screening results and providing a more stable attribution basis for subsequent module division and candidate position generation.
[0212] In one possible implementation, the target anchor device corresponding to the member device is determined from each candidate anchor device based on each attribution score, including:
[0213] The candidate anchor device with the highest affiliation score is determined as the target anchor device corresponding to the member device.
[0214] Specifically, determining the candidate anchor device with the highest assignment score as the target anchor device means selecting the anchor device corresponding to the maximum score among all candidate anchor devices as the final assignment result.
[0215] For example, if a member device corresponds to three candidate anchor devices with scores of 0.85, 0.72 and 0.63 respectively, then the candidate anchor device with a score of 0.85 is determined as the target anchor device.
[0216] It should be understood that the candidate anchor device with the highest affiliation score is the anchor device that is most closely associated with the member device under the comprehensive evaluation of multiple preset dimension parameters. Using this as the target anchor device can ensure the accuracy of functional module division to the greatest extent.
[0217] In a specific implementation, after obtaining multiple candidate anchor devices corresponding to a certain member device, the PCB device layout optimization device calculates the assignment score for each candidate anchor device. This score can be characterized by the topological connection strength between devices, the distance between devices, the relationship of the devices on the page, and the priority of the candidate anchor device type. Subsequently, the PCB device layout optimization device compares the assignment scores of each candidate anchor device and directly uses the candidate anchor device with the highest score as the target anchor device for that member device. This comparison and determination process can be completed by the scoring module within the layout engine. The scoring module can be implemented using numerical recording, sorting retrieval, or threshold judgment. In practical applications, other models or implementation forms of the scoring module can also be selected, and this application does not limit this.
[0218] During operation, member devices are first mapped to multiple candidate anchor devices. Then, a comparable quantification result is formed according to a unified attribution score calculation rule. The candidate anchor device with the maximum value is selected as the target anchor device, thereby completing the module attribution determination of member devices.
[0219] In this embodiment, by using the device with the highest attribution score as the target anchor device, the candidate results under multidimensional constraints can be converged into a unique attribution object, so that the module determination of member devices has a clear and verifiable output, thereby improving the consistency of cross-page device attribution and providing a stable attribution basis for subsequent module boundary construction and candidate placement area generation.
[0220] S204. For any functional module, obtain the prohibited placement areas of each device within the functional module, perform polygon union on multiple prohibited placement areas to obtain the outer constraint contour; the outer constraint contour is a polygon.
[0221] The prohibited area refers to the area in the circuit board design where other components are not allowed to be placed.
[0222] For example, the prohibited placement area may include at least one of the following: the area occupied by the anchor device itself, the area occupied by the excluded device, the pre-defined prohibited placement area, and the area that needs to maintain a safe distance from other devices.
[0223] Specifically, the prohibited placement areas for each device within a functional module include the prohibited placement areas for anchor devices and the prohibited placement areas for each member device that has been identified as belonging to that functional module.
[0224] Specifically, the prohibited placement areas for each device within the functional module can be directly obtained from the circuit board design data read and parsed in step S201. In the circuit board design data, each device is typically associated with corresponding package information and layout constraint information, including the definition of the occupied area of the device.
[0225] For example, the prohibited placement area for anchor devices and member devices can be determined in the following way: First, read the package type and outline size data of each device from the component set; second, generate the corresponding prohibited placement area according to the outline size of the device and the preset safety distance; if the device has a custom prohibited placement area configured in the circuit board design data, the custom area is used first.
[0226] Specifically, the prohibited placement areas for each device within a functional module include the prohibited placement areas for anchor devices and the prohibited placement areas for each member device that has been identified as belonging to that functional module. The prohibited placement areas for all devices within the functional module are then aggregated and used as input data for the subsequent polygon union.
[0227] It should be understood that within a functional module, anchor devices and member devices each occupy a certain amount of physical space, and these spaces cannot be intruded upon by other devices during the layout process. Polygonal union refers to superimposing and merging multiple prohibited areas within a functional module according to their actual geometric shapes to form a unified external constraint outline.
[0228] For example, if there are three prohibited placement areas in the functional module, namely a rectangle, a triangle and a circle, then an irregular polygon is obtained by combining the polygons into a set. This polygon completely covers all the space occupied by the three prohibited placement areas and fits the prohibited placement areas as closely as possible.
[0229] It should be understood that the outer constraint contour obtained by the union of polygons is an irregular polygon. Compared with the traditional axis-aligned rectangular bounding box, the polygon union contour can more accurately fit the actual shape occupied by the device in the module, reduce the invalid candidate placement area, and thus improve the utilization of layout space.
[0230] For example, the mathematical expression for prohibiting the merging of regions is as follows:
[0231] Suppose there are q prohibited areas within the functional module, and their shapes are as follows: , ,…, Then the outer constraint profile obtained after merging can be expressed as:
[0232]
[0233] in, This represents the outer constraint outline of the merged module. This represents the polygon union operation. By performing the polygon union operation described above, multiple independent forbidden areas are merged into a single irregular polygonal outline.
[0234] S205. Based on the outer constraint contour, expand outward layer by layer in order from near to far to obtain a multi-layer candidate placement area. For each layer of candidate placement area, determine the candidate position and placement angle of each member device along multiple preset directions to obtain a set of candidate positions.
[0235] Here, "based on the outer constraint contour" means that the polygon union contour obtained in S203 is used as the starting reference for the expansion of the candidate placement area, and all candidate placement areas are generated outside the contour.
[0236] Specifically, expanding outward layer by layer from near to far refers to starting from the edge of the outer constraint contour and moving outward layer by layer according to a preset expansion step size. Each layer forms a polygonal ring-shaped candidate placement area, thus obtaining multiple layers of candidate placement areas. Each layer of candidate placement area is called a shell. It should be understood that the closer the shell is to the outer constraint contour, the closer its candidate position is to the functional module; the farther the shell is from the outer constraint contour, the farther its candidate position is from the functional module.
[0237] For example, the number of shell layers can be configured based on the available space around the functional module. For space-constrained scenarios, fewer shell layers can be set; for space-abundant scenarios, more shell layers can be set to provide a wider range of candidate locations.
[0238] It should be understood that expanding layer by layer in order from near to far can prioritize providing candidate positions for member devices near the center of the functional module, which is conducive to maintaining the clustering of devices within the module and improving the compactness of the layout.
[0239] Specifically, the shell expansion radius is calculated as follows when expanding outward layer by layer:
[0240] With the first Taking a single component to be placed as an example, let its width and height in the current candidate orientation be respectively... and Its equivalent geometric radius is defined as:
[0241]
[0242] Assume the basic slot spacing is , No. The outer radius of the shell can be expressed as:
[0243]
[0244] in, This is the first-layer shell expansion coefficient, used to control the initial clearance between the first-layer candidate placement area and the outer constraint contour; This is the interlayer pitch coefficient, used to control the incremental distance between adjacent shell layers; It is the shell sequence number, and ≥1; This is the basic slot interval. When and When the above expression degenerates into a basic shell expansion method determined by the device equivalent radius, basic slot spacing, and shell number, the expression degenerates into a basic shell expansion method.
[0245] It should be understood that the above formula for the shell extension radius is used to determine the first... The distance between the candidate placement area of each layer and the outer contour of the functional module is used to ensure that the candidate placement areas of each layer are evenly distributed around the functional module in order from near to far.
[0246] In one possible implementation, for each candidate placement area, the candidate positions and placement angles of each member device are determined along multiple preset directions to obtain a set of candidate positions. This includes: for any candidate placement area, sampling is performed near the boundary of the candidate placement area along multiple preset directions to obtain candidate center points corresponding to each direction; the multiple preset directions include up, down, left, and right directions; the tangential interval between adjacent candidate center points in the same candidate placement area is determined based on the size of the member device and a preset safety distance; the candidate positions of the member devices are determined based on each candidate center point and the corresponding tangential interval; the placement angle is determined based on the coordinate difference between the pins of the member device and the pins of the target connection component, where the target connection component is an anchor device or other member device that has an electrical connection with the member device; and the corresponding set of candidate positions is determined based on the candidate positions and placement angles of each member device.
[0247] Sampling along multiple preset directions near the boundary of the candidate placement area means selecting sampling points along the four main directions (up, down, left, right) and each corner area near the outline boundary of each layer of polygonal annular candidate area.
[0248] For example, for the upper region, multiple sampling points can be selected at preset intervals on the upper boundary of the candidate placement area; the same applies to the lower, left, and right regions. It should be understood that the division of the four directions—up, down, left, and right—can be defined based on the geometric center of the functional module.
[0249] Specifically, a candidate center point is a point selected near the outline boundary of the candidate placement area to determine the device placement location. Each candidate center point corresponds to a possible device placement location, and the device is placed with its center or lower left corner aligned to the candidate center point.
[0250] The determination of the tangential spacing between adjacent candidate center points in the same layer candidate placement area, based on the size of the member device and the preset safety distance, means that when determining the candidate center point, it is necessary to ensure that the arc length distance between adjacent candidate center points on the same layer is greater than or equal to the sum of the device width and the safety distance, so as to avoid the overlap or insufficient spacing between adjacent devices placed on the same layer.
[0251] For example, if the width of a member device is W and the preset safety distance is S, then the tangential distance between adjacent candidate center points in the same layer is at least W+S.
[0252] The process of determining the candidate position of a member device based on each candidate center point and the corresponding tangential interval may include: uniformly arranging candidate center points in a preset sampling area in each direction according to the calculated tangential interval, and taking the placement position corresponding to each candidate center point as a candidate position.
[0253] Specifically, the candidate center points are generated as follows:
[0254] Let q be a sampling point on the outer contour boundary. Let be the normal vector pointing outwards at that point. Then, the candidate center point can be represented as:
[0255]
[0256] in, For the first The radius of expansion of the shell layer, Let q be the unit normal vector pointing outwards. The coordinates of the generated candidate center point.
[0257] To avoid overly dense candidate locations within the same layer, the tangential sampling interval must satisfy the following condition:
[0258]
[0259] in, The tangential arc length interval between adjacent candidate center points on the same shell layer. The equivalent geometric radius of the device. This is the basic slot spacing. Through the above tangential spacing control, it can be ensured that devices at adjacent candidate positions in the same candidate placement area will not overlap.
[0260] Specifically, along the perimeter of the outer constraint contour, according to the aforementioned tangential sampling interval... Sample points q are selected uniformly, and candidate center points are generated along the outward normal direction at each sample point, thereby obtaining candidate positions that are uniformly distributed on the shell layer.
[0261] Determining the placement angle based on the coordinate difference between the pins of the member device and the pins of the target connection component can include: determining the placement orientation of the member device based on the direction indicated by the coordinate difference between the pin positions of the member device and the pin positions of the target connection component, so that the device pins face the target connection component, thereby shortening the connection distance between the pins and improving wiring convenience.
[0262] For example, the target connection component may include an anchor point device, a connector, or other component that requires electrical connection with a member device. The coordinate difference between the member device pins and the target connection component pins reflects their relative positional relationship.
[0263] In this embodiment, by generating multi-directional candidate center points near the boundary of the candidate placement area and constructing tangential intervals based on device size and safety clearance, the distribution of candidate positions matches the device shape and spacing rules. Furthermore, by combining pin coordinate differences to determine the placement angle, the candidate position set simultaneously includes spatial location and orientation information, thus providing alternative placement schemes for member devices that can be directly used for layout solving. This enables the formation of a candidate position set that better conforms to device size constraints and pin connection directions within multi-layer candidate placement areas, giving subsequent placement selection clearer position boundaries and angle constraints, thereby improving the regularity and routableness of the layout results.
[0264] In one possible implementation, the placement angle is determined based on the coordinate difference between the pin of the member device and the pin of the target connection component, including: if the coordinate difference in the horizontal direction is greater than the coordinate difference in the vertical direction, then the placement angle is determined to be a first preset angle; if the coordinate difference in the vertical direction is greater than the coordinate difference in the horizontal direction, then the placement angle is determined to be a second preset angle.
[0265] The first preset angle represents a horizontal placement of the device (0°), and the second preset angle represents a vertical placement of the device (90°). It should be understood that when the horizontal distance between the pins of a member device and the pins of the target connection component is greater than the vertical distance, horizontal placement of the device can make the connection between the pins shorter and the wiring smoother; conversely, when the vertical distance is greater than the horizontal distance, vertical placement of the device is more advantageous.
[0266] For example, if the pin of a member device is located on the right side of the device and the pin of the target connection component is located on the left side of the device, and the difference in horizontal coordinates between the two is greater than the difference in vertical coordinates, then the placement angle of the member device is determined to be a first preset angle (horizontal placement), so that the pin of the device faces the target connection component.
[0267] Specifically, let the device pin fixing point be... =( , The target pin connection point is... =( , If the direction difference between the two can be expressed as:
[0268]
[0269]
[0270] in, This indicates the horizontal offset of the target pin relative to the device pin. This indicates the vertical offset of the target pin relative to the device pin.
[0271] The preferred angle can be determined according to the following rules. :like Then determine the placement angle. =0° (horizontal placement); if Then determine the placement angle. =90° (vertical placement).
[0272] It should be understood that the core logic of the above rules is: when the horizontal offset of the target pin is greater than or equal to the vertical offset, placing the device horizontally can shorten the pin connection; conversely, when the vertical offset is greater, placing the device vertically is more advantageous. The placement angle determined in this way allows the device pins to point towards the target connection component, shortening the connection distance between pins and improving wiring convenience.
[0273] In this embodiment, by synchronously determining the placement angle with the position coordinates during candidate position generation, the orientation of the device is aligned with the pin connection direction, thus directly introducing directional constraints into the candidate position set construction process. The PCB device layout optimization device outputs candidate placement schemes with directional information based on this, and uses this angle result in subsequent target placement position selection, ensuring that member devices maintain a reasonable connection orientation with the target connection component during final placement. This eliminates reliance on manual experience in determining the placement angle, instead relying on pin coordinate differences. This ensures that the device orientation matches the actual connection direction, reducing pin crossings and connection detours, and making the availability of candidate positions more aligned with subsequent routing requirements.
[0274] In one possible implementation, before determining the corresponding candidate position set based on the candidate position and placement angle of each member device, the method further includes: in response to the number of candidate positions in the candidate placement position set of any member device being greater than a preset number threshold, filtering a preset number of target candidate placement positions and their corresponding target placement angles; determining the corresponding candidate position set based on the candidate position and placement angle of each member device includes: determining the corresponding candidate position set based on the target candidate position and the corresponding target placement angle of each member device.
[0275] The preset quantity threshold is used to control the number of candidate positions for each member device, so as to avoid excessive computational scale due to too many candidate positions in the subsequent optimization process.
[0276] For example, the preset quantity threshold can be 32. When the number of candidate positions for a certain member device exceeds 32, 32 target candidate positions and their corresponding placement angles are selected from them according to preset filtering rules.
[0277] It should be understood that the selection criteria may include at least one of the following dimensions: the distance between the candidate location and the functional module outline (closer is preferred), the consistency between the direction of the candidate location and the direction of the target connecting component, and whether the candidate location meets the manufacturability design rules. Through selection, the scale of the optimization solution can be controlled while ensuring the quality and directional diversity of the candidate locations.
[0278] Specifically, determining the corresponding candidate position set based on the target candidate position and the corresponding target placement angle of each member device means using the selected target candidate positions and their corresponding placement angles as the final candidate position set of the member device for subsequent layout optimization solutions.
[0279] It should be understood that the candidate location set generated in the above manner includes information on both location coordinates and placement angle for each candidate location, providing complete input data for subsequent optimization and solution.
[0280] Figure 4 This illustration shows a schematic diagram of a method for generating concentric shell candidate placement positions based on merging peripheral constraint contours, according to an embodiment of this application. Figure 4 As shown, when determining the physical layout environment of the target anchor device, it is first necessary to clarify the occupied contour of the anchor device itself and the prohibited placement areas set in its external adjacent positions. This embodiment does not simply obtain a regular rectangle for the anchor device, but rather obtains the actual geometric boundaries of the anchor device and its associated prohibited placement areas, and performs topological merging to form a complete irregular peripheral constraint contour. Subsequently, the PCB device layout optimization device uses this irregular peripheral constraint contour as a reference and expands outward layer by layer to form concentric shells with similar shapes and nested structures. At the boundary edge of each shell layer, the PCB device layout optimization device pre-sets and arranges several candidate placement areas with determined position coordinates and directions based on the actual size of the member devices to be placed and the required safety spacing. Through this concentric expansion method based on irregular contours, sufficient and compact space for device placement can be generated around the anchor device while ensuring that assembly spacing constraints are met, effectively avoiding the space waste or exceeding safety spacing constraints caused by the traditional regular grid-based point-scattering method.
[0281] In this embodiment, after screening is completed, the PCB device layout optimization device reconstructs a candidate position set based on the target candidate positions and target placement angles corresponding to each member device, ensuring that subsequent target placement position selection is performed only within the compressed set. This process can converge an excessively large candidate size to a fixed range, thereby reducing the computational load required for sorting and constraint verification, while maintaining an effective correspondence between candidate positions and placement angles. Through the above processing, when the candidate position set exceeds the limit, it will be compressed into a preset number of target candidate placement positions and their corresponding target placement angles, thereby reducing the complexity of candidate solution, shortening the layout calculation time, and ensuring high constraint consistency and result stability in the subsequent placement selection process.
[0282] S206. Based on multiple preset constraints, select a target placement location for each member device from the candidate placement location set corresponding to each member device to obtain a preliminary placement scheme.
[0283] Among them, selecting the target placement position for each member device from the candidate placement position set corresponding to each member device based on multiple preset constraints means that, under the premise of satisfying various hard constraints, the optimal combination of placement positions is selected from the candidate placement position set of each member device to form a complete preliminary placement scheme.
[0284] It should be understood that each candidate location in the candidate placement location set contains information in two dimensions: position coordinates and placement angle. Selecting a target placement location for each member device involves selecting a set of position coordinates and placement angles for each member device from each candidate location set.
[0285] For example, the multiple preset constraints may include at least one of spatial constraints, electrical constraints, and manufacturability design constraints.
[0286] Specifically, spatial constraints may include restrictions on the overlap of components, the requirement that components not exceed the board frame boundary, and the requirement that components not overlap with fixed obstacles; electrical constraints may include restrictions on signal line length and pin alignment requirements; and manufacturability design constraints may include requirements on component spacing and restrictions on component placement orientation.
[0287] In one possible implementation, based on multiple preset constraints, a target placement location is selected for each member device from a set of candidate placement locations corresponding to each member device to obtain a preliminary placement scheme. This includes: for any functional module, determining a set of corresponding candidate placement locations for the member devices in the functional module based on preset spatial constraints; obtaining a pre-constructed target optimization function, which includes multiple dimensional cost parameters; and solving the target optimization function based on multiple preset constraints to obtain the target placement location for each member device, thereby obtaining a preliminary placement scheme. The multiple preset constraints include spatial constraints and allocation constraints.
[0288] Specifically, determining the corresponding set of candidate placement positions for member devices in any functional module based on preset spatial constraints means further filtering based on the set of candidate placement positions generated in step S204, and excluding candidate positions that do not meet the spatial constraints.
[0289] For example, spatial constraints may include: the placement of member devices must not exceed the board frame boundary, must not overlap with fixed obstacles, must not overlap with the prohibited placement area of anchor devices, and member devices within the same functional module must not overlap.
[0290] Obtaining the pre-constructed target optimization function refers to acquiring a quantitative index function used to evaluate the merits of the placement scheme. The target optimization function includes multiple cost parameters, each corresponding to a different optimization objective, used to comprehensively evaluate the performance of the placement scheme across multiple dimensions.
[0291] For example, the multiple dimensional cost parameters may include at least one of line length cost, anchor point distance cost, pin distance cost, spacing cost, geometric rule cost, and safety spacing exclusion cost. Each dimensional cost parameter has a corresponding configurable weight to adjust the importance of each dimension in the objective optimization function.
[0292] Among them, multiple preset constraints refer to the set of all constraints that need to be satisfied when solving the objective optimization function, in order to ensure the feasibility of the optimization solution.
[0293] Specifically, the multiple preset constraints include spatial constraints and allocation constraints. The difference between spatial constraints and allocation constraints is that spatial constraints are used to limit the legal position of the device in physical space, and their content does not depend on the matching relationship between the device and the candidate position; allocation constraints are used to limit the one-to-one matching relationship between the device and the candidate position, and their content does not involve the physical space attributes of the device.
[0294] Specifically, spatial constraints refer to the physical space limitations that the placement of devices must meet during the candidate location generation and optimization process. For example, spatial constraints may include: the placement of member devices must not exceed the board frame boundary, must not overlap with fixed obstacles, must not overlap with the prohibited placement area of anchor point devices, and member devices within the same functional module must not overlap.
[0295] Specifically, allocation constraints refer to the matching relationship restrictions that must be satisfied between a device and a candidate location when selecting a target placement location for each member device from the candidate location set. For example, allocation constraints may include: each member device selects only one candidate location, and a candidate location is occupied by only one member device.
[0296] It should be understood that spatial constraints and allocation constraints together constitute multiple preset constraints, and the optimization solver needs to satisfy all of the above constraints at the same time in order to output a feasible placement scheme.
[0297] Specifically, the allocation constraints can be defined as follows:
[0298] Specifically, components The set of candidate positions is Define a binary variable :
[0299]
[0300] It should be understood that each component can only select one candidate location, therefore the following constraints must be satisfied:
[0301]
[0302] That is, for any one component The sum of the binary variables corresponding to all candidate positions is equal to 1, indicating that the component will eventually have one and only one selected placement position, that is, each member component selects only one candidate position.
[0303] At the same time, the same candidate position can be occupied by at most one component, so the following constraints need to be met:
[0304]
[0305] That is, for any candidate position The sum of the binary variables of all components at the candidate position does not exceed 1, indicating that a candidate position cannot be assigned to multiple components at the same time.
[0306] The objective optimization function can be as follows:
[0307]
[0308] in: This represents the normalized half-circuit length cost, which can be used to estimate the total cabling length of each network connection, and calculate the half-circuit length of all networks. Add them together and normalize them to get ; This represents the distance cost from a device to its anchor device or anchor profile. For example, for any member device, calculate the Euclidean distance between its center coordinates and the center coordinates of its anchor device. Summing the distances from all member devices to their respective anchor devices and normalizing the result gives the cost. ; This represents the distance cost from the device to the relevant target pin, target mounting point, or target pin side. For example, for any member device, calculate the Euclidean distance between its pin position and the target pin position to be connected. Summing up the pin distances of all member devices and normalizing the result gives the cost. ; This represents the cost of the deviation of the spacing between adjacent devices on the same contour side from the target spacing. For example, for any side of any functional module, determine the arrangement order of each member device along the tangential direction, calculate the square of the difference between the actual spacing of two adjacent member devices and the preset target spacing, sum the spacing deviations of all adjacent pairs and normalize them to obtain the target spacing. ; This represents the cost of soft constraints such as anchor point edge spacing, soft geometry rules, symmetry, or prohibition of side-by-side relationships. For example, for any member device or any pair of member devices, it checks whether their current placement position and angle violate various soft geometry rules. Each violation is recorded as a unit penalty. The cost of all violation penalties is obtained by weighting and summing them according to their severity and then normalizing the result. ; This represents the cost of repulsion between devices within the safety clearance warning area, and is used to measure the risk of devices being too close together in a layout scheme. , , , and These are the optimization weights for the corresponding objective items; This is the repulsion strength coefficient.
[0309] When estimating the length of the connecting lines, a half-circumference length estimation method can be used. Specifically, for network n, its relevant pin coordinate set is as follows: , where m is the number of pins in the network.
[0310] The formula for estimating the length of a semi-perimeter is:
[0311]
[0312] in, Represents network The half-perimeter of the line is the sum of the width and height of the smallest rectangle that encloses all the pins of the network. and These represent the pins respectively. The maximum and minimum values of the coordinates; and These represent the pins respectively. The maximum and minimum values of the coordinates. The smaller the semi-circle length, the more concentrated the pins of the network, and the shorter the actual trace length.
[0313] The exclusion cost can be exemplarily represented as:
[0314]
[0315] in, Indicator device With devices The minimum spacing between the outlines of the no-clothing zones, This indicates the preset safety distance threshold.
[0316] It should be understood that when ≥ hour, =0, no exclusionary cost is incurred; when < At that time, the rejection cost increases quadratically with the degree of insufficient spacing; the more severe the insufficient spacing, the greater the rejection cost.
[0317] It should be understood that unacceptable situations such as geometric overlap are still directly prohibited through hard constraints, rather than simply relying on exclusion costs. That is, the prohibition of overlap between devices is a hard condition that must be met, and exclusion costs are only used to guide devices to maintain a reasonable distance within the safety clearance warning area, rather than allowing overlap to occur.
[0318] Solving the objective optimization function based on multiple preset constraints means minimizing the objective optimization function while satisfying all preset constraints, so that the final combination of target placement positions can minimize the value of the objective optimization function while satisfying all constraints.
[0319] Specifically, the solution process can be implemented using a constraint programming solver. The solver uses the candidate positions of each component as decision variables, multiple preset constraints as constraint boundaries, and an objective function as the optimization objective, searching for the optimal solution through algorithms such as branch and bound and constraint propagation.
[0320] It should be understood that among multiple preset constraints, "each member device selects only one candidate position" means that each member device can only select one position from its own set of candidate placement positions and cannot occupy multiple candidate positions at the same time; "a candidate position is occupied by only one member device" means that the same candidate position can be selected by at most one member device and cannot be occupied by multiple member devices at the same time, so as to ensure that there will be no position conflict between devices.
[0321] For example, if two member devices have the same candidate position in their candidate position sets, then at most one member device can choose that candidate position during optimization, and the other member device must choose another candidate position.
[0322] In this embodiment, during the operation, spatial constraints first define the feasible region, and the objective optimization function then uniformly evaluates the candidate positions within the feasible region. Constraints further restrict the uniqueness of the solution results, ultimately yielding preliminary placement results that satisfy the requirements of module boundaries, device spacing, and occupancy relationships. Using this method, the generation of candidate positions for member devices and the selection of target positions can be completed within the same constraint framework. The resulting preliminary placement scheme exhibits good positional consistency and occupancy uniqueness, providing stable input for subsequent layout optimization.
[0323] S207. Optimize the preliminary placement plan to obtain the final placement plan.
[0324] Optimizing the preliminary placement scheme may include: based on the preliminary placement scheme obtained in step S205, further improving the scheme quality through local adjustments and multi-stage adjustments, so as to eliminate possible local defects in the preliminary scheme and obtain a final placement scheme that meets all constraints.
[0325] It should be understood that the preliminary placement scheme is a globally optimal solution obtained through constrained programming in a discrete candidate location space. However, since the candidate location space is discretely sampled, the preliminary scheme may have room for further optimization in local details. At the same time, each functional module solves independently in its own temporary coordinate system, which may lead to collisions or insufficient spacing between modules after being spliced into the overall coordinate system.
[0326] In one possible implementation, the preliminary placement scheme is optimized to obtain the final placement scheme, including: optimizing the preliminary placement scheme using a local iterative adjustment strategy to obtain an optimized placement scheme; and adjusting the position of the device using a multi-stage adjustment method based on the optimized placement scheme to obtain the final placement scheme.
[0327] Among them, the local iterative adjustment strategy refers to iteratively improving the initial scheme by local operations such as device movement and / or device exchange within the neighborhood space of the initial placement scheme, so as to reduce the value of the objective optimization function.
[0328] The neighborhood space refers to the set of all candidate placement schemes that can be reached from the current placement scheme through a single local operation (i.e., moving a candidate position of a single device or exchanging the candidate positions of two devices).
[0329] Specifically, device movement refers to moving a member device from its current candidate position to another candidate position in its set of candidate placement positions; device swapping refers to exchanging the current candidate positions of two member devices.
[0330] For example, local iterative adjustments can employ a greedy strategy, whereby each time a local operation is selected that maximizes the decrease in the value of the target optimization function, until no further decrease in the value of the target function can be achieved through any local operation or the preset maximum number of iterations is reached.
[0331] It should be understood that during local iterative adjustments, for each device movement or device exchange operation, it is necessary to determine whether the operation should be accepted.
[0332] Specifically, let the current layout be... A new layout is obtained after moving or swapping. If the objective function satisfies:
[0333]
[0334] Then accept the local adjustment, that is .
[0335] Here, F() represents the objective function. It should be understood that this acceptance criterion employs a greedy strategy: only local adjustments that decrease the objective function value are accepted, ensuring that the quality of the layout improves with each iteration. If the objective function value does not decrease after adjustment, the adjustment is abandoned, and the current layout remains unchanged.
[0336] Specifically, for any local adjustment operation, the current layout state needs to be updated after the adjustment is accepted, and subsequent iterations are performed based on the updated state. If, in a certain iteration, traversing all device moves and device swaps fails to reduce the objective function value, the local iterative adjustment strategy terminates prematurely, and the current layout is output as the optimized placement scheme.
[0337] Multi-stage adjustment refers to adjusting the position of the optimized placement scheme in multiple stages after the local iterative adjustment is completed, in order to deal with possible collisions or insufficient spacing between modules.
[0338] Specifically, the multi-stage adjustment includes a coordinate transformation stage, a repulsive force relaxation stage, a global scan adjustment stage, and a compaction processing stage.
[0339] In this embodiment, by performing local iterative adjustments of device movement and / or device swapping within the neighborhood of the initial placement scheme, the value of the objective optimization function can be continuously reduced without violating preset constraints, thereby improving the quality of the placement scheme. Furthermore, by performing optimization after the local iterative adjustments and then further adjusting the optimized scheme in multiple stages, the quality and stability of the placement scheme are improved.
[0340] In one possible implementation, based on the initial placement scheme, a local iterative adjustment strategy is used to optimize the initial placement scheme to obtain an optimized placement scheme. This includes: dividing the initial placement scheme into multiple initial sub-placement schemes and determining the cost corresponding to each initial sub-placement scheme; performing local adjustments on each initial sub-placement scheme by means of device movement and / or device swapping to obtain adjusted sub-placement schemes and calculating the cost corresponding to each adjusted sub-placement scheme; in response to the cost corresponding to the adjusted sub-placement scheme being less than the cost corresponding to the initial sub-placement scheme, determining the adjusted sub-placement scheme as the optimized sub-placement scheme, and determining the optimized placement scheme based on each optimized sub-placement scheme; in response to the cost corresponding to the adjusted sub-placement scheme being greater than or equal to the cost corresponding to the initial sub-placement scheme, returning to the step of performing local adjustments on each initial sub-placement scheme by means of device movement and / or device swapping, until a preset maximum number of iterations is reached.
[0341] The process of dividing the preliminary placement scheme involves breaking it down into functional modules, with each functional module's component placement information constituting a preliminary sub-placement scheme. Each preliminary sub-placement scheme corresponds to the component placement layout within a functional module.
[0342] For example, if the target circuit includes three functional modules: a main control module, an RF module, and a power supply module, the initial placement scheme is divided into three initial sub-placement schemes, each corresponding to the device placement scheme within each functional module.
[0343] In this context, determining the cost corresponding to each preliminary sub-placement scheme means using the objective optimization function in step S205 to calculate the objective optimization function value corresponding to each preliminary sub-placement scheme, which is then used as the cost of that sub-placement scheme.
[0344] Specifically, when making local adjustments to each preliminary sub-placement scheme, it is done within the candidate position space corresponding to the functional module. The adjustment range is the set of candidate positions of the devices inside the module, and the devices will not be moved across modules.
[0345] It should be understood that if the cost of the adjusted sub-placement scheme is less than the cost of the initial sub-placement scheme, it means that the local adjustment has improved the quality of the scheme, and therefore the adjustment should be accepted; otherwise, if the cost does not decrease, the adjustment should be abandoned and the original scheme should be maintained.
[0346] For example, the preset maximum number of iteration rounds can be set to 8 rounds. After reaching the preset maximum number of iteration rounds, the local iterative adjustment strategy terminates, and the current optimized placement scheme is output.
[0347] In this embodiment, the initial placement scheme can be divided according to functional module boundaries, device density distribution, or layout grid cells, so that each initial sub-placement scheme contains only adjacent or highly related device sets. During local adjustments, the PCB device layout optimization device reads the device coordinates, orientation, pad spacing, and constraint boundaries of the current sub-scheme, generates movable candidate positions or exchangeable candidate pairs, and calculates the difference before and after adjustment based on the cost function. When the cost is reduced after adjustment, the adjustment result is written into the optimized sub-placement scheme; otherwise, the original scheme is retained and the next round of movement or exchange combinations is explored. After the optimized sub-placement scheme is output, it is then spliced or merged into a complete optimized placement scheme. This method allows the layout optimization to focus on local high-cost areas, enabling the correction of the initial placement results within a limited number of iterations while maintaining the stability of the global placement structure.
[0348] In one possible implementation, based on the optimized placement scheme, a multi-stage adjustment method is used to adjust the position of the components to obtain the final placement scheme. This includes: converting the coordinates of each component in the optimized placement scheme to coordinates in the PCB coordinate system; in the first stage, determining the first functional modules with overlapping or insufficient distance based on the coordinates in the PCB coordinate system, calculating the repulsive force between the first functional modules, and updating the position of the first functional modules based on the repulsive force; in the second stage, traversing all functional modules and performing global relaxation adjustment on the second functional modules with collisions or insufficient distance to ensure that all functional modules are collision-free and the distance meets the requirements; in the third stage, under the condition of no collisions and sufficient distance, compacting the components for any functional module.
[0349] In this context, converting the coordinates of each component in the optimized placement scheme to coordinates in the PCB coordinate system means converting the component position coordinates in the temporary coordinate system of the functional module in the optimized placement scheme to the actual coordinates in the PCB coordinate system through inverse coordinate mapping.
[0350] Specifically, let the transformation method from the actual printed circuit board (PCB) coordinate system to the temporary coordinate system be as follows: (Including translation and rotation transformations), then for a point in the temporary coordinates... Its true coordinates can be represented as:
[0351]
[0352] in, This represents the inverse coordinate transformation, which is the inverse transformation operation from the local temporary coordinate system of a functional module to the global real coordinate system of the entire PCB.
[0353] It should be understood that in steps S204 and S205, each functional module independently generates candidate positions and solves placement schemes in its own temporary coordinate system, and the origin position and orientation of the coordinate system of each module may be different. Through the above inverse coordinate transformation, the device positions of all functional modules can be uniformly transformed to the global coordinate system of the entire PCB board, which facilitates subsequent collision detection and position adjustment between modules.
[0354] The criteria for determining overlap or distance discrepancies in the first stage are as follows: if the occupied areas of two functional modules intersect, they are considered to be overlapping; if the minimum distance between the occupied areas of two functional modules is less than the preset safe distance threshold, they are considered to be not meeting the distance requirements.
[0355] For example, when performing collision detection between modules, let the actual occupied areas of the two functional modules be respectively... and If the following conditions are met:
[0356]
[0357] If the occupied areas of two modules overlap, they are considered to have overlapped or collided.
[0358] If safety distance is considered The module area can be expanded before testing:
[0359]
[0360] Therefore, it is considered that the distance between the two is insufficient.
[0361] in, This represents the region (i.e., the expanded region or safety restricted area) obtained by expanding outward by a distance d based on the outline of functional module M.
[0362] It should be understood that when the outer expansion areas of two modules overlap, it indicates that the actual distance between the two modules is less than the preset safe spacing threshold, requiring separation and adjustment. By considering collision detection for safe spacing, safe gaps between components can be reserved in advance during the layout optimization stage, avoiding insufficient spacing problems in subsequent manufacturing.
[0363] Specifically, repulsive force refers to the force exerted on two functional modules along the line connecting their centers, causing them to move away from each other when there is overlap or insufficient spacing between them. The magnitude of the repulsive force is directly proportional to the degree of overlap or insufficient spacing; the more severe the overlap or the less space there is, the greater the repulsive force.
[0364] For example, the repulsive force between two functional modules can be calculated based on the coordinates of their center points: the direction of the repulsive force is from the center of one module to the center of the other module, and the magnitude of the repulsive force is proportional to the difference between the center distance between the two modules and the safety distance threshold.
[0365] Specifically, for two functional modules that overlap or are too close together... and The repulsive force can be defined as follows:
[0366]
[0367] in, and These represent the coordinates of the center points of the two functional modules; This indicates the degree of overlap or insufficient distance between the two modules. When the two modules overlap, this value represents the overlap area or overlap depth. When the distance between the two modules is insufficient, this value represents the difference between the safe distance and the actual distance. k represents the repulsion strength coefficient, which is used to control the magnitude of the repulsion force.
[0368] For example, when two modules overlap, the overlap area can be obtained by calculating the area of the intersection of the two polygons; the overlap depth can be obtained by calculating the overlap width of the two polygon outlines in the horizontal direction and the overlap height in the vertical direction, and taking the larger of the two values as the overlap depth; or, along the direction of the line connecting the centers of the two modules, calculating the overlap length of the projection of the two outlines in that direction.
[0369] It should be understood that Indicates from module Center pointing module The vector at the center of the vector, divided by The unit direction vector is then obtained. The direction of the repulsive force is the direction that moves away from each other along the line connecting the centers of the two modules. The magnitude of the force is proportional to the degree of overlap or insufficient spacing—the more severe the overlap or insufficient spacing, the greater the repulsive force, thus effectively separating the conflicting modules.
[0370] Specifically, the module position update can be represented as:
[0371]
[0372] in, Indicates all modules Other conflicting functional modules The vector sum of the applied repulsive forces; This indicates the update step size, which controls the maximum movement distance in a single position update to prevent the module from oscillating due to excessive single-step movement; This indicates the center position of the updated module.
[0373] It should be understood that when updating the positions of functional modules based on repulsive forces, the relative positions of the components within each functional module remain unchanged, and the entire functional module moves as a rigid whole. Through iterative updates, each functional module gradually separates under the action of repulsive forces until all modules meet the safety clearance requirements.
[0374] It should be understood that when updating the position of a functional module based on repulsive forces, the relative positions of the internal components of each functional module remain unchanged, and the entire functional module moves as a rigid whole.
[0375] In the second stage, traversing all functional modules means checking each functional module in a preset order to see if there is a collision or insufficient distance between it and its surrounding modules.
[0376] Specifically, global relaxation adjustment refers to translating functional modules that are prone to collisions or have insufficient distance along their movable direction to a position that meets the safety clearance requirements. If the available space in a certain direction is insufficient, other directions are tried until a position that meets the requirements is found.
[0377] For example, global relaxation adjustment can first detect movable space along the horizontal direction; if the horizontal space is insufficient, it can then detect space along the vertical direction. By processing each module individually, all functional modules can ultimately meet the requirements for no collisions and sufficient spacing.
[0378] The third stage of device compaction refers to gradually shrinking the modules back to their original positions after each functional module has met the requirements for no collision and spacing, in order to eliminate the excess gaps generated in the second stage.
[0379] Specifically, the compaction process employs a gradual, trial-and-error approach. Specifically, for each functional module, a unit direction vector is calculated from its current position to its initial position in the first stage. The module then moves a preset step along this direction and checks for collisions. If no collision occurs, the move is accepted; otherwise, the module's compaction is stopped.
[0380] For example, the retraction step size can be set to 1 / 1000th of an inch (abbreviated as mil). Repeat the above retraction probing process until all functional modules can no longer retract; the resulting layout is the final placement scheme.
[0381] It should be understood that after the above three stages of adjustment, the final placement scheme achieves the most compact layout possible while meeting all preset constraints and safety distance requirements.
[0382] Figure 5 This illustration shows a collision resolution and compaction process based on the overall movement of a module, according to an embodiment of this application. Figure 5As shown, after merging the aforementioned functional modules (each with pre-arranged relative component layouts) into the global circuit board coordinate system, the PCB component layout optimization device first performs conflict detection on the spatial positions between the modules. When physical overlap is detected between different modules, or when the safety distance between module edges is insufficient, the entire module is displaced as an indivisible single unit, without disassembling the internal components. During this process, the PCB component layout optimization device applies a repulsive force to drive the interfering modules to translate as a whole in a specific direction to eliminate physical overlap and restore the minimum safety distance. At this stage, the module is strictly moved as a whole, while the relative positions of the internal components remain unchanged. After completing the conflict elimination process and obtaining the initial feasible layout of each module, large unnecessary blank areas may remain between the module assemblies. At this point, the PCB component layout optimization device will perform compaction processing, guiding the modules towards the layout center or reclaiming excess gaps while strictly maintaining collision-free operation and meeting safety distance constraints, to optimize the overall space utilization efficiency. Ultimately, the PCB component layout optimization device outputs a global layout result in which each functional module is arranged compactly without interference and the relative relationships of components within the module remain constant.
[0383] In this embodiment, the method first completes coordinate unification, and then sequentially performs local exclusion correction, global relaxation correction, and compaction convergence. This ensures that the layout eliminates conflicts before compressing space, making the final placement scheme more consistent with the board constraints. Since the three-stage processing corresponds to local conflicts, global residual conflicts, and spatial redundancy, the layout result satisfies the requirements of no collisions and distance, while also making the internal arrangement of modules more compact.
[0384] This application provides a PCB device layout optimization method. It obtains multiple anchor devices and multiple member devices in the target circuit to be laid out. A multi-level priority strategy is used to infer the functional modules to which each member device belongs, resulting in functional modules. Each functional module includes anchor devices and corresponding member devices. For any given functional module, prohibited placement areas for each device within that module are obtained. Multiple prohibited placement areas are then combined using polygon union to obtain an outer constraint contour. Based on this outer constraint contour, the method expands outward layer by layer from near to far to obtain multiple candidate placement areas. For each candidate placement area, candidate positions and placement angles for each member device are determined along multiple preset directions to obtain a candidate position set. Based on multiple preset constraints, target placement positions are selected for each member device from the candidate placement position set to obtain a preliminary placement scheme. This preliminary placement scheme is then optimized to obtain a final placement scheme. Based on these steps, this application significantly improves the utilization rate of layout space by employing a multi-level priority strategy for member device attribution inference, using polygon union and concentric shell expansion to generate candidate positions, and combining multi-constraint collaborative optimization to obtain the final placement scheme.
[0385] Figure 6 A flowchart illustrating another embodiment provided in this application, such as Figure 6 As shown, in this embodiment... Figure 2 Based on the embodiments, the layout optimization method for PCB devices provided in this application is described in detail using a 10-layer PCB mobile phone motherboard as an example. The method includes the following steps:
[0386] S601. Obtain multiple anchor devices and multiple member devices in the circuit of a 10-layer PCB mobile phone motherboard.
[0387] In this embodiment, a design data file exported from a PCB design tool is obtained. The design data file includes component information, pin information, network connection information, component outline bounding box information, keep-out area information, board outline information, and schematic page number or function path information.
[0388] For example, the input data is a PCB JSON (JavaScript Object Notation) file exported by the relevant software, which contains approximately 2,000 components, approximately 1,200 network connections, and design annotation information for multiple functional modules.
[0389] Specifically, multiple anchor devices and multiple member devices are identified and obtained from the design data file. Among them, anchor devices include the main control chip, connectors, RF front-end core devices, and power management core devices; member devices include resistors, capacitors, inductors, ferrite beads, diodes, surge protection devices, matching devices, and other passive devices that have an electrical relationship with the anchor devices.
[0390] It should be understood that while acquiring anchor point devices and member devices, exclusion devices are also acquired. Exclusion devices include marker points, test points, mechanical structural components, and devices that are constrained by fixed positions and do not participate in module aggregation, which are not directly related to the module layout.
[0391] In this embodiment, a rule configuration file is also loaded. The rule configuration file includes a set of ground network names, a set of power network names, a set of ignored network names, a high fan-out network threshold, and device classification rules.
[0392] For example, grounding network names include GND, AGND, and DGND; power network names include VBus and VDD; and ignored network names include NC or other networks that do not participate in module attribution inference.
[0393] The threshold for high fan-out networks is denoted as When the number of devices connected to a network is greater than When this occurs, the network is identified as a high fan-out network. High fan-out networks are generally not used as strong attribution evidence across pages, but can be used as weak attribution evidence within the same page to avoid over-clustering caused by common buses, clock networks, or other global networks. Since the number of components on the mobile phone motherboard in this embodiment is large, and there are multiple common networks across functional modules, the high fan-out network threshold is set to... =80.
[0394] S602. A multi-level priority strategy is used to reason about the functional modules to which each member device belongs, so as to obtain each functional module.
[0395] In this embodiment, the input components are first categorized according to rules, into anchor components, member components, and excluded components. Then, schematic page number information is recovered from PCB design data or diagnostic data. The PHYSICAL_PATH (physical path), LOGICAL_PATH (logical path), or other fields containing schematic page identifiers in the component attributes are parsed to obtain the schematic page number and logical path of the component. If the same macro component has logical references on multiple schematic pages, the set of logically overriding pages for that macro component is inferred based on the page number information and shared network relationships.
[0396] Specifically, for each device to be assigned, a reverse index from the network to the device is established, and module assignment reasoning is performed on a bipartite graph consisting of anchor devices, member devices, and network nodes. The evaluation information used for assignment reasoning includes the number of shared networks, network type, search path length, geometric distance between devices, the logic page where the device is located, anchor type priority, and schematic assignment hints.
[0397] In this embodiment, the attribution determination is performed according to the following hierarchical priority:
[0398] First priority: Evidence of attribution for devices directly connected to anchor points within the same logical page;
[0399] Second priority: Evidence of ownership of short passive chains formed by resistors, capacitors, inductors, ferrite beads or other passive devices within the same logical page;
[0400] Third priority: Anchor point attribution hints recovered from schematic diagnostic data;
[0401] Fourth priority: For functional shorting devices, evidence of attribution to the connector signal path; for grounding shorting devices, fallback evidence of attribution to the grounding network on the same page.
[0402] Fifth priority: Evidence of attribution formed by direct cross-page links or multiple network votes;
[0403] Sixth priority: Attribution evidence obtained by in-page limited or global multi-source weighted BFS (Breadth First Search) / Dijkstra's shortest path search;
[0404] Seventh priority: Weak attribution evidence on the same page formed by high fan-out networks.
[0405] It should be understood that the third, sixth, and seventh priorities are custom clustering priorities that are manually defined based on the actual situation and observed from the schematic diagram in this embodiment.
[0406] The multi-source weighted BFS / Dijkstra search starts simultaneously from multiple anchor devices and expands between network nodes and member device nodes. Different types of networks, cross-page jumps, and device chain depths correspond to different search costs, and anchor devices with lower cumulative search costs are preferentially selected as the assigned results.
[0407] For example, a passive resistor R125 establishes an electrical path with the main control chip U1 through capacitor C88 and functional shorting component SH12. Although there is no direct connection between R125 and U1, it can still be determined that R125 belongs to the main control module through passive chain tracing on the same page or multi-source weighted search.
[0408] For example, some connectors have shorting connections around them that connect to both the functional signal network and the ground network. When the functional signal path clearly points to the interface connector, it is preferentially assigned to the interface module; only when there is a lack of valid evidence of functional signal attribution is the ground network on the same page used as a fallback attribution, thereby reducing incorrect clustering caused by the ground network.
[0409] Based on the above attribution reasoning, approximately 2,000 components are divided into main control module, radio frequency module, power supply module, storage module, interface module, and several auxiliary modules. Each functional module includes anchor devices and corresponding member devices.
[0410] S603. For any functional module, obtain the prohibited placement areas of each device within the functional module, perform polygon union on multiple prohibited placement areas, and obtain the outer constraint contour.
[0411] In this embodiment, for each anchor point module, a polygon union operation is performed on the outline of the no-dispatch zone of one or more physical anchor point devices within the module to obtain a unified anchor point outline source.
[0412] Compared to using only the bounding rectangle as the contour source, the polygon union contour can more accurately preserve the geometric boundaries of irregular anchor point components, thereby reducing invalid candidate locations.
[0413] S604. Based on the outer constraint contour, expand outward layer by layer in order from near to far to obtain a multi-layer candidate placement area. For each layer of candidate placement area, determine the candidate position and placement angle of each member device along multiple preset directions to obtain a candidate position set.
[0414] With the first Taking a single component to be placed as an example, let its width and height in the current candidate orientation be respectively... and Its equivalent geometric radius is defined as:
[0415]
[0416] Assume the basic slot spacing is , No. The outer radius of the shell can be expressed as:
[0417]
[0418] in, This is the first-layer shell expansion coefficient, used to control the initial clearance between the first-layer candidate placement area and the outer constraint contour; This is the interlayer pitch coefficient, used to control the incremental distance between adjacent shell layers; It is the shell sequence number, and ≥1; The basic slot spacing.
[0419] In this embodiment, the following parameters are used: α=1.10, β=0.90, g=12 mil, and the number of shell layers is set to 4. α=1.10 is used to appropriately increase the clearance between the first-layer candidate slot and the anchor point outline; β=0.90 is used to moderately compress the outer shell pitch while maintaining a safe distance for the first layer, thus balancing layout compactness and candidate space coverage.
[0420] On each shell layer, the number of samples is dynamically determined based on the perimeter of the outer contour, the device projection size, and the candidate slot budget, and candidate center points are generated along the top, bottom, left, right, and corner regions of the contour. For devices that support Manhattan orientation, two candidate orientations, 0° and 90°, are generated; for devices with fixed orientation requirements, only candidate orientations that meet the orientation constraints are retained.
[0421] After candidate slots are generated, they are sorted and pruned according to the distance from the device to the anchor point, shell number, target pin direction, side of the candidate slot, keepout (prohibited placement area) feasibility, and candidate diversity. In this embodiment, each movable device retains a maximum of 32 candidate slots for entering the constraint solver.
[0422] S605. Based on multiple preset constraints, select a target placement location for each member device from the candidate placement location set corresponding to each member device to obtain a preliminary placement scheme.
[0423] In this embodiment, after the candidate slots are generated, a unified candidate placement view is constructed, and the device geometry information, candidate slot information, network connection information, fixed obstacle information and geometric rule information are merged into a discrete layout optimization problem to be solved.
[0424] The solution model includes the following hard constraints: each movable device must select one and only one candidate slot; the number of candidate slots used must not exceed its capacity; the selected device's no-go zone must not overlap with the fixed obstacle zone; the selected no-go zones of different devices must not have disallowed area overlap; device level, orientation, and special module rules must be satisfied; and prohibited side-by-side, prohibited parallelism, or other geometric relationships defined as hard rules must not be violated.
[0425] Based on satisfying the above hard constraints, construct the normalized objective function:
[0426]
[0427] This represents the normalized half-period length cost. Indicates the distance cost from the device to its anchor device or anchor profile; Indicates the distance cost from the device to the relevant target pin, target fixed point, or target pin side; This represents the cost of the spacing between adjacent devices on the same contour side deviating from the target spacing; This represents the cost of soft constraints such as anchor point edge spacing, soft geometric rules, symmetry, or prohibition of side-by-side relationships; This indicates the cost of repelling devices within the safety distance warning area; , , , and These are the optimization weights for the corresponding objective items; This is the repulsion strength coefficient.
[0428] The exclusion cost can be exemplarily represented as:
[0429]
[0430] in, Indicator device With devices The minimum spacing between the outlines of the no-clothing zones, This indicates the preset safety distance threshold.
[0431] It should be understood that when ≥ hour, =0, no exclusionary cost is incurred; when < At that time, the rejection cost increases quadratically with the degree of insufficient spacing; the more severe the insufficient spacing, the greater the rejection cost.
[0432] In this embodiment, the normalization optimization weights are set as follows: =1.00, =0.70, =0.85, =1.10, =1.30, repulsion strength coefficient k=8.0.
[0433] During the solution process, a constraint programming solver based on Boolean satisfiability is used to solve the discrete layout optimization problem and obtain a preliminary placement scheme.
[0434] S606. Optimize the preliminary placement plan to obtain the final placement plan.
[0435] In this embodiment, after obtaining a feasible solution, local movement and local swap operations are performed within the range of legal candidate slots. The local search is performed for a maximum of 8 rounds. In each round, incremental scoring is performed on the network, anchor distance, pin target, geometric rules, and keepout relationship affected by the movement of a single device or the swap of two devices, and candidate actions that can reduce the objective function value without violating hard constraints are selected.
[0436] After the internal layout of the module is solved, the layout result in the module's scatter coordinate system is inversely projected back to the actual board-level coordinate system of the PCB. During the inverse projection process, the relative positions between components within the same module remain unchanged, and conflicts are detected between the overall bounding boxes or keep-out contours of different modules.
[0437] When a geometric conflict between modules is detected, the following processes are executed in sequence:
[0438] The first stage is force relaxation. Based on the overlap direction and amount between modules, displacement increments in opposite directions are applied to the colliding modules, and the amplitude of each displacement is limited. The maximum single displacement step size in the force relaxation stage is set to 8 mil.
[0439] The second stage is residual collision scanning and processing. Collisions that still exist after force relaxation are processed one by one according to the predetermined module order, and one of the modules is moved to a position where there is no overlap.
[0440] The third stage is compaction. Without reintroducing collisions, the moved modules are gradually retracted back to their original positions or the layout center to reduce redundant gaps generated during the collision elimination process. The single retraction step size in the compaction stage is set to 1 mil. In this embodiment, the target clearance between modules is set to 1 mil.
[0441] Through the above steps, a final placement scheme that satisfies geometric rules, connection relationships, and engineering constraints is obtained.
[0442] It should be noted that, in order to improve the repeatability of parameter settings under different PCB scenarios, the parameters should be selected in the following order: target item normalization, hard constraint priority, representative module parameter tuning, and whole board verification.
[0443] First, HPWL (Half-Perimeter Wire Length), anchor distance, target pin distance, spacing cost, and geometric regularity cost are calculated on the initial layout or a set of baseline layouts, respectively. The baseline value, upper bound value, or historical statistical quantile of the corresponding objective item is used as the normalization scale. After normalization, each objective item is in a similar numerical range, avoiding the situation where a certain item dominates the entire objective function simply because its dimension or original value is large.
[0444] Secondly, with These are used as reference weights, and other weights are adjusted according to design goals. For general consumer electronics motherboards, the preferred value range can be:
[0445]
[0446]
[0447]
[0448]
[0449]
[0450] When high-speed signals, connector pin correspondence, or target pin orientation become more important, improve When the total length of the wiring is more important, increase... When manufacturability design constraints, device clearance, or rule fulfillment become more important, improve , or .
[0451] The preferred shell spread factor is from , Begin adjustments. For consumer electronics boards with high layout density, The preferred value is 1.05 to 1.20. The preferred value is 0.85–1.00; for industrial electronic boards or automotive electronic boards with high clearance requirements, Preferably, it is 1.15 to 1.35. The preferred value is 1.00 to 1.20.
[0452] If the proportion of candidates filtered out due to Keepout conflicts in the first-level candidate slots is too high, the increment can be increased by 0.05. When the outer candidate layer is too sparse and causes a significant increase in HPWL, it can be reduced in steps of 0.05. When insufficient safety clearance frequently occurs between candidate slots, it can be increased. or basic slot spacing .
[0453] Repulsion strength coefficient The optimal setting is 4 to 12. When there are still many device pairs close to the minimum safety spacing in the feasible layout, increasing... When the layout exhibits significant voids due to repulsion or the module area increases, the reduction... For ordinary mobile phone motherboards, 6 to 8 are preferred; for high-density connector boards or high-reliability electronic boards, 8 to 12 can be selected as the optimal values.
[0454] High fan-out network threshold The threshold can be determined based on the number of board-level components and the network fan-out distribution. Preferably, the high quantile of the network fan-out distribution can be used as the initial threshold, and then adjusted based on the cross-page assignment verification results. For complex motherboards with more than 1000 components, The value can be preferably set to 60-100; for interface boards with a small number of components but a dense connector network, The value can be preferably set to 16-40.
[0455] Finally, several representative main control modules, interface modules, power supply modules, and RF modules can be selected to conduct a small-scale grid search on candidate parameter combinations. When selecting parameters, infeasible solutions or solutions that violate hard rules are first eliminated. Then, among the parameter combinations that satisfy the design rules, the normalized HPWL, target pin distance, module area, number of spacing warnings, and solution time are comprehensively compared to determine the recommended parameters.
[0456] By adopting the method of this embodiment, the following technical effects can be achieved under the conditions of a 10-layer PCB mobile phone motherboard and approximately 2,000 components.
[0457] Firstly, it can significantly shorten the time required for module aggregation and preliminary layout. In the trial operation records of the research and development project, the module aggregation and preliminary layout work, which was originally done manually and usually took about one working day, can be completed in about 10 minutes after adopting the method of this embodiment, thereby improving the efficiency of pre-layout processing.
[0458] Secondly, it can improve the accuracy of cross-page module identification. By introducing electrical network topology awareness, schematic page number recovery, same-page passive chain search, connector functional path judgment, and multi-source weighted BFS / Dijkstra search, it can more accurately handle cross-page passive chains, high fan-out networks, and connector path scenarios, reducing erroneous clustering and missed assignments.
[0459] Third, it can improve the compactness of the layout. By adopting polygonal union contour source, concentric shell candidate slot generation, and CP-SAT and local search collaborative optimization, redundant gaps inside and between modules can be reduced while meeting the constraints of minimum spacing, routing targets, and geometric rules.
[0460] Fourth, it can improve the satisfaction of manufacturing constraints. By introducing target pin distance, target pin side, adjacent slot spacing, keepout hard constraints, and safety spacing exclusion mechanisms, it is possible to improve compliance with design for manufacturability while maintaining layout compactness and reducing the frequency of subsequent manual rework adjustments.
[0461] Fifth, it can balance optimization efficiency and result stability. The constraint programming solver based on Boolean satisfiability is used to obtain feasible or better solutions that satisfy hard constraints. Local moves and exchanges are used to further reduce the objective function, and module-level collision handling is used to eliminate residual conflicts after inverse projection, so that the layout results of different running batches have good stability and repeatability.
[0462] In the exemplary trial operation statistics of this embodiment, the half perimeter line length HPWL of the optimized layout can be reduced by about 10% to 25% compared with the initial layout, the number of module spacing violations or warnings can be reduced by more than 80%, and a feasible layout can be obtained within a preset solution time.
[0463] The above statistical results vary depending on the input board type, initial layout, rule configuration, and computing resources, and do not constitute a limitation on the technical effect or scope of protection of the present invention.
[0464] Figure 7 This is a flowchart illustrating another embodiment provided in this application. Figure 2 Based on the embodiments, the layout optimization method for PCB devices provided in this application is described in detail using an 8-layer high-density connector interface board as an example. The method includes the following steps:
[0465] S701. Obtain multiple anchor devices and multiple member devices from an 8-layer high-density connector interface board circuit.
[0466] In this embodiment, a design data file exported from a PCB design tool is obtained. The interface board includes approximately 650 components, including multiple board-to-board connectors, high-speed external interface connectors, interface control chips, electrostatic discharge protection devices, transient suppression devices, common-mode inductors, termination resistors, matching capacitors, decoupling capacitors, and other passive components.
[0467] Specifically, board-to-board connectors and high-speed external interface connectors are used as primary anchor devices, while interface control chips are used as main or auxiliary anchor devices. Electrostatic discharge (ESD) protection devices, transient suppression devices, common-mode inductors, termination resistors, matching devices, and decoupling devices that are directly or indirectly connected to the connector pins are used as member devices.
[0468] It should be understood that, compared with the mobile phone motherboard in the previous embodiment, the total number of board-level components in this embodiment is less, but the connector pin density is higher, the high-speed signal channels are concentrated, and the arrangement order of components on the connector target pin side and in the channel has a greater impact on the layout quality.
[0469] In this embodiment, a rule configuration file is loaded. A target pin fixing point is established for each connector pin or pin group, and the connector profile side where the target pin is located is recorded. For differential signals or related high-speed signals, the channel group identifier and the device order within the channel are recorded.
[0470] Because this embodiment has a small board-level scale and needs to be more sensitive in identifying public networks that may cause misattribution across interfaces, this embodiment sets the high fan-out network threshold to... =16. High fan-out networks are only used as evidence of weak attribution within the same page, and are not directly used as the primary basis for attribution across pages.
[0471] S702. A multi-level priority strategy is used to reason about the functional modules to which each member device belongs, so as to obtain each functional module.
[0472] In this embodiment, the same multi-level priority strategy as in the previous embodiments is used to perform attribution reasoning for each member device. Board-to-board connectors, high-speed external interface connectors, and interface control chips are used as anchor devices, while electrostatic discharge protection devices, transient suppression devices, common-mode inductors, termination resistors, matching devices, and decoupling devices are used as member devices for attribution reasoning.
[0473] Through attribution reasoning, approximately 650 components are divided into multiple connector interface functional modules, each of which includes anchor devices and corresponding member devices.
[0474] S703. For any functional module, obtain the prohibited placement areas of each device within the functional module, perform polygon union on multiple prohibited placement areas, and obtain the outer constraint contour.
[0475] In this embodiment, polygon union is performed on the keepout contours of multiple adjacent connectors, and an outer constraint contour is generated around the joint connector contour.
[0476] Compared to using only the circumscribed rectangle as the contour source, the polygon union contour can more accurately preserve the irregular geometric boundaries of multiple adjacent connector combinations, thus retaining more effective candidate slots on the connector pin side.
[0477] S704. Based on the outer constraint contour, expand outward layer by layer in order from near to far to obtain a multi-layer candidate placement area. For each layer of candidate placement area, determine the candidate position and placement angle of each member device along multiple preset directions to obtain a set of candidate positions.
[0478] Considering the high density of the connector interface board layout, and the need to maintain the coverage of the candidate slots on the connector pin side, this embodiment adopts the following shell parameters: α=1.05, β=0.85, g=8 mil, and the number of shells is set to 5.
[0479] The smaller α=1.05 and β=0.85 are beneficial for increasing the candidate slot density near the connector profile, concentrating more candidate positions on the side where the connector pins are located. Potential candidate slot overlap or insufficient safety clearance is filtered out by Keepout hard constraints and exclusion costs.
[0480] For each movable device, retain no more than 40 candidate slots. When the solution size is limited, reduce the number of candidate slots to 24–32, and prioritize candidate slots located on the target pin side, with a small target pin distance, and able to maintain channel continuity.
[0481] S705. Based on multiple preset constraints, select a target placement location for each member device from the candidate placement location set corresponding to each member device to obtain a preliminary placement scheme.
[0482] In this embodiment, the same normalized objective function as in Embodiment 1 is constructed. However, since the target pin orientation, channel spacing, and geometric regularity are of greater importance, the following optimization weights are adopted: = 0.90, = 0.50, =1.50, =1.40, =1.60, =10.0.
[0483] Among them, improving This allows for the preferential placement of ESD protection devices, common-mode inductors, termination resistors, and other components on the side where the relevant connector pins are located, while shortening the distance between them and the target pins. This improves... This can enhance the impact on the spacing and arrangement continuity between adjacent devices within the same high-speed channel. Improvement and It can reduce the probability of excessively small spacing or localized congestion around high-density connectors.
[0484] Optionally, for candidate slots that fall on the wrong connector side, a target-side mismatch penalty coefficient is also set. The target-side mismatch penalty coefficient is set to 3 times the target pin distance weight.
[0485] The solution model includes the following hard constraints: each movable device must select one and only one candidate slot; the number of candidate slots used must not exceed its capacity; the selected device's no-go zone must not overlap with the fixed obstacle zone; the selected no-go zones of different devices must not have disallowed area overlap; device level, orientation, and special module rules must be satisfied; and prohibited side-by-side, prohibited parallelism, or other geometric relationships defined as hard rules must not be violated.
[0486] Under the premise of satisfying the above hard constraints, a constraint programming solver based on Boolean satisfiability is used to solve the discrete layout optimization problem and obtain a preliminary placement scheme.
[0487] S706. Optimize the preliminary placement plan to obtain the final placement plan.
[0488] In this embodiment, after obtaining a feasible solution, local movement and local exchange operations are performed within the range of legal candidate slots. For protection devices, filtering devices, and termination devices associated with the same connector pin group, candidate slots located on the target pin side and continuously distributed along the signal propagation direction are preferentially selected. For differential signal-related devices, channel group constraints or adjacent spacing costs are used to prevent two differential channels from intersecting and to maintain the consistency of device arrangement within the channel.
[0489] After the internal layout of the module is solved, the layout result in the module's scatter coordinate system is back-projected back to the actual board-level coordinate system of the PCB. When geometric conflicts between modules are detected, three stages are executed in sequence: force relaxation processing, residual collision scanning processing, and compaction processing.
[0490] In this embodiment, the target clearance between modules is set to 1 mil, the maximum single displacement step size in the force relaxation stage is set to 8 mil, and the single retraction step size in the compaction stage is set to 1 mil.
[0491] Through the above steps, a final placement scheme that satisfies geometric rules, connection relationships, and engineering constraints is obtained.
[0492] By adopting the above parameters, connector-related components can be more concentrated on the corresponding target pin side, while local congestion is suppressed through higher spacing weights, geometric weights, and repulsion strength. Compared with the previous embodiments, this embodiment achieves higher candidate density with a smaller shell expansion factor, and ensures the layout quality of the high-speed interface area with higher target pin, channel spacing, and geometric regularity weights.
[0493] In this embodiment, the modular assembly of components, which originally required 16 hours of manual work, is reduced to 5 minutes using the method described in this embodiment, improving efficiency by more than 99%.
[0494] Figure 8 A schematic diagram of a PCB device layout optimization device provided in this application is shown below. Figure 8 As shown, this embodiment provides a PCB device layout optimization device 800, including: an acquisition module 801, an inference module 802, a first processing module 803, a second processing module 804, a third processing module 805, an optimization module 806, and a fourth processing module 807, wherein:
[0495] The acquisition module 801 is used to acquire the circuit board design data of the target circuit. The circuit board design data includes at least component information and network connection relationships between the pins of each component. Based on the circuit board design data, it acquires multiple anchor devices and multiple member devices in the target circuit to be laid out.
[0496] The reasoning module 802 is used to reason about the functional modules to which each member device belongs based on the network connection relationship between the anchor device and the member device, using a multi-level priority strategy, so as to obtain each functional module, each functional module including the anchor device and the corresponding member device.
[0497] The first processing module 803 is used to obtain the prohibited placement areas of each device in any functional module, and to perform polygonal union on multiple prohibited placement areas to obtain the outer constraint contour; the outer constraint contour is a polygon.
[0498] The second processing module 804 is used to expand outward layer by layer from near to far based on the outer constraint contour to obtain a multi-layer candidate placement area. For each layer of candidate placement area, the candidate position and placement angle of each member device are determined along multiple preset directions to obtain a set of candidate positions.
[0499] The third processing module 805 is used to select a target placement position for each member device from the set of candidate placement positions corresponding to each member device based on multiple preset constraints, so as to obtain a preliminary placement scheme.
[0500] The optimization module 806 is used to optimize the initial placement plan to obtain the final placement plan.
[0501] In one possible implementation, when the second processing module 804 determines the candidate position and placement angle of each member device along multiple preset directions for each candidate placement area to obtain a candidate position set, it specifically performs sampling along multiple preset directions near the boundary of any candidate placement area to obtain the candidate center point corresponding to each direction; the multiple preset directions include up, down, left, and right directions; determines the tangential interval between adjacent candidate center points in the same candidate placement area according to the size of the member device and the preset safety distance; determines the candidate position corresponding to the member device based on each candidate center point and the corresponding tangential interval; determines the placement angle according to the coordinate difference between the pin of the member device and the pin of the target connection component, where the target connection component is an anchor device or other member device that has an electrical connection with the member device; and determines the corresponding candidate position set according to the candidate position and placement angle of each member device.
[0502] In one possible implementation, when the second processing module 804 determines the placement angle based on the coordinate difference between the member device pin and the target connection component pin, it specifically determines the placement angle as a first preset angle if the coordinate difference in the horizontal direction is greater than the coordinate difference in the vertical direction; and determines the placement angle as a second preset angle if the coordinate difference in the vertical direction is greater than the coordinate difference in the horizontal direction.
[0503] In one possible implementation, the second processing module 804 is further configured to, in response to the fact that the number of candidate placement positions in the candidate placement position set of any member device is greater than a preset number threshold, filter a preset number of target candidate placement positions and the corresponding target placement angles.
[0504] In one possible implementation, the second processing module 804 is further configured to determine the corresponding candidate position set based on the target candidate position and the corresponding target placement angle of each member device.
[0505] In one possible implementation, when the inference module 802 infers the functional modules to which each member device belongs based on the network connection relationship between the anchor device and the member device using a multi-level priority strategy to obtain each functional module, it specifically obtains the network connection relationship between each anchor device and each member device; uses a multi-level priority strategy and determines at least one candidate anchor device corresponding to each member device based on the network connection relationship; for any member device, if there are multiple candidate anchor devices, calculates the affiliation score corresponding to each candidate anchor device according to multiple preset dimension parameters; and determines the target anchor device corresponding to the member device from each candidate anchor device based on each affiliation score to obtain the functional module.
[0506] In one possible implementation, when the inference module 802 adopts a multi-level priority strategy and determines at least one candidate anchor device corresponding to each member device based on network connection relationships, it is specifically used to determine, for the first member device, whether there is a first candidate anchor device on the same page as the member device and having a direct network connection relationship, according to the first priority strategy; the first member device can be any member device; for the second member device where there is no first candidate anchor device, it is used to determine, according to the second priority strategy, whether there is a second candidate anchor device on the same page as the second member device and having a network connection relationship lower than a preset level; for the third member device where there is no second candidate anchor device... For a third member device, if the third member device is a preset type device, then the third candidate anchor device is determined according to the third priority strategy and based on the functional path and connection direction of the third member device. For a fourth member device that does not have a third candidate anchor device, the existence of a fourth candidate anchor device is determined according to the fourth priority strategy and based on the reference network where the fourth member device and the anchor point are located or the page information where the fourth member device is located. For a fifth member device that does not have a fourth candidate anchor device, if the fifth member device does not have a candidate anchor device on the same page, then the fifth candidate anchor device is searched in the global network topology across pages according to the fifth priority strategy and using the multi-source shortest path search algorithm.
[0507] In one possible implementation, the preset dimension parameters include: the topological connection strength between devices, the distance between devices, the relationship between the pages where the devices are located, and the priority of the candidate anchor device type. Accordingly, when the inference module 802 calculates the attribution score corresponding to each candidate anchor device according to multiple preset dimension parameters, it specifically obtains each dimension parameter and its corresponding weight for any candidate anchor device; and performs a weighted summation of each dimension parameter according to its weight to obtain the attribution score of the corresponding candidate anchor device.
[0508] In one possible implementation, when the inference module 802 determines the target anchor device corresponding to the member device from each candidate anchor device based on each attribution score, it is specifically used to determine the candidate anchor device with the highest attribution score as the target anchor device corresponding to the member device.
[0509] In one possible implementation, when the third processing module 805 selects a target placement position for each member device from a set of candidate placement positions corresponding to each member device based on multiple preset constraints to obtain a preliminary placement scheme, specifically for any functional module, based on preset spatial constraints, it determines the corresponding set of candidate placement positions for the member devices in the functional module; obtains a pre-constructed target optimization function, which includes multiple dimensional cost parameters; and solves the target optimization function based on multiple preset constraints to obtain the target placement positions corresponding to each member device, thereby obtaining a preliminary placement scheme; wherein the multiple preset constraints include: spatial constraints and allocation constraints.
[0510] In one possible implementation, when optimizing the preliminary placement scheme to obtain the final placement scheme, the optimization module 806 is specifically used to optimize the preliminary placement scheme by adopting a local iterative adjustment strategy to obtain an optimized placement scheme; and based on the optimized placement scheme, to adjust the position of the device by adopting a multi-stage adjustment method to obtain the final placement scheme.
[0511] In one possible implementation, the optimization module 806 optimizes the initial placement scheme using a local iterative adjustment strategy to obtain an optimized placement scheme. Specifically, it divides the initial placement scheme into multiple initial sub-placement schemes and determines the cost corresponding to each initial sub-placement scheme. For each initial sub-placement scheme, it performs local adjustments by moving and / or exchanging devices to obtain adjusted sub-placement schemes and calculates the cost corresponding to each adjusted sub-placement scheme. In response to a situation where the cost of an adjusted sub-placement scheme is less than the cost of an initial sub-placement scheme, the adjusted sub-placement scheme is identified as an optimized sub-placement scheme, and an optimized placement scheme is determined based on each optimized sub-placement scheme. In response to a situation where the cost of an adjusted sub-placement scheme is greater than or equal to the cost of an initial sub-placement scheme, it returns to the step of performing local adjustments by moving and / or exchanging devices for each initial sub-placement scheme until a preset maximum number of iterations is reached.
[0512] In one possible implementation, the optimization module 806, based on the optimized placement scheme, uses a multi-stage adjustment method to adjust the position of the components to obtain the final placement scheme. Specifically, it converts the coordinates of each component in the optimized placement scheme into coordinates in the PCB coordinate system. In the first stage, based on the coordinates in the PCB coordinate system, it identifies the first functional modules that overlap or whose distance does not meet the requirements, calculates the repulsive force between the first functional modules, and updates the position of the first functional modules based on the repulsive force. In the second stage, it traverses all functional modules and performs global relaxation adjustment on the second functional modules that have collisions or whose distance does not meet the requirements, so that all functional modules have no collisions and the distance meets the requirements. In the third stage, under the condition that there are no collisions and the distance meets the requirements, it performs compaction processing on any functional module.
[0513] This embodiment provides a PCB device layout optimization device that can execute the method provided in the above-described method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0514] Figure 9 A schematic diagram of the structure of the electronic device provided in this application. Figure 9 As shown, the electronic device 900 provided in this embodiment includes at least one processor 901 and a memory 902. Optionally, the device 900 further includes a communication component 903. The processor 901, memory 902, and communication component 903 are connected via a bus 904.
[0515] In a specific implementation, at least one processor 901 executes computer execution instructions stored in memory 902, causing at least one processor 901 to perform the above-described method.
[0516] The specific implementation process of processor 901 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0517] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0518] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0519] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0520] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0521] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0522] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0523] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0524] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0525] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0526] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0527] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0528] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0529] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for optimizing the layout of PCB components, characterized in that, include: Obtain the circuit board design data of the target circuit, wherein the circuit board design data includes at least component information and network connection relationships between the pins of each component; Based on the circuit board design data, obtain multiple anchor point devices and multiple member devices in the target circuit to be laid out. Based on the network connection relationship between the anchor device and the member device, a multi-level priority strategy is used to reason about the functional module to which each member device belongs, so as to obtain each functional module, each functional module including the anchor device and the corresponding member device. For any functional module, obtain the prohibited placement area of each device within the functional module, and perform polygon union on multiple prohibited placement areas to obtain the outer constraint contour. The outer constraint contour is a polygon; Based on the aforementioned peripheral constraint contour, the system expands outward layer by layer in order from near to far to obtain multiple candidate placement areas. For each candidate placement area, the candidate positions and placement angles of each member device are determined along multiple preset directions to obtain a set of candidate positions. Based on multiple preset constraints, a target placement location is selected for each member device from the set of candidate placement locations corresponding to each member device to obtain a preliminary placement scheme. The initial placement scheme is optimized to obtain the final placement scheme.
2. The method according to claim 1, characterized in that, For each candidate placement area, the candidate positions and placement angles of each member device are determined along multiple preset directions to obtain a set of candidate positions, including: For any candidate placement area in any layer, sampling is performed near the boundary of the candidate placement area along multiple preset directions to obtain the candidate center point corresponding to each direction; the multiple preset directions include the up, down, left and right directions; Based on the size of the member device and the preset safety distance, the tangential interval between adjacent candidate center points in the same layer candidate placement area is determined; Based on each candidate center point and the corresponding tangential interval, the candidate positions of the member devices are determined. The placement angle is determined based on the coordinate difference between the pins of the member device and the pins of the target connection component, wherein the target connection component is an anchor device or other member device that has an electrical connection with the member device; The corresponding set of candidate positions is determined based on the candidate positions of each member device and the placement angle.
3. The method according to claim 2, characterized in that, Determining the placement angle based on the coordinate difference between the member device pin and the target connection component pin includes: If the coordinate difference is greater in the horizontal direction than in the vertical direction, then the placement angle is determined to be the first preset angle. If the value of the coordinate difference in the vertical direction is greater than the value in the horizontal direction, then the placement angle is determined to be the second preset angle.
4. The method according to claim 2, characterized in that, Before determining the corresponding candidate position set based on the candidate positions of each member device and the placement angle, the method further includes: In response to the fact that the number of candidate placement positions in the candidate placement position set of any member device is greater than a preset number threshold, a preset number of target candidate placement positions and corresponding target placement angles are filtered. The step of determining the corresponding candidate position set based on the candidate positions of each member device and the placement angle includes: The corresponding candidate position set is determined based on the target candidate position and the corresponding target placement angle of each member device.
5. The method according to claim 1, characterized in that, The step involves reasoning about the functional modules to which each member device belongs based on the network connection relationship between the anchor device and the member devices, using a multi-level priority strategy, to obtain each functional module, including: A multi-level priority strategy is adopted, and at least one candidate anchor device is determined for each member device based on the network connection relationship. For any member device, if there are multiple candidate anchor devices, the affiliation score corresponding to each candidate anchor device is calculated according to multiple preset dimension parameters. Based on each attribution score, the target anchor device corresponding to the member device is determined from each of the candidate anchor devices to obtain the functional module.
6. The method according to claim 5, characterized in that, The step of employing a multi-level priority strategy and determining at least one candidate anchor device corresponding to each member device based on the network connection relationship includes: For the first member device, a first candidate anchor device with a direct network connection to the member device is determined according to a first priority strategy; the first member device can be any member device. For a second member device that does not have a first candidate anchor device, determine whether there is a second candidate anchor device that is on the same page as the second member device and has a network connection relationship with a lower than a preset level according to the second priority strategy; For a third member device that does not have a second candidate anchor device, if the third member device is a preset type device, then the third candidate anchor device is determined according to the third priority strategy and the functional path and connection direction of the third member device. For a fourth member device that does not have a third candidate anchor device, the existence of a fourth candidate anchor device is determined according to the fourth priority strategy and based on the reference network where the fourth member device and the anchor point are located or the page information where the fourth member device is located. For a fifth member device that does not have a fourth candidate anchor device, if the fifth member device does not have a candidate anchor device on the same page, then according to the fifth priority strategy and using the multi-source shortest path search algorithm, the fifth candidate anchor device is searched in the global network topology across pages.
7. The method according to claim 5, characterized in that, Preset dimension parameters include: topological connection strength between devices, distance between devices, relationship between the pages where the devices are located, and priority of candidate anchor point device types; The calculation of the attribution score corresponding to each candidate anchor device according to multiple preset dimension parameters includes: For any candidate anchor device, obtain the parameters of each dimension and the corresponding weights; The parameters of each dimension are weighted and summed according to their weights to obtain the belonging score of the corresponding candidate anchor device.
8. The method according to claim 5, characterized in that, The step of determining the target anchor device corresponding to the member device from each candidate anchor device based on each attribution score includes: The candidate anchor device with the highest affiliation score is determined as the target anchor device corresponding to the member device.
9. The method according to claim 1, characterized in that, The process of selecting a target placement location for each member device from a set of candidate placement locations corresponding to each member device based on multiple preset constraints to obtain a preliminary placement scheme includes: For any given functional module, based on preset spatial constraints, a set of candidate placement locations is determined for the member devices within that functional module. Obtain a pre-constructed target optimization function, which includes multiple dimensional cost parameters; The target optimization function is solved based on multiple preset constraints to obtain the target placement positions of each member device, thereby obtaining a preliminary placement scheme. Among them, several preset constraints include: spatial constraints and allocation constraints.
10. The method according to claim 1, characterized in that, The optimization of the preliminary placement scheme to obtain the final placement scheme includes: Based on the initial placement plan, a local iterative adjustment strategy is used to optimize the initial placement plan to obtain an optimized placement plan; Based on the optimized placement scheme, the positions of the components are adjusted in a multi-stage manner to obtain the final placement scheme.
11. The method according to claim 10, characterized in that, The step involves optimizing the initial placement scheme using a local iterative adjustment strategy to obtain an optimized placement scheme, based on the initial placement scheme. This includes: The initial placement scheme is divided into multiple initial sub-placement schemes, and the cost corresponding to each initial sub-placement scheme is determined. For each preliminary sub-placement scheme, local adjustments are made by moving and / or exchanging devices to obtain each adjusted sub-placement scheme, and the cost corresponding to each adjusted sub-placement scheme is calculated. In response to the fact that the cost of the adjusted sub-placement scheme is less than the cost of the initial sub-placement scheme, the adjusted sub-placement scheme is determined as the optimized sub-placement scheme, and the optimized placement scheme is determined based on each optimized sub-placement scheme. If the cost of the adjusted sub-placement scheme is greater than or equal to the cost of the initial sub-placement scheme, return to the step of making local adjustments to each initial sub-placement scheme by means of device movement and / or device exchange, until the preset maximum number of iterations is reached.
12. The method according to claim 10, characterized in that, Based on the optimized placement scheme, the device positions are adjusted using a multi-stage adjustment method to obtain the final placement scheme, including: The coordinates of each device in the optimized placement scheme are converted to coordinates in the PCB coordinate system; In the first stage, based on the coordinates in the PCB coordinate system, the first functional module with overlapping or distance not meeting the requirements is determined, and the repulsive force between the first functional modules is calculated, and the position of the first functional module is updated based on the repulsive force. In the second stage, all functional modules are traversed, and the second functional modules that have collisions or whose distance does not meet the requirements are globally relaxed and adjusted so that all functional modules have no collisions and the distance meets the requirements. In the third stage, under the premise of meeting the requirements of no collision and sufficient distance, the device is compacted for any functional module.
13. A layout optimization device for PCB components, characterized in that, include: The acquisition module is used to acquire the circuit board design data of the target circuit, wherein the circuit board design data includes at least component information and network connection relationships between the pins of each component; Based on the circuit board design data, obtain multiple anchor point devices and multiple member devices in the target circuit to be laid out. The reasoning module is used to reason about the functional modules to which each member device belongs based on the network connection relationship between the anchor device and the member device, using a multi-level priority strategy, so as to obtain each functional module, each functional module including the anchor device and the corresponding member device. The first processing module is used to obtain the prohibited placement area of each device in any functional module, and to perform polygonal union on multiple prohibited placement areas to obtain the outer constraint contour. The outer constraint contour is a polygon; The second processing module is used to expand outward layer by layer based on the outer constraint contour in order from near to far to obtain a multi-layer candidate placement area. For each layer of candidate placement area, the module determines the candidate position and placement angle of each member device along multiple preset directions to obtain a set of candidate positions. The third processing module is used to select a target placement position for each member device from the set of candidate placement positions corresponding to each member device based on multiple preset constraints, so as to obtain a preliminary placement scheme. An optimization module is used to optimize the initial placement scheme to obtain a final placement scheme.
14. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 12.
16. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 12.
