From 83f918107bb29f1ab3ef08eae5c1624d0376179b Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 21 Apr 2020 21:05:18 +0000 Subject: [PATCH] automatically located the joining cells between add and sub --- experiments7/doAlu16.py | 64 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/experiments7/doAlu16.py b/experiments7/doAlu16.py index 66f4043..1b8248f 100755 --- a/experiments7/doAlu16.py +++ b/experiments7/doAlu16.py @@ -11,6 +11,9 @@ from Hurricane import Breakpoint 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 @@ -90,6 +93,52 @@ class ALU16(Module): 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): @@ -157,13 +206,14 @@ class ALU16(Module): 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) -- 2.30.2