go to a tunable 5um grid

This commit is contained in:
jan 2026-03-11 09:37:54 -07:00
commit 91256cbcf9
21 changed files with 222 additions and 233 deletions

View file

@ -9,17 +9,16 @@ from inire.utils.visualization import plot_routing_results
from shapely.geometry import box
def main() -> None:
print("Running Example 07: Fan-Out (5 Nets)...")
print("Running Example 07: Fan-Out (10 Nets, 50um Radius, 5um Grid)...")
# 1. Setup Environment
# Small area for fast and reliable demonstration
bounds = (0, 0, 100, 100)
engine = CollisionEngine(clearance=2.0)
bounds = (0, 0, 1000, 1000)
engine = CollisionEngine(clearance=6.0)
# Wide bottleneck at x=50, 60um gap (from y=20 to y=80)
# Bottleneck at x=500, 200um gap
obstacles = [
box(50, 0, 55, 20),
box(50, 80, 55, 100),
box(450, 0, 550, 400),
box(450, 600, 550, 1000),
]
for obs in obstacles:
engine.add_static_obstacle(obs)
@ -29,32 +28,28 @@ def main() -> None:
evaluator = CostEvaluator(engine, danger_map, greedy_h_weight=1.5)
# Increase node_limit for more complex search
router = AStarRouter(evaluator, node_limit=50000)
pf = PathFinder(router, evaluator, max_iterations=2)
router = AStarRouter(evaluator, node_limit=50000, snap_size=5.0)
pf = PathFinder(router, evaluator, max_iterations=10)
# 2. Define Netlist: Fan-Out Configuration
# 2. Define Netlist
netlist = {}
num_nets = 10
start_x = 10
# Bundle centered at y=50, 4um pitch
start_y_base = 50 - (num_nets * 4.0) / 2.0
start_x = 50
start_y_base = 500 - (num_nets * 10.0) / 2.0
end_x = 90
end_y_base = 10
end_y_pitch = 80.0 / (num_nets - 1)
end_x = 950
end_y_base = 100
end_y_pitch = 800.0 / (num_nets - 1)
for i in range(num_nets):
sy = start_y_base + i * 4.0
ey = end_y_base + i * end_y_pitch
net_id = f"net_{i:02d}"
netlist[net_id] = (Port(start_x, sy, 0), Port(end_x, ey, 0))
sy = round((start_y_base + i * 10.0) / 5.0) * 5.0
ey = round((end_y_base + i * end_y_pitch) / 5.0) * 5.0
netlist[f"net_{i:02d}"] = (Port(start_x, sy, 0), Port(end_x, ey, 0))
net_widths = {nid: 2.0 for nid in netlist}
# 3. Route
print(f"Routing {len(netlist)} nets through 60um bottleneck...")
print(f"Routing {len(netlist)} nets through 200um bottleneck...")
results = pf.route_all(netlist, net_widths)
# 4. Check Results