MCPcopy Create free account
hub / github.com/circuitnet/CircuitNet / get_power_map

Method get_power_map

feature_extraction/src/read.py:1073–1117  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1071 """
1072
1073 def get_power_map(self):
1074 window_shape = [self.n_time_window]
1075 window_shape.extend(self.gcell_size)
1076 self.power_t = np.zeros(window_shape)
1077 self.power_i = np.zeros(self.gcell_size)
1078 self.power_s = np.zeros(self.gcell_size)
1079 self.power_sca = np.zeros(self.gcell_size)
1080 self.power_all = np.zeros(self.gcell_size)
1081 power_map = np.zeros(self.gcell_size)
1082 for k, v in self.power_dict.items():
1083 if v[4] == 'filler':
1084 tw = [0]
1085 else:
1086 tw = v[4]
1087 instance = self.route_instance_dict[k]
1088 cell_size = self.lef_dict[instance[0]]['size']
1089 direction = instance_direction_rect(instance[2])
1090 cell_x_left = instance[1][0]
1091 cell_y_lower = instance[1][1]
1092 cell_x_right = cell_x_left + cell_size[0] * direction[0] + cell_size[1] * direction[1]
1093 cell_y_upper = cell_y_lower + cell_size[0] * direction[2] + cell_size[1] * direction[3]
1094 cell_x_left_gcell = bisect.bisect_left(self.gcell_coordinate_x, cell_x_left)
1095 cell_y_lower_gcell = bisect.bisect_left(self.gcell_coordinate_y, cell_y_lower)
1096 cell_x_right_gcell = bisect.bisect_left(self.gcell_coordinate_x, cell_x_right)
1097 cell_y_upper_gcell = bisect.bisect_left(self.gcell_coordinate_y, cell_y_upper)
1098 location = [cell_x_left, cell_y_lower, cell_x_right, cell_y_upper]
1099 location_gcell = [cell_x_left_gcell, cell_y_lower_gcell, cell_x_right_gcell, cell_y_upper_gcell]
1100 tmp_power_map = np.zeros(self.gcell_size)
1101 power_map += self.compute_density_with_overlap(tmp_power_map, location, location_gcell)
1102 n_pin = len(tw)
1103 self.power_i += power_map * v[1] * n_pin
1104 self.power_s += power_map * v[2] * n_pin
1105 self.power_sca += power_map * ((v[1] + v[2]) * v[0] + v[3]) * n_pin
1106 self.power_all += power_map * (v[1] + v[2] + v[3]) * n_pin
1107 if tw:
1108 for i in tw:
1109 if i == 0:
1110 pass
1111 else:
1112 self.power_t[i[0]:i[1]+1, :, :] += power_map * ((v[1] + v[2]) * v[0] + v[3])
1113 save(self.save_path, 'IR_drop/power_t', self.save_name, self.power_t)
1114 save(self.save_path, 'IR_drop/power_i', self.save_name, self.power_i)
1115 save(self.save_path, 'IR_drop/power_s', self.save_name, self.power_s)
1116 save(self.save_path, 'IR_drop/power_sca', self.save_name, self.power_sca)
1117 save(self.save_path, 'IR_drop/power_all', self.save_name, self.power_all)
1118
1119 """
1120 Function used by get_IR_features. Read IR drop reports.

Callers 1

get_IR_featuresMethod · 0.95

Calls 3

instance_direction_rectFunction · 0.90
saveFunction · 0.90

Tested by

no test coverage detected