pacman.model.graphs.machine package

Module contents

class pacman.model.graphs.machine.AbstractSDRAMPartition[source]

Bases: object

An edge partition that contains SDRAM edges.

get_sdram_base_address_for(vertex)[source]

Get the SDRAM base address for a edge given which side the vertex is on.

Parameters:vertex (MachineVertex) – the vertex to find SDRAM base address of
Returns:the SDRAM address for this vertex
Return type:int
get_sdram_size_of_region_for(vertex)[source]

Get the size of the region for a vertex given a edge.

Parameters:vertex (MachineVertex) – the vertex to find SDRAM size of
Returns:the SDRAM size for this vertex
Return type:int
total_sdram_requirements()[source]

Get the total SDRAM required by this outgoing partition.

Returns:int
class pacman.model.graphs.machine.ConstantSDRAMMachinePartition(identifier, pre_vertex)[source]

Bases: pacman.model.graphs.abstract_single_source_partition.AbstractSingleSourcePartition, pacman.model.graphs.machine.abstract_sdram_partition.AbstractSDRAMPartition

An SDRAM partition that uses a fixed amount of memory. The edges in the partition must agree on how much memory is required.

add_edge(edge)[source]

Add an edge to the edge partition.

Parameters:edge (AbstractEdge) – the edge to add
Raises:PacmanInvalidParameterException – If the edge does not belong in this edge partition
get_sdram_base_address_for(vertex)[source]

Get the SDRAM base address for a edge given which side the vertex is on.

Parameters:vertex (MachineVertex) – the vertex to find SDRAM base address of
Returns:the SDRAM address for this vertex
Return type:int
get_sdram_size_of_region_for(vertex)[source]

Get the size of the region for a vertex given a edge.

Parameters:vertex (MachineVertex) – the vertex to find SDRAM size of
Returns:the SDRAM size for this vertex
Return type:int
sdram_base_address
total_sdram_requirements()[source]

Get the total SDRAM required by this outgoing partition.

Returns:int
class pacman.model.graphs.machine.DestinationSegmentedSDRAMMachinePartition(identifier, pre_vertex)[source]

Bases: pacman.model.graphs.abstract_single_source_partition.AbstractSingleSourcePartition, pacman.model.graphs.machine.abstract_sdram_partition.AbstractSDRAMPartition

An SDRAM partition that gives each edge its own slice of memory from a contiguous block. The edges all have the same source vertex.

add_edge(edge)[source]

Add an edge to the edge partition.

Parameters:edge (AbstractEdge) – the edge to add
Raises:PacmanInvalidParameterException – If the edge does not belong in this edge partition
get_sdram_base_address_for(vertex)[source]

Get the SDRAM base address for a edge given which side the vertex is on.

Parameters:vertex (MachineVertex) – the vertex to find SDRAM base address of
Returns:the SDRAM address for this vertex
Return type:int
get_sdram_size_of_region_for(vertex)[source]

Get the size of the region for a vertex given a edge.

Parameters:vertex (MachineVertex) – the vertex to find SDRAM size of
Returns:the SDRAM size for this vertex
Return type:int
sdram_base_address
total_sdram_requirements()[source]

Get the total SDRAM required by this outgoing partition.

Returns:int
class pacman.model.graphs.machine.MachineEdge(pre_vertex, post_vertex, label=None)[source]

Bases: pacman.model.graphs.abstract_edge.AbstractEdge

A simple implementation of a machine edge.

Parameters:
  • pre_vertex (MachineVertex) – The vertex at the start of the edge.
  • post_vertex (MachineVertex) – The vertex at the end of the edge.
  • label (str or None) – The name of the edge.
label

The label of the edge.

Return type:str
post_vertex

The vertex at the end of the edge.

Return type:MachineVertex
pre_vertex

The vertex at the start of the edge.

Return type:MachineVertex
class pacman.model.graphs.machine.MachineFPGAVertex(fpga_id, fpga_link_id, board_address=None, linked_chip_coordinates=None, label=None, app_vertex=None, vertex_slice=None, outgoing_keys_and_masks=None, incoming=True, outgoing=False)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, pacman.model.graphs.abstract_virtual.AbstractVirtual

A virtual vertex on an FPGA link.

board_address

The IP address of the board to which the device is connected, or None for the boot board, or when using linked chip coordinates.

Return type:str or None
fpga_id

Get link data from the machine.

Parameters:machine (Machine) – The machine to get the data from
Return type:AbstractLinkData
incoming

Whether this device sends traffic into SpiNNaker.

Return type:bool
linked_chip_coordinates

The coordinates of the chip to which the device is connected, or None for the boot board, or when using a board address.

Return type:tuple(int, int) or None
outgoing

Whether this device receives traffic from SpiNNaker.

Return type:bool
outgoing_keys_and_masks()[source]

Get the keys sent by the device or None if there aren’t any explicitly defined.

Return type:list(BaseKeyAndMask) or None
sdram_required

The SDRAM space required by the vertex.

Return type:AbstractSDRAM
class pacman.model.graphs.machine.MachineSpiNNakerLinkVertex(spinnaker_link_id, board_address=None, linked_chip_coordinates=None, label=None, app_vertex=None, vertex_slice=None, outgoing_keys_and_masks=None, incoming=True, outgoing=False)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex, pacman.model.graphs.abstract_virtual.AbstractVirtual

A virtual vertex on a SpiNNaker Link.

board_address

The IP address of the board to which the device is connected, or None for the boot board, or when using linked chip coordinates.

Return type:str or None

Get link data from the machine.

Parameters:machine (Machine) – The machine to get the data from
Return type:AbstractLinkData
incoming

Whether this device sends traffic into SpiNNaker.

Return type:bool
linked_chip_coordinates

The coordinates of the chip to which the device is connected, or None for the boot board, or when using a board address.

Return type:tuple(int, int) or None
outgoing

Whether this device receives traffic from SpiNNaker.

Return type:bool
outgoing_keys_and_masks()[source]

Get the keys sent by the device or None if there aren’t any explicitly defined.

Return type:list(BaseKeyAndMask) or None
sdram_required

The SDRAM space required by the vertex.

Return type:AbstractSDRAM
class pacman.model.graphs.machine.MachineVertex(label=None, app_vertex=None, vertex_slice=None)[source]

Bases: pacman.model.graphs.abstract_vertex.AbstractVertex

A machine graph vertex.

Parameters:
  • label (str or None) – The optional name of the vertex
  • app_vertex (ApplicationVertex or None) – The application vertex that caused this machine vertex to be created. If None, there is no such application vertex.
  • vertex_slice (Slice or None) – The slice of the application vertex that this machine vertex implements.
Raises:
app_vertex

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

Return type:ApplicationVertex or None
get_fixed_location()[source]

The x, y and possibly p the vertex must be placed on.

Typically None! Does not have the value of a normal placements.

Used instead of ChipAndCoreConstraint.

Return type:None or ChipAndCore

Note

If the Machine vertex has no fixed_location but does have an app_vertex, app_vertex.fixed_location is used. If both have a fixed_location the app level is ignored!

get_n_keys_for_partition(partition_id)[source]

Get the number of keys required by the given partition of edges.

Parameters:partition_id (str) – The identifier of the partition; the partition_id param is only used by some MachineVertex subclasses
Returns:The number of keys required
Return type:int
index

The index into the collection of machine vertices for an application vertex.

Return type:int
iptags

The IPtags used by this vertex if any.

Return type:iterable(IPtagResource)
reverse_iptags

The reverse IPtags used by this vertex if any.

Return type:iterable(ReverseIPtagResource)
sdram_required

The SDRAM space required by the vertex.

Return type:AbstractSDRAM
vertex_slice

The slice of the application vertex that this machine vertex implements.

Return type:Slice
class pacman.model.graphs.machine.MulticastEdgePartition(pre_vertex, identifier)[source]

Bases: pacman.model.graphs.abstract_single_source_partition.AbstractSingleSourcePartition

A simple implementation of a machine edge partition that will communicate with SpiNNaker multicast packets. They have a common set of sources with the same semantics and so can share a single key.

Parameters:
  • pre_vertex (MachineVertex) – the pre vertex of this partition.
  • identifier (str) – The identifier of the partition
class pacman.model.graphs.machine.SDRAMMachineEdge(pre_vertex, post_vertex, label)[source]

Bases: pacman.model.graphs.machine.machine_edge.MachineEdge

sdram_base_address
sdram_size
class pacman.model.graphs.machine.SimpleMachineVertex(sdram, label=None, app_vertex=None, vertex_slice=None, iptags=None, reverse_iptags=None)[source]

Bases: pacman.model.graphs.machine.machine_vertex.MachineVertex

A MachineVertex that stores its own resources.

This class is mainly intended for JSON and testing as it support the minimal API. If a more complex Vertex is required consider the MockMachineVertex.

iptags

The IPtags used by this vertex if any.

Return type:iterable(IPtagResource)
reverse_iptags

The reverse IPtags used by this vertex if any.

Return type:iterable(ReverseIPtagResource)
sdram_required

The SDRAM space required by the vertex.

Return type:AbstractSDRAM
class pacman.model.graphs.machine.SourceSegmentedSDRAMMachinePartition(identifier, pre_vertices)[source]

Bases: pacman.model.graphs.abstract_multiple_partition.AbstractMultiplePartition, pacman.model.graphs.machine.abstract_sdram_partition.AbstractSDRAMPartition

An SDRAM partition that gives each edge its own slice of memory from a contiguous block. The edges all have the same destination vertex.

Parameters:
  • identifier (str) – The identifier of the partition
  • label (str) – A label of the partition
  • pre_vertices (iterable(AbstractVertex)) – The vertices that an edge in this partition may originate at
add_edge(edge)[source]

Add an edge to the edge partition.

Parameters:edge (AbstractEdge) – the edge to add
Raises:PacmanInvalidParameterException – If the edge does not belong in this edge partition
get_sdram_base_address_for(vertex)[source]

Get the SDRAM base address for a edge given which side the vertex is on.

Parameters:vertex (MachineVertex) – the vertex to find SDRAM base address of
Returns:the SDRAM address for this vertex
Return type:int
get_sdram_size_of_region_for(vertex)[source]

Get the size of the region for a vertex given a edge.

Parameters:vertex (MachineVertex) – the vertex to find SDRAM size of
Returns:the SDRAM size for this vertex
Return type:int
sdram_base_address
Return type:int
total_sdram_requirements()[source]
Return type:int