apollo
apollo copied to clipboard
Enhance error message on bitstream mismatch
In case of a bitstream for a wrong FPGA I get the error message
OSError: Configuration failed: part ID mismatch / (04a00e10)
It seems to be generated here
The message could be a little more clear:
- Why is this an OSError?
- what mismatched (part IDs of the FPGA and the bitstream?)
- add human readable representation of the part IDs
- which part ID is actually shown? the ID in the bitstream or of the installed FPGA?
I would suggest an error message similar to the following:
configuration failed: trying to load a bitstream generated for FPGA Lattice ECP5 LFE5U-12 partid 04a00e10 onto an incompatible FPGA Lattice ECP5 LFE5U-25 partid 0x41111043
To clarify, 04a00e10
is not either of the part IDs - it's a status code returned to the host.
We'll need to rearrange the code a bit to display a better error message, since we don't have the necessary context in _validate_status
and we may need to send additional requests to the board.