@tscircuit/schematic-trace-solver 0.0.176 → 0.0.177
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -0
- package/lib/solvers/MspConnectionPairSolver/getGroundConnectionPolicy.ts +13 -0
- package/package.json +1 -1
- package/tests/repros/__snapshots__/repro-smartwatch-power-sheet.snap.svg +451 -0
- package/tests/repros/assets/repro-smartwatch-power-sheet.input.json +1112 -0
- package/tests/repros/repro-smartwatch-power-sheet.test.ts +27 -0
- package/tests/solvers/MspConnectionPairSolver/ground-direct-connection-groups.test.ts +11 -0
package/dist/index.js
CHANGED
|
@@ -396,6 +396,12 @@ var getGroundConnectionPolicy = (inputProblem) => {
|
|
|
396
396
|
);
|
|
397
397
|
});
|
|
398
398
|
const areSeparateExplicitGroundIslands = (firstPinId, secondPinId) => {
|
|
399
|
+
const firstChipId = pins.get(firstPinId)?.chip.chipId;
|
|
400
|
+
const secondChipId = pins.get(secondPinId)?.chip.chipId;
|
|
401
|
+
const pinsShareChip = firstChipId !== void 0 && firstChipId === secondChipId;
|
|
402
|
+
if (pinsShareChip && !physicalConnMap.getNetConnectedToId(firstPinId) && !physicalConnMap.getNetConnectedToId(secondPinId)) {
|
|
403
|
+
return false;
|
|
404
|
+
}
|
|
399
405
|
const firstGlobalNetId = netConnMap.getNetConnectedToId(firstPinId);
|
|
400
406
|
const secondGlobalNetId = netConnMap.getNetConnectedToId(secondPinId);
|
|
401
407
|
if (!firstGlobalNetId || firstGlobalNetId !== secondGlobalNetId || !explicitlyWiredGroundNetIds.has(firstGlobalNetId)) {
|
|
@@ -59,6 +59,19 @@ export const getGroundConnectionPolicy = (inputProblem: InputProblem) => {
|
|
|
59
59
|
firstPinId: PinId,
|
|
60
60
|
secondPinId: PinId,
|
|
61
61
|
) => {
|
|
62
|
+
const firstChipId = pins.get(firstPinId)?.chip.chipId
|
|
63
|
+
const secondChipId = pins.get(secondPinId)?.chip.chipId
|
|
64
|
+
const pinsShareChip =
|
|
65
|
+
firstChipId !== undefined && firstChipId === secondChipId
|
|
66
|
+
// Unwired ground terminals on one component can share a local trace
|
|
67
|
+
// without joining separate physical ground islands.
|
|
68
|
+
if (
|
|
69
|
+
pinsShareChip &&
|
|
70
|
+
!physicalConnMap.getNetConnectedToId(firstPinId) &&
|
|
71
|
+
!physicalConnMap.getNetConnectedToId(secondPinId)
|
|
72
|
+
) {
|
|
73
|
+
return false
|
|
74
|
+
}
|
|
62
75
|
const firstGlobalNetId = netConnMap.getNetConnectedToId(firstPinId)
|
|
63
76
|
const secondGlobalNetId = netConnMap.getNetConnectedToId(secondPinId)
|
|
64
77
|
if (
|