These pages document the python code for the SpiNNMachine module which is part of the SpiNNaker Project
This code depends on SpiNNUtils. (Combined_documentation).
SpiNNMachine¶
An abstraction of a SpiNNaker Machine. The main functionality is
provided by spinn_machine.Machine
.
Functional Requirements¶
Create a machine which represents the current state of a machine, in terms of the available chips, cores on the chips, SDRAM available, routable links between chips and available routing entries.
Create a machine which represents an abstract ideal machine.
There can only be one chip in the machine with given x, y coordinates
There can only be one processor in each chip with a given processor ID
There can only be one link in the router of each chip with a given ID
Add a chip to a given machine to represent an external device.
A chip with the same x, y coordinates must not already exist in the machine
Add a link to a router of a given chip to represent a connection to an external device.
A link with the given ID must not already exist in the chip
Create a representation of a multicast routing entry to be shared between modules that deal with routing entries.
Use Cases¶
Machine
is returned as a representation of the current state of a machine.
virtual_machine()
is used to make an outline of a machine on which a simulation will be run, e.g., for placement of executables and/or finding routes between placed executables.
Machine
is extended to add a virtualChip
on the machine representing an external peripheral connected to the machine directly via a link from a chip, so that routes can be directed to and from the external peripheral.
MulticastRoutingEntry
is returned in a list of entries, which indicate the current set of routing entries within a multicast routing table on a chip on the machine.
MulticastRoutingEntry
is sent in a list of routing entries to set up routing on a chip on the machine.
- class spinn_machine.Chip(x: int, y: int, scamp_processors: Iterable[int], placable_processors: Iterable[int], router: Router, sdram: int, nearest_ethernet_x: int, nearest_ethernet_y: int, ip_address: str | None = None, tag_ids: Iterable[int] | None = None, parent_link: int | None = None)[source]
Represents a SpiNNaker chip with a number of cores, an amount of SDRAM shared between the cores, and a router.
- Parameters:
x (int) – the x-coordinate of the chip’s position in the two-dimensional grid of chips
y (int) – the y-coordinate of the chip’s position in the two-dimensional grid of chips
scamp_processors (iterable(int)) – the ids of scamp processors
placable_processors (iterable(int)) – the ids of processors excluding scamp processors.
router (Router) – a router for the chip
sdram (int) – an SDRAM for the chip
ip_address (str or None) – the IP address of the chip, or
None
if no Ethernet attachedtag_ids (iterable(int) or None) – IDs to identify the chip for SDP can be empty to define no tags or None to allocate tag automatically based on if there is an ip_address
nearest_ethernet_x (int or None) – the nearest Ethernet x coordinate
nearest_ethernet_y (int or None) – the nearest Ethernet y coordinate
parent_link (int or None) – The link down which the parent chips is found in the tree of chips towards the root (boot) chip
v_to_p_map (bytearray or None) – An array indexed by virtual core which gives the physical core number or 0xFF if no entry for the core
- Raises:
SpinnMachineAlreadyExistsException – If processors contains any two processors with the same
processor_id
- property all_processor_ids: Iterator[int]
An iterable of id’s of all available processors
- Return type:
iterable(int)
- property ip_address: str | None
The IP address of the chip, or
None
if there is no Ethernet connected to the chip.- Return type:
str or None
- is_processor_with_id(processor_id: int) bool [source]
Determines if a processor with the given ID exists in the chip. Also implemented as
__contains__(processor_id)
- property n_placable_processors: int
The total number of processors that are placable / not used by scamp.
- Return type:
- property n_scamp_processors: int
The total number of processors that are used by scamp.
- Return type:
- property parent_link: int | None
The link down which the parent is found in the tree of chips rooted at the machine root chip (probably 0, 0 in most cases). This will be
None
if the chip information didn’t contain this value.- Return type:
int or None
- property placable_processors_ids: Tuple[int, ...]
An iterable of available placable/ non scamp processor ids.
- Return type:
iterable(int)
- class spinn_machine.CoreSubset(x: int, y: int, processor_ids: Iterable[int])[source]
Represents a subset of the cores on a SpiNNaker chip.
- Parameters:
- add_processor(processor_id: int)[source]
Adds a processor ID to this subset
- Parameters:
processor_id (int) – A processor ID
- intersect(other: CoreSubset) CoreSubset [source]
Returns a new CoreSubset which is an intersect of this and the other.
- Parameters:
other (CoreSubset) – A second CoreSubset with possibly overlapping cores
- Returns:
A new CoreSubset with any overlap
- Return type:
- class spinn_machine.CoreSubsets(core_subsets: Iterable[CoreSubset] = ())[source]
Represents a group of CoreSubsets, with a maximum of one per SpiNNaker chip.
- Parameters:
core_subsets (iterable(CoreSubset)) – The cores for each desired chip
- add_core_subset(core_subset: CoreSubset)[source]
Add a core subset to the set
- Parameters:
core_subset (CoreSubset) – The core subset to add
- add_core_subsets(core_subsets: Iterable[CoreSubset])[source]
Merges a core subsets into this one.
- Parameters:
core_subsets (iterable(CoreSubset)) – the core subsets to add
- add_processor(x: int, y: int, processor_id: int)[source]
Add a processor on a given chip to the set.
- property core_subsets: Iterable[CoreSubset]
The one-per-chip subsets.
- Returns:
Iterable of core subsets
- Return type:
iterable(CoreSubset)
- get_core_subset_for_chip(x: int, y: int) CoreSubset [source]
Get the core subset for a chip.
- Parameters:
- Returns:
The core subset of a chip, which will be empty if not added
- Return type:
- intersect(other: CoreSubsets) CoreSubsets [source]
Returns a new CoreSubsets which is an intersect of this and the other.
- Parameters:
other (CoreSubsets) – A second CoreSubsets with possibly overlapping cores
- Returns:
A new CoreSubsets with any overlap
- Return type:
- is_chip(x: int, y: int) bool [source]
Determine if the chip with coordinates (x, y) is in the subset
- is_core(x: int, y: int, processor_id: int) bool [source]
Determine if there is a chip with coordinates (x, y) in the subset, which has a core with the given ID in the subset
- values() Iterable[CoreSubset] [source]
- Return type:
iterable(CoreSubset)
- class spinn_machine.FrozenCoreSubsets(core_subsets: Iterable[CoreSubset] = ())[source]
Represents a frozen group of CoreSubsets, with a maximum of one per SpiNNaker chip.
- Parameters:
core_subsets (iterable(CoreSubset)) – The cores for each desired chip
- add_core_subset(core_subset: CoreSubset)[source]
Add a core subset to the set
- Parameters:
core_subset (CoreSubset) – The core subset to add
- add_core_subsets(core_subsets: Iterable[CoreSubset])[source]
Merges a core subsets into this one.
- Parameters:
core_subsets (iterable(CoreSubset)) – the core subsets to add
- class spinn_machine.Link(source_x: int, source_y: int, source_link_id: int, destination_x: int, destination_y: int)[source]
Represents a directional link between SpiNNaker chips in the machine.
- Parameters:
source_x (int) – The x-coordinate of the source chip of the link
source_y (int) – The y-coordinate of the source chip of the link
source_link_id (int) – The ID of the link in the source chip
destination_x (int) – The x-coordinate of the destination chip of the link
destination_y (int) – The y-coordinate of the destination chip of the link
- class spinn_machine.Machine(width: int, height: int, chip_core_map: Dict[Tuple[int, int], int], origin: str = '')[source]
A representation of a SpiNNaker Machine with a number of Chips. Machine is also iterable, providing
((x, y), chip)
where:x
is the x-coordinate of a chip,y
is the y-coordinate of a chip,chip
is the chip with the given(x, y)
coordinates.
- Parameters:
width (int) – The width of the machine excluding
height (int) – The height of the machine
chip_core_map (dict((int, int), int)) – A map off the expected x,y coordinates on a standard board to the most likely number of cores on that chip.
origin (str) – Extra information about how this machine was created to be used in the str method. Example “
Virtual
” or “Json
”
- Raises:
SpinnMachineAlreadyExistsException – If any two chips have the same x and y coordinates
- add_chip(chip: Chip)[source]
Add a chip to the machine.
- Parameters:
chip (Chip) – The chip to add to the machine
- Raises:
SpinnMachineAlreadyExistsException – If a chip with the same x and y coordinates already exists
- add_chips(chips: Iterable[Chip])[source]
Add some chips to the machine.
- Parameters:
chips (iterable(Chip)) – an iterable of chips
- Raises:
SpinnMachineAlreadyExistsException – If a chip with the same x and y coordinates as one being added already exists
- add_fpga_links() None [source]
Add FPGA links that are on a given machine depending on the version of the board.
- add_spinnaker_links() None [source]
Add SpiNNaker links that are on a given machine depending on the version of the board.
- property chip_coordinates: Iterator[Tuple[int, int]]
An iterable of chip coordinates in the machine.
- abstract concentric_xys(radius: int, start: Tuple[int, int]) Iterable[Tuple[int, int]] [source]
A generator that produces coordinates for concentric rings of possible chips based on the links of the chips.
No check is done to see if the chip exists. This may even produce coordinates with negative numbers
Mostly copied from: https://github.com/project-rig/rig/blob/master/rig/geometry.py
- property ethernet_connected_chips: Sequence[Chip]
The chips in the machine that have an Ethernet connection.
- Return type:
iterable(Chip)
- get_chip_at(x: int, y: int) Chip | None [source]
Get the chip at a specific (x, y) location. Also implemented as
__getitem__((x, y))
- get_chips_by_ethernet(ethernet_x: int, ethernet_y: int) Iterable[Chip] [source]
Yields the actual chips on the board with this Ethernet-enabled chip. Including the Ethernet-enabled chip itself.
Wrap-arounds are handled as appropriate.
This method does check if the chip actually exists.
- get_cores_count() int [source]
Get the number of cores from the machine.
- Returns:
n_cores
- Return type:
- abstract get_down_xys_by_ethernet(ethernet_x: int, ethernet_y: int) Iterable[Tuple[int, int]] [source]
Yields the (x,y) coordinates of the down chips on the board with this Ethernet-enabled chip.
Note
The Ethernet chip itself can not be missing if validated.
Wrap-arounds are handled as appropriate.
This method does check if the chip actually exists.
- abstract get_existing_xys_by_ethernet(ethernet_x: int, ethernet_y: int) Iterable[Tuple[int, int]] [source]
Yields the (x,y)s of actual chips on the board with this Ethernet-enabled chip. Including the Ethernet-enabled chip itself.
Wrap-arounds are handled as appropriate.
This method does check if the chip actually exists.
- get_existing_xys_on_board(chip: Chip) Iterable[XY] [source]
Get the chips that are on the same board as the given chip.
- get_fpga_link_with_id(fpga_id: int, fpga_link_id: int, board_address: str | None = None, chip_coords: Tuple[int, int] | None = None) FPGALinkData [source]
Get an FPGA link data item that corresponds to the FPGA and FPGA link for a given board address.
- Parameters:
fpga_id (int) – the ID of the FPGA that the data is going through. Refer to technical document located here for more detail: https://drive.google.com/file/d/0B9312BuJXntlVWowQlJ3RE8wWVE
fpga_link_id (int) – the link ID of the FPGA. Refer to technical document located here for more detail: https://drive.google.com/file/d/0B9312BuJXntlVWowQlJ3RE8wWVE
board_address (str or None) – optional board address that this FPGA link is associated with. This is ignored if chip_coords is not None. If this is None and chip_coords is None, the boot board will be assumed.
chip_coords (tuple(int, int) or None) – optional chip coordinates that this FPGA link is associated with. If this is None and board_address is None, the boot board will be assumed.
- Returns:
the given FPGA link object
- Return type:
- abstract get_global_xy(local_x: int, local_y: int, ethernet_x: int, ethernet_y: int) Tuple[int, int] [source]
Converts the local (X, Y) coordinates into global (x,y) coordinates, under the assumption that they are on the board with local (0,0) at global coordinates (ethernet_x, ethernet_y).
This method does take wrap-arounds into consideration.
Warning
GIGO: This method does not check if input parameters make sense, nor does it check if there is a chip at the resulting global (x,y)
- Parameters:
- Returns:
global (x,y) coordinates of the chip
- Return type:
- get_links_count() float [source]
Get the number of links from the machine.
Links are assumed to be bidirectional so the total links counted is half of the unidirectional links found.
SpiNNaker and FPGA links are not included.
- Returns:
n_links; fractional parts indicate partial link problems
- Return type:
- abstract get_local_xy(chip: Chip) XY [source]
Converts the x and y coordinates into the local coordinates on the board as if the Ethernet-enabled chip was at position 0,0.
This method does take wrap-arounds into consideration.
This method assumes that chip is on the machine or is a copy of a chip on the machine
- get_spinnaker_link_with_id(spinnaker_link_id: int, board_address: str | None = None, chip_coords: Tuple[int, int] | None = None) SpinnakerLinkData [source]
Get a SpiNNaker link with a given ID.
- Parameters:
spinnaker_link_id (int) – The ID of the link
board_address (str or None) – optional board address that this SpiNNaker link is associated with. This is ignored if chip_coords is not None. If this is None and chip_coords is None, the boot board will be assumed.
chip_coords (tuple(int, int) or None) – optional chip coordinates that this SpiNNaker link is associated with. If this is None and board_address is None, the boot board will be assumed.
- Returns:
The SpiNNaker link data
- Return type:
- get_unused_xy() Tuple[int, int] [source]
Finds an unused (x,y) coordinate on this machine.
This method will not return an (x,y) of an existing chip
This method will not return an (x,y) on any existing board even if that chip does not exist, i.e., it will not return (x,y) of a known dead chip.
It will however return the same unused_xy until a chip is added at that location.
- abstract get_vector(source: Tuple[int, int], destination: Tuple[int, int]) Tuple[int, int, int] [source]
Get mathematical shortest vector (x, y, z) from source to destination. The z direction uses the diagonal inter-chip links; (0,0,1) is equivalent to (1,1,0) in terms of where it reaches but uses a more efficient route.
This method does not check if the chips and links it assumes to take actually exist. For example long paths along a non-wrapping edge may well travel through the missing area.
This method does take wrap-arounds into consideration as applicable.
From https://github.com/project-rig/rig/blob/master/rig/geometry.py Described in http://jhnet.co.uk/articles/torus_paths
Use the same algorithm as vector_length using the best x, y pair as minimize(x, y, 0)
- abstract get_vector_length(source: Tuple[int, int], destination: Tuple[int, int]) int [source]
Get the mathematical length of the shortest vector (x, y, z) from source to destination.
Use the same algorithm as vector to find the best x, y pair but then is optimised to directly calculate length
This method does not check if the chips and links it assumes to take actually exist. For example long paths along a non-wrapping edge may well travel through the missing area.
This method does take wrap-arounds into consideration as applicable.
From https://github.com/project-rig/rig/blob/master/rig/geometry.py Described in http://jhnet.co.uk/articles/torus_paths
On full wrap-around machines (before minimisation) the vectors can have any of the 4 combinations of positive and negative x and y The positive one is: destination - source % dimension The negative one is: positive - dimension If source is less than dimension the negative one is the wrap around If destination is greater than source the positive one wraps
One no wrap or part wrap boards the x/y that does not wrap is just destination - source
The length of vectors where both x and y have the same sign will be max(abs(x), abs(y)). As the z direction can be used in minimisation The length of vectors where x and y have opposite signs will be abs(x) and abs(y) as these are already minimum so z is not used.
Warning
GIGO: This method does not check if input parameters make sense.
- abstract get_xy_cores_by_ethernet(ethernet_x: int, ethernet_y: int) Iterable[Tuple[Tuple[int, int], int]] [source]
Yields the potential (x,y) locations and the typical number of cores of all the chips on the board with this Ethernet-enabled chip.
Includes the Ethernet-enabled chip itself.
Wrap-arounds are handled as appropriate.
Note
This method does not check if the chip actually exists, nor report the actual number of cores on this chip, as is intended to be called to create the chips.
The number of cores is based on the 1,000,000 core machine where the board where built with the the 17 core chips placed in the same location on nearly every board.
Warning
GIGO! This methods assumes that ethernet_x and ethernet_y are the local 0,0 of an existing board, within the width and height of the machine.
- Parameters:
- Returns:
Yields ((x, y), n_cores) where x, y are coordinates of all the potential chips on this board, and n_cores is the typical number of cores for a chip in that position.
- Return type:
- abstract get_xys_by_ethernet(ethernet_x: int, ethernet_y: int) Iterable[Tuple[int, int]] [source]
Yields the potential x,y locations of all the chips on the board with this Ethernet-enabled chip. Including the Ethernet-enabled chip itself.
Wrap-arounds are handled as appropriate.
Note
This method does not check if the chip actually exists as is intended to be called to create the chips.
Warning
GIGO! This methods assumes that ethernet_x and ethernet_y are the local 0,0 of an existing board, within the width and height of the machine.
- is_chip_at(x: int, y: int) bool [source]
Determine if a chip exists at the given coordinates. Also implemented as
__contains__((x, y))
- is_link_at(x: int, y: int, link: int) bool [source]
Determine if a link exists at the given coordinates.
- property local_xys: Iterable[Tuple[int, int]]
Provides a list of local (x,y) coordinates for a perfect board on this machine.
Local (x,y)s never include wrap-arounds.
Note
No check is done to see if any board in the machine actually has a chip with this local (x, y).
- property min_n_router_enteries: int
The minimum number of router_enteries found on any Chip
- Returns:
The lowest n router entry found on any Router
- Return type:
- property spinnaker_links: Iterator[Tuple[Tuple[str | Tuple[int, int], int], SpinnakerLinkData]]
The set of SpiNNaker links in the machine.
- Return type:
iterable(tuple(tuple(str,int), SpinnakerLinkData))
- summary_string() str [source]
Gets a summary of the Machine and logs warnings for weirdness
- Returns:
A String describing the Machine
- Raises:
IndexError – If there are no Chips in the MAchine
AttributeError – If there is no boot chip
- property total_available_user_cores: int
The total number of cores on the machine which are not monitor cores.
- Return type:
- property total_cores: int
The total number of cores on the machine, including monitors.
- Return type:
- unreachable_incoming_chips() List[Tuple[int, int]] [source]
Detects chips that are not reachable from any of their neighbours.
Current implementation does not deal with group of unreachable chips.
- unreachable_incoming_local_chips() List[Tuple[int, int]] [source]
Detects chips that are not reachable from any of their local neighbours.
Current implementation does not deal with group of unreachable chips.
- unreachable_outgoing_chips() List[Tuple[int, int]] [source]
Detects chips that can not reach any of their neighbours.
Current implementation does not deal with group of unreachable chips.
- unreachable_outgoing_local_chips() List[Tuple[int, int]] [source]
Detects chips that can not reach any of their local neighbours.
Current implementation does not deal with group of unreachable chips.
- validate() None [source]
Validates the machine and raises an exception in unexpected conditions.
Assumes that at the time this is called all chips are on the board.
This allows the checks to be avoided when creating a virtual machine (Except of course in testing)
- Raises:
An Error is raised if there is a chip with a x outside of the range 0 to width -1.
An Error is raised if there is a chip with a y outside of the range 0 to height -1.
An Error is raise if there is no chip at the declared Ethernet-enabled chip x and y.
An Error is raised if an Ethernet-enabled chip is not at a local 0,0.
An Error is raised if there is no Ethernet-enabled chip is at 0,0.
An Error is raised if this is a unexpected multiple board situation.
- where_is_chip(chip: Chip) str [source]
Returns global and local location for this chip.
This method assumes that chip is on the machine or is a copy of a chip on the machine.
- abstract xy_over_link(x: int, y: int, link: int) Tuple[int, int] [source]
Get the potential (x,y) location of the chip reached over this link.
Wrap-arounds are handled as appropriate.
Note
This method does not check if either chip source or destination actually exists as is intended to be called to create the links.
It is the callers responsibility to check the validity of this call before making it or the validity of the result.
Warning
GIGO! This methods assumes that x and y are within the width and height of the machine, and that the link goes to another chip on the machine.
On machine without full wrap-around it is possible that this method generates (x,y) values that fall outside of the legal values including negative values, x = width or y = height.
- Parameters:
- Returns:
x and y coordinates of the chip over that link if it is valid or some fictional (x,y) if not.
- Return type:
- class spinn_machine.MulticastRoutingEntry(key: int, mask: int, routing_entry: RoutingEntry)[source]
Represents an entry in a SpiNNaker chip’s routing table, including the key and mask
- Parameters:
- property defaultable: bool
Whether this entry is a defaultable entry. An entry is defaultable if it is duplicating the default behaviour of the SpiNNaker router (to pass a message out on the link opposite from where it was received, without routing it to any processors; source and destination chips for a message cannot be defaultable).
- Return type:
- merge(other: MulticastRoutingEntry) MulticastRoutingEntry [source]
Merges together two multicast routing entries. The entry to merge must have the same key and mask. The merge will join the processor IDs and link IDs from both the entries. This could be used to add a new destination to an existing route in a routing table. It is also possible to use the add (+) operator or the or (|) operator with the same effect.
- Parameters:
other (MulticastRoutingEntry) – The multicast entry to merge with this entry
- Returns:
A new multicast routing entry with merged destinations
- Return type:
- Raises:
spinn_machine.exceptions.SpinnMachineInvalidParameterException – If the key and mask of the other entry do not match
- class spinn_machine.Router(links: Iterable[Link], n_available_multicast_entries: int)[source]
Represents a router of a chip, with a set of available links. The router is iterable over the links, providing (source_link_id, link) where:
source_link_id
is the ID of a linklink
is theLink
with IDsource_link_id
- Parameters:
- Raises:
SpinnMachineAlreadyExistsException – If any two links have the same
source_link_id
- add_link(link: Link)[source]
Add a link to the router of the chip.
- Parameters:
link (Link) – The link to be added
- Raises:
SpinnMachineAlreadyExistsException – If another link already exists with the same
source_link_id
- static convert_routing_table_entry_to_spinnaker_route(routing_table_entry: MulticastRoutingEntry | RoutingEntry) int [source]
Convert a routing table entry represented in software to a binary routing table entry usable on the machine.
- Parameters:
routing_table_entry (MulticastRoutingEntry or RoutingEntry) – The entry to convert
- Return type:
- static convert_spinnaker_route_to_routing_ids(route: int) Tuple[List[int], List[int]] [source]
Convert a binary routing table entry usable on the machine to lists of route IDs usable in a routing table entry represented in software.
- get_link(source_link_id: int) Link | None [source]
Get the link with the given ID, or None if no such link. Also implemented as
__getitem__(source_link_id)
- get_neighbouring_chips_coords() List[Dict[str, int]] [source]
Utility method to convert links into x and y coordinates.
- is_link(source_link_id: int) bool [source]
Determine if there is a link with ID source_link_id. Also implemented as
__contains__(source_link_id)
- property n_available_multicast_entries: int
The number of available multicast entries in the routing tables.
- Return type:
- class spinn_machine.RoutingEntry(*, processor_ids: int | Collection[int], link_ids: int | Collection[int], incoming_processor: int | None = None, incoming_link: int | None = None, defaultable: None = None, spinnaker_route: None = None)[source]
- class spinn_machine.RoutingEntry(*, processor_ids: None = None, link_ids: None = None, incoming_processor: None = None, incoming_link: None = None, defaultable: bool | None = False, spinnaker_route: int)
Represents an entry in a SpiNNaker chip’s multicast routing table.
Note
The processor_ids and link_ids parameters are only optional if a spinnaker_route is provided. If a spinnaker_route is provided the processor_ids and link_ids parameters are ignored.
- Parameters:
processor_ids (iterable(int) or None) – The destination processor IDs
link_ids (iterable(int) or None) – The destination link IDs
defaultable (bool) – If this entry is defaultable (it receives packets from its directly opposite route position)
spinnaker_route (int or None) – The processor_ids and link_ids expressed as a single int.
- Raises:
spinn_machine.exceptions.SpinnMachineAlreadyExistsException –
If processor_ids contains the same ID more than once
If link_ids contains the same ID more than once
TypeError – if no spinnaker_route provided and either processor_ids or link_ids is missing or None
- property defaultable: bool
Whether this entry is a defaultable entry. An entry is defaultable if it is duplicating the default behaviour of the SpiNNaker router (to pass a message out on the link opposite from where it was received, without routing it to any processors; source and destination chips for a message cannot be defaultable).
- Return type:
- merge(other: RoutingEntry) RoutingEntry [source]
Merges together two routing entries. The merge will join the processor IDs and link IDs from both the entries. This could be used to add a new destination to an existing route in a routing table. It is also possible to use the add (+) operator or the or (|) operator with the same effect.
- Parameters:
other (MulticastRoutingEntry) – The multicast entry to merge with this entry
- Returns:
A new multicast routing entry with merged destinations
- Return type:
- Raises:
spinn_machine.exceptions.SpinnMachineInvalidParameterException – If the key and mask of the other entry do not match
- class spinn_machine.SpiNNakerTriadGeometry(triad_width: int, triad_height: int, board_width: int, board_height: int, roots: Sequence[Tuple[int, int]], centre: Tuple[float, float])[source]
Geometry of a “triad” of SpiNNaker boards.
The geometry is defined by the arguments to the constructor; the standard arrangement can be obtained from get_spinn5_geometry.
Note
The geometry defines what a Triad is in terms of the dimensions of a triad and where the Ethernet chips occur in the triad.
- Parameters:
triad_width (int) – width of a triad in chips
triad_height (int) – height of a triad in chips
board_width (int) – width of a board in chips
board_height (int) – height of a board in chips
roots (list(tuple(int, int))) – locations of the Ethernet connected chips
centre (tuple(float, float)) –
the distance from each Ethernet chip to the centre of the hexagon
Note
This is the theoretical centre, it might not be an actual chip
- get_ethernet_chip_coordinates(x: int, y: int, width: int, height: int, root_x: int = 0, root_y: int = 0) Tuple[int, int] [source]
Get the coordinates of a chip’s local Ethernet connected chip according to this triad geometry object.
Warning
local_eth_coord()
will always produce the coordinates of the Ethernet-connected SpiNNaker chip on the same SpiNN-5 board as the supplied chip. This chip may not actually be working.- Parameters:
x (int) – x-coordinate of the chip to find the nearest Ethernet of
y (int) – y-coordinate of the chip to find the nearest Ethernet of
width (int) – width of the SpiNNaker machine (must be a multiple of the triad width of this geometry)
height (int) – height of the SpiNNaker machine (must be a multiple of the triad height of this geometry)
root_x (int) – x-coordinate of the boot chip (default 0, 0)
root_y (int) – y-coordinate of the boot chip (default 0, 0)
- Returns:
The coordinates of the closest Ethernet chip
- Return type:
- get_local_chip_coordinate(x: int, y: int, root_x: int = 0, root_y: int = 0) Tuple[int, int] [source]
Get the coordinates of a chip on its board of a multi-board system relative to the Ethernet chip of the board.
Note
This function assumes the system is constructed from SpiNN-5 boards
- Parameters:
- Returns:
the coordinates of the chip relative to its board
- Return type:
- get_potential_ethernet_chips(width: int, height: int) Sequence[Tuple[int, int]] [source]
Get the coordinates of chips that should be Ethernet chips
- static get_spinn5_geometry() SpiNNakerTriadGeometry [source]
Get the geometry object for a SpiNN-5 arrangement of boards
- Returns:
a
SpiNNakerTriadGeometry
object.
- spinn_machine.virtual_machine(width: int, height: int, validate: bool = True)[source]
Create a virtual SpiNNaker machine, used for planning execution.
Contents¶
- spinn_machine
- spinn_machine package
- Subpackages
- spinn_machine.data package
- Submodules
- spinn_machine.data.machine_data_writer module
- Module contents
MachineDataView
MachineDataView.get_all_monitor_cores()
MachineDataView.get_chip_at()
MachineDataView.get_ethernet_monitor_cores()
MachineDataView.get_machine()
MachineDataView.get_machine_version()
MachineDataView.get_nearest_ethernet()
MachineDataView.get_physical_core_id()
MachineDataView.get_physical_quad()
MachineDataView.get_physical_string()
MachineDataView.has_existing_machine()
MachineDataView.has_machine()
MachineDataView.set_v_to_p_map()
MachineDataView.where_is_chip()
MachineDataView.where_is_xy()
- spinn_machine.ignores package
- spinn_machine.link_data_objects package
- spinn_machine.tags package
- spinn_machine.version package
- Submodules
- spinn_machine.version.abstract_version module
AbstractVersion
AbstractVersion.board_shape
AbstractVersion.chip_core_map
AbstractVersion.clock_speeds_hz
AbstractVersion.create_machine()
AbstractVersion.dtcm_bytes
AbstractVersion.expected_xys
AbstractVersion.fpga_links()
AbstractVersion.get_potential_ethernet_chips()
AbstractVersion.id_to_qx_qy_qp()
AbstractVersion.illegal_ethernet_message()
AbstractVersion.max_cores_per_chip
AbstractVersion.max_sdram_per_chip
AbstractVersion.minimum_cores_expected
AbstractVersion.n_chips_per_board
AbstractVersion.n_router_entries
AbstractVersion.n_scamp_cores
AbstractVersion.name
AbstractVersion.number
AbstractVersion.parse_cores_string()
AbstractVersion.quads_maps()
AbstractVersion.qx_qy_qp_to_id()
AbstractVersion.size_from_n_boards()
AbstractVersion.size_from_n_chips()
AbstractVersion.size_from_n_cores()
AbstractVersion.spinnaker_links()
AbstractVersion.supports_multiple_boards
AbstractVersion.verify_size()
AbstractVersion.version_parse_cores_string()
- spinn_machine.version.vec2mesh_reader module
- spinn_machine.version.version_201 module
- spinn_machine.version.version_248 module
- spinn_machine.version.version_3 module
- spinn_machine.version.version_48_chips module
- spinn_machine.version.version_5 module
- spinn_machine.version.version_spin1 module
- spinn_machine.version.version_spin2 module
- spinn_machine.version.version_strings module
- Module contents
- spinn_machine.data package
- Submodules
- spinn_machine.config_setup module
- spinn_machine.exceptions module
- spinn_machine.full_wrap_machine module
FullWrapMachine
FullWrapMachine.concentric_xys()
FullWrapMachine.get_down_xys_by_ethernet()
FullWrapMachine.get_existing_xys_by_ethernet()
FullWrapMachine.get_global_xy()
FullWrapMachine.get_local_xy()
FullWrapMachine.get_vector()
FullWrapMachine.get_vector_length()
FullWrapMachine.get_xy_cores_by_ethernet()
FullWrapMachine.get_xys_by_ethernet()
FullWrapMachine.wrap
FullWrapMachine.xy_over_link()
- spinn_machine.horizontal_wrap_machine module
HorizontalWrapMachine
HorizontalWrapMachine.concentric_xys()
HorizontalWrapMachine.get_down_xys_by_ethernet()
HorizontalWrapMachine.get_existing_xys_by_ethernet()
HorizontalWrapMachine.get_global_xy()
HorizontalWrapMachine.get_local_xy()
HorizontalWrapMachine.get_vector()
HorizontalWrapMachine.get_vector_length()
HorizontalWrapMachine.get_xy_cores_by_ethernet()
HorizontalWrapMachine.get_xys_by_ethernet()
HorizontalWrapMachine.wrap
HorizontalWrapMachine.xy_over_link()
- spinn_machine.json_machine module
- spinn_machine.machine_factory module
- spinn_machine.no_wrap_machine module
NoWrapMachine
NoWrapMachine.concentric_xys()
NoWrapMachine.get_down_xys_by_ethernet()
NoWrapMachine.get_existing_xys_by_ethernet()
NoWrapMachine.get_global_xy()
NoWrapMachine.get_local_xy()
NoWrapMachine.get_vector()
NoWrapMachine.get_vector_length()
NoWrapMachine.get_xy_cores_by_ethernet()
NoWrapMachine.get_xys_by_ethernet()
NoWrapMachine.wrap
NoWrapMachine.xy_over_link()
- spinn_machine.vertical_wrap_machine module
VerticalWrapMachine
VerticalWrapMachine.concentric_xys()
VerticalWrapMachine.get_down_xys_by_ethernet()
VerticalWrapMachine.get_existing_xys_by_ethernet()
VerticalWrapMachine.get_global_xy()
VerticalWrapMachine.get_local_xy()
VerticalWrapMachine.get_vector()
VerticalWrapMachine.get_vector_length()
VerticalWrapMachine.get_xy_cores_by_ethernet()
VerticalWrapMachine.get_xys_by_ethernet()
VerticalWrapMachine.wrap
VerticalWrapMachine.xy_over_link()
- Module contents
- Functional Requirements
- Use Cases
Chip
Chip.all_processor_ids
Chip.ip_address
Chip.is_processor_with_id()
Chip.n_placable_processors
Chip.n_processors
Chip.n_scamp_processors
Chip.nearest_ethernet_x
Chip.nearest_ethernet_y
Chip.parent_link
Chip.placable_processors_ids
Chip.router
Chip.scamp_processors_ids
Chip.sdram
Chip.tag_ids
Chip.x
Chip.y
CoreSubset
CoreSubsets
FrozenCoreSubsets
Link
Machine
Machine.LINK_ADD_TABLE
Machine.add_chip()
Machine.add_chips()
Machine.add_fpga_links()
Machine.add_spinnaker_links()
Machine.boot_chip
Machine.chip_coordinates
Machine.chips
Machine.concentric_xys()
Machine.ethernet_connected_chips
Machine.get_chip_at()
Machine.get_chips_by_ethernet()
Machine.get_cores_count()
Machine.get_down_xys_by_ethernet()
Machine.get_existing_xys_by_ethernet()
Machine.get_existing_xys_on_board()
Machine.get_fpga_link_with_id()
Machine.get_global_xy()
Machine.get_links_count()
Machine.get_local_xy()
Machine.get_spinnaker_link_with_id()
Machine.get_unused_xy()
Machine.get_vector()
Machine.get_vector_length()
Machine.get_xy_cores_by_ethernet()
Machine.get_xys_by_ethernet()
Machine.height
Machine.is_chip_at()
Machine.is_link_at()
Machine.local_xys
Machine.min_n_router_enteries
Machine.n_chips
Machine.one_way_links()
Machine.spinnaker_links
Machine.summary_string()
Machine.total_available_user_cores
Machine.total_cores
Machine.unreachable_incoming_chips()
Machine.unreachable_incoming_local_chips()
Machine.unreachable_outgoing_chips()
Machine.unreachable_outgoing_local_chips()
Machine.validate()
Machine.where_is_chip()
Machine.where_is_xy()
Machine.width
Machine.wrap
Machine.xy_over_link()
MulticastRoutingEntry
Router
Router.LINK_OPPOSITE
Router.MAX_CORES_PER_ROUTER
Router.MAX_LINKS_PER_ROUTER
Router.add_link()
Router.convert_routing_table_entry_to_spinnaker_route()
Router.convert_spinnaker_route_to_routing_ids()
Router.get_link()
Router.get_neighbouring_chips_coords()
Router.is_link()
Router.links
Router.n_available_multicast_entries
Router.opposite()
RoutingEntry
SpiNNakerTriadGeometry
virtual_machine()
- Subpackages
- spinn_machine package