Commit 1d8d3713 by Dinple

clustered ports done

parent d4d5de0e
...@@ -762,30 +762,20 @@ class PlacementCost(object): ...@@ -762,30 +762,20 @@ class PlacementCost(object):
#[MACRO][macro][PORT] #[MACRO][macro][PORT]
module_indices = self.hard_macro_indices + self.soft_macro_indices + self.port_indices module_indices = self.hard_macro_indices + self.soft_macro_indices + self.port_indices
for row_idx, module_idx in enumerate(module_indices): #[Grid Cell] => [PORT]
# row index clustered_ports = {}
# store temp module for port_idx in self.port_indices:
curr_module = self.modules_w_pins[module_idx] port = self.modules_w_pins[port_idx]
# get module name x_pos, y_pos = port.get_pos()
curr_module_name = curr_module.get_name()
for col_idx, h_module_idx in enumerate(module_indices):
# col index
entry = 0
# store connected module
h_module = self.modules_w_pins[h_module_idx]
# get connected module name
h_module_name = h_module.get_name()
if curr_module_name in h_module.get_connection(): row, col = self.__get_grid_cell_location(x_pos=x_pos, y_pos=y_pos)
entry += h_module.get_connection()[curr_module_name]
if h_module_name in curr_module.get_connection(): if (row, col) in clustered_ports:
entry += curr_module.get_connection()[h_module_name] clustered_ports[(row, col)].append(port)
else:
macro_adj[row_idx * self.module_cnt + col_idx] = entry clustered_ports[(row, col)] = [port]
return macro_adj return clustered_ports
def get_node_location(self): def get_node_location(self):
pass pass
...@@ -1196,6 +1186,7 @@ def main(): ...@@ -1196,6 +1186,7 @@ def main():
print(plc.get_grid_cells_density()) print(plc.get_grid_cells_density())
print(plc.get_density_cost()) print(plc.get_density_cost())
print(plc.display_canvas()) print(plc.display_canvas())
print(len(plc.get_macro_and_clustered_port_adjacency()))
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment