From 09b65ef4ccd4191730ed1bda46c716d64c7fdcb6 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sun, 4 Sep 2022 14:16:02 +0200 Subject: [PATCH] gowin: better error message when mismatch between fs idcode and target's idcode --- src/gowin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gowin.cpp b/src/gowin.cpp index 1637146..4c101db 100644 --- a/src/gowin.cpp +++ b/src/gowin.cpp @@ -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); } } }