• 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

62.5
/spinnman/processes/malloc_sdram_process.py
1
# Copyright (c) 2015 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 spinnman.messages.scp.impl.sdram_alloc import SDRAMAlloc, _AllocResponse
1✔
16
from .abstract_multi_connection_process import AbstractMultiConnectionProcess
1✔
17
from .abstract_multi_connection_process_connection_selector import (
1✔
18
    ConnectionSelector)
19

20

21
class MallocSDRAMProcess(AbstractMultiConnectionProcess[_AllocResponse]):
1✔
22
    """
23
    A process for allocating a block of SDRAM on a SpiNNaker chip.
24
    """
25
    __slots__ = ("_base_address", )
1✔
26

27
    def __init__(self, connection_selector: ConnectionSelector):
1✔
28
        """
29
        :param ConnectionSelector connection_selector:
30
        """
31
        super().__init__(connection_selector)
×
32
        self._base_address = 0
×
33

34
    def __handle_sdram_alloc_response(self, response: _AllocResponse):
1✔
35
        self._base_address = response.base_address
×
36

37
    def malloc_sdram(self, x: int, y: int, size: int, app_id: int, tag: int):
1✔
38
        """
39
        Allocate space in the SDRAM space.
40

41
        :param int x:
42
        :param int y:
43
        :param int size:
44
        :param int app_id:
45
        :param int tag:
46
        """
47
        # pylint: disable=too-many-arguments
48
        with self._collect_responses():
×
49
            self._send_request(SDRAMAlloc(x, y, app_id, size, tag),
×
50
                               self.__handle_sdram_alloc_response)
51

52
    @property
1✔
53
    def base_address(self) -> int:
1✔
54
        """
55
        The address of the allocated memory block.
56

57
        :rtype: int
58
        """
59
        return self._base_address
×
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