Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
type ViaTile,
ViaGraphSolver,
createConvexViaGraphFromXYConnections,
viaTile as defaultViaTile,
} from "@tscircuit/hypergraph"
import { ConnectivityMap } from "circuit-json-to-connectivity-map"
import type {
Expand All @@ -33,7 +32,6 @@ export interface FixedTopologyHighDensityIntraNodeSolverParams {
nodeWithPortPoints: NodeWithPortPoints
colorMap?: Record<string, string>
traceWidth?: number
viaDiameter?: number
connMap?: ConnectivityMap
effort?: number
}
Expand All @@ -53,8 +51,6 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
nodeWithPortPoints: NodeWithPortPoints
colorMap: Record<string, string>
traceWidth: number
viaDiameter: number
viaTile: ViaTile
connMap?: ConnectivityMap

rootConnectionNameByConnectionId: Map<string, string | undefined> = new Map()
Expand All @@ -70,8 +66,6 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
this.nodeWithPortPoints = params.nodeWithPortPoints
this.colorMap = params.colorMap ?? {}
this.traceWidth = params.traceWidth ?? 0.15
this.viaTile = defaultViaTile
this.viaDiameter = this._resolveViaDiameter(params.viaDiameter)
this.connMap = params.connMap
this.MAX_ITERATIONS = P99_MAX_ITERATIONS * (params.effort ?? 1)

Expand All @@ -92,17 +86,6 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
return 0.3
}

private _resolveViaDiameter(requestedViaDiameter?: number): number {
const viaTileDiameter = this._getViaTileDiameter(this.viaTile)
if (
requestedViaDiameter !== undefined &&
Math.abs(requestedViaDiameter - viaTileDiameter) <= 1e-6
) {
return requestedViaDiameter
}
return viaTileDiameter
}

private _initializeGraph(): ViaGraphSolver | null {
// Build connections from port points
const connectionMap = new Map<
Expand Down Expand Up @@ -140,10 +123,7 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
}
if (inputConnections.length === 0) return null

const convexGraph = createConvexViaGraphFromXYConnections(
inputConnections,
this.viaTile,
)
const convexGraph = createConvexViaGraphFromXYConnections(inputConnections)
this.tiledViasByNet = convexGraph.viaTile.viasByNet ?? {}

return new ViaGraphSolver({
Expand Down Expand Up @@ -418,6 +398,9 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
private _processResults(viaGraphSolver: ViaGraphSolver) {
this.solvedRoutes = []
const viaTile = viaGraphSolver.viaTile
const fallbackViaDiameter = viaTile
? this._getViaTileDiameter(viaTile)
: 0.3
const viasByPosition: Map<
string,
{
Expand Down Expand Up @@ -571,7 +554,7 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
? Math.max(
...routeViaRegions.map((viaRegion) => viaRegion.diameter),
)
: this.viaDiameter,
: fallbackViaDiameter,
route: routePoints,
vias: routeVias,
viaRegions: routeViaRegions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ export class HyperSingleIntraNodeSolver extends HyperParameterSupervisorSolver<
nodeWithPortPoints: this.nodeWithPortPoints,
connMap: this.connMap,
colorMap: this.constructorParams.colorMap,
viaDiameter: this.constructorParams.viaDiameter,
traceWidth: this.constructorParams.traceWidth,
effort: this.effort,
}) as any
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@tscircuit/circuit-json-util": "^0.0.46",
"@tscircuit/core": "^0.0.337",
"@tscircuit/curvy-trace-solver": "^0.0.10",
"@tscircuit/hypergraph": "^0.0.50",
"@tscircuit/hypergraph": "^0.0.60",
"@tscircuit/jumper-topology-generator": "^0.0.4",
"@tscircuit/math-utils": "^0.0.27",
"@tscircuit/rectdiff": "0.0.22",
Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/e2e3_hg.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/bugs/__snapshots__/bugreport04-aa1d41.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/bugs/__snapshots__/bugreport05-f03221.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions tests/features/__snapshots__/via-high-density01.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 17 additions & 17 deletions tests/features/__snapshots__/via-high-density02.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 17 additions & 17 deletions tests/features/__snapshots__/via-high-density03.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading