spinn_front_end_common.utility_models package

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

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

Parameters:
  • label (str) – The label of this vertex
  • constraints (iterable(AbstractConstraint)) – Any initial constraints to this vertex
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(spinn_front_end_common.utility_models.multi_cast_command.MultiCastCommand)) – The commands to send when the simulation starts or resumes from pause
  • pause_stop_commands (iterable(spinn_front_end_common.utility_models.multi_cast_command.MultiCastCommand)) – the commands to send when the simulation stops or pauses after running
  • timed_commands (iterable(spinn_front_end_common.utility_models.multi_cast_command.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]
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_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 (AbstractOutgoingEdgePartition) – 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 (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) – 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:
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.

Parameters:
  • label (str) – vertex label
  • constraints (iterable(AbstractConstraint)) – constraints on this vertex
  • n_samples_per_recording (int) – how may samples between recording entry
  • sampling_frequency (int) – how often to sample, in microseconds
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:
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:

numpy.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

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

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)) –
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:
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

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)) –
BASE_KEY = 4294967289

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

BASE_MASK = 4294967291

to use with multicast stuff

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'

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
calculate_max_seq_num()[source]

Deduce the max sequence number expected to be received

Returns:the biggest sequence num expected
Return type:int
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_graph (MachineGraph) – (injected)
  • routing_info (RoutingInfo) – (injected)
  • tags (Tags) – (injected)
  • machine_time_step (int) – (injected)
  • time_scale_factor (int) – (injected)
  • mc_data_chips_to_keys (dict(tuple(int,int), int)) – (injected)
  • machine (Machine) – (injected)
  • app_id (int) – (injected)
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) – 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: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:
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:
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 (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
  • 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:
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:
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:
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

Control over the extra monitors.

Parameters:constraints (iterable(AbstractConstraint)) – The constraints on the vertex
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:
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

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

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

None

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

None

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

Sets the timeout of the routers

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) – the placements object
  • extra_monitor_cores_to_set (iterable(ExtraMonitorSupportMachineVertex)) – which monitors control the routers to set the timeout of
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 (tuple(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 (iterable(ExtraMonitorSupportMachineVertex)) – which monitors control the routers to set the timeout of
Return type:

None

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
class spinn_front_end_common.utility_models.LivePacketGather(hostname=None, port=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:
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, 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

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
static get_dtcm_usage()[source]

Get the DTCM used by this vertex

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)

static 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) – 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 (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 (numpy.ndarray(numpy.ndarray(numpy.int32)) or list(numpy.ndarray(numpy.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
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:
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 (AbstractOutgoingEdgePartition) – 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

When messages will be sent.

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:
  • 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
  • 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 (numpy.ndarray(numpy.ndarray(numpy.int32)) or list(numpy.ndarray(numpy.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_recording(new_state=True)[source]

Enable recording of the keys sent

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

Parameters:partition (AbstractOutgoingEdgePartition) – 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 (Transceiver) – the SpinnMan interface object
  • placement (Placement) – the placement of the object
Returns:

the provenance items

Return type:

iterable(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]

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]
Parameters:
  • send_buffer_times (numpy.ndarray(numpy.ndarray(numpy.int32)) or list(numpy.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
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
resources_required

The resources required by the vertex

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