@@ -26,6 +26,7 @@ const createEmptyRegionIntersectionCache = (): RegionIntersectionCache => ({
2626 existingSameLayerIntersections : 0 ,
2727 existingEntryExitLayerChanges : 0 ,
2828 existingRegionCost : 0 ,
29+ existingSegmentCount : 0 ,
2930} )
3031
3132export interface TinyHyperGraphTopology {
@@ -138,7 +139,7 @@ export class TinyHyperGraphSolver extends BaseSolver {
138139
139140 RIP_THRESHOLD_START = 0.05
140141 RIP_THRESHOLD_END = 0.8
141- RIP_THRESHOLD_RAMP_ATTEMPTS = 20
142+ RIP_THRESHOLD_RAMP_ATTEMPTS = 50
142143
143144 RIP_CONGESTION_REGION_COST_FACTOR = 0.1
144145
@@ -438,6 +439,7 @@ export class TinyHyperGraphSolver extends BaseSolver {
438439 newCrossLayerIntersections
439440 const existingEntryExitLayerChanges =
440441 regionCache . existingEntryExitLayerChanges + newEntryExitLayerChanges
442+ const existingSegmentCount = lesserAngles . length
441443
442444 state . regionIntersectionCaches [ regionId ] = {
443445 netIds,
@@ -447,12 +449,14 @@ export class TinyHyperGraphSolver extends BaseSolver {
447449 existingSameLayerIntersections,
448450 existingCrossingLayerIntersections,
449451 existingEntryExitLayerChanges,
452+ existingSegmentCount,
450453 existingRegionCost : computeRegionCost (
451454 topology . regionWidth [ regionId ] ,
452455 topology . regionHeight [ regionId ] ,
453456 existingSameLayerIntersections ,
454457 existingCrossingLayerIntersections ,
455458 existingEntryExitLayerChanges ,
459+ existingSegmentCount ,
456460 ) ,
457461 }
458462 }
@@ -550,7 +554,10 @@ export class TinyHyperGraphSolver extends BaseSolver {
550554 ripCount : state . ripCount ,
551555 }
552556
553- if ( regionIdsOverCostThreshold . length === 0 ) {
557+ if (
558+ regionIdsOverCostThreshold . length === 0 ||
559+ state . ripCount === this . RIP_THRESHOLD_RAMP_ATTEMPTS
560+ ) {
554561 this . solved = true
555562 return
556563 }
@@ -639,6 +646,7 @@ export class TinyHyperGraphSolver extends BaseSolver {
639646 regionCache . existingCrossingLayerIntersections +
640647 newCrossLayerIntersections ,
641648 regionCache . existingEntryExitLayerChanges + newEntryExitLayerChanges ,
649+ regionCache . existingSegmentCount + 1 ,
642650 ) - regionCache . existingRegionCost
643651
644652 return (
0 commit comments