java.lang.Object
uk.ac.manchester.spinnaker.messages.model.P2PTable

public class P2PTable extends Object
Represents a P2P routing table read from the machine.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final @uk.ac.manchester.spinnaker.machine.ValidMachineHeight int
    The height of the machine that this table represents.
    final @uk.ac.manchester.spinnaker.machine.ValidMachineWidth int
    The width of the machine that this table represents.
  • Constructor Summary

    Constructors
    Constructor
    Description
    P2PTable(MachineDimensions dimensions, Collection<ByteBuffer> columnData)
    Construct a routing table from data.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns The coordinates of chips in the table.
    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.
    Get the route to follow from this chip to the given chip.
    boolean
    Determines if there is a route in the P2P table to the given chip.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • width

      @ValidMachineWidth public final @uk.ac.manchester.spinnaker.machine.ValidMachineWidth int width
      The width of the machine that this table represents.
    • height

      @ValidMachineHeight public final @uk.ac.manchester.spinnaker.machine.ValidMachineHeight int height
      The height of the machine that this table represents.
  • Constructor Details

    • P2PTable

      public P2PTable(MachineDimensions dimensions, Collection<ByteBuffer> columnData)
      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

      public Set<ChipLocation> getChips()
      Returns The coordinates of chips in the table.
      Returns:
      The coordinates of chips in the table
    • isRoute

      public boolean isRoute(HasChipLocation chip)
      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

      public P2PTableRoute getRoute(HasChipLocation chip)
      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.