@tscircuit/core 0.0.2128 → 0.0.2129
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 +46 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -118370,11 +118370,15 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
118370
118370
|
return [...breakoutPlans, ...plans];
|
|
118371
118371
|
}
|
|
118372
118372
|
|
|
118373
|
+
// lib/utils/autorouting/routing-phase-preparation-error.ts
|
|
118374
|
+
var RoutingPhasePreparationError = class extends Error {
|
|
118375
|
+
};
|
|
118376
|
+
|
|
118373
118377
|
// package.json
|
|
118374
118378
|
var package_default = {
|
|
118375
118379
|
name: "@tscircuit/core",
|
|
118376
118380
|
type: "module",
|
|
118377
|
-
version: "0.0.
|
|
118381
|
+
version: "0.0.2128",
|
|
118378
118382
|
types: "dist/index.d.ts",
|
|
118379
118383
|
main: "dist/index.js",
|
|
118380
118384
|
module: "dist/index.js",
|
|
@@ -118661,16 +118665,27 @@ function Group_filterSimpleRouteJsonForPhase(simpleRouteJson, phasePlan) {
|
|
|
118661
118665
|
}
|
|
118662
118666
|
if (positiveConnectionIncluded) differentialPairs.push(differentialPair);
|
|
118663
118667
|
}
|
|
118664
|
-
const
|
|
118665
|
-
connections.map((connection) => [
|
|
118668
|
+
const srjConnectionByName = new Map(
|
|
118669
|
+
simpleRouteJson.connections.map((connection) => [
|
|
118670
|
+
connection.name,
|
|
118671
|
+
connection
|
|
118672
|
+
])
|
|
118666
118673
|
);
|
|
118667
118674
|
const buses = (simpleRouteJson.buses ?? []).map((bus) => {
|
|
118668
118675
|
const connectionNames = bus.connectionNames.filter(
|
|
118669
118676
|
(connectionName) => includedConnectionNames.has(connectionName)
|
|
118670
118677
|
);
|
|
118678
|
+
const cohortConnectionNames = bus.connectionNames.filter(
|
|
118679
|
+
(connectionName) => srjConnectionByName.get(connectionName)?.routingPcbGroupId === phasePlan.routingPcbGroupId
|
|
118680
|
+
);
|
|
118681
|
+
if (bus.maxLengthSkew !== void 0 && connectionNames.length > 0 && connectionNames.length !== cohortConnectionNames.length) {
|
|
118682
|
+
throw new RoutingPhasePreparationError(
|
|
118683
|
+
`Length-matched bus "${bus.name || "unnamed bus"}" cannot be split across autorouting phases. Assign the complete bus to one routingPhaseIndex.`
|
|
118684
|
+
);
|
|
118685
|
+
}
|
|
118671
118686
|
const connectionExitTargets = Object.fromEntries(
|
|
118672
118687
|
connectionNames.flatMap((connectionName) => {
|
|
118673
|
-
const connection =
|
|
118688
|
+
const connection = srjConnectionByName.get(connectionName);
|
|
118674
118689
|
if (!connection) return [];
|
|
118675
118690
|
const pairedTarget = getPairedBreakoutExitTarget(
|
|
118676
118691
|
simpleRouteJson,
|
|
@@ -120961,10 +120976,33 @@ var Group5 = class extends NormalComponent {
|
|
|
120961
120976
|
if (this._hasStartedAsyncAutorouting) return;
|
|
120962
120977
|
this._hasStartedAsyncAutorouting = true;
|
|
120963
120978
|
if (this._getAutorouterConfig().local) {
|
|
120964
|
-
this._queueAsyncEffect(
|
|
120965
|
-
|
|
120966
|
-
|
|
120967
|
-
|
|
120979
|
+
this._queueAsyncEffect("autorouting", async () => {
|
|
120980
|
+
try {
|
|
120981
|
+
await this._runLocalAutorouting();
|
|
120982
|
+
} catch (error) {
|
|
120983
|
+
if (!(error instanceof RoutingPhasePreparationError)) throw error;
|
|
120984
|
+
const { db: db2 } = this.root;
|
|
120985
|
+
const pcbErrorId = `pcb_autorouter_error_subcircuit_${this.subcircuit_id}`;
|
|
120986
|
+
const alreadyRecorded = db2.pcb_autorouting_error.list().some(
|
|
120987
|
+
(recordedError) => recordedError.pcb_error_id === pcbErrorId && recordedError.message === error.message
|
|
120988
|
+
);
|
|
120989
|
+
if (!alreadyRecorded) {
|
|
120990
|
+
db2.pcb_autorouting_error.insert({
|
|
120991
|
+
pcb_error_id: pcbErrorId,
|
|
120992
|
+
error_type: "pcb_autorouting_error",
|
|
120993
|
+
message: error.message,
|
|
120994
|
+
subcircuit_id: this.subcircuit_id ?? void 0
|
|
120995
|
+
});
|
|
120996
|
+
this.root?.emit("autorouting:error", {
|
|
120997
|
+
type: "autorouting:error",
|
|
120998
|
+
subcircuit_id: this.subcircuit_id,
|
|
120999
|
+
componentDisplayName: this.getString(),
|
|
121000
|
+
error: { message: error.message }
|
|
121001
|
+
});
|
|
121002
|
+
}
|
|
121003
|
+
throw error;
|
|
121004
|
+
}
|
|
121005
|
+
});
|
|
120968
121006
|
} else {
|
|
120969
121007
|
this._queueAsyncEffect(
|
|
120970
121008
|
"make-http-autorouting-request",
|