spinn_front_end_common.utility_models package

Module contents

class spinn_front_end_common.utility_models.ChipPowerMonitorMachineVertex(label: str, sampling_frequency: int)

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

Get the filename of the binary.

Return type:

str

static binary_start_type() ExecutableType[source]

The type of binary that implements this vertex.

Returns:

start-type

Return type:

ExecutableType

generate_data_specification(spec: DataSpecificationGenerator, placement: Placement)[source]

Generate a data specification.

Parameters:
  • spec (DataSpecificationGenerator) – The data specification to write to

  • placement (Placement) – The placement the vertex is located at

get_binary_file_name() str[source]

Get the binary name to be run for this vertex.

Return type:

str

get_binary_start_type() ExecutableType[source]

Get the start type of the binary to be run.

Return type:

ExecutableType

get_recorded_data(placement: Placement) ndarray[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() List[int][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: Placement) int[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

property sampling_frequency: int

How often to sample, in microseconds.

Return type:

int

property sdram_required: AbstractSDRAM

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

class spinn_front_end_common.utility_models.CommandSender(label: str)

Bases: AbstractOneAppOneMachineVertex[CommandSenderMachineVertex]

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: Iterable[MultiCastCommand], pause_stop_commands: Iterable[MultiCastCommand], timed_commands: Iterable[MultiCastCommand], vertex_to_send_to: AbstractVertex)[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() Tuple[List[ApplicationEdge], List[str]][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: str) BaseKeyAndMask[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: str, app_vertex: CommandSender)

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, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

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: Iterable[MultiCastCommand], pause_stop_commands: Iterable[MultiCastCommand], timed_commands: Iterable[MultiCastCommand], vertex_to_send_to: AbstractVertex)[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() Tuple[List[MachineEdge], List[str]][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: DataSpecificationGenerator, placement: Placement)[source]

Generate a data specification.

Parameters:
  • spec (DataSpecificationGenerator) – The data specification to write to

  • placement (Placement) – The placement the vertex is located at

get_binary_file_name() str[source]

Get the binary name to be run for this vertex.

Return type:

str

get_binary_start_type() ExecutableType[source]

Get the start type of the binary to be run.

Return type:

ExecutableType

get_edges_and_partitions(pre_vertex: CS, vertex_type: Type[V], edge_type: Callable[[CS, V], E]) Tuple[List[E], List[str]][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: str) BaseKeyAndMask[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: Sized) int[source]
Parameters:

commands (list(MultiCastCommand)) –

Return type:

int

get_timed_commands_bytes() int[source]
Return type:

int

parse_extra_provenance_items(label: str, x: int, y: int, p: int, provenance_data: Sequence[int])[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: AbstractSDRAM

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

class spinn_front_end_common.utility_models.DataSpeedUpPacketGatherMachineVertex(x: int, y: int, ip_address: str)

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_MASK = 4294967291
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'
NEW_SEQ_KEY = 4294967288
NEW_SEQ_KEY_OFFSET = 1
OUT_REPORT_NAME = 'routers_used_in_speed_up_process.rpt'
TRANSACTION_ID_KEY = 4294967285
TRANSACTION_ID_KEY_OFFSET = 4
clear_reinjection_queue() None[source]

Clears the queues for reinjection.

generate_data_specification(spec: DataSpecificationGenerator, placement: Placement)[source]

Generate a data specification.

Parameters:
  • spec (DataSpecificationGenerator) – The data specification to write to

  • placement (Placement) – The placement the vertex is located at

get_binary_file_name() str[source]

Get the binary name to be run for this vertex.

Return type:

str

get_binary_start_type() ExecutableType[source]

Get the start type of the binary to be run.

Return type:

ExecutableType

get_data(extra_monitor: ExtraMonitorSupportMachineVertex, placement: Placement, memory_address: int, length_in_bytes: int) 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: Placement)[source]

Get provenance data items for a placement and store them in the provenance DB.

Parameters:

placement (Placement) – the placement of the object

property iptags: List[IPtagResource]

The IPTags used by this vertex, if any.

Return type:

iterable(IPtagResource)

static load_application_routing_tables() None[source]

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

static load_system_routing_tables() None[source]

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

property sdram_required: ConstantSDRAM

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

send_data_into_spinnaker(x: int, y: int, base_address: int, data: BinaryIO | bytes | str | int, *, n_bytes: int | None = None, offset: int = 0, cpu: int = 0)[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 a string)

  • n_bytes (int) – how many bytes to read, or None if not set

  • offset (int) – where in the data to start from

  • cpu (int) – Ignored; can only target SDRAM so unimportant

set_cores_for_data_streaming() None[source]

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

set_router_wait1_timeout(timeout: Tuple[int, int])[source]

Set the wait1 field for a set of routers.

Parameters:

timeout (tuple(int,int)) – The mantissa and exponent of the timeout value, each between 0 and 15

set_router_wait2_timeout(timeout: Tuple[int, int])[source]

Set the wait2 field for a set of routers.

Parameters:

timeout (tuple(int,int)) – The mantissa and exponent of the timeout value, each between 0 and 15

unset_cores_for_data_streaming() None[source]

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

class spinn_front_end_common.utility_models.EIEIOParameters(receive_port: int | None = None, receive_sdp_port: int = 1, receive_tag: int | None = None, receive_rate: float = 10.0, virtual_key: int | None = None, prefix: int | None = None, prefix_type: EIEIOPrefix | None = None, check_keys: bool = False, send_buffer_partition_id: str | None = None, reserve_reverse_ip_tag: bool = False, injection_partition_id: str | None = None)

Bases: object

Parameters:
  • 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_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

check_keys: bool = False
injection_partition_id: str | None = None
prefix: int | None = None
prefix_type: EIEIOPrefix | None = None
receive_port: int | None = None
receive_rate: float = 10.0
receive_sdp_port: int = 1
receive_tag: int | None = None
reserve_reverse_ip_tag: bool = False
send_buffer_partition_id: str | None = None
virtual_key: int | None = None
class spinn_front_end_common.utility_models.ExtraMonitorSupportMachineVertex(reinject_point_to_point: bool = False, reinject_nearest_neighbour: bool = False, reinject_fixed_route: bool = False)

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

generate_data_specification(spec: DataSpecificationGenerator, placement: Placement)[source]

Generate a data specification.

Parameters:
  • spec (DataSpecificationGenerator) – The data specification to write to

  • placement (Placement) – The placement the vertex is located at

get_binary_file_name() str[source]

Get the binary name to be run for this vertex.

Return type:

str

get_binary_start_type() ExecutableType[source]

Get the start type of the binary to be run.

Return type:

ExecutableType

get_provenance_data_from_machine(placement: Placement)[source]

Get provenance data items for a placement and store them in the provenance DB.

Parameters:

placement (Placement) – the placement of the object

get_reinjection_status() ReInjectionStatus[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() Dict[Chip, ReInjectionStatus][source]

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

Return type:

dict(Chip, ReInjectionStatus)

load_application_mc_routes() None[source]

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

load_system_mc_routes() None[source]

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

property placement: Placement
Return type:

Placement

property reinject_fixed_route: bool
Return type:

bool

property reinject_multicast: bool
Return type:

bool

property reinject_nearest_neighbour: bool
Return type:

bool

property reinject_point_to_point: bool
Return type:

bool

reset_reinjection_counters(extra_monitor_cores_to_set: Iterable[ExtraMonitorSupportMachineVertex])[source]

Resets the counters for reinjection.

Parameters:
property sdram_required: AbstractSDRAM

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

set_reinjection_packets(point_to_point: bool | None = None, multicast: bool | None = None, nearest_neighbour: bool | None = None, fixed_route: bool | None = 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.

static static_get_binary_file_name() str[source]

The name of the binary implementing this vertex.

Return type:

str

static static_get_binary_start_type() ExecutableType[source]

The type of the binary implementing this vertex.

Return type:

ExecutableType

property transaction_id: int
update_transaction_id() None[source]

Advance the transaction ID.

update_transaction_id_from_machine() None[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: LivePacketGatherParameters, label: str | None = None)

Bases: ApplicationVertex[LivePacketGatherMachineVertex]

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

Parameters:
property n_atoms: int

The number of atoms in the vertex.

Return type:

int

property params: LivePacketGatherParameters
class spinn_front_end_common.utility_models.LivePacketGatherMachineVertex(lpg_params: LivePacketGatherParameters, app_vertex: LivePacketGather | None = None, label: str | None = None)

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'
add_incoming_source(m_vertex: MachineVertex, partition_id: str)[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: DataSpecificationGenerator, placement: Placement)[source]

Generate a data specification.

Parameters:
  • spec (DataSpecificationGenerator) – The data specification to write to

  • placement (Placement) – The placement the vertex is located at

get_binary_file_name() str[source]

Get the binary name to be run for this vertex.

Return type:

str

get_binary_start_type() ExecutableType[source]

Get the start type of the binary to be run.

Return type:

ExecutableType

classmethod get_sdram_usage() int[source]

Get the SDRAM used by this vertex.

Return type:

int

property iptags: List[IPtagResource]

The IPTags used by this vertex, if any.

Return type:

iterable(IPtagResource)

property params: LivePacketGatherParameters
parse_extra_provenance_items(label: str, x: int, y: int, p: int, provenance_data: Sequence[int])[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: AbstractSDRAM

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

class spinn_front_end_common.utility_models.MultiCastCommand(key: int, payload: int | None = None, *, time: int | None = None, repeat: int = 0, delay_between_repeats: int = 0)

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

int

property is_payload: bool

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: bool

Whether this command is a timed command.

Return type:

bool

property key: int
Return type:

int

property payload: int | None

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

Return type:

int or None

property repeat: int
Return type:

int

property time: int | None

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: str | None, vertex_slice: Slice | None = None, app_vertex: ReverseIpTagMultiCastSource | None = None, n_keys: int | None = None, eieio_params: EIEIOParameters | None = None, send_buffer_times: _SendBufferTimes = None)

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)

  • eieio_params – General parameters passed from the application vertex.

  • send_buffer_times (ndarray) – An array of arrays of time steps at which keys should be sent (one array for each key, default disabled)

  • 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:
  • PacmanValueError – If the slice of the machine_vertex is too big

  • AttributeError – If a not-None app_vertex is not an ApplicationVertex

buffering_input() bool[source]

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

Return type:

bool

static calculate_mask(n_neurons: int) int[source]
Parameters:

n_neurons (int) –

Return type:

int

enable_recording(new_state: bool = True)[source]

Enable recording of the keys sent.

Parameters:

new_state (bool) –

generate_data_specification(spec: DataSpecificationGenerator, placement: Placement)[source]

Generate a data specification.

Parameters:
  • spec (DataSpecificationGenerator) – The data specification to write to

  • placement (Placement) – The placement the vertex is located at

get_binary_file_name() str[source]

Get the binary name to be run for this vertex.

Return type:

str

get_binary_start_type() ExecutableType[source]

Get the start type of the binary to be run.

Return type:

ExecutableType

get_recorded_region_ids() List[int][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: Placement) int[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: int) int[source]
Parameters:

region (int) – Region ID

Returns:

Size of buffer, in bytes.

Return type:

int

get_regions() Collection[int][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: _SendBufferTimes, recording_enabled: bool, receive_rate: float, n_keys: int) VariableSDRAM[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() int[source]

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

Return type:

int or None

property injection_partition_id: str

The partition that packets are being injected with.

Return type:

str

property is_in_injection_mode: bool

Whether this vertex is actually in injection mode.

Return type:

bool

property mask: int | None
Return type:

int or None

parse_extra_provenance_items(label: str, x: int, y: int, p: int, provenance_data: Sequence[int])[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: List[ReverseIPtagResource]

The ReverseIPTags used by this vertex, if any.

Return type:

iterable(ReverseIPtagResource)

rewind(region: int)[source]

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

Parameters:

region (int) – The region to rewind

property sdram_required: AbstractSDRAM

The SDRAM space required by the vertex.

Return type:

AbstractSDRAM

property send_buffer_times: _SendBufferTimes

When events will be sent.

Return type:

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

property send_buffers: Dict[int, BufferedSendingRegion]
Return type:

dict(int,BufferedSendingRegion)

update_virtual_key() None[source]
class spinn_front_end_common.utility_models.ReverseIpTagMultiCastSource(n_keys: int, label: str | None = None, max_atoms_per_core: int | Tuple[int, ...] | None = 9223372036854775807, receive_port: int | None = None, receive_sdp_port: int = 1, receive_tag: IPTag | None = None, receive_rate: int = 10, virtual_key: int | None = None, prefix: int | None = None, prefix_type: EIEIOPrefix | None = None, check_keys: bool = False, send_buffer_times: ndarray | List[ndarray] | None = None, send_buffer_partition_id: str | None = None, reserve_reverse_ip_tag: bool = False, injection_partition_id: str | None = None, splitter: AbstractSplitterCommon | None = None)

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 (AbstractSplitterCommon or None) – the splitter object needed for this vertex

create_machine_vertex(vertex_slice: Slice, sdram: AbstractSDRAM, label: str | None = None) ReverseIPTagMulticastSourceMachineVertex[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: bool = True)[source]
get_fixed_key_and_mask(partition_id: str) BaseKeyAndMask | None[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: Slice) AbstractSDRAM[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: int

The number of atoms in the vertex.

Return type:

int

property send_buffer_times: ndarray | List[ndarray] | None

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: Iterable[DataSpeedUpPacketGatherMachineVertex])

Bases: ContextManager[None]

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

Parameters:

gatherers (iterable(DataSpeedUpPacketGatherMachineVertex)) –