Class P2PTable
java.lang.Object
uk.ac.manchester.spinnaker.messages.model.P2PTable
Represents a P2P routing table read from the machine.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionP2PTable
(MachineDimensions dimensions, Collection<ByteBuffer> columnData) Construct a routing table from data. -
Method Summary
Modifier and TypeMethodDescriptiongetChips()
static int
getColumnOffset
(int column) Get the offset of the next column in the table from the P2P base address.static int
getNumColumnBytes
(int height) Get the number of bytes to be read for each column of the table.getRoute
(HasChipLocation chip) Get the route to follow from this chip to the given chip.boolean
isRoute
(HasChipLocation chip) Determines if there is a route in the P2P table to the given chip.
-
Field Details
-
width
The width of the machine that this table represents. -
height
The height of the machine that this table represents.
-
-
Constructor Details
-
P2PTable
Construct a routing table from data.- Parameters:
dimensions
- The size of the machine.columnData
- The routing data to parse.
-
-
Method Details
-
getNumColumnBytes
public static int getNumColumnBytes(int height) Get the number of bytes to be read for each column of the table.- Parameters:
height
- The height of the machine- Returns:
- The number of bytes for the column
-
getColumnOffset
public static int getColumnOffset(int column) Get the offset of the next column in the table from the P2P base address.- Parameters:
column
- The column to be read- Returns:
- Where the column is located within the table.
-
getChips
- Returns:
- The coordinates of chips in the table.
-
isRoute
Determines if there is a route in the P2P table to the given chip.- Parameters:
chip
- The coordinates of the chip to look up.- Returns:
- True if anything in the table routes to the chip.
-
getRoute
Get the route to follow from this chip to the given chip.- Parameters:
chip
- The coordinates of the chip to find the route to- Returns:
- Get the route descriptor for a chip.
-