lattice: throw exception when program fails

This commit is contained in:
Gwenhael Goavec-Merou 2021-08-23 16:27:28 +02:00
parent 74b8305730
commit faedb0cfd7
1 changed files with 11 additions and 4 deletions

View File

@ -492,10 +492,14 @@ bool Lattice::program_flash(unsigned int offset)
DisableISC();
bool retval;
if (_file_extension == "jed")
program_intFlash();
retval = program_intFlash();
else
program_extFlash(offset);
retval = program_extFlash(offset);
if (!retval)
return false;
/* *************************** */
/* reload bitstream from flash */
@ -519,10 +523,13 @@ bool Lattice::program_flash(unsigned int offset)
void Lattice::program(unsigned int offset)
{
bool retval;
if (_mode == FLASH_MODE)
program_flash(offset);
retval = program_flash(offset);
else if (_mode == MEM_MODE)
program_mem();
retval = program_mem();
if (!retval)
throw std::exception();
}
bool Lattice::dumpFlash(const string &filename,