Example #1
0
 def __init__(s):
     s.in1 = InPort(4)
     s.in2 = InPort(4)
     s.in3 = InPort(16)
     s.out1 = OutPort(4)
     s.out2 = OutPort(4)
     s.out3 = OutPort(16)
Example #2
0
    def _reverse(self):

        for var_name, var_obj in self.__dict__.items():

            if isinstance(var_obj, InPort):
                self.__dict__[var_name] = OutPort(var_obj.dtype)
            elif isinstance(var_obj, OutPort):
                self.__dict__[var_name] = InPort(var_obj.dtype)

        return self
Example #3
0
    def __new__(cls, *args, **kwargs):
        """Pre-constructor adds default 'clk' and 'reset' Signals to PyMTL.

    We use __new__ instead of __init__ for this purpose so that user's
    do not need to explicitly call the super constructor in their Model
    definitions: ``super( Model, self ).__init__()`` is too ugly!
    """

        # Instantiate a new Python object
        inst = object.__new__(cls)

        # Add implicit clk and reset ports
        inst.clk = InPort(1)
        inst.reset = InPort(1)

        # Initialize internal datastructures
        inst._tick_blocks = []
        inst._posedge_clk_blocks = []
        inst._combinational_blocks = []
        inst._connections = set()

        return inst
Example #4
0
 def __init__(s):
     s.in_ = InPort(8)
     s.out = OutPort(8)
Example #5
0
 def __init__(s):
     s.in_ = InPort(Bits(8))
     s.out = OutPort(Bits(8))
Example #6
0
 def __init__(s):
     s.in0 = InPort(4)
     s.in1 = InPort(6)
     s.in2 = InPort(8)
     s.out = OutPort(8)
Example #7
0
 def __init__(s):
     s.in_ = InPort(8)
     s.out0 = OutPort(4)
     s.out1 = OutPort(6)
     s.out2 = OutPort(8)