Class Transceiver
- All Implemented Interfaces:
Closeable
,AutoCloseable
,BMPTransceiverInterface
,RetryTracker
,TransceiverInterface
public class Transceiver extends UDPTransceiver implements TransceiverInterface, RetryTracker
The methods of this class are designed to be thread-safe; thus you can make multiple calls to the same (or different) methods from multiple threads and expect each call to work as if it had been called sequentially, although the order of returns is not guaranteed. Note also that with multiple connections to the board, using multiple threads in this way may result in an increase in the overall speed of operation, since the multiple calls may be made separately over the set of given connections.
For details of thread safety, see the methods annotated with
ParallelSafe
, ParallelSafeWithCare
and ParallelUnsafe
in TransceiverInterface
. Note that operations on an individual
BMP are always parallel-unsafe, other documentation in this
class notwithstanding; BMPs must only ever have one outstanding call made to
them as they do not handle asynchronous calls at all well due to known
firmware bugs.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Transceiver.ConnectionDescriptor
A simple description of a connnection to create.Nested classes/interfaces inherited from interface uk.ac.manchester.spinnaker.transceiver.BMPTransceiverInterface
BMPTransceiverInterface.FPGAResetType
-
Field Summary
Fields inherited from interface uk.ac.manchester.spinnaker.transceiver.TransceiverInterface
BOARD_BOOT_RETRIES, DEFAULT_CHECK_INTERVAL, DEFAULT_ERROR_STATES, DEFAULT_POLL_INTERVAL, LAUNCH_DELAY, TIMEOUT_DISABLED
-
Constructor Summary
Constructors Constructor Description Transceiver(InetAddress hostname, MachineVersion version)
Create a Transceiver by creating a UDPConnection to the given hostname on port 17893 (the default SCAMP port), and a BootConnection on port 54321 (the default boot port), discovering any additional links using the UDPConnection, and then returning the transceiver created with the conjunction of the created UDPConnection and the discovered connections.Transceiver(InetAddress host, MachineVersion version, Collection<BMPConnectionData> bmpConnectionData, Integer numberOfBoards, Set<ChipLocation> ignoredChips, Map<ChipLocation,Set<Integer>> ignoredCores, Map<ChipLocation,EnumSet<Direction>> ignoredLinks, boolean autodetectBMP, List<Transceiver.ConnectionDescriptor> scampConnections, Integer bootPortNumber, Integer maxSDRAMSize)
Create a Transceiver by creating a UDPConnection to the given hostname on port 17893 (the default SCAMP port), and a BootConnection on port 54321 (the default boot port), optionally discovering any additional links using the UDPConnection, and then returning the transceiver created with the conjunction of the created UDPConnection and the discovered connections.Transceiver(MachineVersion version, Collection<Connection> connections)
Create a transceiver.Transceiver(MachineVersion version, Collection<Connection> connections, Collection<ChipLocation> ignoredChips, Map<ChipLocation,Set<Integer>> ignoredCores, Map<ChipLocation,EnumSet<Direction>> ignoredLinks, Collection<Transceiver.ConnectionDescriptor> scampConnections, Integer maxSDRAMSize)
Create a transceiver. -
Method Summary
Modifier and Type Method Description protected void
addConnection(Connection connection)
Add a connection to the collection of general connections managed by this class.MappableIterable<BMPBoard>
availableBoards(BMPCoords bmp)
List which boards are actually available to be manipulated by a particular BMP.void
bind(BMPCoords bmp)
Set the default BMP coordinates, at least for cabinet and frame.void
bootBoard(Map<SystemVariableDefinition,Object> extraBootValues)
Attempt to boot the board.void
clearIobuf(CoreSubsets coreSubsets)
Clear the contents of the IOBUF buffer for a collection of processors.void
clearIPTag(int tag, InetAddress boardAddress)
Clear the setting of an IP tag.void
clearMulticastRoutes(HasChipLocation chip)
Remove all the multicast routes on a chip.void
clearReinjectionQueues(CoreSubsets monitorCores)
Clear the packet reinjection queues in some monitor processes.void
clearReinjectionQueues(HasCoreLocation monitorCore)
Clear the packet reinjection queues in a monitor process.void
clearRouterDiagnosticCounters(HasChipLocation chip, boolean enable, Iterable<Integer> counterIDs)
Clear router diagnostic information on a chip.void
close()
Close the transceiver and any threads that are running.void
close(boolean closeOriginalConnections, boolean powerOffMachine)
Close the transceiver and any threads that are running.SCPConnection
createScpConnection(ChipLocation chip, InetAddress addr)
Create a connection to a particular instance of SCAMP.List<SCPConnection>
discoverScampConnections()
Find connections to the board and store these for future use.void
enableWatchDogTimerOnChip(HasChipLocation chip, boolean watchdog)
Enable or disable the watch dog timer on a specific chip.VersionInfo
ensureBoardIsReady(int numRetries, Map<SystemVariableDefinition,Object> extraBootValues)
Ensure that the board is ready to interact with this version of the transceiver.void
execute(HasChipLocation chip, Collection<Integer> processors, File executable, AppID appID, boolean wait)
Start an executable running on a single chip.void
execute(HasChipLocation chip, Collection<Integer> processors, InputStream executable, int numBytes, AppID appID, boolean wait)
Start an executable running on a single chip.void
execute(HasChipLocation chip, Collection<Integer> processors, ByteBuffer executable, AppID appID, boolean wait)
Start an executable running on a single chip.void
executeFlood(CoreSubsets coreSubsets, File executable, AppID appID, boolean wait)
Start an executable running on multiple places on the board.void
executeFlood(CoreSubsets coreSubsets, InputStream executable, int numBytes, AppID appID, boolean wait)
Start an executable running on multiple places on the board.void
executeFlood(CoreSubsets coreSubsets, ByteBuffer executable, AppID appID, boolean wait)
Start an executable running on multiple places on the board.void
fillMemory(HasChipLocation chip, MemoryLocation baseAddress, int repeatValue, int size, FillDataType dataType)
Fill some memory with repeated data.void
freeSDRAM(HasChipLocation chip, MemoryLocation baseAddress)
Free allocated SDRAM.int
freeSDRAM(HasChipLocation chip, AppID appID)
Free all SDRAM allocated to a given application ID.AppIdTracker
getAppIdTracker()
Map<BMPCoords,ConnectionSelector<BMPConnection>>
getBMPConnection()
BMPCoords
getBoundBMP()
Set<Connection>
getConnections()
Get the currently known connections to the board, made up of those passed in to the transceiver and those that are discovered during calls todiscoverScampConnections()
.int
getCoreStateCount(AppID appID, CPUState state)
Get a count of the number of cores which have a given state.MappableIterable<CPUInfo>
getCPUInformation(CoreSubsets coreSubsets)
Get information about some processors on the board.List<HeapElement>
getHeap(HasChipLocation chip, SystemVariableDefinition heap)
Get the contents of the given heap on a given chip.MappableIterable<IOBuffer>
getIobuf(CoreSubsets coreSubsets)
Get the contents of the IOBUF buffer for a collection of processors.Machine
getMachineDetails()
Get the details of the machine made up of chips on a board and how they are connected to each other.MachineDimensions
getMachineDimensions()
Get the maximum chip x-coordinate and maximum chip y-coordinate of the chips in the machine.List<MulticastRoutingEntry>
getMulticastRoutes(HasChipLocation chip, AppID appID)
Get the current multicast routes set up on a chip.Map<CoreLocation,ReinjectionStatus>
getReinjectionStatus(CoreSubsets monitorCores)
Get the packet reinjection status of some monitor processes.ReinjectionStatus
getReinjectionStatus(HasCoreLocation monitorCore)
Get the packet reinjection status of a monitor process.boolean
getResetStatus(BMPCoords bmp, BMPBoard board)
Get the FPGA reset status.DiagnosticFilter
getRouterDiagnosticFilter(HasChipLocation chip, int position)
Gets a router diagnostic filter from a router.RouterDiagnostics
getRouterDiagnostics(HasChipLocation chip)
Get router diagnostic information from a chip.ConnectionSelector<SCPConnection>
getScampConnectionSelector()
VersionInfo
getScampVersion(HasChipLocation chip, ConnectionSelector<SCPConnection> connectionSelector)
Get the version of SCAMP which is running on the board.MemoryLocation
getSerialFlashBuffer(BMPCoords bmp, BMPBoard board)
Get the address of the serial flash buffer.List<Tag>
getTags(SCPConnection connection)
Get the current set of tags that have been set on the board.Map<Tag,Integer>
getTagUsage(SCPConnection connection)
Get the number of times each tag has had a message sent via it for a connection.boolean
isConnected(Connection connection)
Determines if the board can be contacted.static boolean
isScampVersionCompatible(Version version)
Determine if the version of SCAMP is compatible with this transceiver.void
loadApplicationRouterTables(CoreSubsets monitorCores)
Load the (previously saved) application's multicast router tables.void
loadFixedRoute(HasChipLocation chip, RoutingEntry fixedRoute, AppID appID)
Loads a fixed route routing table entry onto a chip's router.void
loadMulticastRoutes(HasChipLocation chip, Collection<MulticastRoutingEntry> routes, AppID appID)
Load a set of multicast routes on to a chip.void
loadSystemRouterTables(CoreSubsets monitorCores)
Load the (previously configured) system multicast router tables.SCPConnection
locateSpinnakerConnection(InetAddress boardAddress)
Find a connection that matches the given board IP address.static Transceiver
makeWithDescriptors(MachineVersion version, Collection<Transceiver.ConnectionDescriptor> scampConnections)
Create a transceiver.MemoryLocation
mallocSDRAM(HasChipLocation chip, int size, AppID appID, int tag)
Allocates a chunk of SDRAM on a chip on the machine.void
power(PowerCommand powerCommand, BMPCoords bmp, Collection<BMPBoard> boards)
Send a power request to the machine.void
powerOffMachine()
Power off the whole machine.void
powerOnMachine()
Power on the whole machine.ADCInfo
readADCData(BMPCoords bmp, BMPBoard board)
Read the ADC data.ByteBuffer
readBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int length)
Read BMP memory.VersionInfo
readBMPVersion(BMPCoords bmp, BMPBoard board)
Read the BMP version.String
readBoardSerialNumber(BMPCoords bmp, BMPBoard board)
Read the BMP serial number from a board.RoutingEntry
readFixedRoute(HasChipLocation chip, AppID appID)
Reads a fixed route routing table entry from a chip's router.int
readFPGARegister(FPGA fpga, MemoryLocation register, BMPCoords bmp, BMPBoard board)
Read a register on a FPGA of a board.ByteBuffer
readMemory(HasCoreLocation core, MemoryLocation baseAddress, int length)
Read some areas of SDRAM (or System RAM) from the board.ByteBuffer
readNeighbourMemory(HasCoreLocation core, Direction link, MemoryLocation baseAddress, int length)
Read some areas of memory on a neighbouring chip using a LINK_READ SCP command.void
readRegion(BufferManagerStorage.Region region, BufferManagerStorage storage)
Read an area associated with a recording region from SDRAM from a core of a chip on the board.ByteBuffer
readSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int length)
Read BMP serial flash memory.int
readSerialFlashCRC(BMPCoords bmp, BMPBoard board, MemoryLocation address, int length)
Read the CRC32 checksum of BMP serial flash memory.void
resetFPGA(BMPCoords bmp, BMPBoard board, BMPTransceiverInterface.FPGAResetType resetType)
Reset the FPGAs on a board.void
resetReinjectionCounters(CoreSubsets monitorCores)
Reset the packet reinjection counters of some monitor processes.void
resetReinjectionCounters(HasCoreLocation monitorCore)
Reset the packet reinjection counters of a monitor process.void
retryNeeded()
Note that a retry was required.void
saveApplicationRouterTables(CoreSubsets monitorCores)
Save the application's multicast router tables.void
sendSCPMessage(SCPRequest<?> message, SCPConnection connection)
Sends an SCP message, without expecting a response.void
sendSDPMessage(SDPMessage message, SDPConnection connection)
Sends an SDP message using one of the connections.void
sendSignal(AppID appID, Signal signal)
Send a signal to an application.void
setIPTag(IPTag tag)
Set up an IP tag.void
setIPTag(IPTag tag, SDPConnection connection)
Set up an IP tag to deliver messages to a particular connection.void
setLED(Collection<Integer> leds, LEDAction action, BMPCoords bmp, Collection<BMPBoard> board)
Set the LED state of a board in the machine.void
setLEDs(HasCoreLocation core, Map<Integer,LEDAction> ledStates)
Set LED states.void
setReinjectionEmergencyTimeout(CoreSubsets monitorCores, int timeoutMantissa, int timeoutExponent)
Set the emergency packet reinjection timeout.void
setReinjectionEmergencyTimeout(HasCoreLocation monitorCore, int timeoutMantissa, int timeoutExponent)
Set the emergency packet reinjection timeout.void
setReinjectionTimeout(CoreSubsets monitorCores, int timeoutMantissa, int timeoutExponent)
Set the packet reinjection timeout.void
setReinjectionTimeout(HasCoreLocation monitorCore, int timeoutMantissa, int timeoutExponent)
Set the packet reinjection timeout.void
setReinjectionTypes(CoreSubsets monitorCores, boolean multicast, boolean pointToPoint, boolean fixedRoute, boolean nearestNeighbour)
Set what types of packets are to be reinjected.void
setReinjectionTypes(HasCoreLocation monitorCore, boolean multicast, boolean pointToPoint, boolean fixedRoute, boolean nearestNeighbour)
Set what types of packets are to be reinjected.void
setReverseIPTag(ReverseIPTag tag)
Set up a reverse IP tag.void
setRouterDiagnosticFilter(HasChipLocation chip, int position, DiagnosticFilter diagnosticFilter)
Sets a router diagnostic filter in a router.void
setWatchDogTimeoutOnChip(HasChipLocation chip, int watchdog)
Set the value of the watch dog timer on a specific chip.void
stopApplication(AppID appID)
Sends a stop request for an application ID.void
updateProvenanceAndExit(CoreSubsets coreSubsets)
Tell some running application cores to write their provenance data to a location where it can be read back, and then to go into theirFINISHED
state.void
updateRuntime(Integer runTimesteps, int currentTime, int syncTimesteps, CoreSubsets coreSubsets)
Set the running time information for a collection of processors.void
waitForCoresToBeInState(CoreSubsets allCoreSubsets, AppID appID, EnumSet<CPUState> cpuStates, Integer timeout, int timeBetweenPolls, EnumSet<CPUState> errorStates, int countBetweenFullChecks)
Waits for the specified cores running the given application to be in some target state or states.void
writeBMPFlash(BMPCoords bmp, BMPBoard board, MemoryLocation address)
Write a fixed size chunk to flash memory of a BMP with erase.void
writeBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, File file)
Write BMP memory from a file.void
writeBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, ByteBuffer data)
Write BMP memory.void
writeFlash(@Valid BMPCoords bmp, @Valid BMPBoard board, @NotNull MemoryLocation baseAddress, @NotNull ByteBuffer data)
Write a buffer to flash memory on the BMP.void
writeFPGARegister(FPGA fpga, MemoryLocation register, int value, BMPCoords bmp, BMPBoard board)
Write a register on a FPGA of a board.void
writeMemory(HasCoreLocation core, MemoryLocation baseAddress, File dataFile)
Write to the SDRAM on the board.void
writeMemory(HasCoreLocation core, MemoryLocation baseAddress, InputStream dataStream, int numBytes)
Write to the SDRAM on the board.void
writeMemory(HasCoreLocation core, MemoryLocation baseAddress, ByteBuffer data)
Write to the SDRAM (or System RAM) on the board.void
writeMemoryFlood(MemoryLocation baseAddress, File dataFile)
Write to the SDRAM of all chips.void
writeMemoryFlood(MemoryLocation baseAddress, InputStream dataStream, int numBytes)
Write to the SDRAM of all chips.void
writeMemoryFlood(MemoryLocation baseAddress, ByteBuffer data)
Write to the SDRAM of all chips.void
writeNeighbourMemory(HasCoreLocation core, Direction link, MemoryLocation baseAddress, File dataFile)
Write to the memory of a neighbouring chip using a LINK_WRITE SCP command.void
writeNeighbourMemory(HasCoreLocation core, Direction link, MemoryLocation baseAddress, InputStream dataStream, int numBytes)
Write to the memory of a neighbouring chip using a LINK_WRITE SCP command.void
writeNeighbourMemory(HasCoreLocation core, Direction link, MemoryLocation baseAddress, ByteBuffer data)
Write to the memory of a neighbouring chip using a LINK_WRITE SCP command.void
writeSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int size, InputStream stream)
Write BMP serial flash memory from a stream.void
writeSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, File file)
Write BMP serial flash memory from a file.void
writeSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, ByteBuffer data)
Write BMP serial flash memory.Methods inherited from class uk.ac.manchester.spinnaker.transceiver.UDPTransceiver
newEieioConnection, registerEIEIOListener, registerEIEIOListener, registerEIEIOListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface uk.ac.manchester.spinnaker.transceiver.BMPTransceiverInterface
availableBoards, getResetStatus, getSerialFlashBuffer, powerOff, powerOff, powerOn, powerOn, readADCData, readBlacklist, readBlacklist, readBMPFirmwareDescriptor, readBMPFirmwareDescriptor, readBMPMemory, readBMPMemoryWord, readBMPMemoryWord, readBMPVersion, readBMPVersion, readBMPVersion, readBoardSerialNumber, readFPGALinkCounter, readFPGALinkCounter, readFPGALinkCounter, readFPGALinkCounter, readFPGARegister, readFPGARegister, readFPGARegister, readFPGARegister, readFPGARegister, readSerialFlash, readSerialFlashCRC, resetFPGA, setLED, writeBlacklist, writeBlacklist, writeBMPFlash, writeBMPMemory, writeBMPMemory, writeBMPMemory, writeBMPMemory, writeFlash, writeFPGARegister, writeFPGARegister, writeFPGARegister, writeFPGARegister, writeFPGARegister, writeSerialFlash, writeSerialFlash, writeSerialFlash
Methods inherited from interface uk.ac.manchester.spinnaker.transceiver.TransceiverInterface
bootBoard, clearIobuf, clearIobuf, clearIPTag, clearIPTag, clearRouterDiagnosticCounters, clearRouterDiagnosticCounters, clearRouterDiagnosticCounters, enableWatchDogTimer, ensureBoardIsReady, ensureBoardIsReady, ensureBoardIsReady, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeApplication, executeFlood, executeFlood, executeFlood, fillMemory, getCoresInState, getCoresInState, getCoresNotInState, getCoresNotInState, getCPUInformation, getCPUInformation, getFullChipInformation, getHeap, getIobuf, getIobuf, getMulticastRoutes, getScampVersion, getScampVersion, getScampVersion, getTags, getTagUsage, getUser0RegisterAddress, getUser0RegisterAddress, getUser0RegisterAddress, getUser1RegisterAddress, getUser1RegisterAddress, getUser1RegisterAddress, getUser2RegisterAddress, getUser2RegisterAddress, getUser2RegisterAddress, isConnected, loadFixedRoute, loadMulticastRoutes, mallocSDRAM, mallocSDRAM, readFixedRoute, readMemory, readMemory, readNeighbourMemory, readUser0, readUser1, readUser2, sendSDPMessage, setLEDs, setReinjection, setReinjection, setReinjection, setReinjection, setReinjectionEmergencyTimeout, setReinjectionEmergencyTimeout, setReinjectionEmergencyTimeout, setReinjectionTimeout, setReinjectionTimeout, setReinjectionTimeout, setWatchDogTimeout, updateProvenanceAndExit, updateProvenanceAndExit, updateRuntime, updateRuntime, waitForCoresToBeInState, writeMemory, writeMemory, writeMemory, writeMemory, writeMemory, writeMemory, writeMemory, writeMemoryFlood, writeMemoryFlood, writeNeighbourMemory, writeNeighbourMemory, writeNeighbourMemory, writeNeighbourMemory, writeNeighbourMemory, writeNeighbourMemory, writeNeighbourMemory, writeUser0, writeUser0, writeUser1, writeUser1, writeUser2, writeUser2
-
Constructor Details
-
Transceiver
@MustBeClosed public Transceiver(InetAddress host, MachineVersion version, Collection<BMPConnectionData> bmpConnectionData, Integer numberOfBoards, Set<ChipLocation> ignoredChips, Map<ChipLocation,Set<Integer>> ignoredCores, Map<ChipLocation,EnumSet<Direction>> ignoredLinks, boolean autodetectBMP, List<Transceiver.ConnectionDescriptor> scampConnections, Integer bootPortNumber, Integer maxSDRAMSize) throws IOException, SpinnmanException, InterruptedExceptionCreate a Transceiver by creating a UDPConnection to the given hostname on port 17893 (the default SCAMP port), and a BootConnection on port 54321 (the default boot port), optionally discovering any additional links using the UDPConnection, and then returning the transceiver created with the conjunction of the created UDPConnection and the discovered connections.- Parameters:
host
- The host IP address of the boardversion
- The type of SpiNNaker board used within the SpiNNaker machine being used. May benull
if the board in question can be assumed to be always already booted.numberOfBoards
- a number of boards expected to be supported, ornull
, which defaults to a single boardignoredChips
- An optional set of chips to ignore in the machine. Requests for a "machine" will have these chips excluded, as if they never existed. The processors of the specified chips are ignored.ignoredCores
- An optional map of cores to ignore in the machine. Requests for a "machine" will have these cores excluded, as if they never existed.ignoredLinks
- An optional set of links to ignore in the machine. Requests for a "machine" will have these links excluded, as if they never existed.bmpConnectionData
- the details of the BMP connections used to boot multi-board systemsautodetectBMP
- True if the BMP of version 4 or 5 boards should be automatically determined from the board IP addressbootPortNumber
- the port number used to boot the machinescampConnections
- the list of connections used for SCAMP communicationsmaxSDRAMSize
- the max size each chip can say it has for SDRAM (mainly used in debugging purposes)- Throws:
IOException
- if networking failsSpinnmanException
- If a BMP is uncontactable or SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
Transceiver
@MustBeClosed public Transceiver(InetAddress hostname, MachineVersion version) throws IOException, SpinnmanException, InterruptedExceptionCreate a Transceiver by creating a UDPConnection to the given hostname on port 17893 (the default SCAMP port), and a BootConnection on port 54321 (the default boot port), discovering any additional links using the UDPConnection, and then returning the transceiver created with the conjunction of the created UDPConnection and the discovered connections.- Parameters:
hostname
- The hostname or IP address of the boardversion
- The type of SpiNNaker board used within the SpiNNaker machine being used. May benull
if the board in question can be assumed to be always already booted.- Throws:
IOException
- if networking failsSpinnmanException
- If a BMP is uncontactable or SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
Transceiver
@MustBeClosed public Transceiver(MachineVersion version, Collection<Connection> connections) throws IOException, SpinnmanException, InterruptedExceptionCreate a transceiver.- Parameters:
version
- The type of SpiNNaker board used within the SpiNNaker machine being used. May benull
if the board in question can be assumed to be always already booted.connections
- The connections to use in the transceiver. Note that the transceiver may make additional connections.- Throws:
IOException
- if networking failsSpinnmanException
- If a BMP is uncontactable or SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
Transceiver
public Transceiver(MachineVersion version, Collection<Connection> connections, Collection<ChipLocation> ignoredChips, Map<ChipLocation,Set<Integer>> ignoredCores, Map<ChipLocation,EnumSet<Direction>> ignoredLinks, Collection<Transceiver.ConnectionDescriptor> scampConnections, Integer maxSDRAMSize) throws IOException, SpinnmanException, InterruptedExceptionCreate a transceiver.- Parameters:
version
- The type of SpiNNaker board used within the SpiNNaker machine being used. May benull
if the board in question can be assumed to be always already booted.connections
- The connections to use in the transceiver. Note that the transceiver may make additional connections. This should be modifiable (ornull
) ifscampConnections
supplied and not empty.ignoredChips
- Blacklisted chips.ignoredCores
- Blacklisted cores.ignoredLinks
- Blacklisted links.scampConnections
- Descriptions of SCP connections to create.maxSDRAMSize
- If notnull
, the maximum SDRAM size to allow.- Throws:
IOException
- if networking failsSpinnmanException
- If a BMP is uncontactable or SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
-
Method Details
-
makeWithDescriptors
@MustBeClosed public static Transceiver makeWithDescriptors(MachineVersion version, Collection<Transceiver.ConnectionDescriptor> scampConnections) throws IOException, SpinnmanException, InterruptedExceptionCreate a transceiver.- Parameters:
version
- The type of SpiNNaker board used within the SpiNNaker machine being used. May benull
if the board in question can be assumed to be always already booted.scampConnections
- Descriptions of SCP Connections to make.- Returns:
- The created transceiver.
- Throws:
IOException
- if networking failsSpinnmanException
- If a BMP is uncontactable or SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
createScpConnection
Description copied from interface:TransceiverInterface
Create a connection to a particular instance of SCAMP. Note that this connection is a new connection; it is not a previously existing connection.- Specified by:
createScpConnection
in interfaceTransceiverInterface
- Parameters:
chip
- The location of the chip on the board with this remoteHostaddr
- The IP address of the SpiNNaker board to send messages to.- Returns:
- The SCP connection to use. It is up to the caller to arrange for this to be closed at the right time.
- Throws:
IOException
- If anything goes wrong with socket setup.
-
getScampConnectionSelector
- Specified by:
getScampConnectionSelector
in interfaceTransceiverInterface
- Returns:
- The connection selector to use for SCP messages.
-
retryNeeded
public void retryNeeded()Description copied from interface:RetryTracker
Note that a retry was required.- Specified by:
retryNeeded
in interfaceRetryTracker
-
sendSCPMessage
Description copied from interface:TransceiverInterface
Sends an SCP message, without expecting a response.- Specified by:
sendSCPMessage
in interfaceTransceiverInterface
- Parameters:
message
- The message to sendconnection
- The connection to use (omit to pick a random one)- Throws:
IOException
- If anything goes wrong with networking.
-
sendSDPMessage
Description copied from interface:TransceiverInterface
Sends an SDP message using one of the connections.- Specified by:
sendSDPMessage
in interfaceTransceiverInterface
- Parameters:
message
- The message to sendconnection
- An optional connection to use- Throws:
IOException
- If anything goes wrong with networking.
-
discoverScampConnections
@CheckReturnValue public List<SCPConnection> discoverScampConnections() throws IOException, ProcessException, InterruptedExceptionFind connections to the board and store these for future use. Note that connections can be empty, in which case another local discovery mechanism will be used. Note that an exception will be thrown if no initial connections can be found to the board.- Returns:
- An iterable of discovered connections, not including the initially given connections in the constructor
- Throws:
IOException
- if networking failsProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getConnections
Get the currently known connections to the board, made up of those passed in to the transceiver and those that are discovered during calls todiscoverScampConnections()
. No further discovery is done here.- Returns:
- The connections known to the transceiver
-
getMachineDimensions
public MachineDimensions getMachineDimensions() throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get the maximum chip x-coordinate and maximum chip y-coordinate of the chips in the machine.WARNING! This operation is unsafe in a multi-threaded context unless previously called from a parallel-safe situation.
- Specified by:
getMachineDimensions
in interfaceTransceiverInterface
- Returns:
- The dimensions of the machine
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getMachineDetails
Description copied from interface:TransceiverInterface
Get the details of the machine made up of chips on a board and how they are connected to each other.WARNING! This operation is unsafe in a multi-threaded context unless previously called from a parallel-safe situation.
- Specified by:
getMachineDetails
in interfaceTransceiverInterface
- Returns:
- A machine description
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getAppIdTracker
- Returns:
- the application ID tracker for this transceiver.
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
isConnected
Description copied from interface:TransceiverInterface
Determines if the board can be contacted.- Specified by:
isConnected
in interfaceTransceiverInterface
- Parameters:
connection
- The connection which is to be tested. Ifnull
, all connections will be tested, and the board will be considered to be connected if any one connection works.- Returns:
- True if the board can be contacted, False otherwise
-
getScampVersion
@CheckReturnValue public VersionInfo getScampVersion(HasChipLocation chip, ConnectionSelector<SCPConnection> connectionSelector) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get the version of SCAMP which is running on the board.- Specified by:
getScampVersion
in interfaceTransceiverInterface
- Parameters:
chip
- the coordinates of the chip to query for SCAMP versionconnectionSelector
- the connection to send the SCAMP version or none (if none then a random SCAMP connection is used).- Returns:
- The version identifier
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
bootBoard
@ParallelUnsafe public void bootBoard(Map<SystemVariableDefinition,Object> extraBootValues) throws InterruptedException, IOExceptionDescription copied from interface:TransceiverInterface
Attempt to boot the board. No check is performed to see if the board is already booted.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
bootBoard
in interfaceTransceiverInterface
- Parameters:
extraBootValues
- extra values to set during boot- Throws:
InterruptedException
- If the thread is interrupted while waiting.IOException
- If anything goes wrong with networking.
-
isScampVersionCompatible
Determine if the version of SCAMP is compatible with this transceiver.- Parameters:
version
- The version to test- Returns:
- true exactly when they are compatible
-
ensureBoardIsReady
@ParallelUnsafe public VersionInfo ensureBoardIsReady(int numRetries, Map<SystemVariableDefinition,Object> extraBootValues) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Ensure that the board is ready to interact with this version of the transceiver. Boots the board if not already booted and verifies that the version of SCAMP running is compatible with this transceiver.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
ensureBoardIsReady
in interfaceTransceiverInterface
- Parameters:
numRetries
- The number of times to retry bootingextraBootValues
- Any additional values to set during boot- Returns:
- The version identifier
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the thread is interrupted while waiting.
-
getCPUInformation
@CheckReturnValue @ParallelSafeWithCare public MappableIterable<CPUInfo> getCPUInformation(CoreSubsets coreSubsets) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get information about some processors on the board.WARNING! This operation is unsafe in a multi-threaded context unless the
coreSubsets
only contains cores on a single board.- Specified by:
getCPUInformation
in interfaceTransceiverInterface
- Parameters:
coreSubsets
- A set of chips and cores from which to get the information. Ifnull
, the information from all of the cores on all of the chips on the board are obtained.- Returns:
- An iterable of the CPU information for the selected cores, or all
cores if
coreSubsets
isnull
. - Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getIobuf
@CheckReturnValue @ParallelSafeWithCare public MappableIterable<IOBuffer> getIobuf(CoreSubsets coreSubsets) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get the contents of the IOBUF buffer for a collection of processors.- Specified by:
getIobuf
in interfaceTransceiverInterface
- Parameters:
coreSubsets
- A set of chips and cores from which to get the buffers.- Returns:
- An iterable of the buffers, which may not be in the order of
coreSubsets
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
clearIobuf
@ParallelSafeWithCare public void clearIobuf(CoreSubsets coreSubsets) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Clear the contents of the IOBUF buffer for a collection of processors.- Specified by:
clearIobuf
in interfaceTransceiverInterface
- Parameters:
coreSubsets
- A set of chips and cores on which to clear the buffers.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
updateRuntime
@ParallelSafeWithCare public void updateRuntime(Integer runTimesteps, int currentTime, int syncTimesteps, CoreSubsets coreSubsets) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set the running time information for a collection of processors.- Specified by:
updateRuntime
in interfaceTransceiverInterface
- Parameters:
runTimesteps
- How many machine timesteps will the run last.null
is used to indicate an infinite (unbounded until explicitly stopped) run.currentTime
- The current simulation time.syncTimesteps
- The number of timesteps before we pause to synchronise.coreSubsets
- A set of chips and cores on which to set the running time.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
updateProvenanceAndExit
@ParallelSafeWithCare public void updateProvenanceAndExit(CoreSubsets coreSubsets) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Tell some running application cores to write their provenance data to a location where it can be read back, and then to go into theirFINISHED
state.- Specified by:
updateProvenanceAndExit
in interfaceTransceiverInterface
- Parameters:
coreSubsets
- A set of cores tell to finish.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
setWatchDogTimeoutOnChip
@ParallelSafe public void setWatchDogTimeoutOnChip(HasChipLocation chip, int watchdog) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set the value of the watch dog timer on a specific chip.- Specified by:
setWatchDogTimeoutOnChip
in interfaceTransceiverInterface
- Parameters:
chip
- coordinates of the chip to write new watchdog parameter towatchdog
- value to set the timer count to- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
enableWatchDogTimerOnChip
@ParallelSafe public void enableWatchDogTimerOnChip(HasChipLocation chip, boolean watchdog) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Enable or disable the watch dog timer on a specific chip.- Specified by:
enableWatchDogTimerOnChip
in interfaceTransceiverInterface
- Parameters:
chip
- coordinates of the chip to write new watchdog parameter towatchdog
- whether to enable (True) or disable (False) the watchdog timer- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getCoreStateCount
@CheckReturnValue @ParallelUnsafe public int getCoreStateCount(AppID appID, CPUState state) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get a count of the number of cores which have a given state.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
getCoreStateCount
in interfaceTransceiverInterface
- Parameters:
appID
- The ID of the application from which to get the count.state
- The state count to get- Returns:
- A count of the cores with the given status
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
execute
@ParallelSafe public void execute(HasChipLocation chip, Collection<Integer> processors, InputStream executable, int numBytes, AppID appID, boolean wait) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Start an executable running on a single chip.- Specified by:
execute
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chip on which to run the executableprocessors
- The cores on the chip on which to run the applicationexecutable
- The data that is to be executed.numBytes
- The number of bytes to read from the input stream.appID
- The ID of the application with which to associate the executablewait
- True if the binary should enter a "wait" state on loading- Throws:
IOException
- If anything goes wrong with networking or with reading from the input stream.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the thread is interrupted while waiting.
-
execute
@ParallelSafe public final void execute(HasChipLocation chip, Collection<Integer> processors, File executable, AppID appID, boolean wait) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Start an executable running on a single chip.- Specified by:
execute
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chip on which to run the executableprocessors
- The cores on the chip on which to run the applicationexecutable
- The data that is to be executed.appID
- The ID of the application with which to associate the executablewait
- True if the binary should enter a "wait" state on loading- Throws:
IOException
- If anything goes wrong with networking or with reading from the file.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the thread is interrupted while waiting.
-
execute
@ParallelSafe public void execute(HasChipLocation chip, Collection<Integer> processors, ByteBuffer executable, AppID appID, boolean wait) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Start an executable running on a single chip.- Specified by:
execute
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chip on which to run the executableprocessors
- The cores on the chip on which to run the applicationexecutable
- The data that is to be executed.appID
- The ID of the application with which to associate the executablewait
- True if the binary should enter a "wait" state on loading- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the thread is interrupted while waiting.
-
executeFlood
@ParallelSafeWithCare public void executeFlood(CoreSubsets coreSubsets, InputStream executable, int numBytes, AppID appID, boolean wait) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Start an executable running on multiple places on the board. This will be optimised based on the selected cores, but it may still require a number of communications with the board to execute.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
executeFlood
in interfaceTransceiverInterface
- Parameters:
coreSubsets
- Which cores on which chips to start the executableexecutable
- The data that is to be executed.numBytes
- The size of the executable data in bytes.appID
- The ID of the application with which to associate the executablewait
- True if the processors should enter a "wait" state on loading- Throws:
IOException
- If anything goes wrong with networking or with reading from the input stream.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the thread is interrupted while waiting.
-
executeFlood
@ParallelSafeWithCare public void executeFlood(CoreSubsets coreSubsets, File executable, AppID appID, boolean wait) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Start an executable running on multiple places on the board. This will be optimised based on the selected cores, but it may still require a number of communications with the board to execute.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
executeFlood
in interfaceTransceiverInterface
- Parameters:
coreSubsets
- Which cores on which chips to start the executableexecutable
- The data that is to be executed.appID
- The ID of the application with which to associate the executablewait
- True if the processors should enter a "wait" state on loading- Throws:
IOException
- If anything goes wrong with networking or with reading from the file.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the thread is interrupted while waiting.
-
executeFlood
@ParallelSafeWithCare public void executeFlood(CoreSubsets coreSubsets, ByteBuffer executable, AppID appID, boolean wait) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Start an executable running on multiple places on the board. This will be optimised based on the selected cores, but it may still require a number of communications with the board to execute.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
executeFlood
in interfaceTransceiverInterface
- Parameters:
coreSubsets
- Which cores on which chips to start the executableexecutable
- The data that is to be executed.appID
- The ID of the application with which to associate the executablewait
- True if the processors should enter a "wait" state on loading- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the thread is interrupted while waiting.
-
powerOnMachine
@ParallelUnsafe public void powerOnMachine() throws InterruptedException, IOException, ProcessExceptionDescription copied from interface:BMPTransceiverInterface
Power on the whole machine.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
powerOnMachine
in interfaceBMPTransceiverInterface
- Throws:
InterruptedException
- If the thread is interrupted while waiting.IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.
-
powerOffMachine
@ParallelUnsafe public void powerOffMachine() throws InterruptedException, IOException, ProcessExceptionDescription copied from interface:BMPTransceiverInterface
Power off the whole machine.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
powerOffMachine
in interfaceBMPTransceiverInterface
- Throws:
InterruptedException
- If the thread is interrupted while waiting.IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.
-
power
@ParallelUnsafe public void power(PowerCommand powerCommand, BMPCoords bmp, Collection<BMPBoard> boards) throws InterruptedException, IOException, ProcessExceptionDescription copied from interface:BMPTransceiverInterface
Send a power request to the machine.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
power
in interfaceBMPTransceiverInterface
- Parameters:
powerCommand
- The power command to sendbmp
- the coordinates of the BMP; components are zero for a board not in a frame of a cabinetboards
- The boards to send the command to- Throws:
InterruptedException
- If the thread is interrupted while waiting.IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.
-
setLED
@ParallelUnsafe public void setLED(Collection<Integer> leds, LEDAction action, BMPCoords bmp, Collection<BMPBoard> board) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Set the LED state of a board in the machine.- Specified by:
setLED
in interfaceBMPTransceiverInterface
- Parameters:
leds
- Collection of LED numbers to set the state of (0-7)action
- State to set the LED to, either on, off or togglebmp
- the coordinates of the BMP this is targetingboard
- Specifies the board to control the LEDs of. The command will actually be sent to the first board in the collection.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
readFPGARegister
@CheckReturnValue @ParallelUnsafe public int readFPGARegister(FPGA fpga, MemoryLocation register, BMPCoords bmp, BMPBoard board) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Read a register on a FPGA of a board. The meaning of the register's contents will depend on the FPGA's configuration.- Specified by:
readFPGARegister
in interfaceBMPTransceiverInterface
- Parameters:
fpga
- FPGA (0, 1 or 2) to communicate with.register
- Register address to read to (will be rounded down to the nearest 32-bit word boundary).bmp
- the coordinates of the BMP this is targetingboard
- which board to request the FPGA register from- Returns:
- the register data
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeFPGARegister
@ParallelUnsafe public void writeFPGARegister(FPGA fpga, MemoryLocation register, int value, BMPCoords bmp, BMPBoard board) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Write a register on a FPGA of a board. The meaning of setting the register's contents will depend on the FPGA's configuration.- Specified by:
writeFPGARegister
in interfaceBMPTransceiverInterface
- Parameters:
fpga
- FPGA (0, 1 or 2) to communicate with.register
- Register address to read to (will be rounded down to the nearest 32-bit word boundary).value
- the value to write into the FPGA registerbmp
- the coordinates of the BMP this is targetingboard
- which board to write the FPGA register to- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
readADCData
@CheckReturnValue @ParallelUnsafe public ADCInfo readADCData(BMPCoords bmp, BMPBoard board) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Read the ADC data.- Specified by:
readADCData
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- the coordinates of the BMP this is targetingboard
- which board to request the ADC data from- Returns:
- the FPGA's ADC data object
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
readBMPVersion
@CheckReturnValue @ParallelUnsafe public VersionInfo readBMPVersion(BMPCoords bmp, BMPBoard board) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Read the BMP version.- Specified by:
readBMPVersion
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- the coordinates of the BMP this is targetingboard
- which board to request the data from- Returns:
- the parsed SVER from the BMP
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
readBMPMemory
@CheckReturnValue @ParallelSafeWithCare public ByteBuffer readBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int length) throws ProcessException, IOException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Read BMP memory.- Specified by:
readBMPMemory
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board's BMP are we reading?baseAddress
- The address in the BMP's memory where the region of memory to be read startslength
- The length of the data to be read in bytes- Returns:
- A little-endian buffer of data read, positioned at the start of the data. The buffer will be writable, but writes will not be automatically reflected anywhere.
- Throws:
ProcessException
- If SpiNNaker rejects a message.IOException
- If anything goes wrong with networking.InterruptedException
- If the communications were interrupted.
-
writeBMPMemory
public void writeBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, ByteBuffer data) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Write BMP memory.- Specified by:
writeBMPMemory
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board's BMP are we writing?baseAddress
- The address in the BMP's memory where the region of memory to be written startsdata
- The data to be written, extending from the position to the limit. The contents of this buffer will be unchanged.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeBMPMemory
public void writeBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, File file) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Write BMP memory from a file.- Specified by:
writeBMPMemory
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board's BMP are we writing?baseAddress
- The address in the BMP's memory where the region of memory to be written startsfile
- The file containing the data to be written.- Throws:
IOException
- If anything goes wrong with networking or file I/O.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getSerialFlashBuffer
public MemoryLocation getSerialFlashBuffer(BMPCoords bmp, BMPBoard board) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Get the address of the serial flash buffer.- Specified by:
getSerialFlashBuffer
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which BMP's buffer do we want the address of?- Returns:
- The adress of the serial flash buffer.
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
readBoardSerialNumber
public String readBoardSerialNumber(BMPCoords bmp, BMPBoard board) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Read the BMP serial number from a board.- Specified by:
readBoardSerialNumber
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we sending messages to directly?board
- Which board's BMP (of those managed by the BMP we send the message to) are we getting the serial number from?- Returns:
- The LPC1768 serial number.
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
readSerialFlash
@CheckReturnValue public ByteBuffer readSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int length) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Read BMP serial flash memory.- Specified by:
readSerialFlash
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board's BMP are we reading?baseAddress
- The address in the BMP's serial flash where the region of memory to be read startslength
- The length of the data to be read in bytes- Returns:
- A little-endian buffer of data read, positioned at the start of the data. The buffer will be writable, but writes will not be automatically reflected anywhere.
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
readSerialFlashCRC
@CheckReturnValue public int readSerialFlashCRC(BMPCoords bmp, BMPBoard board, MemoryLocation address, int length) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Read the CRC32 checksum of BMP serial flash memory.- Specified by:
readSerialFlashCRC
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board's BMP are we reading?address
- The address in the BMP's serial flash where the region of memory to be checksummed startslength
- The length of the data to be checksummed in bytes- Returns:
- The CRC32 checksum
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeSerialFlash
public void writeSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, ByteBuffer data) throws ProcessException, IOException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Write BMP serial flash memory.- Specified by:
writeSerialFlash
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board's BMP are we writing?baseAddress
- The address in the BMP's serial flash where the region of memory to be written startsdata
- The raw data to be written- Throws:
ProcessException
- If SpiNNaker rejects a message.IOException
- If anything goes wrong with networking.InterruptedException
- If the communications were interrupted.
-
writeSerialFlash
public void writeSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int size, InputStream stream) throws ProcessException, IOException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Write BMP serial flash memory from a stream.- Specified by:
writeSerialFlash
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board's BMP are we writing?baseAddress
- The address in the BMP's serial flash where the region of memory to be written startssize
- How many bytes to write from the streamstream
- The file containing the data to be written- Throws:
ProcessException
- If SpiNNaker rejects a message.IOException
- If anything goes wrong with networking.InterruptedException
- If the communications were interrupted.
-
writeSerialFlash
public void writeSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, File file) throws ProcessException, IOException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Write BMP serial flash memory from a file.- Specified by:
writeSerialFlash
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board's BMP are we writing?baseAddress
- The address in the BMP's serial flash where the region of memory to be written startsfile
- The file containing the data to be written- Throws:
ProcessException
- If SpiNNaker rejects a message.IOException
- If anything goes wrong with networking.InterruptedException
- If the communications were interrupted.
-
writeBMPFlash
public void writeBMPFlash(BMPCoords bmp, BMPBoard board, MemoryLocation address) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Write a fixed size chunk to flash memory of a BMP with erase. The data must have already been written to the flash buffer.- Specified by:
writeBMPFlash
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board's BMP are we writing to?address
- Where in flash will we write?- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.- See Also:
BMPTransceiverInterface.writeFlash(BMPCoords,BMPBoard,MemoryLocation,ByteBuffer)
-
writeFlash
public void writeFlash(@Valid @Valid BMPCoords bmp, @Valid @Valid BMPBoard board, @NotNull @NotNull MemoryLocation baseAddress, @NotNull @NotNull ByteBuffer data) throws ProcessException, IOException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Write a buffer to flash memory on the BMP. This is a composite operation.- Specified by:
writeFlash
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board's BMP are we writing to?baseAddress
- Where in flash will we write?data
- What data will we write?- Throws:
ProcessException
- If SpiNNaker rejects a message.IOException
- If anything goes wrong with networking.InterruptedException
- If the communications were interrupted.
-
getResetStatus
@ParallelSafe public boolean getResetStatus(BMPCoords bmp, BMPBoard board) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Get the FPGA reset status.- Specified by:
getResetStatus
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board are the FPGAs on?- Returns:
- What the state of the reset line is.
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
resetFPGA
@ParallelSafe public void resetFPGA(BMPCoords bmp, BMPBoard board, BMPTransceiverInterface.FPGAResetType resetType) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
Reset the FPGAs on a board.- Specified by:
resetFPGA
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we talking to?board
- Which board are the FPGAs on?resetType
- What kind of reset to perform.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
availableBoards
@CheckReturnValue public MappableIterable<BMPBoard> availableBoards(BMPCoords bmp) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:BMPTransceiverInterface
List which boards are actually available to be manipulated by a particular BMP.- Specified by:
availableBoards
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- Which BMP are we asking?- Returns:
- Ordered list of board identifiers.
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeMemory
@ParallelSafe public void writeMemory(HasCoreLocation core, MemoryLocation baseAddress, InputStream dataStream, int numBytes) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Write to the SDRAM on the board.- Specified by:
writeMemory
in interfaceTransceiverInterface
- Parameters:
core
- The coordinates of the core where the memory is that is to be written tobaseAddress
- The address in SDRAM where the region of memory is to be writtendataStream
- The stream of data that is to be written.numBytes
- The amount of data to be written in bytes.- Throws:
IOException
- If anything goes wrong with networking or reading from the input stream.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeMemory
@ParallelSafe public void writeMemory(HasCoreLocation core, MemoryLocation baseAddress, File dataFile) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Write to the SDRAM on the board.- Specified by:
writeMemory
in interfaceTransceiverInterface
- Parameters:
core
- The coordinates of the core where the memory is that is to be written tobaseAddress
- The address in SDRAM where the region of memory is to be writtendataFile
- The file holding the data that is to be written.- Throws:
IOException
- If anything goes wrong with networking or reading from the file.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeMemory
@ParallelSafe public void writeMemory(HasCoreLocation core, MemoryLocation baseAddress, ByteBuffer data) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Write to the SDRAM (or System RAM) on the board.- Specified by:
writeMemory
in interfaceTransceiverInterface
- Parameters:
core
- The coordinates of the core where the memory is that is to be written tobaseAddress
- The address in SDRAM where the region of memory is to be writtendata
- The data that is to be written. The data should be from the position to the limit.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeNeighbourMemory
@ParallelUnsafe public void writeNeighbourMemory(HasCoreLocation core, Direction link, MemoryLocation baseAddress, InputStream dataStream, int numBytes) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Write to the memory of a neighbouring chip using a LINK_WRITE SCP command. If sent to a BMP, this command can be used to communicate with the FPGAs' debug registers; in that case, the link must be the direction with the same ID as the ID of the FPGA to communicate with.WARNING! This operation is unsafe in a multi-threaded context if the link leaves the current board.
- Specified by:
writeNeighbourMemory
in interfaceTransceiverInterface
- Parameters:
core
- The coordinates of the core whose neighbour is to be written to; the CPU to use is typically 0 (or if a BMP, the slot number)link
- The link direction to send the request alongbaseAddress
- The address in SDRAM where the region of memory is to be writtendataStream
- The stream of data that is to be written.numBytes
- The amount of data to be written in bytes.- Throws:
IOException
- If anything goes wrong with networking or with reading from the input stream.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeNeighbourMemory
@ParallelUnsafe public void writeNeighbourMemory(HasCoreLocation core, Direction link, MemoryLocation baseAddress, File dataFile) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Write to the memory of a neighbouring chip using a LINK_WRITE SCP command. If sent to a BMP, this command can be used to communicate with the FPGAs' debug registers; in that case, the link must be the direction with the same ID as the ID of the FPGA to communicate with.WARNING! This operation is unsafe in a multi-threaded context if the link leaves the current board.
- Specified by:
writeNeighbourMemory
in interfaceTransceiverInterface
- Parameters:
core
- The coordinates of the core whose neighbour is to be written to; the CPU to use is typically 0 (or if a BMP, the slot number)link
- The link direction to send the request alongbaseAddress
- The address in SDRAM where the region of memory is to be writtendataFile
- The name of the file holding the data that is to be written.- Throws:
IOException
- If anything goes wrong with networking or with reading from the file.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeNeighbourMemory
@ParallelUnsafe public void writeNeighbourMemory(HasCoreLocation core, Direction link, MemoryLocation baseAddress, ByteBuffer data) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Write to the memory of a neighbouring chip using a LINK_WRITE SCP command. If sent to a BMP, this command can be used to communicate with the FPGAs' debug registers; in that case, the link must be the direction with the same ID as the ID of the FPGA to communicate with.WARNING! This operation is unsafe in a multi-threaded context if the link leaves the current board.
- Specified by:
writeNeighbourMemory
in interfaceTransceiverInterface
- Parameters:
core
- The coordinates of the core whose neighbour is to be written to; the CPU to use is typically 0 (or if a BMP, the slot number)link
- The link direction to send the request alongbaseAddress
- The address in SDRAM where the region of memory is to be writtendata
- The data that is to be written. The data should be from the position to the limit.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeMemoryFlood
@ParallelUnsafe public void writeMemoryFlood(MemoryLocation baseAddress, InputStream dataStream, int numBytes) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Write to the SDRAM of all chips.WARNING! This operation is unsafe in a multi-threaded context. It has interlocking, but you should not rely on it.
- Specified by:
writeMemoryFlood
in interfaceTransceiverInterface
- Parameters:
baseAddress
- The address in SDRAM where the region of memory is to be writtendataStream
- The stream of data that is to be written.numBytes
- The amount of data to be written in bytes.- Throws:
IOException
- If anything goes wrong with networking or with reading from the input stream.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeMemoryFlood
@ParallelUnsafe public void writeMemoryFlood(MemoryLocation baseAddress, File dataFile) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Write to the SDRAM of all chips.WARNING! This operation is unsafe in a multi-threaded context. It has interlocking, but you should not rely on it.
- Specified by:
writeMemoryFlood
in interfaceTransceiverInterface
- Parameters:
baseAddress
- The address in SDRAM where the region of memory is to be writtendataFile
- The name of the file holding the data that is to be written.- Throws:
IOException
- If anything goes wrong with networking or with reading from the file.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
writeMemoryFlood
@ParallelUnsafe public void writeMemoryFlood(MemoryLocation baseAddress, ByteBuffer data) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Write to the SDRAM of all chips.WARNING! This operation is unsafe in a multi-threaded context. It has interlocking, but you should not rely on it.
- Specified by:
writeMemoryFlood
in interfaceTransceiverInterface
- Parameters:
baseAddress
- The address in SDRAM where the region of memory is to be writtendata
- The data that is to be written. The data should be from the position to the limit.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
readMemory
@CheckReturnValue @ParallelSafe public ByteBuffer readMemory(HasCoreLocation core, MemoryLocation baseAddress, int length) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Read some areas of SDRAM (or System RAM) from the board.- Specified by:
readMemory
in interfaceTransceiverInterface
- Parameters:
core
- The coordinates of the core where the memory is to be read frombaseAddress
- The address in SDRAM where the region of memory to be read startslength
- The length of the data to be read in bytes- Returns:
- A little-endian buffer of data read, positioned at the start of the data
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
readRegion
@ParallelSafe public void readRegion(BufferManagerStorage.Region region, BufferManagerStorage storage) throws IOException, ProcessException, StorageException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Read an area associated with a recording region from SDRAM from a core of a chip on the board.- Specified by:
readRegion
in interfaceTransceiverInterface
- Parameters:
region
- The recording region that is being read. Describes which core produced the data, what DSE index the data came from, and where in memory to actually read.storage
- The database to write to.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.StorageException
- If anything goes wrong with access to the database.InterruptedException
- If the communications were interrupted.
-
readNeighbourMemory
@CheckReturnValue @ParallelUnsafe public ByteBuffer readNeighbourMemory(HasCoreLocation core, Direction link, MemoryLocation baseAddress, int length) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Read some areas of memory on a neighbouring chip using a LINK_READ SCP command. If sent to a BMP, this command can be used to communicate with the FPGAs' debug registers; in that case, the link must be the direction with the same ID as the ID of the FPGA to communicate with.WARNING! This operation is unsafe in a multi-threaded context if the link leaves the current board.
- Specified by:
readNeighbourMemory
in interfaceTransceiverInterface
- Parameters:
core
- The coordinates of the chip whose neighbour is to be read from, plus the CPU to use (typically 0, or if a BMP, the slot number)link
- The link direction to send the request alongbaseAddress
- The address in SDRAM where the region of memory to be read startslength
- The length of the data to be read in bytes- Returns:
- A little-endian buffer of data that has been read, positioned at the start of the data
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
stopApplication
@ParallelUnsafe public void stopApplication(AppID appID) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Sends a stop request for an application ID.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
stopApplication
in interfaceTransceiverInterface
- Parameters:
appID
- The ID of the application to send to- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
waitForCoresToBeInState
@ParallelSafeWithCare public void waitForCoresToBeInState(CoreSubsets allCoreSubsets, AppID appID, EnumSet<CPUState> cpuStates, Integer timeout, int timeBetweenPolls, EnumSet<CPUState> errorStates, int countBetweenFullChecks) throws IOException, InterruptedException, SpinnmanExceptionDescription copied from interface:TransceiverInterface
Waits for the specified cores running the given application to be in some target state or states. Handles failures.WARNING! This operation is unsafe in a multi-threaded context if the cores are over more than a single board.
- Specified by:
waitForCoresToBeInState
in interfaceTransceiverInterface
- Parameters:
allCoreSubsets
- the cores to check are in a given sync stateappID
- the application ID that being used by the simulationcpuStates
- The expected states once the applications are ready; success is when each application is in one of these statestimeout
- The amount of time to wait in milliseconds for the cores to reach one of the states, ornull
to wait for an unbounded amount of time.timeBetweenPolls
- Time between checking the state, in millisecondserrorStates
- Set of states that the application can be in that indicate an error, and so should raise an exceptioncountBetweenFullChecks
- The number of times to use the count signal before instead using the full CPU state check- Throws:
IOException
- If anything goes wrong with networking.InterruptedException
- If the thread is interrupted while waiting.SpinnmanException
- If some cores enter an error state or SpiNNaker rejects a message.
-
sendSignal
@ParallelUnsafe public void sendSignal(AppID appID, Signal signal) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Send a signal to an application.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
sendSignal
in interfaceTransceiverInterface
- Parameters:
appID
- The ID of the application to send tosignal
- The signal to send- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
setLEDs
@ParallelSafe public void setLEDs(HasCoreLocation core, Map<Integer,LEDAction> ledStates) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set LED states.- Specified by:
setLEDs
in interfaceTransceiverInterface
- Parameters:
core
- The coordinates of the core on which to set the LEDsledStates
- A map from LED index to state with 0 being off, 1 on and 2 inverted.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
locateSpinnakerConnection
Description copied from interface:TransceiverInterface
Find a connection that matches the given board IP address.- Specified by:
locateSpinnakerConnection
in interfaceTransceiverInterface
- Parameters:
boardAddress
- The IP address of the Ethernet connection on the board- Returns:
- A connection for the given IP address, or
null
if no such connection exists
-
setIPTag
@ParallelSafeWithCare public void setIPTag(IPTag tag) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set up an IP tag.- Specified by:
setIPTag
in interfaceTransceiverInterface
- Parameters:
tag
- The tag to set up; note its board address can benull
, in which case, the tag will be assigned to all boards.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
setIPTag
@ParallelSafeWithCare public void setIPTag(IPTag tag, SDPConnection connection) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set up an IP tag to deliver messages to a particular connection.- Specified by:
setIPTag
in interfaceTransceiverInterface
- Parameters:
tag
- The tag to set up.connection
- The connection to deliver messages to, which must already be set up to talk to the correct board.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
setReverseIPTag
@ParallelSafeWithCare public void setReverseIPTag(ReverseIPTag tag) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set up a reverse IP tag.- Specified by:
setReverseIPTag
in interfaceTransceiverInterface
- Parameters:
tag
- The reverse tag to set up; note its board address can benull
, in which case, the tag will be assigned to all boards- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
clearIPTag
@ParallelSafeWithCare public void clearIPTag(int tag, InetAddress boardAddress) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Clear the setting of an IP tag.- Specified by:
clearIPTag
in interfaceTransceiverInterface
- Parameters:
tag
- The tag IDboardAddress
- Board address where the tag should be cleared. Ifnull
, all SCPSender connections will send the message to clear the tag- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getTags
@CheckReturnValue @ParallelSafeWithCare public List<Tag> getTags(SCPConnection connection) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get the current set of tags that have been set on the board.- Specified by:
getTags
in interfaceTransceiverInterface
- Parameters:
connection
- Connection from which the tags should be received.- Returns:
- An iterable of tags
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getTagUsage
@CheckReturnValue @ParallelSafeWithCare public Map<Tag,Integer> getTagUsage(SCPConnection connection) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get the number of times each tag has had a message sent via it for a connection.- Specified by:
getTagUsage
in interfaceTransceiverInterface
- Parameters:
connection
- Connection from which the tag usage should be retrieved.- Returns:
- A map from the tags to their usage.
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
mallocSDRAM
@CheckReturnValue @ParallelSafe public MemoryLocation mallocSDRAM(HasChipLocation chip, int size, AppID appID, int tag) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Allocates a chunk of SDRAM on a chip on the machine.- Specified by:
mallocSDRAM
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chip onto which to allocate memorysize
- The amount of memory to allocate in bytesappID
- The ID of the application with which to associate the routes.tag
- The tag for the SDRAM, a 8-bit (chip-wide) tag that can be looked up by a SpiNNaker application to discover the address of the allocated block.- Returns:
- the base address of the allocated memory
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
freeSDRAM
@ParallelSafe public void freeSDRAM(HasChipLocation chip, MemoryLocation baseAddress) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Free allocated SDRAM.- Specified by:
freeSDRAM
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chip onto which to free memorybaseAddress
- The base address of the allocated memory- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
freeSDRAM
@ParallelSafe public int freeSDRAM(HasChipLocation chip, AppID appID) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Free all SDRAM allocated to a given application ID.- Specified by:
freeSDRAM
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chip onto which to free memoryappID
- The app ID of the owner of the allocated memory- Returns:
- The number of blocks freed
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
loadMulticastRoutes
@ParallelSafe public void loadMulticastRoutes(HasChipLocation chip, Collection<MulticastRoutingEntry> routes, AppID appID) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Load a set of multicast routes on to a chip.- Specified by:
loadMulticastRoutes
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chip onto which to load the routesroutes
- An iterable of multicast routes to loadappID
- The ID of the application with which to associate the routes.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
loadFixedRoute
@ParallelSafe public void loadFixedRoute(HasChipLocation chip, RoutingEntry fixedRoute, AppID appID) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Loads a fixed route routing table entry onto a chip's router.- Specified by:
loadFixedRoute
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chip onto which to load the routefixedRoute
- the route for the fixed route entry on this chipappID
- The ID of the application with which to associate the route.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
readFixedRoute
@CheckReturnValue @ParallelSafe public RoutingEntry readFixedRoute(HasChipLocation chip, AppID appID) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Reads a fixed route routing table entry from a chip's router.- Specified by:
readFixedRoute
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinate of the chip from which to read the route.appID
- The ID of the application associated the route.- Returns:
- the route as a fixed route entry
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getMulticastRoutes
@CheckReturnValue @ParallelSafe public List<MulticastRoutingEntry> getMulticastRoutes(HasChipLocation chip, AppID appID) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get the current multicast routes set up on a chip.- Specified by:
getMulticastRoutes
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chip from which to get the routesappID
- The ID of the application to filter the routes for.null
means "don't filter".- Returns:
- An iterable of multicast routes
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
clearMulticastRoutes
@ParallelSafe public void clearMulticastRoutes(HasChipLocation chip) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Remove all the multicast routes on a chip.- Specified by:
clearMulticastRoutes
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chip on which to clear the routes- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getRouterDiagnostics
@CheckReturnValue @ParallelSafe public RouterDiagnostics getRouterDiagnostics(HasChipLocation chip) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get router diagnostic information from a chip.- Specified by:
getRouterDiagnostics
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chip from which to get the information- Returns:
- The router diagnostic information
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
setRouterDiagnosticFilter
@ParallelSafe public void setRouterDiagnosticFilter(HasChipLocation chip, int position, DiagnosticFilter diagnosticFilter) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Sets a router diagnostic filter in a router.- Specified by:
setRouterDiagnosticFilter
in interfaceTransceiverInterface
- Parameters:
chip
- the address of the router in which this filter is being setposition
- the position in the list of filters where this filter is to be added, between 0 and 15 (note that positions 0 to 11 are used by the default filters, and setting these positions will result in a warning).diagnosticFilter
- the diagnostic filter being set in the position.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getRouterDiagnosticFilter
@ParallelSafe public DiagnosticFilter getRouterDiagnosticFilter(HasChipLocation chip, int position) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Gets a router diagnostic filter from a router.- Specified by:
getRouterDiagnosticFilter
in interfaceTransceiverInterface
- Parameters:
chip
- the address of the router from which this filter is being retrievedposition
- the position in the list of filters where this filter is to be read from- Returns:
- The diagnostic filter read
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
clearRouterDiagnosticCounters
@ParallelSafe public void clearRouterDiagnosticCounters(HasChipLocation chip, boolean enable, Iterable<Integer> counterIDs) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Clear router diagnostic information on a chip.- Specified by:
clearRouterDiagnosticCounters
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chipenable
- True (default) if the counters should be enabledcounterIDs
- The IDs of the counters to reset and enable if enable is True; each must be between 0 and 15- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
clearReinjectionQueues
@ParallelSafe public void clearReinjectionQueues(HasCoreLocation monitorCore) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Clear the packet reinjection queues in a monitor process.- Specified by:
clearReinjectionQueues
in interfaceTransceiverInterface
- Parameters:
monitorCore
- The coordinates of the monitor core.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
clearReinjectionQueues
@ParallelSafe public void clearReinjectionQueues(CoreSubsets monitorCores) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Clear the packet reinjection queues in some monitor processes.- Specified by:
clearReinjectionQueues
in interfaceTransceiverInterface
- Parameters:
monitorCores
- The coordinates of the monitor cores.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getReinjectionStatus
@ParallelSafe public ReinjectionStatus getReinjectionStatus(HasCoreLocation monitorCore) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get the packet reinjection status of a monitor process.- Specified by:
getReinjectionStatus
in interfaceTransceiverInterface
- Parameters:
monitorCore
- The coordinates of the monitor core.- Returns:
- The reinjection status.
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getReinjectionStatus
@ParallelSafe public Map<CoreLocation,ReinjectionStatus> getReinjectionStatus(CoreSubsets monitorCores) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get the packet reinjection status of some monitor processes.- Specified by:
getReinjectionStatus
in interfaceTransceiverInterface
- Parameters:
monitorCores
- The coordinates of the monitor cores.- Returns:
- The reinjection statuses of the cores.
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
resetReinjectionCounters
@ParallelSafe public void resetReinjectionCounters(HasCoreLocation monitorCore) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Reset the packet reinjection counters of a monitor process.- Specified by:
resetReinjectionCounters
in interfaceTransceiverInterface
- Parameters:
monitorCore
- The coordinates of the monitor core.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
resetReinjectionCounters
@ParallelSafeWithCare public void resetReinjectionCounters(CoreSubsets monitorCores) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Reset the packet reinjection counters of some monitor processes.- Specified by:
resetReinjectionCounters
in interfaceTransceiverInterface
- Parameters:
monitorCores
- The coordinates of the monitor cores.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
setReinjectionTypes
@ParallelSafe public void setReinjectionTypes(HasCoreLocation monitorCore, boolean multicast, boolean pointToPoint, boolean fixedRoute, boolean nearestNeighbour) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set what types of packets are to be reinjected.- Specified by:
setReinjectionTypes
in interfaceTransceiverInterface
- Parameters:
monitorCore
- The coordinates of the monitor core.multicast
- True if multicast packets are to be reinjected.pointToPoint
- True if point-to-point packets are to be reinjected.fixedRoute
- True if fixed-route packets are to be reinjected.nearestNeighbour
- True if nearest-neighbour packets are to be reinjected.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
setReinjectionTypes
@ParallelSafeWithCare public void setReinjectionTypes(CoreSubsets monitorCores, boolean multicast, boolean pointToPoint, boolean fixedRoute, boolean nearestNeighbour) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set what types of packets are to be reinjected.- Specified by:
setReinjectionTypes
in interfaceTransceiverInterface
- Parameters:
monitorCores
- The coordinates of some monitor cores.multicast
- True if multicast packets are to be reinjected.pointToPoint
- True if point-to-point packets are to be reinjected.fixedRoute
- True if fixed-route packets are to be reinjected.nearestNeighbour
- True if nearest-neighbour packets are to be reinjected.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
setReinjectionEmergencyTimeout
@ParallelSafe public void setReinjectionEmergencyTimeout(HasCoreLocation monitorCore, int timeoutMantissa, int timeoutExponent) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set the emergency packet reinjection timeout.- Specified by:
setReinjectionEmergencyTimeout
in interfaceTransceiverInterface
- Parameters:
monitorCore
- The coordinates of the monitor core.timeoutMantissa
- The mantissa of the timeout value, between 0 and 15.timeoutExponent
- The exponent of the timeout value, between 0 and 15.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
setReinjectionEmergencyTimeout
@ParallelSafeWithCare public void setReinjectionEmergencyTimeout(CoreSubsets monitorCores, int timeoutMantissa, int timeoutExponent) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set the emergency packet reinjection timeout.- Specified by:
setReinjectionEmergencyTimeout
in interfaceTransceiverInterface
- Parameters:
monitorCores
- The coordinates of some monitor cores.timeoutMantissa
- The mantissa of the timeout value, between 0 and 15.timeoutExponent
- The exponent of the timeout value, between 0 and 15.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
setReinjectionTimeout
@ParallelSafe public void setReinjectionTimeout(HasCoreLocation monitorCore, int timeoutMantissa, int timeoutExponent) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set the packet reinjection timeout.- Specified by:
setReinjectionTimeout
in interfaceTransceiverInterface
- Parameters:
monitorCore
- The coordinates of the monitor core.timeoutMantissa
- The mantissa of the timeout value, between 0 and 15.timeoutExponent
- The exponent of the timeout value, between 0 and 15.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
setReinjectionTimeout
@ParallelSafeWithCare public void setReinjectionTimeout(CoreSubsets monitorCores, int timeoutMantissa, int timeoutExponent) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Set the packet reinjection timeout.- Specified by:
setReinjectionTimeout
in interfaceTransceiverInterface
- Parameters:
monitorCores
- The coordinates of some monitor cores.timeoutMantissa
- The mantissa of the timeout value, between 0 and 15.timeoutExponent
- The exponent of the timeout value, between 0 and 15.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
getHeap
@CheckReturnValue @ParallelSafe public List<HeapElement> getHeap(HasChipLocation chip, SystemVariableDefinition heap) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Get the contents of the given heap on a given chip.- Specified by:
getHeap
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chipheap
- The SystemVariableDefinition which is the heap to read- Returns:
- the list of chunks in the heap
- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
fillMemory
@ParallelSafe public void fillMemory(HasChipLocation chip, MemoryLocation baseAddress, int repeatValue, int size, FillDataType dataType) throws ProcessException, IOException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Fill some memory with repeated data.- Specified by:
fillMemory
in interfaceTransceiverInterface
- Parameters:
chip
- The coordinates of the chipbaseAddress
- The address at which to start the fillrepeatValue
- The data to repeatsize
- The number of bytes to fill. Must be compatible with the data type i.e. if the data type is WORD, the number of bytes must be divisible by 4dataType
- The type of data to fill.- Throws:
ProcessException
- If SpiNNaker rejects a message.IOException
- If anything goes wrong with networking.InterruptedException
- If the communications were interrupted.
-
saveApplicationRouterTables
@ParallelSafeWithCare public void saveApplicationRouterTables(CoreSubsets monitorCores) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Save the application's multicast router tables.- Specified by:
saveApplicationRouterTables
in interfaceTransceiverInterface
- Parameters:
monitorCores
- The coordinates of some monitor cores; the routers on those chips will have their (current) multicast router tables saved.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
loadApplicationRouterTables
@ParallelSafeWithCare public void loadApplicationRouterTables(CoreSubsets monitorCores) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Load the (previously saved) application's multicast router tables. The router tables must have been previously saved.- Specified by:
loadApplicationRouterTables
in interfaceTransceiverInterface
- Parameters:
monitorCores
- The coordinates of some monitor cores; the routers on those chips will have their multicast router tables loaded.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
loadSystemRouterTables
@ParallelSafeWithCare public void loadSystemRouterTables(CoreSubsets monitorCores) throws IOException, ProcessException, InterruptedExceptionDescription copied from interface:TransceiverInterface
Load the (previously configured) system multicast router tables. The application's router tables must have been previously saved.- Specified by:
loadSystemRouterTables
in interfaceTransceiverInterface
- Parameters:
monitorCores
- The coordinates of some monitor cores; the routers on those chips will have their multicast router tables loaded.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.
-
close
Close the transceiver and any threads that are running.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBMPTransceiverInterface
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classUDPTransceiver
- Throws:
IOException
- If anything goes wrong
-
close
public void close(boolean closeOriginalConnections, boolean powerOffMachine) throws IOException, InterruptedExceptionClose the transceiver and any threads that are running.- Parameters:
closeOriginalConnections
- If True, the original connections passed to the transceiver in the constructor are also closed. If False, only newly discovered connections are closed.powerOffMachine
- if true, the machine is sent a power down command via its BMP (if it has one)- Throws:
IOException
- If anything goes wrong with networkingInterruptedException
- If interrupted while waiting for the machine to power down (only if that is requested).
-
getBMPConnection
- Returns:
- The connection selectors used for BMP connections.
-
addConnection
Description copied from class:UDPTransceiver
Add a connection to the collection of general connections managed by this class.- Specified by:
addConnection
in classUDPTransceiver
- Parameters:
connection
- the connection to add
-
bind
Description copied from interface:BMPTransceiverInterface
Set the default BMP coordinates, at least for cabinet and frame.- Specified by:
bind
in interfaceBMPTransceiverInterface
- Parameters:
bmp
- The new default coordinates.
-
getBoundBMP
- Specified by:
getBoundBMP
in interfaceBMPTransceiverInterface
- Returns:
- The currently bound BMP coordinates. Defaults to 0,0 if not set
by
BMPTransceiverInterface.bind(BMPCoords)
.
-