Esempio n. 1
0
    def get_spec(self, port_type):
        """ get_spec(port_type) -> PortSpec

        Returns a PortSpec corresponding to the function parameter
        types set.  This is useful to make module functions look more
        like they are 'regular' modules and connections (which is what
        they get compiled down to in execution).

        port_type is either 'input' or 'output', as strings, which
        simply gets set on the spec being returned.
        """
        assert port_type == 'input' or port_type == 'output'
        result = PortSpec(sigstring=self.sigstring)
        result.type = port_type
        return result
Esempio n. 2
0
    def get_spec(self, port_type):
        """ get_spec(port_type) -> PortSpec

        Returns a PortSpec corresponding to the function parameter
        types set.  This is useful to make module functions look more
        like they are 'regular' modules and connections (which is what
        they get compiled down to in execution).

        port_type is either 'input' or 'output', as strings, which
        simply gets set on the spec being returned.
        """
        assert port_type == 'input' or port_type == 'output'
        result = PortSpec(sigstring=self.sigstring)
        result.type = port_type
        return result