Models

Net

Net Module

class models.net.Net(net_id, net_name, num_of_pins, net_pins_coordinates)[source]

Net class represents a wire that connects two or more pins

update_hpwl() int[source]

Set the value of HPWL (Half-Perimeter Wirelength)

Returns:

int: HPWL (Half-Perimeter Wirelength)

Node

Node Module

class models.node.Node(prev, coordinates)[source]

Node class represents a pin in a net

Path

Path Module

class models.path.Path(end_node)[source]

Path class represents the full path of a net

Global Router

Global Router Module

class models.global_router.GlobalRouter[source]

Global Router class, handles the logic of the global router

show_netlist_info() None[source]

Prints netlist info to the terminal

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()[source]

rip up and reroute

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

Determine if given coordinate is within layout bounds

Args:

next_coordinate (Tuple[int, int]): coordinate of next node

Returns:

bool: coordinate of next node is legal or not

get_node_id(coordinate: Tuple[int, int]) int[source]

Get ID of the node

Args:

coordinate (Tuple[int, int]): the coordinate of the node

Returns:

int: the ID of the node

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

get_edge_cost(edge_id: int) float[source]

Get the cost of the edge

Args:

edge_id (int): Edge ID

Returns:

float: cost of the edge

route_two_pin_net(net: Net)[source]

Route a two-pin net (BFS)

Args:

net (Net): two-pin net

update_demand(path: Path, increment: bool)[source]

Update demand level for the path

Args:

path (Path): path increment (bool): demand is incremented

update_overflow() Tuple[int, int][source]

Update overflow info for the layout

Returns:

Tuple[int, int]: (total_overflow, wirelength)

global_route() Tuple[int, int][source]

main global routing logic

generate_congestion_output(output_file_name: str) None[source]

Generate the congestion data for the output

Args:

output_file_name (str): name of the output file

parse_input(input_file_path: str)[source]

Parse the netlist input file

Args:

input_file_path (str): path of the netlist input file

Raises:

FileNotFoundError: Input file path not found

Returns:

List[Net]: list of all nets

is_overflow(path: Path) bool[source]

Determines if overflow exists for a path

Args:

path (Path): layout path

Returns:

bool: layout has overflow