@tscircuit/core 0.0.1832 → 0.0.1833
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 +238 -236
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -19989,6 +19989,39 @@ function getFanoutExitPositionConfig(exitPosition) {
|
|
|
19989
19989
|
|
|
19990
19990
|
// node_modules/@tscircuit/fanout-solver/lib/fanout-solver.ts
|
|
19991
19991
|
import { BaseSolver } from "@tscircuit/solver-utils";
|
|
19992
|
+
import { mergeGraphics } from "graphics-debug";
|
|
19993
|
+
|
|
19994
|
+
// node_modules/@tscircuit/fanout-solver/lib/add-via-layer-metadata.ts
|
|
19995
|
+
function addViaLayerMetadataToTrace(params) {
|
|
19996
|
+
const { trace, layerNames, allowBlindAndBuriedVias } = params;
|
|
19997
|
+
return {
|
|
19998
|
+
...trace,
|
|
19999
|
+
route: trace.route.map(
|
|
20000
|
+
(routePoint) => routePoint.route_type === "via" && !allowBlindAndBuriedVias ? {
|
|
20001
|
+
...routePoint,
|
|
20002
|
+
layers: getViaSpanLayers2({
|
|
20003
|
+
fromLayer: routePoint.from_layer,
|
|
20004
|
+
toLayer: routePoint.to_layer,
|
|
20005
|
+
layerNames,
|
|
20006
|
+
allowBlindAndBuriedVias
|
|
20007
|
+
})
|
|
20008
|
+
} : { ...routePoint }
|
|
20009
|
+
)
|
|
20010
|
+
};
|
|
20011
|
+
}
|
|
20012
|
+
function addViaLayerMetadataToSrj(params) {
|
|
20013
|
+
const { srj, layerNames, allowBlindAndBuriedVias } = params;
|
|
20014
|
+
return {
|
|
20015
|
+
...srj,
|
|
20016
|
+
traces: (srj.traces ?? []).map(
|
|
20017
|
+
(trace) => addViaLayerMetadataToTrace({
|
|
20018
|
+
trace,
|
|
20019
|
+
layerNames,
|
|
20020
|
+
allowBlindAndBuriedVias
|
|
20021
|
+
})
|
|
20022
|
+
)
|
|
20023
|
+
};
|
|
20024
|
+
}
|
|
19992
20025
|
|
|
19993
20026
|
// node_modules/@tscircuit/fanout-solver/lib/boundary-exit.ts
|
|
19994
20027
|
function getExitEdgeForDirection(direction) {
|
|
@@ -20027,6 +20060,156 @@ function getCornerBandSide(exitEdge, preferredExit) {
|
|
|
20027
20060
|
return preferredExit.endsWith("-right") ? "maximum" : "minimum";
|
|
20028
20061
|
}
|
|
20029
20062
|
|
|
20063
|
+
// node_modules/@tscircuit/fanout-solver/lib/build-output.ts
|
|
20064
|
+
function createViaObstacle(plan, layerNames, via, viaIndex) {
|
|
20065
|
+
const zLayers = via.spanLayers.map((layer) => {
|
|
20066
|
+
const layerIndex = layerNames.indexOf(layer);
|
|
20067
|
+
if (layerIndex < 0) {
|
|
20068
|
+
throw new Error(
|
|
20069
|
+
`FanoutSolver: via for "${plan.connectionName}" uses unknown layer "${layer}"`
|
|
20070
|
+
);
|
|
20071
|
+
}
|
|
20072
|
+
return layerIndex;
|
|
20073
|
+
});
|
|
20074
|
+
const outputIds = createFanoutOutputIds(plan);
|
|
20075
|
+
return {
|
|
20076
|
+
obstacleId: viaIndex === "endpoint" ? outputIds.planeEndpointViaObstacleId : viaIndex === 0 ? outputIds.viaObstacleId : `${outputIds.viaObstacleId}:${viaIndex}`,
|
|
20077
|
+
type: "rect",
|
|
20078
|
+
center: via.center,
|
|
20079
|
+
width: via.diameter,
|
|
20080
|
+
height: via.diameter,
|
|
20081
|
+
layers: via.spanLayers,
|
|
20082
|
+
zLayers,
|
|
20083
|
+
__zLayers: zLayers,
|
|
20084
|
+
connectedTo: [plan.connectionName, plan.trace.pcb_trace_id]
|
|
20085
|
+
};
|
|
20086
|
+
}
|
|
20087
|
+
function buildOutputSimpleRouteJson(params) {
|
|
20088
|
+
const { inputSrj, plans, layerNames } = params;
|
|
20089
|
+
const outputConnections = inputSrj.connections.map((connection) => ({
|
|
20090
|
+
...connection,
|
|
20091
|
+
pointsToConnect: connection.pointsToConnect.map((point6) => ({ ...point6 }))
|
|
20092
|
+
}));
|
|
20093
|
+
const viaObstacles = [];
|
|
20094
|
+
const planeTerminatedConnectionNames = /* @__PURE__ */ new Set();
|
|
20095
|
+
for (const plan of plans) {
|
|
20096
|
+
const connection = outputConnections[plan.connectionIndex];
|
|
20097
|
+
if (!connection) {
|
|
20098
|
+
throw new Error(
|
|
20099
|
+
`FanoutSolver: output connection index ${plan.connectionIndex} is missing`
|
|
20100
|
+
);
|
|
20101
|
+
}
|
|
20102
|
+
const outputIds = createFanoutOutputIds(plan);
|
|
20103
|
+
connection.pointsToConnect[plan.sourcePointIndex] = {
|
|
20104
|
+
x: plan.exitPoint.x,
|
|
20105
|
+
y: plan.exitPoint.y,
|
|
20106
|
+
layer: plan.targetLayer,
|
|
20107
|
+
pointId: plan.termination.type === "plane" ? outputIds.planeExitPointId : outputIds.boundaryExitPointId
|
|
20108
|
+
};
|
|
20109
|
+
if (plan.termination.type === "plane") {
|
|
20110
|
+
planeTerminatedConnectionNames.add(plan.connectionName);
|
|
20111
|
+
}
|
|
20112
|
+
if (plan.via) {
|
|
20113
|
+
const viaObstacle = createViaObstacle(plan, layerNames, plan.via, 0);
|
|
20114
|
+
if (viaObstacle) viaObstacles.push(viaObstacle);
|
|
20115
|
+
}
|
|
20116
|
+
for (const [additionalViaIndex, via] of (plan.additionalVias ?? []).entries()) {
|
|
20117
|
+
const viaObstacle = createViaObstacle(
|
|
20118
|
+
plan,
|
|
20119
|
+
layerNames,
|
|
20120
|
+
via,
|
|
20121
|
+
additionalViaIndex + 1
|
|
20122
|
+
);
|
|
20123
|
+
if (viaObstacle) viaObstacles.push(viaObstacle);
|
|
20124
|
+
}
|
|
20125
|
+
if (plan.planeEndpointVia) {
|
|
20126
|
+
const endpointViaObstacle = createViaObstacle(
|
|
20127
|
+
plan,
|
|
20128
|
+
layerNames,
|
|
20129
|
+
plan.planeEndpointVia,
|
|
20130
|
+
"endpoint"
|
|
20131
|
+
);
|
|
20132
|
+
if (endpointViaObstacle) viaObstacles.push(endpointViaObstacle);
|
|
20133
|
+
}
|
|
20134
|
+
}
|
|
20135
|
+
const planTraces = plans.flatMap((plan) => [
|
|
20136
|
+
plan.trace,
|
|
20137
|
+
...plan.planeEndpointTrace ? [plan.planeEndpointTrace] : []
|
|
20138
|
+
]);
|
|
20139
|
+
const coordinateRoutePoints = planTraces.flatMap(
|
|
20140
|
+
(trace) => trace.route.filter(
|
|
20141
|
+
(routePoint) => "x" in routePoint && "y" in routePoint
|
|
20142
|
+
)
|
|
20143
|
+
);
|
|
20144
|
+
const boundsMargin = Math.max(
|
|
20145
|
+
inputSrj.defaultObstacleMargin ?? 0,
|
|
20146
|
+
inputSrj.minTraceWidth
|
|
20147
|
+
);
|
|
20148
|
+
const outputBounds = coordinateRoutePoints.length === 0 ? { ...inputSrj.bounds } : {
|
|
20149
|
+
minX: Math.min(
|
|
20150
|
+
inputSrj.bounds.minX,
|
|
20151
|
+
...coordinateRoutePoints.map(
|
|
20152
|
+
(routePoint) => routePoint.x - boundsMargin
|
|
20153
|
+
)
|
|
20154
|
+
),
|
|
20155
|
+
maxX: Math.max(
|
|
20156
|
+
inputSrj.bounds.maxX,
|
|
20157
|
+
...coordinateRoutePoints.map(
|
|
20158
|
+
(routePoint) => routePoint.x + boundsMargin
|
|
20159
|
+
)
|
|
20160
|
+
),
|
|
20161
|
+
minY: Math.min(
|
|
20162
|
+
inputSrj.bounds.minY,
|
|
20163
|
+
...coordinateRoutePoints.map(
|
|
20164
|
+
(routePoint) => routePoint.y - boundsMargin
|
|
20165
|
+
)
|
|
20166
|
+
),
|
|
20167
|
+
maxY: Math.max(
|
|
20168
|
+
inputSrj.bounds.maxY,
|
|
20169
|
+
...coordinateRoutePoints.map(
|
|
20170
|
+
(routePoint) => routePoint.y + boundsMargin
|
|
20171
|
+
)
|
|
20172
|
+
)
|
|
20173
|
+
};
|
|
20174
|
+
return {
|
|
20175
|
+
...inputSrj,
|
|
20176
|
+
fanoutPlaneConnectivity: plans.flatMap(
|
|
20177
|
+
(plan) => plan.termination.type === "plane" ? [
|
|
20178
|
+
{
|
|
20179
|
+
connectionName: plan.connectionName,
|
|
20180
|
+
layer: plan.termination.layer
|
|
20181
|
+
}
|
|
20182
|
+
] : []
|
|
20183
|
+
),
|
|
20184
|
+
bounds: outputBounds,
|
|
20185
|
+
connections: outputConnections.filter(
|
|
20186
|
+
(connection) => !planeTerminatedConnectionNames.has(connection.name)
|
|
20187
|
+
),
|
|
20188
|
+
buses: inputSrj.buses?.map((bus) => ({
|
|
20189
|
+
...bus,
|
|
20190
|
+
connectionNames: bus.connectionNames.filter(
|
|
20191
|
+
(connectionName) => !planeTerminatedConnectionNames.has(connectionName)
|
|
20192
|
+
)
|
|
20193
|
+
})).filter((bus) => bus.connectionNames.length > 0),
|
|
20194
|
+
obstacles: [
|
|
20195
|
+
...inputSrj.obstacles.map((obstacle) => ({
|
|
20196
|
+
...obstacle,
|
|
20197
|
+
center: { ...obstacle.center },
|
|
20198
|
+
layers: [...obstacle.layers],
|
|
20199
|
+
connectedTo: [...obstacle.connectedTo]
|
|
20200
|
+
})),
|
|
20201
|
+
...viaObstacles
|
|
20202
|
+
],
|
|
20203
|
+
traces: [
|
|
20204
|
+
...(inputSrj.traces ?? []).map((trace) => ({
|
|
20205
|
+
...trace,
|
|
20206
|
+
route: trace.route.map((routePoint) => ({ ...routePoint }))
|
|
20207
|
+
})),
|
|
20208
|
+
...planTraces
|
|
20209
|
+
]
|
|
20210
|
+
};
|
|
20211
|
+
}
|
|
20212
|
+
|
|
20030
20213
|
// node_modules/@tscircuit/fanout-solver/lib/get-routed-trace-copper.ts
|
|
20031
20214
|
function getRoutedTraceCopper(srj, trace, allowBlindAndBuriedVias = true) {
|
|
20032
20215
|
const layerNames = getCopperLayerNames(srj.layerCount);
|
|
@@ -24013,240 +24196,6 @@ function routeBus(params) {
|
|
|
24013
24196
|
return routeBusAlternatives(params, 1)[0] ?? null;
|
|
24014
24197
|
}
|
|
24015
24198
|
|
|
24016
|
-
// node_modules/@tscircuit/fanout-solver/lib/shorten-bus-plans.ts
|
|
24017
|
-
function shortenBusPlans(params) {
|
|
24018
|
-
const { bus } = params;
|
|
24019
|
-
let plans = [...params.plans];
|
|
24020
|
-
if (bus.maxLengthSkew === void 0) return plans;
|
|
24021
|
-
const busPlans = plans.filter((plan) => plan.busId === bus.busId).toSorted((first, second) => second.length - first.length);
|
|
24022
|
-
for (const plan of busPlans) {
|
|
24023
|
-
const minimumLength = Math.min(
|
|
24024
|
-
...plans.filter((p) => p.busId === bus.busId).map((p) => p.length)
|
|
24025
|
-
);
|
|
24026
|
-
if (plan.length - minimumLength <= bus.maxLengthSkew) continue;
|
|
24027
|
-
if (!plan.via || plan.additionalVias?.length || plan.planeEndpointVia || plan.segments.filter((segment2) => segment2.layer === plan.sourceLayer).length !== 1)
|
|
24028
|
-
continue;
|
|
24029
|
-
const connection = bus.connections.find(
|
|
24030
|
-
(c) => c.connectionIndex === plan.connectionIndex
|
|
24031
|
-
);
|
|
24032
|
-
for (const alignGridToPads of [true, false]) {
|
|
24033
|
-
const candidate = routeViaMinimalWinding({
|
|
24034
|
-
...params,
|
|
24035
|
-
bus: {
|
|
24036
|
-
...bus,
|
|
24037
|
-
connections: [connection],
|
|
24038
|
-
routableEscapeLayers: [plan.targetLayer]
|
|
24039
|
-
},
|
|
24040
|
-
terminals: [
|
|
24041
|
-
{ connection, viaPoint: plan.via.center, exitPoint: plan.exitPoint }
|
|
24042
|
-
],
|
|
24043
|
-
targetLayer: plan.targetLayer,
|
|
24044
|
-
acceptedPlans: plans.filter((p) => p !== plan),
|
|
24045
|
-
allowBlindAndBuriedVias: false,
|
|
24046
|
-
gridStepDivisor: 2,
|
|
24047
|
-
alignGridToPads,
|
|
24048
|
-
maximumRouteOrderAttempts: 1
|
|
24049
|
-
})?.[0];
|
|
24050
|
-
if (!candidate || candidate.length >= plan.length - 1e-6) continue;
|
|
24051
|
-
const nextPlans = plans.map((p) => p === plan ? candidate : p);
|
|
24052
|
-
if (!fanoutPlansAreClear({
|
|
24053
|
-
...params,
|
|
24054
|
-
plans: nextPlans,
|
|
24055
|
-
allowBlindAndBuriedVias: false
|
|
24056
|
-
}))
|
|
24057
|
-
continue;
|
|
24058
|
-
plans = nextPlans;
|
|
24059
|
-
break;
|
|
24060
|
-
}
|
|
24061
|
-
}
|
|
24062
|
-
return plans;
|
|
24063
|
-
}
|
|
24064
|
-
|
|
24065
|
-
// node_modules/@tscircuit/fanout-solver/lib/fanout-solver.ts
|
|
24066
|
-
import { mergeGraphics } from "graphics-debug";
|
|
24067
|
-
|
|
24068
|
-
// node_modules/@tscircuit/fanout-solver/lib/add-via-layer-metadata.ts
|
|
24069
|
-
function addViaLayerMetadataToTrace(params) {
|
|
24070
|
-
const { trace, layerNames, allowBlindAndBuriedVias } = params;
|
|
24071
|
-
return {
|
|
24072
|
-
...trace,
|
|
24073
|
-
route: trace.route.map(
|
|
24074
|
-
(routePoint) => routePoint.route_type === "via" && !allowBlindAndBuriedVias ? {
|
|
24075
|
-
...routePoint,
|
|
24076
|
-
layers: getViaSpanLayers2({
|
|
24077
|
-
fromLayer: routePoint.from_layer,
|
|
24078
|
-
toLayer: routePoint.to_layer,
|
|
24079
|
-
layerNames,
|
|
24080
|
-
allowBlindAndBuriedVias
|
|
24081
|
-
})
|
|
24082
|
-
} : { ...routePoint }
|
|
24083
|
-
)
|
|
24084
|
-
};
|
|
24085
|
-
}
|
|
24086
|
-
function addViaLayerMetadataToSrj(params) {
|
|
24087
|
-
const { srj, layerNames, allowBlindAndBuriedVias } = params;
|
|
24088
|
-
return {
|
|
24089
|
-
...srj,
|
|
24090
|
-
traces: (srj.traces ?? []).map(
|
|
24091
|
-
(trace) => addViaLayerMetadataToTrace({
|
|
24092
|
-
trace,
|
|
24093
|
-
layerNames,
|
|
24094
|
-
allowBlindAndBuriedVias
|
|
24095
|
-
})
|
|
24096
|
-
)
|
|
24097
|
-
};
|
|
24098
|
-
}
|
|
24099
|
-
|
|
24100
|
-
// node_modules/@tscircuit/fanout-solver/lib/build-output.ts
|
|
24101
|
-
function createViaObstacle(plan, layerNames, via, viaIndex) {
|
|
24102
|
-
const zLayers = via.spanLayers.map((layer) => {
|
|
24103
|
-
const layerIndex = layerNames.indexOf(layer);
|
|
24104
|
-
if (layerIndex < 0) {
|
|
24105
|
-
throw new Error(
|
|
24106
|
-
`FanoutSolver: via for "${plan.connectionName}" uses unknown layer "${layer}"`
|
|
24107
|
-
);
|
|
24108
|
-
}
|
|
24109
|
-
return layerIndex;
|
|
24110
|
-
});
|
|
24111
|
-
const outputIds = createFanoutOutputIds(plan);
|
|
24112
|
-
return {
|
|
24113
|
-
obstacleId: viaIndex === "endpoint" ? outputIds.planeEndpointViaObstacleId : viaIndex === 0 ? outputIds.viaObstacleId : `${outputIds.viaObstacleId}:${viaIndex}`,
|
|
24114
|
-
type: "rect",
|
|
24115
|
-
center: via.center,
|
|
24116
|
-
width: via.diameter,
|
|
24117
|
-
height: via.diameter,
|
|
24118
|
-
layers: via.spanLayers,
|
|
24119
|
-
zLayers,
|
|
24120
|
-
__zLayers: zLayers,
|
|
24121
|
-
connectedTo: [plan.connectionName, plan.trace.pcb_trace_id]
|
|
24122
|
-
};
|
|
24123
|
-
}
|
|
24124
|
-
function buildOutputSimpleRouteJson(params) {
|
|
24125
|
-
const { inputSrj, plans, layerNames } = params;
|
|
24126
|
-
const outputConnections = inputSrj.connections.map((connection) => ({
|
|
24127
|
-
...connection,
|
|
24128
|
-
pointsToConnect: connection.pointsToConnect.map((point6) => ({ ...point6 }))
|
|
24129
|
-
}));
|
|
24130
|
-
const viaObstacles = [];
|
|
24131
|
-
const planeTerminatedConnectionNames = /* @__PURE__ */ new Set();
|
|
24132
|
-
for (const plan of plans) {
|
|
24133
|
-
const connection = outputConnections[plan.connectionIndex];
|
|
24134
|
-
if (!connection) {
|
|
24135
|
-
throw new Error(
|
|
24136
|
-
`FanoutSolver: output connection index ${plan.connectionIndex} is missing`
|
|
24137
|
-
);
|
|
24138
|
-
}
|
|
24139
|
-
const outputIds = createFanoutOutputIds(plan);
|
|
24140
|
-
connection.pointsToConnect[plan.sourcePointIndex] = {
|
|
24141
|
-
x: plan.exitPoint.x,
|
|
24142
|
-
y: plan.exitPoint.y,
|
|
24143
|
-
layer: plan.targetLayer,
|
|
24144
|
-
pointId: plan.termination.type === "plane" ? outputIds.planeExitPointId : outputIds.boundaryExitPointId
|
|
24145
|
-
};
|
|
24146
|
-
if (plan.termination.type === "plane") {
|
|
24147
|
-
planeTerminatedConnectionNames.add(plan.connectionName);
|
|
24148
|
-
}
|
|
24149
|
-
if (plan.via) {
|
|
24150
|
-
const viaObstacle = createViaObstacle(plan, layerNames, plan.via, 0);
|
|
24151
|
-
if (viaObstacle) viaObstacles.push(viaObstacle);
|
|
24152
|
-
}
|
|
24153
|
-
for (const [additionalViaIndex, via] of (plan.additionalVias ?? []).entries()) {
|
|
24154
|
-
const viaObstacle = createViaObstacle(
|
|
24155
|
-
plan,
|
|
24156
|
-
layerNames,
|
|
24157
|
-
via,
|
|
24158
|
-
additionalViaIndex + 1
|
|
24159
|
-
);
|
|
24160
|
-
if (viaObstacle) viaObstacles.push(viaObstacle);
|
|
24161
|
-
}
|
|
24162
|
-
if (plan.planeEndpointVia) {
|
|
24163
|
-
const endpointViaObstacle = createViaObstacle(
|
|
24164
|
-
plan,
|
|
24165
|
-
layerNames,
|
|
24166
|
-
plan.planeEndpointVia,
|
|
24167
|
-
"endpoint"
|
|
24168
|
-
);
|
|
24169
|
-
if (endpointViaObstacle) viaObstacles.push(endpointViaObstacle);
|
|
24170
|
-
}
|
|
24171
|
-
}
|
|
24172
|
-
const planTraces = plans.flatMap((plan) => [
|
|
24173
|
-
plan.trace,
|
|
24174
|
-
...plan.planeEndpointTrace ? [plan.planeEndpointTrace] : []
|
|
24175
|
-
]);
|
|
24176
|
-
const coordinateRoutePoints = planTraces.flatMap(
|
|
24177
|
-
(trace) => trace.route.filter(
|
|
24178
|
-
(routePoint) => "x" in routePoint && "y" in routePoint
|
|
24179
|
-
)
|
|
24180
|
-
);
|
|
24181
|
-
const boundsMargin = Math.max(
|
|
24182
|
-
inputSrj.defaultObstacleMargin ?? 0,
|
|
24183
|
-
inputSrj.minTraceWidth
|
|
24184
|
-
);
|
|
24185
|
-
const outputBounds = coordinateRoutePoints.length === 0 ? { ...inputSrj.bounds } : {
|
|
24186
|
-
minX: Math.min(
|
|
24187
|
-
inputSrj.bounds.minX,
|
|
24188
|
-
...coordinateRoutePoints.map(
|
|
24189
|
-
(routePoint) => routePoint.x - boundsMargin
|
|
24190
|
-
)
|
|
24191
|
-
),
|
|
24192
|
-
maxX: Math.max(
|
|
24193
|
-
inputSrj.bounds.maxX,
|
|
24194
|
-
...coordinateRoutePoints.map(
|
|
24195
|
-
(routePoint) => routePoint.x + boundsMargin
|
|
24196
|
-
)
|
|
24197
|
-
),
|
|
24198
|
-
minY: Math.min(
|
|
24199
|
-
inputSrj.bounds.minY,
|
|
24200
|
-
...coordinateRoutePoints.map(
|
|
24201
|
-
(routePoint) => routePoint.y - boundsMargin
|
|
24202
|
-
)
|
|
24203
|
-
),
|
|
24204
|
-
maxY: Math.max(
|
|
24205
|
-
inputSrj.bounds.maxY,
|
|
24206
|
-
...coordinateRoutePoints.map(
|
|
24207
|
-
(routePoint) => routePoint.y + boundsMargin
|
|
24208
|
-
)
|
|
24209
|
-
)
|
|
24210
|
-
};
|
|
24211
|
-
return {
|
|
24212
|
-
...inputSrj,
|
|
24213
|
-
fanoutPlaneConnectivity: plans.flatMap(
|
|
24214
|
-
(plan) => plan.termination.type === "plane" ? [
|
|
24215
|
-
{
|
|
24216
|
-
connectionName: plan.connectionName,
|
|
24217
|
-
layer: plan.termination.layer
|
|
24218
|
-
}
|
|
24219
|
-
] : []
|
|
24220
|
-
),
|
|
24221
|
-
bounds: outputBounds,
|
|
24222
|
-
connections: outputConnections.filter(
|
|
24223
|
-
(connection) => !planeTerminatedConnectionNames.has(connection.name)
|
|
24224
|
-
),
|
|
24225
|
-
buses: inputSrj.buses?.map((bus) => ({
|
|
24226
|
-
...bus,
|
|
24227
|
-
connectionNames: bus.connectionNames.filter(
|
|
24228
|
-
(connectionName) => !planeTerminatedConnectionNames.has(connectionName)
|
|
24229
|
-
)
|
|
24230
|
-
})).filter((bus) => bus.connectionNames.length > 0),
|
|
24231
|
-
obstacles: [
|
|
24232
|
-
...inputSrj.obstacles.map((obstacle) => ({
|
|
24233
|
-
...obstacle,
|
|
24234
|
-
center: { ...obstacle.center },
|
|
24235
|
-
layers: [...obstacle.layers],
|
|
24236
|
-
connectedTo: [...obstacle.connectedTo]
|
|
24237
|
-
})),
|
|
24238
|
-
...viaObstacles
|
|
24239
|
-
],
|
|
24240
|
-
traces: [
|
|
24241
|
-
...(inputSrj.traces ?? []).map((trace) => ({
|
|
24242
|
-
...trace,
|
|
24243
|
-
route: trace.route.map((routePoint) => ({ ...routePoint }))
|
|
24244
|
-
})),
|
|
24245
|
-
...planTraces
|
|
24246
|
-
]
|
|
24247
|
-
};
|
|
24248
|
-
}
|
|
24249
|
-
|
|
24250
24199
|
// node_modules/@tscircuit/fanout-solver/lib/match-bus-lengths.ts
|
|
24251
24200
|
var EPSILON7 = 1e-6;
|
|
24252
24201
|
function pointsMatch2(first, second) {
|
|
@@ -27938,6 +27887,58 @@ function routeSingleLayerWithPushAndShove(params) {
|
|
|
27938
27887
|
return paths.map(buildPlan4);
|
|
27939
27888
|
}
|
|
27940
27889
|
|
|
27890
|
+
// node_modules/@tscircuit/fanout-solver/lib/runtime-process.ts
|
|
27891
|
+
var getRuntimeProcess = (runtime) => runtime.process ?? { env: {} };
|
|
27892
|
+
|
|
27893
|
+
// node_modules/@tscircuit/fanout-solver/lib/shorten-bus-plans.ts
|
|
27894
|
+
function shortenBusPlans(params) {
|
|
27895
|
+
const { bus } = params;
|
|
27896
|
+
let plans = [...params.plans];
|
|
27897
|
+
if (bus.maxLengthSkew === void 0) return plans;
|
|
27898
|
+
const busPlans = plans.filter((plan) => plan.busId === bus.busId).toSorted((first, second) => second.length - first.length);
|
|
27899
|
+
for (const plan of busPlans) {
|
|
27900
|
+
const minimumLength = Math.min(
|
|
27901
|
+
...plans.filter((p) => p.busId === bus.busId).map((p) => p.length)
|
|
27902
|
+
);
|
|
27903
|
+
if (plan.length - minimumLength <= bus.maxLengthSkew) continue;
|
|
27904
|
+
if (!plan.via || plan.additionalVias?.length || plan.planeEndpointVia || plan.segments.filter((segment2) => segment2.layer === plan.sourceLayer).length !== 1)
|
|
27905
|
+
continue;
|
|
27906
|
+
const connection = bus.connections.find(
|
|
27907
|
+
(c) => c.connectionIndex === plan.connectionIndex
|
|
27908
|
+
);
|
|
27909
|
+
for (const alignGridToPads of [true, false]) {
|
|
27910
|
+
const candidate = routeViaMinimalWinding({
|
|
27911
|
+
...params,
|
|
27912
|
+
bus: {
|
|
27913
|
+
...bus,
|
|
27914
|
+
connections: [connection],
|
|
27915
|
+
routableEscapeLayers: [plan.targetLayer]
|
|
27916
|
+
},
|
|
27917
|
+
terminals: [
|
|
27918
|
+
{ connection, viaPoint: plan.via.center, exitPoint: plan.exitPoint }
|
|
27919
|
+
],
|
|
27920
|
+
targetLayer: plan.targetLayer,
|
|
27921
|
+
acceptedPlans: plans.filter((p) => p !== plan),
|
|
27922
|
+
allowBlindAndBuriedVias: false,
|
|
27923
|
+
gridStepDivisor: 2,
|
|
27924
|
+
alignGridToPads,
|
|
27925
|
+
maximumRouteOrderAttempts: 1
|
|
27926
|
+
})?.[0];
|
|
27927
|
+
if (!candidate || candidate.length >= plan.length - 1e-6) continue;
|
|
27928
|
+
const nextPlans = plans.map((p) => p === plan ? candidate : p);
|
|
27929
|
+
if (!fanoutPlansAreClear({
|
|
27930
|
+
...params,
|
|
27931
|
+
plans: nextPlans,
|
|
27932
|
+
allowBlindAndBuriedVias: false
|
|
27933
|
+
}))
|
|
27934
|
+
continue;
|
|
27935
|
+
plans = nextPlans;
|
|
27936
|
+
break;
|
|
27937
|
+
}
|
|
27938
|
+
}
|
|
27939
|
+
return plans;
|
|
27940
|
+
}
|
|
27941
|
+
|
|
27941
27942
|
// node_modules/@tscircuit/fanout-solver/lib/validate-fanout-solution.ts
|
|
27942
27943
|
var EPSILON9 = 1e-6;
|
|
27943
27944
|
function pointsMatch3(first, second) {
|
|
@@ -29037,6 +29038,7 @@ function visualizeSimpleRouteJson(srj) {
|
|
|
29037
29038
|
}
|
|
29038
29039
|
|
|
29039
29040
|
// node_modules/@tscircuit/fanout-solver/lib/fanout-solver.ts
|
|
29041
|
+
var process = getRuntimeProcess(globalThis);
|
|
29040
29042
|
var FanoutWorkSolver = class extends BaseSolver {
|
|
29041
29043
|
constructor(solverName, generator, getVisualization, getStats, getProgress) {
|
|
29042
29044
|
super();
|
|
@@ -45341,7 +45343,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
45341
45343
|
var package_default = {
|
|
45342
45344
|
name: "@tscircuit/core",
|
|
45343
45345
|
type: "module",
|
|
45344
|
-
version: "0.0.
|
|
45346
|
+
version: "0.0.1832",
|
|
45345
45347
|
types: "dist/index.d.ts",
|
|
45346
45348
|
main: "dist/index.js",
|
|
45347
45349
|
module: "dist/index.js",
|
|
@@ -45381,7 +45383,7 @@ var package_default = {
|
|
|
45381
45383
|
"@tscircuit/common": "^0.0.20",
|
|
45382
45384
|
"@tscircuit/copper-pour-solver": "^0.0.52",
|
|
45383
45385
|
"@tscircuit/create-fdm-enclosure": "0.0.4",
|
|
45384
|
-
"@tscircuit/fanout-solver": "0.0.
|
|
45386
|
+
"@tscircuit/fanout-solver": "0.0.55",
|
|
45385
45387
|
"@tscircuit/footprinter": "^0.0.426",
|
|
45386
45388
|
"@tscircuit/image-utils": "^0.0.8",
|
|
45387
45389
|
"@tscircuit/implicit-copper-pour-solver": "github:tscircuit/implicit-copper-pour-solver#d880f80e4eb7a34d5da5a521f10a63c810d4728b",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.1833",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@tscircuit/common": "^0.0.20",
|
|
42
42
|
"@tscircuit/copper-pour-solver": "^0.0.52",
|
|
43
43
|
"@tscircuit/create-fdm-enclosure": "0.0.4",
|
|
44
|
-
"@tscircuit/fanout-solver": "0.0.
|
|
44
|
+
"@tscircuit/fanout-solver": "0.0.55",
|
|
45
45
|
"@tscircuit/footprinter": "^0.0.426",
|
|
46
46
|
"@tscircuit/image-utils": "^0.0.8",
|
|
47
47
|
"@tscircuit/implicit-copper-pour-solver": "github:tscircuit/implicit-copper-pour-solver#d880f80e4eb7a34d5da5a521f10a63c810d4728b",
|