Circuit layout wire segment linkage adjustment method and device, medium and equipment
By identifying intersection points and locating parallel related line segments in the circuit layout design, the automatic adjustment of the linked movement of related line segments is achieved when moving line segments. This solves the problem of low routing efficiency caused by manual adjustment of related line segments in the prior art and improves design efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ORIGIN QUANTUM INSTR CO
- Filing Date
- 2024-11-22
- Publication Date
- 2026-05-29
AI Technical Summary
In existing circuit layout designs, moving trace segments requires manual adjustment of associated segments, resulting in low routing efficiency. Existing software cannot automatically achieve coordinated movement of associated segments.
A method for linking and adjusting trace segments in a circuit layout is provided. By determining whether the target trace segment intersects with the extensions of its adjacent trace segments, the method finds the parallel and closest related trace segment and keeps the slope and connection relationship of the adjacent trace segments unchanged, thereby moving the normal of the related trace segment until its length becomes zero or the interval is a preset distance.
It improves layout routing efficiency, enables automatic adjustment of the linked movement of related line segments when moving line segments, maintains a fixed line spacing between line segments, and improves design efficiency.
Smart Images

Figure CN122113813A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of circuit layout design, and in particular to a method, apparatus, medium, and device for the coordinated adjustment of trace segments in a circuit layout. Background Technology
[0002] In circuit layout design, after drawing the layout graphics of components, pads, and other circuit entities, traces need to be arranged between the connection points of each layout graphic to represent the circuit connection relationship. Existing routing methods include manual routing and automatic routing. Manual routing is done by designers manually, while automatic routing is performed automatically by software according to pre-set routing rules.
[0003] However, regardless of the routing method used, the resulting traces are rarely able to fully meet requirements such as signal integrity, power consumption distribution, timing requirements, and area constraints, necessitating local adjustments by designers. In some scenarios, it's necessary to move the position of a trace segment, but this may cause conflicts with parallel trace segments. Therefore, it's necessary to move the related segments again. Currently, existing layout design software does not support automatically moving other related segments when moving a trace segment, so both adjustments must be done manually by the designer, resulting in low layout routing efficiency. Summary of the Invention
[0004] The purpose of this invention is to provide a method, apparatus, storage medium, and electronic device for coordinated adjustment of trace segments in circuit layout, so as to solve the problem that in the prior art, other related trace segments need to be manually moved again when moving trace segments, and can realize the joint movement of other related trace segments when moving trace segments, thereby improving the efficiency of circuit layout routing.
[0005] To solve the above technical problems, the present invention provides a method for coordinated adjustment of trace segments in circuit layout, comprising:
[0006] Obtain the target line segment located in the middle of the trace on the circuit layout and its endpoint of movement;
[0007] Determine whether there is an intersection point between the extension lines of the target line segment and the detection line that passes through the moving endpoint and is parallel to the target line segment;
[0008] If there is no intersection, search for the closest related line segment that is parallel to the target line segment on other routes between the detection line and the target line segment and the straight line containing the adjacent line segments before and after;
[0009] Keeping the slope and connection relationship of the adjacent line segments before and after the associated line segment unchanged, move the associated line segment toward the moving endpoint in the normal direction until the length becomes zero or crosses the moving endpoint and is separated from the moving endpoint by a preset line distance;
[0010] Keeping the slope and connection relationship of the adjacent line segments before and after the target line segment unchanged, move the target line segment toward the associated line segment in the normal direction until it is separated from the associated line segment by the preset line distance.
[0011] Preferably, obtaining the target line segment located in the middle of the trace on the circuit layout and its moving endpoint includes:
[0012] In response to the selection command, the current line segment located in the middle of the trace on the circuit layout is taken as the target line segment;
[0013] The mouse position point is acquired in real time and used as the endpoint of the movement of the target line segment.
[0014] Preferably, the step of searching for the closest related line segment that is parallel to the target line segment on other routes between the detection line and the target line segment, and between the straight lines containing the preceding and following adjacent line segments, includes:
[0015] Search for other line segments parallel to the target line segment on the normal direction pointing from the target line segment to the endpoint of the movement as candidate line segments;
[0016] The candidate line segments are sorted in ascending order of their distance from the target line segment;
[0017] The search area is defined using the detection line, the target line segment, the line containing the preceding adjacent line segment of the target line segment, and the line containing the following adjacent line segment of the target line segment as boundaries:
[0018] The process continues until an intersection is detected for the first time.
[0019] Candidate line segments that intersect with the search area are designated as associated line segments.
[0020] Preferably, the step of searching for other line segments parallel to the target line segment on the normal direction pointing from the target line segment to the endpoint of the movement as candidate line segments includes:
[0021] Path points are set at the preset line distances from both ends of the target line segment on the straight line where the target line segment is located, and a rectangular search box with the smallest area is constructed, with the edges in the horizontal and vertical directions respectively, which encloses the moving endpoint and the two path points.
[0022] On other line segments, feature points including endpoints are selected at intervals of the preset line spacing, and rectangular object frames with the edges in the horizontal and vertical directions are constructed using two adjacent feature points as diagonal vertices.
[0023] From the line segments where the rectangular object box and the rectangular search box intersect, select other line segments that are located on the normal direction of the target line segment pointing to the moving endpoint and are parallel to the target line segment as candidate line segments.
[0024] Preferably, the step of sequentially detecting whether each of the candidate line segments intersects with the search area until the first intersection is detected includes:
[0025] Each of the candidate line segments is copied at the preset distances on both sides in the normal direction to generate a mirror line segment;
[0026] The search continues until an intersection is detected for the first time.
[0027] It was confirmed that the candidate line segment detected for the first time intersected with the search area.
[0028] Preferably, the distance between the candidate line segment and the target line segment is the difference between the intercept of the line containing the candidate line segment and the intercept of the line containing the target line segment.
[0029] Preferably, the step of selecting line segments from the line segments where the rectangular object box and the rectangular search box intersect, that lie on the normal direction of the target line segment pointing to the endpoint of the movement and are parallel to the target line segment, as candidate line segments, includes:
[0030] Select the line segment located in the normal direction from the line segments where the target line segment points to the moving endpoint from the line segments where the rectangular object box and the rectangular search box intersect;
[0031] Select a line segment from the first temporary line segment that is parallel to the target line segment as the second temporary line segment;
[0032] Select line segments from other routes in the second temporary line segment as candidate line segments.
[0033] Preferably, the method for coordinated adjustment of wiring segments further includes:
[0034] If an intersection point exists, a limit endpoint is set at the preset line distance on the side of the intersection point away from the target line segment along the normal of the target line segment;
[0035] Find the closest related line segment that is parallel to the target line segment on other routes between the boundary line that passes through the extreme endpoint and is parallel to the target line segment, the target line segment, the adjacent line segments before and after it and their extensions;
[0036] Keeping the slope and connection relationship of the adjacent line segments of the associated line segment unchanged, the associated line segment is moved toward the limit endpoint in the normal direction until the length becomes zero or crosses the limit endpoint and is separated from the limit endpoint by the preset line distance;
[0037] Keeping the slope and connection relationship of the adjacent line segments before and after the target line segment unchanged, move the target line segment toward the associated line segment in the normal direction until it is separated from the associated line segment by the preset line distance.
[0038] To solve the above-mentioned technical problems, the present invention also provides a circuit layout trace segment linkage adjustment device, comprising:
[0039] The acquisition module is used to acquire the target line segment located in the middle of the trace on the circuit layout and its moving endpoint;
[0040] The judgment module is used to determine whether there is an intersection point between the extension lines of the preceding and following adjacent line segments of the target line segment and the detection line that passes through the moving endpoint and is parallel to the target line segment;
[0041] The search module is used to find the closest related line segment that is parallel to the target line segment on other routes when there is no intersection.
[0042] The first adjustment module is used to keep the slope and connection relationship of the adjacent line segments before and after the associated line segment unchanged, and move the associated line segment toward the moving endpoint in the normal direction until the length becomes zero or crosses the moving endpoint and is separated from the moving endpoint by the preset line distance.
[0043] The second adjustment module is used to keep the slope and connection relationship of the adjacent line segments before and after the target line segment unchanged, and move the target line segment toward the associated line segment in the normal direction until it is separated from the associated line segment by the preset line distance.
[0044] To solve the above-mentioned technical problems, the present invention also provides a storage medium storing a computer program, the computer program being configured to execute the circuit layout routing segment linkage adjustment method described in any of the preceding claims when running.
[0045] To address the aforementioned technical problems, the present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the circuit layout routing segment linkage adjustment method described in any of the preceding claims.
[0046] Unlike existing technologies, the circuit layout routing segment linkage adjustment method provided by this invention, after obtaining the target line segment and its moving endpoint, first determines whether there is an intersection point between the target line segment and the extended lines of the adjacent line segments before and after the target line segment, where the detection line passes through the moving endpoint and is parallel to the target line segment. If no intersection point exists, the associated line segment to be linked is determined based on the detection line, the target line segment, and the extended line. Then, keeping the slope and connection relationship of the adjacent line segments before and after the associated line segment unchanged, the associated line segment is moved in the normal direction toward the moving endpoint of the target line segment until the length of the associated line segment becomes zero or crosses the moving endpoint and is separated from the moving endpoint by a preset line distance. Finally, keeping the slope and connection relationship of the adjacent line segments before and after the target line segment unchanged, the target line segment is moved in the normal direction toward the associated line segment until it is separated from the associated line segment by a preset line distance. This invention can realize the joint movement of other associated line segments when moving a line segment, and can keep two line segments with a fixed line distance, thus improving the layout routing efficiency.
[0047] The circuit layout trace segment linkage adjustment device, storage medium and electronic device provided by the present invention belong to the same inventive concept as the circuit layout trace segment linkage adjustment method, and therefore have the same beneficial effects, which will not be repeated here. Attached Figure Description
[0048] Figure 1 This is a flowchart illustrating the method for linking and adjusting trace segments in a circuit layout according to an embodiment of the present invention.
[0049] Figure 2 This is a schematic diagram of the target line segment and its endpoint.
[0050] Figure 3 This is a schematic diagram showing the intersection of the extensions of the target line segments before and after the detection line and the target line segment where there are no adjacent line segments.
[0051] Figure 4 This is a schematic diagram of the associated line segment located between the detection line and the target line segment.
[0052] Figure 5 This is a schematic diagram showing how the length of an associated line segment becomes zero before it moves to a point where it is collinear with the endpoint of the move.
[0053] Figure 6 This is a schematic diagram showing the movement of a line segment until it is collinear with the endpoint of the movement.
[0054] Figure 7 A schematic diagram showing the movement of a target line segment to a distance from the associated line segment by a preset distance.
[0055] Figure 8 for Figure 1 A detailed flowchart of step S1 in the process shown.
[0056] Figure 9 for Figure 1 A detailed flowchart of step S2 in the process shown.
[0057] Figure 10 This is a schematic diagram showing the distance between the candidate line segment and the target line segment.
[0058] Figure 11 This is a schematic diagram of the candidate line segments and the search area.
[0059] Figure 12 A flowchart illustrating the process of finding alternative line segments.
[0060] Figure 13 This is a schematic diagram of a rectangular search box.
[0061] Figure 14 This is a schematic diagram of a rectangular object frame.
[0062] Figure 15 This is a flowchart illustrating the process of detecting whether there is an intersection between the candidate line segment and the search area.
[0063] Figure 16 This is a schematic diagram of a mirrored line segment generated by copying a candidate line segment.
[0064] Figure 17 This is a schematic diagram showing the positional relationship between the mirror image of the candidate line segment and the search area.
[0065] Figure 18 A flowchart illustrating the process of selecting candidate line segments.
[0066] Figure 19 A schematic flowchart of a circuit layout routing segment linkage adjustment method provided in another embodiment of the present invention.
[0067] Figure 20 This is a schematic diagram showing the intersection of the extensions of adjacent line segments before and after the target line segment between the detection line and the target line segment.
[0068] Figure 21 This is a schematic diagram of the connecting line segments located between the dividing line and the target line segment.
[0069] Figure 22 This is a schematic diagram showing how the length of an associated line segment becomes zero before it moves to the point where it is collinear with the endpoint of the limit.
[0070] Figure 23 This is a schematic diagram showing the movement of the associated line segment to the point where it is collinear with the endpoint of the limit.
[0071] Figure 24 This is a schematic diagram of the target line segment moving to a position with a preset distance from the associated line segment in another embodiment.
[0072] Figure 25A schematic diagram of the circuit layout routing segment linkage adjustment device provided in another embodiment of the present invention. Detailed Implementation
[0073] The specific embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. The advantages and features of the present invention will become clearer from the following description and claims. It should be noted that the drawings are all in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the present invention.
[0074] In the description of this invention, it should be understood that the terms "center", "upper", "lower", "left", "right", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0075] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0076] Please refer to Figure 1 This invention provides a method for coordinated adjustment of trace segments in a circuit layout, the method comprising the following steps:
[0077] S1: Obtain the target line segment located in the middle of the trace on the circuit layout and its moving endpoint.
[0078] In circuit routing design, traces are often designed as zigzag lines. This design has many advantages, such as reducing signal interference during transmission, improving circuit reliability, and saving routing space. A target segment is a segment on the trace that is in the middle and not directly connected to the start or end point of the trace. The target segment can be determined based on external input; for example, the user can use the mouse to select the middle segment of a trace and designate it as the target segment.
[0079] The endpoint is a coordinate point in a circuit layout, used to indicate the position of a target line segment after it has moved along the normal direction without being obstructed by other line segments. At this position, the target line segment will be collinear with the endpoint, meaning they are on the same line. The endpoint can be obtained in several ways, such as by clicking with a mouse, where the mouse cursor position is the endpoint, or by the user selecting the endpoint by inputting coordinates.
[0080] like Figure 2 The diagram shown is a schematic of the target line segment and its endpoint. The target line segment H is the middle segment of a path, and the endpoint P is located on one side of the target line segment H.
[0081] S2: Determine whether there is an intersection point between the extension lines of the target line segment and the detection line that passes through the moving endpoint and is parallel to the target line segment.
[0082] The detection line, which passes through the endpoint and is parallel to the target line segment, is a hypothetical straight line. If the slopes of the adjacent line segments before and after the target line segment are different, the extensions of these adjacent line segments will intersect, and thus, there may be a situation where the intersection point is located between the detection line and the target line segment. If the slopes of the adjacent line segments before and after the target line segment are the same, the extensions of these adjacent line segments will not intersect, and in this case, there will be no situation where the intersection point is located between the detection line and the target line segment.
[0083] like Figure 3 The diagram shows the intersection point of the extensions of the preceding and following line segments of the target line segment H. The extensions of the preceding and following line segments M and N of the target line segment H intersect at intersection point J. Intersection point J is not located between the detection line K (which passes through the endpoint P and is parallel to the target line segment H) and the target line segment H, but rather on the side of the detection line K away from the target line segment H.
[0084] S3: If there is no intersection, find the closest related line segment that is parallel to the target line segment on other routes between the detection line and the target line segment, and between the straight lines of the adjacent line segments before and after.
[0085] Among them, the associated line segment is located between the detection line and the target line segment, and is also located between the previous adjacent line segment and its extension of the target line segment and the next adjacent line segment and its extension of the target line segment. Furthermore, the associated line segment and the target line segment are different routes, and are parallel to the target line segment.
[0086] like Figure 4 The diagram shows the associated line segment located between the detection line and the target line segment. The associated line segment G is located between the detection line K and the target line segment H, and also between the extension of the preceding adjacent line segment M and the following adjacent line segment N of the target line segment H. The associated line segment G is parallel to the target line segment H, yet belongs to a different path from it. Furthermore, the associated line segment G is the closest to the target line segment H among all line segments between the detection line K and the target line segment H, the preceding and following adjacent line segments M and N, and their extensions, that are parallel to the target line segment H and belong to a different path from it.
[0087] S4: Keep the slope and connection relationship of the adjacent line segments unchanged, move the associated line segment toward the moving endpoint in the normal direction until the length becomes zero or crosses the moving endpoint and is separated from the moving endpoint by a preset line distance.
[0088] As the associated line segment moves toward the endpoint, the slope and connection relationship of the adjacent line segments remain unchanged. Therefore, the length of the adjacent line segments will decrease or the side length will increase as the associated line segment moves. Furthermore, since the two endpoints of the associated line segment will change position with the adjacent line segments, the length of the associated line segment will also decrease or increase.
[0089] If the length of the associated line segment becomes zero before it moves past the endpoint and is separated from the endpoint by a preset line distance, it means that the associated line segment has become the intersection of the extensions of the adjacent line segments before and after it. At this time, the associated line segment ends its movement.
[0090] If the length of the associated line segment does not become zero when it moves past the endpoint and is separated from the endpoint by a preset line distance, then the associated line segment will also end its movement.
[0091] The preset line spacing can be set according to actual needs, representing the minimum distance between different lines.
[0092] like Figure 5 The diagram shows the length of an associated line segment becoming zero before it moves past the endpoint and is separated from the endpoint by a preset distance. The left side of the diagram shows the associated line segment G before it moves, and the right side shows the associated line segment G after it moves. When the associated line segment G moves past the endpoint P and is separated from the endpoint P by a preset distance, its length becomes zero, and the associated line segment G becomes a point. At this point, the associated line segment G ends its movement.
[0093] like Figure 6 The diagram shows the movement of an associated line segment G until it crosses the endpoint and is separated from the endpoint by a preset distance. The left side of the diagram shows the associated line segment G before it moves, and the right side shows the associated line segment G after it moves. When the associated line segment G moves to cross the endpoint P and is separated from the endpoint P by a preset distance d, its length becomes shorter, but it does not become zero. At this point, the associated line segment G ends its movement.
[0094] S5: Keeping the slope and connection relationship of the adjacent line segments before and after the target line segment unchanged, move the target line segment toward the associated line segment in the normal direction until it is separated from the associated line segment by a preset line distance.
[0095] As the target line segment moves toward the associated line segment, the slope and connection relationship of the adjacent line segments before and after the target line segment remain unchanged. Therefore, the length of the adjacent line segments before and after the target line segment will decrease or the side length will increase as the target line segment moves. Furthermore, since the two endpoints of the target line segment will change position with the adjacent line segments before and after, the length of the target line segment will also decrease or increase.
[0096] Since the intersection of the extensions of the target line segment and the adjacent line segments is farther away from the target line segment than the moving end point, even if the target line segment moves to the point where it is collinear with the moving end point, its length will not become zero, although it will become shorter. Therefore, when the target line segment moves to a point where it is separated from the associated line segment by a preset line distance, it is still a line segment, but at this time the target line segment ends its movement.
[0097] like Figure 7 The diagram shows the target line segment H moving to a position where it is separated from the associated line segment by a preset distance. The left side of the diagram shows the target line segment H before it moves, and the right side shows the target line segment H after it moves. When the target line segment H moves to a position where it is separated from the associated line segment G by a preset distance d, it is exactly collinear with the endpoint P. Although its length has shortened, it has not become zero. At this point, the target line segment H ends its movement.
[0098] In accordance with the above method, the circuit layout routing segment linkage adjustment method provided by the embodiments of the present invention, after obtaining the target line segment and its moving endpoint, first determines whether there is an intersection point between the detection line that passes through the moving endpoint and is parallel to the target line segment and the target line segment, and the extension line of the target line segment. If there is no intersection point, the associated line segment that needs to be linked is determined according to the detection line, the target line segment and the extension line. Then, while keeping the slope and connection relationship of the adjacent line segments of the associated line segment unchanged, the associated line segment is moved in the normal direction toward the moving endpoint of the target line segment until the length of the associated line segment becomes zero or crosses the moving endpoint and is separated from the moving endpoint by a preset line distance. Finally, while keeping the slope and connection relationship of the adjacent line segments of the target line segment unchanged, the target line segment is moved in the normal direction toward the associated line segment until it is separated from the associated line segment by a preset line distance. The present invention can realize the joint movement of other associated line segments when moving line segments, and can keep two line segments with a fixed line distance, thus improving the layout routing efficiency.
[0099] In the embodiments of this application, please refer to Figure 8 ,yes Figure 1 The flowchart for step S1 in the illustrated process is shown below. Step S1, which involves obtaining the target line segment located in the middle of the trace on the circuit layout and its endpoint, includes:
[0100] S11: In response to the selection instruction, the current line segment located in the middle of the trace on the circuit layout is selected as the target line segment.
[0101] The selection command can be triggered by certain operations, such as the user clicking a preset key on the mouse or keyboard, or selecting a preset option on the user interface. At this time, the current line segment located in the middle of the trace is identified as the target line segment. The current line segment can be identified by coordinate information, label information, or mouse cursor. For example, before the user clicks the preset key on the mouse, the line segment in the middle of the trace where the mouse cursor is currently located is the current line segment.
[0102] S12: Real-time acquisition of mouse position point, using the mouse position point as the endpoint of the target line segment's movement.
[0103] Once the target line segment is confirmed, the position of the mouse cursor in the circuit layout is obtained in real time, and this position is used as the endpoint of the target line segment's movement.
[0104] In the embodiments of this application, please refer to Figure 9 ,yes Figure 1 The flowchart illustrates step S2 in the process shown. Step S2 involves finding the closest related line segment parallel to the target line segment on other paths between the detection line and the target line segment, adjacent line segments before and after it, and their extensions.
[0105] S21: Search for other lines on the normal direction of the target line segment pointing to the endpoint of the movement as alternative lines.
[0106] There may be other lines parallel to the target line segment on both sides, but only the line segment in the normal direction pointing to the target line segment's endpoint can hinder the movement of the target line segment. Therefore, searching for alternative line segments only in the normal direction can filter out some line segments and reduce the amount of calculation.
[0107] S22: Sort the candidate line segments in ascending order of their distance from the target line segment.
[0108] There may be multiple candidate line segments, which need to be sorted. In this embodiment, the distance between a candidate line segment and the target line segment is the difference between the intercept of the line containing the candidate line segment and the intercept of the line containing the target line segment. Figure 10 The diagram illustrates the distances between the candidate line segment and the target line segment. The intercept of the line containing candidate line segment L is the distance from the intersection of the line containing candidate line segment L and the Y-axis to the zero point of the coordinate system. Similarly, the intercept of the line containing target line segment H is the distance from the intersection of the line containing candidate line segment L and the Y-axis to the zero point of the coordinate system. The difference between the two intercepts is taken as the distance between candidate line segment L and target line segment H.
[0109] S23: The search area is determined by using the detection line, the target line segment, the line containing the previous adjacent line segment of the target line segment, and the line containing the next adjacent line segment of the target line segment as boundaries.
[0110] Since the detection line, the target line segment, the line containing the previous adjacent line segment of the target line segment, and the line containing the next adjacent line segment of the target line segment intersect each other, they will form a closed area, which is then used as the search area.
[0111] S24: Check each candidate line segment in sequence to see if it intersects with the search area until the first intersection is detected.
[0112] In each detection, the candidate line segment closest to the target line segment is detected first. Once the candidate line segment is detected to intersect with the search area for the first time, the detection stops.
[0113] The existence of intersection for each candidate line segment means that at least a portion of the candidate line segment is located within the search area.
[0114] like Figure 11 The diagram shows the candidate line segments and the search area. In the diagram, the detection line K, the target line segment H, the line containing the preceding adjacent line segment M of the target line segment H, and the line containing the following adjacent line segment N of the target line segment H enclose the search area A. There are three candidate line segments, assumed to be ordered L1, L2, and L3. When the first candidate line segment L1 is detected, it is outside the search area A and has no intersection with it. The second candidate line segment L2 is then detected; a portion of L2 is within the search area A, thus intersecting with it. At this point, the detection stops, and the third candidate line segment L3 is no longer detected.
[0115] S25: Select the candidate line segments that intersect with the search area as associated line segments.
[0116] Furthermore, when searching for candidate line segments, a quadtree search can be performed. For details, please refer to [link / reference needed]. Figure 12 This is a flowchart illustrating the process of finding candidate line segments. Step S21 involves searching for other line segments parallel to the target line segment along the normal direction pointing to the endpoint of the movement, as candidate line segments.
[0117] S211: Path points are set at the preset line distances from both ends of the target line segment on the straight line where the target line segment is located, and a rectangular search box with the smallest area is constructed, with the edges in the horizontal and vertical directions respectively, enclosing the moving endpoint and the two path points.
[0118] The horizontal and vertical directions are reference directions set according to actual needs. For ease of coordinate calculation, the horizontal and vertical directions are set as the X-axis and Y-axis directions of the reference coordinate system. The path points on the outer sides of both ends of the target line segment are located on the two adjacent sides of the rectangular search box.
[0119] like Figure 13 The diagram shows a rectangular search box. The path points S on the outer sides of both ends of the target line segment H are on the same line as the target line segment H, and are at a preset distance d from the endpoints of the target line segment H. The rectangular search box B1 needs to enclose the endpoint P and the two path points S. Therefore, it is necessary to obtain the minimum x-coordinate, minimum y-coordinate, maximum x-coordinate, and maximum y-coordinate of the coordinates of the endpoint P and the two path points S, thereby determining the two diagonal vertices and constructing the rectangular search box B1.
[0120] S212: Select feature points, including endpoints, on other line segments at preset line spacing intervals, and construct rectangular object boxes with the edges in the horizontal and vertical directions respectively, using two adjacent feature points as diagonal vertices.
[0121] When selecting feature points, you can start from the endpoints of the line segment and select at preset line spacing. If the interval between the last feature point and the other endpoint is less than or equal to the preset line spacing when the last feature point is selected, the selection ends.
[0122] like Figure 14 The diagram shows a rectangular object frame. There are two other line segments on either side of the target line segment H. Therefore, after selecting feature points T on these other line segments, multiple rectangular object frames B2 are constructed on each line segment.
[0123] S213: Select from the line segments that intersect the rectangular object box and the rectangular search box, other line segments that are located on the normal direction of the target line segment pointing to the end point of the movement and are parallel to the target line segment as candidate line segments.
[0124] In some cases, the rectangular object boxes on a line segment do not intersect with the rectangular search box, so such a segment will not be selected as a candidate line segment. In other cases, even if only one rectangular object box intersects with the rectangular search box on a line segment, it may still be selected as a candidate line segment.
[0125] In addition to checking whether the rectangular object box and the rectangular search box intersect, the system also filters out lines that belong to other routes, are located in the normal direction of the target line segment pointing to the endpoint of the movement, and are parallel to the target line segment. The filtered line segments are selected as candidate line segments.
[0126] like Figure 14 As shown, only the first and second line segments in the normal direction of the target line segment pointing to the endpoint of the movement are selected as candidate line segments.
[0127] Considering that when detecting whether candidate line segments intersect with the search area, coordinate errors may cause some candidate line segments to actually intersect with the search area but not be detected. To avoid this situation, in this embodiment, please refer to... Figure 15This is a flowchart illustrating the process of detecting whether a candidate line segment intersects with the search area. Step S24 involves sequentially checking whether each candidate line segment intersects with the search area until the first intersection is detected. The steps include:
[0128] S241: Copy each candidate line segment at the preset line distance on both sides of the normal direction to generate a mirrored line segment.
[0129] For each candidate line segment, two mirrored line segments are generated by copying the candidate line segment at a preset distance on both sides along its normal direction. The preset distance and preset spacing are the same, both set according to actual needs. The preset distance is mainly set based on coordinate error.
[0130] like Figure 16 The diagram shows a mirrored line segment generated by copying a candidate line segment. Two mirrored line segments, LJ1 and LJ2, are located on either side of the candidate line segment L, at a preset distance n from L, along the normal direction.
[0131] S242: Sequentially check whether one of the two mirror segments of each candidate line segment intersects with the search area until the first intersection is detected.
[0132] In each candidate line segment, if either of the two mirrored line segments intersects with the search area, the detection ends and no further candidate line segments are detected.
[0133] like Figure 17 The diagram shows the positional relationship between the mirrored segment of the candidate line segment and the search area. Assume there is only one candidate line segment L, which is located outside the search area A. Its mirrored segment LJ1 is also located outside the search area A, but its mirrored segment LJ2 is located inside the search area A. In this case, the detection result is that the mirrored segment LJ2 intersects with the search area A.
[0134] S243: Confirm that the candidate line segment detected for the first time intersects with the search area.
[0135] When selecting candidate line segments, the line segments need to meet three conditions: they must be located in the normal direction pointing to the endpoint of the target line segment, parallel to the target line segment, and belong to a different route from the target route. These three conditions need to be screened sequentially. For example, in this embodiment, please refer to... Figure 18 This is a flowchart illustrating the selection of candidate line segments. Step S25 involves selecting line segments from the intersection of the rectangular object box and the rectangular search box that lie on the normal direction to the target line segment pointing towards the endpoint of the movement, and are parallel to the target line segment, as candidate line segments.
[0136] S251: Select the line segment located on the normal direction of the target line segment pointing to the endpoint of the movement from the line segments that intersect the rectangular object box and the rectangular search box as the first temporary line segment.
[0137] Among them, the line segments where the rectangular object box and the rectangular search box intersect on the circuit layout are line segments that may cause layout conflicts after the target line segment is moved. However, since the target line segment moves towards the destination, line segments that move away from the target line segment will not cause layout conflicts after the target line segment is moved. Therefore, some line segments can be filtered out by selecting only the line segments located in the normal direction of the target line segment pointing to the destination.
[0138] S252: Select a line segment from the first temporary line segment that is parallel to the target line segment as the second temporary line segment.
[0139] In the first temporary segment, only segments parallel to the target segment are likely to cause layout conflicts after the target segment is moved. Therefore, selecting segments parallel to the target segment can further filter out some segments. Slope calculations can be used to detect which segments are parallel to the target segment. When the calculated slope is the same as the slope of the target segment, it can be confirmed that the segment is parallel to the target segment.
[0140] S253: Select line segments from other routes in the second temporary line segment as candidate line segments.
[0141] In this case, only segments belonging to other paths in the second temporary line segment will constitute obstacles to the movement of the target line segment. Therefore, after selecting segments from other paths in the second temporary line segment, the number of segments that meet the conditions is relatively small, which can significantly reduce the amount of computer computation.
[0142] Please refer to Figure 19 Another embodiment of the present invention provides a method for coordinated adjustment of trace segments in a circuit layout. This method is based on the trace segment coordinated adjustment method of the foregoing embodiments, except that the trace segment coordinated adjustment method further includes the following steps:
[0143] S6: If an intersection point exists, set the extreme endpoint at a preset distance along the normal of the target line segment on the side of the intersection point away from the target line segment.
[0144] If the detection line that passes through the moving endpoint and is parallel to the target line segment intersects with the extensions of the target line segment's preceding and following line segments, it indicates that the length of the target line segment will become zero during its movement to the moving endpoint. Therefore, the target line segment needs to have a new extreme endpoint set to replace the original moving endpoint. The extreme endpoint is set on the normal direction of the intersection of the extensions of the target line segment's preceding and following line segments, located on the side of the intersection away from the target line segment, and separated from the intersection by a preset line distance.
[0145] like Figure 20 The diagram shows the intersection point of the extensions of the preceding and following line segments of the target line segment. The extensions of the preceding and following line segments M and N of the target line segment H intersect at intersection point J. Intersection point J is located between the detection line K, which passes through the moving endpoint P and is parallel to the target line segment H, and the target line segment H. Therefore, a limit endpoint Z is set, and the distance between the limit endpoint Z and the intersection point J in the normal direction of the target line segment H is a preset line spacing d.
[0146] S7: Find the closest related line segment that is parallel to the target line segment on other routes between the boundary line that passes through the limit endpoint and is parallel to the target line segment, the target line segment, the adjacent line segments before and after it and their extensions.
[0147] The associated line segment is located between the boundary line and the target line segment, and also between the preceding adjacent line segment and its extension of the target line segment, and the following adjacent line segment and its extension of the target line segment. Furthermore, the associated line segment and the target line segment are on different paths, and the associated line segment is parallel to the target line segment. The specific search method is the same as the search method in the aforementioned embodiments, and will not be repeated here.
[0148] like Figure 21 The diagram shows the associated line segment located between the boundary line and the target line segment. The associated line segment G is located between the boundary line F and the target line segment H, and also between the extension of the preceding adjacent line segment M and the following adjacent line segment N of the target line segment H. The associated line segment G is parallel to the target line segment H, yet belongs to a different path from it. Furthermore, the associated line segment G is the line segment closest to the target line segment H among all line segments that are parallel to the target line segment H and belong to a different path from it, located between the boundary line F and the target line segment H, and between the preceding and following adjacent line segments M and N and their extensions (i.e., the triangular area in the diagram with the boundary line F and the target line segment H as the base and J as the vertex).
[0149] S8: Keeping the slope and connection relationship of the adjacent line segments unchanged, move the associated line segment toward the limit endpoint in the normal direction until the length becomes zero or it is collinear with the limit endpoint.
[0150] As the associated line segment moves toward the endpoint, the slope and connection relationship of the adjacent line segments remain unchanged. Therefore, the length of the adjacent line segments will decrease or the side length will increase as the associated line segment moves. Furthermore, since the two endpoints of the associated line segment will change position with the adjacent line segments, the length of the associated line segment will also decrease or increase.
[0151] If the length of the associated line segment becomes zero before it moves to the point where it is collinear with the endpoint of the limit (i.e., on the same line as the endpoint of the limit), it means that the associated line segment has become the intersection of the extensions of the adjacent line segments before and after it. At this point, the associated line segment ends its movement.
[0152] If the length of the associated line segment does not become zero when it moves to the point where it is collinear with the endpoint of the limit, then the associated line segment also ends its movement.
[0153] like Figure 22 The diagram shows the length of an associated line segment becoming zero before it moves to the point where it is collinear with the endpoint Z. The left side of the diagram shows the associated line segment G before it moves, and the right side shows the associated line segment G after it moves. When the associated line segment G moves to the point where it is collinear with the endpoint Z, its length becomes zero, and the associated line segment G becomes a point. At this point, the associated line segment G ends its movement.
[0154] like Figure 23 The diagram shows the state when the associated line segment G moves to the point where it is collinear with the endpoint Z. The left side of the diagram shows the state before the associated line segment G moves, and the right side shows the state after the associated line segment G moves. When the associated line segment G moves to the point where it is collinear with the endpoint Z, its length becomes shorter, but it does not become zero. At this point, the associated line segment G ends its movement.
[0155] S9: Keeping the slope and connection relationship of the adjacent line segments before and after the target line segment unchanged, move the target line segment toward the associated line segment in the normal direction until it is separated from the associated line segment by a preset line distance.
[0156] As the target line segment moves toward the associated line segment, the slope and connection relationship of the adjacent line segments before and after the target line segment remain unchanged. Therefore, the length of the adjacent line segments before and after the target line segment will decrease or the side length will increase as the target line segment moves. Furthermore, since the two endpoints of the target line segment will change position with the adjacent line segments before and after, the length of the target line segment will also decrease or increase.
[0157] It should be noted that if the associated line segment moves to be collinear with the endpoint of the limit, then the length of the target line segment becomes zero when it ends. If the length of the associated line segment becomes zero before it moves to be collinear with the endpoint of the limit, then the length of the target line segment will not become zero when it ends, and it will still be a line segment.
[0158] like Figure 24 The diagram shown is a schematic of the target line segment moving to a position where it is spaced by a preset distance from the associated line segment in another embodiment. The left side of the diagram is a schematic of the target line segment H before it moves, and the right side is a schematic of the target line segment H after it moves. When the target line segment H moves to a position where it is spaced by a preset distance d from the associated line segment G, it is collinear with the intersection point J. Therefore, the length of the target line segment H becomes zero, and the normal distance between it and the endpoint Z is exactly the preset distance d.
[0159] Please refer to Figure 25 Another embodiment of the present invention provides a circuit layout trace segment linkage adjustment device, the device comprising:
[0160] The acquisition module 11 is used to acquire the target line segment located in the middle of the trace on the circuit layout and its moving endpoint.
[0161] The judgment module 12 is used to determine whether there is an intersection point between the extension lines of the target line segment and the detection line that has passed the moving endpoint and is parallel to the target line segment.
[0162] The search module 13 is used to find the closest related line segment that is parallel to the target line segment on other routes when there is no intersection.
[0163] The first adjustment module 14 is used to keep the slope and connection relationship of the adjacent line segments of the associated line segment unchanged, and to move the associated line segment toward the moving endpoint in the normal direction until the length becomes zero or crosses the moving endpoint and is separated from the moving endpoint by a preset line distance.
[0164] The second adjustment module 15 is used to keep the slope and connection relationship of the adjacent line segments before and after the target line segment unchanged, and to move the target line segment toward the associated line segment in the normal direction until it is separated from the associated line segment by a preset line distance.
[0165] The circuit layout trace segment linkage adjustment device of this embodiment may also include other technical features of the circuit layout trace segment linkage adjustment method of the foregoing embodiment, implement all the steps of the trace segment linkage adjustment method of the foregoing embodiment, and have the same technical effect as the trace segment linkage adjustment method of the foregoing embodiment, which will not be repeated here.
[0166] The present invention also provides a storage medium storing a computer program, which is configured to execute the circuit layout routing segment linkage adjustment method of the foregoing embodiments when running.
[0167] Specifically, in this embodiment, the storage medium may include, but is not limited to, USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks, and other media capable of storing computer programs.
[0168] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to execute the circuit layout routing segment linkage adjustment method of the foregoing embodiments.
[0169] Specifically, the memory and processor can be connected via a data bus. Furthermore, the aforementioned electronic device may also include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0170] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," or "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments. In addition, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.
[0171] The above are merely preferred embodiments of the present invention and do not constitute any limitation on the present invention. Any equivalent substitutions or modifications made by those skilled in the art to the technical solutions and content disclosed in the present invention without departing from the scope of the present invention shall be deemed to have remained within the protection scope of the present invention.
Claims
1. A method for coordinated adjustment of trace segments in a circuit layout, characterized in that, include: Obtain the target line segment located in the middle of the trace on the circuit layout and its endpoint of movement; Determine whether there is an intersection point between the extension lines of the target line segment and the detection line that passes through the moving endpoint and is parallel to the target line segment; If there is no intersection, search for the closest related line segment that is parallel to the target line segment on other routes between the detection line and the target line segment and the straight line containing the adjacent line segments before and after; Keeping the slope and connection relationship of the adjacent line segments before and after the associated line segment unchanged, move the associated line segment toward the moving endpoint in the normal direction until the length becomes zero or crosses the moving endpoint and is separated from the moving endpoint by a preset line distance; Keeping the slope and connection relationship of the adjacent line segments before and after the target line segment unchanged, move the target line segment toward the associated line segment in the normal direction until it is separated from the associated line segment by the preset line distance.
2. The method for coordinated adjustment of wiring segments according to claim 1, characterized in that, The acquisition of the target line segment located in the middle of the trace on the circuit layout and its moving endpoint includes: In response to the selection command, the current line segment located in the middle of the trace on the circuit layout is taken as the target line segment; The mouse position point is acquired in real time and used as the endpoint of the movement of the target line segment.
3. The method for coordinated adjustment of wiring segments according to claim 1, characterized in that, The step of finding the closest related line segment that is parallel to the target line segment on other routes between the detection line and the target line segment, and between the straight lines containing the preceding and following adjacent line segments, includes: Search for other line segments parallel to the target line segment on the normal direction pointing from the target line segment to the endpoint of the movement as candidate line segments; The candidate line segments are sorted in ascending order of their distance from the target line segment; The search area is defined using the detection line, the target line segment, the line containing the preceding adjacent line segment of the target line segment, and the line containing the following adjacent line segment of the target line segment as boundaries: The process continues until an intersection is detected for the first time. Candidate line segments that intersect with the search area are designated as associated line segments.
4. The method for coordinated adjustment of wiring segments according to claim 3, characterized in that, The step of searching for other line segments parallel to the target line segment on the normal direction pointing from the target line segment to the endpoint of the movement as candidate line segments includes: Path points are set at the preset line distances from both ends of the target line segment on the straight line where the target line segment is located, and a rectangular search box with the smallest area is constructed, with the edges in the horizontal and vertical directions respectively, which encloses the moving endpoint and the two path points. On other line segments, feature points including endpoints are selected at intervals of the preset line spacing, and rectangular object frames with the edges in the horizontal and vertical directions are constructed using two adjacent feature points as diagonal vertices. From the line segments where the rectangular object box and the rectangular search box intersect, select other line segments that are located on the normal direction of the target line segment pointing to the moving endpoint and are parallel to the target line segment as candidate line segments.
5. The method for coordinated adjustment of wiring segments according to claim 3, characterized in that, The step of sequentially detecting whether each of the candidate line segments intersects with the search area until the first intersection is detected includes: Each of the candidate line segments is copied at the preset distances on both sides in the normal direction to generate a mirror line segment; The search continues until an intersection is detected for the first time. It was confirmed that the candidate line segment detected for the first time intersected with the search area.
6. The method for coordinated adjustment of wiring segments according to claim 3, characterized in that, The distance between the candidate line segment and the target line segment is the difference between the intercept of the line containing the candidate line segment and the intercept of the line containing the target line segment.
7. The method for coordinated adjustment of wiring segments according to claim 3, characterized in that, The step of selecting line segments from the line segments intersecting the rectangular object box and the rectangular search box, that lie on the normal direction of the target line segment pointing to the endpoint of the movement and are parallel to the target line segment, as candidate line segments, includes: Select the line segment located in the normal direction from the line segments where the target line segment points to the moving endpoint from the line segments where the rectangular object box and the rectangular search box intersect; Select a line segment from the first temporary line segment that is parallel to the target line segment as the second temporary line segment; Select line segments from other routes in the second temporary line segment as candidate line segments.
8. The method for coordinated adjustment of wiring segments according to any one of claims 1 to 7, characterized in that, The method for adjusting the linkage of wiring segments also includes: If an intersection point exists, a limit endpoint is set at the preset line distance on the side of the intersection point away from the target line segment along the normal of the target line segment; Find the closest related line segment that is parallel to the target line segment on other routes between the boundary line that passes through the extreme endpoint and is parallel to the target line segment, the target line segment, the adjacent line segments before and after it and their extensions; Keeping the slope and connection relationship of the adjacent line segments of the associated line segment unchanged, the associated line segment is moved toward the limit endpoint in the normal direction until the length becomes zero or crosses the limit endpoint and is separated from the limit endpoint by the preset line distance; Keeping the slope and connection relationship of the adjacent line segments before and after the target line segment unchanged, move the target line segment toward the associated line segment in the normal direction until it is separated from the associated line segment by the preset line distance.
9. A circuit layout trace segment linkage adjustment device, characterized in that, include: The acquisition module is used to acquire the target line segment located in the middle of the trace on the circuit layout and its moving endpoint; The judgment module is used to determine whether there is an intersection point between the extension lines of the preceding and following adjacent line segments of the target line segment and the detection line that passes through the moving endpoint and is parallel to the target line segment; The search module is used to find the closest related line segment that is parallel to the target line segment on other routes when there is no intersection. The first adjustment module is used to keep the slope and connection relationship of the adjacent line segments before and after the associated line segment unchanged, and move the associated line segment toward the moving endpoint in the normal direction until the length becomes zero or crosses the moving endpoint and is separated from the moving endpoint by the preset line distance. The second adjustment module is used to keep the slope and connection relationship of the adjacent line segments before and after the target line segment unchanged, and move the target line segment toward the associated line segment in the normal direction until it is separated from the associated line segment by the preset line distance.
10. A storage medium, characterized in that, The storage medium stores a computer program, which is configured to execute the method for linking and adjusting trace segments of the circuit layout as described in any one of claims 1 to 8 when it is run.
11. An electronic device, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the method for linking and adjusting trace segments of a circuit layout as described in any one of claims 1 to 8.