Machine etc.: Machine resource availability P&R data structure

class rig.place_and_route.Machine(width, height, chip_resources={Cores: 18, SDRAM: 134217728, SRAM: 32768}, chip_resource_exceptions={}, dead_chips=set([]), dead_links=set([]))[source]

Defines the resources available in a SpiNNaker machine.

This datastructure makes the assumption that in most systems almost everything is uniform and working.

This data-structure intends to be completely transparent. Its contents are described below. A number of utility methods are available but should be considered just that: utilities.

Note

In early versions of Rig this object was called rig.machine.Machine.

Attributes:
width : int

The width of the system in chips: chips will thus have x-coordinates between 0 and width-1 inclusive.

height : int

The height of the system in chips: chips will thus have y-coordinates between 0 and height-1 inclusive.

chip_resources : {resource_key: requirement, …}

The resources available on chips (unless otherwise stated in chip_resource_exceptions). `resource_key must be some unique identifying object for a given resource. requirement must be a positive numerical value. For example: {Cores: 17, SDRAM: 128*1024*1024} would indicate 17 cores and 128 MBytes of SDRAM.

chip_resource_exceptions : {(x,y): resources, …}

If any chip’s resources differ from those specified in chip_resources, an entry in this dictionary with the key being the chip’s coordinates as a tuple (x, y) and resources being a dictionary of the same format as chip_resources. Note that every exception must specify exactly the same set of keys as chip_resources.

dead_chips : set

A set of (x,y) tuples enumerating all chips which completely unavailable. Links leaving a dead chip are implicitly marked as dead.

dead_links : set

A set (x,y,link) where x and y are a chip’s coordinates and link is a value from the Enum Links. Note that links have two directions and both should be defined if a link is dead in both directions (the typical case).

__init__(width, height, chip_resources={Cores: 18, SDRAM: 134217728, SRAM: 32768}, chip_resource_exceptions={}, dead_chips=set([]), dead_links=set([]))[source]

Defines the resources available within a SpiNNaker system.

Parameters:
width : int
height : int
chip_resources : {resource_key: requirement, …}
chip_resource_exceptions : {(x,y): resources, …}
dead_chips : set([(x,y,p), …])
dead_links : set([(x,y,link), …])
copy()[source]

Produce a copy of this datastructure.

__eq__(other)[source]

Test whether this Machine describes the same machine as another.

__ne__(other)[source]

x.__ne__(y) <==> x!=y

issubset(other)[source]

Test whether the resources available in this machine description are a (non-strict) subset of those available in another machine.

Note

This test being False does not imply that the this machine is a superset of the other machine; machines may have disjoint resources.

__contains__(chip_or_link)[source]

Test if a given chip or link is present and alive.

Parameters:
chip_or_link : tuple

If of the form (x, y, link), checks a link. If of the form (x, y), checks a core.

__getitem__(xy)[source]

Get the resources available to a given chip.

Raises:
IndexError

If the given chip is dead or not within the bounds of the system.

__setitem__(xy, resources)[source]

Specify the resources available to a given chip.

Raises:
IndexError

If the given chip is dead or not within the bounds of the system.

__iter__()[source]

Iterate over the working chips in the machine.

Generates a series of (x, y) tuples.

__weakref__

list of weak references to the object (if defined)

An iterator over the working links in the machine.

Generates a series of (x, y, link) tuples.

Test if a machine has wrap-around connections installed.

Since the Machine object does not explicitly define whether a machine has wrap-around links they must be tested for directly. This test performs a “fuzzy” test on the number of wrap-around links which are working to determine if wrap-around links are really present.

Parameters:
minimum_working : 0.0 <= float <= 1.0

The minimum proportion of all wrap-around links which must be working for this function to return True.

Returns:
bool

True if the system has wrap-around links, False if not.

rig.place_and_route.Cores = Cores

Resource identifier for (monitor and application) processor cores.

Note that this identifier does not trigger any kind of special-case behaviour in library functions. Users are free to define their own alternatives.

In early versions of Rig this object was called rig.machine.Cores.

rig.place_and_route.SDRAM = SDRAM

Resource identifier for shared off-die SDRAM (in bytes).

Note that this identifier does not trigger any kind of special-case behaviour in library functions. Users are free to define their own alternatives.

Note

In early versions of Rig this object was called rig.machine.SDRAM.

rig.place_and_route.SRAM = SRAM

Resource identifier for shared on-die SRAM (in bytes).

Note that this identifier does not trigger any kind of special-case behaviour in library functions. Users are free to define their own alternatives.

Note

In early versions of Rig this object was called rig.machine.SRAM.