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
10 changes: 8 additions & 2 deletions lib/solvers/LongDistancePairSolver/LongDistancePairSolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,14 @@ export class LongDistancePairSolver extends BaseSolver {
> = []
const addedPairKeys = new Set<string>()

for (const netId of Object.keys(netConnMap.netMap)) {
const allPinIdsInNet = netConnMap.getIdsConnectedToNet(netId)
for (const internalNetId of Object.keys(netConnMap.netMap)) {
const [originalNetId, ...allPinIdsInNet] =
netConnMap.getIdsConnectedToNet(internalNetId)

if (originalNetId === "GND" || originalNetId === "VCC") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can’t have specific conditions for ids in the code, they would need to be passed in via config (im pretty dure they already are, but you have to use the config)

continue
}

if (allPinIdsInNet.length < 2) continue

const unconnectedPinIds = allPinIdsInNet.filter(
Expand Down
10 changes: 10 additions & 0 deletions lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ export class MspConnectionPairSolver extends BaseSolver {
const dcNetId = this.queuedDcNetIds.shift()!

const allIds = this.globalConnMap.getIdsConnectedToNet(dcNetId) as string[]

// Find the user-facing net ID (if any) to check for exclusion
const firstPinId = allIds.find((id) => !!this.pinMap[id])
if (firstPinId) {
const userNetId = this.userNetIdByPinId[firstPinId]
if (userNetId === "GND" || userNetId === "VCC") {
return
}
}

const directlyConnectedPins = allIds.filter((id) => !!this.pinMap[id])

if (directlyConnectedPins.length <= 1) {
Expand Down
33 changes: 33 additions & 0 deletions tests/assets/connected-gnd-vcc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"chips": [
{
"chipId": "schematic_component_0",
"center": { "x": 2, "y": 0 },
"width": 0.53,
"height": 1.1,
"pins": [
{ "pinId": "C1.1", "x": 2, "y": -0.55 },
{ "pinId": "C1.2", "x": 2, "y": 0.55 }
]
},
{
"chipId": "schematic_component_1",
"center": { "x": 0, "y": 0 },
"width": 0.53,
"height": 1.1,
"pins": [
{ "pinId": "C2.1", "x": -3.469446951953614e-17, "y": -0.55 },
{ "pinId": "C2.2", "x": 3.469446951953614e-17, "y": 0.55 }
]
}
],
"directConnections": [
{ "pinIds": ["C1.1", "C2.1"], "netId": "C1.pin1 to C2.pin1" }
],
"netConnections": [
{ "netId": "GND", "pinIds": ["C1.1", "C2.1"], "netLabelWidth": 0.3 },
{ "netId": "VCC", "pinIds": ["C1.2", "C2.2"], "netLabelWidth": 0.3 }
],
"availableNetLabelOrientations": { "GND": ["y-"], "VCC": ["y+"] },
"maxMspPairDistance": 2.4
}
31 changes: 31 additions & 0 deletions tests/assets/unconnect-gnd-vcc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"chips": [
{
"chipId": "schematic_component_0",
"center": { "x": 2, "y": 0 },
"width": 0.53,
"height": 1.1,
"pins": [
{ "pinId": "C1.1", "x": 2, "y": -0.55 },
{ "pinId": "C1.2", "x": 2, "y": 0.55 }
]
},
{
"chipId": "schematic_component_1",
"center": { "x": 0, "y": 0 },
"width": 0.53,
"height": 1.1,
"pins": [
{ "pinId": "C2.1", "x": -3.469446951953614e-17, "y": -0.55 },
{ "pinId": "C2.2", "x": 3.469446951953614e-17, "y": 0.55 }
]
}
],
"directConnections": [],
"netConnections": [
{ "netId": "GND", "pinIds": ["C1.1", "C2.1"], "netLabelWidth": 0.3 },
{ "netId": "VCC", "pinIds": ["C1.2", "C2.2"], "netLabelWidth": 0.3 }
],
"availableNetLabelOrientations": { "GND": ["y-"], "VCC": ["y+"] },
"maxMspPairDistance": 2.4
}
67 changes: 38 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