def _always_decorator(func): if not isinstance(func, FunctionType): raise AlwaysError(_error.ArgType) if _isGenFunc(func): raise AlwaysError(_error.ArgType) if func.__code__.co_argcount > 0: raise AlwaysError(_error.NrOfArgs) return _Always(func, args, callinfo=callinfo, sigdict=sigdict)
def _always_seq_decorator(func): if not isinstance(func, FunctionType): raise AlwaysSeqError(_error.ArgType) if _isGenFunc(func): raise AlwaysSeqError(_error.ArgType) if func.__code__.co_argcount > 0: raise AlwaysSeqError(_error.NrOfArgs) return _AlwaysSeq(func, edge, reset)
def _always_seq_decorator(func): if not isinstance(func, FunctionType): raise AlwaysSeqError(_error.ArgType) if _isGenFunc(func): raise AlwaysSeqError(_error.ArgType) if func.func_code.co_argcount > 0: raise AlwaysSeqError(_error.NrOfArgs) return _AlwaysSeq(func, edge, reset)
def instance(genFunc): if not isinstance(genFunc, FunctionType): raise InstanceError(_error.ArgType) if not _isGenFunc(genFunc): raise InstanceError(_error.ArgType) if genFunc.func_code.co_argcount > 0: raise InstanceError(_error.NrOfArgs) return _Instantiator(genFunc)
def _always_seq_decorator(func): if not isinstance(func, FunctionType): raise AlwaysSeqError(_error.ArgType) if _isGenFunc(func): raise AlwaysSeqError(_error.ArgType) if func.__code__.co_argcount > 0: raise AlwaysSeqError(_error.NrOfArgs) return _AlwaysSeq(func, edge, reset, callinfo=callinfo, sigdict=sigdict)
def _always_decorator(func): if not isinstance(func, FunctionType): raise AlwaysError(_error.ArgType) if _isGenFunc(func): raise AlwaysError(_error.ArgType) if func.__code__.co_argcount > 0: raise AlwaysError(_error.NrOfArgs) return _Always(func, args)
def _always_decorator(func): if not isinstance(func, FunctionType): raise AlwaysError(_error.ArgType) if _isGenFunc(func): raise AlwaysError(_error.ArgType) if func.func_code.co_argcount > 0: raise AlwaysError(_error.NrOfArgs) return _Always(func, args)
def instance(genfunc): callinfo = _getCallInfo() if not isinstance(genfunc, FunctionType): raise InstanceError(_error.ArgType) if not _isGenFunc(genfunc): raise InstanceError(_error.ArgType) if genfunc.__code__.co_argcount > 0: raise InstanceError(_error.NrOfArgs) return _Instantiator(genfunc, callinfo=callinfo)
def always_comb(func): if not isinstance( func, FunctionType): raise AlwaysCombError(_error.ArgType) if _isGenFunc(func): raise AlwaysCombError(_error.ArgType) if func.__code__.co_argcount > 0: raise AlwaysCombError(_error.NrOfArgs) c = _AlwaysComb(func) return c
def always_comb(func): if not isinstance(func, FunctionType): raise AlwaysCombError(_error.ArgType) if _isGenFunc(func): raise AlwaysCombError(_error.ArgType) if func.__code__.co_argcount > 0: raise AlwaysCombError(_error.NrOfArgs) c = _AlwaysComb(func) return c
def comb_logic(func): '''Decorator for combinational logic functions in PygMyHDL. Create a combinational logic block and store it on the instance list.''' callinfo = myhdlinst._getCallInfo() if not isinstance(func, FunctionType): raise myhdlcomb.AlwaysCombError(myhdlcomb._error.ArgType) if myhdlutil._isGenFunc(func): raise myhdlcomb.AlwaysCombError(myhdlcomb._error.ArgType) if func.__code__.co_argcount > 0: raise myhdlcomb.AlwaysCombError(myhdlcomb._error.NrOfArgs) c = myhdlcomb._AlwaysComb(func, callinfo=callinfo) _instances.append(c) return c
def _always_seq_decorator(func): if not isinstance(func, FunctionType): raise myhdlseq.AlwaysSeqError(myhdlseq._error.ArgType) if myhdlutil._isGenFunc(func): raise myhdlseq.AlwaysSeqError(myhdlseq._error.ArgType) if func.__code__.co_argcount > 0: raise myhdlseq.AlwaysSeqError(myhdlseq._error.NrOfArgs) c = myhdlseq._AlwaysSeq(func, edge, reset, callinfo=callinfo, sigdict=sigdict) _instances.append(c) return c
def always_comb(func): if not isinstance( func, FunctionType): raise AlwaysCombError(_error.ArgType) if _isGenFunc(func): raise AlwaysCombError(_error.ArgType) if func.func_code.co_argcount > 0: raise AlwaysCombError(_error.NrOfArgs) varnames = func.func_code.co_varnames symdict = {} for n, v in func.func_globals.items(): if n not in varnames: symdict[n] = v # handle free variables if func.func_code.co_freevars: for n, c in zip(func.func_code.co_freevars, func.func_closure): obj = _cell_deref(c) symdict[n] = obj c = _AlwaysComb(func, symdict) return c
def always_comb(func): if not isinstance(func, FunctionType): raise AlwaysCombError(_error.ArgType) if _isGenFunc(func): raise AlwaysCombError(_error.ArgType) if func.__code__.co_argcount > 0: raise AlwaysCombError(_error.NrOfArgs) varnames = func.__code__.co_varnames symdict = {} for n, v in func.__globals__.items(): if n not in varnames: symdict[n] = v # handle free variables if func.__code__.co_freevars: for n, c in zip(func.__code__.co_freevars, func.__closure__): try: obj = _cell_deref(c) symdict[n] = obj except NameError: raise NameError(n) c = _AlwaysComb(func, symdict) return c