Exemplo n.º 1
0
 def __init__(self, cmpFn=lambda x, y: x < y):
     """
     :param cmpFn: function (item0, item1) if returns true,
         items are not swaped
     """
     Unit.__init__(self)
     self.cmpFn = cmpFn
Exemplo n.º 2
0
 def __init__(self, intfCls: Type[VldSynced]):
     """
     :param hsIntfCls: class of interface which should be used
         as interface of this unit
     """
     self.intfCls = intfCls
     Unit.__init__(self)
Exemplo n.º 3
0
 def __init__(self, cmpFn=lambda x, y: x < y):
     """
     :param cmpFn: function (item0, item1) if returns true,
         items are not swaped
     """
     Unit.__init__(self)
     self.cmpFn = cmpFn
Exemplo n.º 4
0
 def __init__(self, hsIntfCls: Type[Union[Handshaked, HandshakeSync]]):
     """
     :param hsIntfCls: class of interface which should be used
         as interface of this unit
     """
     assert(issubclass(hsIntfCls, (Handshaked, HandshakeSync))), hsIntfCls
     self.intfCls = hsIntfCls
     Unit.__init__(self)
Exemplo n.º 5
0
 def __init__(self, structT, tmpl=None, frames=None):
     """
     :param structT: instance of HStruct which specifies data format to download
     :param tmpl: instance of TransTmpl for this structT
     :param frames: list of FrameTmpl instances for this tmpl
     :note: if tmpl and frames are None they are resolved from structT parseTemplate
     :note: this unit can parse sequence of frames, if they are specified by "frames"
     :attention: interfaces for each field in struct will be dynamically created
     :attention: structT can not contain fields with variable size like HStream
     """
     Unit.__init__(self)
     assert isinstance(structT, HStruct)
     TemplateConfigured.__init__(self, structT, tmpl=tmpl, frames=frames)
Exemplo n.º 6
0
    def __init__(self, structTemplate, intfCls=None, shouldEnterFn=None):
        """
        :param structTemplate: instance of HStruct which describes
            address space of this endpoint
        :param intfCls: class of bus interface which should be used
        :param shouldEnterFn: function(root_t, structFieldPath) return (shouldEnter, shouldUse)
            where shouldEnter is flag that means iterator over this interface
            should look inside of this actual object
            and shouldUse flag means that this field should be used
            (to create interface)
        """
        assert intfCls is not None, "intfCls has to be specified"

        self._intfCls = intfCls
        self.STRUCT_TEMPLATE = structTemplate
        if shouldEnterFn is None:
            self.shouldEnterFn = self._defaultShouldEnterFn
        else:
            self.shouldEnterFn = shouldEnterFn
        Unit.__init__(self)
Exemplo n.º 7
0
    def __init__(self, structTemplate, intfCls=None, shouldEnterFn=None):
        """
        :param structTemplate: instance of HStruct which describes
            address space of this endpoint
        :param intfCls: class of bus interface which should be used
        :param shouldEnterFn: function(structField) return (shouldEnter, shouldUse)
            where shouldEnter is flag that means iterator over this interface
            should look inside of this actual object
            and shouldUse flag means that this field should be used
            (to create interface)
        """
        assert intfCls is not None, "intfCls has to be specified"

        self._intfCls = intfCls
        self.STRUCT_TEMPLATE = structTemplate
        if shouldEnterFn is None:
            self.shouldEnterFn = self._defaultShouldEnterFn
        else:
            self.shouldEnterFn = shouldEnterFn
        Unit.__init__(self)
Exemplo n.º 8
0
    def __init__(self, structT, tmpl=None, frames=None):
        """
        :param structT: instance of HStruct which specifies data format to download
        :param tmpl: instance of TransTmpl for this structT
        :param frames: list of FrameTmpl instances for this tmpl
        :note: if tmpl and frames are None they are resolved from structT parseTemplate
        :note: this unit can parse sequence of frames, if they are specified by "frames"
        :attention: interfaces for each field in struct will be dynamically created
        :attention: structT can not contain fields with variable size like HStream
        """
        Unit.__init__(self)
        assert isinstance(structT, HStruct)
        self._structT = structT
        if tmpl is not None:
            assert frames is not None, "tmpl and frames can be used only together"
        else:
            assert frames is None, "tmpl and frames can be used only together"

        self._tmpl = tmpl
        self._frames = frames
Exemplo n.º 9
0
Arquivo: base.py Projeto: Nic30/hwtLib
 def __init__(self, intfCls=AxiStream):
     """
     :param hsIntfCls: class of interface which should be used as interface of this unit
     """
     self.intfCls = intfCls
     Unit.__init__(self)
Exemplo n.º 10
0
 def __init__(self):
     Unit.__init__(self)
Exemplo n.º 11
0
 def __init__(self, axiCls):
     self.axiCls = axiCls
     Unit.__init__(self)
Exemplo n.º 12
0
 def __init__(self, intfCls=AxiStream):
     """
     :param hsIntfCls: class of interface which should be used as interface of this unit
     """
     self.intfCls = intfCls
     Unit.__init__(self)
Exemplo n.º 13
0
 def __init__(self, intfCls: Type[MonitorIntf]):
     self.intfCls = intfCls
     Unit.__init__(self)