spinn_front_end_common.utility_models package

Submodules

spinn_front_end_common.utility_models.lpg_splitter module

class spinn_front_end_common.utility_models.lpg_splitter.LPGSplitter[source]

Bases: AbstractSplitterCommon

Splitter for the LivePacketGather vertex.

create_machine_vertices(chip_counter)[source]

Method for specific splitter objects to override.

Parameters:

chip_counter (ChipCounter) – counter of used chips

create_vertices(system_placements)[source]

Special way of making LPG machine vertices, where one is placed on each Ethernet-enabled chip.

Note

This adds to system placements.

get_in_coming_slices()[source]

The slices of the input vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_in_coming_vertices(partition_id)[source]

Get machine post-vertices for a given partition.

The input vertices are the ones that will serve as target vertices for external edges.

Note

This method returns all that could be used for any source machine vertex in the given partition.

Parameters:

partition_id (str) – The identifier of the incoming partition

Return type:

list(MachineVertex)

get_out_going_slices()[source]

The slices of the output vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_out_going_vertices(partition_id)[source]

Get machine pre-vertices.

The output vertices are the ones that will serve as source vertices for external edges.

Parameters:

partition_id (str) – The identifier of the outgoing partition

Return type:

list(MachineVertex)

get_source_specific_in_coming_vertices(source_vertex, partition_id)[source]

Get machine post-vertices for a given source.

The input vertices are the ones that will serve as target vertices for external edges.

Note

This method allows filtering of the targets for a specific source machine vertex.

This default method makes every machine vertex a target for the source. This should be overridden if there are specific machine vertices for any given source vertex.

Parameters:
  • source_vertex (ApplicationVertex) – The source to get incoming vertices for

  • partition_id (str) – The identifier of the incoming partition

Returns:

A list of tuples of (target machine vertex, list of source machine or application vertices that should hit the target)

Return type:

list(tuple(MachineVertex, list(MachineVertex or ApplicationVertex)))

machine_vertices_for_recording(variable_to_record)[source]

Gets the machine vertices which are recording this variable.

Parameters:

variable_to_record (str) – the variable to get machine vertices for.

Returns:

list of machine vertices

Return type:

iterable(MachineVertex)

reset_called()[source]

Reset the splitter to be as if it has not operated a splitting yet.

property targeted_lpgs

Which LPG machine vertex is targeted by which machine vertex and partition.

Returns:

A set of (LPG machine vertex, source machine vertex, partition_id)

Return type:

set(tuple(LivePacketGatherMachineVertex, MachineVertex, str))

Module contents

class spinn_front_end_common.utility_models.ChipPowerMonitorMachineVertex(label, sampling_frequency)[source]

Bases: MachineVertex, AbstractHasAssociatedBinary, AbstractGeneratesDataSpecification, AbstractReceiveBuffersToHost

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

Note

This is an unusual machine vertex, in that it has no associated application vertex.

Parameters:
  • label (str) – vertex label

  • sampling_frequency (int) – how often to sample, in microseconds

static binary_file_name()[source]

Get the filename of the binary.

Return type:

str

static binary_start_type()[source]

The type of binary that implements this vertex.

Returns:

start-type

Return type:

ExecutableType

generate_data_specification(spec, placement)[source]

Generate a data specification.

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

Get data from SDRAM given placement and buffer manager. Also arranges for provenance data to be available.

Parameters:

placement (Placement) – the location on machine to get data from

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

Get the recording region base address.

Parameters:

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

Get the resources used by this vertex.

Parameters:

sampling_frequency (float) –

Return type:

VariableSDRAM

property sampling_frequency

How often to sample, in microseconds.

Return type:

int

property sdram_required

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

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

Bases: AbstractOneAppOneMachineVertex

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

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

Get a fixed key and mask for the application vertex or None if not fixed (the default). See get_machine_gixed_key_and_mask() for the conditions.

Parameters:

partition_id (str) – The identifier of the partition to get the key for

Return type:

BaseKeyAndMask or None

class spinn_front_end_common.utility_models.CommandSenderMachineVertex(label, app_vertex=None)[source]

Bases: MachineVertex, ProvidesProvenanceDataFromMachineImpl, AbstractHasAssociatedBinary, AbstractGeneratesDataSpecification

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

Bases: IntEnum

An enumeration.

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(spec, placement)[source]

Generate a data specification.

Parameters:
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, vertex_type, edge_type)[source]

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

Note

Do not call this directly from outside either a CommandSender or a CommandSenderMachineVertex.

Parameters:
Returns:

edges, partition IDs

Return type:

tuple(list(AbstractEdge), list(str))

get_fixed_key_and_mask(partition_id)[source]

Get the key and mask for the given partition.

Parameters:

partition_id (str) – The partition to get the key for

Return type:

BaseKeyAndMask

classmethod get_n_command_bytes(commands)[source]
Parameters:

commands (list(MultiCastCommand)) –

Return type:

int

get_timed_commands_bytes()[source]
Return type:

int

parse_extra_provenance_items(label, x, y, p, provenance_data)[source]

Convert the remaining provenance words (those not in the standard set) into provenance items.

Called by get_provenance_data_from_machine()

Parameters:
  • label (str) – A descriptive label for the vertex (derived from label and placed position) to be used for provenance error reporting to the user.

  • x (int) – x coordinate of the chip where this core

  • y (int) – y coordinate of the core where this core

  • p (int) – virtual id of the core

  • provenance_data (list(int)) – The list of words of raw provenance data.

property sdram_required

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

class spinn_front_end_common.utility_models.DataSpeedUpPacketGatherMachineVertex(x, y, ip_address)[source]

Bases: MachineVertex, AbstractGeneratesDataSpecification, AbstractHasAssociatedBinary, AbstractProvidesProvenanceDataFromMachine

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.

Note

This is an unusual machine vertex, in that it has no associated application vertex.

Parameters:
  • x (int) – Where this gatherer is.

  • y (int) – Where this gatherer is.

  • ip_address (str) – How to talk directly to the chip where the gatherer is.

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

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 number expected

Return type:

int

clear_reinjection_queue()[source]

Clears the queues for reinjection.

Parameters:

placements (Placements) – the placements object

generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
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, placement, memory_address, length_in_bytes)[source]

Gets data from a given core and memory address.

Parameters:
  • extra_monitor (ExtraMonitorSupportMachineVertex) – the extra monitor used for this data

  • 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

Returns:

byte array of the data

Return type:

bytearray

get_provenance_data_from_machine(placement)[source]

Get an iterable of provenance data items.

Parameters:

placement (Placement) – the placement of the object

Return type:

iterable

property iptags

The IPTags used by this vertex, if any.

Return type:

iterable(IPtagResource)

static load_application_routing_tables()[source]

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

static load_system_routing_tables()[source]

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

static locate_correct_write_data_function_for_chip_location(uses_advanced_monitors, 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

  • 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

property sdram_required

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

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

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

set_router_wait1_timeout(timeout)[source]

Set the wait1 field for a set of routers.

Parameters:
set_router_wait2_timeout(timeout)[source]

Set the wait2 field for a set of routers.

Parameters:

timeout (tuple(int,int)) –

unset_cores_for_data_streaming()[source]

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

update_transaction_id_from_machine()[source]

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

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

Bases: MachineVertex, AbstractHasAssociatedBinary, AbstractGeneratesDataSpecification, AbstractProvidesProvenanceDataFromMachine

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

Usually deployed once per chip.

Note

This is an unusual machine vertex, in that it has no associated application vertex.

Parameters:
  • 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(extra_monitor_cores_to_set)[source]

Clears the queues for reinjection.

Parameters:

extra_monitor_cores_to_set (iterable(ExtraMonitorSupportMachineVertex)) – Which extra monitors need to clear their queues.

generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
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_provenance_data_from_machine(placement)[source]

Get an iterable of provenance data items.

Parameters:

placement (Placement) – the placement of the object

Return type:

iterable

get_reinjection_status()[source]

Get the reinjection status from this extra monitor vertex.

Returns:

the reinjection status for this vertex

Return type:

ReInjectionStatus

get_reinjection_status_for_vertices()[source]

Get the reinjection status from a set of extra monitor cores.

Return type:

dict(tuple(int,int), ReInjectionStatus)

load_application_mc_routes()[source]

Get the extra monitor cores to load up the application-based multicast routes (used by the Data In protocol).

load_system_mc_routes()[source]

Get the extra monitor cores to load up the system-based multicast routes (used by the Data In protocol).

Parameters:

transceiver (Transceiver) – the spinnMan interface

property placement
Return type:

Placement

property reinject_fixed_route
Return type:

bool

property reinject_multicast
Return type:

bool

property reinject_nearest_neighbour
Return type:

bool

property reinject_point_to_point
Return type:

bool

reset_reinjection_counters(extra_monitor_cores_to_set)[source]

Resets the counters for reinjection.

Parameters:
property sdram_required

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

set_reinjection_packets(point_to_point=None, multicast=None, nearest_neighbour=None, fixed_route=None)[source]
Parameters:
  • 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, 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

  • extra_monitor_cores_to_set (iterable(ExtraMonitorSupportMachineVertex)) – which monitors control the routers to set the timeout of

set_router_wait2_timeout(timeout, 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

  • 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

property transaction_id
update_transaction_id()[source]
update_transaction_id_from_machine()[source]

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

class spinn_front_end_common.utility_models.LivePacketGather(params, label=None)[source]

Bases: ApplicationVertex

A vertex that gathers and forwards multicast packets to the host.

Parameters:
property n_atoms

The number of atoms in the vertex.

Return type:

int

property params
class spinn_front_end_common.utility_models.LivePacketGatherMachineVertex(lpg_params, app_vertex=None, label=None)[source]

Bases: MachineVertex, ProvidesProvenanceDataFromMachineImpl, AbstractGeneratesDataSpecification, AbstractHasAssociatedBinary

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:
KEY_ENTRY_SIZE = 12
TRAFFIC_IDENTIFIER = 'LPG_EVENT_STREAM'

Used to identify tags involved with the live packet gatherer.

add_incoming_source(m_vertex, partition_id)[source]

Add a machine vertex source incoming into this gatherer.

Parameters:
  • m_vertex (MachineVertex) – The source machine vertex

  • partition_id (str) – The incoming partition id

generate_data_specification(spec, placement)[source]

Generate a data specification.

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

Get the SDRAM used by this vertex.

Return type:

int

property iptags

The IPTags used by this vertex, if any.

Return type:

iterable(IPtagResource)

property params
parse_extra_provenance_items(label, x, y, p, provenance_data)[source]

Convert the remaining provenance words (those not in the standard set) into provenance items.

Called by get_provenance_data_from_machine()

Parameters:
  • label (str) – A descriptive label for the vertex (derived from label and placed position) to be used for provenance error reporting to the user.

  • x (int) – x coordinate of the chip where this core

  • y (int) – y coordinate of the core where this core

  • p (int) – virtual id of the core

  • provenance_data (list(int)) – The list of words of raw provenance data.

property sdram_required

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

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

property delay_between_repeats
Return type:

int

property 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

property is_timed

Whether this command is a timed command.

Return type:

bool

property key
Return type:

int

property payload

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

Return type:

int or None

property repeat
Return type:

int

property 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.ReverseIPTagMulticastSourceMachineVertex(label, vertex_slice=None, app_vertex=None, n_keys=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, injection_partition_id=None)[source]

Bases: MachineVertex, AbstractGeneratesDataSpecification, AbstractHasAssociatedBinary, AbstractSupportsDatabaseInjection, ProvidesProvenanceDataFromMachineImpl, SendsBuffersFromHostPreBufferedImpl, AbstractReceiveBuffersToHost

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

Parameters:
  • label (str or None) – The label of this vertex

  • vertex_slice (Slice or None) – The slice served via this multicast source

  • app_vertex (ApplicationVertex or None) – The associated application vertex

  • n_keys (int) – The number of keys to be sent via this multicast source (can’t be None if vertex_slice is also None)

  • 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

  • injection_partition (str) – If not None, will enable injection and specify the partition to send injected keys with

  • label – The optional name of the vertex

  • app_vertex – The application vertex that caused this machine vertex to be created. If None, there is no such application vertex.

  • vertex_slice – The slice of the application vertex that this machine vertex implements.

Raises:
buffering_input()[source]

Return True if the input of this vertex is to be buffered.

Return type:

bool

static calculate_mask(n_neurons)[source]
Parameters:

n_neurons (int) –

Return type:

int

enable_recording(new_state=True)[source]

Enable recording of the keys sent.

Parameters:

new_state (bool) –

generate_data_specification(spec, placement)[source]

Generate a data specification.

Parameters:
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_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(placement)[source]

Get the recording region base address.

Parameters:

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

get_regions()[source]

Get the set of regions for which there are keys to be sent.

Returns:

Iterable of region IDs

Return type:

iterable(int)

classmethod get_sdram_usage(send_buffer_times, recording_enabled, 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

  • receive_rate (float) – What the expected message receive rate is

  • n_keys (int) – How many keys are being sent

Return type:

VariableSDRAM

get_virtual_key()[source]

Updates and returns the virtual key. None is give a zero value

Return type:

int or None

property injection_partition_id

The partition that packets are being injected with.

Return type:

str

property is_in_injection_mode

Whether this vertex is actually in injection mode.

Return type:

bool

property mask
Return type:

int or None

parse_extra_provenance_items(label, x, y, p, provenance_data)[source]

Convert the remaining provenance words (those not in the standard set) into provenance items.

Called by get_provenance_data_from_machine()

Parameters:
  • label (str) – A descriptive label for the vertex (derived from label and placed position) to be used for provenance error reporting to the user.

  • x (int) – x coordinate of the chip where this core

  • y (int) – y coordinate of the core where this core

  • p (int) – virtual id of the core

  • provenance_data (list(int)) – The list of words of raw provenance data.

property reverse_iptags

The ReverseIPTags used by this vertex, if any.

Return type:

iterable(ReverseIPtagResource)

rewind(region)[source]

Rewinds the internal buffer in preparation of re-sending the spikes.

Parameters:

region (int) – The region to rewind

property sdram_required

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

property send_buffer_times

When events will be sent.

Return type:

ndarray(ndarray(numpy.int32)) or list(ndarray(numpy.int32)) or None

property send_buffers
Return type:

dict(int,BufferedSendingRegion)

update_virtual_key()[source]
class spinn_front_end_common.utility_models.ReverseIpTagMultiCastSource(n_keys, label=None, max_atoms_per_core=9223372036854775807, 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, injection_partition_id=None, splitter=None)[source]

Bases: ApplicationVertex, LegacyPartitionerAPI

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

  • 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

  • injection_partition (str) – If not None, will enable injection and specify the partition to send injected keys with

  • splitter (None or AbstractSplitterCommon) – the splitter object needed for this vertex

create_machine_vertex(vertex_slice, sdram, label=None)[source]

Create a machine vertex from this application vertex.

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover.

  • sdram (AbstractSDRAM) – The SDRAM used by the machine vertex.

  • label (str or None) – human readable label for the machine vertex

Returns:

The created machine vertex

Return type:

MachineVertex

enable_recording(new_state=True)[source]
get_fixed_key_and_mask(partition_id)[source]

Get a fixed key and mask for the application vertex or None if not fixed (the default). See get_machine_gixed_key_and_mask() for the conditions.

Parameters:

partition_id (str) – The identifier of the partition to get the key for

Return type:

BaseKeyAndMask or None

get_sdram_used_by_atoms(vertex_slice)[source]

Get the separate SDRAM requirements for a range of atoms.

Parameters:

vertex_slice (Slice) – the low value of atoms to calculate resources from

Return type:

AbstractSDRAM

property n_atoms

The number of atoms in the vertex.

Return type:

int

property 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.StreamingContextManager(gatherers)[source]

Bases: object

The implementation of the context manager object for streaming configuration control.

Parameters:

gatherers (iterable(DataSpeedUpPacketGatherMachineVertex)) –