def __init__(self, Kind, Path): self.Kind = Kind self.Path = Path self.Base = db.baseme(self) self.Pins = {} veri.force('%s.base' % (Path), str(self.Base)) if Kind == 'color': self.Color = logs.bin2str(veri.peek('%s.color' % (Path))) self.Clock = logs.bin2str(veri.peek('%s.clock' % (Path))) self.refClock = logs.bin2str(veri.peek('%s.refclock' % (Path))) if self.Clock != '': self.Cycle = 0 self.Pins['in0'] = newNet(self, 'in0', self.Base) self.Pins['out0'] = newNet(self, 'out0', self.Base) elif Kind == 'blob': self.Func = logs.bin2str(veri.peek('%s.func' % (Path))) self.Func = self.Func.replace('||', '|') self.Func = self.Func.replace('&&', '&') self.Func = self.Func.replace('!', '~') self.Vars = getVars(self.Func) for Var in self.Vars: self.Pins[Var] = newNet(self, Var, self.Base) self.Pins['out0'] = newNet(self, 'out0', self.Base) self.Vals = {} elif Kind == 'flop': self.Pins['clk'] = newNet(self, 'clk', self.Base) self.Pins['dd'] = newNet(self, 'dd', self.Base) self.Pins['qq'] = newNet(self, 'qq', self.Base) else: logs.log_error('kind is %s' % self.Kind)
def work_ant(Id, Who): if Id not in Workers: PP = veri.peek_mem('tb.paths', str2(Id)) Path = logs.bin2str(PP) Who = logs.bin2str(Who) Eval = '%sWorkerClass(Path)' % Who Obj = eval(Eval) Workers[Id] = Obj logs.log_info('who %s %s %s' % (Id, Who, Path)) Workers[Id].run()
def ram_operator(Id, Path): PP = logs.bin2str(Path) ID = logs.intx(Id) # logs.log_info('ram_operator %s %s'%(PP,ID)) if (ID <= 0): pass elif ID not in ANTS: ANTS[ID] = antClass.ramClass(PP, ID) else: ANTS[ID].run()
def blobinit(AA): db.addson('blob', logs.bin2str(AA))
def colorinit(AA): db.addson('color', logs.bin2str(AA))
def flopinit(AA): db.addson('flop', logs.bin2str(AA))
def initial(Id): Id = logs.intx(Id) PP = veri.peek_mem('tb.paths', str(Id)) Path = logs.bin2str(PP) print 'my id', Id, Path Workers