return DbU.fromLambda(l)
-def create_pins(
- cell, net, name, direction, status=Pin.PlacementStatus.FIXED, layer=None,
- x=0.0, y=0.0, width=2.0, height=2.0, repeat=1, delta=0.0, external=True,
-):
- """
- Creates a series of pins in a cell.
+def create_pins(cell, net, name, direction,
+ status=Pin.PlacementStatus.FIXED, layer=None,
+ x=0.0, y=0.0, width=2.0, height=2.0,
+ repeat=1, delta=0.0, external=True):
+ """Creates a series of pins in a cell.
:param cell: Hurricane.Cell object to place pins onto, or object name,
:param net: Hurricane.Net object name or name template, taking a pin
provided.
"""
if isinstance(cell, basestring):
- cell = CRL.AllianceFramework.get().getCell(
- cell, CRL.Catalog.State.Logical
- )
+ cell = af.getCell(cell, CRL.Catalog.State.Logical)
if layer is None:
layer = get_layer('METAL3')
iterator = repeat
for i in iterator:
- pin = Pin.create(
- cell.getNet(net.format(i)),
- name.format(i),
- direction,
- status,
- layer,
- l(x),
- l(y),
- l(width),
- l(height),
- )
+ pin = Pin.create(cell.getNet(net.format(i)), name.format(i),
+ direction, status, layer,
+ l(x), l(y), l(width), l(height))
if direction in (Pin.Direction.NORTH, Pin.Direction.SOUTH):
x += delta
else:
cellsTop = '~/alliance-check-toolkit/cells'
env = af.getEnvironment()
- env.addSYSTEM_LIBRARY(
- library=cellsTop + '/nsxlib', mode=CRL.Environment.Prepend
- )
- env.addSYSTEM_LIBRARY(
- library=cellsTop + '/mpxlib', mode=CRL.Environment.Prepend
- )
+ env.addSYSTEM_LIBRARY(library=cellsTop + '/nsxlib',
+ mode=CRL.Environment.Prepend)
+ env.addSYSTEM_LIBRARY(library=cellsTop + '/mpxlib',
+ mode=CRL.Environment.Prepend)
Cfg.getParamBool('misc.catchCore').setBool(False)
Cfg.getParamBool('misc.info').setBool(False)
UpdateSession.open()
cell.setAbutmentBox(ab)
- create_pins(
- cell, 'a({})', 'a({}).0', Pin.Direction.NORTH,
- x=10.0, y=height, delta=20.0, repeat=BIT_WIDTH,
- )
- create_pins(
- cell, 'o({})', 'o({}).0', Pin.Direction.SOUTH,
- x=100.0, y=0.0, delta=10.0, repeat=BIT_WIDTH,
- )
- create_pins(
- cell, 'b({})', 'b({}).0', Pin.Direction.NORTH,
- x=20.0, y=height, delta=20.0, repeat=BIT_WIDTH,
- )
+ create_pins(cell, 'a({})', 'a({}).0', Pin.Direction.NORTH,
+ x=10.0, y=height, delta=20.0, repeat=BIT_WIDTH)
+ create_pins(cell, 'o({})', 'o({}).0', Pin.Direction.SOUTH,
+ x=100.0, y=0.0, delta=10.0, repeat=BIT_WIDTH)
+ create_pins(cell, 'b({})', 'b({}).0', Pin.Direction.NORTH,
+ x=20.0, y=height, delta=20.0, repeat=BIT_WIDTH)
UpdateSession.close()
if editor:
UpdateSession.open()
cell.setAbutmentBox(ab)
- create_pins(
- cell, 'a({})', 'a({}).0', Pin.Direction.NORTH,
- x=10.0, y=height, delta=20.0, repeat=BIT_WIDTH,
- )
- create_pins(
- cell, 'o({})', 'o({}).0', Pin.Direction.SOUTH,
- x=100.0, y=0.0, delta=10.0, repeat=BIT_WIDTH,
- )
- create_pins(
- cell, 'b({})', 'b({}).0', Pin.Direction.NORTH,
- x=20.0, y=height, delta=20.0, repeat=BIT_WIDTH,
- )
+ create_pins(cell, 'a({})', 'a({}).0', Pin.Direction.NORTH,
+ x=10.0, y=height, delta=20.0, repeat=BIT_WIDTH)
+ create_pins(cell, 'o({})', 'o({}).0', Pin.Direction.SOUTH,
+ x=100.0, y=0.0, delta=10.0, repeat=BIT_WIDTH)
+ create_pins(cell, 'b({})', 'b({}).0', Pin.Direction.NORTH,
+ x=20.0, y=height, delta=20.0, repeat=BIT_WIDTH)
UpdateSession.close()
# find adder instance
add_inst = [x for x in instances if x.getName().endswith('add')][0]
- add_inst.setTransformation(
- Transformation(
- to_DbU(25.0), to_DbU(75.0), Transformation.Orientation.ID
- )
- )
+ add_inst.setTransformation(Transformation(to_DbU(25.0), to_DbU(75.0),
+ Transformation.Orientation.ID))
add_inst.setPlacementStatus(Instance.PlacementStatus.FIXED)
# find subtractor instance
sub_inst = [x for x in instances if x.getName().endswith('sub')][0]
- sub_inst.setTransformation(
- Transformation(
- to_DbU(725.0), to_DbU(75.0), Transformation.Orientation.ID
- )
- )
+ sub_inst.setTransformation(Transformation(to_DbU(725.0), to_DbU(75.0),
+ Transformation.Orientation.ID))
sub_inst.setPlacementStatus(Instance.PlacementStatus.FIXED)
y_north = cell.getAbutmentBox().getYMax()
- create_pins(
- cell, 'a({})', 'a({}).0', Pin.Direction.SOUTH,
- x=50.0, y=0.0, delta=60.0, repeat=BIT_WIDTH,
- )
- create_pins(
- cell, 'b({})', 'b({}).0', Pin.Direction.SOUTH,
- x=80.0, y=0.0, delta=60.0, repeat=BIT_WIDTH,
- )
- create_pins(
- cell, 'o({})', 'o({}).0', Pin.Direction.NORTH,
- x=50.0, y=y_north/l(1), # converting back to lambdas?
- delta=60.0, repeat=BIT_WIDTH,
- )
- create_pins(
- cell, 'rst', 'rst.0', Pin.Direction.WEST, layer=METAL2, x=0.0, y=140.0,
- )
+ create_pins(cell, 'a({})', 'a({}).0', Pin.Direction.SOUTH,
+ x=50.0, y=0.0, delta=60.0, repeat=BIT_WIDTH)
+ create_pins(cell, 'b({})', 'b({}).0', Pin.Direction.SOUTH,
+ x=80.0, y=0.0, delta=60.0, repeat=BIT_WIDTH)
+ create_pins(cell, 'o({})', 'o({}).0', Pin.Direction.NORTH,
+ x=50.0, y=y_north/l(1), # converting back to lambdas?
+ delta=60.0, repeat=BIT_WIDTH)
+ create_pins(cell, 'rst', 'rst.0', Pin.Direction.WEST, layer=METAL2,
+ x=0.0, y=140.0)
UpdateSession.close()
if editor: