Пример #1
0
    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)
Пример #2
0
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()
Пример #3
0
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()
Пример #4
0
def blobinit(AA):
    db.addson('blob', logs.bin2str(AA))
Пример #5
0
def colorinit(AA):
    db.addson('color', logs.bin2str(AA))
Пример #6
0
def flopinit(AA):
    db.addson('flop', logs.bin2str(AA))
Пример #7
0
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