af = CRL.AllianceFramework.get()
-def toDbU(l):
- return DbU.fromLambda(l)
-
-
-def createVertical(contacts, x, layer, width=None):
- def yincrease(lhs, rhs):
- return int(lhs.getY() - rhs.getY())
-
- contacts.sort(yincrease)
+def get_layer(name, layer_cache={}):
+ """ Creates a new layer or returns it from cache. """
+ if name in layer_cache:
+ return layer_cache[name]
- if width is None: width = l(2.0)
+ layer = DataBase.getDB().getTechnology().getLayer(name)
+ layer_cache[name] = layer
+ return layer
- for i in range(1, len(contacts)):
- print("create vert", contacts[i - 1], contacts[i], layer, x, width)
- v = Vertical.create(contacts[i - 1], contacts[i], layer, x, width)
- print("v", v)
-
-def build_downtrace(net, layer, x, y, y1):
- contacts = [
- Contact.create(net, layer, l(x), l(y), l(2.0), l(2.0)),
- Contact.create(net, layer, l(x), l(y1), l(2.0), l(2.0)),
- ]
-
- createVertical(contacts, l(x), layer)
- print("slaves", contacts[-1].getSlaveComponents())
- for component in contacts[-1].getSlaveComponents():
- NetExternalComponents.setExternal(component)
+def toDbU(l):
+ return DbU.fromLambda(l)
def placeAndRoute(cell):
db = DataBase.getDB()
print(db, dir(db))
- METAL2 = DataBase.getDB().getTechnology().getLayer('METAL2')
- METAL3 = DataBase.getDB().getTechnology().getLayer('METAL3')
- METAL5 = DataBase.getDB().getTechnology().getLayer('METAL5')
- BLOCKAGE2 = DataBase.getDB().getTechnology().getLayer('BLOCKAGE2')
- BLOCKAGE3 = DataBase.getDB().getTechnology().getLayer('BLOCKAGE3')
- BLOCKAGE4 = DataBase.getDB().getTechnology().getLayer('BLOCKAGE4')
- BLOCKAGE5 = DataBase.getDB().getTechnology().getLayer('BLOCKAGE5')
+ METAL2 = get_layer('METAL2')
+ METAL3 = get_layer('METAL3')
+ METAL5 = get_layer('METAL5')
+ BLOCKAGE2 = get_layer('BLOCKAGE2')
+ BLOCKAGE3 = get_layer('BLOCKAGE3')
+ BLOCKAGE4 = get_layer('BLOCKAGE4')
+ BLOCKAGE5 = get_layer('BLOCKAGE5')
cell = af.getCell('add', CRL.Catalog.State.Logical)
print(cell.getNet('a(0)'))
db = DataBase.getDB()
print(db, dir(db))
- METAL2 = DataBase.getDB().getTechnology().getLayer('METAL2')
- METAL3 = DataBase.getDB().getTechnology().getLayer('METAL3')
- METAL5 = DataBase.getDB().getTechnology().getLayer('METAL5')
- BLOCKAGE2 = DataBase.getDB().getTechnology().getLayer('BLOCKAGE2')
- BLOCKAGE3 = DataBase.getDB().getTechnology().getLayer('BLOCKAGE3')
- BLOCKAGE4 = DataBase.getDB().getTechnology().getLayer('BLOCKAGE4')
- BLOCKAGE5 = DataBase.getDB().getTechnology().getLayer('BLOCKAGE5')
+ METAL2 = get_layer('METAL2')
+ METAL3 = get_layer('METAL3')
+ METAL5 = get_layer('METAL5')
+ BLOCKAGE2 = get_layer('BLOCKAGE2')
+ BLOCKAGE3 = get_layer('BLOCKAGE3')
+ BLOCKAGE4 = get_layer('BLOCKAGE4')
+ BLOCKAGE5 = get_layer('BLOCKAGE5')
cell = af.getCell('sub', CRL.Catalog.State.Logical)
print(cell.getNet('a(0)'))
db = DataBase.getDB()
print(db, dir(db))
- METAL2 = DataBase.getDB().getTechnology().getLayer('METAL2')
- METAL3 = DataBase.getDB().getTechnology().getLayer('METAL3')
+ METAL2 = get_layer('METAL2')
+ METAL3 = get_layer('METAL3')
cell = af.getCell('alu16', CRL.Catalog.State.Logical)
if not cell: