spinn_front_end_common.utility_models package

Submodules

spinn_front_end_common.utility_models.chip_power_monitor module

class spinn_front_end_common.utility_models.chip_power_monitor.ChipPowerMonitor(label, constraints, n_samples_per_recording, sampling_frequency)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification

Represents idle time recording code in a application graph.

Parameters:
  • label (str) – vertex label
  • constraints – constraints for the vertex
  • n_samples_per_recording (int) – how many samples to take before recording to SDRAM the total
  • sampling_frequency – how many microseconds between sampling
create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_resources_used_by_atoms(*args, **kwargs)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Return type:int

spinn_front_end_common.utility_models.chip_power_monitor_machine_vertex module

class spinn_front_end_common.utility_models.chip_power_monitor_machine_vertex.ChipPowerMonitorMachineVertex(*args, **kwargs)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.interface.buffer_management.buffer_models.abstract_receive_buffers_to_host.AbstractReceiveBuffersToHost

Machine vertex for C code representing functionality to record idle times in a machine graph.

class CHIP_POWER_MONITOR_REGIONS

Bases: enum.Enum

CONFIG = 1
RECORDING = 2
SYSTEM = 0
SAMPLE_RECORDING_REGION = 0
static binary_file_name()[source]

Return the string binary file name

Returns:basestring
static binary_start_type()[source]

The type of binary that implements this vertex

Returns:starttype enum
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_recorded_data(placement, buffer_manager)[source]

Get data from SDRAM given placement and buffer manager

Parameters:
  • placement – the location on machine to get data from
  • buffer_manager – the buffer manager that might have data
Returns:

results

Return type:

numpy array with 1 dimension

get_recorded_region_ids()[source]

Get the recording region IDs that have been recorded using buffering

Returns:The region numbers that have active recording
Return type:iterable(int)
get_recording_region_base_address(txrx, placement)[source]

Get the recording region base address

Parameters:
  • txrx – the SpiNNMan instance
  • placement – the placement object of the core to find the address of
Returns:

the base address of the recording region

static get_resources(time_step, time_scale_factor, n_samples_per_recording, sampling_frequency)[source]

Get the resources used by this vertex

Returns:Resource container
n_samples_per_recording
resources_required

The resources required by the vertex

Return type:ResourceContainer
sampling_frequency

spinn_front_end_common.utility_models.command_sender module

class spinn_front_end_common.utility_models.command_sender.CommandSender(label, constraints)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints

A utility for sending commands to a vertex (possibly an external device) at fixed times in the simulation

add_commands(start_resume_commands, pause_stop_commands, timed_commands, vertex_to_send_to)[source]
create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
edges_and_partitions()[source]
generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge that comes out of this vertex.

Parameters:partition – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list(AbstractConstraint)
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Return type:int

spinn_front_end_common.utility_models.command_sender_machine_vertex module

class spinn_front_end_common.utility_models.command_sender_machine_vertex.CommandSenderMachineVertex(label, constraints)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints

BINARY_FILE_NAME = 'command_sender_multicast_source.aplx'
class DATA_REGIONS

Bases: enum.Enum

COMMANDS_AT_START_RESUME = 2
COMMANDS_AT_STOP_PAUSE = 3
COMMANDS_WITH_ARBITRARY_TIMES = 1
PROVENANCE_REGION = 4
SYSTEM_REGION = 0
add_commands(start_resume_commands, pause_stop_commands, timed_commands, vertex_to_send_to)[source]

Add commands to be sent down a given edge

Parameters:
edges_and_partitions()[source]
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str

Return a string representation of the models binary

get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_edges_and_partitions(pre_vertex, edge_type)[source]
static get_n_command_bytes(commands)[source]
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge that comes out of this vertex.

Parameters:partition – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list(AbstractConstraint)
get_timed_commands_bytes()[source]
resources_required

The resources required by the vertex

Return type:ResourceContainer

spinn_front_end_common.utility_models.data_speed_up_packet_gatherer module

class spinn_front_end_common.utility_models.data_speed_up_packet_gatherer.DataSpeedUpPacketGather(x, y, ip_address, extra_monitors_by_chip, report_default_directory, write_data_speed_up_reports, constraints=None)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary

create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
machine_vertex
n_atoms

The number of atoms in the vertex

Return type:int

spinn_front_end_common.utility_models.data_speed_up_packet_gatherer_machine_vertex module

class spinn_front_end_common.utility_models.data_speed_up_packet_gatherer_machine_vertex.DATA_IN_COMMANDS

Bases: enum.Enum

RECEIVE_FINISHED = 2005
RECEIVE_FIRST_MISSING_SEQ = 2003
RECEIVE_MISSING_SEQ_DATA = 2004
SEND_DATA_TO_LOCATION = 200
SEND_DONE = 2002
SEND_SEQ_DATA = 2000
class spinn_front_end_common.utility_models.data_speed_up_packet_gatherer_machine_vertex.DATA_OUT_COMMANDS

Bases: enum.Enum

CLEAR = 2000
MISSING_SEQ = 1001
START_MISSING_SEQ = 1000
START_SENDING = 100
class spinn_front_end_common.utility_models.data_speed_up_packet_gatherer_machine_vertex.DataSpeedUpPacketGatherMachineVertex(x, y, extra_monitors_by_chip, ip_address, report_default_directory, write_data_speed_up_reports, constraints=None)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.interface.provenance.abstract_provides_local_provenance_data.AbstractProvidesLocalProvenanceData

BASE_KEY = 4294967289
BASE_MASK = 4294967291
END_FLAG_KEY = 4294967286
END_FLAG_KEY_OFFSET = 3
FIRST_DATA_KEY = 4294967287
FIRST_DATA_KEY_OFFSET = 2
IN_REPORT_NAME = 'speeds_gained_in_speed_up_process.rpt'
LAST_MESSAGE_FLAG_BIT_MASK = 2147483648
LONG_TIMEOUT = (14, 14)
MISSING_SEQ_NUMS_END_FLAG = 4294967295
NEW_SEQ_KEY = 4294967288
NEW_SEQ_KEY_OFFSET = 1
OUT_REPORT_NAME = 'routers_used_in_speed_up_process.rpt'
SEQUENCE_NUMBER_MASK = 2147483647
SHORT_TIMEOUT = (1, 1)
TEMP_TIMEOUT = (15, 4)
TIMEOUT_PER_RECEIVE_IN_SECONDS = 1
TIME_OUT_FOR_SENDING_IN_SECONDS = 0.01
TRAFFIC_TYPE = 2
TRANSMISSION_THROTTLE_TIME = 1e-06
ZERO_TIMEOUT = (0, 0)
calculate_max_seq_num()[source]

Deduce the max sequence number expected to be received

Returns:int of the biggest sequence num expected
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_data(placement, memory_address, length_in_bytes, fixed_routes)[source]

Gets data from a given core and memory address.

Parameters:
  • placement – placement object for where to get data from
  • memory_address – the address in SDRAM to start reading from
  • length_in_bytes – the length of data to read in bytes
  • fixed_routes – the fixed routes, used in the report of which chips were used by the speed up process
Returns:

byte array of the data

get_local_provenance_data()[source]

Get an iterable of provenance data items

Returns:iterable of ProvenanceDataItem
static load_application_routing_tables(transceiver, extra_monitor_cores, placements)[source]

Set all chips to have application table loaded in the router

Parameters:
  • transceiver – the SpiNNMan instance
  • extra_monitor_cores – the extra monitor cores to set
  • placements – placements object
Return type:

None

static load_system_routing_tables(transceiver, extra_monitor_cores, placements)[source]

Set all chips to have the system table loaded in the router

Parameters:
  • transceiver – the SpiNNMan instance
  • extra_monitor_cores – the extra monitor cores to set
  • placements – placements object
Return type:

None

static locate_correct_write_data_function_for_chip_location(uses_advanced_monitors, machine, x, y, transceiver, extra_monitor_cores_to_ethernet_connection_map)[source]

supports other components figuring out which gather and function to call for writing data onto spinnaker

Parameters:
  • uses_advanced_monitors (bool) – Whether the system is using advanced monitors
  • machine – the SpiNNMachine instance
  • x – the chip x coordinate to write data to
  • y – the chip y coordinate to write data to
  • extra_monitor_cores_to_ethernet_connection_map – mapping between cores and connections
  • transceiver – the SpiNNMan instance
Returns:

a write function of either a LPG or the spinnMan

Return type:

func

resources_required

The resources required by the vertex

Return type:ResourceContainer
send_data_into_spinnaker(x, y, base_address, data, n_bytes=None, offset=0, cpu=0, is_filename=False)[source]

sends a block of data into SpiNNaker to a given chip

Parameters:
  • x – chip x for data
  • y – chip y for data
  • base_address – the address in SDRAM to start writing memory
  • data – the data to write
  • n_bytes – how many bytes to read, or None if not set
  • offset – where in the data to start from
  • is_filename (bool) – whether data is actually a file.
Return type:

None

set_cores_for_data_streaming(transceiver, extra_monitor_cores, placements)[source]

Helper method for setting the router timeouts to a state usable for data streaming

Parameters:
  • transceiver – the SpiNNMan instance
  • extra_monitor_cores – the extra monitor cores to set
  • placements – placements object
Return type:

None

static static_resources_required()[source]
static streaming(gatherers, transceiver, extra_monitor_cores, placements)[source]

Helper method for setting the router timeouts to a state usable for data streaming via a Python context manager (i.e., using the ‘with’ statement).

Parameters:
  • gatherers – All the gatherers that are to be set
  • transceiver – the SpiNNMan instance
  • extra_monitor_cores – the extra monitor cores to set
  • placements – placements object
Return type:

a context manager

unset_cores_for_data_streaming(transceiver, extra_monitor_cores, placements)[source]

Helper method for setting the router timeouts to a state usable for data streaming

Parameters:
  • transceiver – the SpiNNMan instance
  • extra_monitor_cores – the extra monitor cores to set
  • placements – placements object
Return type:

None

spinn_front_end_common.utility_models.data_speed_up_packet_gatherer_machine_vertex.ceildiv(dividend, divisor)[source]

How to divide two possibly-integer numbers and round up.

spinn_front_end_common.utility_models.extra_monitor_support module

class spinn_front_end_common.utility_models.extra_monitor_support.ExtraMonitorSupport(constraints)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification

create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Return type:int

spinn_front_end_common.utility_models.extra_monitor_support_machine_vertex module

class spinn_front_end_common.utility_models.extra_monitor_support_machine_vertex.ExtraMonitorSupportMachineVertex(constraints, reinject_multicast=None, reinject_point_to_point=False, reinject_nearest_neighbour=False, reinject_fixed_route=False)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification

Parameters:
  • constraints – constraints on this vertex
  • reinject_multicast – if we reinject multicast packets; defaults to value of enable_reinjection setting in configuration file
  • reinject_point_to_point – if we reinject point-to-point packets
  • reinject_nearest_neighbour – if we reinject nearest-neighbour packets
  • reinject_fixed_route – if we reinject fixed route packets
clear_reinjection_queue(transceiver, placements, extra_monitor_cores_to_set)[source]

Clears the queues for reinjection

generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_reinjection_status(placements, transceiver)[source]

Get the reinjection status from this extra monitor vertex

Parameters:
  • transceiver – the spinnMan interface
  • placements – the placements object
Returns:

the reinjection status for this vertex

get_reinjection_status_for_vertices(placements, extra_monitor_cores_for_data, transceiver)[source]

Get the reinjection status from a set of extra monitor cores

Parameters:
  • placements – the placements object
  • extra_monitor_cores_for_data – the extra monitor cores to get status from
  • transceiver – the spinnMan interface
Return type:

None

load_application_mc_routes(placements, extra_monitor_cores_for_data, transceiver)[source]

Get the extra monitor cores to load up the application-based multicast routes (used by data in).

Parameters:
  • placements (Placements) – the placements object
  • extra_monitor_cores_for_data (iterable(ExtraMonitorSupportMachineVertex)) – the extra monitor cores to get status from
  • transceiver (Transceiver) – the spinnMan interface
Return type:

None

load_system_mc_routes(placements, extra_monitor_cores_for_data, transceiver)[source]

Get the extra monitor cores to load up the system-based multicast routes (used by data in).

Parameters:
  • placements (Placements) – the placements object
  • extra_monitor_cores_for_data (iterable(ExtraMonitorSupportMachineVertex)) – the extra monitor cores to get status from
  • transceiver (Transceiver) – the spinnMan interface
Return type:

None

placement
reinject_fixed_route
reinject_multicast
reinject_nearest_neighbour
reinject_point_to_point
reset_reinjection_counters(transceiver, placements, extra_monitor_cores_to_set)[source]

Resets the counters for reinjection

resources_required

The resources required by the vertex

Return type:ResourceContainer
set_reinjection_packets(placements, extra_monitor_cores_for_data, transceiver, point_to_point=None, multicast=None, nearest_neighbour=None, fixed_route=None)[source]
Parameters:
  • placements – placements object
  • extra_monitor_cores_for_data – the extra monitor cores to set the packets of
  • transceiver – spinnman instance
  • point_to_point (bool or None) – If point to point should be set, or None if left as before
  • multicast (bool or None) – If multicast should be set, or None if left as before
  • nearest_neighbour (bool or None) – If nearest neighbour should be set, or None if left as before
  • fixed_route (bool or None) – If fixed route should be set, or None if left as before.
Return type:

None

set_router_emergency_timeout(timeout, transceiver, placements, extra_monitor_cores_to_set)[source]

Sets the timeout of the routers

Parameters:
  • timeout ((int, int)) – The mantissa and exponent of the timeout value, each between 0 and 15
  • transceiver (Transceiver) – the spinnMan instance
  • placements (Placements) – the placements object
  • extra_monitor_cores_to_set – the set of vertices to change the local chip for.
set_router_time_outs(timeout, transceiver, placements, extra_monitor_cores_to_set)[source]

Supports setting of the router time outs for a set of chips via their extra monitor cores.

Parameters:
  • timeout ((int, int)) – The mantissa and exponent of the timeout value, each between 0 and 15
  • transceiver (Transceiver) – the spinnman interface
  • placements (Placements) – placements object
  • extra_monitor_cores_to_set – which vertices to use
Return type:

None

static static_get_binary_file_name()[source]
static static_get_binary_start_type()[source]
static static_resources_required()[source]

spinn_front_end_common.utility_models.live_packet_gather module

class spinn_front_end_common.utility_models.live_packet_gather.LivePacketGather(hostname, port, board_address=None, tag=None, strip_sdp=True, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0, constraints=None, label=None)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary

A model which stores all the events it receives during a timer tick and then compresses them into Ethernet packets and sends them out of a SpiNNaker machine.

create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Return type:int

spinn_front_end_common.utility_models.live_packet_gather_machine_vertex module

class spinn_front_end_common.utility_models.live_packet_gather_machine_vertex.LivePacketGatherMachineVertex(label, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0, hostname=None, port=None, strip_sdp=None, board_address=None, tag=None, constraints=None)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_supports_database_injection.AbstractSupportsDatabaseInjection

N_ADDITIONAL_PROVENANCE_ITEMS = 2
TRAFFIC_IDENTIFIER = 'LPG_EVENT_STREAM'
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
static get_cpu_usage()[source]

Get the CPU used by this vertex

Returns:0
Return type:int
static get_dtcm_usage()[source]

Get the DTCM used by this vertex

get_provenance_data_from_machine(transceiver, placement)[source]

Get provenance from the machine

Parameters:
  • transceiver – spinnman interface to the machine
  • placement – the location of this vertex on the machine
static get_sdram_usage()[source]

Get the SDRAM used by this vertex

is_in_injection_mode

Whether this vertex is actually in injection mode.

resources_required

The resources required by the vertex

Return type:ResourceContainer

spinn_front_end_common.utility_models.multi_cast_command module

class spinn_front_end_common.utility_models.multi_cast_command.MultiCastCommand(key, payload=None, time=None, repeat=0, delay_between_repeats=0)[source]

Bases: object

A command to be sent to a vertex.

Parameters:
  • key (int) – The key of the command
  • payload (int) – The payload of the command
  • time (int) – The time within the simulation at which to send the command, or None if this is not a timed command
  • repeat (int) – The number of times that the command should be repeated after sending it once. This could be used to ensure that the command is sent despite lost packets. Must be between 0 and 65535
  • delay_between_repeats (int) – The amount of time in microseconds to wait between sending repeats of the same command. Must be between 0 and 65535, and must be 0 if repeat is 0
Raises:

SpynnakerException – If the repeat or delay are out of range

delay_between_repeats
is_payload

Determine if this command has a payload. By default, this returns True if the payload passed in to the constructor is not None, but this can be overridden to indicate that a payload will be generated, despite None being passed to the constructor

Returns:True if there is a payload, False otherwise
Return type:bool
is_timed
key
payload

Get the payload of the command.

Returns:The payload of the command, or None if there is no payload
Return type:int
repeat
time

spinn_front_end_common.utility_models.reverse_ip_tag_multi_cast_source module

class spinn_front_end_common.utility_models.reverse_ip_tag_multi_cast_source.ReverseIpTagMultiCastSource(n_keys, label=None, constraints=None, max_atoms_per_core=9223372036854775807, board_address=None, receive_port=None, receive_sdp_port=1, receive_tag=None, receive_rate=10, virtual_key=None, prefix=None, prefix_type=None, check_keys=False, send_buffer_times=None, send_buffer_partition_id=None, reserve_reverse_ip_tag=False)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl

A model which will allow events to be injected into a SpiNNaker machine and converted into multicast packets.

Parameters:
  • n_keys – The number of keys to be sent via this multicast source
  • label – The label of this vertex
  • constraints – Any initial constraints to this vertex
  • board_address – The IP address of the board on which to place this vertex if receiving data, either buffered or live (by default, any board is chosen)
  • receive_port – The port on the board that will listen for incoming event packets (default is to disable this feature; set a value to enable it)
  • receive_sdp_port – The SDP port to listen on for incoming event packets (defaults to 1)
  • receive_tag – The IP tag to use for receiving live events (uses any by default)
  • receive_rate – The estimated rate of packets that will be sent by this source
  • virtual_key – The base multicast key to send received events with (assigned automatically by default)
  • prefix – The prefix to “or” with generated multicast keys (default is no prefix)
  • prefix_type – Whether the prefix should apply to the upper or lower half of the multicast keys (default is upper half)
  • check_keys – True if the keys of received events should be verified before sending (default False)
  • send_buffer_times – An array of arrays of times at which keys should be sent (one array for each key, default disabled)
  • send_buffer_partition_id – The ID of the partition containing the edges down which the events are to be sent
  • send_buffer_max_space – The maximum amount of space to use of the SDRAM on the machine (default is 1MB)
  • send_buffer_space_before_notify – The amount of space free in the sending buffer before the machine will ask the host for more data (default setting is optimised for most cases)
  • buffer_notification_ip_address – The IP address of the host that will send new buffers (must be specified if a send buffer is specified or if recording will be used)
  • buffer_notification_port – The port that the host that will send new buffers is listening on (must be specified if a send buffer is specified, or if recording will be used)
  • buffer_notification_tag – The IP tag to use to notify the host about space in the buffer (default is to use any tag)
create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
enable_recording(new_state=True)[source]
generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge that comes out of this vertex.

Parameters:partition – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list(AbstractConstraint)
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Return type:int
send_buffer_times

spinn_front_end_common.utility_models.reverse_ip_tag_multicast_source_machine_vertex module

class spinn_front_end_common.utility_models.reverse_ip_tag_multicast_source_machine_vertex.ReverseIPTagMulticastSourceMachineVertex(*args, **kwargs)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_supports_database_injection.AbstractSupportsDatabaseInjection, spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints, spinn_front_end_common.interface.buffer_management.buffer_models.sends_buffers_from_host_pre_buffered_impl.SendsBuffersFromHostPreBufferedImpl, spinn_front_end_common.interface.buffer_management.buffer_models.abstract_receive_buffers_to_host.AbstractReceiveBuffersToHost, spinn_front_end_common.abstract_models.abstract_recordable.AbstractRecordable

A model which allows events to be injected into SpiNNaker and converted in to multicast packets

enable_recording(new_state=True)[source]

Enable recording of the keys sent

generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
static get_cpu_usage()[source]
static get_dtcm_usage()[source]
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge that comes out of this vertex.

Parameters:partition – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list(AbstractConstraint)
get_provenance_data_from_machine(transceiver, placement)[source]

Get an iterable of provenance data items

Parameters:
  • transceiver – the SpinnMan interface object
  • placement – the placement of the object
Returns:

iterable of ProvenanceDataItem

get_recorded_region_ids()[source]

Get the recording region IDs that have been recorded using buffering

Returns:The region numbers that have active recording
Return type:iterable(int)
get_recording_region_base_address(txrx, placement)[source]

Get the recording region base address

Parameters:
  • txrx – the SpiNNMan instance
  • placement – the placement object of the core to find the address of
Returns:

the base address of the recording region

get_region_buffer_size(region)[source]

Get the size of the buffer to be used in SDRAM on the machine for the region in bytes

Parameters:region (int) – The region to get the buffer size of
Returns:The size of the buffer space in bytes
Return type:int
static get_sdram_usage(send_buffer_times, recording_enabled, machine_time_step, receive_rate, n_keys)[source]
is_in_injection_mode

Whether this vertex is actually in injection mode.

is_recording()[source]

Deduce if the recorder is actually recording

mask
static max_send_buffer_keys_per_timestep(send_buffer_times, n_keys)[source]
static n_regions_to_allocate(send_buffering, recording)[source]

Get the number of regions that will be allocated

static recording_sdram_per_timestep(machine_time_step, is_recording, receive_rate, send_buffer_times, n_keys)[source]
resources_required

The resources required by the vertex

Return type:ResourceContainer
static send_buffer_sdram_per_timestep(send_buffer_times, n_keys)[source]
send_buffer_times
send_buffers
update_buffer(arg)[source]
virtual_key

Module contents

class spinn_front_end_common.utility_models.CommandSender(label, constraints)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints

A utility for sending commands to a vertex (possibly an external device) at fixed times in the simulation

add_commands(start_resume_commands, pause_stop_commands, timed_commands, vertex_to_send_to)[source]
create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
edges_and_partitions()[source]
generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge that comes out of this vertex.

Parameters:partition – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list(AbstractConstraint)
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Return type:int
class spinn_front_end_common.utility_models.CommandSenderMachineVertex(label, constraints)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints

BINARY_FILE_NAME = 'command_sender_multicast_source.aplx'
class DATA_REGIONS

Bases: enum.Enum

COMMANDS_AT_START_RESUME = 2
COMMANDS_AT_STOP_PAUSE = 3
COMMANDS_WITH_ARBITRARY_TIMES = 1
PROVENANCE_REGION = 4
SYSTEM_REGION = 0
add_commands(start_resume_commands, pause_stop_commands, timed_commands, vertex_to_send_to)[source]

Add commands to be sent down a given edge

Parameters:
edges_and_partitions()[source]
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str

Return a string representation of the models binary

get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_edges_and_partitions(pre_vertex, edge_type)[source]
static get_n_command_bytes(commands)[source]
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge that comes out of this vertex.

Parameters:partition – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list(AbstractConstraint)
get_timed_commands_bytes()[source]
resources_required

The resources required by the vertex

Return type:ResourceContainer
class spinn_front_end_common.utility_models.ChipPowerMonitor(label, constraints, n_samples_per_recording, sampling_frequency)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification

Represents idle time recording code in a application graph.

Parameters:
  • label (str) – vertex label
  • constraints – constraints for the vertex
  • n_samples_per_recording (int) – how many samples to take before recording to SDRAM the total
  • sampling_frequency – how many microseconds between sampling
create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_resources_used_by_atoms(*args, **kwargs)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Return type:int
class spinn_front_end_common.utility_models.ChipPowerMonitorMachineVertex(*args, **kwargs)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.interface.buffer_management.buffer_models.abstract_receive_buffers_to_host.AbstractReceiveBuffersToHost

Machine vertex for C code representing functionality to record idle times in a machine graph.

class CHIP_POWER_MONITOR_REGIONS

Bases: enum.Enum

CONFIG = 1
RECORDING = 2
SYSTEM = 0
SAMPLE_RECORDING_REGION = 0
static binary_file_name()[source]

Return the string binary file name

Returns:basestring
static binary_start_type()[source]

The type of binary that implements this vertex

Returns:starttype enum
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_recorded_data(placement, buffer_manager)[source]

Get data from SDRAM given placement and buffer manager

Parameters:
  • placement – the location on machine to get data from
  • buffer_manager – the buffer manager that might have data
Returns:

results

Return type:

numpy array with 1 dimension

get_recorded_region_ids()[source]

Get the recording region IDs that have been recorded using buffering

Returns:The region numbers that have active recording
Return type:iterable(int)
get_recording_region_base_address(txrx, placement)[source]

Get the recording region base address

Parameters:
  • txrx – the SpiNNMan instance
  • placement – the placement object of the core to find the address of
Returns:

the base address of the recording region

static get_resources(time_step, time_scale_factor, n_samples_per_recording, sampling_frequency)[source]

Get the resources used by this vertex

Returns:Resource container
n_samples_per_recording
resources_required

The resources required by the vertex

Return type:ResourceContainer
sampling_frequency
class spinn_front_end_common.utility_models.DataSpeedUpPacketGather(x, y, ip_address, extra_monitors_by_chip, report_default_directory, write_data_speed_up_reports, constraints=None)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary

create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
machine_vertex
n_atoms

The number of atoms in the vertex

Return type:int
class spinn_front_end_common.utility_models.DataSpeedUpPacketGatherMachineVertex(x, y, extra_monitors_by_chip, ip_address, report_default_directory, write_data_speed_up_reports, constraints=None)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.interface.provenance.abstract_provides_local_provenance_data.AbstractProvidesLocalProvenanceData

BASE_KEY = 4294967289
BASE_MASK = 4294967291
END_FLAG_KEY = 4294967286
END_FLAG_KEY_OFFSET = 3
FIRST_DATA_KEY = 4294967287
FIRST_DATA_KEY_OFFSET = 2
IN_REPORT_NAME = 'speeds_gained_in_speed_up_process.rpt'
LAST_MESSAGE_FLAG_BIT_MASK = 2147483648
LONG_TIMEOUT = (14, 14)
MISSING_SEQ_NUMS_END_FLAG = 4294967295
NEW_SEQ_KEY = 4294967288
NEW_SEQ_KEY_OFFSET = 1
OUT_REPORT_NAME = 'routers_used_in_speed_up_process.rpt'
SEQUENCE_NUMBER_MASK = 2147483647
SHORT_TIMEOUT = (1, 1)
TEMP_TIMEOUT = (15, 4)
TIMEOUT_PER_RECEIVE_IN_SECONDS = 1
TIME_OUT_FOR_SENDING_IN_SECONDS = 0.01
TRAFFIC_TYPE = 2
TRANSMISSION_THROTTLE_TIME = 1e-06
ZERO_TIMEOUT = (0, 0)
calculate_max_seq_num()[source]

Deduce the max sequence number expected to be received

Returns:int of the biggest sequence num expected
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_data(placement, memory_address, length_in_bytes, fixed_routes)[source]

Gets data from a given core and memory address.

Parameters:
  • placement – placement object for where to get data from
  • memory_address – the address in SDRAM to start reading from
  • length_in_bytes – the length of data to read in bytes
  • fixed_routes – the fixed routes, used in the report of which chips were used by the speed up process
Returns:

byte array of the data

get_local_provenance_data()[source]

Get an iterable of provenance data items

Returns:iterable of ProvenanceDataItem
static load_application_routing_tables(transceiver, extra_monitor_cores, placements)[source]

Set all chips to have application table loaded in the router

Parameters:
  • transceiver – the SpiNNMan instance
  • extra_monitor_cores – the extra monitor cores to set
  • placements – placements object
Return type:

None

static load_system_routing_tables(transceiver, extra_monitor_cores, placements)[source]

Set all chips to have the system table loaded in the router

Parameters:
  • transceiver – the SpiNNMan instance
  • extra_monitor_cores – the extra monitor cores to set
  • placements – placements object
Return type:

None

static locate_correct_write_data_function_for_chip_location(uses_advanced_monitors, machine, x, y, transceiver, extra_monitor_cores_to_ethernet_connection_map)[source]

supports other components figuring out which gather and function to call for writing data onto spinnaker

Parameters:
  • uses_advanced_monitors (bool) – Whether the system is using advanced monitors
  • machine – the SpiNNMachine instance
  • x – the chip x coordinate to write data to
  • y – the chip y coordinate to write data to
  • extra_monitor_cores_to_ethernet_connection_map – mapping between cores and connections
  • transceiver – the SpiNNMan instance
Returns:

a write function of either a LPG or the spinnMan

Return type:

func

resources_required

The resources required by the vertex

Return type:ResourceContainer
send_data_into_spinnaker(x, y, base_address, data, n_bytes=None, offset=0, cpu=0, is_filename=False)[source]

sends a block of data into SpiNNaker to a given chip

Parameters:
  • x – chip x for data
  • y – chip y for data
  • base_address – the address in SDRAM to start writing memory
  • data – the data to write
  • n_bytes – how many bytes to read, or None if not set
  • offset – where in the data to start from
  • is_filename (bool) – whether data is actually a file.
Return type:

None

set_cores_for_data_streaming(transceiver, extra_monitor_cores, placements)[source]

Helper method for setting the router timeouts to a state usable for data streaming

Parameters:
  • transceiver – the SpiNNMan instance
  • extra_monitor_cores – the extra monitor cores to set
  • placements – placements object
Return type:

None

static static_resources_required()[source]
static streaming(gatherers, transceiver, extra_monitor_cores, placements)[source]

Helper method for setting the router timeouts to a state usable for data streaming via a Python context manager (i.e., using the ‘with’ statement).

Parameters:
  • gatherers – All the gatherers that are to be set
  • transceiver – the SpiNNMan instance
  • extra_monitor_cores – the extra monitor cores to set
  • placements – placements object
Return type:

a context manager

unset_cores_for_data_streaming(transceiver, extra_monitor_cores, placements)[source]

Helper method for setting the router timeouts to a state usable for data streaming

Parameters:
  • transceiver – the SpiNNMan instance
  • extra_monitor_cores – the extra monitor cores to set
  • placements – placements object
Return type:

None

class spinn_front_end_common.utility_models.ExtraMonitorSupport(constraints)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification

create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Return type:int
class spinn_front_end_common.utility_models.ExtraMonitorSupportMachineVertex(constraints, reinject_multicast=None, reinject_point_to_point=False, reinject_nearest_neighbour=False, reinject_fixed_route=False)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification

Parameters:
  • constraints – constraints on this vertex
  • reinject_multicast – if we reinject multicast packets; defaults to value of enable_reinjection setting in configuration file
  • reinject_point_to_point – if we reinject point-to-point packets
  • reinject_nearest_neighbour – if we reinject nearest-neighbour packets
  • reinject_fixed_route – if we reinject fixed route packets
clear_reinjection_queue(transceiver, placements, extra_monitor_cores_to_set)[source]

Clears the queues for reinjection

generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_reinjection_status(placements, transceiver)[source]

Get the reinjection status from this extra monitor vertex

Parameters:
  • transceiver – the spinnMan interface
  • placements – the placements object
Returns:

the reinjection status for this vertex

get_reinjection_status_for_vertices(placements, extra_monitor_cores_for_data, transceiver)[source]

Get the reinjection status from a set of extra monitor cores

Parameters:
  • placements – the placements object
  • extra_monitor_cores_for_data – the extra monitor cores to get status from
  • transceiver – the spinnMan interface
Return type:

None

load_application_mc_routes(placements, extra_monitor_cores_for_data, transceiver)[source]

Get the extra monitor cores to load up the application-based multicast routes (used by data in).

Parameters:
  • placements (Placements) – the placements object
  • extra_monitor_cores_for_data (iterable(ExtraMonitorSupportMachineVertex)) – the extra monitor cores to get status from
  • transceiver (Transceiver) – the spinnMan interface
Return type:

None

load_system_mc_routes(placements, extra_monitor_cores_for_data, transceiver)[source]

Get the extra monitor cores to load up the system-based multicast routes (used by data in).

Parameters:
  • placements (Placements) – the placements object
  • extra_monitor_cores_for_data (iterable(ExtraMonitorSupportMachineVertex)) – the extra monitor cores to get status from
  • transceiver (Transceiver) – the spinnMan interface
Return type:

None

placement
reinject_fixed_route
reinject_multicast
reinject_nearest_neighbour
reinject_point_to_point
reset_reinjection_counters(transceiver, placements, extra_monitor_cores_to_set)[source]

Resets the counters for reinjection

resources_required

The resources required by the vertex

Return type:ResourceContainer
set_reinjection_packets(placements, extra_monitor_cores_for_data, transceiver, point_to_point=None, multicast=None, nearest_neighbour=None, fixed_route=None)[source]
Parameters:
  • placements – placements object
  • extra_monitor_cores_for_data – the extra monitor cores to set the packets of
  • transceiver – spinnman instance
  • point_to_point (bool or None) – If point to point should be set, or None if left as before
  • multicast (bool or None) – If multicast should be set, or None if left as before
  • nearest_neighbour (bool or None) – If nearest neighbour should be set, or None if left as before
  • fixed_route (bool or None) – If fixed route should be set, or None if left as before.
Return type:

None

set_router_emergency_timeout(timeout, transceiver, placements, extra_monitor_cores_to_set)[source]

Sets the timeout of the routers

Parameters:
  • timeout ((int, int)) – The mantissa and exponent of the timeout value, each between 0 and 15
  • transceiver (Transceiver) – the spinnMan instance
  • placements (Placements) – the placements object
  • extra_monitor_cores_to_set – the set of vertices to change the local chip for.
set_router_time_outs(timeout, transceiver, placements, extra_monitor_cores_to_set)[source]

Supports setting of the router time outs for a set of chips via their extra monitor cores.

Parameters:
  • timeout ((int, int)) – The mantissa and exponent of the timeout value, each between 0 and 15
  • transceiver (Transceiver) – the spinnman interface
  • placements (Placements) – placements object
  • extra_monitor_cores_to_set – which vertices to use
Return type:

None

static static_get_binary_file_name()[source]
static static_get_binary_start_type()[source]
static static_resources_required()[source]
class spinn_front_end_common.utility_models.LivePacketGather(hostname, port, board_address=None, tag=None, strip_sdp=True, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0, constraints=None, label=None)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary

A model which stores all the events it receives during a timer tick and then compresses them into Ethernet packets and sends them out of a SpiNNaker machine.

create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Return type:int
class spinn_front_end_common.utility_models.LivePacketGatherMachineVertex(label, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0, hostname=None, port=None, strip_sdp=None, board_address=None, tag=None, constraints=None)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_supports_database_injection.AbstractSupportsDatabaseInjection

N_ADDITIONAL_PROVENANCE_ITEMS = 2
TRAFFIC_IDENTIFIER = 'LPG_EVENT_STREAM'
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
static get_cpu_usage()[source]

Get the CPU used by this vertex

Returns:0
Return type:int
static get_dtcm_usage()[source]

Get the DTCM used by this vertex

get_provenance_data_from_machine(transceiver, placement)[source]

Get provenance from the machine

Parameters:
  • transceiver – spinnman interface to the machine
  • placement – the location of this vertex on the machine
static get_sdram_usage()[source]

Get the SDRAM used by this vertex

is_in_injection_mode

Whether this vertex is actually in injection mode.

resources_required

The resources required by the vertex

Return type:ResourceContainer
class spinn_front_end_common.utility_models.MultiCastCommand(key, payload=None, time=None, repeat=0, delay_between_repeats=0)[source]

Bases: object

A command to be sent to a vertex.

Parameters:
  • key (int) – The key of the command
  • payload (int) – The payload of the command
  • time (int) – The time within the simulation at which to send the command, or None if this is not a timed command
  • repeat (int) – The number of times that the command should be repeated after sending it once. This could be used to ensure that the command is sent despite lost packets. Must be between 0 and 65535
  • delay_between_repeats (int) – The amount of time in microseconds to wait between sending repeats of the same command. Must be between 0 and 65535, and must be 0 if repeat is 0
Raises:

SpynnakerException – If the repeat or delay are out of range

delay_between_repeats
is_payload

Determine if this command has a payload. By default, this returns True if the payload passed in to the constructor is not None, but this can be overridden to indicate that a payload will be generated, despite None being passed to the constructor

Returns:True if there is a payload, False otherwise
Return type:bool
is_timed
key
payload

Get the payload of the command.

Returns:The payload of the command, or None if there is no payload
Return type:int
repeat
time
class spinn_front_end_common.utility_models.ReverseIpTagMultiCastSource(n_keys, label=None, constraints=None, max_atoms_per_core=9223372036854775807, board_address=None, receive_port=None, receive_sdp_port=1, receive_tag=None, receive_rate=10, virtual_key=None, prefix=None, prefix_type=None, check_keys=False, send_buffer_times=None, send_buffer_partition_id=None, reserve_reverse_ip_tag=False)[source]

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl

A model which will allow events to be injected into a SpiNNaker machine and converted into multicast packets.

Parameters:
  • n_keys – The number of keys to be sent via this multicast source
  • label – The label of this vertex
  • constraints – Any initial constraints to this vertex
  • board_address – The IP address of the board on which to place this vertex if receiving data, either buffered or live (by default, any board is chosen)
  • receive_port – The port on the board that will listen for incoming event packets (default is to disable this feature; set a value to enable it)
  • receive_sdp_port – The SDP port to listen on for incoming event packets (defaults to 1)
  • receive_tag – The IP tag to use for receiving live events (uses any by default)
  • receive_rate – The estimated rate of packets that will be sent by this source
  • virtual_key – The base multicast key to send received events with (assigned automatically by default)
  • prefix – The prefix to “or” with generated multicast keys (default is no prefix)
  • prefix_type – Whether the prefix should apply to the upper or lower half of the multicast keys (default is upper half)
  • check_keys – True if the keys of received events should be verified before sending (default False)
  • send_buffer_times – An array of arrays of times at which keys should be sent (one array for each key, default disabled)
  • send_buffer_partition_id – The ID of the partition containing the edges down which the events are to be sent
  • send_buffer_max_space – The maximum amount of space to use of the SDRAM on the machine (default is 1MB)
  • send_buffer_space_before_notify – The amount of space free in the sending buffer before the machine will ask the host for more data (default setting is optimised for most cases)
  • buffer_notification_ip_address – The IP address of the host that will send new buffers (must be specified if a send buffer is specified or if recording will be used)
  • buffer_notification_port – The port that the host that will send new buffers is listening on (must be specified if a send buffer is specified, or if recording will be used)
  • buffer_notification_tag – The IP tag to use to notify the host about space in the buffer (default is to use any tag)
create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
  • resources_required (ResourceContainer) – the resources used by the machine vertex
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
enable_recording(new_state=True)[source]
generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge that comes out of this vertex.

Parameters:partition – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list(AbstractConstraint)
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Return type:int
send_buffer_times
class spinn_front_end_common.utility_models.ReverseIPTagMulticastSourceMachineVertex(*args, **kwargs)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_supports_database_injection.AbstractSupportsDatabaseInjection, spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints, spinn_front_end_common.interface.buffer_management.buffer_models.sends_buffers_from_host_pre_buffered_impl.SendsBuffersFromHostPreBufferedImpl, spinn_front_end_common.interface.buffer_management.buffer_models.abstract_receive_buffers_to_host.AbstractReceiveBuffersToHost, spinn_front_end_common.abstract_models.abstract_recordable.AbstractRecordable

A model which allows events to be injected into SpiNNaker and converted in to multicast packets

enable_recording(new_state=True)[source]

Enable recording of the keys sent

generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
  • spec (Placement) – The data specification to write to
  • placement – the placement object this spec is associated with
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
static get_cpu_usage()[source]
static get_dtcm_usage()[source]
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge that comes out of this vertex.

Parameters:partition – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list(AbstractConstraint)
get_provenance_data_from_machine(transceiver, placement)[source]

Get an iterable of provenance data items

Parameters:
  • transceiver – the SpinnMan interface object
  • placement – the placement of the object
Returns:

iterable of ProvenanceDataItem

get_recorded_region_ids()[source]

Get the recording region IDs that have been recorded using buffering

Returns:The region numbers that have active recording
Return type:iterable(int)
get_recording_region_base_address(txrx, placement)[source]

Get the recording region base address

Parameters:
  • txrx – the SpiNNMan instance
  • placement – the placement object of the core to find the address of
Returns:

the base address of the recording region

get_region_buffer_size(region)[source]

Get the size of the buffer to be used in SDRAM on the machine for the region in bytes

Parameters:region (int) – The region to get the buffer size of
Returns:The size of the buffer space in bytes
Return type:int
static get_sdram_usage(send_buffer_times, recording_enabled, machine_time_step, receive_rate, n_keys)[source]
is_in_injection_mode

Whether this vertex is actually in injection mode.

is_recording()[source]

Deduce if the recorder is actually recording

mask
static max_send_buffer_keys_per_timestep(send_buffer_times, n_keys)[source]
static n_regions_to_allocate(send_buffering, recording)[source]

Get the number of regions that will be allocated

static recording_sdram_per_timestep(machine_time_step, is_recording, receive_rate, send_buffer_times, n_keys)[source]
resources_required

The resources required by the vertex

Return type:ResourceContainer
static send_buffer_sdram_per_timestep(send_buffer_times, n_keys)[source]
send_buffer_times
send_buffers
update_buffer(arg)[source]
virtual_key