• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SpiNNakerManchester / SpiNNMan / 6574804013

19 Oct 2023 12:47PM UTC coverage: 51.937% (+1.2%) from 50.777%
6574804013

Pull #327

github

Christian-B
typing changes
Pull Request #327: Type Annotations and Checking

105 of 1288 branches covered (0.0%)

Branch coverage included in aggregate %.

2375 of 2375 new or added lines in 180 files covered. (100.0%)

4775 of 8108 relevant lines covered (58.89%)

0.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.33
/spinnman/messages/scp/impl/read_link.py
1
# Copyright (c) 2014 The University of Manchester
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
6
#
7
#     https://www.apache.org/licenses/LICENSE-2.0
8
#
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14

15
from spinn_utilities.overrides import overrides
1✔
16
from spinn_utilities.typing.coords import XYP
1✔
17
from spinnman.messages.scp import SCPRequestHeader
1✔
18
from spinnman.messages.scp.abstract_messages import AbstractSCPRequest
1✔
19
from spinnman.messages.scp.enums import SCPCommand
1✔
20
from spinnman.messages.sdp import SDPFlag, SDPHeader
1✔
21
from .read_memory import Response
1✔
22

23

24
class ReadLink(AbstractSCPRequest[Response]):
1✔
25
    """
26
    An SCP request to read a region of memory via a link on a chip.
27
    """
28
    __slots__ = ()
1✔
29

30
    def __init__(
1✔
31
            self, coordinates: XYP, link: int, base_address: int, size: int):
32
        """
33
        :param tuple(int,int,int) coordinates:
34
            The coordinates of the core of the chip whose neighbour will be
35
            read from; X and Y between 0 and 255,
36
            CPU core normally 0 (or if a BMP then the board slot number)
37
        :param int link: The ID of the link down which to send the query
38
        :param int base_address:
39
            The positive base address to start the read from
40
        :param int size: The number of bytes to read, between 1 and 256
41
        """
42
        # pylint: disable=too-many-arguments
43
        x, y, cpu = coordinates
1✔
44
        super().__init__(
1✔
45
            SDPHeader(
46
                flags=SDPFlag.REPLY_EXPECTED, destination_port=0,
47
                destination_cpu=cpu, destination_chip_x=x,
48
                destination_chip_y=y),
49
            SCPRequestHeader(command=SCPCommand.CMD_LINK_READ),
50
            argument_1=base_address, argument_2=size, argument_3=link)
51

52
    @overrides(AbstractSCPRequest.get_scp_response)
1✔
53
    def get_scp_response(self) -> Response:
1✔
54
        return Response("read neighbour memory", "CMD_LINK_READ")
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc