spinn_front_end_common.utility_models package

Module contents

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

Bases: spinn_front_end_common.utility_models.abstract_one_app_one_machine_vertex.AbstractOneAppOneMachineVertex, 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 or in response to simulation events (e.g., starting and stopping).

Parameters:
  • label (str) – The label of this vertex
  • constraints (iterable(AbstractConstraint)) – Any initial constraints to this vertex
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:
  • start_resume_commands (iterable(MultiCastCommand)) – The commands to send when the simulation starts or resumes from pause
  • pause_stop_commands (iterable(MultiCastCommand)) – The commands to send when the simulation stops or pauses after running
  • timed_commands (iterable(MultiCastCommand)) – The commands to send at specific times
  • vertex_to_send_to (AbstractVertex) – The vertex these commands are to be sent to
edges_and_partitions()[source]

Construct application edges from this vertex to the app vertices that this vertex knows how to target (and has keys allocated for).

Returns:edges, partition IDs
Return type:tuple(list(ApplicationEdge), list(str))
get_outgoing_partition_constraints(partition)[source]

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

Parameters:partition (OutgoingEdgePartition) – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list(AbstractConstraint)
class spinn_front_end_common.utility_models.CommandSenderMachineVertex(label, constraints, app_vertex=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_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

Machine vertex for injecting packets at particular times or in response to particular events into a SpiNNaker application.

Parameters:
BINARY_FILE_NAME = 'command_sender_multicast_source.aplx'
class DATA_REGIONS[source]

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:
  • start_resume_commands (iterable(MultiCastCommand)) – The commands to send when the simulation starts or resumes from pause
  • pause_stop_commands (iterable(MultiCastCommand)) – the commands to send when the simulation stops or pauses after running
  • timed_commands (iterable(MultiCastCommand)) – The commands to send at specific times
  • vertex_to_send_to (AbstractVertex) – The vertex these commands are to be sent to
edges_and_partitions()[source]

Construct machine edges from this vertex to the machine vertices that this vertex knows how to target (and has keys allocated for).

Returns:edges, partition IDs
Return type:tuple(list(MachineEdge), list(str))
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
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
classmethod get_n_command_bytes(commands)[source]
Parameters:commands (list(MultiCastCommand)) –
Return type:int
get_outgoing_partition_constraints(partition)[source]

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

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

The resources required by the vertex

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

Bases: pacman.model.graphs.application.application_vertex.ApplicationVertex, 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 (iterable(AbstractConstraint)) – constraints for the vertex
  • n_samples_per_recording (int) – how many samples to take before recording to SDRAM the total
  • sampling_frequency (int) – 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 or None) – The slice of atoms that the machine vertex will cover, or None to use the default slice
  • 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 (DataSpecificationGenerator) – The data specification to write to
  • placement (Placement) – The placement the vertex is located at
  • machine_time_step (int) –
  • time_scale_factor (int) –
  • n_machine_time_steps (int) –
Return type:

None

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
  • machine_time_step (int) –
  • time_scale_factor (int) –
Returns:

a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource

Return type:

ResourceContainer

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.

static binary_file_name()[source]

Return the string binary file name

Return type:str
static binary_start_type()[source]

The type of binary that implements this vertex

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

Generate a data specification.

Parameters:
  • spec (DataSpecificationGenerator) – The data specification to write to
  • placement (Placement) – The placement the vertex is located at
  • machine_time_step (int) – machine time step
  • time_scale_factor (int) – time scale factor
  • data_n_time_steps (int) – timesteps to reserve data for
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 (Placement) – the location on machine to get data from
  • buffer_manager (BufferManager) – the buffer manager that might have data
Returns:

results, an array with 1 dimension of uint32 values

Return type:

ndarray

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 (Transceiver) – the SpiNNMan instance
  • placement (Placement) – the placement object of the core to find the address of
Returns:

the base address of the recording region

Return type:

int

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

Get the resources used by this vertex

Parameters:
  • time_step (int) –
  • time_scale_factor (int) –
  • n_samples_per_recording (int) –
  • sampling_frequency (float) –
Return type:

ResourceContainer

n_samples_per_recording

how may samples to take between making recording entries

Return type:int
resources_required

The resources required by the vertex

Return type:ResourceContainer
sampling_frequency

how often to sample, in microseconds

Return type:int
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: spinn_front_end_common.utility_models.abstract_one_app_one_machine_vertex.AbstractOneAppOneMachineVertex

The gatherer for the data speed up protocols. Gatherers are only ever deployed on chips with an ethernet connection.

Parameters:
  • x (int) – Where this gatherer is.
  • y (int) – Where this gatherer is.
  • extra_monitors_by_chip (dict(tuple(int,int), ExtraMonitorSupportMachineVertex)) – UNUSED
  • ip_address (str) – How to talk directly to the chip where the gatherer is.
  • report_default_directory (str) – Where reporting is done.
  • write_data_speed_up_reports (bool) – Whether to write low-level reports on data transfer speeds.
  • constraints (iterable(AbstractConstraint)) –
class spinn_front_end_common.utility_models.DataSpeedUpPacketGatherMachineVertex(x, y, extra_monitors_by_chip, ip_address, report_default_directory, write_data_speed_up_reports, app_vertex=None, 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

Machine vertex for handling fast data transfer between host and SpiNNaker. This machine vertex is only ever placed on chips with a working Ethernet connection; it collaborates with the ExtraMonitorSupportMachineVertex to write data on other chips..

Parameters:
  • x (int) – Where this gatherer is.
  • y (int) – Where this gatherer is.
  • extra_monitors_by_chip (dict(tuple(int,int), ExtraMonitorSupportMachineVertex)) – UNUSED
  • ip_address (str) – How to talk directly to the chip where the gatherer is.
  • report_default_directory (str) – Where reporting is done.
  • write_data_speed_up_reports (bool) – Whether to write low-level reports on data transfer speeds.
  • constraints (iterable(AbstractConstraint)) –
  • app_vertex (ApplicationVertex or None) – The application vertex that caused this machine vertex to be created. If None, there is no such application vertex.
BASE_KEY = 4294967289

base key (really nasty hack to tie in fixed route keys)

BASE_MASK = 4294967291

to use with multicast stuff (reinjection acks have to be fixed route)

END_FLAG_KEY = 4294967286
END_FLAG_KEY_OFFSET = 3
FIRST_DATA_KEY = 4294967287
FIRST_DATA_KEY_OFFSET = 2
FLAG_FOR_MISSING_ALL_SEQUENCES = 4294967294
IN_REPORT_NAME = 'speeds_gained_in_speed_up_process.rpt'

report name for tracking performance gains

NEW_SEQ_KEY = 4294967288
NEW_SEQ_KEY_OFFSET = 1
OUT_REPORT_NAME = 'routers_used_in_speed_up_process.rpt'

report name for tracking used routers

TRAFFIC_TYPE = 2
TRANSACTION_ID_KEY = 4294967285
TRANSACTION_ID_KEY_OFFSET = 4
calculate_max_seq_num()[source]

Deduce the max sequence number expected to be received

Returns:the biggest sequence num expected
Return type:int
clear_reinjection_queue(transceiver, placements)[source]

Clears the queues for reinjection.

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

Generate a data specification.

Parameters:
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(extra_monitor, extra_monitor_placement, memory_address, length_in_bytes, fixed_routes)[source]

Gets data from a given core and memory address.

Parameters:
  • extra_monitor (ExtraMonitorSupportMachineVertex) – the extra monitor used for this data
  • extra_monitor_placement (Placement) – placement object for where to get data from
  • memory_address (int) – the address in SDRAM to start reading from
  • length_in_bytes (int) – the length of data to read in bytes
  • fixed_routes (dict(tuple(int,int),FixedRouteEntry)) – the fixed routes, used in the report of which chips were used by the speed up process
Returns:

byte array of the data

Return type:

bytearray

get_local_provenance_data()[source]

Get an iterable of provenance data items.

Returns:the provenance items
Return type:iterable(ProvenanceDataItem)
static load_application_routing_tables(transceiver, extra_monitor_cores, placements)[source]

Set all chips to have application table loaded in the router.

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

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

Parameters:
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 gatherer and function to call for writing data onto SpiNNaker.

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

a write function of either a LPG or the spinnMan

Return type:

callable

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 (int) – chip x for data
  • y (int) – chip y for data
  • base_address (int) – the address in SDRAM to start writing memory
  • data (bytes or bytearray or memoryview or str) – the data to write (or filename to load data from, if is_filename is True; that’s the only time this is a str)
  • n_bytes (int) – how many bytes to read, or None if not set
  • offset (int) – where in the data to start from
  • cpu (int) –
  • is_filename (bool) – whether data is actually a file.
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:
set_router_wait1_timeout(timeout, transceiver, placements)[source]

Set the wait1 field for a set of routers.

Parameters:
set_router_wait2_timeout(timeout, transceiver, placements)[source]

Set the wait2 field for a set of routers.

Parameters:
classmethod static_resources_required()[source]
Return type:ResourceContainer
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:
Returns:

a context manager

unset_cores_for_data_streaming(transceiver, extra_monitor_cores, placements)[source]

Helper method for restoring the router timeouts to normal after being in a state usable for data streaming.

Parameters:
update_transaction_id_from_machine(txrx)[source]

Looks up from the machine what the current transaction ID is and updates the data speed up gatherer.

Parameters:txrx (Transceiver) – SpiNNMan instance
class spinn_front_end_common.utility_models.ExtraMonitorSupport(constraints)[source]

Bases: spinn_front_end_common.utility_models.abstract_one_app_one_machine_vertex.AbstractOneAppOneMachineVertex

Control over the extra monitors.

Parameters:constraints (iterable(AbstractConstraint)) – The constraints on the vertex
class spinn_front_end_common.utility_models.ExtraMonitorSupportMachineVertex(constraints, app_vertex, 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

Machine vertex for talking to extra monitor cores. Supports reinjection control and the faster data transfer protocols.

Usually deployed once per chip.

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

Clears the queues for reinjection

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

Generate a data specification.

Parameters:
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:
Returns:

the reinjection status for this vertex

Return type:

ReInjectionStatus

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:
Return type:

dict(tuple(int,int), ReInjectionStatus)

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:
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:
placement
Return type:Placement
reinject_fixed_route
Return type:bool
reinject_multicast
Return type:bool
reinject_nearest_neighbour
Return type:bool
reinject_point_to_point
Return type:bool
reset_reinjection_counters(transceiver, placements, extra_monitor_cores_to_set)[source]

Resets the counters for reinjection

Parameters:
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) – placements object
  • extra_monitor_cores_for_data (iterable(ExtraMonitorSupportMachineVertex)) – the extra monitor cores to set the packets of
  • transceiver (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.
set_router_wait1_timeout(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. This sets the timeout for the time between when a packet arrives and when it starts to be emergency routed. (Actual emergency routing is disabled by default.)

Parameters:
  • timeout (tuple(int,int)) – The mantissa and exponent of the timeout value, each between 0 and 15
  • transceiver (Transceiver) – the spinnman interface
  • placements (Placements) – vertex placements
  • extra_monitor_cores_to_set (iterable(ExtraMonitorSupportMachineVertex)) – which monitors control the routers to set the timeout of
set_router_wait2_timeout(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. This sets the timeout for the time between when a packet starts to be emergency routed and when it is dropped. (Actual emergency routing is disabled by default.)

Parameters:
  • timeout (tuple(int,int)) – The mantissa and exponent of the timeout value, each between 0 and 15
  • transceiver (Transceiver) – the spinnMan instance
  • placements (Placements) – vertex placements
  • extra_monitor_cores_to_set (iterable(ExtraMonitorSupportMachineVertex)) – which monitors control the routers to set the timeout of
static static_get_binary_file_name()[source]

The name of the binary implementing this vertex.

Return type:str
static static_get_binary_start_type()[source]

The type of the binary implementing this vertex.

Return type:ExecutableType
static static_resources_required()[source]

The resources required by this vertex.

Return type:ResourceContainer
transaction_id
update_transaction_id()[source]
update_transaction_id_from_machine(txrx)[source]

looks up from the machine what the current transaction id is and updates the extra monitor.

Parameters:txrx – SpiNNMan instance
Return type:None
class spinn_front_end_common.utility_models.LivePacketGather(lpg_params, constraints=None)[source]

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

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.

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

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice or None) – The slice of atoms that the machine vertex will cover, or None to use the default slice
  • 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:
Return type:

None

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
n_atoms

The number of atoms in the vertex

Return type:int
class spinn_front_end_common.utility_models.LivePacketGatherMachineVertex(lpg_params, constraints=None, app_vertex=None, label=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

Used to gather multicast packets coming from cores and stream them out to a receiving application on host. Only ever deployed on chips with a working Ethernet connection.

Parameters:
TRAFFIC_IDENTIFIER = 'LPG_EVENT_STREAM'

Used to identify tags involved with the live packet gatherer.

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

Generate a data specification.

Parameters:
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
classmethod get_dtcm_usage()[source]

Get the DTCM used by this vertex

Return type:int
get_provenance_data_from_machine(transceiver, placement)[source]

Get an iterable of provenance data items.

Parameters:
  • transceiver (Transceiver) – the SpinnMan interface object
  • placement (Placement) – the placement of the object
Returns:

the provenance items

Return type:

iterable(ProvenanceDataItem)

classmethod get_sdram_usage()[source]

Get the SDRAM used by this vertex

Return type:int
is_in_injection_mode

Whether this vertex is actually in injection mode.

Return type:bool
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 or None) – The payload of the command
  • time (int or None) – 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:

ConfigurationException – If the repeat or delay are out of range

delay_between_repeats
Return type:int
is_payload

Whether 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

Return type:bool
is_timed

Whether this command is a timed command.

Return type:bool
key
Return type:int
payload

The payload of the command, or None if there is no payload.

Return type:int or None
repeat
Return type:int
time

The time within the simulation at which to send the command, or None if this is not a timed command

Return type:int or None
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, enable_injection=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_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 (int) – The number of keys to be sent via this multicast source
  • label (str) – The label of this vertex
  • constraints (iterable(AbstractConstraint)) – Any initial constraints to this vertex
  • max_atoms_per_core (int) –
  • board_address (str or None) – 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 (int or None) – 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 (int) – The SDP port to listen on for incoming event packets (defaults to 1)
  • receive_tag (IPTag) – The IP tag to use for receiving live events (uses any by default)
  • receive_rate (float) – The estimated rate of packets that will be sent by this source
  • virtual_key (int) – The base multicast key to send received events with (assigned automatically by default)
  • prefix (int) – The prefix to “or” with generated multicast keys (default is no prefix)
  • prefix_type (EIEIOPrefix) – Whether the prefix should apply to the upper or lower half of the multicast keys (default is upper half)
  • check_keys (bool) – True if the keys of received events should be verified before sending (default False)
  • send_buffer_times (ndarray(ndarray(numpy.int32)) or list(ndarray(int32)) or None) – An array of arrays of times at which keys should be sent (one array for each key, default disabled)
  • send_buffer_partition_id (str or None) – The ID of the partition containing the edges down which the events are to be sent
  • reserve_reverse_ip_tag (bool) – Extra flag for input without a reserved port
  • enable_injection (bool) – Flag to indicate that data will be received to inject
create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice (Slice or None) – The slice of atoms that the machine vertex will cover, or None to use the default slice
  • 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:
Return type:

None

get_outgoing_partition_constraints(partition)[source]

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

Parameters:partition (OutgoingEdgePartition) – 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
n_atoms

The number of atoms in the vertex

Return type:int
send_buffer_times

When messages will be sent.

Return type:ndarray(ndarray(numpy.int32)) or list(ndarray(int32)) or None
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.

Parameters:
  • label (str) – The label of this vertex
  • vertex_slice (Slice or None) – The slice served via this multicast source
  • app_vertex (ReverseIpTagMultiCastSource or None) – The associated application vertex
  • n_keys (int) – The number of keys to be sent via this mulitcast source (can’t be None if vertex_slice is also None)
  • constraints (iterable(AbstractConstraint)) – Any initial constraints to this vertex
  • board_address (str) – 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 (int) – The port on the board that will listen for incoming event packets (default is to disable this feature; set a value to enable it, or set the reserve_reverse_ip_tag parameter to True if a random port is to be used)
  • receive_sdp_port (int) – The SDP port to listen on for incoming event packets (defaults to 1)
  • receive_tag (int) – The IP tag to use for receiving live events (uses any by default)
  • receive_rate (float) –
  • virtual_key (int) – The base multicast key to send received events with (assigned automatically by default)
  • prefix (int) – The prefix to “or” with generated multicast keys (default is no prefix)
  • prefix_type (EIEIOPrefix) – Whether the prefix should apply to the upper or lower half of the multicast keys (default is upper half)
  • check_keys (bool) – True if the keys of received events should be verified before sending (default False)
  • send_buffer_times (ndarray) – An array of arrays of time steps at which keys should be sent (one array for each key, default disabled)
  • send_buffer_partition_id (str) – The ID of the partition containing the edges down which the events are to be sent
  • reserve_reverse_ip_tag (bool) – True if the source should set up a tag through which it can receive packets; if port is set to None this can be used to enable the reception of packets on a randomly assigned port, which can be read from the database
  • enable_injection (bool) – Flag to indicate that data will be received to inject
enable_recording(new_state=True)[source]

Enable recording of the keys sent.

Parameters:new_state (bool) –
generate_data_specification(*args, **kwargs)[source]

Generate a data specification.

Parameters:
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 partition that comes out of this vertex.

Parameters:partition (OutgoingEdgePartition) – 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]

Retrieve the provenance data.

Parameters:
  • transceiver (Transceiver) – How to talk to the machine
  • placement (Placement) – Which vertex are we retrieving from, and where was it
Return type:

list(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 (Transceiver) – the SpiNNMan instance
  • placement (Placement) – the placement object of the core to find the address of
Returns:

the base address of the recording region

Return type:

int

get_region_buffer_size(region)[source]
Parameters:region (int) – Region ID
Returns:Size of buffer, in bytes.
Return type:int
classmethod get_sdram_usage(send_buffer_times, recording_enabled, machine_time_step, receive_rate, n_keys)[source]
Parameters:
  • send_buffer_times (ndarray(ndarray(numpy.int32)) or list(ndarray(numpy.int32)) or None) – When events will be sent
  • recording_enabled (bool) – Whether recording is done
  • machine_time_step (int) – What the machine timestep is
  • receive_rate (float) – What the expected message receive rate is
  • n_keys (int) – How many keys are being sent
Return type:

VariableSDRAM

is_in_injection_mode

Whether this vertex is actually in injection mode.

Return type:bool
is_recording()[source]

Deduce if the recorder is actually recording

Return type:bool
mask
Return type:int or None
resources_required

The resources required by the vertex

Return type:ResourceContainer
send_buffer_times

When events will be sent.

Return type:ndarray(ndarray(numpy.int32)) or list(ndarray(numpy.int32)) or None
send_buffers
Return type:dict(int,BufferedSendingRegion)
update_buffer(arg)[source]
Updates the buffers on specification of the first machine timestep.
Note: This is called by injection.
Parameters:
  • first_machine_time_step (int) – The first machine time step in the simulation
  • run_until_timesteps (int) – The last machine time step in the simulation
virtual_key
Return type:int or None