def add_key(self, key): """ Add a key to the packet :param key: The key to add :type key: int :raise SpinnmanInvalidParameterException: If the key is too\ big for the format """ if key > self._eieio_header.eieio_type.max_value: raise SpinnmanInvalidParameterException( "key", key, "Larger than the maximum allowed of {}".format( self._eieio_header.eieio_type.max_value)) EIEIODataMessage.add_element(self, EIEIOKeyDataElement(key))
def add_key(self, key): """ Add a key to the packet :param key: The key to add :type key: int :raise SpinnmanInvalidParameterException: If the key is too\ big for the format """ if key > self._eieio_header.eieio_type.max_value: raise SpinnmanInvalidParameterException( "key", key, "Larger than the maximum allowed of {}".format( self._eieio_header.eieio_type.max_value)) EIEIODataMessage.add_element(self, EIEIOKeyDataElement(key))
def add_key_and_payload(self, key, payload): """ Adds a key and payload to the packet :param key: The key to add :type key: int :param payload: The payload to add :type payload: int :raise SpinnmanInvalidParameterException: If the key or payload is too\ big for the format """ if key > self._eieio_header.eieio_type.max_value: raise SpinnmanInvalidParameterException( "key", key, "Larger than the maximum allowed of {}".format( self._eieio_header.eieio_type.max_value)) if payload > self._eieio_header.eieio_type.max_value: raise SpinnmanInvalidParameterException( "payload", payload, "Larger than the maximum allowed of {}".format( self._eieio_header.eieio_type.max_value)) EIEIODataMessage.add_element( self, EIEIOKeyPayloadDataElement(key, payload, self._eieio_header.is_time))
def add_key_and_payload(self, key, payload): """ Adds a key and payload to the packet :param key: The key to add :type key: int :param payload: The payload to add :type payload: int :raise SpinnmanInvalidParameterException: If the key or payload is too\ big for the format """ if key > self._eieio_header.eieio_type.max_value: raise SpinnmanInvalidParameterException( "key", key, "Larger than the maximum allowed of {}".format( self._eieio_header.eieio_type.max_value)) if payload > self._eieio_header.eieio_type.max_value: raise SpinnmanInvalidParameterException( "payload", payload, "Larger than the maximum allowed of {}".format( self._eieio_header.eieio_type.max_value)) EIEIODataMessage.add_element( self, EIEIOKeyPayloadDataElement(key, payload, self._eieio_header.is_time))