@tscircuit/fanout-solver 0.0.42 → 0.0.43

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.
@@ -445,6 +445,7 @@ export function shouldUseJointBoundaryViaReservation(
445
445
  ): boolean {
446
446
  return (
447
447
  boundaryBusConnectionCounts.length === 5 ||
448
+ boundaryBusConnectionCounts.length === 6 ||
448
449
  (boundaryBusConnectionCounts.length === 4 &&
449
450
  new Set(boundaryBusConnectionCounts).size > 1)
450
451
  )
@@ -454,17 +455,32 @@ export function shouldDeferSingletonBoundaryViaReservation(
454
455
  boundaryBusConnectionCounts: readonly number[],
455
456
  ): boolean {
456
457
  return (
457
- boundaryBusConnectionCounts.length === 5 &&
458
+ (boundaryBusConnectionCounts.length === 5 ||
459
+ boundaryBusConnectionCounts.length === 6) &&
458
460
  boundaryBusConnectionCounts.filter((count) => count === 1).length === 1
459
461
  )
460
462
  }
461
463
 
462
464
  export function shouldSearchAdditionalBoundaryRouteTopologies(params: {
463
465
  boundaryBusCount: number
466
+ connectionCount: number
464
467
  rawSkew: number
465
468
  maximumSkew: number
466
469
  }): boolean {
467
- if (params.boundaryBusCount >= 5) return false
470
+ if (params.boundaryBusCount === 5 || params.boundaryBusCount > 6) {
471
+ return false
472
+ }
473
+ if (params.boundaryBusCount === 6) {
474
+ // A sixth bus removes enough meander space that a severely skewed wide
475
+ // topology can be impossible to tune. Keep the retry away from narrow
476
+ // differential/control groups and from modest deficits that the atomic
477
+ // length matcher can absorb directly.
478
+ return (
479
+ params.connectionCount > 2 &&
480
+ params.rawSkew - params.maximumSkew >
481
+ Math.max(1, params.maximumSkew * 0.5)
482
+ )
483
+ }
468
484
  return (
469
485
  params.rawSkew - params.maximumSkew > Math.max(1, params.maximumSkew * 0.25)
470
486
  )
@@ -803,7 +819,14 @@ export class FanoutSolver extends BaseSolver {
803
819
  const layerDifference =
804
820
  this.config.layerNames.indexOf(firstLayer ?? "") -
805
821
  this.config.layerNames.indexOf(secondLayer ?? "")
806
- return -layerDifference
822
+ if (layerDifference !== 0) return -layerDifference
823
+ if (unsortedBoundaryBuses.length !== 6) return 0
824
+ // The general routing order can differ across the two components as a
825
+ // function of local pad geometry. Keep otherwise-equivalent corner buses
826
+ // in one deterministic order for the six-bus path so their boundary
827
+ // lanes do not swap between the two ends of a direct interconnect. Leave
828
+ // the released four- and five-bus tie behavior unchanged.
829
+ return first.busId.localeCompare(second.busId)
807
830
  })
808
831
  // Preserve the caller/input order for the dense singleton fill. The
809
832
  // general routing sort is useful for heterogeneous buses, but ordering a
@@ -815,7 +838,7 @@ export class FanoutSolver extends BaseSolver {
815
838
  )
816
839
  if (
817
840
  boundaryBuses.length === 0 ||
818
- boundaryBuses.length > 5 ||
841
+ boundaryBuses.length > 6 ||
819
842
  planeBuses.length < 8 ||
820
843
  boundaryBuses.some((bus) => !busUsesCoordinatedWinding(bus)) ||
821
844
  planeBuses.some((bus) => bus.connections.length !== 1) ||
@@ -862,7 +885,7 @@ export class FanoutSolver extends BaseSolver {
862
885
  ),
863
886
  )
864
887
  }
865
- // Five boundary buses, and heterogeneous four-bus groups, leave too little
888
+ // Five or six boundary buses, and heterogeneous four-bus groups, leave too little
866
889
  // slack for incremental site allocation: a valid early trace can consume
867
890
  // the last dogbone site of a later narrow bus. Reserve the multi-line bus
868
891
  // barrels before routing copper. A single one-line bus stays provisional
@@ -975,6 +998,7 @@ export class FanoutSolver extends BaseSolver {
975
998
  const needsRouteDiversity =
976
999
  shouldSearchAdditionalBoundaryRouteTopologies({
977
1000
  boundaryBusCount: boundaryBuses.length,
1001
+ connectionCount: bus.connections.length,
978
1002
  rawSkew,
979
1003
  maximumSkew: bus.maxLengthSkew,
980
1004
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/fanout-solver",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "BGA fanout solver with coordinated bus-layer escapes for SimpleRouteJson",
5
5
  "module": "lib/index.ts",
6
6
  "type": "module",