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
14 changes: 14 additions & 0 deletions lib/solvers/LongDistancePairSolver/LongDistancePairSolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ export class LongDistancePairSolver extends BaseSolver {
}
}

// Pins that participate in an explicit direct connection. Nets that are
// made up purely of net-label connections should not be connected with a
// (long-distance) trace "jumping" between their pins; each pin is instead
// represented with its own net label.
const directlyWiredPinIds = new Set<PinId>()
for (const dc of inputProblem.directConnections) {
for (const pid of dc.pinIds) {
directlyWiredPinIds.add(pid)
}
}

// 2. Generate candidate pairs using N-Nearest-Neighbors approach
const candidatePairs: Array<
[InputPin & { chipId: string }, InputPin & { chipId: string }]
Expand All @@ -77,6 +88,9 @@ export class LongDistancePairSolver extends BaseSolver {
const allPinIdsInNet = netConnMap.getIdsConnectedToNet(netId)
if (allPinIdsInNet.length < 2) continue

// Skip net-label-only nets (no pin has a direct connection)
if (!allPinIdsInNet.some((id) => directlyWiredPinIds.has(id))) continue

const unconnectedPinIds = allPinIdsInNet.filter(
(pinId) => !primaryConnectedPinIds.has(pinId),
)
Expand Down
15 changes: 14 additions & 1 deletion lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,20 @@ export class MspConnectionPairSolver extends BaseSolver {
}
}

this.queuedDcNetIds = Object.keys(netConnMap.netMap)
// Only run the MSP/trace solver for nets that contain at least one pin
// with an explicit direct connection. Nets that are made up purely of
// net-label connections should be represented with separate net labels on
// each pin instead of a trace "jumping" between them.
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
4 changes: 4 additions & 0 deletions site/examples/example35.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { PipelineDebugger } from "site/components/PipelineDebugger"
import inputProblem from "../../tests/assets/example35.json"

export default () => <PipelineDebugger inputProblem={inputProblem as any} />
62 changes: 62 additions & 0 deletions tests/assets/example35.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"chips": [
{
"chipId": "C2",
"center": {
"x": 0,
"y": 0
},
"width": 0.4,
"height": 1,
"pins": [
{
"pinId": "C2.1",
"x": 0,
"y": 0.5
},
{
"pinId": "C2.2",
"x": 0,
"y": -0.5
}
]
},
{
"chipId": "C1",
"center": {
"x": 2,
"y": 0
},
"width": 0.4,
"height": 1,
"pins": [
{
"pinId": "C1.1",
"x": 2,
"y": 0.5
},
{
"pinId": "C1.2",
"x": 2,
"y": -0.5
}
]
}
],
"directConnections": [],
"netConnections": [
{
"pinIds": ["C1.1", "C2.1"],
"netId": "GND"
},
{
"pinIds": ["C1.2", "C2.2"],
"netId": "VCC"
}
],
"availableNetLabelOrientations": {
"GND": ["y+"],
"VCC": ["y-"]
},
"maxMspPairDistance": 5
}
75 changes: 40 additions & 35 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
Loading