gowin: better error message when mismatch between fs idcode and target's idcode

This commit is contained in:
Gwenhael Goavec-Merou
2022-09-04 14:16:02 +02:00
parent 93aa9f4dd3
commit 09b65ef4cc
+4 -1
View File
@@ -127,7 +127,10 @@ Gowin::Gowin(Jtag *jtag, const string filename, const string &file_type, std::st
string idcode_str = _fs->getHeaderVal("idcode");
uint32_t fs_idcode = std::stoul(idcode_str.c_str(), NULL, 16);
if ((fs_idcode & 0x0fffffff) != idcode) {
throw std::runtime_error("mismatch between target's idcode and fs idcode");
char mess[256];
sprintf(mess, "mismatch between target's idcode and bitstream idcode\n"
"\tbitstream has 0x%08X hardware requires 0x%08x", fs_idcode, idcode);
throw std::runtime_error(mess);
}
}
}