import symbolic.cmos # do not remove
af = CRL.AllianceFramework.get()
+BIT_WIDTH = 16
def get_layer(name, layer_cache={}):
UpdateSession.open()
cell.setAbutmentBox(ab)
- for i in range(16):
+ for i in range(BIT_WIDTH):
x = 20.0 * i + 10.0
y = height
pin = Pin.create(
pin.getNet().setExternal(True)
NetExternalComponents.setExternal(pin)
- for i in range(16):
+ for i in range(BIT_WIDTH):
pin = Pin.create(
cell.getNet('o(%d)' % i),
'o(%d).0' % i,
pin.getNet().setExternal(True)
NetExternalComponents.setExternal(pin)
- for i in range(16):
+ for i in range(BIT_WIDTH):
net = cell.getNet('b(%d)' % i)
x = 20.0 * i + 10.0 + 10
y = height - 0
UpdateSession.open()
cell.setAbutmentBox(ab)
- for i in range(16):
+ for i in range(BIT_WIDTH):
x = 20.0 * i + 10.0
y = height
pin = Pin.create(
pin.getNet().setExternal(True)
NetExternalComponents.setExternal(pin)
- for i in range(16):
+ for i in range(BIT_WIDTH):
pin = Pin.create(
cell.getNet('o(%d)' % i),
'o(%d).0' % i,
pin.getNet().setExternal(True)
NetExternalComponents.setExternal(pin)
- for i in range(16):
+ for i in range(BIT_WIDTH):
net = cell.getNet('b(%d)' % i)
x = 20.0 * i + 10.0 + 10
y = height - 0
UpdateSession.open()
cell.setAbutmentBox(ab)
- ins = cell.getInstance('subckt_48_add')
- ins.setTransformation(
+ # get instances inside cell
+ instances = cell.getInstances()
+
+ # find adder instance
+ add_inst = [x for x in instances if x.getName().endswith('add')][0]
+ add_inst.setTransformation(
Transformation(
toDbU(25.0), toDbU(75.0), Transformation.Orientation.ID
)
)
- ins.setPlacementStatus(Instance.PlacementStatus.FIXED)
+ add_inst.setPlacementStatus(Instance.PlacementStatus.FIXED)
- ins = cell.getInstance('subckt_49_sub')
- ins.setTransformation(
+ # find subtractor instance
+ sub_inst = [x for x in instances if x.getName().endswith('sub')][0]
+ sub_inst.setTransformation(
Transformation(
toDbU(725.0), toDbU(75.0), Transformation.Orientation.ID
)
)
- ins.setPlacementStatus(Instance.PlacementStatus.FIXED)
+ sub_inst.setPlacementStatus(Instance.PlacementStatus.FIXED)
yNorth = cell.getAbutmentBox().getYMax()
- for i in range(16):
+ for i in range(BIT_WIDTH):
Pin.create(
cell.getNet('a(%d)' % i),
'a(%d).0' % i,
# this puts all the remaining cells (little ones)
# into this (small) space so that they do not go
# "all over the place" around the add and sub
- ab2 = Box( l( 400.0 )
- , l( 50.0 )
- , l( 700.0 )
- , l( 500.0 ) )
+ ab2 = Box(l(400.0), l(50.0), l(700.0), l(500.0))
- cell.setAbutmentBox( ab2 )
+ cell.setAbutmentBox(ab2)
etesian = Etesian.EtesianEngine.create(cell)
etesian.place()
# then route (globally)
# this connects up not just in the remaining (little) cells,
# it connects *to add and sub and the outside world as well*
- cell.setAbutmentBox( ab )
+ cell.setAbutmentBox(ab)
result = placeAndRoute(cell)