""" Main routine. """
with SessionManager():
- self.init_abutment_box()
+ self.compute_ab()
self.create_pins()
if self.editor:
return False
with SessionManager():
- self.init_abutment_box()
+ self.init_ab()
self.place_submodules()
# TODO: replace with some form of lazy evaluation?
# 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*
- self.init_abutment_box()
+ self.init_ab()
result = self.place_and_route()
self.save()
coriolis_setup()
add = AddSub(
- 'add', editor, width=350.0, height=400.0,
+ 'add', editor,
north_pins=[
{'net': 'a({})', 'x': 10.0, 'delta': 20.0, 'repeat': BIT_WIDTH},
{'net': 'b({})', 'x': 20.0, 'delta': 20.0, 'repeat': BIT_WIDTH},
},
)
sub = AddSub(
- 'sub', editor, width=350.0, height=400.0,
+ 'sub', editor,
north_pins=[
{'net': 'a({})', 'x': 10.0, 'delta': 20.0, 'repeat': BIT_WIDTH},
{'net': 'b({})', 'x': 20.0, 'delta': 20.0, 'repeat': BIT_WIDTH},
"""
return DbU.toLambda(dbu)
+ def compute_ab(self):
+ """ Compute default abutment box without placement. """
+ etesian = Etesian.EtesianEngine.create(self.cell)
+ etesian.setDefaultAb()
+ etesian.destroy()
+
def place(self):
""" Places the current cell. """
etesian = Etesian.EtesianEngine.create(self.cell)
if isinstance(repeat, int):
if repeat > 1 and delta == 0.0:
- raise Warning('You are trying to place pins on each other.')
+ raise Warning(
+ '{}: you are trying to place pins on each other.'.format(
+ self.name
+ )
+ )
iterator = range(repeat)
else:
iterator = repeat
return x, y
- def init_abutment_box(self):
+ def init_ab(self):
""" Create the abutment box with object's initial values. """
-
- self.ab = Box(0, 0, self.to_dbu(self.width), self.to_dbu(self.height))
+ if self.width and self.height:
+ self.ab = Box(
+ 0, 0, self.to_dbu(self.width), self.to_dbu(self.height)
+ )
+ else:
+ raise Warning('{}: Module size is not set.'.format(self.name))
def create_pins(self):
""" Creates all pins set on Module object creation. """
raise NotImplementedError('You need to implement the `build` method.')
+
class Config:
def __init__(self, priority=None):