Class FirmwareLoader
java.lang.Object
uk.ac.manchester.spinnaker.alloc.bmp.FirmwareLoader
@Component @Prototype public class FirmwareLoader extends Object
Handles loading of firmware into a BMP or an FPGA.
- Author:
- Donal Fellows
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FirmwareLoader.CRCFailedException
A CRC check failed.static class
FirmwareLoader.FirmwareLoaderException
Base class of exceptions thrown by the firmware loader.static class
FirmwareLoader.RegisterSet
Instructions to set a register on one or more FPGAs.static class
FirmwareLoader.TooLargeException
A data chunk was too large for the firmware loader to handle.static class
FirmwareLoader.UpdateFailedException
An update of the firmware on a BMP failed. -
Constructor Summary
Constructors Constructor Description FirmwareLoader(BMPTransceiverInterface txrx, BMPBoard board)
-
Method Summary
Modifier and Type Method Description void
bitLoad(boolean postDelay)
Load the FPGA definitions.void
setupBitfile(String handle, int slot, FPGA chip)
Set a bitfile to be loaded.void
setupRegisters(FirmwareLoader.RegisterSet... settings)
The write part ofcmd_xreg
frombmpc
.
-
Constructor Details
-
FirmwareLoader
- Parameters:
txrx
- How to talk to BMPs. The specific BMP to talk to must have been bound.board
- Which board's BMP are we really working with.
-
-
Method Details
-
setupRegisters
public void setupRegisters(FirmwareLoader.RegisterSet... settings) throws ProcessException, IOException, InterruptedExceptionThe write part ofcmd_xreg
frombmpc
.- Parameters:
settings
- The registers to set.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.InterruptedException
- If the communications were interrupted.FirmwareLoader.UpdateFailedException
- If the flash data sector read back does not match what we wanted to write.
-
setupBitfile
public void setupBitfile(String handle, int slot, FPGA chip) throws IOException, ProcessException, InterruptedExceptionSet a bitfile to be loaded.- Parameters:
handle
- The bitfile handle, matching one of the resources known to this bean.slot
- Which slot to install the bitfile in.chip
- Which chip or chips are to load the bitfile.- Throws:
IOException
- If anything goes wrong with networking.ProcessException
- If SpiNNaker rejects a message.FirmwareLoader.TooLargeException
- If the bitfile is too large for the BMP's buffer.FirmwareLoader.CRCFailedException
- If the written bitfile fails its CRC check.FirmwareLoader.UpdateFailedException
- If the flash data sector read back does not match what we wanted to write.InterruptedException
- If the communications were interrupted.
-
bitLoad
Load the FPGA definitions.- Parameters:
postDelay
- Whether to do the long delay after the FPGA boot/check- Throws:
InterruptedException
- If interrupted while sleepingProcessException
- If a BMP rejects a messageIOException
- If the network fails or the packaged bitfiles are unreadableFirmwareLoader.FirmwareLoaderException
- If something goes wrong.
-