@tscircuit/capacity-autorouter 0.0.279 → 0.0.281
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.d.ts +63 -44
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2085,19 +2085,33 @@ declare class MultiSectionPortPointOptimizer extends BaseSolver {
|
|
|
2085
2085
|
}
|
|
2086
2086
|
|
|
2087
2087
|
type Side = "left" | "right" | "top" | "bottom";
|
|
2088
|
+
type OwnerPair = [string, string];
|
|
2089
|
+
type OwnerPairKey = string;
|
|
2090
|
+
type EdgeOrientation = "vertical" | "horizontal";
|
|
2088
2091
|
type Bounds = {
|
|
2089
2092
|
minX: number;
|
|
2090
2093
|
maxX: number;
|
|
2091
2094
|
minY: number;
|
|
2092
2095
|
maxY: number;
|
|
2093
2096
|
};
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
}
|
|
2098
|
-
type
|
|
2099
|
-
|
|
2100
|
-
|
|
2097
|
+
type PortPointWithOwnerPair = PortPoint & {
|
|
2098
|
+
ownerNodeIds: OwnerPair;
|
|
2099
|
+
ownerPairKey: OwnerPairKey;
|
|
2100
|
+
};
|
|
2101
|
+
type SharedEdge = {
|
|
2102
|
+
ownerNodeIds: OwnerPair;
|
|
2103
|
+
ownerPairKey: OwnerPairKey;
|
|
2104
|
+
orientation: EdgeOrientation;
|
|
2105
|
+
x1: number;
|
|
2106
|
+
y1: number;
|
|
2107
|
+
x2: number;
|
|
2108
|
+
y2: number;
|
|
2109
|
+
center: {
|
|
2110
|
+
x: number;
|
|
2111
|
+
y: number;
|
|
2112
|
+
};
|
|
2113
|
+
length: number;
|
|
2114
|
+
nodeSideByOwnerId: Record<string, Side>;
|
|
2101
2115
|
};
|
|
2102
2116
|
|
|
2103
2117
|
interface UniformPortDistributionSolverInput {
|
|
@@ -2110,20 +2124,19 @@ interface UniformPortDistributionSolverInput {
|
|
|
2110
2124
|
* routing density and prevent congestion.
|
|
2111
2125
|
*
|
|
2112
2126
|
* This solver:
|
|
2113
|
-
* 1.
|
|
2114
|
-
* 2.
|
|
2115
|
-
* 3. Evenly spaces port points along their
|
|
2127
|
+
* 1. Determines an owner pair of capacity nodes for each port point.
|
|
2128
|
+
* 2. Precomputes the shared edge for each owner pair.
|
|
2129
|
+
* 3. Evenly spaces "family" port points along their shared edge.
|
|
2116
2130
|
*/
|
|
2117
2131
|
declare class UniformPortDistributionSolver extends BaseSolver$1 {
|
|
2118
2132
|
private input;
|
|
2119
2133
|
getSolverName(): string;
|
|
2120
|
-
mapOfNodeIdToLengthOfEachSide: Map<string, Record<Side, number>>;
|
|
2121
|
-
sidesToProcess: NodeAndSide[];
|
|
2122
2134
|
mapOfNodeIdToBounds: Map<string, Bounds>;
|
|
2123
|
-
|
|
2124
|
-
|
|
2135
|
+
mapOfOwnerPairToPortPoints: Map<string, PortPointWithOwnerPair[]>;
|
|
2136
|
+
mapOfOwnerPairToSharedEdge: Map<string, SharedEdge>;
|
|
2137
|
+
ownerPairsToProcess: OwnerPairKey[];
|
|
2138
|
+
currentOwnerPairBeingProcessed: OwnerPairKey | null;
|
|
2125
2139
|
redistributedNodes: NodeWithPortPoints[];
|
|
2126
|
-
private getNodeAndSideKey;
|
|
2127
2140
|
constructor(input: UniformPortDistributionSolverInput);
|
|
2128
2141
|
step(): void;
|
|
2129
2142
|
rebuildNodes(): void;
|
|
@@ -4304,33 +4317,37 @@ type HgPort = RegionPort & {
|
|
|
4304
4317
|
d: InputPortPoint;
|
|
4305
4318
|
};
|
|
4306
4319
|
|
|
4320
|
+
type RegionId = CapacityMeshNodeId;
|
|
4321
|
+
type RegionMemoryPfMap = Map<RegionId, number>;
|
|
4322
|
+
type RegionRipCountMap = Map<RegionId, number>;
|
|
4307
4323
|
interface HgPortPointPathingSolverParams {
|
|
4308
4324
|
inputGraph: HyperGraph;
|
|
4309
4325
|
inputConnections: Connection[];
|
|
4310
4326
|
connectionsWithResults: ConnectionPathResult[];
|
|
4311
4327
|
inputNodes: InputNodeWithPortPoints[];
|
|
4312
4328
|
portPointMap: Map<string, InputPortPoint>;
|
|
4313
|
-
|
|
4329
|
+
regionMemoryPfMap: RegionMemoryPfMap;
|
|
4314
4330
|
rippingEnabled: boolean;
|
|
4315
4331
|
forceCenterFirst: boolean;
|
|
4316
4332
|
weights: {
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4333
|
+
GREEDY_MULTIPLIER: number;
|
|
4334
|
+
RIP_COST: number;
|
|
4335
|
+
PORT_USAGE_PENALTY: number;
|
|
4336
|
+
REGION_TRANSITION_PENALTY: number;
|
|
4337
|
+
MEMORY_PF_FACTOR: number;
|
|
4338
|
+
CENTER_OFFSET_DIST_PENALTY_FACTOR: number;
|
|
4339
|
+
STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR: number;
|
|
4340
|
+
RIP_REGION_PF_THRESHOLD_START: number;
|
|
4341
|
+
MAX_REGION_RIPS: number;
|
|
4342
|
+
RANDOM_RIP_FRACTION: number;
|
|
4343
|
+
MAX_RIPS: number;
|
|
4344
|
+
MIN_ALLOWED_BOARD_SCORE: number;
|
|
4327
4345
|
};
|
|
4328
|
-
MIN_ALLOWED_BOARD_SCORE: number;
|
|
4329
4346
|
}
|
|
4330
4347
|
declare class HgPortPointPathingSolver extends HyperGraphSolver<HgRegion, HgPort> {
|
|
4331
4348
|
inputNodes: InputNodeWithPortPoints[];
|
|
4332
|
-
|
|
4333
|
-
|
|
4349
|
+
regionNodeMap: Map<RegionId, InputNodeWithPortPoints>;
|
|
4350
|
+
regionById: Map<RegionId, HgRegion>;
|
|
4334
4351
|
portPointMap: Map<string, InputPortPoint>;
|
|
4335
4352
|
connectionsWithResults: ConnectionPathResult[];
|
|
4336
4353
|
assignedPortPoints: Map<string, {
|
|
@@ -4341,22 +4358,23 @@ declare class HgPortPointPathingSolver extends HyperGraphSolver<HgRegion, HgPort
|
|
|
4341
4358
|
assignmentsBuilt: boolean;
|
|
4342
4359
|
portUsagePenalty: number;
|
|
4343
4360
|
regionTransitionPenalty: number;
|
|
4344
|
-
|
|
4345
|
-
|
|
4361
|
+
ripRegionPfThresholdStart: number;
|
|
4362
|
+
maxRegionRips: number;
|
|
4346
4363
|
memoryPfFactor: number;
|
|
4364
|
+
centerOffsetDistPenaltyFactor: number;
|
|
4347
4365
|
forceCenterFirst: boolean;
|
|
4348
4366
|
straightLineDeviationPenaltyFactor: number;
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4367
|
+
connectionResultByName: Map<string, ConnectionPathResult>;
|
|
4368
|
+
regionRipCountMap: RegionRipCountMap;
|
|
4369
|
+
regionMemoryPfMap: RegionMemoryPfMap;
|
|
4352
4370
|
totalRipCount: number;
|
|
4353
4371
|
randomRipFraction: number;
|
|
4354
4372
|
maxRips: number;
|
|
4355
4373
|
MIN_ALLOWED_BOARD_SCORE: number;
|
|
4356
|
-
constructor({ inputGraph, inputConnections, connectionsWithResults, inputNodes, portPointMap,
|
|
4374
|
+
constructor({ inputGraph, inputConnections, connectionsWithResults, inputNodes, portPointMap, regionMemoryPfMap, rippingEnabled, weights, forceCenterFirst, }: HgPortPointPathingSolverParams);
|
|
4357
4375
|
private clampPf;
|
|
4358
4376
|
private pfToFailureCost;
|
|
4359
|
-
private
|
|
4377
|
+
private recordRegionMemoryPf;
|
|
4360
4378
|
estimateCostToEnd(port: HgPort): number;
|
|
4361
4379
|
computeH(candidate: Candidate$3<HgRegion, HgPort>): number;
|
|
4362
4380
|
private getStraightLineDeviationPenalty;
|
|
@@ -4364,22 +4382,23 @@ declare class HgPortPointPathingSolver extends HyperGraphSolver<HgRegion, HgPort
|
|
|
4364
4382
|
getPortUsagePenalty(port: HgPort): number;
|
|
4365
4383
|
getRipsRequiredForPortUsage(region: HgRegion, port1: HgPort, port2: HgPort): RegionPortAssignment[];
|
|
4366
4384
|
private isPortAvailableForCurrentNet;
|
|
4367
|
-
private
|
|
4385
|
+
private getCenterFirstEnteringRegionCandidates;
|
|
4368
4386
|
selectCandidatesForEnteringRegion(candidates: Candidate$3<HgRegion, HgPort>[]): Candidate$3<HgRegion, HgPort>[];
|
|
4369
4387
|
routeSolvedHook(solvedRoute: SolvedRoute): void;
|
|
4370
4388
|
_step(): void;
|
|
4371
4389
|
private enforceBoardScoreGuardrail;
|
|
4372
4390
|
private buildAssignmentsIfSolved;
|
|
4373
|
-
private
|
|
4391
|
+
private getRegionRippingPfThreshold;
|
|
4374
4392
|
private getPortPointsFromRegionAssignments;
|
|
4375
4393
|
private getPortPointsFromNewlySolvedRouteInRegion;
|
|
4376
|
-
private
|
|
4377
|
-
private
|
|
4394
|
+
private computeRegionPf;
|
|
4395
|
+
private computeRegionPfFromAssignments;
|
|
4378
4396
|
private getDerivedCapacityMeshNode;
|
|
4379
|
-
private
|
|
4380
|
-
private
|
|
4381
|
-
private
|
|
4382
|
-
private
|
|
4397
|
+
private getCrossingRoutesByRegionForRoute;
|
|
4398
|
+
private getRoutesInRegionForRipping;
|
|
4399
|
+
private getTraversedRegionIds;
|
|
4400
|
+
private processRandomRips;
|
|
4401
|
+
private processRippingForRoute;
|
|
4383
4402
|
computeRoutesToRip(newlySolvedRoute: SolvedRoute): Set<SolvedRoute>;
|
|
4384
4403
|
getNodesWithPortPoints(): NodeWithPortPoints[];
|
|
4385
4404
|
computeBoardScore(): number;
|