Class UnimplementedBMPTransceiver
java.lang.Object
uk.ac.manchester.spinnaker.transceiver.UnimplementedBMPTransceiver
- All Implemented Interfaces:
AutoCloseable,BMPTransceiverInterface
A transceiver where every operation (except the few mandatory ones) fails
with
UnsupportedOperationException. A suitable base for partial
implementations.- Author:
- Donal Fellows
-
Nested Class Summary
Nested classes/interfaces inherited from interface uk.ac.manchester.spinnaker.transceiver.BMPTransceiverInterface
BMPTransceiverInterface.FPGAResetType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionavailableBoards(BMPCoords bmp) List which boards are actually available to be manipulated by a particular BMP.voidSet the default BMP coordinates, at least for cabinet and frame.voidclose()booleangetResetStatus(BMPCoords bmp, BMPBoard board) Get the FPGA reset status.getSerialFlashBuffer(BMPCoords bmp, BMPBoard board) Get the address of the serial flash buffer.intPing a board.voidpower(PowerCommand powerCommand, BMPCoords bmp, Collection<BMPBoard> boards) Send a power request to the machine.voidPower off the whole machine.voidPower on the whole machine.readADCData(BMPCoords bmp, BMPBoard board) Read the ADC data.readBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int length) Read BMP memory.readBMPVersion(BMPCoords bmp, BMPBoard board) Read the BMP version.readBoardSerialNumber(BMPCoords bmp, BMPBoard board) Read the BMP serial number from a board.intreadFPGARegister(FPGA fpga, MemoryLocation register, BMPCoords bmp, BMPBoard board) Read a register on a FPGA of a board.readSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int length) Read BMP serial flash memory.intreadSerialFlashCRC(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int length) Read the CRC32 checksum of BMP serial flash memory.voidresetFPGA(BMPCoords bmp, BMPBoard board, BMPTransceiverInterface.FPGAResetType resetType) Reset the FPGAs on a board.voidsetLED(Collection<Integer> leds, LEDAction action, BMPCoords bmp, Collection<BMPBoard> board) Set the LED state of a board in the machine.voidwriteBMPFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress) Write a fixed size chunk to flash memory of a BMP with erase.voidwriteBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, File file) Write BMP memory from a file.voidwriteBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, ByteBuffer data) Write BMP memory.voidwriteFlash(@Valid BMPCoords bmp, @Valid BMPBoard board, @NotNull MemoryLocation baseAddress, @NotNull ByteBuffer data) Write a buffer to flash memory on the BMP.voidwriteFPGARegister(FPGA fpga, MemoryLocation register, int value, BMPCoords bmp, BMPBoard board) Write a register on a FPGA of a board.voidwriteSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int size, InputStream stream) Write BMP serial flash memory from a stream.voidwriteSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, File file) Write BMP serial flash memory from a file.voidwriteSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, ByteBuffer data) Write BMP serial flash memory.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
Constructor Details
-
UnimplementedBMPTransceiver
public UnimplementedBMPTransceiver()
-
-
Method Details
-
powerOnMachine
Description copied from interface:BMPTransceiverInterfacePower on the whole machine.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
powerOnMachinein interfaceBMPTransceiverInterface- Throws:
InterruptedException- If the thread is interrupted while waiting.IOException- If anything goes wrong with networking.ProcessException- If SpiNNaker rejects a message.
-
powerOffMachine
Description copied from interface:BMPTransceiverInterfacePower off the whole machine.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
powerOffMachinein interfaceBMPTransceiverInterface- Throws:
InterruptedException- If the thread is interrupted while waiting.IOException- If anything goes wrong with networking.ProcessException- If SpiNNaker rejects a message.
-
power
public void power(PowerCommand powerCommand, BMPCoords bmp, Collection<BMPBoard> boards) throws InterruptedException, IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceSend a power request to the machine.WARNING! This operation is unsafe in a multi-threaded context.
- Specified by:
powerin 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
public void setLED(Collection<Integer> leds, LEDAction action, BMPCoords bmp, Collection<BMPBoard> board) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceSet the LED state of a board in the machine.- Specified by:
setLEDin 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.
-
readFPGARegister
public int readFPGARegister(FPGA fpga, MemoryLocation register, BMPCoords bmp, BMPBoard board) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceRead a register on a FPGA of a board. The meaning of the register's contents will depend on the FPGA's configuration.- Specified by:
readFPGARegisterin 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.
-
writeFPGARegister
public void writeFPGARegister(FPGA fpga, MemoryLocation register, int value, BMPCoords bmp, BMPBoard board) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceWrite 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:
writeFPGARegisterin 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.
-
readADCData
Description copied from interface:BMPTransceiverInterfaceRead the ADC data.- Specified by:
readADCDatain 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.
-
readBMPVersion
public VersionInfo readBMPVersion(BMPCoords bmp, BMPBoard board) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceRead the BMP version.- Specified by:
readBMPVersionin 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.
-
getResetStatus
Description copied from interface:BMPTransceiverInterfaceGet the FPGA reset status.- Specified by:
getResetStatusin 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.
-
resetFPGA
public void resetFPGA(BMPCoords bmp, BMPBoard board, BMPTransceiverInterface.FPGAResetType resetType) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceReset the FPGAs on a board.- Specified by:
resetFPGAin 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.
-
readBMPMemory
public ByteBuffer readBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int length) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceRead BMP memory.- Specified by:
readBMPMemoryin 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:
IOException- If anything goes wrong with networking.ProcessException- If SpiNNaker rejects a message.
-
writeBMPMemory
public void writeBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, ByteBuffer data) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceWrite BMP memory.- Specified by:
writeBMPMemoryin 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.
-
writeBMPMemory
public void writeBMPMemory(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, File file) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceWrite BMP memory from a file.- Specified by:
writeBMPMemoryin 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.
-
readSerialFlash
public ByteBuffer readSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int length) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceRead BMP serial flash memory.- Specified by:
readSerialFlashin 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.
-
readSerialFlashCRC
public int readSerialFlashCRC(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int length) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceRead the CRC32 checksum of BMP serial flash memory.- Specified by:
readSerialFlashCRCin 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 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.
-
writeSerialFlash
public void writeSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, File file) throws ProcessException, IOException Description copied from interface:BMPTransceiverInterfaceWrite BMP serial flash memory from a file.- Specified by:
writeSerialFlashin 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.
-
writeSerialFlash
public void writeSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, ByteBuffer data) throws ProcessException, IOException Description copied from interface:BMPTransceiverInterfaceWrite BMP serial flash memory.- Specified by:
writeSerialFlashin 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.
-
writeFlash
public void writeFlash(@Valid @Valid BMPCoords bmp, @Valid @Valid BMPBoard board, @NotNull @NotNull MemoryLocation baseAddress, @NotNull @NotNull ByteBuffer data) throws ProcessException, IOException, InterruptedException Description copied from interface:BMPTransceiverInterfaceWrite a buffer to flash memory on the BMP. This is a composite operation.- Specified by:
writeFlashin 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.
-
getSerialFlashBuffer
public MemoryLocation getSerialFlashBuffer(BMPCoords bmp, BMPBoard board) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceGet the address of the serial flash buffer.- Specified by:
getSerialFlashBufferin 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.
-
writeSerialFlash
public void writeSerialFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress, int size, InputStream stream) throws ProcessException, IOException Description copied from interface:BMPTransceiverInterfaceWrite BMP serial flash memory from a stream.- Specified by:
writeSerialFlashin 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.
-
writeBMPFlash
public void writeBMPFlash(BMPCoords bmp, BMPBoard board, MemoryLocation baseAddress) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceWrite 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:
writeBMPFlashin 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?- Throws:
IOException- If anything goes wrong with networking.ProcessException- If SpiNNaker rejects a message.- See Also:
-
availableBoards
public MappableIterable<BMPBoard> availableBoards(BMPCoords bmp) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceList which boards are actually available to be manipulated by a particular BMP.- Specified by:
availableBoardsin 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.
-
readBoardSerialNumber
public String readBoardSerialNumber(BMPCoords bmp, BMPBoard board) throws IOException, ProcessException Description copied from interface:BMPTransceiverInterfaceRead the BMP serial number from a board.- Specified by:
readBoardSerialNumberin 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.
-
bind
Description copied from interface:BMPTransceiverInterfaceSet the default BMP coordinates, at least for cabinet and frame.- Specified by:
bindin interfaceBMPTransceiverInterface- Parameters:
bmp- The new default coordinates.
-
getBoundBMP
- Specified by:
getBoundBMPin interfaceBMPTransceiverInterface- Returns:
- The currently bound BMP coordinates. Defaults to 0,0 if not set
by
BMPTransceiverInterface.bind(BMPCoords).
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBMPTransceiverInterface- Throws:
IOException
-
pingBoard
Description copied from interface:BMPTransceiverInterfacePing a board.- Specified by:
pingBoardin interfaceBMPTransceiverInterface- Parameters:
address- The board IP address.- Returns:
- 0 on success, other values on failure (reflecting the result of the OS subprocess).
-