CN-121981064-A - Method, device, medium and equipment for moving middle line segment of wiring in circuit layout
Abstract
The invention discloses a method, a device, a medium and equipment for moving an intermediate line segment of a wiring in a circuit layout. The method comprises the steps of obtaining a target line segment positioned in the middle of a target trace of a circuit layout and a guide point outside the target line segment, determining the moving direction and the moving distance of the target line segment on a normal line of the target line segment according to the position of the guide point, translating the moving distance of the target line segment in the moving direction to obtain a mirror line segment, searching a first intersection point of a straight line where the mirror line segment is located and a straight line where a front line segment of the target line segment is located and a second intersection point of the straight line where a rear line segment of the target line segment is located respectively, replacing the first intersection point and the second intersection point with the first endpoint of the target line segment connected with the first endpoint of the front line segment and the second endpoint of the target line segment respectively, and conducting connection adjustment on the target trace. The invention can keep other line segments relatively unchanged when the middle line segment of the wiring is moved.
Inventors
- LI SHUXIAO
Assignees
- 本源科仪(成都)科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20241025
Claims (10)
- 1. A method for moving an intermediate line segment of a wiring in a circuit layout is characterized by comprising the following steps: acquiring a target line segment positioned in the middle on a target line adopting broken line wiring in a circuit layout and a guide point outside the target line segment; determining a moving direction and a moving distance on the target line segment normal according to the position of the index point; translating the target line segment in the moving direction by the moving distance to obtain a mirror line segment; Searching a first intersection point of a straight line where the mirror line segment is located and a straight line where a previous line segment of the target line segment is located and a second intersection point of the straight line where a next line segment of the target line segment is located respectively; And respectively replacing the first intersection point and the second intersection point with the first end point of the previous line segment and the second end point of the subsequent line segment which are connected with the target line segment, and carrying out connection adjustment on the target wiring.
- 2. The method of claim 1, wherein the step of performing a wire-line adjustment on the target wire comprises: the straight line is connected with the first intersection point and the second intersection point; Extending the previous line segment to the first intersection point when the first intersection point is not located on the previous line segment, otherwise deleting the part from the first intersection point to the first endpoint on the previous line segment; and when the second intersection point is not positioned on the subsequent line segment, extending the subsequent line segment to the second intersection point, otherwise deleting the part from the second intersection point to the second endpoint on the subsequent line segment.
- 3. The intermediate line segment movement method according to claim 1, wherein the step of determining the movement direction on the target line segment normal from the position of the index point includes: constructing a first vector, in which a first end point of the target line segment connected with a previous line segment points to a second end point connected with a next line segment, a second vector, in which the first end point points to the pointing point, and a reference vector formed by clockwise rotating the first vector by a preset angle, wherein the preset angle is smaller than 180 degrees; Calculating a first vector product of the reference vector and the first vector and a second vector product of the second vector and the first vector, and comparing the directions of the first vector product and the second vector product; And when the directions are the same, taking the normal direction perpendicular to the target line segment and pointing to the right side of the first vector as a moving direction, and when the directions are different, taking the normal direction perpendicular to the target line segment and pointing to the left side of the first vector as the moving direction.
- 4. A method of moving an intermediate line segment according to claim 3, wherein the predetermined angle is 90 degrees.
- 5. A method of moving an intermediate line segment according to claim 3, wherein said step of confirming a moving distance on said target line segment normal from a position of said index point comprises: Comparing the slopes of the previous segment and the next segment of the target segment; When the slopes of the previous line segment and the next line segment of the target line segment are different, a third intersection point of the straight line where the previous line segment is located and the straight line where the next line segment is located is obtained; detecting whether a third endpoint of the previous line segment far from the target line segment, a fourth endpoint of the subsequent line segment far from the target line segment and the third intersection point are located in the moving direction; And selecting the shortest distance from the vertical distance from the guide point to the target line segment and the vertical distances from the third endpoint, the fourth endpoint and the third intersection point which are positioned in the moving direction to the target line segment as the moving distance.
- 6. The method of claim 5, wherein the step of determining the moving distance on the target line segment normal from the position of the pointing point further comprises: Detecting whether the third end point and the fourth end point are located in the moving direction when the slopes of the previous line segment and the next line segment of the target line segment are the same; And selecting the shortest distance from the vertical distance from the guide point to the target line segment and the vertical distance from the third endpoint and the fourth endpoint which are positioned in the moving direction to the target line segment as the moving distance.
- 7. The intermediate line segment movement method according to claim 1 or 2, characterized in that the intermediate line segment movement method further comprises: And merging the connecting line of the first intersection point and the second intersection point with the second line segment before the target line segment and/or the second line segment after the target line segment into one line segment when the connecting line of the first intersection point and the second line segment before the target line segment and/or the second line segment after the target line segment have common endpoints and are on the same straight line.
- 8. An intermediate line segment moving device for routing in a circuit layout, comprising: the acquisition module is used for acquiring a target line segment positioned in the middle on a target wiring adopting broken line wiring in the circuit layout and a guide point outside the target line segment; the determining module is used for determining the moving direction and the moving distance on the target line segment normal according to the position of the guide point; the translation module is used for translating the target line segment by the movement distance in the movement direction to obtain a mirror line segment; the searching module is used for searching a first intersection point of a straight line where the mirror line segment is located and a straight line where a previous line segment of the target line segment is located and a second intersection point of the straight line where a next line segment of the target line segment is located respectively; And the adjustment module is used for respectively replacing the first intersection point and the second intersection point with the first endpoint of the previous line segment and the second endpoint of the subsequent line segment to be connected with the target line segment, and carrying out connection adjustment on the target wiring.
- 9. A storage medium, characterized in that the storage medium has stored therein a computer program arranged to perform the method of moving intermediate line segments of a trace in a circuit layout according to any one of claims 1 to 7 when run.
- 10. An electronic device comprising a memory and a processor, the memory having stored therein a computer program, the processor being arranged to run the computer program to perform the method of moving intermediate line segments of traces in a circuit layout as claimed in any one of claims 1 to 7.
Description
Method, device, medium and equipment for moving middle line segment of wiring in circuit layout Technical Field The present invention relates to the field of circuit layout design, and in particular, to a method, an apparatus, a medium, and a device for moving an intermediate line segment of a trace in a circuit layout. Background In circuit layout design, after drawing layout patterns of circuit entities such as components and pads, wiring is required to be arranged among connection points of each layout pattern so as to represent circuit connection relation. Existing wiring methods include manual wiring and automatic wiring. The manual wiring is performed manually by a designer, and the automatic wiring is performed automatically by software according to wiring rules set in advance. However, whichever way of routing is adopted, the resulting trace is difficult to fully meet the requirements of signal integrity, power distribution, timing requirements, area limitations, etc., requiring a designer to make local adjustments to the trace. In some scenarios, when moving intermediate line segments on a trace routed using polyline, it is sometimes undesirable to have the positions of other line segments on the trace change, because the positions of other line segments may already be in optimal positions, once moved, will disrupt the overall layout of the circuit layout. However, the existing layout design software does not support the moving mode, only supports the integral movement of all the line segments of the wiring, and therefore the requirements cannot be met. Disclosure of Invention The invention aims to provide a method, a device, a medium and equipment for moving an intermediate line segment of a wiring in a circuit layout, which are used for solving the problem that the wiring can only be moved integrally in the prior art, and keeping other line segments relatively unchanged when the intermediate line segment of the wiring is moved. In order to solve the technical problems, the invention provides a method for moving an intermediate line segment of a wiring in a circuit layout, which comprises the following steps: acquiring a target line segment positioned in the middle on a target line adopting broken line wiring in a circuit layout and a guide point outside the target line segment; determining a moving direction and a moving distance on the target line segment normal according to the position of the index point; translating the target line segment in the moving direction by the moving distance to obtain a mirror line segment; Searching a first intersection point of a straight line where the mirror line segment is located and a straight line where a previous line segment of the target line segment is located and a second intersection point of the straight line where a next line segment of the target line segment is located respectively; And respectively replacing the first intersection point and the second intersection point with the first end point of the previous line segment and the second end point of the subsequent line segment which are connected with the target line segment, and carrying out connection adjustment on the target wiring. Preferably, the step of performing the wire connection adjustment on the target wire includes: the straight line is connected with the first intersection point and the second intersection point; Extending the previous line segment to the first intersection point when the first intersection point is not located on the previous line segment, otherwise deleting the part from the first intersection point to the first endpoint on the previous line segment; and when the second intersection point is not positioned on the subsequent line segment, extending the subsequent line segment to the second intersection point, otherwise deleting the part from the second intersection point to the second endpoint on the subsequent line segment. Preferably, the step of determining the moving direction on the target line segment normal according to the position of the pointing point includes: constructing a first vector, in which a first end point of the target line segment connected with a previous line segment points to a second end point connected with a next line segment, a second vector, in which the first end point points to the pointing point, and a reference vector formed by clockwise rotating the first vector by a preset angle, wherein the preset angle is smaller than 180 degrees; Calculating a first vector product of the reference vector and the first vector and a second vector product of the second vector and the first vector, and comparing the directions of the first vector product and the second vector product; And when the directions are the same, taking the normal direction perpendicular to the target line segment and pointing to the right side of the first vector as a moving direction, and when the directions are different, taking the normal direction perpendicular to t