Exemplo n.º 1
0
 def __init__(self, name=""):
     self._name = name
     self._device_type = -1
     self._device_channel = -1
     self._rect = geo.Rect()
     self._pin_list = []
     self._pin_name_map = {}
Exemplo n.º 2
0
 def calculate_design_bbox(self):
     """
     @brief Going through all the devices and find the boundary for the design
     """
     self._bbox = geo.Rect()
     for device in self._devices:
         self._bbox.union(device.rect())
Exemplo n.º 3
0
 def compute_bbox(self):
     assert len(self._shapes) > 0
     """
     Here need a deep copy. Re-construct a new object for covenience
     """
     self._bbox = geo.Rect(self._shapes[0].x_lo(), self._shapes[0].y_lo(),
                           self._shapes[0].x_hi(), self._shapes[0].y_hi())
     for idx in range(1, len(self._shapes)):
         self._bbox.union(self._shapes[idx])
Exemplo n.º 4
0
 def export_connect_net_bbox(self, filename):
     """
     @brief try to catch the connectivity information into images
     @param filename: the file name of the output images
     """
     img = np.zeros((self._image_size, self._image_size), dtype=int)
     for net_idx in range(0, self._db.num_nets()):
         #print("Net ", net_idx)
         net = self._db.net_idx(net_idx)
         bbox = geo.Rect()
         for pin_idx in net.pin_list():
             pin = self._db.pin_idx(pin_idx)
             #print(pin.rect().to_str())
             bbox.union(pin.rect())
         #print("BBOX: ", bbox.to_str())
         xl_px = self._db.circuit().pixel_x(bbox.x_lo())
         yl_px = self._db.circuit().pixel_y(bbox.y_lo())
         xh_px = self._db.circuit().pixel_x(bbox.x_hi())
         yh_px = self._db.circuit().pixel_y(bbox.y_hi())
         for x_px in range(int(xl_px), int(xh_px)):
             for y_px in range(int(yl_px), int(yh_px)):
                 img[y_px][x_px] += 1 # Increment the value
     export_grayscale_image(img, self._image_size, filename)
Exemplo n.º 5
0
 def add_shape(self, layer, x_lo, y_lo, x_hi, y_hi):
     self._layers.append(layer)
     self._shapes.append(geo.Rect(x_lo, y_lo, x_hi, y_hi))
Exemplo n.º 6
0
 def set_rect(self, x_lo, y_lo, x_hi, y_hi):
     self._rect = geo.Rect(x_lo, y_lo, x_hi, y_hi)
Exemplo n.º 7
0
 def __init__(self):
     self._device_idx = -1
     self._rect = geo.Rect()
     self._net_idx = -1
     self._name = ""
Exemplo n.º 8
0
 def __init__(self):
     self._name = ""
     self._layers = []
     self._shapes = []
     self._bbox = geo.Rect()