spinn_machine.version package

Submodules

spinn_machine.version.abstract_version module

class spinn_machine.version.abstract_version.AbstractVersion(max_cores_per_chip: int, max_sdram_per_chip: int)[source]

Bases: object

Base class for the version classes.

Version classes are the main way to create a Machine object of the correct class.

The version classes contain properties that will change depending on the version.

abstract property board_shape: Tuple[int, int]

The width and height of a single board of this type

abstract property chip_core_map: Mapping[Tuple[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.

Return type:

dict((int, int), int)

abstract property clock_speeds_hz: List[int]

The processor clock speeds in Hz this processor can run at

Return type:

int

create_machine(width: int | None, height: int | None, origin: str | None = None) Machine[source]

Creates a new empty machine based on the width, height and version.

Parameters:
  • width (int) – The width of the machine excluding any virtual chips

  • height (int) – The height of the machine excluding any virtual chips

  • origin (str or None) – Extra information about how this machine was created to be used in str(version). Example “Virtual” or “Json

Returns:

A subclass of Machine with no chips in it

Return type:

Machine

Raises:

SpinnMachineInvalidParameterException – If the size is unexpected

abstract property dtcm_bytes: int

The Data Tightly Coupled Memory available on a processor in bytes

Return type:

int

property expected_xys: Sequence[Tuple[int, int]]

List of the standard x,y coordinates of chips for this version.

Remember that will the board may have dead or excluded chips.

Returns:

The list of Local X, Y, link, fpga_link_id and fpga_id

These are applied local to each Ethernet Chip and even if the link is connected to another board

Return type:

List((int, int, int, int, int))

abstract get_potential_ethernet_chips(width: int, height: int) Sequence[Tuple[int, int]][source]

Get the coordinates of chips that should be Ethernet chips.

This may well be passed down to SpiNNakerTriadGeometry.

Note

This methods assumes that width and height would pass verify_size(). If not, the results may be wrong.

Parameters:
  • width (int) – The width of the machine to find the chips in

  • height (int) – The height of the machine to find the chips in

Return type:

list(tuple(int, int))

abstract illegal_ethernet_message(x: int, y: int) str | None[source]

Checks if x and y could be for an Ethernet.

This method will return an explanation if the values for x and y are known be illegal for an Ethernet chip.

Due to the limited information available this method will generate False negatives. So this method returning None does not imply that x, y is an Ethernet location

Parameters:
Returns:

An explanation that the x and y can never be an Ethernet

property max_cores_per_chip: int

Gets the maximum number of cores per chip for the whole system.

There is no guarantee that there will be any chips with this many cores, only that there will be no cores with more.

Return type:

int

property max_sdram_per_chip: int

Gets the maximum SDRAM per chip for the whole system.

While it is likely that all Chips will have this SDRAM this should not be counted on. Ask each Chip for its SDRAM.

Returns:

the default SDRAM per chip

Return type:

int

abstract property minimum_cores_expected: int

The minimum number of Chip that we expect from a Chip

If there are less that this number of Cores Machine.validate and other methods are allowed to raise an exception

Return type:

int

Returns:

The lowest number of cores to accept before flagging a Chip to be blacklisted

property n_chips_per_board: int

The normal number of chips on each board of this version.

Remember that will the board may have dead or excluded chips.

Return type:

int

abstract property n_router_entries: int

The standard number of router entries in a router table.

While it is likely that all chips will have this number it should not be counted on. Ask each chip’s router for the correct value.

Return type:

int

abstract property n_scamp_cores: int

The number of scamp cores per chip.

Return type:

int

abstract property name: str

The name of the specific version.

Return type:

str

abstract property number: int

The version number that produced this Version.

Return type:

int

size_from_n_boards(n_boards: int) Tuple[int, int][source]

Returns the size needed to support this many boards.

Parameters:

n_boards (int)

Return type:

(int, int)

Raises:

SpinnMachineException – If multiple boards are needed but not supported

size_from_n_chips(n_chips: int) Tuple[int, int][source]

Returns the size needed to support this many chips.

Designed for use with virtual boards. Does not include a safety factor for blacklisted Chips. For real machines a slightly bigger Machine may be needed.

Parameters:

n_boards (int)

Return type:

(int, int)

Raises:

SpinnMachineException – If multiple boards are needed but not supported

size_from_n_cores(n_cores: int) Tuple[int, int][source]

Returns the size needed to support this many cores.

Takes into consideration scamp and monitor cores.

Designed for use with virtual boards. Does not include a safety factor for blacklisted cores or chips. For real machines a slightly bigger Machine may be needed.

Parameters:

n_cores (int) – Number of None Scamp and monitor cores needed

Return type:

(int, int)

The list of Local X, Y and link Id to add spinnaker links to

These are applied local to each Ethernet Chip and only if the link is not connected to another board

Return type:

List((int, int, int))

abstract property supports_multiple_boards: bool

Specifies if this version allows machines of more than one board

Returns:

verify_size(width: int | None, height: int | None)[source]

Checks that the width and height are allowed for this version.

Parameters:
Raises:

SpinnMachineException – If the size is unexpected

spinn_machine.version.version_201 module

class spinn_machine.version.version_201.Version201[source]

Bases: AbstractVersion

Code for the 1 Chip test Spin2 board versions

property board_shape: Tuple[int, int]

The width and height of a single board of this type

property chip_core_map: Mapping[Tuple[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.

Return type:

dict((int, int), int)

property clock_speeds_hz: List[int]

The processor clock speeds in Hz this processor can run at

Return type:

int

property dtcm_bytes: int

The Data Tightly Coupled Memory available on a processor in bytes

Return type:

int

The list of Local X, Y, link, fpga_link_id and fpga_id

These are applied local to each Ethernet Chip and even if the link is connected to another board

Return type:

List((int, int, int, int, int))

get_potential_ethernet_chips(width: int, height: int) Sequence[Tuple[int, int]][source]

Get the coordinates of chips that should be Ethernet chips.

This may well be passed down to SpiNNakerTriadGeometry.

Note

This methods assumes that width and height would pass verify_size(). If not, the results may be wrong.

Parameters:
  • width (int) – The width of the machine to find the chips in

  • height (int) – The height of the machine to find the chips in

Return type:

list(tuple(int, int))

illegal_ethernet_message(x: int, y: int) str | None[source]

Checks if x and y could be for an Ethernet.

This method will return an explanation if the values for x and y are known be illegal for an Ethernet chip.

Due to the limited information available this method will generate False negatives. So this method returning None does not imply that x, y is an Ethernet location

Parameters:
Returns:

An explanation that the x and y can never be an Ethernet

property minimum_cores_expected: int

The minimum number of Chip that we expect from a Chip

If there are less that this number of Cores Machine.validate and other methods are allowed to raise an exception

Return type:

int

Returns:

The lowest number of cores to accept before flagging a Chip to be blacklisted

property n_router_entries: int

The standard number of router entries in a router table.

While it is likely that all chips will have this number it should not be counted on. Ask each chip’s router for the correct value.

Return type:

int

property n_scamp_cores: int

The number of scamp cores per chip.

Return type:

int

property name: str

The name of the specific version.

Return type:

str

property number: int

The version number that produced this Version.

Return type:

int

The list of Local X, Y and link Id to add spinnaker links to

These are applied local to each Ethernet Chip and only if the link is not connected to another board

Return type:

List((int, int, int))

property supports_multiple_boards: bool

Specifies if this version allows machines of more than one board

Returns:

spinn_machine.version.version_3 module

class spinn_machine.version.version_3.Version3[source]

Bases: VersionSpin1

Code for the small Spin1 4 Chip boards

Covers versions 2 and 3

property board_shape: Tuple[int, int]

The width and height of a single board of this type

property chip_core_map: Mapping[Tuple[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.

Return type:

dict((int, int), int)

The list of Local X, Y, link, fpga_link_id and fpga_id

These are applied local to each Ethernet Chip and even if the link is connected to another board

Return type:

List((int, int, int, int, int))

get_potential_ethernet_chips(width: int, height: int) Sequence[Tuple[int, int]][source]

Get the coordinates of chips that should be Ethernet chips.

This may well be passed down to SpiNNakerTriadGeometry.

Note

This methods assumes that width and height would pass verify_size(). If not, the results may be wrong.

Parameters:
  • width (int) – The width of the machine to find the chips in

  • height (int) – The height of the machine to find the chips in

Return type:

list(tuple(int, int))

illegal_ethernet_message(x: int, y: int) str | None[source]

Checks if x and y could be for an Ethernet.

This method will return an explanation if the values for x and y are known be illegal for an Ethernet chip.

Due to the limited information available this method will generate False negatives. So this method returning None does not imply that x, y is an Ethernet location

Parameters:
Returns:

An explanation that the x and y can never be an Ethernet

property name: str

The name of the specific version.

Return type:

str

property number: int

The version number that produced this Version.

Return type:

int

The list of Local X, Y and link Id to add spinnaker links to

These are applied local to each Ethernet Chip and only if the link is not connected to another board

Return type:

List((int, int, int))

property supports_multiple_boards: bool

Specifies if this version allows machines of more than one board

Returns:

spinn_machine.version.version_5 module

class spinn_machine.version.version_5.Version5[source]

Bases: VersionSpin1

Code for the large Spin1 48 Chip boards

Covers versions 4 and 5

property board_shape: Tuple[int, int]

The width and height of a single board of this type

property chip_core_map: Mapping[Tuple[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.

Return type:

dict((int, int), int)

The list of Local X, Y, link, fpga_link_id and fpga_id

These are applied local to each Ethernet Chip and even if the link is connected to another board

Return type:

List((int, int, int, int, int))

get_potential_ethernet_chips(width: int, height: int) Sequence[Tuple[int, int]][source]

Get the coordinates of chips that should be Ethernet chips.

This may well be passed down to SpiNNakerTriadGeometry.

Note

This methods assumes that width and height would pass verify_size(). If not, the results may be wrong.

Parameters:
  • width (int) – The width of the machine to find the chips in

  • height (int) – The height of the machine to find the chips in

Return type:

list(tuple(int, int))

illegal_ethernet_message(x: int, y: int) str | None[source]

Checks if x and y could be for an Ethernet.

This method will return an explanation if the values for x and y are known be illegal for an Ethernet chip.

Due to the limited information available this method will generate False negatives. So this method returning None does not imply that x, y is an Ethernet location

Parameters:
Returns:

An explanation that the x and y can never be an Ethernet

property name: str

The name of the specific version.

Return type:

str

property number: int

The version number that produced this Version.

Return type:

int

size_from_n_boards(n_boards: int) Tuple[int, int][source]

Returns the size needed to support this many boards.

Parameters:

n_boards (int)

Return type:

(int, int)

Raises:

SpinnMachineException – If multiple boards are needed but not supported

The list of Local X, Y and link Id to add spinnaker links to

These are applied local to each Ethernet Chip and only if the link is not connected to another board

Return type:

List((int, int, int))

property supports_multiple_boards: bool

Specifies if this version allows machines of more than one board

Returns:

spinn_machine.version.version_spin1 module

class spinn_machine.version.version_spin1.VersionSpin1[source]

Bases: AbstractVersion

Shared code for all Spin1 board versions

property clock_speeds_hz: List[int]

The processor clock speeds in Hz this processor can run at

Return type:

int

property dtcm_bytes: int

The Data Tightly Coupled Memory available on a processor in bytes

Return type:

int

property minimum_cores_expected: int

The minimum number of Chip that we expect from a Chip

If there are less that this number of Cores Machine.validate and other methods are allowed to raise an exception

Return type:

int

Returns:

The lowest number of cores to accept before flagging a Chip to be blacklisted

property n_router_entries: int

The standard number of router entries in a router table.

While it is likely that all chips will have this number it should not be counted on. Ask each chip’s router for the correct value.

Return type:

int

property n_scamp_cores: int

The number of scamp cores per chip.

Return type:

int

spinn_machine.version.version_strings module

class spinn_machine.version.version_strings.VersionStrings(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

A description of strings in cfg settings to say test versions

As additional Versions are added this should allow easy testing of these as far as possible.

ANY = 1
BIG = 3
FOUR_PLUS = 2
MULTIPLE_BOARDS = 4
WRAPPABLE = 5
classmethod from_string(value: str) VersionStrings[source]

Gets a VersionString object from a String

Parameters:

value (str)

Return type:

VersionStrings

property options: List[int]

The list of the versions covered by this string

This list can grow as new versions are added

Return type:

list(int)

property short_str: str

The text but in a shortened version

This makes the text lower case and removes some special characters

Return type:

str

classmethod shorten(value: str) str[source]

Makes the String lower case and removes some special characters

Parameters:

value (str)

Return type:

str

Module contents

spinn_machine.version.version_factory() AbstractVersion

Creates a Machine Version class based on cfg settings.

Returns:

A subclass of AbstractVersion

Raises:

SpinnMachineException – If the cfg version is not set correctly