import CRL
import Cfg
from Hurricane import Box
-from plugins import RSavePlugin
from coriolis2.settings import af
from utils import Module, SessionManager
class AddSub(Module):
- def do(self):
+ def build(self):
""" Main routine. """
with SessionManager():
with SessionManager():
self.create_pads()
- RSavePlugin.ScriptMain(editor=self.editor, cell=self.cell)
+ self.save()
return result
class ALU16(Module):
- def do(self):
+ def save(self):
+ self.name = self.name + '_r'
+ self.af.saveCell(self.cell, CRL.Catalog.State.Views)
+ super(ALU16, self).save()
+
+ def build(self):
- if not self.do_submodules():
+ if not self.build_submodules():
return False
with SessionManager():
self.init_abutment_box()
result = self.place_and_route()
- self.name = self.name + '_r'
- self.af.saveCell(self.cell, CRL.Catalog.State.Views)
- RSavePlugin.ScriptMain(editor=self.editor, cell=self.cell)
-
+ self.save()
return result
{'net': 'rst', 'y': 140.0, 'layer': 'METAL2'},
],
)
- return alu16.do()
+ return alu16.build()
if __name__ == '__main__':
DbU, DataBase, UpdateSession, Box, Transformation, Instance, Pad, Pin,
NetExternalComponents,
)
+from plugins import RSavePlugin
class SessionManager(object):
x=None, y=None, width=2.0, height=2.0,
repeat=1, delta=0.0, external=True):
"""
- Creates a series of pins in a cell.
+ Creates a pin or a series of pins in a cell.
:param net: Hurricane.Net object name or name template, taking a pin
enumeration parameter, i. e. pin number,
for net, layers in self.pads.items():
self.create_pads_for_net(net, layers)
- def do_submodules(self):
+ def build_submodules(self):
"""
Execute submodules and gather their status.
"""
for submodule, x, y in self.submodules:
- if not submodule.do():
+ if not submodule.build():
return False
return True
))
instance.setPlacementStatus(Instance.PlacementStatus.FIXED)
- def do(self):
+ def save(self):
+ """ Saves cell. """
+ RSavePlugin.ScriptMain(editor=self.editor, cell=self.cell)
+
+ def build(self):
""" Main routine. """
- raise NotImplementedError('You need to implement the `do` method.')
+ raise NotImplementedError('You need to implement the `build` method.')