From bca3bd6623797bc8d04818d7d0478fd88ecb74dd Mon Sep 17 00:00:00 2001 From: Catherine Date: Fri, 22 Dec 2023 21:07:23 +0000 Subject: [PATCH 1/2] Use correct format specifier for printing uint64_t. --- src/lattice.cpp | 2 +- src/xilinx.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lattice.cpp b/src/lattice.cpp index 5dc8b36..b81152d 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -1048,7 +1048,7 @@ void Lattice::displayReadReg(uint64_t dev) uint8_t err; printf("displayReadReg\n"); if (dev & 1<<0) printf("\tTRAN Mode\n"); - printf("\tConfig Target Selection : %lx\n", (dev >> 1) & 0x07); + printf("\tConfig Target Selection : %llx\n", (dev >> 1) & 0x07); if (dev & 1<<4) printf("\tJTAG Active\n"); if (dev & 1<<5) printf("\tPWD Protect\n"); if (dev & 1<<6) printf("\tOTP\n"); diff --git a/src/xilinx.cpp b/src/xilinx.cpp index e8df0ed..834f869 100644 --- a/src/xilinx.cpp +++ b/src/xilinx.cpp @@ -385,7 +385,7 @@ Xilinx::Xilinx(Jtag *jtag, const std::string &filename, if (read_dna) { if (_fpga_family == ARTIX_FAMILY || _fpga_family == KINTEXUS_FAMILY) { uint64_t dna = Xilinx::fuse_dna_read(); - printf("{\"dna\": \"0x%016lx\"}\n", dna); + printf("{\"dna\": \"0x%016llx\"}\n", dna); } else { throw std::runtime_error("Error: read_xadc only supported for Artix 7"); } From 8c6c0ee85af7dfb5d672b79901f92c582879f8a0 Mon Sep 17 00:00:00 2001 From: Catherine Date: Fri, 22 Dec 2023 21:07:33 +0000 Subject: [PATCH 2/2] Add WebAssembly support. --- src/gowin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gowin.cpp b/src/gowin.cpp index 3d064d6..600727d 100644 --- a/src/gowin.cpp +++ b/src/gowin.cpp @@ -231,7 +231,7 @@ bool Gowin::send_command(uint8_t cmd) #include #define le32toh(x) OSSwapLittleToHostInt32(x) #define htole32(x) OSSwapHostToLittleInt32(x) -#elif (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) || defined(__WINDOWS__) +#elif (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) || defined(__WINDOWS__) || defined(__wasm__) #if BYTE_ORDER == LITTLE_ENDIAN #if defined(_MSC_VER) #include