Exemplo n.º 1
0
    def pin_position(self, it):
        px = odb.new_int(0)
        py = odb.new_int(0)

        if it.getAvgXY(px, py):
            # Got it
            return odb.get_int(px), odb.get_int(py)
        else:
            # Failed, use the center coordinate of the instance as fall back
            return it.getInst().getLocation()
Exemplo n.º 2
0
 def test_avgxy_R90(self):
     x = odb.new_int(0)
     y = odb.new_int(0)
     mterm_a = self.and2.findMTerm('a')
     mpin_a = odb.dbMPin_create(mterm_a)
     geo_box_a_1 = odb.dbBox_create(mpin_a,
                                    self.lib.getTech().getLayers()[0], 0, 0,
                                    50, 50)
     geo_box_a_2 = odb.dbBox_create(mpin_a,
                                    self.lib.getTech().getLayers()[0], 0, 0,
                                    100, 100)
     self.inst.setOrient('R90')
     self.assertTrue(self.iterm_a.getAvgXY(x, y))
     self.assertEqual(odb.get_int(x), int(((0 + 50) + (0 + 100)) / 4) * -1)
     self.assertEqual(odb.get_int(y), int(((0 + 50) + (0 + 100)) / 4))
Exemplo n.º 3
0
 def test_avgxy_R0(self):
     x = odb.new_int(0)
     y = odb.new_int(0)
     self.assertFalse(self.iterm_a.getAvgXY(x, y))  #no mpin to work on
     mterm_a = self.and2.findMTerm('a')
     mpin_a = odb.dbMPin_create(mterm_a)
     self.assertFalse(self.iterm_a.getAvgXY(x, y))  #no boxes to work on
     geo_box_a_1 = odb.dbBox_create(mpin_a,
                                    self.lib.getTech().getLayers()[0], 0, 0,
                                    50, 50)
     self.assertTrue(self.iterm_a.getAvgXY(x, y))
     self.assertEqual(odb.get_int(x), int((0 + 50) / 2))
     self.assertEqual(odb.get_int(y), int((0 + 50) / 2))
     geo_box_a_2 = odb.dbBox_create(mpin_a,
                                    self.lib.getTech().getLayers()[0], 5,
                                    10, 100, 100)
     self.assertTrue(self.iterm_a.getAvgXY(x, y))
     self.assertEqual(odb.get_int(x), int(((0 + 50) + (5 + 100)) / 4))
     self.assertEqual(odb.get_int(y), int(((0 + 50) + (10 + 100)) / 4))
Exemplo n.º 4
0
    def net_source(self, net):
        # See if it's an input pad
        for bt in net.getBTerms():
            if bt.getIoType != 'INPUT':
                continue
            good, x, y = bt.getFirstPinLocation()
            if good:
                return (True, (x, y))

        # Or maybe output of a cell
        x = odb.new_int(0)
        y = odb.new_int(0)

        for it in net.getITerms():
            if not it.isOutputSignal():
                continue
            if it.getAvgXY(x, y):
                return (False, (odb.get_int(x), odb.get_int(y)))

        # Nothing found
        return None, None
Exemplo n.º 5
0
    block_top.getBTerms()) == len(pin_placement["#N"] + pin_placement["#E"] +
                                  pin_placement["#S"] + pin_placement["#W"])

# generate slots

DIE_AREA = block_top.getDieArea()
BLOCK_LL_X = DIE_AREA.xMin()
BLOCK_LL_Y = DIE_AREA.yMin()
BLOCK_UR_X = DIE_AREA.xMax()
BLOCK_UR_Y = DIE_AREA.yMax()

print("Block boundaries:", BLOCK_LL_X, BLOCK_LL_Y, BLOCK_UR_X, BLOCK_UR_Y)

origin, count, step = odb.new_int(0), odb.new_int(0), odb.new_int(0)
block_top.findTrackGrid(H_LAYER).getGridPatternY(0, origin, count, step)
origin, count, step = odb.get_int(origin), odb.get_int(count), odb.get_int(
    step)

h_tracks = getGrid(origin, count, step)

origin, count, step = odb.new_int(0), odb.new_int(0), odb.new_int(0)
block_top.findTrackGrid(V_LAYER).getGridPatternX(0, origin, count, step)
origin, count, step = odb.get_int(origin), odb.get_int(count), odb.get_int(
    step)

v_tracks = getGrid(origin, count, step)

for rev in reverse_arr:
    pin_placement[rev].reverse()

# create the pins