spinn_front_end_common.utility_models package

Submodules

spinn_front_end_common.utility_models.command_sender module

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

Bases: pacman.model.graphs.application.impl.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_binary_uses_simulation_run.AbstractBinaryUsesSimulationRun

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

add_commands(commands, partitions)[source]

Add commands to be sent down a given edge

Parameters:
Raises:

ConfigurationException – If the edge already has commands or if all the commands masks are not 0xFFFFFFFF and there is no commonality between the command masks

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

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice – The slice of atoms that the machine vertex will cover
  • resources_required – the resources used by the machine vertex
  • constraints – Constraints to be passed on to the machine vertex
generate_data_specification(obj, *args, **kwargs)[source]

Generate a data specification

Parameters:
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for vertices of this vertex Return a string representation of the models binary

get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (pacman.model.graph.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

Returns:The number of atoms
Return type:int

spinn_front_end_common.utility_models.command_sender_machine_vertex module

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

Bases: pacman.model.graphs.machine.impl.machine_vertex.MachineVertex, spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl

COMMANDS = 1
PROVENANCE_REGION = 2
SYSTEM_REGION = 0
add_constraint(obj, *args, **kwargs)[source]

Add a new constraint to the collection of constraints

Parameters:constraint (pacman.model.constraints.abstract_constraint.AbstractConstraint) – constraint to add
Return type:None
Raises:pacman.exceptions.PacmanInvalidParameterException – If the constraint is not valid
add_constraints(obj, *args, **kwargs)[source]

Add an iterable of constraints to the collection of constraints

Parameters:constraints (iterable of pacman.model.constraints.abstract_constraint.AbstractConstraint) – iterable of constraints to add
Return type:None
Raises:pacman.exceptions.PacmanInvalidParameterException – If one of the constraints is not valid
constraints

An iterable of constraints

Returns:iterable of constraints
Return type:iterable of pacman.model.constraints.abstract_constraint                    .AbstractConstraint
Raises:None – Raises no known exceptions
resources_required

The resources required by the vertex

Return type:pacman.model.resources.resource_container.ResourceContainer

spinn_front_end_common.utility_models.live_packet_gather module

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

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

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(obj, *args, **kwargs)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice – The slice of atoms that the machine vertex will cover
  • resources_required – the resources used by the machine vertex
  • constraints – 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 vertices of this vertex

get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (pacman.model.graph.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

Returns:The number of atoms
Return type:int

spinn_front_end_common.utility_models.live_packet_gather_machine_vertex module

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

Bases: pacman.model.graphs.machine.impl.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_binary_uses_simulation_run.AbstractBinaryUsesSimulationRun

N_ADDITIONAL_PROVENANCE_ITEMS = 2
generate_data_specification(obj, *args, **kwargs)[source]

Generate a data specification

Parameters:
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for vertices of this vertex

static get_cpu_usage()[source]

Get the CPU used by this vertex

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

Get the DTCM used by this vertex

get_provenance_data_from_machine(transceiver, placement)[source]

Get provenance from the machine

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

Get the SDRAM used by this vertex

resources_required

The resources required by the vertex

Return type:pacman.model.resources.resource_container.ResourceContainer

spinn_front_end_common.utility_models.multi_cast_command module

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

Bases: object

A command to be sent to a vertex

Parameters:
  • time (int) – The time within the simulation at which to send the command. 0 or a positive value indicates the number of timesteps after the start of the simulation at which the command is to be sent. A negative value indicates the (number of timesteps - 1) before the end of simulation at which the command is to be sent (thus -1 means the last timestep of the simulation).
  • key (int) – The key of the command
  • payload (int) – The payload of the 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 micro seconds 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()[source]

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
key
payload

Get the payload of the command.

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

spinn_front_end_common.utility_models.reverse_ip_tag_multi_cast_source module

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

Bases: pacman.model.graphs.application.impl.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.abstract_binary_uses_simulation_run.AbstractBinaryUsesSimulationRun

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

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

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice – The slice of atoms that the machine vertex will cover
  • resources_required – the resources used by the machine vertex
  • constraints – Constraints to be passed on to the machine vertex
enable_recording(record_buffer_size=1048576, buffer_size_before_receive=16384, time_between_requests=0)[source]
generate_data_specification(spec, placement)[source]
get_binary_file_name()[source]

Get the binary name to be run for vertices of this vertex

get_outgoing_partition_constraints(partition)[source]

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

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

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (pacman.model.graph.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

Returns:The number of atoms
Return type:int
send_buffer_times

spinn_front_end_common.utility_models.reverse_ip_tag_multicast_source_machine_vertex module

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

Bases: pacman.model.graphs.machine.abstract_machine_vertex.AbstractMachineVertex, pacman.model.abstract_classes.abstract_has_constraints.AbstractHasConstraints, 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_binary_uses_simulation_run.AbstractBinaryUsesSimulationRun, 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

add_constraint(obj, *args, **kwargs)[source]

Add a new constraint to the collection of constraints

Parameters:constraint (pacman.model.constraints.abstract_constraint.AbstractConstraint) – constraint to add
Return type:None
Raises:pacman.exceptions.PacmanInvalidParameterException – If the constraint is not valid
add_constraints(obj, *args, **kwargs)[source]

Add an iterable of constraints to the collection of constraints

Parameters:constraints (iterable of pacman.model.constraints.abstract_constraint.AbstractConstraint) – iterable of constraints to add
Return type:None
Raises:pacman.exceptions.PacmanInvalidParameterException – If one of the constraints is not valid
constraints

An iterable of constraints

Returns:iterable of constraints
Return type:iterable of pacman.model.constraints.abstract_constraint                    .AbstractConstraint
Raises:None – Raises no known exceptions
enable_recording(record_buffer_size=1048576, buffer_size_before_receive=16384, time_between_triggers=0)[source]

Enable recording of the keys sent

Parameters:
  • record_buffer_size (int) – The size of the recording buffer in bytes. Note that when using automatic pause and resume, this will be used as the minimum size of the buffer
  • buffer_size_before_receive (int) – The size that the buffer can grow to before a read request is issued to the host (in bytes)
  • time_between_triggers (int) – The minimum time between the sending of read requests
generate_data_specification(obj, *args, **kwargs)[source]

Generate a data specification

Parameters:
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for vertices of this vertex

static get_cpu_usage()[source]
static get_dtcm_usage()[source]
get_minimum_buffer_sdram_usage()[source]

Get the minimum amount of SDRAM to reserve for buffers

get_n_timesteps_in_buffer_space(buffer_space, machine_time_step)[source]

Get the number of timesteps that can be stored fully in the given buffer space in bytes

Parameters:
  • buffer_space – The buffer space in bytes
  • machine_time_step – The size of each time step
Returns:

The number of time steps that can be stored in the buffer

Return type:

int

get_outgoing_partition_constraints(partition)[source]

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

Parameters:partition – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list of pacman.model.constraints.abstract_constraint.AbstractConstraint
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 of int
get_recording_region_base_address(txrx, placement)[source]

Get the recording region base address

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

the base address of the recording region

static get_sdram_usage(send_buffer_times, send_buffer_max_space, recording_enabled)[source]
is_in_injection_mode
is_recording()[source]

Deduce if the recorder is actually recording

label

The label of the item

Returns:The label
Return type:str
Raises:None – Raises no known exceptions
mask
static n_regions_to_allocate(send_buffering, recording)[source]

Get the number of regions that will be allocated

resources_required

The resources required by the vertex

Return type:pacman.model.resources.resource_container.ResourceContainer
send_buffer_times
update_buffer(obj, arg)[source]
virtual_key

Module contents