@tscircuit/capacity-autorouter 0.0.864 → 0.0.866
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/README.md +20 -0
- package/dist/index.d.ts +136 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,6 +49,26 @@ if (solver.failed) {
|
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
### Simplifying Existing Traces
|
|
53
|
+
|
|
54
|
+
Use `AutoroutingPipelineSolver11_Simplification` when the input already
|
|
55
|
+
contains routed traces and only needs post-route cleanup. This pipeline does
|
|
56
|
+
not route missing SRJ connections. Constant-width traces are simplified while
|
|
57
|
+
variable-width traces retain their exact copper widths and geometry.
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { AutoroutingPipelineSolver11_Simplification } from "@tscircuit/capacity-autorouter"
|
|
61
|
+
|
|
62
|
+
const solver = new AutoroutingPipelineSolver11_Simplification(simpleRouteJson)
|
|
63
|
+
solver.solve()
|
|
64
|
+
|
|
65
|
+
if (solver.failed) {
|
|
66
|
+
throw new Error(solver.error ?? "Trace simplification failed")
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const simplified = solver.getOutputSimpleRouteJson()
|
|
70
|
+
```
|
|
71
|
+
|
|
52
72
|
### Input Format: SimpleRouteJson
|
|
53
73
|
|
|
54
74
|
The input to the autorouter is a `SimpleRouteJson` object with the following structure:
|
package/dist/index.d.ts
CHANGED
|
@@ -2541,6 +2541,8 @@ declare class TraceSimplificationSolver extends BaseSolver {
|
|
|
2541
2541
|
* - enableCrossingViaReduction: Enables coordinated crossing layer swaps
|
|
2542
2542
|
* - preserveRouteEndpoints: Prevents simplification from moving endpoint
|
|
2543
2543
|
* coordinates or layers when routes represent spliceable local sections
|
|
2544
|
+
* - useTraceWidthAwareClearance: Uses each route segment's actual copper
|
|
2545
|
+
* width when checking path-simplification clearance
|
|
2544
2546
|
* - terminalLayerIndicesByPcbPortId: Physical copper-layer indices on
|
|
2545
2547
|
* which each PCB-port terminal can directly accept a route endpoint
|
|
2546
2548
|
* without a via
|
|
@@ -2563,6 +2565,7 @@ declare class TraceSimplificationSolver extends BaseSolver {
|
|
|
2563
2565
|
readonly netByConnectionName?: ReadonlyMap<string, string>;
|
|
2564
2566
|
readonly enableCrossingViaReduction?: boolean;
|
|
2565
2567
|
readonly preserveRouteEndpoints?: boolean;
|
|
2568
|
+
readonly useTraceWidthAwareClearance?: boolean;
|
|
2566
2569
|
readonly terminalLayerIndicesByPcbPortId?: ReadonlyMap<string, ReadonlySet<number>>;
|
|
2567
2570
|
});
|
|
2568
2571
|
private validatePreservedRouteEndpoints;
|
|
@@ -6664,6 +6667,136 @@ declare class AutoroutingPipelineSolver10_BgaFanout extends BasePipelineSolver<A
|
|
|
6664
6667
|
finalVisualize(): GraphicsObject;
|
|
6665
6668
|
}
|
|
6666
6669
|
|
|
6670
|
+
type PreparedPipeline11Trace = {
|
|
6671
|
+
originalTrace: SimplifiedPcbTrace;
|
|
6672
|
+
mutableHdRoute?: HighDensityRoute$1;
|
|
6673
|
+
leadingTerminalVias: SimplifiedPcbTrace["route"];
|
|
6674
|
+
trailingTerminalVias: SimplifiedPcbTrace["route"];
|
|
6675
|
+
uniformTraceWidth?: number;
|
|
6676
|
+
viaHoleDiameter: number;
|
|
6677
|
+
};
|
|
6678
|
+
type PreparedPipeline11Simplification = {
|
|
6679
|
+
originalSrj: SimpleRouteJson;
|
|
6680
|
+
srj: SimpleRouteJson;
|
|
6681
|
+
connMap: ConnectivityMap;
|
|
6682
|
+
colorMap: Record<string, string>;
|
|
6683
|
+
immutableHdRoutes: HighDensityRoute$1[];
|
|
6684
|
+
mutableHdRoutes: HighDensityRoute$1[];
|
|
6685
|
+
netByConnectionName: Map<string, string>;
|
|
6686
|
+
options: AutoroutingPipelineSolver11SimplificationOptions;
|
|
6687
|
+
preparedTraces: PreparedPipeline11Trace[];
|
|
6688
|
+
};
|
|
6689
|
+
type PrepareTraceSimplificationSolverInput = {
|
|
6690
|
+
inputSrj: SimpleRouteJson;
|
|
6691
|
+
options: AutoroutingPipelineSolver11SimplificationOptions;
|
|
6692
|
+
};
|
|
6693
|
+
declare class PrepareTraceSimplificationSolver extends BaseSolver$1 {
|
|
6694
|
+
private readonly preparedInput;
|
|
6695
|
+
private readonly seenTraceIds;
|
|
6696
|
+
private nextTraceIndex;
|
|
6697
|
+
constructor(input: PrepareTraceSimplificationSolverInput);
|
|
6698
|
+
getSolverName(): string;
|
|
6699
|
+
_step(): void;
|
|
6700
|
+
private prepareTrace;
|
|
6701
|
+
getOutput(): PreparedPipeline11Simplification;
|
|
6702
|
+
}
|
|
6703
|
+
|
|
6704
|
+
type ApplyTraceSimplificationSolverInput = {
|
|
6705
|
+
preparedInput: PreparedPipeline11Simplification;
|
|
6706
|
+
simplifiedHdRoutes: HighDensityRoute$1[];
|
|
6707
|
+
};
|
|
6708
|
+
/** Converts one simplified high-density route back to SRJ per step. */
|
|
6709
|
+
declare class ApplyTraceSimplificationSolver extends BaseSolver$1 {
|
|
6710
|
+
readonly inputProblem: ApplyTraceSimplificationSolverInput;
|
|
6711
|
+
private readonly simplifiedRouteByTraceId;
|
|
6712
|
+
private readonly outputTraces;
|
|
6713
|
+
private nextTraceIndex;
|
|
6714
|
+
constructor(inputProblem: ApplyTraceSimplificationSolverInput);
|
|
6715
|
+
getSolverName(): string;
|
|
6716
|
+
_step(): void;
|
|
6717
|
+
private applyTrace;
|
|
6718
|
+
private finishApplication;
|
|
6719
|
+
getConstructorParams(): readonly [
|
|
6720
|
+
ApplyTraceSimplificationSolverInput
|
|
6721
|
+
];
|
|
6722
|
+
getOutput(): SimpleRouteJson;
|
|
6723
|
+
}
|
|
6724
|
+
|
|
6725
|
+
type TraceSimplificationStageSolverInput = {
|
|
6726
|
+
preparedInput: PreparedPipeline11Simplification;
|
|
6727
|
+
};
|
|
6728
|
+
/** Adapts the incremental cleanup solver to the conventional pipeline API. */
|
|
6729
|
+
declare class TraceSimplificationStageSolver extends BaseSolver$1 {
|
|
6730
|
+
readonly inputProblem: TraceSimplificationStageSolverInput;
|
|
6731
|
+
readonly traceSimplificationSolver: TraceSimplificationSolver;
|
|
6732
|
+
constructor(inputProblem: TraceSimplificationStageSolverInput);
|
|
6733
|
+
getSolverName(): string;
|
|
6734
|
+
/** Advances exactly one incremental unit of the wrapped solver. */
|
|
6735
|
+
_step(): void;
|
|
6736
|
+
getConstructorParams(): readonly [
|
|
6737
|
+
TraceSimplificationStageSolverInput
|
|
6738
|
+
];
|
|
6739
|
+
getOutput(): HighDensityRoute$1[];
|
|
6740
|
+
visualize(): GraphicsObject;
|
|
6741
|
+
preview(): GraphicsObject;
|
|
6742
|
+
}
|
|
6743
|
+
|
|
6744
|
+
type ValidateTraceSimplificationSolverInput = {
|
|
6745
|
+
preparedInput: PreparedPipeline11Simplification;
|
|
6746
|
+
outputSrj: SimpleRouteJson;
|
|
6747
|
+
};
|
|
6748
|
+
/** Rejects simplification whenever it introduces an autorouting DRC category. */
|
|
6749
|
+
declare class ValidateTraceSimplificationSolver extends BaseSolver$1 {
|
|
6750
|
+
readonly inputProblem: ValidateTraceSimplificationSolverInput;
|
|
6751
|
+
private readonly drcEngine;
|
|
6752
|
+
private phase;
|
|
6753
|
+
private baselineErrorCounts;
|
|
6754
|
+
private outputErrorCounts;
|
|
6755
|
+
constructor(inputProblem: ValidateTraceSimplificationSolverInput);
|
|
6756
|
+
getSolverName(): string;
|
|
6757
|
+
_step(): void;
|
|
6758
|
+
private evaluateErrorCounts;
|
|
6759
|
+
private assertNoNewDrcErrors;
|
|
6760
|
+
getConstructorParams(): readonly [
|
|
6761
|
+
ValidateTraceSimplificationSolverInput
|
|
6762
|
+
];
|
|
6763
|
+
getOutput(): SimpleRouteJson;
|
|
6764
|
+
}
|
|
6765
|
+
|
|
6766
|
+
interface AutoroutingPipelineSolver11SimplificationOptions {
|
|
6767
|
+
/** Number of complete cleanup passes. Defaults to two. */
|
|
6768
|
+
iterations?: number;
|
|
6769
|
+
/** Enables coordinated layer swaps that reduce vias at crossings. */
|
|
6770
|
+
enableCrossingViaReduction?: boolean;
|
|
6771
|
+
}
|
|
6772
|
+
type AutoroutingPipeline11SimplificationInput = {
|
|
6773
|
+
inputSrj: SimpleRouteJson;
|
|
6774
|
+
options: AutoroutingPipelineSolver11SimplificationOptions;
|
|
6775
|
+
};
|
|
6776
|
+
/**
|
|
6777
|
+
* Pipeline 11 only cleans traces already present in the input SRJ. It never
|
|
6778
|
+
* routes missing connections. Mixed-width traces remain immutable because the
|
|
6779
|
+
* cleanup solvers operate on constant-width high-density routes.
|
|
6780
|
+
*/
|
|
6781
|
+
declare class AutoroutingPipelineSolver11_Simplification extends BasePipelineSolver<AutoroutingPipeline11SimplificationInput> {
|
|
6782
|
+
prepareTraceSimplificationSolver?: PrepareTraceSimplificationSolver;
|
|
6783
|
+
traceSimplificationStageSolver?: TraceSimplificationStageSolver;
|
|
6784
|
+
applyTraceSimplificationSolver?: ApplyTraceSimplificationSolver;
|
|
6785
|
+
validateTraceSimplificationSolver?: ValidateTraceSimplificationSolver;
|
|
6786
|
+
pipelineDef: PipelineStep$b<BaseSolver$1>[];
|
|
6787
|
+
constructor(inputSrj: SimpleRouteJson, options?: AutoroutingPipelineSolver11SimplificationOptions);
|
|
6788
|
+
getSolverName(): string;
|
|
6789
|
+
getConstructorParams(): readonly [
|
|
6790
|
+
SimpleRouteJson,
|
|
6791
|
+
AutoroutingPipelineSolver11SimplificationOptions
|
|
6792
|
+
];
|
|
6793
|
+
getOutput(): SimpleRouteJson;
|
|
6794
|
+
getOutputSimpleRouteJson(): SimpleRouteJson;
|
|
6795
|
+
getOutputSimplifiedPcbTraces(): SimplifiedPcbTraces;
|
|
6796
|
+
initialVisualize(): GraphicsObject;
|
|
6797
|
+
finalVisualize(): GraphicsObject;
|
|
6798
|
+
}
|
|
6799
|
+
|
|
6667
6800
|
/**
|
|
6668
6801
|
* Calculate the capacity of a node based on its width
|
|
6669
6802
|
*
|
|
@@ -6937,6 +7070,7 @@ declare class MultiSimplifiedPathSolver extends BaseSolver {
|
|
|
6937
7070
|
}>;
|
|
6938
7071
|
minBoardEdgeClearance: number;
|
|
6939
7072
|
defaultViaDiameter: number;
|
|
7073
|
+
useTraceWidthAwareClearance: boolean;
|
|
6940
7074
|
constructor(params: {
|
|
6941
7075
|
unsimplifiedHdRoutes: HighDensityIntraNodeRoute$1[];
|
|
6942
7076
|
/** Routed copper that participates in collision checks but is never changed. */
|
|
@@ -6950,6 +7084,7 @@ declare class MultiSimplifiedPathSolver extends BaseSolver {
|
|
|
6950
7084
|
}>;
|
|
6951
7085
|
minBoardEdgeClearance?: number;
|
|
6952
7086
|
defaultViaDiameter?: number;
|
|
7087
|
+
useTraceWidthAwareClearance?: boolean;
|
|
6953
7088
|
});
|
|
6954
7089
|
_step(): void;
|
|
6955
7090
|
visualize(): GraphicsObject;
|
|
@@ -7784,4 +7919,4 @@ declare const HyperSingleIntraNodeSolver: typeof PortfolioSingleIntraNodeSolver;
|
|
|
7784
7919
|
*/
|
|
7785
7920
|
type HyperSingleIntraNodeSolver = InstanceType<typeof PortfolioSingleIntraNodeSolver>;
|
|
7786
7921
|
|
|
7787
|
-
export { AUTOROUTER_VERSION, AssignableAutoroutingPipeline1Solver, AssignableAutoroutingPipeline2, AssignableAutoroutingPipeline3, AttachProjectedRectsSolver, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver7_MultiGraph as AutoroutingPipelineSolver, AutoroutingPipelineSolver10_BgaFanout, AutoroutingPipelineSolver2_PortPointPathing, AutoroutingPipelineSolver3_HgPortPointPathing, AutoroutingPipelineSolver4_TinyHypergraph as AutoroutingPipelineSolver4, AutoroutingPipelineSolver4_TinyHypergraph, AutoroutingPipelineSolver5_HdCache as AutoroutingPipelineSolver5, AutoroutingPipelineSolver5_HdCache, AutoroutingPipelineSolver6_PolyHypergraph as AutoroutingPipelineSolver6, AutoroutingPipelineSolver6_PolyHypergraph, AutoroutingPipelineSolver7_MultiGraph, AutoroutingPipelineSolver8, type AutoroutingPipelineSolver9NetworkedOptions, AutoroutingPipelineSolver9_Networked, AutoroutingPipelineSolver9_PreloadedTraceGraph, type AutoroutingPipelineSolverOptions, type BusId, type CachableSolver, type CacheProvider, CapacityMeshSolver, type ConnectionPoint$1 as ConnectionPoint, type ConvertSrjToGraphicsObjectOptions, CurvyIntraNodeSolver, DEFAULT_HD_CACHE2_SERVER_URL, type DifferentialPair, GrowShrinkHighDensityIntraNodeSolver, type HighDensityIntraNodeRouteWithJumpers, JumperHighDensitySolver as HighDensitySolver, HyperSingleIntraNodeSolver, InMemoryCache, IntraNodeSolverWithJumpers, type Jumper, LocalStorageCache, type MultiLayerConnectionPoint, type Obstacle, PIPELINE9_NETWORKED_SOLVE_POLICY, type Pipeline9NetworkedCacheSource, type Pipeline9NetworkedHighDensityNodeInput, type Pipeline9NetworkedHighDensityNodeOutput, type Pipeline9NetworkedSolveBatchCacheMiss, type Pipeline9NetworkedSolveBatchItem, type Pipeline9NetworkedSolveBatchRequest, type Pipeline9NetworkedSolveBatchResult, type Pipeline9NetworkedSolveRequest, type Pipeline9NetworkedSolveResponse, PolyHighDensitySolver, PolySingleIntraNodeSolver as PolyIntraNodeSolver, PolySingleIntraNodeSolver, PortfolioSingleIntraNodeSolver, ProjectHighDensityToPolygonSolver, type RerouteRectRegion, type SimpleRouteBus, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, type SimplifiedPcbTraces, SingleHighDensityRouteWithJumpersSolver, type SingleLayerConnectionPoint, type TerminalViaHint, type TraceColorMode, calculateOptimalCapacityDepth, convertSrjToGraphicsObject, getGlobalInMemoryCache, getGlobalLocalStorageCache, getRerouteSimpleRouteJson, getTunedTotalCapacity1, reconnectReroutedSimpleRouteJsonRegion, setupGlobalCaches, solvePipeline9NetworkedHighDensityNode };
|
|
7922
|
+
export { AUTOROUTER_VERSION, AssignableAutoroutingPipeline1Solver, AssignableAutoroutingPipeline2, AssignableAutoroutingPipeline3, AttachProjectedRectsSolver, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver7_MultiGraph as AutoroutingPipelineSolver, AutoroutingPipelineSolver10_BgaFanout, type AutoroutingPipelineSolver11SimplificationOptions, AutoroutingPipelineSolver11_Simplification, AutoroutingPipelineSolver2_PortPointPathing, AutoroutingPipelineSolver3_HgPortPointPathing, AutoroutingPipelineSolver4_TinyHypergraph as AutoroutingPipelineSolver4, AutoroutingPipelineSolver4_TinyHypergraph, AutoroutingPipelineSolver5_HdCache as AutoroutingPipelineSolver5, AutoroutingPipelineSolver5_HdCache, AutoroutingPipelineSolver6_PolyHypergraph as AutoroutingPipelineSolver6, AutoroutingPipelineSolver6_PolyHypergraph, AutoroutingPipelineSolver7_MultiGraph, AutoroutingPipelineSolver8, type AutoroutingPipelineSolver9NetworkedOptions, AutoroutingPipelineSolver9_Networked, AutoroutingPipelineSolver9_PreloadedTraceGraph, type AutoroutingPipelineSolverOptions, type BusId, type CachableSolver, type CacheProvider, CapacityMeshSolver, type ConnectionPoint$1 as ConnectionPoint, type ConvertSrjToGraphicsObjectOptions, CurvyIntraNodeSolver, DEFAULT_HD_CACHE2_SERVER_URL, type DifferentialPair, GrowShrinkHighDensityIntraNodeSolver, type HighDensityIntraNodeRouteWithJumpers, JumperHighDensitySolver as HighDensitySolver, HyperSingleIntraNodeSolver, InMemoryCache, IntraNodeSolverWithJumpers, type Jumper, LocalStorageCache, type MultiLayerConnectionPoint, type Obstacle, PIPELINE9_NETWORKED_SOLVE_POLICY, type Pipeline9NetworkedCacheSource, type Pipeline9NetworkedHighDensityNodeInput, type Pipeline9NetworkedHighDensityNodeOutput, type Pipeline9NetworkedSolveBatchCacheMiss, type Pipeline9NetworkedSolveBatchItem, type Pipeline9NetworkedSolveBatchRequest, type Pipeline9NetworkedSolveBatchResult, type Pipeline9NetworkedSolveRequest, type Pipeline9NetworkedSolveResponse, PolyHighDensitySolver, PolySingleIntraNodeSolver as PolyIntraNodeSolver, PolySingleIntraNodeSolver, PortfolioSingleIntraNodeSolver, ProjectHighDensityToPolygonSolver, type RerouteRectRegion, type SimpleRouteBus, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, type SimplifiedPcbTraces, SingleHighDensityRouteWithJumpersSolver, type SingleLayerConnectionPoint, type TerminalViaHint, type TraceColorMode, calculateOptimalCapacityDepth, convertSrjToGraphicsObject, getGlobalInMemoryCache, getGlobalLocalStorageCache, getRerouteSimpleRouteJson, getTunedTotalCapacity1, reconnectReroutedSimpleRouteJsonRegion, setupGlobalCaches, solvePipeline9NetworkedHighDensityNode };
|