Source code for spinn_front_end_common.utilities.scp.scp_clear_iobuf_request
# Copyright (c) 2017-2019 The University of Manchester
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from spinnman.messages.sdp import SDPHeader, SDPFlag
from spinnman.messages.scp.abstract_messages import AbstractSCPRequest
from spinnman.messages.scp import SCPRequestHeader
from spinnman.messages.scp.impl import CheckOKResponse
from spinn_front_end_common.utilities.constants import (
SDP_RUNNING_MESSAGE_CODES)
[docs]class SCPClearIOBUFRequest(AbstractSCPRequest):
def __init__(
self, x, y, p, destination_port, expect_response=True):
# pylint: disable=too-many-arguments
sdp_flags = SDPFlag.REPLY_NOT_EXPECTED
if expect_response:
sdp_flags = SDPFlag.REPLY_EXPECTED
super(SCPClearIOBUFRequest, self).__init__(
SDPHeader(
flags=sdp_flags, destination_port=destination_port,
destination_cpu=p, destination_chip_x=x, destination_chip_y=y),
SCPRequestHeader(
command=SDP_RUNNING_MESSAGE_CODES.SDP_CLEAR_IOBUF_CODE),
argument_3=int(bool(expect_response)))
[docs] def get_scp_response(self):
return CheckOKResponse(
"clear iobuf",
SDP_RUNNING_MESSAGE_CODES.SDP_CLEAR_IOBUF_CODE.value)