hwt/synthesizer/interface.py
def _signalsForInterface(self, context, prefix='', typeTransform=None):
        """
        generate _sig for each interface which has no subinterface
        if already has _sig return it instead

        :param context: instance of RtlNetlist where signals should be created
        :param prefix: name prefix for created signals
        :param typeTransform: optional function (type) returns modified type
            for signal
        """
        sigs = []
        if self._interfaces:
            for intf in self._interfaces:
                sigs.extend(
                    intf._signalsForInterface(context, prefix,
                                              typeTransform=typeTransform))
        else:
            if hasattr(self, '_sig'):
                sigs = [self._sig]
            else:
                t = self._dtype
                if typeTransform is not None:
                    t = typeTransform(t)

                s = context.sig(prefix + self._getPhysicalName(), t)
                s._interface = self
                self._sig = s

                if hasattr(self, '_boundedEntityPort'):
                    self._boundedEntityPort.connectSig(self._sig)
                sigs = [s]

        return sigs
def _signalsForInterface(self, context, prefix='', typeTransform=None):
        sigs = []
        if self._interfaces:
            for intf in self._interfaces:
                sigs.extend(
                    intf._signalsForInterface(context, prefix,
                                              typeTransform=typeTransform))
        else:
            if hasattr(self, '_sig'):
                sigs = [self._sig]
            else:
                t = self._dtype
                if typeTransform is not None:
                    t = typeTransform(t)

                s = context.sig(prefix + self._getPhysicalName(), t)
                s._interface = self
                self._sig = s

                if hasattr(self, '_boundedEntityPort'):
                    self._boundedEntityPort.connectSig(self._sig)
                sigs = [s]

        return sigs
def _signalsForInterface ( self , context , prefix = '' , typeTransform = None ) : sigs = [ ] if self . _interfaces : for intf in self . _interfaces : sigs . extend ( intf . _signalsForInterface ( context , prefix , typeTransform = typeTransform ) ) else : if hasattr ( self , '_sig' ) : sigs = [ self . _sig ] else : t = self . _dtype if typeTransform is not None : t = typeTransform ( t ) s = context . sig ( prefix + self . _getPhysicalName ( ) , t ) s . _interface = self self . _sig = s if hasattr ( self , '_boundedEntityPort' ) : self . _boundedEntityPort . connectSig ( self . _sig ) sigs = [ s ] return sigs
generate _sig for each interface which has no subinterface
        if already has _sig return it instead

        :param context: instance of RtlNetlist where signals should be created
        :param prefix: name prefix for created signals
        :param typeTransform: optional function (type) returns modified type
            for signal
generate _sig for each interface which has no subinterface if already has _sig return it instead