Header menu logo issie

BusWireSeparate Module

Functions and values

Function or value Description

adjustSegmentsInModel ori model lines

Full Usage: adjustSegmentsInModel ori model lines

Parameters:
Returns: Model

Given a list of segment changes of given orientation apply them to the model

ori : Orientation
model : Model
lines : Line list
Returns: Model

bBoxToLines ori box

Full Usage: bBoxToLines ori box

Parameters:
Returns: Line list

Convert a symbol BoundingBox into two fixed lines (of given orientation). The lines correspond to the two box edges of the specified orientation.

ori : Orientation
box : BoundingBox
Returns: Line list

calcSegPositions model lines loc

Full Usage: calcSegPositions model lines loc

Parameters:

Function which given a cluster (loc) works out how to spread out the contained segments optimally, spacing them from other segments and symbols. Return value is a list of segments, represented as Lines, paired with where they move. lines is the source list of lines (vertical or horizontal according to which is being processed). model is the Buswire model needed to access wires.

model : Model
lines : Line array
loc : Cluster

checkExtensionNoCrossings overlap ext excludedWire info

Full Usage: checkExtensionNoCrossings overlap ext excludedWire info

Parameters:
Returns: bool

Return true if there is no crossing symbol boundary between line and lines array (with exception of excludedLine). Lines and excludedLine or opposite orientation from line

overlap : float
ext : Extension
excludedWire : ConnectionId
info : LineInfo
Returns: bool

checkExtensionNoOverlap overlap ext excludedWire info

Full Usage: checkExtensionNoOverlap overlap ext excludedWire info

Parameters:
Returns: bool

Return true if there is no overlap between line and lines array (with exception of excludedLine). All lines are the same type (parallel)

overlap : float
ext : Extension
excludedWire : ConnectionId
info : LineInfo
Returns: bool

expandCluster index searchDir lines

Full Usage: expandCluster index searchDir lines

Parameters:
Returns: Cluster

When given a segment index search for nearby segments to be considered with it as a single cluster for spreading out. To be included segments must be close enough and overlapping. Search terminates given large gap or a fixed boundary segments are not allowed to move across.

index : int
searchDir : LocSearchDir
lines : Line array
Returns: Cluster

findInterval lines p

Full Usage: findInterval lines p

Parameters:
    lines : Line array
    p : float

Returns: int

Return the index of the Line with the smallest value of P > p Use binary earch for speed.

lines : Line array
p : float
Returns: int

findWireCorner info cornerSizeLimit wire

Full Usage: findWireCorner info cornerSizeLimit wire

Parameters:
Returns: WireCorner list

Return the list of wire corners found in given wire with all corner edges smaller than cornerSizeLimit. A wire can have at most one corner.

info : LineInfo
cornerSizeLimit : float
wire : Wire
Returns: WireCorner list

isSegmentExtensionOk info wire segNum ori newLength

Full Usage: isSegmentExtensionOk info wire segNum ori newLength

Parameters:
Returns: bool

Return true if the given segment length change is allowed. If the new segment creates a part line segment that did not previouly exist this is checked for overlap with symbols and other wires.

info : LineInfo
wire : Wire
segNum : int
ori : Orientation
newLength : float
Returns: bool

lineToWire model line

Full Usage: lineToWire model line

Parameters:
Returns: (Wire * int) option

return wire and segment index of line, if line a segment, otehrwise return None.

model : Model
line : Line
Returns: (Wire * int) option

linkAndRemoveSameNetSegments lines cluster

Full Usage: linkAndRemoveSameNetSegments lines cluster

Parameters:
Returns: Cluster

Check a cluster for same net segments within separateCaptureOverlap Remove from cluster and all except one in every such same net group The removed segments are marked LINKEDSEG and linked for later processing

lines : Line array
cluster : Cluster
Returns: Cluster

linkSameNetLines sameNetCapture lines

Full Usage: linkSameNetLines sameNetCapture lines

Parameters:
    sameNetCapture : float
    lines : Line list

Returns: Line list

Where two segments in lines are on the same Net and on top of each other we must NEVER separate them. This function links such segments, and marks all except the head one as a LINKEDSEG so that the clustering algorithm will ignore them. sameNetCapture specified how close segments muts be to be linked.

sameNetCapture : float
lines : Line list
Returns: Line list

makeClusters lines

Full Usage: makeClusters lines

Parameters:
    lines : Line array

Returns: Cluster list

Scan through segments in P order creating a list of local Clusters. Within one cluster segments are adjacent and overlapping. Note that different clusters may occupy the same P values if their segments do not overlap. Segments within each cluster will be repositioned and reordered after clusters are identified. Every segment must be part of a unique cluster.

lines : Line array
Returns: Cluster list

makeLineInfo wiresToRoute model

Full Usage: makeLineInfo wiresToRoute model

Parameters:
Returns: LineInfo

Process the symbols and wires in Model generating arrays of Horizontal and Vertical lines. In addition the inverse map is generated which can map each segmnet to the corresponding Line if that exists. Note that Lines reference segments, which contain wire Id and segment Index and can therefore be used to reference the corresponding wire via the model.Wires map.

wiresToRoute : ConnectionId list
model : Model
Returns: LineInfo

makeLines wiresToRoute ori model

Full Usage: makeLines wiresToRoute ori model

Parameters:
Returns: Line[]

Make all lines, fixed and movable, of given orientation from wires and symbols in Model ori - orientation of Lines (P coord is reverse of this)

wiresToRoute : ConnectionId list
ori : Orientation
model : Model
Returns: Line[]

numCrossingsSign model line1 line2 wires

Full Usage: numCrossingsSign model line1 line2 wires

Parameters:
Returns: int

+1 if line1.P > line2.P for zero crossings. -1 if line1.P < line2.P for zero crossings. 0 if line1.P and line2.P have one crossing.

model : Model
line1 : Line
line2 : Line
wires : Map<ConnectionId, Wire>
Returns: int

orderPairwiseToMinimiseCrossings model lines segL

Full Usage: orderPairwiseToMinimiseCrossings model lines segL

Parameters:
    model : Model
    lines : Line array
    segL : int list

Returns: int list

segL is a list of lines array indexes representing segments found close together. Return the list ordered in such a way that wire crossings are minimised if the segments are placed as ordered. The return list is placed with required P value increasing along the list.

model : Model
lines : Line array
segL : int list
Returns: int list

printLostSegmentInCluster msg lines lostIndex loc

Full Usage: printLostSegmentInCluster msg lines lostIndex loc

Parameters:
    msg : string
    lines : Line array
    lostIndex : int
    loc : Cluster

print diagnostics in rare case that a segment gets "orphaned" this should probably never happened and be fixed if anything is printed.

msg : string
lines : Line array
lostIndex : int
loc : Cluster

reRouteWiresFrom comps model

Full Usage: reRouteWiresFrom comps model

Parameters:
Returns: Model

all wires from comps are autorouted from scratch then the separation logic is rerun on these wires

comps : ComponentId list
model : Model
Returns: Model

reSeparateWiresFrom comps model

Full Usage: reSeparateWiresFrom comps model

Parameters:
Returns: Model

all wires from comps have all segments made auto. then the separation logic is rerun on these wires

comps : ComponentId list
model : Model
Returns: Model

removeCorner info wc

Full Usage: removeCorner info wc

Parameters:
Returns: LineInfo

Change LineInfo removing a corner from a wire. TODO: currently only WireMap changes

info : LineInfo
wc : WireCorner
Returns: LineInfo

removeModelCorners wires model

Full Usage: removeModelCorners wires model

Parameters:
Returns: Model

Return model with corners identified and removed where possible. Corners are artifacts - usually small - which give wires more visible segments than is needed.

wires : ConnectionId list
model : Model
Returns: Model

removeModelSpikes model

Full Usage: removeModelSpikes model

Parameters:
Returns: Model

return model with all wire spikes removed

model : Model
Returns: Model

removeWireSpikes wire

Full Usage: removeWireSpikes wire

Parameters:
Returns: Wire option

Return None, or Some wire' where wire' is wire with spikes removed. Spikes segments that turn back on previous ones (with a zero-length segment in between). Optimised for the case that there are no spikes and None is returned.

wire : Wire
Returns: Wire option

routeAndSeparateSymbolWires model compId

Full Usage: routeAndSeparateSymbolWires model compId

Parameters:
Returns: Model

Top-level function does routing and then separation of set of wires. Uses partial routing if possible.

model : Model
compId : ComponentId
Returns: Model

segmentToLine lType ori wire seg

Full Usage: segmentToLine lType ori wire seg

Parameters:
Returns: Line

Convert a segment into a fixed or movable line (of given orientation). seg: ASegment of given segment to convert. wire: wire of given segment to convert. ori: orientation of segment (for reasons of efficiecny - it could be calculated from seg). lType: type of line generated.

lType : LType
ori : Orientation
wire : Wire
seg : ASegment
Returns: Line

separateAndOrderModelSegments wiresToRoute model

Full Usage: separateAndOrderModelSegments wiresToRoute model

Parameters:
Returns: Model

Perform complete wire segment separation and ordering for all orientations. wiresToRoute: set of wires to have segments separated and ordered

wiresToRoute : ConnectionId list
model : Model
Returns: Model

separateFixedSegments wiresToRoute ori model

Full Usage: separateFixedSegments wiresToRoute ori model

Parameters:
Returns: Model

Segments which could be moved, but would make an extra segment if moved, are marked Fixed and not moved by the normal cluster-based separation functions. This function looks at these segments and moves them a little in the special case that they overlap. It is called after the main segment separation is complete.

wiresToRoute : ConnectionId list
ori : Orientation
model : Model
Returns: Model

separateModelSegmentsOneOrientation wiresToRoute ori model

Full Usage: separateModelSegmentsOneOrientation wiresToRoute ori model

Parameters:
Returns: Model

Perform complete segment ordering and separation for segments of given orientation. wires: set of wires allowed to be moved.

wiresToRoute : ConnectionId list
ori : Orientation
model : Model
Returns: Model

turnDirs line wires

Full Usage: turnDirs line wires

Parameters:
Returns: int * int

Returns integers +/- 1 indicating direction of wire leaving ends of line segment. Pair returned is MaxB, MinB end of line

line : Line
wires : Map<ConnectionId, Wire>
Returns: int * int

updateWireSegmentJumpsAndSeparations wires model

Full Usage: updateWireSegmentJumpsAndSeparations wires model

Parameters:
Returns: Model

Top-level function to replace updateWireSegmentJumps and call the Segment separate code as well. This should run when significant circuit wiring changes have been made e.g. at the end of symbol drags.

wires : ConnectionId list
model : Model
Returns: Model

Type something to start searching.