Models
Net
Net Module
Node
Node Module
Path
Path Module
Grid
Grid Module
- class models.grid.Grid(grid_size: Tuple[int, int], capacity: Tuple[int, int])[source]
A grid of cells, that represents a layout
- is_overflow(path: Path) bool[source]
Determines if overflow exists for a path
- Args:
path (Path): layout path
- Returns:
bool: layout has overflow
- update_congestion(path: Path, increment: bool)[source]
Update congestion level for the path
- Args:
path (Path): path increment (bool): congestion is incremented, else decremented
- get_edge_cost(edge_id: int) float[source]
Get the cost of the edge. This cost function ensures that edges with high congestion have higher costs, which guides the search algorithm towards less congested paths and helps find a solution more quickly.
- Args:
edge_id (int): Edge ID
- Returns:
float: cost of the edge
- get_edge_id(coordinate: Tuple[int, int], direction: int) int[source]
Get ID of the edge
- Args:
coordinate (Tuple[int, int]): coordinate of the node direction (int): direction
- Returns:
int: Edge ID
Global Router
Global Router Module
- class models.global_router.GlobalRouter(algorithm: int, seed: int)[source]
Global Router class, handles the logic of the global router
- dump_result(output_file_path: str) None[source]
Dumps the route result into an output file
- Args:
output_file_path (str): path of the output file
- rip_up_and_reroute() Tuple[int, int][source]
rip up and reroute
- Returns:
Tuple[int, int]: overflow and wirelength
- get_next_coordinate(current_node_coordinate: Tuple[int, int], direction: int) Tuple[int, int][source]
Get next coordinate for the path, given the current node
- Args:
current_node_coordinate (Tuple[int, int]): coordinate of current node direction (int): direction to next node’s coordinate
- Returns:
Tuple[int, int]: next node’s coordinate
- connect_net_breadth_first_search(net: Net) None[source]
Route a two-pin net with Breadth-First Search
This will only create L-shaped paths for all nets. This is a terrible algorithm as it doesn’t take congestion into account and might create a lot of overflow.
- Args:
net (Net): two-pin net
- connect_net_best_first_search_heapq(net: Net) None[source]
Route a two-pin net with Best-First Search
The priority queue (binary heap) stores the nodes to be expanded in ascending order of their congestion heuristic cost. At each step, the algorithm chooses the node with the lowest cost and expands it by considering all of its neighbors.
- Args:
net (Net): two-pin net