spinnman.processes package

Submodules

spinnman.processes.abstract_multi_connection_process module

class spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_process.AbstractProcess

A process that uses multiple connections in communication.

spinnman.processes.abstract_multi_connection_process_connection_selector module

class spinnman.processes.abstract_multi_connection_process_connection_selector.AbstractMultiConnectionProcessConnectionSelector(connections)[source]

Bases: object

A connection selector for multi-connection processes

Parameters:connections – The connections to be used
get_next_connection(message)[source]

Get the index of the next connection for the process from a list of connections.

Parameters:message – The SCP message to be sent
Return type:int

spinnman.processes.abstract_process module

class spinnman.processes.abstract_process.AbstractProcess[source]

Bases: object

An abstract process for talking to SpiNNaker efficiently.

check_for_error(print_exception=False)[source]
is_error()[source]

spinnman.processes.abstract_single_connection_process module

class spinnman.processes.abstract_single_connection_process.AbstractSingleConnectionProcess(connection_selector, n_retries=10)[source]

Bases: spinnman.processes.abstract_process.AbstractProcess

A process that uses a single connection in communication.

spinnman.processes.application_run_process module

class spinnman.processes.application_run_process.ApplicationRunProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

run(app_id, core_subsets, wait)[source]

spinnman.processes.de_alloc_sdram_process module

class spinnman.processes.de_alloc_sdram_process.DeAllocSDRAMProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

de_alloc_sdram(x, y, app_id, base_address=None)[source]
no_blocks_freed

spinnman.processes.fill_process module

class spinnman.processes.fill_process.FillDataType(value, struct_type, doc='')[source]

Bases: enum.Enum

An enumeration.

BYTE = 1
HALF_WORD = 2
WORD = 4
struct

An object that can pack and unpack 4 bytes-worth of this type.

Return type:struct.Struct
struct_type

The struct descriptor for packing and unpacking 4 bytes-worth of this type.

Return type:str
class spinnman.processes.fill_process.FillProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for filling memory.

fill_memory(x, y, base_address, data, size, data_type)[source]

spinnman.processes.get_cpu_info_process module

class spinnman.processes.get_cpu_info_process.GetCPUInfoProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

get_cpu_info(core_subsets)[source]
handle_response(x, y, p, response)[source]

spinnman.processes.get_heap_process module

class spinnman.processes.get_heap_process.GetHeapProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

get_heap(chip_address, pointer=<SystemVariableDefinition.sdram_heap_address: _Definition(offset=76, data_type=<_DataType.INT: 4>, default=0, array_size=None, doc='The base address of the user SDRAM heap')>)[source]

spinnman.processes.get_machine_process module

class spinnman.processes.get_machine_process.GetMachineProcess(connection_selector, ignore_chips, ignore_cores, ignore_links, max_core_id, max_sdram_size=None)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for getting the machine details over a set of connections.

create_machine(width, height, repair_machine, ignore_bad_ethernets)[source]
get_chip_info()[source]

Get the chip information for the machine.

Note

get_machine_details() must have been called first.

get_machine_details(boot_x, boot_y, width, height, repair_machine, ignore_bad_ethernets)[source]

spinnman.processes.get_routes_process module

class spinnman.processes.get_routes_process.GetMultiCastRoutesProcess(connection_selector, app_id=None)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading the multicast routing table of a SpiNNaker chip.

get_routes(x, y, base_address)[source]
handle_read_response(offset, response)[source]

spinnman.processes.get_tags_process module

class spinnman.processes.get_tags_process.GetTagsProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

get_tags(connection)[source]
handle_get_tag_response(tag, board_address, response)[source]
handle_tag_info_response(response)[source]

spinnman.processes.get_version_process module

class spinnman.processes.get_version_process.GetVersionProcess(connection_selector, n_retries=10)[source]

Bases: spinnman.processes.abstract_single_connection_process.AbstractSingleConnectionProcess

A process for getting the version of the machine.

get_version(x, y, p)[source]

spinnman.processes.load_fixed_route_routing_entry_process module

class spinnman.processes.load_fixed_route_routing_entry_process.LoadFixedRouteRoutingEntryProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

load_fixed_route(x, y, fixed_route, app_id=0)[source]

Load a fixed route routing entry onto a chip.

Parameters:
  • x (int) – The x-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions.
  • y (int) – The y-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions.
  • fixed_route – the fixed route entry
  • app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
Return type:

None

spinnman.processes.load_routes_process module

class spinnman.processes.load_routes_process.LoadMultiCastRoutesProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for loading the multicast routing table on a SpiNNaker chip.

handle_router_alloc_response(response)[source]
load_routes(x, y, routes, app_id)[source]

spinnman.processes.malloc_sdram_process module

class spinnman.processes.malloc_sdram_process.MallocSDRAMProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for allocating a block of SDRAM on a SpiNNaker chip.

base_address
malloc_sdram(x, y, size, app_id, tag)[source]

Allocate space in the SDRAM space.

spinnman.processes.most_direct_connection_selector module

class spinnman.processes.most_direct_connection_selector.MostDirectConnectionSelector(machine, connections)[source]

Bases: spinnman.processes.abstract_multi_connection_process_connection_selector.AbstractMultiConnectionProcessConnectionSelector

A selector that goes for the most direct connection for the message.

Parameters:connections – The connections to be used
get_next_connection(message)[source]

Get the index of the next connection for the process from a list of connections.

Parameters:message – The SCP message to be sent
Return type:int
set_machine(new_machine)[source]

spinnman.processes.read_fixed_route_routing_entry_process module

class spinnman.processes.read_fixed_route_routing_entry_process.ReadFixedRouteRoutingEntryProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading a chip’s fixed route routing entry.

Creates the process for writing a fixed route entry to a chip’s router.

Parameters:connection_selector – the SC&MP connection selector
handle_read_response(response)[source]
read_fixed_route(x, y, app_id=0)[source]

Reads a fixed route routing table entry.

Parameters:
  • x (int) – The x-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
  • y (int) – The y-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
  • app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
Return type:

None

spinnman.processes.read_iobuf_process module

class spinnman.processes.read_iobuf_process.ReadIOBufProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading IOBUF memory (mostly log messages) from a SpiNNaker core.

read_iobuf(iobuf_size, core_subsets)[source]
Return type:iterable of IOBuffer

spinnman.processes.read_memory_process module

class spinnman.processes.read_memory_process.ReadMemoryProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading memory on a SpiNNaker chip.

handle_response(offset, response)[source]
read_memory(x, y, p, base_address, length)[source]

spinnman.processes.read_router_diagnostics_process module

class spinnman.processes.read_router_diagnostics_process.ReadRouterDiagnosticsProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading the diagnostic data block from a SpiNNaker router.

get_router_diagnostics(x, y)[source]
handle_control_register_response(response)[source]
handle_error_status_response(response)[source]
handle_register_response(response)[source]

spinnman.processes.round_robin_connection_selector module

class spinnman.processes.round_robin_connection_selector.RoundRobinConnectionSelector(connections)[source]

Bases: spinnman.processes.abstract_multi_connection_process_connection_selector.AbstractMultiConnectionProcessConnectionSelector

Parameters:connections – The connections to be used
get_next_connection(message)[source]

Get the index of the next connection for the process from a list of connections.

Parameters:message – The SCP message to be sent
Return type:int

spinnman.processes.send_single_command_process module

class spinnman.processes.send_single_command_process.SendSingleCommandProcess(connection_selector, n_retries=3, timeout=1.0)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

execute(request)[source]
handle_response(response)[source]

spinnman.processes.write_memory_flood_process module

class spinnman.processes.write_memory_flood_process.WriteMemoryFloodProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for writing memory on multiple SpiNNaker chips at once.

write_memory_from_bytearray(nearest_neighbour_id, base_address, data, offset, n_bytes=None)[source]
write_memory_from_reader(nearest_neighbour_id, base_address, reader, n_bytes)[source]

spinnman.processes.write_memory_process module

class spinnman.processes.write_memory_process.WriteMemoryProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for writing memory on a SpiNNaker chip.

write_memory_from_bytearray(x, y, p, base_address, data, offset, n_bytes)[source]

Writes memory onto a SpiNNaker chip from a bytearray.

Parameters:
  • x – The x-coordinate of the chip where the memory is to be written to
  • y – The y-coordinate of the chip where the memory is to be written to
  • p – The processor of the chip where the memory is to be written to
  • processor_address – the (x, y, p) coords of the chip in question
  • base_address – the address in SDRAM to start writing
  • data (bytearray or bytes) – the data to write
  • offset – where in the data to start writing from
  • n_bytes – how much data to write
Return type:

None

write_memory_from_reader(x, y, p, base_address, reader, n_bytes)[source]

Writes memory onto a SpiNNaker chip from a reader.

Parameters:
  • x – The x-coordinate of the chip where the memory is to be written to
  • y – The y-coordinate of the chip where the memory is to be written to
  • p – The processor of the chip where the memory is to be written to
  • base_address – the address in SDRAM to start writing
  • reader (io.RawIOBase or io.BufferedIOBase) – the readable object containing the data to write
  • n_bytes – how much data to write
Return type:

None

Module contents

class spinnman.processes.AbstractMultiConnectionProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_process.AbstractProcess

A process that uses multiple connections in communication.

class spinnman.processes.ApplicationRunProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

run(app_id, core_subsets, wait)[source]
class spinnman.processes.DeAllocSDRAMProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

de_alloc_sdram(x, y, app_id, base_address=None)[source]
no_blocks_freed
class spinnman.processes.GetCPUInfoProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

get_cpu_info(core_subsets)[source]
handle_response(x, y, p, response)[source]
class spinnman.processes.GetHeapProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

get_heap(chip_address, pointer=<SystemVariableDefinition.sdram_heap_address: _Definition(offset=76, data_type=<_DataType.INT: 4>, default=0, array_size=None, doc='The base address of the user SDRAM heap')>)[source]
class spinnman.processes.GetMachineProcess(connection_selector, ignore_chips, ignore_cores, ignore_links, max_core_id, max_sdram_size=None)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for getting the machine details over a set of connections.

create_machine(width, height, repair_machine, ignore_bad_ethernets)[source]
get_chip_info()[source]

Get the chip information for the machine.

Note

get_machine_details() must have been called first.

get_machine_details(boot_x, boot_y, width, height, repair_machine, ignore_bad_ethernets)[source]
class spinnman.processes.GetMultiCastRoutesProcess(connection_selector, app_id=None)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading the multicast routing table of a SpiNNaker chip.

get_routes(x, y, base_address)[source]
handle_read_response(offset, response)[source]
class spinnman.processes.GetTagsProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

get_tags(connection)[source]
handle_get_tag_response(tag, board_address, response)[source]
handle_tag_info_response(response)[source]
class spinnman.processes.GetVersionProcess(connection_selector, n_retries=10)[source]

Bases: spinnman.processes.abstract_single_connection_process.AbstractSingleConnectionProcess

A process for getting the version of the machine.

get_version(x, y, p)[source]
class spinnman.processes.FillDataType(value, struct_type, doc='')[source]

Bases: enum.Enum

An enumeration.

BYTE = 1
HALF_WORD = 2
WORD = 4
struct

An object that can pack and unpack 4 bytes-worth of this type.

Return type:struct.Struct
struct_type

The struct descriptor for packing and unpacking 4 bytes-worth of this type.

Return type:str
class spinnman.processes.FillProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for filling memory.

fill_memory(x, y, base_address, data, size, data_type)[source]
class spinnman.processes.LoadFixedRouteRoutingEntryProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

load_fixed_route(x, y, fixed_route, app_id=0)[source]

Load a fixed route routing entry onto a chip.

Parameters:
  • x (int) – The x-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions.
  • y (int) – The y-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions.
  • fixed_route – the fixed route entry
  • app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
Return type:

None

class spinnman.processes.LoadMultiCastRoutesProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for loading the multicast routing table on a SpiNNaker chip.

handle_router_alloc_response(response)[source]
load_routes(x, y, routes, app_id)[source]
class spinnman.processes.MallocSDRAMProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for allocating a block of SDRAM on a SpiNNaker chip.

base_address
malloc_sdram(x, y, size, app_id, tag)[source]

Allocate space in the SDRAM space.

class spinnman.processes.MostDirectConnectionSelector(machine, connections)[source]

Bases: spinnman.processes.abstract_multi_connection_process_connection_selector.AbstractMultiConnectionProcessConnectionSelector

A selector that goes for the most direct connection for the message.

Parameters:connections – The connections to be used
get_next_connection(message)[source]

Get the index of the next connection for the process from a list of connections.

Parameters:message – The SCP message to be sent
Return type:int
set_machine(new_machine)[source]
class spinnman.processes.ReadFixedRouteRoutingEntryProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading a chip’s fixed route routing entry.

Creates the process for writing a fixed route entry to a chip’s router.

Parameters:connection_selector – the SC&MP connection selector
handle_read_response(response)[source]
read_fixed_route(x, y, app_id=0)[source]

Reads a fixed route routing table entry.

Parameters:
  • x (int) – The x-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
  • y (int) – The y-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
  • app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
Return type:

None

class spinnman.processes.ReadIOBufProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading IOBUF memory (mostly log messages) from a SpiNNaker core.

read_iobuf(iobuf_size, core_subsets)[source]
Return type:iterable of IOBuffer
class spinnman.processes.ReadMemoryProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading memory on a SpiNNaker chip.

handle_response(offset, response)[source]
read_memory(x, y, p, base_address, length)[source]
class spinnman.processes.ReadRouterDiagnosticsProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading the diagnostic data block from a SpiNNaker router.

get_router_diagnostics(x, y)[source]
handle_control_register_response(response)[source]
handle_error_status_response(response)[source]
handle_register_response(response)[source]
class spinnman.processes.RoundRobinConnectionSelector(connections)[source]

Bases: spinnman.processes.abstract_multi_connection_process_connection_selector.AbstractMultiConnectionProcessConnectionSelector

Parameters:connections – The connections to be used
get_next_connection(message)[source]

Get the index of the next connection for the process from a list of connections.

Parameters:message – The SCP message to be sent
Return type:int
class spinnman.processes.SendSingleCommandProcess(connection_selector, n_retries=3, timeout=1.0)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

execute(request)[source]
handle_response(response)[source]
class spinnman.processes.WriteMemoryFloodProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for writing memory on multiple SpiNNaker chips at once.

write_memory_from_bytearray(nearest_neighbour_id, base_address, data, offset, n_bytes=None)[source]
write_memory_from_reader(nearest_neighbour_id, base_address, reader, n_bytes)[source]
class spinnman.processes.WriteMemoryProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for writing memory on a SpiNNaker chip.

write_memory_from_bytearray(x, y, p, base_address, data, offset, n_bytes)[source]

Writes memory onto a SpiNNaker chip from a bytearray.

Parameters:
  • x – The x-coordinate of the chip where the memory is to be written to
  • y – The y-coordinate of the chip where the memory is to be written to
  • p – The processor of the chip where the memory is to be written to
  • processor_address – the (x, y, p) coords of the chip in question
  • base_address – the address in SDRAM to start writing
  • data (bytearray or bytes) – the data to write
  • offset – where in the data to start writing from
  • n_bytes – how much data to write
Return type:

None

write_memory_from_reader(x, y, p, base_address, reader, n_bytes)[source]

Writes memory onto a SpiNNaker chip from a reader.

Parameters:
  • x – The x-coordinate of the chip where the memory is to be written to
  • y – The y-coordinate of the chip where the memory is to be written to
  • p – The processor of the chip where the memory is to be written to
  • base_address – the address in SDRAM to start writing
  • reader (io.RawIOBase or io.BufferedIOBase) – the readable object containing the data to write
  • n_bytes – how much data to write
Return type:

None