@tscircuit/core 0.0.1875 → 0.0.1877

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.
Files changed (2) hide show
  1. package/dist/index.js +83 -8
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -24078,11 +24078,21 @@ function routePlaneTerminatedBus(params) {
24078
24078
  (direction) => direction !== bus.direction
24079
24079
  )
24080
24080
  ];
24081
- for (const direction of candidateDirections) {
24081
+ const candidateDirectionPasses = [
24082
+ ...candidateDirections.map((direction) => ({
24083
+ direction,
24084
+ centeredOutward: false
24085
+ })),
24086
+ ...candidateDirections.map((direction) => ({
24087
+ direction,
24088
+ centeredOutward: true
24089
+ }))
24090
+ ];
24091
+ for (const { direction, centeredOutward } of candidateDirectionPasses) {
24082
24092
  const directionalBus = direction === bus.direction ? bus : { ...bus, direction };
24083
24093
  const directionalPadSize = isHorizontal(direction) ? sourceObstacle.width : sourceObstacle.height;
24084
24094
  const pairChannelFitsVia = getDirectionalPitch(directionalBus) / 2 - directionalPadSize / 2 >= viaDiameter / 2 + clearance - 1e-9;
24085
- const viaHandednesses = pairChannelFitsVia ? [0] : [1, -1];
24095
+ const viaHandednesses = centeredOutward ? !pairChannelFitsVia && busIsOnOutwardComponentEdge(directionalBus) ? [0] : [] : pairChannelFitsVia ? [0] : [1, -1];
24086
24096
  for (const viaHandedness of viaHandednesses) {
24087
24097
  for (const connectionOrder of getConnectionOrders(directionalBus)) {
24088
24098
  const candidatePlans = [];
@@ -34739,6 +34749,39 @@ var FanoutSolver = class extends BaseSolver {
34739
34749
  const wideBoundaryBuses = unsortedBoundaryBuses.filter(
34740
34750
  (bus) => bus.connections.length >= 8
34741
34751
  );
34752
+ const hasForeignAllLayerObstaclesInComponent = wideBoundaryBuses.some(
34753
+ (bus) => this.routingSrj.obstacles.some(
34754
+ (obstacle) => obstacle.componentId !== bus.componentId && this.config.layerNames.every(
34755
+ (layer) => obstacle.layers.includes(layer)
34756
+ ) && obstacle.center.x >= bus.componentBounds.minX && obstacle.center.x <= bus.componentBounds.maxX && obstacle.center.y >= bus.componentBounds.minY && obstacle.center.y <= bus.componentBounds.maxY
34757
+ )
34758
+ );
34759
+ const dogboneCandidateCountByConnectionIndex = /* @__PURE__ */ new Map();
34760
+ if (hasForeignAllLayerObstaclesInComponent) {
34761
+ for (const candidate of getComponentDogboneViaSiteCandidates(
34762
+ unsortedBoundaryBuses,
34763
+ {
34764
+ viaDiameter: this.config.viaDiameter,
34765
+ viaHoleDiameter: this.config.viaHoleDiameter,
34766
+ traceWidth: this.config.traceWidth,
34767
+ clearance: this.config.clearance,
34768
+ additionalObstacles: this.routingSrj.obstacles
34769
+ }
34770
+ )) {
34771
+ dogboneCandidateCountByConnectionIndex.set(
34772
+ candidate.connectionIndex,
34773
+ (dogboneCandidateCountByConnectionIndex.get(
34774
+ candidate.connectionIndex
34775
+ ) ?? 0) + 1
34776
+ );
34777
+ }
34778
+ }
34779
+ const getBusDogboneCandidateCount = (bus) => bus.connections.reduce(
34780
+ (total, connection) => total + (dogboneCandidateCountByConnectionIndex.get(
34781
+ connection.connectionIndex
34782
+ ) ?? 0),
34783
+ 0
34784
+ );
34742
34785
  const adjacentCenteredFieldByTurningBus = /* @__PURE__ */ new Map();
34743
34786
  if (usePadAlignedDenseRouting && !configuredDensePlaneRouting) {
34744
34787
  for (const bus of wideBoundaryBuses) {
@@ -34826,6 +34869,12 @@ var FanoutSolver = class extends BaseSolver {
34826
34869
  ...unsortedBoundaryBuses.map((bus) => bus.connections.length)
34827
34870
  ) >= 8 ? first.connections.length - second.connections.length : second.connections.length - first.connections.length;
34828
34871
  if (connectionCountDifference !== 0) return connectionCountDifference;
34872
+ if (hasForeignAllLayerObstaclesInComponent && first.connections.length >= 8 && second.connections.length >= 8) {
34873
+ const dogboneCandidateCountDifference = getBusDogboneCandidateCount(first) - getBusDogboneCandidateCount(second);
34874
+ if (dogboneCandidateCountDifference !== 0) {
34875
+ return dogboneCandidateCountDifference;
34876
+ }
34877
+ }
34829
34878
  }
34830
34879
  const firstLayer = params.busLayerAssignments[first.busId];
34831
34880
  const secondLayer = params.busLayerAssignments[second.busId];
@@ -35226,9 +35275,9 @@ var FanoutSolver = class extends BaseSolver {
35226
35275
  yield;
35227
35276
  if (seedViaPoints) {
35228
35277
  const denseBoundaryBusesInRoutingOrder = [
35229
- ...multiLayerLeadingSingletonBuses,
35278
+ ...hasForeignAllLayerObstaclesInComponent ? [] : multiLayerLeadingSingletonBuses,
35230
35279
  ...boundaryBuses.filter(
35231
- (bus) => !multiLayerLeadingSingletonBuses.includes(bus) && !throughAllLeadingBuses.includes(bus)
35280
+ (bus) => (hasForeignAllLayerObstaclesInComponent || !multiLayerLeadingSingletonBuses.includes(bus)) && !throughAllLeadingBuses.includes(bus)
35232
35281
  ).flatMap((bus) => [
35233
35282
  ...throughAllLeadingBuses.filter(
35234
35283
  (candidate) => getContainingWideSourceField(candidate) === bus
@@ -36866,7 +36915,7 @@ var FanoutSolver = class extends BaseSolver {
36866
36915
  debugDense("plane-route:start", bus.busId);
36867
36916
  const targetLayer = params.busLayerAssignments[bus.busId];
36868
36917
  const blockingBusCounts = /* @__PURE__ */ new Map();
36869
- const busPlans = targetLayer ? routeBus({
36918
+ let busPlans = targetLayer ? routeBus({
36870
36919
  srj: this.routingSrj,
36871
36920
  bus,
36872
36921
  targetLayer,
@@ -36883,6 +36932,32 @@ var FanoutSolver = class extends BaseSolver {
36883
36932
  blockingBusCounts,
36884
36933
  fixedViaPointsByConnectionIndex
36885
36934
  }) : null;
36935
+ if (!busPlans && targetLayer && hasForeignAllLayerObstaclesInComponent) {
36936
+ busPlans = routeBus({
36937
+ srj: this.routingSrj,
36938
+ bus,
36939
+ targetLayer,
36940
+ acceptedPlans: matchedPlans,
36941
+ layerNames: this.config.layerNames,
36942
+ traceWidth: this.config.traceWidth,
36943
+ viaDiameter: this.config.viaDiameter,
36944
+ viaHoleDiameter: this.config.viaHoleDiameter,
36945
+ clearance: this.config.clearance,
36946
+ compactBusTracks: this.config.compactBusTracks,
36947
+ allowBlindAndBuriedVias: false,
36948
+ allowSameNetMerges: this.config.allowSameNetMerges,
36949
+ staticClearanceCache: this.routeStaticClearanceCache,
36950
+ blockingBusCounts
36951
+ });
36952
+ if (busPlans) {
36953
+ fixedViaPointsByConnectionIndex = new Map([
36954
+ ...fixedViaPointsByConnectionIndex,
36955
+ ...busPlans.flatMap(
36956
+ (plan) => plan.via ? [[plan.connectionIndex, plan.via.center]] : []
36957
+ )
36958
+ ]);
36959
+ }
36960
+ }
36886
36961
  if (!busPlans) {
36887
36962
  debugDense(
36888
36963
  "plane-route:failed",
@@ -51467,7 +51542,7 @@ function Group_getRoutingPhasePlans(group) {
51467
51542
  var package_default = {
51468
51543
  name: "@tscircuit/core",
51469
51544
  type: "module",
51470
- version: "0.0.1874",
51545
+ version: "0.0.1876",
51471
51546
  types: "dist/index.d.ts",
51472
51547
  main: "dist/index.js",
51473
51548
  module: "dist/index.js",
@@ -51501,13 +51576,13 @@ var package_default = {
51501
51576
  "@tsci/tscircuit.ti": "github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157",
51502
51577
  "@tscircuit/alphabet": "0.0.25",
51503
51578
  "@tscircuit/bga-fanout-solver": "github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39",
51504
- "@tscircuit/capacity-autorouter": "^0.0.890",
51579
+ "@tscircuit/capacity-autorouter": "^0.0.892",
51505
51580
  "@tscircuit/checks": "^0.0.185",
51506
51581
  "@tscircuit/circuit-json-util": "^0.0.106",
51507
51582
  "@tscircuit/common": "^0.0.20",
51508
51583
  "@tscircuit/copper-pour-solver": "^0.0.54",
51509
51584
  "@tscircuit/create-fdm-enclosure": "0.0.4",
51510
- "@tscircuit/fanout-solver": "0.0.66",
51585
+ "@tscircuit/fanout-solver": "0.0.68",
51511
51586
  "@tscircuit/footprinter": "^0.0.426",
51512
51587
  "@tscircuit/image-utils": "^0.0.8",
51513
51588
  "@tscircuit/implicit-copper-pour-solver": "github:tscircuit/implicit-copper-pour-solver#a5cbbda0cd65fd4707c5c1af25779837c25aba92",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1875",
4
+ "version": "0.0.1877",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -35,13 +35,13 @@
35
35
  "@tsci/tscircuit.ti": "github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157",
36
36
  "@tscircuit/alphabet": "0.0.25",
37
37
  "@tscircuit/bga-fanout-solver": "github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39",
38
- "@tscircuit/capacity-autorouter": "^0.0.890",
38
+ "@tscircuit/capacity-autorouter": "^0.0.892",
39
39
  "@tscircuit/checks": "^0.0.185",
40
40
  "@tscircuit/circuit-json-util": "^0.0.106",
41
41
  "@tscircuit/common": "^0.0.20",
42
42
  "@tscircuit/copper-pour-solver": "^0.0.54",
43
43
  "@tscircuit/create-fdm-enclosure": "0.0.4",
44
- "@tscircuit/fanout-solver": "0.0.66",
44
+ "@tscircuit/fanout-solver": "0.0.68",
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#a5cbbda0cd65fd4707c5c1af25779837c25aba92",