mask idcode upper nibble (version in IEEE 1149.1)

This commit is contained in:
Gwenhael Goavec-Merou
2021-08-27 15:10:12 +02:00
parent faedb0cfd7
commit 304ec0071c
5 changed files with 52 additions and 46 deletions
+2 -2
View File
@@ -63,7 +63,7 @@ Gowin::Gowin(Jtag *jtag, const string filename, const string &file_type,
verify, verbose), is_gw1n1(false)
{
_fs = NULL;
uint32_t idcode = idCode();
uint32_t idcode = _jtag->get_target_device_id();;
if (!_file_extension.empty()) {
if (_file_extension == "fs") {
@@ -90,7 +90,7 @@ Gowin::Gowin(Jtag *jtag, const string filename, const string &file_type,
_fs->displayHeader();
string idcode_str = _fs->getHeaderVal("idcode");
uint32_t fs_idcode = std::stoul(idcode_str.c_str(), NULL, 16);
if (fs_idcode != idcode) {
if ((fs_idcode & 0x0fffffff) != idcode) {
throw std::runtime_error("mismatch between target's idcode and fs idcode");
}
} else {