| 95 | |
| 96 | |
| 97 | class ReadInnovusOutput: |
| 98 | def __init__(self, root_dir, arg, save_name, lef_dict, lef_dict_jnet=None): |
| 99 | self.save_name = save_name |
| 100 | self.save_path = arg.save_path |
| 101 | self.unit = arg.unit |
| 102 | |
| 103 | # Path for LEF/DEF and reports from Innovus. |
| 104 | self.lef_dict = lef_dict |
| 105 | self.lef_dict_jnet = lef_dict_jnet |
| 106 | self.root_dir = root_dir |
| 107 | self.place_def_path = os.path.join(root_dir, arg.place_def_name) |
| 108 | self.route_def_path = os.path.join(root_dir, arg.route_def_name) |
| 109 | self.eGR_congestion_path = os.path.join(root_dir, arg.eGR_congestion_name) |
| 110 | self.route_congestion_path = os.path.join(root_dir, arg.route_congestion_name) |
| 111 | self.drc_path = os.path.join(root_dir, arg.drc_rpt_name) |
| 112 | self.twf_path = os.path.join(root_dir, arg.twf_rpt_name) |
| 113 | self.power_path = os.path.join(root_dir, arg.power_rpt_name) |
| 114 | self.ir_path = os.path.join(root_dir, arg.ir_rpt_name) |
| 115 | |
| 116 | # The LEF/DEF we released are scaled, and it can be reverted with the scaling factor (arg.scaling). |
| 117 | # Contact us with email to get the scaling factor if you need to revert the scaling. |
| 118 | if not arg.scaling: |
| 119 | self.scaling = 1 |
| 120 | else: |
| 121 | self.scaling = arg.scaling |
| 122 | |
| 123 | self.die_area = None # Total area of die (chip). Currently not used. |
| 124 | self.gcell_size = [-1,-1] # Number of Gcell grids. |
| 125 | self.gcell_coordinate_x = [] # Coordinate of Gcell grids in DEF. |
| 126 | self.gcell_coordinate_y = [] |
| 127 | # The geometric information of all instances(cells)/nets/pins from DEF. |
| 128 | # We need to read both route DEF and place DEF as the instances may be changed due to optDesign. |
| 129 | self.route_instance_dict = {} # contains information of instances {inst_name:[std_cell_name, [inst_location_w/h], inst_direction]} |
| 130 | self.route_net_dict = {} # contains instance names and pin names in each nets {net_name:[pin_names]} |
| 131 | self.route_pin_dict = {} # contains information of IO pins {pin_name{'layer':layer, 'rect':rect, 'location':location, 'direction':direction}} |
| 132 | self.place_instance_dict = {} # same as route |
| 133 | self.place_net_dict = {} |
| 134 | self.place_pin_dict = {} |
| 135 | |
| 136 | # The placement(locations) of all instances(cells) from DEF |
| 137 | self.instance_placement_dict = {} |
| 138 | |
| 139 | # Array of congestion for eGR (early global routing/trail routing) in 2 directions (horizontal/vertical) and 2 definitions (utilization/overflow of tracks). |
| 140 | self.congestion_horizontal_util_eGR = [] |
| 141 | self.congestion_vertical_util_eGR = [] |
| 142 | self.congestion_horizontal_overflow_eGR = [] |
| 143 | self.congestion_vertical_overflow_eGR = [] |
| 144 | self.hotspot_eGR = 0 |
| 145 | # Array of congestion for GR (global routing) in 2 directions (horizontal/vertical) and 2 definitions (utilization/overflow of tracks). |
| 146 | self.congestion_horizontal_util = [] |
| 147 | self.congestion_vertical_util = [] |
| 148 | self.congestion_horizontal_overflow = [] |
| 149 | self.congestion_vertical_overflow = [] |
| 150 | self.hotspot = 0 |
| 151 | |
| 152 | # Array of routability features. |
| 153 | self.cell_density=None |
| 154 | self.RUDY = None |