Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/repro79-demo.mp4
Binary file not shown.
42 changes: 42 additions & 0 deletions docs/repro79-demo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion lib/solvers/LongDistancePairSolver/LongDistancePairSolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ export class LongDistancePairSolver extends BaseSolver {
primaryConnectedPinIds.add(pair.pins[0].pinId)
primaryConnectedPinIds.add(pair.pins[1].pinId)
}
const directlyWiredPinIds = new Set<PinId>()
for (const dc of inputProblem.directConnections) {
for (const pinId of dc.pinIds) {
directlyWiredPinIds.add(pinId)
}
}

const { netConnMap } = getConnectivityMapsFromInputProblem(inputProblem)
this.netConnMap = netConnMap
Expand All @@ -73,7 +79,9 @@ export class LongDistancePairSolver extends BaseSolver {
const addedPairKeys = new Set<string>()

for (const netId of Object.keys(netConnMap.netMap)) {
const allPinIdsInNet = netConnMap.getIdsConnectedToNet(netId)
const allPinIdsInNet = netConnMap
.getIdsConnectedToNet(netId)
.filter((pinId) => directlyWiredPinIds.has(pinId))
if (allPinIdsInNet.length < 2) continue

const unconnectedPinIds = allPinIdsInNet.filter(
Expand Down
11 changes: 10 additions & 1 deletion lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,16 @@ export class MspConnectionPairSolver extends BaseSolver {
}
}

this.queuedDcNetIds = Object.keys(netConnMap.netMap)
const directlyWiredPinIds = new Set<string>()
for (const dc of inputProblem.directConnections) {
for (const pid of dc.pinIds) {
directlyWiredPinIds.add(pid)
}
}
this.queuedDcNetIds = Object.keys(netConnMap.netMap).filter((netId) => {
const connectedIds = netConnMap.getIdsConnectedToNet(netId) as string[]
return connectedIds.some((id) => directlyWiredPinIds.has(id))
})
}

override getConstructorParams(): ConstructorParameters<
Expand Down
73 changes: 44 additions & 29 deletions tests/examples/__snapshots__/example01.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading