spinn_front_end_common.utilities package

Subpackages

Submodules

spinn_front_end_common.utilities.constants module

class spinn_front_end_common.utilities.constants.BUFFERING_OPERATIONS

Bases: enum.Enum

BUFFER_READ = 0
BUFFER_WRITE = 1
class spinn_front_end_common.utilities.constants.SDP_PORTS

Bases: enum.Enum

EXTRA_MONITOR_CORE_DATA_IN_SPEED_UP = 6
EXTRA_MONITOR_CORE_DATA_SPEED_UP = 5
EXTRA_MONITOR_CORE_REINJECTION = 4
INPUT_BUFFERING_SDP_PORT = 1
OUTPUT_BUFFERING_SDP_PORT = 2
RUNNING_COMMAND_SDP_PORT = 3
spinn_front_end_common.utilities.constants.SDP_RUNNING_MESSAGE_CODES

alias of spinn_front_end_common.utilities.constants.SDP_RUNNING_MESSAGE_ID_CODES

spinn_front_end_common.utilities.exceptions module

exception spinn_front_end_common.utilities.exceptions.BufferableRegionTooSmall[source]

Bases: spinn_front_end_common.utilities.exceptions.SpinnFrontEndException

Raised when the SDRAM space of the region for buffered packets is too small to contain any packet at all

exception spinn_front_end_common.utilities.exceptions.BufferedRegionNotPresent[source]

Bases: spinn_front_end_common.utilities.exceptions.SpinnFrontEndException

Raised when trying to issue buffered packets for a region not managed

exception spinn_front_end_common.utilities.exceptions.ConfigurationException[source]

Bases: spinn_front_end_common.utilities.exceptions.SpinnFrontEndException

Raised when the front end determines a input parameter is invalid

exception spinn_front_end_common.utilities.exceptions.ExecutableFailedToStartException[source]

Bases: spinn_front_end_common.utilities.exceptions.SpinnFrontEndException

Raised when an executable has not entered the expected state during start up

exception spinn_front_end_common.utilities.exceptions.ExecutableFailedToStopException[source]

Bases: spinn_front_end_common.utilities.exceptions.SpinnFrontEndException

Raised when an executable has not entered the expected state during execution

exception spinn_front_end_common.utilities.exceptions.ExecutableNotFoundException[source]

Bases: spinn_front_end_common.utilities.exceptions.SpinnFrontEndException

Raised when a specified executable could not be found

exception spinn_front_end_common.utilities.exceptions.RallocException[source]

Bases: spinn_front_end_common.utilities.exceptions.SpinnFrontEndException

Raised when there are not enough routing table entries

exception spinn_front_end_common.utilities.exceptions.SpinnFrontEndException[source]

Bases: exceptions.Exception

Raised when the front end detects an error

spinn_front_end_common.utilities.failed_state module

class spinn_front_end_common.utilities.failed_state.FailedState[source]

Bases: spinn_front_end_common.utilities.simulator_interface.SimulatorInterface

add_socket_address(socket_address)[source]
buffer_manager
config
graph_mapper
has_ran
increment_none_labelled_vertex_count
machine
machine_time_step
no_machine_time_steps
none_labelled_vertex_count
placements
run(run_time)[source]
stop()[source]
tags
time_scale_factor
transceiver
use_virtual_board
verify_not_running()[source]

spinn_front_end_common.utilities.function_list module

spinn_front_end_common.utilities.globals_variables module

spinn_front_end_common.utilities.globals_variables.get_not_running_simulator()[source]
spinn_front_end_common.utilities.globals_variables.get_simulator()[source]
spinn_front_end_common.utilities.globals_variables.has_simulator()[source]
spinn_front_end_common.utilities.globals_variables.set_failed_state(new_failed_state)[source]
spinn_front_end_common.utilities.globals_variables.set_simulator(new_simulator)[source]
spinn_front_end_common.utilities.globals_variables.unset_simulator()[source]

spinn_front_end_common.utilities.helpful_functions module

spinn_front_end_common.utilities.helpful_functions.convert_string_into_chip_and_core_subset(cores)[source]

Translate a string list of cores into a core subset

Parameters:cores (str or None) – string representing down cores formatted as x,y,p[:x,y,p]*
spinn_front_end_common.utilities.helpful_functions.convert_time_diff_to_total_milliseconds(sample)[source]

Convert between a time diff and total milliseconds.

Returns:total milliseconds
Return type:float
spinn_front_end_common.utilities.helpful_functions.convert_vertices_to_core_subset(vertices, placements)[source]

Converts vertices into core subsets.

Parameters:
  • extra_monitor_cores_to_set – the vertices to convert to core subsets
  • placements – the placements object
Returns:

the CoreSubSets of the vertices

spinn_front_end_common.utilities.helpful_functions.determine_flow_states(executable_types, no_sync_changes)[source]

Get the start and end states for these executable types.

Parameters:
  • executable_types (dict( ExecutableType -> any)) – the execute types to locate start and end states from
  • no_sync_changes (int) – the number of times sync signals been sent
Returns:

dict of executable type to states.

Return type:

2-tuple

spinn_front_end_common.utilities.helpful_functions.emergency_recover_state_from_failure(txrx, app_id, vertex, placement)[source]

Used to get at least some information out of a core when something goes badly wrong. Not a replacement for what abstract spinnaker base does.

Parameters:
spinn_front_end_common.utilities.helpful_functions.emergency_recover_states_from_failure(txrx, app_id, executable_targets)[source]

Used to get at least some information out of a core when something goes badly wrong. Not a replacement for what abstract spinnaker base does.

Parameters:
  • txrx – The transceiver.
  • app_id – The ID of the application.
  • executable_targets – The what/where mapping
spinn_front_end_common.utilities.helpful_functions.flood_fill_binary_to_spinnaker(executable_targets, binary, txrx, app_id)[source]

flood fills a binary to spinnaker on a given app_id given the executable targets and binary.

Parameters:
  • executable_targets – the executable targets object
  • binary – the binary to flood fill
  • txrx (Tranceiver) – spinnman instance
  • app_id – the app id to load it on
Returns:

the number of cores it was loaded onto

spinn_front_end_common.utilities.helpful_functions.generate_unique_folder_name(folder, filename, extension)[source]

Generate a unique file name with a given extension in a given folder

Parameters:
  • folder – where to put this unique file
  • filename – the name of the first part of the file without extension
  • extension – extension of the file
Returns:

file path with a unique addition

spinn_front_end_common.utilities.helpful_functions.get_ethernet_chip(machine, board_address)[source]

Locate the chip with the given board IP address

Parameters:
  • machine – the SpiNNaker machine
  • board_address – the board address to locate the chip of.
Returns:

The chip that supports that board address

Raises:

ConfigurationException – when that board address has no chip associated with it

spinn_front_end_common.utilities.helpful_functions.locate_extra_monitor_mc_receiver(machine, placement_x, placement_y, packet_gather_cores_to_ethernet_connection_map)[source]
spinn_front_end_common.utilities.helpful_functions.locate_memory_region_for_placement(placement, region, transceiver)[source]

Get the address of a region for a placement

Parameters:
  • region (int) – the region to locate the base address of
  • placement (Placement) – the placement object to get the region address of
  • transceiver (Transceiver) – the python interface to the SpiNNaker machine
spinn_front_end_common.utilities.helpful_functions.read_config(config, section, item)[source]

Get the string value of a config item, returning None if the value is “None”

spinn_front_end_common.utilities.helpful_functions.read_config_boolean(config, section, item)[source]

Get the boolean value of a config item, returning None if the value is “None”

spinn_front_end_common.utilities.helpful_functions.read_config_int(config, section, item)[source]

Get the integer value of a config item, returning None if the value is “None”

spinn_front_end_common.utilities.helpful_functions.read_data(x, y, address, length, data_format, transceiver)[source]

Reads and converts a single data item from memory

Parameters:
  • x – chip x
  • y – chip y
  • address – base address of the SDRAM chip to read
  • length – length to read
  • data_format – the format to read memory
  • transceiver – the SpinnMan interface

Translate the down cores and down chips string into a form that spinnman can understand

Parameters:
  • downed_cores (str or None) – string representing down cores formatted as x,y,p[:x,y,p]*
  • downed_chips (str or None) – string representing down chips formatted as x,y[:x,y]*
  • downed_links – string representing down links formatted as x,y,link[:x,y,link]*
Returns:

a tuple of ( set of (x, y) of down chips, set of (x, y, p) of down cores, set of ((x, y), link ID) of down links)

Return type:

tuple(set(tuple(int, int)), set(tuple(int, int, int)), set(tuple(tuple(int, int), int)))

spinn_front_end_common.utilities.helpful_functions.write_address_to_user0(txrx, x, y, p, address)[source]

Writes the given address into the user_0 register of the given core.

Parameters:
  • txrx – The transceiver.
  • x – Chip coordinate.
  • y – Chip coordinate.
  • p – Core ID on chip.
  • address – Value to write (32-bit integer)

spinn_front_end_common.utilities.math_constants module

random math constants

spinn_front_end_common.utilities.simulator_interface module

class spinn_front_end_common.utilities.simulator_interface.SimulatorInterface[source]

Bases: object

add_socket_address(socket_address)[source]
buffer_manager
config
graph_mapper
has_ran
increment_none_labelled_vertex_count
machine
machine_time_step
no_machine_time_steps
none_labelled_vertex_count
placements
run
stop()[source]
tags
time_scale_factor
transceiver
use_virtual_board
verify_not_running()[source]

Module contents

class spinn_front_end_common.utilities.FailedState[source]

Bases: spinn_front_end_common.utilities.simulator_interface.SimulatorInterface

add_socket_address(socket_address)[source]
buffer_manager
config
graph_mapper
has_ran
increment_none_labelled_vertex_count
machine
machine_time_step
no_machine_time_steps
none_labelled_vertex_count
placements
run(run_time)[source]
stop()[source]
tags
time_scale_factor
transceiver
use_virtual_board
verify_not_running()[source]
class spinn_front_end_common.utilities.SimulatorInterface[source]

Bases: object

add_socket_address(socket_address)[source]
buffer_manager
config
graph_mapper
has_ran
increment_none_labelled_vertex_count
machine
machine_time_step
no_machine_time_steps
none_labelled_vertex_count
placements
run
stop()[source]
tags
time_scale_factor
transceiver
use_virtual_board
verify_not_running()[source]