Skip to content

Commit

Permalink
Merge branch 'master' into config2
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Jun 8, 2021
2 parents 5932889 + 2956899 commit bb8bc0a
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 1 deletion.
3 changes: 3 additions & 0 deletions spinnman/messages/scp/impl/bmp_set_led.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

class BMPSetLed(BMPRequest):
""" Set the LED(s) of a board to either on, off or toggling
This class is currently deprecated and untested as there is no
known use except for Transceiver.set_led which is itself deprecated.
"""
__slots__ = []

Expand Down
4 changes: 4 additions & 0 deletions spinnman/messages/scp/impl/read_adc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
class ReadADC(BMPRequest):
""" SCP Request for the data from the BMP including voltages and\
temperature.
This class is currently deprecated and untested as there is no
known use except for Transceiver.read_adc_data which is itself
deprecated.
"""
__slots__ = []

Expand Down
3 changes: 3 additions & 0 deletions spinnman/messages/scp/impl/set_led.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

class SetLED(AbstractSCPRequest):
""" A request to change the state of an SetLED
This class is currently deprecated and untested as there is no
known use except for Transceiver.set_led which is itself deprecated.
"""
__slots__ = []

Expand Down
5 changes: 5 additions & 0 deletions spinnman/processes/de_alloc_sdram_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@


class DeAllocSDRAMProcess(AbstractMultiConnectionProcess):
"""
This class is currently deprecated and untested as there is no
known use except for Transceiver.free_sdram and free_sdram_by_app_id
which are both themselves deprecated.
"""
__slots__ = [
"_no_blocks_freed"]

Expand Down
65 changes: 64 additions & 1 deletion spinnman/transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from spinn_utilities.config_holder import get_config_bool
from spinn_utilities.abstract_context_manager import AbstractContextManager
from spinn_utilities.log import FormatAdapter
from spinn_utilities.logger_utils import warn_once
from spinn_machine import CoreSubsets
from spinnman.constants import (
BMP_POST_POWER_ON_SLEEP_TIME, BMP_POWER_ON_TIMEOUT, BMP_TIMEOUT,
Expand Down Expand Up @@ -456,6 +457,9 @@ def _check_connection(
def _chip_execute_lock(self, x, y):
""" Get a lock for executing an executable on a chip
This method is currently deprecated and untested as there is no
known use except for excute which is itself deprecated.
:param int x:
:param int y:
"""
Expand Down Expand Up @@ -1138,6 +1142,10 @@ def set_watch_dog_on_chip(self, x, y, watch_dog):
""" Enable, disable or set the value of the watch dog timer on a\
specific chip
This method is currently deprecated and untested as there is no
known use. Same functionaility provided by ybug and bmpc.
Retained in case needed for hardware debugging.
:param int x: chip x coord to write new watchdog param to
:param int y: chip y coord to write new watchdog param to
:param watch_dog:
Expand All @@ -1147,6 +1155,8 @@ def set_watch_dog_on_chip(self, x, y, watch_dog):
:type watch_dog: bool or int
"""
# build what we expect it to be
warn_once(logger, "The set_watch_dog_on_chip method is deprecated "
"and untested due to no known use.")
value_to_set = watch_dog
WATCHDOG = SystemVariableDefinition.software_watchdog_count
if isinstance(watch_dog, bool):
Expand All @@ -1162,12 +1172,18 @@ def set_watch_dog_on_chip(self, x, y, watch_dog):
def set_watch_dog(self, watch_dog):
""" Enable, disable or set the value of the watch dog timer
This method is currently deprecated and untested as there is no
known use. Same functionaility provided by ybug and bmpc.
Retained in case nneded for hardware debugging.
:param watch_dog:
Either a boolean indicating whether to enable (True) or
disable (False) the watch dog timer, or an int value to set the
timer count to.
:type watch_dog: bool or int
"""
warn_once(logger, "The set_watch_dog method is deprecated and "
"untested due to no known use.")
if self._machine is None:
self._update_machine()
for x, y in self._machine.chip_coordinates:
Expand All @@ -1176,6 +1192,8 @@ def set_watch_dog(self, watch_dog):
def get_iobuf_from_core(self, x, y, p):
""" Get the contents of IOBUF for a given core
This method is currently deprecated and likely to be removed.
:param int x: The x-coordinate of the chip containing the processor
:param int y: The y-coordinate of the chip containing the processor
:param int p: The ID of the processor to get the IOBUF for
Expand All @@ -1191,6 +1209,8 @@ def get_iobuf_from_core(self, x, y, p):
:raise SpinnmanUnexpectedResponseCodeException:
If a response indicates an error during the exchange
"""
warn_once(logger, "The get_iobuf_from_core method is deprecated and "
"likely to be removed.")
core_subsets = CoreSubsets()
core_subsets.add_processor(x, y, p)
return next(self.get_iobuf(core_subsets))
Expand Down Expand Up @@ -1223,6 +1243,8 @@ def execute(
wait=False, is_filename=False):
""" Start an executable running on a single chip
This method is currently deprecated and likely to be removed.
:param int x:
The x-coordinate of the chip on which to run the executable
:param int y:
Expand Down Expand Up @@ -1263,6 +1285,8 @@ def execute(
:raise SpinnmanUnexpectedResponseCodeException:
If a response indicates an error during the exchange
"""
warn_once(logger, "The Transceiver's execute method is deprecated "
"likely to be removed.")
# Lock against updates
with self._chip_execute_lock(x, y):
# Write the executable
Expand Down Expand Up @@ -1458,6 +1482,10 @@ def _power(self, power_command, boards=0, cabinet=0, frame=0):
def set_led(self, led, action, board, cabinet, frame):
""" Set the LED state of a board in the machine
This method is currently deprecated and untested as there is no
known use. Same functionaility provided by ybug and bmpc.
Retained in case needed for hardware debugging.
:param led:
Number of the LED or an iterable of LEDs to set the state of (0-7)
:type led: int or iterable(int)
Expand All @@ -1470,6 +1498,8 @@ def set_led(self, led, action, board, cabinet, frame):
:param int cabinet: the cabinet this is targeting
:param int frame: the frame this is targeting
"""
warn_once(logger, "The set_led method is deprecated and "
"untested due to no known use.")
process = SendSingleCommandProcess(
self._bmp_connection(cabinet, frame))
process.execute(BMPSetLed(led, action, board))
Expand Down Expand Up @@ -1516,12 +1546,18 @@ def write_fpga_register(self, fpga_num, register, value, cabinet, frame,
def read_adc_data(self, board, cabinet, frame):
""" Read the BMP ADC data
This method is currently deprecated and untested as there is no
known use. Same functionaility provided by ybug and bmpc.
Retained in case needed for hardware debugging.
:param int cabinet: cabinet: the cabinet this is targeting
:param int frame: the frame this is targeting
:param int board: which board to request the ADC data from
:return: the FPGA's ADC data object
:rtype: ADCInfo
"""
warn_once(logger, "The read_adc_data method is deprecated and "
"untested due to no known use.")
process = SendSingleCommandProcess(
self._bmp_connection(cabinet, frame))
response = process.execute(ReadADC(board))
Expand Down Expand Up @@ -1653,6 +1689,8 @@ def write_neighbour_memory(self, x, y, link, base_address, data,
:raise SpinnmanUnexpectedResponseCodeException:
If a response indicates an error during the exchange
"""
warn_once(logger, "The write_neighbour_memory method is deprecated "
"and untested due to no known use.")
process = WriteMemoryProcess(self._scamp_connection_selector)
if isinstance(data, io.RawIOBase):
process.write_link_memory_from_reader(
Expand Down Expand Up @@ -1796,6 +1834,10 @@ def read_neighbour_memory(self, x, y, link, base_address, length, cpu=0):
SCP command. If sent to a BMP, this command can be used to\
communicate with the FPGAs' debug registers.
This method is currently deprecated and untested as there is no
known use. Same functionaility provided by ybug and bmpc.
Retained in case needed for hardware debugging.
:param int x:
The x-coordinate of the chip whose neighbour is to be read from
:param int y:
Expand All @@ -1819,7 +1861,8 @@ def read_neighbour_memory(self, x, y, link, base_address, length, cpu=0):
:raise SpinnmanUnexpectedResponseCodeException:
If a response indicates an error during the exchange
"""

warn_once(logger, "The read_neighbour_memory method is deprecated "
"and untested due to no known use.")
process = ReadMemoryProcess(self._scamp_connection_selector)
return process.read_link_memory(x, y, cpu, link, base_address, length)

Expand Down Expand Up @@ -2052,6 +2095,8 @@ def set_leds(self, x, y, cpu, led_states):
:raise SpinnmanUnexpectedResponseCodeException:
If a response indicates an error during the exchange
"""
warn_once(logger, "The set_leds is deprecated and "
"untested due to no known use.")
process = SendSingleCommandProcess(self._scamp_connection_selector)
process.execute(SetLED(x, y, cpu, led_states))

Expand Down Expand Up @@ -2254,23 +2299,33 @@ def malloc_sdram(self, x, y, size, app_id, tag=None):
def free_sdram(self, x, y, base_address, app_id):
""" Free allocated SDRAM
This method is currently deprecated and likely to be removed.
:param int x: The x-coordinate of the chip onto which to ask for memory
:param int y: The y-coordinate of the chip onto which to ask for memory
:param int base_address: The base address of the allocated memory
:param int app_id: The app ID of the allocated memory
"""
warn_once(logger, "The free_sdram method is deprecated and "
"likely to be removed.")
process = DeAllocSDRAMProcess(self._scamp_connection_selector)
process.de_alloc_sdram(x, y, app_id, base_address)

def free_sdram_by_app_id(self, x, y, app_id):
""" Free all SDRAM allocated to a given app ID
This method is currently deprecated and untested as there is no
known use. Same functionaility provided by ybug and bmpc.
Retained in case needed for hardware debugging.
:param int x: The x-coordinate of the chip onto which to ask for memory
:param int y: The y-coordinate of the chip onto which to ask for memory
:param int app_id: The app ID of the allocated memory
:return: The number of blocks freed
:rtype: int
"""
warn_once(logger, "The free_sdram_by_app_id method is deprecated and "
"untested due to no known use.")
process = DeAllocSDRAMProcess(self._scamp_connection_selector)
process.de_alloc_sdram(x, y, app_id)
return process.no_blocks_freed
Expand Down Expand Up @@ -2526,8 +2581,12 @@ def clear_router_diagnostic_counters(self, x, y, enable=True,
def number_of_boards_located(self):
""" The number of boards currently configured.
This method is currently deprecated and likely to be removed.
:rtype: int
"""
warn_once(logger, "The number_of_boards_located method is deprecated "
"and likely to be removed.")
boards = 0
for bmp_connection in self._bmp_connections:
boards += len(bmp_connection.boards)
Expand Down Expand Up @@ -2686,8 +2745,12 @@ def scamp_connection_selector(self):
@property
def bmp_connection(self):
"""
This method is currently deprecated and likely to be removed.
:rtype: dict(tuple(int,int),MostDirectConnectionSelector)
"""
warn_once(logger, "The bmp_connection property is deprecated and "
"likely to be removed.")
return self._bmp_connection_selectors

def get_heap(self, x, y, heap=SystemVariableDefinition.sdram_heap_address):
Expand Down

0 comments on commit bb8bc0a

Please sign in to comment.