from Hurricane import Instance
from coriolis2.settings import af
from utils import Module, SessionManager, Config
+import Etesian
+import helpers
+from helpers.overlay import UpdateSession
import symbolic.cmos # do not remove
x += inst.getAbutmentBox().getWidth()
def place(self):
+ """ALU16.place(), manual placement overload."""
+ datapath_insts = []
+ add, sub = self.submodules
+ #print (sub.ab, dir(list(sub.cell.getInstances())[0]))
+ #print (list(sub.cell.getInstances())[0].getAbutmentBox())
+ subx = widths[BIT_WIDTH] - 40 #self.from_dbu(sub.ab.getXMax())
+ addx = self.from_dbu(add.ab.getWidth()) + 5
+
+ for i in range(BIT_WIDTH):
+ dp = [['nmx2', None],
+ ['no2', None],
+ ['sff1', None]]
+
+ # XXX here is the computed abutment box which we want to
+ # place the auto-located cells into, using *auto* place
+ # *not* manual place.
+ y = 40.0 + i * 50
+ y1 = y + 50
+ ab = Box(self.to_dbu(addx), self.to_dbu(y),
+ self.to_dbu(subx), self.to_dbu(y1))
+ print ("ab", addx, subx, ab, self.from_dbu(ab.getWidth()),
+ self.from_dbu(ab.getHeight()))
+
+ # automatically locate all non-placed cells connected to
+ # o(0)....o(15)
+ find = self.get_net_connections(['o(%d)' % i],
+ ['clk', 'rst', 'op'])
+ for inst in find:
+ print (inst, inst.getName(), dir(inst))
+ print ("place", ab, inst, dir(inst))
+ for column in dp:
+ if inst.getName().find(column[0]) != -1:
+ column[1] = inst
+ # XXX TODO: want to auto-place the instances
+ #with SessionManager():
+ #cell.setAbutmentBox(ab)
+ #etesian = Etesian.EtesianEngine.create(cell)
+ #etesian.place()
+ datapath_insts.append(dp)
+
+ # place to right of add
+ add, sub = self.submodules
+ add_wid = self.from_dbu(add.ab.getWidth())
+ self.place_datapath(datapath_insts, add_wid, 40.0, 1)
+
+ def _old_place(self):
"""ALU16.place(), manual placement overload."""
datapath_insts = []
for i in range(BIT_WIDTH):
self.create_pins()
- find = self.get_net_connections(['o(15)'],
- ['clk', 'rst', 'op'])
- print (find)
- sys.exit(0)
- find = self.get_net_connections(['o_next(0)'],
- ['clk', 'vss', 'vdd', 'rst'])
- print (find)
+ if False:
+ find = self.get_net_connections(['o(15)'],
+ ['clk', 'rst', 'op'])
+ print (find)
+ sys.exit(0)
+ find = self.get_net_connections(['o_next(0)'],
+ ['clk', 'vss', 'vdd', 'rst'])
+ print (find)
if self.editor:
self.editor.setCell(self.cell)