spinnman.data package

Module contents

class spinnman.data.SpiNNManDataView

Bases: spinn_machine.data.machine_data_view.MachineDataView

Adds the extra Methods to the View for SpiNNMan level.

See UtilsDataView for a more detailed description.

This class is designed to only be used directly within the SpiNNMan repository as all methods are available to subclasses

classmethod free_id(app_id)[source]

Frees up an app_id

previously transceiver.app_id_tracker.free_id(app_id)

Parameters:app_id (int) –
classmethod get_app_id()[source]

Gets the main app id used by the transceiver.

This method will create a new app_id if one has not yet been created.

Return type:int
classmethod get_new_id()[source]

Gets a new id from the current app_id_tracker

previously transceiver.app_id_tracker.get_new_id()

Return type:AppIdTracker
classmethod get_scamp_connection_selector()[source]

Gets the scamp connection selector from the transceiver

Semantic sugar for transceiver.scamp_connection_selector

Return type:MostDirectConnectionSelector
Raises:SpiNNUtilsException – If the transceiver is currently unavailable
classmethod get_transceiver()[source]

The transceiver description

Return type:Transceiver
Raises:SpiNNUtilsException – If the transceiver is currently unavailable
classmethod has_transceiver()[source]

Reports if a transceiver is currently set

Return type:bool
classmethod read_memory(x, y, base_address, length, cpu=0)[source]

Read some areas of memory (usually SDRAM) from the board.

Semantic sugar for transceiver.read_memory

Parameters:
  • x (int) – The x-coordinate of the chip where the memory is to be read from
  • y (int) – The y-coordinate of the chip where the memory is to be read from
  • base_address (int) – The address in SDRAM where the region of memory to be read starts
  • length (int) – The length of the data to be read in bytes
  • cpu (int) – the core ID used to read the memory of; should usually be 0 when reading from SDRAM, but may be other values when reading from DTCM.
Returns:

A bytearray of data read

Return type:

bytes

Raises:
classmethod write_memory(x, y, base_address, data, n_bytes=None, offset=0, cpu=0, is_filename=False)[source]

Write to the SDRAM on the board.

Semantic sugar for transceiver.read_memory

Parameters:
  • x (int) – The x-coordinate of the chip where the memory is to be written to
  • y (int) – The y-coordinate of the chip where the memory is to be written to
  • base_address (int) – The address in SDRAM where the region of memory is to be written
  • data (RawIOBase or bytes or bytearray or int or str) –

    The data to write. Should be one of the following:

    • An instance of RawIOBase
    • A bytearray/bytes
    • A single integer - will be written in little-endian byte order
    • A filename of a data file (in which case is_filename must be set to True)
  • n_bytes (int) –

    The amount of data to be written in bytes. If not specified:

    • If data is an RawIOBase, an error is raised
    • If data is a bytearray, the length of the bytearray will be used
    • If data is an int, 4 will be used
    • If data is a str, the length of the file will be used
  • offset (int) – The offset from which the valid data begins
  • cpu (int) – The optional CPU to write to
  • is_filename (bool) – True if data is a filename
Raises: