spinn_front_end_common.abstract_models package

Subpackages

Module contents

class spinn_front_end_common.abstract_models.AbstractCanReset

Bases: object

Indicates an object that can be reset to time 0.

This is used when AbstractSpinnakerBase.reset is called. All Vertices and all edges in the original graph (the one added to by the user) will be checked and reset.

abstract reset_to_first_timestep() None[source]

Reset the object to first time step.

class spinn_front_end_common.abstract_models.AbstractGeneratesDataSpecification

Bases: object

A machine vertex that generates a data specification that describes what its binary’s initialisation data is.

abstract 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

class spinn_front_end_common.abstract_models.AbstractHasAssociatedBinary

Bases: object

Marks a machine graph vertex that can be launched on a SpiNNaker core.

abstract get_binary_file_name() str[source]

Get the binary name to be run for this vertex.

Return type:

str

abstract get_binary_start_type() ExecutableType[source]

Get the start type of the binary to be run.

Return type:

ExecutableType

class spinn_front_end_common.abstract_models.AbstractRewritesDataSpecification

Bases: object

Indicates an object that allows data to be changed after run, and so can rewrite the data specification.

abstract regenerate_data_specification(spec: DataSpecificationReloader, placement: Placement)[source]

Regenerate the data specification, only generating regions that have changed and need to be reloaded.

Parameters:
  • spec (DataSpecificationGenerator) – Where to write the regenerated spec

  • placement (Placement) – Where are we regenerating for?

abstract reload_required() bool[source]

Return true if any data region needs to be reloaded.

Return type:

bool

abstract set_reload_required(new_value: bool)[source]

Indicate that the regions have been reloaded.

Parameters:

new_value – the new value

class spinn_front_end_common.abstract_models.AbstractSendMeMulticastCommandsVertex

Bases: object

A device that may be a virtual vertex which wants to commands to be sent to it as multicast packets at fixed points in the simulation.

Note

The device might not be a vertex at all. It could instead be instantiated entirely host side, in which case these methods will never be called.

abstract property pause_stop_commands: Iterable[MultiCastCommand]

The commands needed when pausing or stopping simulation.

Return type:

iterable(MultiCastCommand)

abstract property start_resume_commands: Iterable[MultiCastCommand]

The commands needed when starting or resuming simulation.

Return type:

iterable(MultiCastCommand)

abstract property timed_commands: List[MultiCastCommand]

The commands to be sent at given times in the simulation.

Return type:

list(MultiCastCommand)

class spinn_front_end_common.abstract_models.AbstractSupportsBitFieldGeneration

Bases: object

Marks a vertex that can provide information about bitfields it wants generated on-chip.

abstract bit_field_base_address(placement: Placement) int[source]

Returns the SDRAM address for the bit field table data.

Parameters:

placement (Placement)

Returns:

the SDRAM address for the bitfield address

Return type:

int

abstract bit_field_builder_region(placement: Placement) int[source]

Returns the SDRAM address for the bit field builder data.

Parameters:

placement (Placement)

Returns:

the SDRAM address for the bitfield builder data

Return type:

int

class spinn_front_end_common.abstract_models.AbstractSupportsBitFieldRoutingCompression

Bases: object

Marks a machine vertex that can support having the on-chip bitfield compressor running on its core.

abstract bit_field_base_address(placement: Placement) int[source]

Returns the SDRAM address for the bit-field table data.

Parameters:

placement (Placement)

Returns:

the SDRAM address for the bitfield address

Return type:

int

abstract regeneratable_sdram_blocks_and_sizes(placement: Placement) List[Tuple[int, int]][source]

Returns the SDRAM addresses and sizes for the cores’ SDRAM that are available (borrowed) for generating bitfield tables.

Parameters:

placement (Placement)

Returns:

list of tuples containing (the SDRAM address for the cores SDRAM address’s for the core’s SDRAM that can be used to generate bitfield tables loaded, and the size of memory chunks located there)

Return type:

list(tuple(int,int))

class spinn_front_end_common.abstract_models.AbstractSupportsDatabaseInjection

Bases: object

Marks a machine vertex as supporting injection of information via a database running on the controlling host.

abstract property injection_partition_id: str

The partition that packets are being injected with.

Return type:

str

abstract property is_in_injection_mode: bool

Whether this vertex is actually in injection mode.

Return type:

bool

class spinn_front_end_common.abstract_models.AbstractVertexWithEdgeToDependentVertices

Bases: object

A vertex with a dependent vertices, which should be connected to this vertex by an edge directly to each of them.

abstract dependent_vertices() Iterable[ApplicationVertex][source]

Return the vertices which this vertex depends upon.

Return type:

iterable(ApplicationVertex)

abstract edge_partition_identifiers_for_dependent_vertex(vertex: ApplicationVertex) Iterable[str][source]

Return the dependent edge identifiers for a particular dependent vertex.

Parameters:

vertex (ApplicationVertex)

Return type:

iterable(str)

class spinn_front_end_common.abstract_models.HasCustomAtomKeyMap

Bases: object

An object that can provide a custom atom-key mapping for a partition. Useful when there isn’t a one-to-one correspondence between atoms and keys for a given partition.

abstract get_atom_key_map(pre_vertex: MachineVertex, partition_id: str, routing_info: RoutingInfo) Iterable[Tuple[int, int]][source]

Get the mapping between atoms and keys for the given partition id, and for the given machine pre-vertex.

Parameters:
  • pre_vertex (MachineVertex) – The machine vertex to get the map for

  • partition_id (str) – The partition to get the map for

  • routing_info (RoutingInfo) – Routing information

Returns:

A list of (atom_id, key)

Return type:

list(tuple(int,int))

class spinn_front_end_common.abstract_models.LiveOutputDevice

Bases: object

Indicates a device that will live-output other vertices, and so has a different mapping of keys to atoms.

abstract get_device_output_keys() Dict[MachineVertex, List[Tuple[int, int]]][source]

Get the atom key mapping to be output for each machine vertex received by the device to be output. Note that the device may change the keys as they pass through it, and this needs to be recognised here.

Return type:

Dict[MachineVertex, List[Tuple[int, int]]]