Mock Version: 1.4.14 ENTER ['do'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target i686 --nodeps /builddir/build/SPECS/icestorm.spec'], chrootPath='/var/lib/mock/870521-fedora-rawhide-i386-1552997197.580194/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'}shell=Falselogger=timeout=0uid=1001gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.pugiew11:/etc/resolv.conf']unshare_net=TrueprintOutput=True) Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '2d9ee9cfed4543179bcfcb66b944a90a', '-D', '/var/lib/mock/870521-fedora-rawhide-i386-1552997197.580194/root', '-a', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.pugiew11:/etc/resolv.conf', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=en_US.UTF-8', '-u', 'mockbuild', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target i686 --nodeps /builddir/build/SPECS/icestorm.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'} and shell False Building target platforms: i686 Building for target i686 Wrote: /builddir/build/SRPMS/icestorm-0-0.7.20190311gitfa1c932.fc31.src.rpm Child return code was: 0 ENTER ['do'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target i686 --nodeps /builddir/build/SPECS/icestorm.spec'], chrootPath='/var/lib/mock/870521-fedora-rawhide-i386-1552997197.580194/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'}shell=Falselogger=timeout=0uid=1001gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.pugiew11:/etc/resolv.conf']unshare_net=TrueprintOutput=True) Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '2e634c904e8841569a913cb51f70746e', '-D', '/var/lib/mock/870521-fedora-rawhide-i386-1552997197.580194/root', '-a', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.pugiew11:/etc/resolv.conf', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=en_US.UTF-8', '-u', 'mockbuild', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target i686 --nodeps /builddir/build/SPECS/icestorm.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'} and shell False Building target platforms: i686 Building for target i686 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.prrHJV + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1 + /usr/bin/gzip -dc /builddir/build/SOURCES/icestorm-fa1c932.tar.gz + /usr/bin/tar -xof - + STATUS=0 + '[' 0 -ne 0 ']' + cd icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + echo 'Patch #1 (icestorm-datadir.patch):' Patch #1 (icestorm-datadir.patch): + /usr/bin/patch --no-backup-if-mismatch -p1 -b --suffix .datadir --fuzz=0 patching file icebox/icebox_vlog.py Hunk #1 succeeded at 383 (offset 16 lines). + find . -name '*.py' -exec sed -i 's|/usr/bin/env python3|/usr/bin/python3|' '{}' ';' + find . -name .gitignore -delete + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.xvpegf + umask 022 + cd /builddir/build/BUILD + cd icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1 + make -j2 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/libftdi1' 'CXXFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/libftdi1' PREFIX=/usr CHIPDB_SUBDIR=icestorm 'LDFLAGS=-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' make -C icebox all make -C icepack all make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icepack' g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/libftdi1 -c -o icepack.o icepack.cc make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icebox' python3 icebox_chipdb.py -3 > chipdb-384.new BUILDSTDERR: icepack.cc: In member function 'void FpgaConfig::write_ascii(std::ostream&) const': BUILDSTDERR: icepack.cc:53:41: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'std::vector >::size_type' {aka 'unsigned int'} [-Wformat=] BUILDSTDERR: 53 | #define error(...) do { fprintf(stderr, "Error: " __VA_ARGS__); exit(1); } while (0) BUILDSTDERR: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 54 | #define panic(fmt, ...) do { fprintf(stderr, "Internal Error at %s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__); abort(); } while (0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 55 | BUILDSTDERR: | BUILDSTDERR: 56 | string vstringf(const char *fmt, va_list ap) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 57 | { BUILDSTDERR: | ~ BUILDSTDERR: 58 | string string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 59 | char *str = NULL; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 60 | BUILDSTDERR: | BUILDSTDERR: 61 | #ifdef _WIN32 BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 62 | int sz = 64, rc; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 63 | while (1) { BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 64 | va_list apc; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 65 | va_copy(apc, ap); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 66 | str = (char*)realloc(str, sz); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 67 | rc = vsnprintf(str, sz, fmt, apc); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 68 | va_end(apc); BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 69 | if (rc >= 0 && rc < sz) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 70 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 71 | sz *= 2; BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 72 | } BUILDSTDERR: | ~ BUILDSTDERR: 73 | #else BUILDSTDERR: | ~~~~~ BUILDSTDERR: 74 | if (vasprintf(&str, fmt, ap) < 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 75 | str = NULL; BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 76 | #endif BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 77 | BUILDSTDERR: | BUILDSTDERR: 78 | if (str != NULL) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 79 | string = str; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 80 | free(str); BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 81 | } BUILDSTDERR: | ~ BUILDSTDERR: 82 | BUILDSTDERR: | BUILDSTDERR: 83 | return string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 84 | } BUILDSTDERR: | ~ BUILDSTDERR: 85 | BUILDSTDERR: | BUILDSTDERR: 86 | string stringf(const char *fmt, ...) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 87 | { BUILDSTDERR: | ~ BUILDSTDERR: 88 | string string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 89 | va_list ap; BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 90 | BUILDSTDERR: | BUILDSTDERR: 91 | va_start(ap, fmt); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 92 | string = vstringf(fmt, ap); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 93 | va_end(ap); BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 94 | BUILDSTDERR: | BUILDSTDERR: 95 | return string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 96 | } BUILDSTDERR: | ~ BUILDSTDERR: 97 | BUILDSTDERR: | BUILDSTDERR: 98 | // ================================================================== BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 99 | // FpgaConfig stuff BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 100 | BUILDSTDERR: | BUILDSTDERR: 101 | struct FpgaConfig BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 102 | { BUILDSTDERR: | ~ BUILDSTDERR: 103 | string device; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 104 | string freqrange; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 105 | string nosleep; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 106 | string warmboot; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 107 | BUILDSTDERR: | BUILDSTDERR: 108 | // cram[BANK][X][Y] BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 109 | int cram_width, cram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 110 | vector>> cram; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 111 | BUILDSTDERR: | BUILDSTDERR: 112 | // bram[BANK][X][Y] BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 113 | int bram_width, bram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 114 | vector>> bram; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 115 | BUILDSTDERR: | BUILDSTDERR: 116 | // data before preamble BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 117 | vector initblop; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 118 | BUILDSTDERR: | BUILDSTDERR: 119 | // bitstream i/o BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 120 | void read_bits(std::istream &ifs); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 121 | void write_bits(std::ostream &ofs) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 122 | BUILDSTDERR: | BUILDSTDERR: 123 | // icebox i/o BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 124 | void read_ascii(std::istream &ifs, bool nosleep); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 125 | void write_ascii(std::ostream &ofs) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 126 | BUILDSTDERR: | BUILDSTDERR: 127 | // netpbm i/o BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 128 | void write_cram_pbm(std::ostream &ofs, int bank_num = -1) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 129 | void write_bram_pbm(std::ostream &ofs, int bank_num = -1) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 130 | BUILDSTDERR: | BUILDSTDERR: 131 | // query chip type metadata BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 132 | int chip_width() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 133 | int chip_height() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 134 | vector chip_cols() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 135 | BUILDSTDERR: | BUILDSTDERR: 136 | // query tile metadata BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 137 | string tile_type(int x, int y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 138 | int tile_width(const string &type) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 139 | BUILDSTDERR: | BUILDSTDERR: 140 | // cram bit manipulation BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 141 | void cram_clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 142 | void cram_fill_tiles(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 143 | void cram_checkerboard(int m = 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 144 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 145 | BUILDSTDERR: | BUILDSTDERR: 146 | struct CramIndexConverter BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 147 | { BUILDSTDERR: | ~ BUILDSTDERR: 148 | const FpgaConfig *fpga; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 149 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 150 | BUILDSTDERR: | BUILDSTDERR: 151 | string tile_type; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 152 | int tile_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 153 | int column_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 154 | BUILDSTDERR: | BUILDSTDERR: 155 | bool left_right_io; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 156 | bool right_half; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 157 | bool top_half; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 158 | BUILDSTDERR: | BUILDSTDERR: 159 | int bank_num; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 160 | int bank_tx; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 161 | int bank_ty; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 162 | int bank_xoff; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 163 | int bank_yoff; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 164 | BUILDSTDERR: | BUILDSTDERR: 165 | CramIndexConverter(const FpgaConfig *fpga, int tile_x, int tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 166 | void get_cram_index(int bit_x, int bit_y, int &cram_bank, int &cram_x, int &cram_y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 167 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 168 | BUILDSTDERR: | BUILDSTDERR: 169 | struct BramIndexConverter BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 170 | { BUILDSTDERR: | ~ BUILDSTDERR: 171 | const FpgaConfig *fpga; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 172 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 173 | BUILDSTDERR: | BUILDSTDERR: 174 | int bank_num; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 175 | int bank_off; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 176 | BUILDSTDERR: | BUILDSTDERR: 177 | BramIndexConverter(const FpgaConfig *fpga, int tile_x, int tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 178 | void get_bram_index(int bit_x, int bit_y, int &bram_bank, int &bram_x, int &bram_y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 179 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 180 | BUILDSTDERR: | BUILDSTDERR: 181 | static void update_crc16(uint16_t &crc, uint8_t byte) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 182 | { BUILDSTDERR: | ~ BUILDSTDERR: 183 | // CRC-16-CCITT, Initialize to 0xFFFF, No zero padding BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 184 | for (int i = 7; i >= 0; i--) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 185 | uint16_t xor_value = ((crc >> 15) ^ ((byte >> i) & 1)) ? 0x1021 : 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 186 | crc = (crc << 1) ^ xor_value; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 187 | } BUILDSTDERR: | ~ BUILDSTDERR: 188 | } BUILDSTDERR: | ~ BUILDSTDERR: 189 | BUILDSTDERR: | BUILDSTDERR: 190 | static uint8_t read_byte(std::istream &ifs, uint16_t &crc_value, int &file_offset) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 191 | { BUILDSTDERR: | ~ BUILDSTDERR: 192 | int byte = ifs.get(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 193 | BUILDSTDERR: | BUILDSTDERR: 194 | if (byte < 0) BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 195 | error("Unexpected end of file.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 196 | BUILDSTDERR: | BUILDSTDERR: 197 | file_offset++; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 198 | update_crc16(crc_value, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 199 | BUILDSTDERR: | BUILDSTDERR: 200 | return byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 201 | } BUILDSTDERR: | ~ BUILDSTDERR: 202 | BUILDSTDERR: | BUILDSTDERR: 203 | static void write_byte(std::ostream &ofs, uint16_t &crc_value, int &file_offset, uint8_t byte) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 204 | { BUILDSTDERR: | ~ BUILDSTDERR: 205 | ofs << byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 206 | file_offset++; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 207 | update_crc16(crc_value, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 208 | } BUILDSTDERR: | ~ BUILDSTDERR: 209 | BUILDSTDERR: | BUILDSTDERR: 210 | void FpgaConfig::read_bits(std::istream &ifs) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 211 | { BUILDSTDERR: | ~ BUILDSTDERR: 212 | int file_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 213 | uint16_t crc_value = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 214 | BUILDSTDERR: | BUILDSTDERR: 215 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 216 | info("Parsing bitstream file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 217 | BUILDSTDERR: | BUILDSTDERR: 218 | // skip initial comments until preamble is found BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 219 | BUILDSTDERR: | BUILDSTDERR: 220 | uint32_t preamble = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 221 | BUILDSTDERR: | BUILDSTDERR: 222 | while (1) BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 223 | { BUILDSTDERR: | ~ BUILDSTDERR: 224 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 225 | preamble = (preamble << 8) | byte; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 226 | if (preamble == 0xffffffff) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 227 | error("No preamble found in bitstream.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 228 | if (preamble == 0x7EAA997E) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 229 | info("Found preamble at offset %d.\n", file_offset-4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 230 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 231 | } BUILDSTDERR: | ~ BUILDSTDERR: 232 | initblop.push_back(byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 233 | } BUILDSTDERR: | ~ BUILDSTDERR: 234 | BUILDSTDERR: | BUILDSTDERR: 235 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 236 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 237 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 238 | BUILDSTDERR: | BUILDSTDERR: 239 | // main parser loop BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 240 | BUILDSTDERR: | BUILDSTDERR: 241 | int current_bank = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 242 | int current_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 243 | int current_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 244 | int current_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 245 | bool wakeup = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 246 | BUILDSTDERR: | BUILDSTDERR: 247 | this->cram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 248 | this->cram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 249 | BUILDSTDERR: | BUILDSTDERR: 250 | this->bram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 251 | this->bram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 252 | BUILDSTDERR: | BUILDSTDERR: 253 | while (!wakeup) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 254 | { BUILDSTDERR: | ~ BUILDSTDERR: 255 | // one command byte. the lower 4 bits of the command byte specify BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 256 | // the length of the command payload. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 257 | BUILDSTDERR: | BUILDSTDERR: 258 | uint8_t command = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 259 | uint32_t payload = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 260 | BUILDSTDERR: | BUILDSTDERR: 261 | for (int i = 0; i < (command & 0x0f); i++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 262 | payload = (payload << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 263 | BUILDSTDERR: | BUILDSTDERR: 264 | debug("Next command at offset %d: 0x%02x 0x%0*x\n", file_offset - 1 - (command & 0x0f), BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 265 | command, 2*(command & 0x0f), payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 266 | BUILDSTDERR: | BUILDSTDERR: 267 | uint16_t end_token; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 268 | BUILDSTDERR: | BUILDSTDERR: 269 | switch (command & 0xf0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 270 | { BUILDSTDERR: | ~ BUILDSTDERR: 271 | case 0x00: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 272 | switch (payload) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 273 | { BUILDSTDERR: | ~ BUILDSTDERR: 274 | case 0x01: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 275 | info("CRAM Data [%d]: %d x %d bits = %d bits = %d bytes\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 276 | current_bank, current_width, current_height, BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 277 | current_height*current_width, (current_height*current_width)/8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 278 | BUILDSTDERR: | BUILDSTDERR: 279 | this->cram_width = std::max(this->cram_width, current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 280 | this->cram_height = std::max(this->cram_height, current_offset + current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 281 | BUILDSTDERR: | BUILDSTDERR: 282 | this->cram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 283 | this->cram[current_bank].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 284 | for (int x = 0; x < current_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 285 | this->cram[current_bank][x].resize(this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 286 | BUILDSTDERR: | BUILDSTDERR: 287 | for (int i = 0; i < (current_height*current_width)/8; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 288 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 289 | for (int j = 0; j < 8; j++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 290 | int x = (i*8 + j) % current_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 291 | int y = (i*8 + j) / current_width + current_offset; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 292 | this->cram[current_bank][x][y] = ((byte << j) & 0x80) != 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 293 | } BUILDSTDERR: | ~ BUILDSTDERR: 294 | } BUILDSTDERR: | ~ BUILDSTDERR: 295 | BUILDSTDERR: | BUILDSTDERR: 296 | end_token = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 297 | end_token = (end_token << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 298 | if (end_token) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 299 | error("Expeded 0x0000 after CRAM data, got 0x%04x\n", end_token); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 300 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 301 | BUILDSTDERR: | BUILDSTDERR: 302 | case 0x03: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 303 | info("BRAM Data [%d]: %d x %d bits = %d bits = %d bytes\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 304 | current_bank, current_width, current_height, BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 305 | current_height*current_width, (current_height*current_width)/8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 306 | BUILDSTDERR: | BUILDSTDERR: 307 | this->bram_width = std::max(this->bram_width, current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 308 | this->bram_height = std::max(this->bram_height, current_offset + current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 309 | BUILDSTDERR: | BUILDSTDERR: 310 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 311 | this->bram[current_bank].resize(this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 312 | for (int x = 0; x < current_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 313 | this->bram[current_bank][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 314 | BUILDSTDERR: | BUILDSTDERR: 315 | for (int i = 0; i < (current_height*current_width)/8; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 316 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 317 | for (int j = 0; j < 8; j++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 318 | int x = (i*8 + j) % current_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 319 | int y = (i*8 + j) / current_width + current_offset; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 320 | this->bram[current_bank][x][y] = ((byte << j) & 0x80) != 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 321 | } BUILDSTDERR: | ~ BUILDSTDERR: 322 | } BUILDSTDERR: | ~ BUILDSTDERR: 323 | BUILDSTDERR: | BUILDSTDERR: 324 | end_token = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 325 | end_token = (end_token << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 326 | if (end_token) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 327 | error("Expeded 0x0000 after BRAM data, got 0x%04x\n", end_token); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 328 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 329 | BUILDSTDERR: | BUILDSTDERR: 330 | case 0x05: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 331 | debug("Resetting CRC.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 332 | crc_value = 0xffff; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 333 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 334 | BUILDSTDERR: | BUILDSTDERR: 335 | case 0x06: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 336 | info("Wakeup.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 337 | wakeup = true; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 338 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 339 | BUILDSTDERR: | BUILDSTDERR: 340 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 341 | error("Unknown command: 0x%02x 0x%02x\n", command, payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 342 | } BUILDSTDERR: | ~ BUILDSTDERR: 343 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 344 | BUILDSTDERR: | BUILDSTDERR: 345 | case 0x10: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 346 | current_bank = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 347 | debug("Set bank to %d.\n", current_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 348 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 349 | BUILDSTDERR: | BUILDSTDERR: 350 | case 0x20: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 351 | if (crc_value != 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 352 | error("CRC Check FAILED.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 353 | info("CRC Check OK.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 354 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 355 | BUILDSTDERR: | BUILDSTDERR: 356 | case 0x50: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 357 | if (payload == 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 358 | this->freqrange = "low"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 359 | else if (payload == 1) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 360 | this->freqrange = "medium"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 361 | else if (payload == 2) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 362 | this->freqrange = "high"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 363 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 364 | error("Unknown freqrange payload 0x%02x\n", payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 365 | info("Setting freqrange to '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 366 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 367 | BUILDSTDERR: | BUILDSTDERR: 368 | case 0x60: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 369 | current_width = payload + 1; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 370 | debug("Setting bank width to %d.\n", current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 371 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 372 | BUILDSTDERR: | BUILDSTDERR: 373 | case 0x70: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 374 | current_height = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 375 | debug("Setting bank height to %d.\n", current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 376 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 377 | BUILDSTDERR: | BUILDSTDERR: 378 | case 0x80: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 379 | current_offset = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 380 | debug("Setting bank offset to %d.\n", current_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 381 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 382 | BUILDSTDERR: | BUILDSTDERR: 383 | case 0x90: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 384 | switch(payload) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 385 | { BUILDSTDERR: | ~ BUILDSTDERR: 386 | case 0: BUILDSTDERR: | ~~~~~~~ BUILDSTDERR: 387 | this->warmboot = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 388 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 389 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 390 | case 1: BUILDSTDERR: | ~~~~~~~ BUILDSTDERR: 391 | this->warmboot = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 392 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 393 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 394 | case 32: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 395 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 396 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 397 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 398 | case 33: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 399 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 400 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 401 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 402 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 403 | error("Unknown warmboot/nosleep payload 0x%02x\n", payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 404 | } BUILDSTDERR: | ~ BUILDSTDERR: 405 | info("Setting warmboot to '%s', nosleep to '%s'.\n", this->warmboot.c_str(), this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 406 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 407 | BUILDSTDERR: | BUILDSTDERR: 408 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 409 | error("Unknown command: 0x%02x 0x%02x\n", command, payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 410 | } BUILDSTDERR: | ~ BUILDSTDERR: 411 | } BUILDSTDERR: | ~ BUILDSTDERR: 412 | BUILDSTDERR: | BUILDSTDERR: 413 | if (this->cram_width == 182 && this->cram_height == 80) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 414 | this->device = "384"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 415 | else if (this->cram_width == 332 && this->cram_height == 144) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 416 | this->device = "1k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 417 | else if (this->cram_width == 872 && this->cram_height == 272) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 418 | this->device = "8k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 419 | else if (this->cram_width == 692 && this->cram_height == 336) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 420 | this->device = "5k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 421 | else if (this->cram_width == 692 && this->cram_height == 176) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 422 | this->device = "u4k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 423 | else if (this->cram_width == 656 && this->cram_height == 176) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 424 | this->device = "lm4k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 425 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 426 | error("Failed to detect chip type.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 427 | BUILDSTDERR: | BUILDSTDERR: 428 | info("Chip type is '%s'.\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 429 | } BUILDSTDERR: | ~ BUILDSTDERR: 430 | BUILDSTDERR: | BUILDSTDERR: 431 | void FpgaConfig::write_bits(std::ostream &ofs) const BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 432 | { BUILDSTDERR: | ~ BUILDSTDERR: 433 | int file_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 434 | uint16_t crc_value = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 435 | BUILDSTDERR: | BUILDSTDERR: 436 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 437 | info("Writing bitstream file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 438 | BUILDSTDERR: | BUILDSTDERR: 439 | for (auto byte : this->initblop) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 440 | ofs << byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 441 | BUILDSTDERR: | BUILDSTDERR: 442 | debug("Writing preamble.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 443 | write_byte(ofs, crc_value, file_offset, 0x7E); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 444 | write_byte(ofs, crc_value, file_offset, 0xAA); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 445 | write_byte(ofs, crc_value, file_offset, 0x99); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 446 | write_byte(ofs, crc_value, file_offset, 0x7E); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 447 | BUILDSTDERR: | BUILDSTDERR: 448 | debug("Setting freqrange to '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 449 | write_byte(ofs, crc_value, file_offset, 0x51); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 450 | if (this->freqrange == "low") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 451 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 452 | else if (this->freqrange == "medium") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 453 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 454 | else if (this->freqrange == "high") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 455 | write_byte(ofs, crc_value, file_offset, 0x02); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 456 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 457 | error("Unknown freqrange '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 458 | BUILDSTDERR: | BUILDSTDERR: 459 | debug("Resetting CRC.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 460 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 461 | write_byte(ofs, crc_value, file_offset, 0x05); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 462 | crc_value = 0xffff; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 463 | BUILDSTDERR: | BUILDSTDERR: 464 | { BUILDSTDERR: | ~ BUILDSTDERR: 465 | uint8_t nosleep_flag; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 466 | debug("Setting warmboot to '%s', nosleep to '%s'.\n", this->warmboot.c_str(), this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 467 | write_byte(ofs, crc_value, file_offset, 0x92); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 468 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 469 | BUILDSTDERR: | BUILDSTDERR: 470 | if (this->nosleep == "disabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 471 | nosleep_flag = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 472 | else if (this->nosleep == "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 473 | nosleep_flag = 1; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 474 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 475 | error("Unknown nosleep setting '%s'.\n", this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 476 | BUILDSTDERR: | BUILDSTDERR: 477 | if (this->warmboot == "disabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 478 | write_byte(ofs, crc_value, file_offset, 0x00 | nosleep_flag); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 479 | else if (this->warmboot == "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 480 | write_byte(ofs, crc_value, file_offset, 0x20 | nosleep_flag); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 481 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 482 | error("Unknown warmboot setting '%s'.\n", this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 483 | } BUILDSTDERR: | ~ BUILDSTDERR: 484 | BUILDSTDERR: | BUILDSTDERR: 485 | debug("CRAM: Setting bank width to %d.\n", this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 486 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 487 | write_byte(ofs, crc_value, file_offset, (this->cram_width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 488 | write_byte(ofs, crc_value, file_offset, (this->cram_width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 489 | if(this->device != "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 490 | debug("CRAM: Setting bank height to %d.\n", this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 491 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 492 | write_byte(ofs, crc_value, file_offset, this->cram_height >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 493 | write_byte(ofs, crc_value, file_offset, this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 494 | } BUILDSTDERR: | ~ BUILDSTDERR: 495 | BUILDSTDERR: | BUILDSTDERR: 496 | debug("CRAM: Setting bank offset to 0.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 497 | write_byte(ofs, crc_value, file_offset, 0x82); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 498 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 499 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 500 | BUILDSTDERR: | BUILDSTDERR: 501 | for (int cram_bank = 0; cram_bank < 4; cram_bank++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 502 | { BUILDSTDERR: | ~ BUILDSTDERR: 503 | vector cram_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 504 | int height = this->cram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 505 | if(this->device == "5k" && ((cram_bank % 2) == 1)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 506 | height = height / 2 + 8; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 507 | for (int cram_y = 0; cram_y < height; cram_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 508 | for (int cram_x = 0; cram_x < this->cram_width; cram_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 509 | cram_bits.push_back(this->cram[cram_bank][cram_x][cram_y]); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 510 | BUILDSTDERR: | BUILDSTDERR: 511 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 512 | debug("CRAM: Setting bank height to %d.\n", height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 513 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 514 | write_byte(ofs, crc_value, file_offset, height >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 515 | write_byte(ofs, crc_value, file_offset, height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 516 | } BUILDSTDERR: | ~ BUILDSTDERR: 517 | BUILDSTDERR: | BUILDSTDERR: 518 | debug("CRAM: Setting bank %d.\n", cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 519 | write_byte(ofs, crc_value, file_offset, 0x11); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 520 | write_byte(ofs, crc_value, file_offset, cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 521 | BUILDSTDERR: | BUILDSTDERR: 522 | debug("CRAM: Writing bank %d data.\n", cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 523 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 524 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 525 | for (int i = 0; i < int(cram_bits.size()); i += 8) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 526 | uint8_t byte = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 527 | for (int j = 0; j < 8; j++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 528 | byte = (byte << 1) | (cram_bits[i+j] ? 1 : 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 529 | write_byte(ofs, crc_value, file_offset, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 530 | } BUILDSTDERR: | ~ BUILDSTDERR: 531 | BUILDSTDERR: | BUILDSTDERR: 532 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 533 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 534 | } BUILDSTDERR: | ~ BUILDSTDERR: 535 | BUILDSTDERR: | BUILDSTDERR: 536 | int bram_chunk_size = 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 537 | BUILDSTDERR: | BUILDSTDERR: 538 | if (this->bram_width && this->bram_height) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 539 | { BUILDSTDERR: | ~ BUILDSTDERR: 540 | if(this->device != "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 541 | debug("BRAM: Setting bank width to %d.\n", this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 542 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 543 | write_byte(ofs, crc_value, file_offset, (this->bram_width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 544 | write_byte(ofs, crc_value, file_offset, (this->bram_width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 545 | } BUILDSTDERR: | ~ BUILDSTDERR: 546 | BUILDSTDERR: | BUILDSTDERR: 547 | BUILDSTDERR: | BUILDSTDERR: 548 | debug("BRAM: Setting bank height to %d.\n", this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 549 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 550 | write_byte(ofs, crc_value, file_offset, bram_chunk_size >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 551 | write_byte(ofs, crc_value, file_offset, bram_chunk_size); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 552 | BUILDSTDERR: | BUILDSTDERR: 553 | for (int bram_bank = 0; bram_bank < 4; bram_bank++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 554 | { BUILDSTDERR: | ~ BUILDSTDERR: 555 | debug("BRAM: Setting bank %d.\n", bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 556 | write_byte(ofs, crc_value, file_offset, 0x11); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 557 | write_byte(ofs, crc_value, file_offset, bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 558 | BUILDSTDERR: | BUILDSTDERR: 559 | for (int offset = 0; offset < this->bram_height; offset += bram_chunk_size) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 560 | { BUILDSTDERR: | ~ BUILDSTDERR: 561 | vector bram_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 562 | int width = this->bram_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 563 | if(this->device == "5k" && ((bram_bank % 2) == 1)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 564 | width = width / 2; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 565 | for (int bram_y = 0; bram_y < bram_chunk_size; bram_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 566 | for (int bram_x = 0; bram_x < width; bram_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 567 | bram_bits.push_back(this->bram[bram_bank][bram_x][bram_y+offset]); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 568 | BUILDSTDERR: | BUILDSTDERR: 569 | debug("BRAM: Setting bank offset to %d.\n", offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 570 | write_byte(ofs, crc_value, file_offset, 0x82); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 571 | write_byte(ofs, crc_value, file_offset, offset >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 572 | write_byte(ofs, crc_value, file_offset, offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 573 | BUILDSTDERR: | BUILDSTDERR: 574 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 575 | debug("BRAM: Setting bank width to %d.\n", width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 576 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 577 | write_byte(ofs, crc_value, file_offset, (width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 578 | write_byte(ofs, crc_value, file_offset, (width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 579 | } BUILDSTDERR: | ~ BUILDSTDERR: 580 | BUILDSTDERR: | BUILDSTDERR: 581 | BUILDSTDERR: | BUILDSTDERR: 582 | debug("BRAM: Writing bank %d data.\n", bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 583 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 584 | write_byte(ofs, crc_value, file_offset, 0x03); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 585 | for (int i = 0; i < int(bram_bits.size()); i += 8) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 586 | uint8_t byte = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 587 | for (int j = 0; j < 8; j++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 588 | byte = (byte << 1) | (bram_bits[i+j] ? 1 : 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 589 | write_byte(ofs, crc_value, file_offset, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 590 | } BUILDSTDERR: | ~ BUILDSTDERR: 591 | BUILDSTDERR: | BUILDSTDERR: 592 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 593 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 594 | } BUILDSTDERR: | ~ BUILDSTDERR: 595 | } BUILDSTDERR: | ~ BUILDSTDERR: 596 | } BUILDSTDERR: | ~ BUILDSTDERR: 597 | BUILDSTDERR: | BUILDSTDERR: 598 | debug("Writing CRC value.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 599 | write_byte(ofs, crc_value, file_offset, 0x22); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 600 | uint8_t crc_hi = crc_value >> 8, crc_lo = crc_value; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 601 | write_byte(ofs, crc_value, file_offset, crc_hi); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 602 | write_byte(ofs, crc_value, file_offset, crc_lo); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 603 | BUILDSTDERR: | BUILDSTDERR: 604 | debug("Wakeup.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 605 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 606 | write_byte(ofs, crc_value, file_offset, 0x06); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 607 | BUILDSTDERR: | BUILDSTDERR: 608 | debug("Padding byte.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 609 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 610 | } BUILDSTDERR: | ~ BUILDSTDERR: 611 | BUILDSTDERR: | BUILDSTDERR: 612 | void FpgaConfig::read_ascii(std::istream &ifs, bool nosleep) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 613 | { BUILDSTDERR: | ~ BUILDSTDERR: 614 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 615 | info("Parsing ascii file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 616 | BUILDSTDERR: | BUILDSTDERR: 617 | bool got_device = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 618 | this->cram.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 619 | this->bram.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 620 | this->freqrange = "low"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 621 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 622 | BUILDSTDERR: | BUILDSTDERR: 623 | bool reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 624 | string line, command; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 625 | BUILDSTDERR: | BUILDSTDERR: 626 | while (reuse_line || getline(ifs, line)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 627 | { BUILDSTDERR: | ~ BUILDSTDERR: 628 | reuse_line = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 629 | BUILDSTDERR: | BUILDSTDERR: 630 | std::istringstream is(line); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 631 | is >> command; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 632 | BUILDSTDERR: | BUILDSTDERR: 633 | if (command.empty()) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 634 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 635 | BUILDSTDERR: | BUILDSTDERR: 636 | debug("Next command: %s\n", line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 637 | BUILDSTDERR: | BUILDSTDERR: 638 | if (command == ".comment") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 639 | { BUILDSTDERR: | ~ BUILDSTDERR: 640 | this->initblop.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 641 | this->initblop.push_back(0xff); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 642 | this->initblop.push_back(0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 643 | BUILDSTDERR: | BUILDSTDERR: 644 | while (getline(ifs, line)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 645 | { BUILDSTDERR: | ~ BUILDSTDERR: 646 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 647 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 648 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 649 | } BUILDSTDERR: | ~ BUILDSTDERR: 650 | BUILDSTDERR: | BUILDSTDERR: 651 | for (auto ch : line) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 652 | this->initblop.push_back(ch); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 653 | this->initblop.push_back(0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 654 | } BUILDSTDERR: | ~ BUILDSTDERR: 655 | BUILDSTDERR: | BUILDSTDERR: 656 | this->initblop.push_back(0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 657 | this->initblop.push_back(0xff); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 658 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 659 | } BUILDSTDERR: | ~ BUILDSTDERR: 660 | BUILDSTDERR: | BUILDSTDERR: 661 | if (command == ".device") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 662 | { BUILDSTDERR: | ~ BUILDSTDERR: 663 | if (got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 664 | error("More than one .device statement.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 665 | BUILDSTDERR: | BUILDSTDERR: 666 | is >> this->device; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 667 | BUILDSTDERR: | BUILDSTDERR: 668 | if (this->device == "384") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 669 | this->cram_width = 182; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 670 | this->cram_height = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 671 | this->bram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 672 | this->bram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 673 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 674 | if (this->device == "1k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 675 | this->cram_width = 332; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 676 | this->cram_height = 144; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 677 | this->bram_width = 64; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 678 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 679 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 680 | if (this->device == "8k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 681 | this->cram_width = 872; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 682 | this->cram_height = 272; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 683 | this->bram_width = 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 684 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 685 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 686 | if (this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 687 | this->cram_width = 692; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 688 | this->cram_height = 336; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 689 | this->bram_width = 160; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 690 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 691 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 692 | if (this->device == "u4k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 693 | this->cram_width = 692; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 694 | this->cram_height = 176; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 695 | this->bram_width = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 696 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 697 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 698 | if (this->device == "lm4k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 699 | this->cram_width = 656; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 700 | this->cram_height = 176; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 701 | this->bram_width = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 702 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 703 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 704 | error("Unsupported chip type '%s'.\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 705 | BUILDSTDERR: | BUILDSTDERR: 706 | this->cram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 707 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 708 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 709 | this->cram[i].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 710 | for (int x = 0; x < this->cram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 711 | this->cram[i][x].resize(((i % 2) == 1) ? (this->cram_height / 2 + 8) : this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 712 | } BUILDSTDERR: | ~ BUILDSTDERR: 713 | BUILDSTDERR: | BUILDSTDERR: 714 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 715 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 716 | int width = ((i % 2) == 1) ? (this->bram_width / 2) : this->bram_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 717 | this->bram[i].resize(width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 718 | for (int x = 0; x < width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 719 | this->bram[i][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 720 | } BUILDSTDERR: | ~ BUILDSTDERR: 721 | } else { BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 722 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 723 | this->cram[i].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 724 | for (int x = 0; x < this->cram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 725 | this->cram[i][x].resize(this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 726 | } BUILDSTDERR: | ~ BUILDSTDERR: 727 | BUILDSTDERR: | BUILDSTDERR: 728 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 729 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 730 | this->bram[i].resize(this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 731 | for (int x = 0; x < this->bram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 732 | this->bram[i][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 733 | } BUILDSTDERR: | ~ BUILDSTDERR: 734 | } BUILDSTDERR: | ~ BUILDSTDERR: 735 | BUILDSTDERR: | BUILDSTDERR: 736 | BUILDSTDERR: | BUILDSTDERR: 737 | got_device = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 738 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 739 | } BUILDSTDERR: | ~ BUILDSTDERR: 740 | BUILDSTDERR: | BUILDSTDERR: 741 | if (command == ".warmboot") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 742 | { BUILDSTDERR: | ~ BUILDSTDERR: 743 | is >> this->warmboot; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 744 | BUILDSTDERR: | BUILDSTDERR: 745 | if (this->warmboot != "disabled" && BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 746 | this->warmboot != "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 747 | error("Unknown warmboot setting '%s'.\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 748 | this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 749 | BUILDSTDERR: | BUILDSTDERR: 750 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 751 | } BUILDSTDERR: | ~ BUILDSTDERR: 752 | BUILDSTDERR: | BUILDSTDERR: 753 | // No ".nosleep" section despite sharing the same byte as .warmboot. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 754 | // ".nosleep" is specified when icepack is invoked, which is too late. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 755 | // So we inject the section based on command line argument. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 756 | if (nosleep) BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 757 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 758 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 759 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 760 | BUILDSTDERR: | BUILDSTDERR: 761 | if (command == ".io_tile" || command == ".logic_tile" || command == ".ramb_tile" || command == ".ramt_tile" || command.substr(0, 4) == ".dsp" || command == ".ipcon_tile") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 762 | { BUILDSTDERR: | ~ BUILDSTDERR: 763 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 764 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 765 | BUILDSTDERR: | BUILDSTDERR: 766 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 767 | is >> tile_x >> tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 768 | BUILDSTDERR: | BUILDSTDERR: 769 | CramIndexConverter cic(this, tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 770 | BUILDSTDERR: | BUILDSTDERR: 771 | if (("." + cic.tile_type + "_tile") != command) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 772 | error("Got %s statement for %s tile %d %d.\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 773 | command.c_str(), cic.tile_type.c_str(), tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 774 | BUILDSTDERR: | BUILDSTDERR: 775 | for (int bit_y = 0; bit_y < 16 && getline(ifs, line); bit_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 776 | { BUILDSTDERR: | ~ BUILDSTDERR: 777 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 778 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 779 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 780 | } BUILDSTDERR: | ~ BUILDSTDERR: 781 | BUILDSTDERR: | BUILDSTDERR: 782 | for (int bit_x = 0; bit_x < int(line.size()) && bit_x < cic.tile_width; bit_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 783 | if (line[bit_x] == '1') { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 784 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 785 | cic.get_cram_index(bit_x, bit_y, cram_bank, cram_x, cram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 786 | this->cram[cram_bank][cram_x][cram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 787 | } BUILDSTDERR: | ~ BUILDSTDERR: 788 | } BUILDSTDERR: | ~ BUILDSTDERR: 789 | BUILDSTDERR: | BUILDSTDERR: 790 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 791 | } BUILDSTDERR: | ~ BUILDSTDERR: 792 | BUILDSTDERR: | BUILDSTDERR: 793 | if (command == ".ram_data") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 794 | { BUILDSTDERR: | ~ BUILDSTDERR: 795 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 796 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 797 | BUILDSTDERR: | BUILDSTDERR: 798 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 799 | is >> tile_x >> tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 800 | BUILDSTDERR: | BUILDSTDERR: 801 | BramIndexConverter bic(this, tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 802 | BUILDSTDERR: | BUILDSTDERR: 803 | for (int bit_y = 0; bit_y < 16 && getline(ifs, line); bit_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 804 | { BUILDSTDERR: | ~ BUILDSTDERR: 805 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 806 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 807 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 808 | } BUILDSTDERR: | ~ BUILDSTDERR: 809 | BUILDSTDERR: | BUILDSTDERR: 810 | for (int bit_x = 256-4, ch_idx = 0; ch_idx < int(line.size()) && bit_x >= 0; bit_x -= 4, ch_idx++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 811 | { BUILDSTDERR: | ~ BUILDSTDERR: 812 | int value = -1; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 813 | if ('0' <= line[ch_idx] && line[ch_idx] <= '9') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 814 | value = line[ch_idx] - '0'; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 815 | if ('a' <= line[ch_idx] && line[ch_idx] <= 'f') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 816 | value = line[ch_idx] - 'a' + 10; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 817 | if ('A' <= line[ch_idx] && line[ch_idx] <= 'F') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 818 | value = line[ch_idx] - 'A' + 10; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 819 | if (value < 0) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 820 | error("Not a hex character: '%c' (in line '%s')\n", line[ch_idx], line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 821 | BUILDSTDERR: | BUILDSTDERR: 822 | for (int i = 0; i < 4; i++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 823 | if ((value & (1 << i)) != 0) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 824 | int bram_bank, bram_x, bram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 825 | bic.get_bram_index(bit_x+i, bit_y, bram_bank, bram_x, bram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 826 | this->bram[bram_bank][bram_x][bram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 827 | } BUILDSTDERR: | ~ BUILDSTDERR: 828 | } BUILDSTDERR: | ~ BUILDSTDERR: 829 | } BUILDSTDERR: | ~ BUILDSTDERR: 830 | BUILDSTDERR: | BUILDSTDERR: 831 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 832 | } BUILDSTDERR: | ~ BUILDSTDERR: 833 | BUILDSTDERR: | BUILDSTDERR: 834 | if (command == ".extra_bit") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 835 | { BUILDSTDERR: | ~ BUILDSTDERR: 836 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 837 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 838 | BUILDSTDERR: | BUILDSTDERR: 839 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 840 | is >> cram_bank >> cram_x >> cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 841 | this->cram[cram_bank][cram_x][cram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 842 | BUILDSTDERR: | BUILDSTDERR: 843 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 844 | } BUILDSTDERR: | ~ BUILDSTDERR: 845 | BUILDSTDERR: | BUILDSTDERR: 846 | if (command == ".sym") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 847 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 848 | BUILDSTDERR: | BUILDSTDERR: 849 | if (command.substr(0, 1) == ".") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 850 | error("Unknown statement: %s\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 851 | error("Unexpected data line: %s\n", line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 852 | } BUILDSTDERR: | ~ BUILDSTDERR: 853 | } BUILDSTDERR: | ~ BUILDSTDERR: 854 | BUILDSTDERR: | BUILDSTDERR: 855 | void FpgaConfig::write_ascii(std::ostream &ofs) const BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 856 | { BUILDSTDERR: | ~ BUILDSTDERR: 857 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 858 | info("Writing ascii file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 859 | BUILDSTDERR: | BUILDSTDERR: 860 | ofs << ".comment"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 861 | bool insert_newline = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 862 | for (auto ch : this->initblop) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 863 | if (ch == 0) { BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 864 | insert_newline = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 865 | } else if (ch == 0xff) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 866 | insert_newline = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 867 | } else { BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 868 | if (insert_newline) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 869 | ofs << '\n'; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 870 | ofs << ch; BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 871 | insert_newline = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 872 | } BUILDSTDERR: | ~ BUILDSTDERR: 873 | } BUILDSTDERR: | ~ BUILDSTDERR: 874 | BUILDSTDERR: | BUILDSTDERR: 875 | ofs << stringf("\n.device %s\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 876 | if (this->warmboot != "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 877 | ofs << stringf(".warmboot %s\n", this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 878 | BUILDSTDERR: | BUILDSTDERR: 879 | // As "nosleep" is an icepack command, we do not write out a ".nosleep" BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 880 | // section. However, we parse it in read_bits() and notify the user in BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 881 | // info. BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 882 | BUILDSTDERR: | BUILDSTDERR: 883 | typedef std::tuple tile_bit_t; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 884 | std::set tile_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 885 | BUILDSTDERR: | BUILDSTDERR: 886 | for (int y = 0; y <= this->chip_height()+1; y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 887 | for (int x = 0; x <= this->chip_width()+1; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 888 | { BUILDSTDERR: | ~ BUILDSTDERR: 889 | CramIndexConverter cic(this, x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 890 | BUILDSTDERR: | BUILDSTDERR: 891 | if (cic.tile_type == "corner" || cic.tile_type == "unsupported") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 892 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 893 | BUILDSTDERR: | BUILDSTDERR: 894 | ofs << stringf(".%s_tile %d %d\n", cic.tile_type.c_str(), x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 895 | BUILDSTDERR: | BUILDSTDERR: 896 | for (int bit_y = 0; bit_y < 16; bit_y++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 897 | for (int bit_x = 0; bit_x < cic.tile_width; bit_x++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 898 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 899 | cic.get_cram_index(bit_x, bit_y, cram_bank, cram_x, cram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 900 | tile_bits.insert(tile_bit_t(cram_bank, cram_x, cram_y)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 901 | if (cram_x > int(this->cram[cram_bank].size())) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 902 | error("cram_x %d (bit %d, %d) larger than bank size %lu\n", cram_x, bit_x, bit_y, this->cram[cram_bank].size()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: | | BUILDSTDERR: | std::vector >::size_type {aka unsigned int} BUILDSTDERR: icepack.cc:902:6: note: in expansion of macro 'error' BUILDSTDERR: 902 | error("cram_x %d (bit %d, %d) larger than bank size %lu\n", cram_x, bit_x, bit_y, this->cram[cram_bank].size()); BUILDSTDERR: | ^~~~~ BUILDSTDERR: icepack.cc:902:60: note: format string is defined here BUILDSTDERR: 902 | error("cram_x %d (bit %d, %d) larger than bank size %lu\n", cram_x, bit_x, bit_y, this->cram[cram_bank].size()); BUILDSTDERR: | ~~^ BUILDSTDERR: | | BUILDSTDERR: | long unsigned int BUILDSTDERR: | %u BUILDSTDERR: icepack.cc:53:41: warning: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'std::vector::size_type' {aka 'unsigned int'} [-Wformat=] BUILDSTDERR: 53 | #define error(...) do { fprintf(stderr, "Error: " __VA_ARGS__); exit(1); } while (0) BUILDSTDERR: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 54 | #define panic(fmt, ...) do { fprintf(stderr, "Internal Error at %s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__); abort(); } while (0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 55 | BUILDSTDERR: | BUILDSTDERR: 56 | string vstringf(const char *fmt, va_list ap) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 57 | { BUILDSTDERR: | ~ BUILDSTDERR: 58 | string string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 59 | char *str = NULL; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 60 | BUILDSTDERR: | BUILDSTDERR: 61 | #ifdef _WIN32 BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 62 | int sz = 64, rc; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 63 | while (1) { BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 64 | va_list apc; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 65 | va_copy(apc, ap); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 66 | str = (char*)realloc(str, sz); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 67 | rc = vsnprintf(str, sz, fmt, apc); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 68 | va_end(apc); BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 69 | if (rc >= 0 && rc < sz) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 70 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 71 | sz *= 2; BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 72 | } BUILDSTDERR: | ~ BUILDSTDERR: 73 | #else BUILDSTDERR: | ~~~~~ BUILDSTDERR: 74 | if (vasprintf(&str, fmt, ap) < 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 75 | str = NULL; BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 76 | #endif BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 77 | BUILDSTDERR: | BUILDSTDERR: 78 | if (str != NULL) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 79 | string = str; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 80 | free(str); BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 81 | } BUILDSTDERR: | ~ BUILDSTDERR: 82 | BUILDSTDERR: | BUILDSTDERR: 83 | return string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 84 | } BUILDSTDERR: | ~ BUILDSTDERR: 85 | BUILDSTDERR: | BUILDSTDERR: 86 | string stringf(const char *fmt, ...) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 87 | { BUILDSTDERR: | ~ BUILDSTDERR: 88 | string string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 89 | va_list ap; BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 90 | BUILDSTDERR: | BUILDSTDERR: 91 | va_start(ap, fmt); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 92 | string = vstringf(fmt, ap); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 93 | va_end(ap); BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 94 | BUILDSTDERR: | BUILDSTDERR: 95 | return string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 96 | } BUILDSTDERR: | ~ BUILDSTDERR: 97 | BUILDSTDERR: | BUILDSTDERR: 98 | // ================================================================== BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 99 | // FpgaConfig stuff BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 100 | BUILDSTDERR: | BUILDSTDERR: 101 | struct FpgaConfig BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 102 | { BUILDSTDERR: | ~ BUILDSTDERR: 103 | string device; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 104 | string freqrange; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 105 | string nosleep; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 106 | string warmboot; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 107 | BUILDSTDERR: | BUILDSTDERR: 108 | // cram[BANK][X][Y] BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 109 | int cram_width, cram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 110 | vector>> cram; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 111 | BUILDSTDERR: | BUILDSTDERR: 112 | // bram[BANK][X][Y] BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 113 | int bram_width, bram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 114 | vector>> bram; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 115 | BUILDSTDERR: | BUILDSTDERR: 116 | // data before preamble BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 117 | vector initblop; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 118 | BUILDSTDERR: | BUILDSTDERR: 119 | // bitstream i/o BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 120 | void read_bits(std::istream &ifs); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 121 | void write_bits(std::ostream &ofs) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 122 | BUILDSTDERR: | BUILDSTDERR: 123 | // icebox i/o BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 124 | void read_ascii(std::istream &ifs, bool nosleep); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 125 | void write_ascii(std::ostream &ofs) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 126 | BUILDSTDERR: | BUILDSTDERR: 127 | // netpbm i/o BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 128 | void write_cram_pbm(std::ostream &ofs, int bank_num = -1) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 129 | void write_bram_pbm(std::ostream &ofs, int bank_num = -1) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 130 | BUILDSTDERR: | BUILDSTDERR: 131 | // query chip type metadata BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 132 | int chip_width() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 133 | int chip_height() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 134 | vector chip_cols() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 135 | BUILDSTDERR: | BUILDSTDERR: 136 | // query tile metadata BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 137 | string tile_type(int x, int y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 138 | int tile_width(const string &type) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 139 | BUILDSTDERR: | BUILDSTDERR: 140 | // cram bit manipulation BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 141 | void cram_clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 142 | void cram_fill_tiles(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 143 | void cram_checkerboard(int m = 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 144 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 145 | BUILDSTDERR: | BUILDSTDERR: 146 | struct CramIndexConverter BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 147 | { BUILDSTDERR: | ~ BUILDSTDERR: 148 | const FpgaConfig *fpga; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 149 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 150 | BUILDSTDERR: | BUILDSTDERR: 151 | string tile_type; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 152 | int tile_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 153 | int column_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 154 | BUILDSTDERR: | BUILDSTDERR: 155 | bool left_right_io; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 156 | bool right_half; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 157 | bool top_half; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 158 | BUILDSTDERR: | BUILDSTDERR: 159 | int bank_num; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 160 | int bank_tx; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 161 | int bank_ty; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 162 | int bank_xoff; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 163 | int bank_yoff; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 164 | BUILDSTDERR: | BUILDSTDERR: 165 | CramIndexConverter(const FpgaConfig *fpga, int tile_x, int tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 166 | void get_cram_index(int bit_x, int bit_y, int &cram_bank, int &cram_x, int &cram_y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 167 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 168 | BUILDSTDERR: | BUILDSTDERR: 169 | struct BramIndexConverter BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 170 | { BUILDSTDERR: | ~ BUILDSTDERR: 171 | const FpgaConfig *fpga; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 172 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 173 | BUILDSTDERR: | BUILDSTDERR: 174 | int bank_num; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 175 | int bank_off; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 176 | BUILDSTDERR: | BUILDSTDERR: 177 | BramIndexConverter(const FpgaConfig *fpga, int tile_x, int tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 178 | void get_bram_index(int bit_x, int bit_y, int &bram_bank, int &bram_x, int &bram_y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 179 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 180 | BUILDSTDERR: | BUILDSTDERR: 181 | static void update_crc16(uint16_t &crc, uint8_t byte) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 182 | { BUILDSTDERR: | ~ BUILDSTDERR: 183 | // CRC-16-CCITT, Initialize to 0xFFFF, No zero padding BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 184 | for (int i = 7; i >= 0; i--) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 185 | uint16_t xor_value = ((crc >> 15) ^ ((byte >> i) & 1)) ? 0x1021 : 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 186 | crc = (crc << 1) ^ xor_value; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 187 | } BUILDSTDERR: | ~ BUILDSTDERR: 188 | } BUILDSTDERR: | ~ BUILDSTDERR: 189 | BUILDSTDERR: | BUILDSTDERR: 190 | static uint8_t read_byte(std::istream &ifs, uint16_t &crc_value, int &file_offset) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 191 | { BUILDSTDERR: | ~ BUILDSTDERR: 192 | int byte = ifs.get(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 193 | BUILDSTDERR: | BUILDSTDERR: 194 | if (byte < 0) BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 195 | error("Unexpected end of file.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 196 | BUILDSTDERR: | BUILDSTDERR: 197 | file_offset++; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 198 | update_crc16(crc_value, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 199 | BUILDSTDERR: | BUILDSTDERR: 200 | return byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 201 | } BUILDSTDERR: | ~ BUILDSTDERR: 202 | BUILDSTDERR: | BUILDSTDERR: 203 | static void write_byte(std::ostream &ofs, uint16_t &crc_value, int &file_offset, uint8_t byte) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 204 | { BUILDSTDERR: | ~ BUILDSTDERR: 205 | ofs << byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 206 | file_offset++; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 207 | update_crc16(crc_value, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 208 | } BUILDSTDERR: | ~ BUILDSTDERR: 209 | BUILDSTDERR: | BUILDSTDERR: 210 | void FpgaConfig::read_bits(std::istream &ifs) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 211 | { BUILDSTDERR: | ~ BUILDSTDERR: 212 | int file_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 213 | uint16_t crc_value = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 214 | BUILDSTDERR: | BUILDSTDERR: 215 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 216 | info("Parsing bitstream file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 217 | BUILDSTDERR: | BUILDSTDERR: 218 | // skip initial comments until preamble is found BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 219 | BUILDSTDERR: | BUILDSTDERR: 220 | uint32_t preamble = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 221 | BUILDSTDERR: | BUILDSTDERR: 222 | while (1) BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 223 | { BUILDSTDERR: | ~ BUILDSTDERR: 224 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 225 | preamble = (preamble << 8) | byte; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 226 | if (preamble == 0xffffffff) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 227 | error("No preamble found in bitstream.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 228 | if (preamble == 0x7EAA997E) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 229 | info("Found preamble at offset %d.\n", file_offset-4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 230 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 231 | } BUILDSTDERR: | ~ BUILDSTDERR: 232 | initblop.push_back(byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 233 | } BUILDSTDERR: | ~ BUILDSTDERR: 234 | BUILDSTDERR: | BUILDSTDERR: 235 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 236 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 237 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 238 | BUILDSTDERR: | BUILDSTDERR: 239 | // main parser loop BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 240 | BUILDSTDERR: | BUILDSTDERR: 241 | int current_bank = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 242 | int current_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 243 | int current_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 244 | int current_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 245 | bool wakeup = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 246 | BUILDSTDERR: | BUILDSTDERR: 247 | this->cram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 248 | this->cram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 249 | BUILDSTDERR: | BUILDSTDERR: 250 | this->bram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 251 | this->bram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 252 | BUILDSTDERR: | BUILDSTDERR: 253 | while (!wakeup) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 254 | { BUILDSTDERR: | ~ BUILDSTDERR: 255 | // one command byte. the lower 4 bits of the command byte specify BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 256 | // the length of the command payload. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 257 | BUILDSTDERR: | BUILDSTDERR: 258 | uint8_t command = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 259 | uint32_t payload = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 260 | BUILDSTDERR: | BUILDSTDERR: 261 | for (int i = 0; i < (command & 0x0f); i++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 262 | payload = (payload << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 263 | BUILDSTDERR: | BUILDSTDERR: 264 | debug("Next command at offset %d: 0x%02x 0x%0*x\n", file_offset - 1 - (command & 0x0f), BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 265 | command, 2*(command & 0x0f), payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 266 | BUILDSTDERR: | BUILDSTDERR: 267 | uint16_t end_token; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 268 | BUILDSTDERR: | BUILDSTDERR: 269 | switch (command & 0xf0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 270 | { BUILDSTDERR: | ~ BUILDSTDERR: 271 | case 0x00: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 272 | switch (payload) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 273 | { BUILDSTDERR: | ~ BUILDSTDERR: 274 | case 0x01: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 275 | info("CRAM Data [%d]: %d x %d bits = %d bits = %d bytes\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 276 | current_bank, current_width, current_height, BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 277 | current_height*current_width, (current_height*current_width)/8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 278 | BUILDSTDERR: | BUILDSTDERR: 279 | this->cram_width = std::max(this->cram_width, current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 280 | this->cram_height = std::max(this->cram_height, current_offset + current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 281 | BUILDSTDERR: | BUILDSTDERR: 282 | this->cram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 283 | this->cram[current_bank].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 284 | for (int x = 0; x < current_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 285 | this->cram[current_bank][x].resize(this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 286 | BUILDSTDERR: | BUILDSTDERR: 287 | for (int i = 0; i < (current_height*current_width)/8; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 288 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 289 | for (int j = 0; j < 8; j++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 290 | int x = (i*8 + j) % current_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 291 | int y = (i*8 + j) / current_width + current_offset; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 292 | this->cram[current_bank][x][y] = ((byte << j) & 0x80) != 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 293 | } BUILDSTDERR: | ~ BUILDSTDERR: 294 | } BUILDSTDERR: | ~ BUILDSTDERR: 295 | BUILDSTDERR: | BUILDSTDERR: 296 | end_token = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 297 | end_token = (end_token << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 298 | if (end_token) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 299 | error("Expeded 0x0000 after CRAM data, got 0x%04x\n", end_token); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 300 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 301 | BUILDSTDERR: | BUILDSTDERR: 302 | case 0x03: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 303 | info("BRAM Data [%d]: %d x %d bits = %d bits = %d bytes\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 304 | current_bank, current_width, current_height, BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 305 | current_height*current_width, (current_height*current_width)/8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 306 | BUILDSTDERR: | BUILDSTDERR: 307 | this->bram_width = std::max(this->bram_width, current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 308 | this->bram_height = std::max(this->bram_height, current_offset + current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 309 | BUILDSTDERR: | BUILDSTDERR: 310 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 311 | this->bram[current_bank].resize(this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 312 | for (int x = 0; x < current_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 313 | this->bram[current_bank][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 314 | BUILDSTDERR: | BUILDSTDERR: 315 | for (int i = 0; i < (current_height*current_width)/8; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 316 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 317 | for (int j = 0; j < 8; j++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 318 | int x = (i*8 + j) % current_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 319 | int y = (i*8 + j) / current_width + current_offset; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 320 | this->bram[current_bank][x][y] = ((byte << j) & 0x80) != 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 321 | } BUILDSTDERR: | ~ BUILDSTDERR: 322 | } BUILDSTDERR: | ~ BUILDSTDERR: 323 | BUILDSTDERR: | BUILDSTDERR: 324 | end_token = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 325 | end_token = (end_token << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 326 | if (end_token) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 327 | error("Expeded 0x0000 after BRAM data, got 0x%04x\n", end_token); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 328 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 329 | BUILDSTDERR: | BUILDSTDERR: 330 | case 0x05: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 331 | debug("Resetting CRC.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 332 | crc_value = 0xffff; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 333 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 334 | BUILDSTDERR: | BUILDSTDERR: 335 | case 0x06: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 336 | info("Wakeup.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 337 | wakeup = true; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 338 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 339 | BUILDSTDERR: | BUILDSTDERR: 340 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 341 | error("Unknown command: 0x%02x 0x%02x\n", command, payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 342 | } BUILDSTDERR: | ~ BUILDSTDERR: 343 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 344 | BUILDSTDERR: | BUILDSTDERR: 345 | case 0x10: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 346 | current_bank = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 347 | debug("Set bank to %d.\n", current_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 348 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 349 | BUILDSTDERR: | BUILDSTDERR: 350 | case 0x20: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 351 | if (crc_value != 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 352 | error("CRC Check FAILED.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 353 | info("CRC Check OK.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 354 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 355 | BUILDSTDERR: | BUILDSTDERR: 356 | case 0x50: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 357 | if (payload == 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 358 | this->freqrange = "low"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 359 | else if (payload == 1) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 360 | this->freqrange = "medium"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 361 | else if (payload == 2) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 362 | this->freqrange = "high"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 363 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 364 | error("Unknown freqrange payload 0x%02x\n", payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 365 | info("Setting freqrange to '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 366 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 367 | BUILDSTDERR: | BUILDSTDERR: 368 | case 0x60: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 369 | current_width = payload + 1; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 370 | debug("Setting bank width to %d.\n", current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 371 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 372 | BUILDSTDERR: | BUILDSTDERR: 373 | case 0x70: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 374 | current_height = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 375 | debug("Setting bank height to %d.\n", current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 376 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 377 | BUILDSTDERR: | BUILDSTDERR: 378 | case 0x80: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 379 | current_offset = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 380 | debug("Setting bank offset to %d.\n", current_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 381 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 382 | BUILDSTDERR: | BUILDSTDERR: 383 | case 0x90: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 384 | switch(payload) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 385 | { BUILDSTDERR: | ~ BUILDSTDERR: 386 | case 0: BUILDSTDERR: | ~~~~~~~ BUILDSTDERR: 387 | this->warmboot = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 388 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 389 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 390 | case 1: BUILDSTDERR: | ~~~~~~~ BUILDSTDERR: 391 | this->warmboot = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 392 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 393 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 394 | case 32: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 395 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 396 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 397 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 398 | case 33: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 399 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 400 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 401 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 402 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 403 | error("Unknown warmboot/nosleep payload 0x%02x\n", payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 404 | } BUILDSTDERR: | ~ BUILDSTDERR: 405 | info("Setting warmboot to '%s', nosleep to '%s'.\n", this->warmboot.c_str(), this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 406 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 407 | BUILDSTDERR: | BUILDSTDERR: 408 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 409 | error("Unknown command: 0x%02x 0x%02x\n", command, payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 410 | } BUILDSTDERR: | ~ BUILDSTDERR: 411 | } BUILDSTDERR: | ~ BUILDSTDERR: 412 | BUILDSTDERR: | BUILDSTDERR: 413 | if (this->cram_width == 182 && this->cram_height == 80) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 414 | this->device = "384"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 415 | else if (this->cram_width == 332 && this->cram_height == 144) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 416 | this->device = "1k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 417 | else if (this->cram_width == 872 && this->cram_height == 272) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 418 | this->device = "8k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 419 | else if (this->cram_width == 692 && this->cram_height == 336) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 420 | this->device = "5k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 421 | else if (this->cram_width == 692 && this->cram_height == 176) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 422 | this->device = "u4k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 423 | else if (this->cram_width == 656 && this->cram_height == 176) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 424 | this->device = "lm4k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 425 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 426 | error("Failed to detect chip type.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 427 | BUILDSTDERR: | BUILDSTDERR: 428 | info("Chip type is '%s'.\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 429 | } BUILDSTDERR: | ~ BUILDSTDERR: 430 | BUILDSTDERR: | BUILDSTDERR: 431 | void FpgaConfig::write_bits(std::ostream &ofs) const BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 432 | { BUILDSTDERR: | ~ BUILDSTDERR: 433 | int file_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 434 | uint16_t crc_value = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 435 | BUILDSTDERR: | BUILDSTDERR: 436 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 437 | info("Writing bitstream file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 438 | BUILDSTDERR: | BUILDSTDERR: 439 | for (auto byte : this->initblop) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 440 | ofs << byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 441 | BUILDSTDERR: | BUILDSTDERR: 442 | debug("Writing preamble.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 443 | write_byte(ofs, crc_value, file_offset, 0x7E); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 444 | write_byte(ofs, crc_value, file_offset, 0xAA); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 445 | write_byte(ofs, crc_value, file_offset, 0x99); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 446 | write_byte(ofs, crc_value, file_offset, 0x7E); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 447 | BUILDSTDERR: | BUILDSTDERR: 448 | debug("Setting freqrange to '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 449 | write_byte(ofs, crc_value, file_offset, 0x51); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 450 | if (this->freqrange == "low") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 451 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 452 | else if (this->freqrange == "medium") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 453 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 454 | else if (this->freqrange == "high") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 455 | write_byte(ofs, crc_value, file_offset, 0x02); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 456 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 457 | error("Unknown freqrange '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 458 | BUILDSTDERR: | BUILDSTDERR: 459 | debug("Resetting CRC.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 460 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 461 | write_byte(ofs, crc_value, file_offset, 0x05); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 462 | crc_value = 0xffff; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 463 | BUILDSTDERR: | BUILDSTDERR: 464 | { BUILDSTDERR: | ~ BUILDSTDERR: 465 | uint8_t nosleep_flag; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 466 | debug("Setting warmboot to '%s', nosleep to '%s'.\n", this->warmboot.c_str(), this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 467 | write_byte(ofs, crc_value, file_offset, 0x92); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 468 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 469 | BUILDSTDERR: | BUILDSTDERR: 470 | if (this->nosleep == "disabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 471 | nosleep_flag = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 472 | else if (this->nosleep == "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 473 | nosleep_flag = 1; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 474 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 475 | error("Unknown nosleep setting '%s'.\n", this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 476 | BUILDSTDERR: | BUILDSTDERR: 477 | if (this->warmboot == "disabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 478 | write_byte(ofs, crc_value, file_offset, 0x00 | nosleep_flag); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 479 | else if (this->warmboot == "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 480 | write_byte(ofs, crc_value, file_offset, 0x20 | nosleep_flag); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 481 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 482 | error("Unknown warmboot setting '%s'.\n", this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 483 | } BUILDSTDERR: | ~ BUILDSTDERR: 484 | BUILDSTDERR: | BUILDSTDERR: 485 | debug("CRAM: Setting bank width to %d.\n", this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 486 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 487 | write_byte(ofs, crc_value, file_offset, (this->cram_width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 488 | write_byte(ofs, crc_value, file_offset, (this->cram_width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 489 | if(this->device != "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 490 | debug("CRAM: Setting bank height to %d.\n", this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 491 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 492 | write_byte(ofs, crc_value, file_offset, this->cram_height >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 493 | write_byte(ofs, crc_value, file_offset, this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 494 | } BUILDSTDERR: | ~ BUILDSTDERR: 495 | BUILDSTDERR: | BUILDSTDERR: 496 | debug("CRAM: Setting bank offset to 0.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 497 | write_byte(ofs, crc_value, file_offset, 0x82); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 498 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 499 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 500 | BUILDSTDERR: | BUILDSTDERR: 501 | for (int cram_bank = 0; cram_bank < 4; cram_bank++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 502 | { BUILDSTDERR: | ~ BUILDSTDERR: 503 | vector cram_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 504 | int height = this->cram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 505 | if(this->device == "5k" && ((cram_bank % 2) == 1)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 506 | height = height / 2 + 8; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 507 | for (int cram_y = 0; cram_y < height; cram_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 508 | for (int cram_x = 0; cram_x < this->cram_width; cram_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 509 | cram_bits.push_back(this->cram[cram_bank][cram_x][cram_y]); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 510 | BUILDSTDERR: | BUILDSTDERR: 511 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 512 | debug("CRAM: Setting bank height to %d.\n", height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 513 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 514 | write_byte(ofs, crc_value, file_offset, height >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 515 | write_byte(ofs, crc_value, file_offset, height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 516 | } BUILDSTDERR: | ~ BUILDSTDERR: 517 | BUILDSTDERR: | BUILDSTDERR: 518 | debug("CRAM: Setting bank %d.\n", cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 519 | write_byte(ofs, crc_value, file_offset, 0x11); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 520 | write_byte(ofs, crc_value, file_offset, cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 521 | BUILDSTDERR: | BUILDSTDERR: 522 | debug("CRAM: Writing bank %d data.\n", cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 523 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 524 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 525 | for (int i = 0; i < int(cram_bits.size()); i += 8) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 526 | uint8_t byte = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 527 | for (int j = 0; j < 8; j++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 528 | byte = (byte << 1) | (cram_bits[i+j] ? 1 : 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 529 | write_byte(ofs, crc_value, file_offset, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 530 | } BUILDSTDERR: | ~ BUILDSTDERR: 531 | BUILDSTDERR: | BUILDSTDERR: 532 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 533 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 534 | } BUILDSTDERR: | ~ BUILDSTDERR: 535 | BUILDSTDERR: | BUILDSTDERR: 536 | int bram_chunk_size = 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 537 | BUILDSTDERR: | BUILDSTDERR: 538 | if (this->bram_width && this->bram_height) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 539 | { BUILDSTDERR: | ~ BUILDSTDERR: 540 | if(this->device != "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 541 | debug("BRAM: Setting bank width to %d.\n", this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 542 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 543 | write_byte(ofs, crc_value, file_offset, (this->bram_width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 544 | write_byte(ofs, crc_value, file_offset, (this->bram_width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 545 | } BUILDSTDERR: | ~ BUILDSTDERR: 546 | BUILDSTDERR: | BUILDSTDERR: 547 | BUILDSTDERR: | BUILDSTDERR: 548 | debug("BRAM: Setting bank height to %d.\n", this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 549 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 550 | write_byte(ofs, crc_value, file_offset, bram_chunk_size >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 551 | write_byte(ofs, crc_value, file_offset, bram_chunk_size); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 552 | BUILDSTDERR: | BUILDSTDERR: 553 | for (int bram_bank = 0; bram_bank < 4; bram_bank++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 554 | { BUILDSTDERR: | ~ BUILDSTDERR: 555 | debug("BRAM: Setting bank %d.\n", bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 556 | write_byte(ofs, crc_value, file_offset, 0x11); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 557 | write_byte(ofs, crc_value, file_offset, bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 558 | BUILDSTDERR: | BUILDSTDERR: 559 | for (int offset = 0; offset < this->bram_height; offset += bram_chunk_size) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 560 | { BUILDSTDERR: | ~ BUILDSTDERR: 561 | vector bram_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 562 | int width = this->bram_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 563 | if(this->device == "5k" && ((bram_bank % 2) == 1)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 564 | width = width / 2; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 565 | for (int bram_y = 0; bram_y < bram_chunk_size; bram_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 566 | for (int bram_x = 0; bram_x < width; bram_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 567 | bram_bits.push_back(this->bram[bram_bank][bram_x][bram_y+offset]); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 568 | BUILDSTDERR: | BUILDSTDERR: 569 | debug("BRAM: Setting bank offset to %d.\n", offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 570 | write_byte(ofs, crc_value, file_offset, 0x82); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 571 | write_byte(ofs, crc_value, file_offset, offset >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 572 | write_byte(ofs, crc_value, file_offset, offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 573 | BUILDSTDERR: | BUILDSTDERR: 574 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 575 | debug("BRAM: Setting bank width to %d.\n", width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 576 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 577 | write_byte(ofs, crc_value, file_offset, (width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 578 | write_byte(ofs, crc_value, file_offset, (width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 579 | } BUILDSTDERR: | ~ BUILDSTDERR: 580 | BUILDSTDERR: | BUILDSTDERR: 581 | BUILDSTDERR: | BUILDSTDERR: 582 | debug("BRAM: Writing bank %d data.\n", bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 583 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 584 | write_byte(ofs, crc_value, file_offset, 0x03); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 585 | for (int i = 0; i < int(bram_bits.size()); i += 8) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 586 | uint8_t byte = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 587 | for (int j = 0; j < 8; j++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 588 | byte = (byte << 1) | (bram_bits[i+j] ? 1 : 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 589 | write_byte(ofs, crc_value, file_offset, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 590 | } BUILDSTDERR: | ~ BUILDSTDERR: 591 | BUILDSTDERR: | BUILDSTDERR: 592 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 593 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 594 | } BUILDSTDERR: | ~ BUILDSTDERR: 595 | } BUILDSTDERR: | ~ BUILDSTDERR: 596 | } BUILDSTDERR: | ~ BUILDSTDERR: 597 | BUILDSTDERR: | BUILDSTDERR: 598 | debug("Writing CRC value.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 599 | write_byte(ofs, crc_value, file_offset, 0x22); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 600 | uint8_t crc_hi = crc_value >> 8, crc_lo = crc_value; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 601 | write_byte(ofs, crc_value, file_offset, crc_hi); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 602 | write_byte(ofs, crc_value, file_offset, crc_lo); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 603 | BUILDSTDERR: | BUILDSTDERR: 604 | debug("Wakeup.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 605 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 606 | write_byte(ofs, crc_value, file_offset, 0x06); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 607 | BUILDSTDERR: | BUILDSTDERR: 608 | debug("Padding byte.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 609 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 610 | } BUILDSTDERR: | ~ BUILDSTDERR: 611 | BUILDSTDERR: | BUILDSTDERR: 612 | void FpgaConfig::read_ascii(std::istream &ifs, bool nosleep) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 613 | { BUILDSTDERR: | ~ BUILDSTDERR: 614 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 615 | info("Parsing ascii file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 616 | BUILDSTDERR: | BUILDSTDERR: 617 | bool got_device = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 618 | this->cram.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 619 | this->bram.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 620 | this->freqrange = "low"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 621 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 622 | BUILDSTDERR: | BUILDSTDERR: 623 | bool reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 624 | string line, command; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 625 | BUILDSTDERR: | BUILDSTDERR: 626 | while (reuse_line || getline(ifs, line)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 627 | { BUILDSTDERR: | ~ BUILDSTDERR: 628 | reuse_line = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 629 | BUILDSTDERR: | BUILDSTDERR: 630 | std::istringstream is(line); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 631 | is >> command; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 632 | BUILDSTDERR: | BUILDSTDERR: 633 | if (command.empty()) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 634 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 635 | BUILDSTDERR: | BUILDSTDERR: 636 | debug("Next command: %s\n", line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 637 | BUILDSTDERR: | BUILDSTDERR: 638 | if (command == ".comment") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 639 | { BUILDSTDERR: | ~ BUILDSTDERR: 640 | this->initblop.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 641 | this->initblop.push_back(0xff); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 642 | this->initblop.push_back(0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 643 | BUILDSTDERR: | BUILDSTDERR: 644 | while (getline(ifs, line)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 645 | { BUILDSTDERR: | ~ BUILDSTDERR: 646 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 647 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 648 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 649 | } BUILDSTDERR: | ~ BUILDSTDERR: 650 | BUILDSTDERR: | BUILDSTDERR: 651 | for (auto ch : line) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 652 | this->initblop.push_back(ch); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 653 | this->initblop.push_back(0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 654 | } BUILDSTDERR: | ~ BUILDSTDERR: 655 | BUILDSTDERR: | BUILDSTDERR: 656 | this->initblop.push_back(0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 657 | this->initblop.push_back(0xff); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 658 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 659 | } BUILDSTDERR: | ~ BUILDSTDERR: 660 | BUILDSTDERR: | BUILDSTDERR: 661 | if (command == ".device") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 662 | { BUILDSTDERR: | ~ BUILDSTDERR: 663 | if (got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 664 | error("More than one .device statement.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 665 | BUILDSTDERR: | BUILDSTDERR: 666 | is >> this->device; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 667 | BUILDSTDERR: | BUILDSTDERR: 668 | if (this->device == "384") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 669 | this->cram_width = 182; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 670 | this->cram_height = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 671 | this->bram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 672 | this->bram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 673 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 674 | if (this->device == "1k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 675 | this->cram_width = 332; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 676 | this->cram_height = 144; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 677 | this->bram_width = 64; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 678 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 679 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 680 | if (this->device == "8k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 681 | this->cram_width = 872; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 682 | this->cram_height = 272; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 683 | this->bram_width = 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 684 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 685 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 686 | if (this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 687 | this->cram_width = 692; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 688 | this->cram_height = 336; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 689 | this->bram_width = 160; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 690 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 691 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 692 | if (this->device == "u4k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 693 | this->cram_width = 692; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 694 | this->cram_height = 176; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 695 | this->bram_width = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 696 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 697 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 698 | if (this->device == "lm4k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 699 | this->cram_width = 656; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 700 | this->cram_height = 176; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 701 | this->bram_width = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 702 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 703 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 704 | error("Unsupported chip type '%s'.\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 705 | BUILDSTDERR: | BUILDSTDERR: 706 | this->cram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 707 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 708 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 709 | this->cram[i].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 710 | for (int x = 0; x < this->cram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 711 | this->cram[i][x].resize(((i % 2) == 1) ? (this->cram_height / 2 + 8) : this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 712 | } BUILDSTDERR: | ~ BUILDSTDERR: 713 | BUILDSTDERR: | BUILDSTDERR: 714 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 715 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 716 | int width = ((i % 2) == 1) ? (this->bram_width / 2) : this->bram_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 717 | this->bram[i].resize(width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 718 | for (int x = 0; x < width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 719 | this->bram[i][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 720 | } BUILDSTDERR: | ~ BUILDSTDERR: 721 | } else { BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 722 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 723 | this->cram[i].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 724 | for (int x = 0; x < this->cram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 725 | this->cram[i][x].resize(this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 726 | } BUILDSTDERR: | ~ BUILDSTDERR: 727 | BUILDSTDERR: | BUILDSTDERR: 728 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 729 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 730 | this->bram[i].resize(this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 731 | for (int x = 0; x < this->bram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 732 | this->bram[i][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 733 | } BUILDSTDERR: | ~ BUILDSTDERR: 734 | } BUILDSTDERR: | ~ BUILDSTDERR: 735 | BUILDSTDERR: | BUILDSTDERR: 736 | BUILDSTDERR: | BUILDSTDERR: 737 | got_device = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 738 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 739 | } BUILDSTDERR: | ~ BUILDSTDERR: 740 | BUILDSTDERR: | BUILDSTDERR: 741 | if (command == ".warmboot") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 742 | { BUILDSTDERR: | ~ BUILDSTDERR: 743 | is >> this->warmboot; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 744 | BUILDSTDERR: | BUILDSTDERR: 745 | if (this->warmboot != "disabled" && BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 746 | this->warmboot != "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 747 | error("Unknown warmboot setting '%s'.\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 748 | this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 749 | BUILDSTDERR: | BUILDSTDERR: 750 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 751 | } BUILDSTDERR: | ~ BUILDSTDERR: 752 | BUILDSTDERR: | BUILDSTDERR: 753 | // No ".nosleep" section despite sharing the same byte as .warmboot. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 754 | // ".nosleep" is specified when icepack is invoked, which is too late. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 755 | // So we inject the section based on command line argument. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 756 | if (nosleep) BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 757 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 758 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 759 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 760 | BUILDSTDERR: | BUILDSTDERR: 761 | if (command == ".io_tile" || command == ".logic_tile" || command == ".ramb_tile" || command == ".ramt_tile" || command.substr(0, 4) == ".dsp" || command == ".ipcon_tile") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 762 | { BUILDSTDERR: | ~ BUILDSTDERR: 763 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 764 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 765 | BUILDSTDERR: | BUILDSTDERR: 766 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 767 | is >> tile_x >> tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 768 | BUILDSTDERR: | BUILDSTDERR: 769 | CramIndexConverter cic(this, tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 770 | BUILDSTDERR: | BUILDSTDERR: 771 | if (("." + cic.tile_type + "_tile") != command) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 772 | error("Got %s statement for %s tile %d %d.\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 773 | command.c_str(), cic.tile_type.c_str(), tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 774 | BUILDSTDERR: | BUILDSTDERR: 775 | for (int bit_y = 0; bit_y < 16 && getline(ifs, line); bit_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 776 | { BUILDSTDERR: | ~ BUILDSTDERR: 777 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 778 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 779 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 780 | } BUILDSTDERR: | ~ BUILDSTDERR: 781 | BUILDSTDERR: | BUILDSTDERR: 782 | for (int bit_x = 0; bit_x < int(line.size()) && bit_x < cic.tile_width; bit_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 783 | if (line[bit_x] == '1') { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 784 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 785 | cic.get_cram_index(bit_x, bit_y, cram_bank, cram_x, cram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 786 | this->cram[cram_bank][cram_x][cram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 787 | } BUILDSTDERR: | ~ BUILDSTDERR: 788 | } BUILDSTDERR: | ~ BUILDSTDERR: 789 | BUILDSTDERR: | BUILDSTDERR: 790 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 791 | } BUILDSTDERR: | ~ BUILDSTDERR: 792 | BUILDSTDERR: | BUILDSTDERR: 793 | if (command == ".ram_data") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 794 | { BUILDSTDERR: | ~ BUILDSTDERR: 795 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 796 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 797 | BUILDSTDERR: | BUILDSTDERR: 798 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 799 | is >> tile_x >> tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 800 | BUILDSTDERR: | BUILDSTDERR: 801 | BramIndexConverter bic(this, tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 802 | BUILDSTDERR: | BUILDSTDERR: 803 | for (int bit_y = 0; bit_y < 16 && getline(ifs, line); bit_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 804 | { BUILDSTDERR: | ~ BUILDSTDERR: 805 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 806 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 807 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 808 | } BUILDSTDERR: | ~ BUILDSTDERR: 809 | BUILDSTDERR: | BUILDSTDERR: 810 | for (int bit_x = 256-4, ch_idx = 0; ch_idx < int(line.size()) && bit_x >= 0; bit_x -= 4, ch_idx++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 811 | { BUILDSTDERR: | ~ BUILDSTDERR: 812 | int value = -1; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 813 | if ('0' <= line[ch_idx] && line[ch_idx] <= '9') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 814 | value = line[ch_idx] - '0'; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 815 | if ('a' <= line[ch_idx] && line[ch_idx] <= 'f') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 816 | value = line[ch_idx] - 'a' + 10; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 817 | if ('A' <= line[ch_idx] && line[ch_idx] <= 'F') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 818 | value = line[ch_idx] - 'A' + 10; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 819 | if (value < 0) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 820 | error("Not a hex character: '%c' (in line '%s')\n", line[ch_idx], line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 821 | BUILDSTDERR: | BUILDSTDERR: 822 | for (int i = 0; i < 4; i++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 823 | if ((value & (1 << i)) != 0) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 824 | int bram_bank, bram_x, bram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 825 | bic.get_bram_index(bit_x+i, bit_y, bram_bank, bram_x, bram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 826 | this->bram[bram_bank][bram_x][bram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 827 | } BUILDSTDERR: | ~ BUILDSTDERR: 828 | } BUILDSTDERR: | ~ BUILDSTDERR: 829 | } BUILDSTDERR: | ~ BUILDSTDERR: 830 | BUILDSTDERR: | BUILDSTDERR: 831 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 832 | } BUILDSTDERR: | ~ BUILDSTDERR: 833 | BUILDSTDERR: | BUILDSTDERR: 834 | if (command == ".extra_bit") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 835 | { BUILDSTDERR: | ~ BUILDSTDERR: 836 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 837 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 838 | BUILDSTDERR: | BUILDSTDERR: 839 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 840 | is >> cram_bank >> cram_x >> cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 841 | this->cram[cram_bank][cram_x][cram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 842 | BUILDSTDERR: | BUILDSTDERR: 843 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 844 | } BUILDSTDERR: | ~ BUILDSTDERR: 845 | BUILDSTDERR: | BUILDSTDERR: 846 | if (command == ".sym") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 847 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 848 | BUILDSTDERR: | BUILDSTDERR: 849 | if (command.substr(0, 1) == ".") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 850 | error("Unknown statement: %s\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 851 | error("Unexpected data line: %s\n", line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 852 | } BUILDSTDERR: | ~ BUILDSTDERR: 853 | } BUILDSTDERR: | ~ BUILDSTDERR: 854 | BUILDSTDERR: | BUILDSTDERR: 855 | void FpgaConfig::write_ascii(std::ostream &ofs) const BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 856 | { BUILDSTDERR: | ~ BUILDSTDERR: 857 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 858 | info("Writing ascii file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 859 | BUILDSTDERR: | BUILDSTDERR: 860 | ofs << ".comment"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 861 | bool insert_newline = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 862 | for (auto ch : this->initblop) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 863 | if (ch == 0) { BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 864 | insert_newline = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 865 | } else if (ch == 0xff) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 866 | insert_newline = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 867 | } else { BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 868 | if (insert_newline) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 869 | ofs << '\n'; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 870 | ofs << ch; BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 871 | insert_newline = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 872 | } BUILDSTDERR: | ~ BUILDSTDERR: 873 | } BUILDSTDERR: | ~ BUILDSTDERR: 874 | BUILDSTDERR: | BUILDSTDERR: 875 | ofs << stringf("\n.device %s\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 876 | if (this->warmboot != "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 877 | ofs << stringf(".warmboot %s\n", this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 878 | BUILDSTDERR: | BUILDSTDERR: 879 | // As "nosleep" is an icepack command, we do not write out a ".nosleep" BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 880 | // section. However, we parse it in read_bits() and notify the user in BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 881 | // info. BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 882 | BUILDSTDERR: | BUILDSTDERR: 883 | typedef std::tuple tile_bit_t; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 884 | std::set tile_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 885 | BUILDSTDERR: | BUILDSTDERR: 886 | for (int y = 0; y <= this->chip_height()+1; y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 887 | for (int x = 0; x <= this->chip_width()+1; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 888 | { BUILDSTDERR: | ~ BUILDSTDERR: 889 | CramIndexConverter cic(this, x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 890 | BUILDSTDERR: | BUILDSTDERR: 891 | if (cic.tile_type == "corner" || cic.tile_type == "unsupported") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 892 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 893 | BUILDSTDERR: | BUILDSTDERR: 894 | ofs << stringf(".%s_tile %d %d\n", cic.tile_type.c_str(), x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 895 | BUILDSTDERR: | BUILDSTDERR: 896 | for (int bit_y = 0; bit_y < 16; bit_y++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 897 | for (int bit_x = 0; bit_x < cic.tile_width; bit_x++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 898 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 899 | cic.get_cram_index(bit_x, bit_y, cram_bank, cram_x, cram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 900 | tile_bits.insert(tile_bit_t(cram_bank, cram_x, cram_y)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 901 | if (cram_x > int(this->cram[cram_bank].size())) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 902 | error("cram_x %d (bit %d, %d) larger than bank size %lu\n", cram_x, bit_x, bit_y, this->cram[cram_bank].size()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 903 | } BUILDSTDERR: | ~ BUILDSTDERR: 904 | if (cram_y > int(this->cram[cram_bank][cram_x].size())) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 905 | error("cram_y %d (bit %d, %d) larger than bank %d size %lu\n", cram_y, bit_x, bit_y, cram_bank, this->cram[cram_bank][cram_x].size()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: | | BUILDSTDERR: | std::vector::size_type {aka unsigned int} BUILDSTDERR: icepack.cc:905:6: note: in expansion of macro 'error' BUILDSTDERR: 905 | error("cram_y %d (bit %d, %d) larger than bank %d size %lu\n", cram_y, bit_x, bit_y, cram_bank, this->cram[cram_bank][cram_x].size()); BUILDSTDERR: | ^~~~~ BUILDSTDERR: icepack.cc:905:63: note: format string is defined here BUILDSTDERR: 905 | error("cram_y %d (bit %d, %d) larger than bank %d size %lu\n", cram_y, bit_x, bit_y, cram_bank, this->cram[cram_bank][cram_x].size()); BUILDSTDERR: | ~~^ BUILDSTDERR: | | BUILDSTDERR: | long unsigned int BUILDSTDERR: | %u BUILDSTDERR: icepack.cc:53:41: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'std::vector >::size_type' {aka 'unsigned int'} [-Wformat=] BUILDSTDERR: 53 | #define error(...) do { fprintf(stderr, "Error: " __VA_ARGS__); exit(1); } while (0) BUILDSTDERR: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 54 | #define panic(fmt, ...) do { fprintf(stderr, "Internal Error at %s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__); abort(); } while (0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 55 | BUILDSTDERR: | BUILDSTDERR: 56 | string vstringf(const char *fmt, va_list ap) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 57 | { BUILDSTDERR: | ~ BUILDSTDERR: 58 | string string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 59 | char *str = NULL; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 60 | BUILDSTDERR: | BUILDSTDERR: 61 | #ifdef _WIN32 BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 62 | int sz = 64, rc; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 63 | while (1) { BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 64 | va_list apc; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 65 | va_copy(apc, ap); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 66 | str = (char*)realloc(str, sz); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 67 | rc = vsnprintf(str, sz, fmt, apc); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 68 | va_end(apc); BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 69 | if (rc >= 0 && rc < sz) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 70 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 71 | sz *= 2; BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 72 | } BUILDSTDERR: | ~ BUILDSTDERR: 73 | #else BUILDSTDERR: | ~~~~~ BUILDSTDERR: 74 | if (vasprintf(&str, fmt, ap) < 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 75 | str = NULL; BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 76 | #endif BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 77 | BUILDSTDERR: | BUILDSTDERR: 78 | if (str != NULL) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 79 | string = str; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 80 | free(str); BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 81 | } BUILDSTDERR: | ~ BUILDSTDERR: 82 | BUILDSTDERR: | BUILDSTDERR: 83 | return string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 84 | } BUILDSTDERR: | ~ BUILDSTDERR: 85 | BUILDSTDERR: | BUILDSTDERR: 86 | string stringf(const char *fmt, ...) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 87 | { BUILDSTDERR: | ~ BUILDSTDERR: 88 | string string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 89 | va_list ap; BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 90 | BUILDSTDERR: | BUILDSTDERR: 91 | va_start(ap, fmt); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 92 | string = vstringf(fmt, ap); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 93 | va_end(ap); BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 94 | BUILDSTDERR: | BUILDSTDERR: 95 | return string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 96 | } BUILDSTDERR: | ~ BUILDSTDERR: 97 | BUILDSTDERR: | BUILDSTDERR: 98 | // ================================================================== BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 99 | // FpgaConfig stuff BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 100 | BUILDSTDERR: | BUILDSTDERR: 101 | struct FpgaConfig BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 102 | { BUILDSTDERR: | ~ BUILDSTDERR: 103 | string device; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 104 | string freqrange; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 105 | string nosleep; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 106 | string warmboot; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 107 | BUILDSTDERR: | BUILDSTDERR: 108 | // cram[BANK][X][Y] BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 109 | int cram_width, cram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 110 | vector>> cram; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 111 | BUILDSTDERR: | BUILDSTDERR: 112 | // bram[BANK][X][Y] BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 113 | int bram_width, bram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 114 | vector>> bram; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 115 | BUILDSTDERR: | BUILDSTDERR: 116 | // data before preamble BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 117 | vector initblop; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 118 | BUILDSTDERR: | BUILDSTDERR: 119 | // bitstream i/o BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 120 | void read_bits(std::istream &ifs); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 121 | void write_bits(std::ostream &ofs) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 122 | BUILDSTDERR: | BUILDSTDERR: 123 | // icebox i/o BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 124 | void read_ascii(std::istream &ifs, bool nosleep); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 125 | void write_ascii(std::ostream &ofs) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 126 | BUILDSTDERR: | BUILDSTDERR: 127 | // netpbm i/o BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 128 | void write_cram_pbm(std::ostream &ofs, int bank_num = -1) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 129 | void write_bram_pbm(std::ostream &ofs, int bank_num = -1) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 130 | BUILDSTDERR: | BUILDSTDERR: 131 | // query chip type metadata BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 132 | int chip_width() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 133 | int chip_height() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 134 | vector chip_cols() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 135 | BUILDSTDERR: | BUILDSTDERR: 136 | // query tile metadata BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 137 | string tile_type(int x, int y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 138 | int tile_width(const string &type) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 139 | BUILDSTDERR: | BUILDSTDERR: 140 | // cram bit manipulation BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 141 | void cram_clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 142 | void cram_fill_tiles(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 143 | void cram_checkerboard(int m = 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 144 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 145 | BUILDSTDERR: | BUILDSTDERR: 146 | struct CramIndexConverter BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 147 | { BUILDSTDERR: | ~ BUILDSTDERR: 148 | const FpgaConfig *fpga; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 149 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 150 | BUILDSTDERR: | BUILDSTDERR: 151 | string tile_type; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 152 | int tile_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 153 | int column_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 154 | BUILDSTDERR: | BUILDSTDERR: 155 | bool left_right_io; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 156 | bool right_half; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 157 | bool top_half; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 158 | BUILDSTDERR: | BUILDSTDERR: 159 | int bank_num; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 160 | int bank_tx; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 161 | int bank_ty; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 162 | int bank_xoff; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 163 | int bank_yoff; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 164 | BUILDSTDERR: | BUILDSTDERR: 165 | CramIndexConverter(const FpgaConfig *fpga, int tile_x, int tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 166 | void get_cram_index(int bit_x, int bit_y, int &cram_bank, int &cram_x, int &cram_y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 167 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 168 | BUILDSTDERR: | BUILDSTDERR: 169 | struct BramIndexConverter BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 170 | { BUILDSTDERR: | ~ BUILDSTDERR: 171 | const FpgaConfig *fpga; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 172 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 173 | BUILDSTDERR: | BUILDSTDERR: 174 | int bank_num; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 175 | int bank_off; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 176 | BUILDSTDERR: | BUILDSTDERR: 177 | BramIndexConverter(const FpgaConfig *fpga, int tile_x, int tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 178 | void get_bram_index(int bit_x, int bit_y, int &bram_bank, int &bram_x, int &bram_y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 179 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 180 | BUILDSTDERR: | BUILDSTDERR: 181 | static void update_crc16(uint16_t &crc, uint8_t byte) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 182 | { BUILDSTDERR: | ~ BUILDSTDERR: 183 | // CRC-16-CCITT, Initialize to 0xFFFF, No zero padding BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 184 | for (int i = 7; i >= 0; i--) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 185 | uint16_t xor_value = ((crc >> 15) ^ ((byte >> i) & 1)) ? 0x1021 : 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 186 | crc = (crc << 1) ^ xor_value; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 187 | } BUILDSTDERR: | ~ BUILDSTDERR: 188 | } BUILDSTDERR: | ~ BUILDSTDERR: 189 | BUILDSTDERR: | BUILDSTDERR: 190 | static uint8_t read_byte(std::istream &ifs, uint16_t &crc_value, int &file_offset) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 191 | { BUILDSTDERR: | ~ BUILDSTDERR: 192 | int byte = ifs.get(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 193 | BUILDSTDERR: | BUILDSTDERR: 194 | if (byte < 0) BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 195 | error("Unexpected end of file.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 196 | BUILDSTDERR: | BUILDSTDERR: 197 | file_offset++; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 198 | update_crc16(crc_value, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 199 | BUILDSTDERR: | BUILDSTDERR: 200 | return byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 201 | } BUILDSTDERR: | ~ BUILDSTDERR: 202 | BUILDSTDERR: | BUILDSTDERR: 203 | static void write_byte(std::ostream &ofs, uint16_t &crc_value, int &file_offset, uint8_t byte) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 204 | { BUILDSTDERR: | ~ BUILDSTDERR: 205 | ofs << byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 206 | file_offset++; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 207 | update_crc16(crc_value, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 208 | } BUILDSTDERR: | ~ BUILDSTDERR: 209 | BUILDSTDERR: | BUILDSTDERR: 210 | void FpgaConfig::read_bits(std::istream &ifs) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 211 | { BUILDSTDERR: | ~ BUILDSTDERR: 212 | int file_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 213 | uint16_t crc_value = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 214 | BUILDSTDERR: | BUILDSTDERR: 215 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 216 | info("Parsing bitstream file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 217 | BUILDSTDERR: | BUILDSTDERR: 218 | // skip initial comments until preamble is found BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 219 | BUILDSTDERR: | BUILDSTDERR: 220 | uint32_t preamble = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 221 | BUILDSTDERR: | BUILDSTDERR: 222 | while (1) BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 223 | { BUILDSTDERR: | ~ BUILDSTDERR: 224 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 225 | preamble = (preamble << 8) | byte; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 226 | if (preamble == 0xffffffff) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 227 | error("No preamble found in bitstream.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 228 | if (preamble == 0x7EAA997E) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 229 | info("Found preamble at offset %d.\n", file_offset-4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 230 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 231 | } BUILDSTDERR: | ~ BUILDSTDERR: 232 | initblop.push_back(byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 233 | } BUILDSTDERR: | ~ BUILDSTDERR: 234 | BUILDSTDERR: | BUILDSTDERR: 235 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 236 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 237 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 238 | BUILDSTDERR: | BUILDSTDERR: 239 | // main parser loop BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 240 | BUILDSTDERR: | BUILDSTDERR: 241 | int current_bank = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 242 | int current_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 243 | int current_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 244 | int current_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 245 | bool wakeup = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 246 | BUILDSTDERR: | BUILDSTDERR: 247 | this->cram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 248 | this->cram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 249 | BUILDSTDERR: | BUILDSTDERR: 250 | this->bram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 251 | this->bram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 252 | BUILDSTDERR: | BUILDSTDERR: 253 | while (!wakeup) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 254 | { BUILDSTDERR: | ~ BUILDSTDERR: 255 | // one command byte. the lower 4 bits of the command byte specify BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 256 | // the length of the command payload. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 257 | BUILDSTDERR: | BUILDSTDERR: 258 | uint8_t command = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 259 | uint32_t payload = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 260 | BUILDSTDERR: | BUILDSTDERR: 261 | for (int i = 0; i < (command & 0x0f); i++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 262 | payload = (payload << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 263 | BUILDSTDERR: | BUILDSTDERR: 264 | debug("Next command at offset %d: 0x%02x 0x%0*x\n", file_offset - 1 - (command & 0x0f), BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 265 | command, 2*(command & 0x0f), payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 266 | BUILDSTDERR: | BUILDSTDERR: 267 | uint16_t end_token; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 268 | BUILDSTDERR: | BUILDSTDERR: 269 | switch (command & 0xf0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 270 | { BUILDSTDERR: | ~ BUILDSTDERR: 271 | case 0x00: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 272 | switch (payload) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 273 | { BUILDSTDERR: | ~ BUILDSTDERR: 274 | case 0x01: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 275 | info("CRAM Data [%d]: %d x %d bits = %d bits = %d bytes\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 276 | current_bank, current_width, current_height, BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 277 | current_height*current_width, (current_height*current_width)/8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 278 | BUILDSTDERR: | BUILDSTDERR: 279 | this->cram_width = std::max(this->cram_width, current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 280 | this->cram_height = std::max(this->cram_height, current_offset + current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 281 | BUILDSTDERR: | BUILDSTDERR: 282 | this->cram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 283 | this->cram[current_bank].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 284 | for (int x = 0; x < current_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 285 | this->cram[current_bank][x].resize(this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 286 | BUILDSTDERR: | BUILDSTDERR: 287 | for (int i = 0; i < (current_height*current_width)/8; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 288 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 289 | for (int j = 0; j < 8; j++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 290 | int x = (i*8 + j) % current_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 291 | int y = (i*8 + j) / current_width + current_offset; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 292 | this->cram[current_bank][x][y] = ((byte << j) & 0x80) != 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 293 | } BUILDSTDERR: | ~ BUILDSTDERR: 294 | } BUILDSTDERR: | ~ BUILDSTDERR: 295 | BUILDSTDERR: | BUILDSTDERR: 296 | end_token = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 297 | end_token = (end_token << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 298 | if (end_token) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 299 | error("Expeded 0x0000 after CRAM data, got 0x%04x\n", end_token); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 300 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 301 | BUILDSTDERR: | BUILDSTDERR: 302 | case 0x03: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 303 | info("BRAM Data [%d]: %d x %d bits = %d bits = %d bytes\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 304 | current_bank, current_width, current_height, BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 305 | current_height*current_width, (current_height*current_width)/8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 306 | BUILDSTDERR: | BUILDSTDERR: 307 | this->bram_width = std::max(this->bram_width, current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 308 | this->bram_height = std::max(this->bram_height, current_offset + current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 309 | BUILDSTDERR: | BUILDSTDERR: 310 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 311 | this->bram[current_bank].resize(this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 312 | for (int x = 0; x < current_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 313 | this->bram[current_bank][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 314 | BUILDSTDERR: | BUILDSTDERR: 315 | for (int i = 0; i < (current_height*current_width)/8; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 316 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 317 | for (int j = 0; j < 8; j++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 318 | int x = (i*8 + j) % current_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 319 | int y = (i*8 + j) / current_width + current_offset; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 320 | this->bram[current_bank][x][y] = ((byte << j) & 0x80) != 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 321 | } BUILDSTDERR: | ~ BUILDSTDERR: 322 | } BUILDSTDERR: | ~ BUILDSTDERR: 323 | BUILDSTDERR: | BUILDSTDERR: 324 | end_token = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 325 | end_token = (end_token << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 326 | if (end_token) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 327 | error("Expeded 0x0000 after BRAM data, got 0x%04x\n", end_token); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 328 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 329 | BUILDSTDERR: | BUILDSTDERR: 330 | case 0x05: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 331 | debug("Resetting CRC.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 332 | crc_value = 0xffff; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 333 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 334 | BUILDSTDERR: | BUILDSTDERR: 335 | case 0x06: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 336 | info("Wakeup.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 337 | wakeup = true; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 338 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 339 | BUILDSTDERR: | BUILDSTDERR: 340 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 341 | error("Unknown command: 0x%02x 0x%02x\n", command, payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 342 | } BUILDSTDERR: | ~ BUILDSTDERR: 343 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 344 | BUILDSTDERR: | BUILDSTDERR: 345 | case 0x10: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 346 | current_bank = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 347 | debug("Set bank to %d.\n", current_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 348 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 349 | BUILDSTDERR: | BUILDSTDERR: 350 | case 0x20: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 351 | if (crc_value != 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 352 | error("CRC Check FAILED.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 353 | info("CRC Check OK.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 354 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 355 | BUILDSTDERR: | BUILDSTDERR: 356 | case 0x50: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 357 | if (payload == 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 358 | this->freqrange = "low"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 359 | else if (payload == 1) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 360 | this->freqrange = "medium"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 361 | else if (payload == 2) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 362 | this->freqrange = "high"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 363 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 364 | error("Unknown freqrange payload 0x%02x\n", payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 365 | info("Setting freqrange to '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 366 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 367 | BUILDSTDERR: | BUILDSTDERR: 368 | case 0x60: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 369 | current_width = payload + 1; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 370 | debug("Setting bank width to %d.\n", current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 371 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 372 | BUILDSTDERR: | BUILDSTDERR: 373 | case 0x70: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 374 | current_height = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 375 | debug("Setting bank height to %d.\n", current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 376 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 377 | BUILDSTDERR: | BUILDSTDERR: 378 | case 0x80: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 379 | current_offset = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 380 | debug("Setting bank offset to %d.\n", current_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 381 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 382 | BUILDSTDERR: | BUILDSTDERR: 383 | case 0x90: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 384 | switch(payload) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 385 | { BUILDSTDERR: | ~ BUILDSTDERR: 386 | case 0: BUILDSTDERR: | ~~~~~~~ BUILDSTDERR: 387 | this->warmboot = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 388 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 389 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 390 | case 1: BUILDSTDERR: | ~~~~~~~ BUILDSTDERR: 391 | this->warmboot = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 392 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 393 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 394 | case 32: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 395 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 396 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 397 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 398 | case 33: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 399 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 400 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 401 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 402 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 403 | error("Unknown warmboot/nosleep payload 0x%02x\n", payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 404 | } BUILDSTDERR: | ~ BUILDSTDERR: 405 | info("Setting warmboot to '%s', nosleep to '%s'.\n", this->warmboot.c_str(), this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 406 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 407 | BUILDSTDERR: | BUILDSTDERR: 408 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 409 | error("Unknown command: 0x%02x 0x%02x\n", command, payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 410 | } BUILDSTDERR: | ~ BUILDSTDERR: 411 | } BUILDSTDERR: | ~ BUILDSTDERR: 412 | BUILDSTDERR: | BUILDSTDERR: 413 | if (this->cram_width == 182 && this->cram_height == 80) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 414 | this->device = "384"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 415 | else if (this->cram_width == 332 && this->cram_height == 144) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 416 | this->device = "1k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 417 | else if (this->cram_width == 872 && this->cram_height == 272) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 418 | this->device = "8k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 419 | else if (this->cram_width == 692 && this->cram_height == 336) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 420 | this->device = "5k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 421 | else if (this->cram_width == 692 && this->cram_height == 176) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 422 | this->device = "u4k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 423 | else if (this->cram_width == 656 && this->cram_height == 176) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 424 | this->device = "lm4k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 425 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 426 | error("Failed to detect chip type.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 427 | BUILDSTDERR: | BUILDSTDERR: 428 | info("Chip type is '%s'.\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 429 | } BUILDSTDERR: | ~ BUILDSTDERR: 430 | BUILDSTDERR: | BUILDSTDERR: 431 | void FpgaConfig::write_bits(std::ostream &ofs) const BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 432 | { BUILDSTDERR: | ~ BUILDSTDERR: 433 | int file_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 434 | uint16_t crc_value = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 435 | BUILDSTDERR: | BUILDSTDERR: 436 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 437 | info("Writing bitstream file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 438 | BUILDSTDERR: | BUILDSTDERR: 439 | for (auto byte : this->initblop) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 440 | ofs << byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 441 | BUILDSTDERR: | BUILDSTDERR: 442 | debug("Writing preamble.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 443 | write_byte(ofs, crc_value, file_offset, 0x7E); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 444 | write_byte(ofs, crc_value, file_offset, 0xAA); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 445 | write_byte(ofs, crc_value, file_offset, 0x99); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 446 | write_byte(ofs, crc_value, file_offset, 0x7E); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 447 | BUILDSTDERR: | BUILDSTDERR: 448 | debug("Setting freqrange to '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 449 | write_byte(ofs, crc_value, file_offset, 0x51); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 450 | if (this->freqrange == "low") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 451 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 452 | else if (this->freqrange == "medium") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 453 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 454 | else if (this->freqrange == "high") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 455 | write_byte(ofs, crc_value, file_offset, 0x02); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 456 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 457 | error("Unknown freqrange '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 458 | BUILDSTDERR: | BUILDSTDERR: 459 | debug("Resetting CRC.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 460 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 461 | write_byte(ofs, crc_value, file_offset, 0x05); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 462 | crc_value = 0xffff; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 463 | BUILDSTDERR: | BUILDSTDERR: 464 | { BUILDSTDERR: | ~ BUILDSTDERR: 465 | uint8_t nosleep_flag; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 466 | debug("Setting warmboot to '%s', nosleep to '%s'.\n", this->warmboot.c_str(), this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 467 | write_byte(ofs, crc_value, file_offset, 0x92); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 468 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 469 | BUILDSTDERR: | BUILDSTDERR: 470 | if (this->nosleep == "disabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 471 | nosleep_flag = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 472 | else if (this->nosleep == "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 473 | nosleep_flag = 1; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 474 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 475 | error("Unknown nosleep setting '%s'.\n", this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 476 | BUILDSTDERR: | BUILDSTDERR: 477 | if (this->warmboot == "disabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 478 | write_byte(ofs, crc_value, file_offset, 0x00 | nosleep_flag); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 479 | else if (this->warmboot == "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 480 | write_byte(ofs, crc_value, file_offset, 0x20 | nosleep_flag); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 481 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 482 | error("Unknown warmboot setting '%s'.\n", this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 483 | } BUILDSTDERR: | ~ BUILDSTDERR: 484 | BUILDSTDERR: | BUILDSTDERR: 485 | debug("CRAM: Setting bank width to %d.\n", this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 486 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 487 | write_byte(ofs, crc_value, file_offset, (this->cram_width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 488 | write_byte(ofs, crc_value, file_offset, (this->cram_width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 489 | if(this->device != "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 490 | debug("CRAM: Setting bank height to %d.\n", this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 491 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 492 | write_byte(ofs, crc_value, file_offset, this->cram_height >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 493 | write_byte(ofs, crc_value, file_offset, this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 494 | } BUILDSTDERR: | ~ BUILDSTDERR: 495 | BUILDSTDERR: | BUILDSTDERR: 496 | debug("CRAM: Setting bank offset to 0.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 497 | write_byte(ofs, crc_value, file_offset, 0x82); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 498 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 499 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 500 | BUILDSTDERR: | BUILDSTDERR: 501 | for (int cram_bank = 0; cram_bank < 4; cram_bank++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 502 | { BUILDSTDERR: | ~ BUILDSTDERR: 503 | vector cram_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 504 | int height = this->cram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 505 | if(this->device == "5k" && ((cram_bank % 2) == 1)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 506 | height = height / 2 + 8; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 507 | for (int cram_y = 0; cram_y < height; cram_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 508 | for (int cram_x = 0; cram_x < this->cram_width; cram_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 509 | cram_bits.push_back(this->cram[cram_bank][cram_x][cram_y]); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 510 | BUILDSTDERR: | BUILDSTDERR: 511 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 512 | debug("CRAM: Setting bank height to %d.\n", height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 513 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 514 | write_byte(ofs, crc_value, file_offset, height >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 515 | write_byte(ofs, crc_value, file_offset, height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 516 | } BUILDSTDERR: | ~ BUILDSTDERR: 517 | BUILDSTDERR: | BUILDSTDERR: 518 | debug("CRAM: Setting bank %d.\n", cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 519 | write_byte(ofs, crc_value, file_offset, 0x11); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 520 | write_byte(ofs, crc_value, file_offset, cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 521 | BUILDSTDERR: | BUILDSTDERR: 522 | debug("CRAM: Writing bank %d data.\n", cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 523 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 524 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 525 | for (int i = 0; i < int(cram_bits.size()); i += 8) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 526 | uint8_t byte = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 527 | for (int j = 0; j < 8; j++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 528 | byte = (byte << 1) | (cram_bits[i+j] ? 1 : 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 529 | write_byte(ofs, crc_value, file_offset, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 530 | } BUILDSTDERR: | ~ BUILDSTDERR: 531 | BUILDSTDERR: | BUILDSTDERR: 532 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 533 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 534 | } BUILDSTDERR: | ~ BUILDSTDERR: 535 | BUILDSTDERR: | BUILDSTDERR: 536 | int bram_chunk_size = 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 537 | BUILDSTDERR: | BUILDSTDERR: 538 | if (this->bram_width && this->bram_height) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 539 | { BUILDSTDERR: | ~ BUILDSTDERR: 540 | if(this->device != "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 541 | debug("BRAM: Setting bank width to %d.\n", this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 542 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 543 | write_byte(ofs, crc_value, file_offset, (this->bram_width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 544 | write_byte(ofs, crc_value, file_offset, (this->bram_width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 545 | } BUILDSTDERR: | ~ BUILDSTDERR: 546 | BUILDSTDERR: | BUILDSTDERR: 547 | BUILDSTDERR: | BUILDSTDERR: 548 | debug("BRAM: Setting bank height to %d.\n", this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 549 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 550 | write_byte(ofs, crc_value, file_offset, bram_chunk_size >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 551 | write_byte(ofs, crc_value, file_offset, bram_chunk_size); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 552 | BUILDSTDERR: | BUILDSTDERR: 553 | for (int bram_bank = 0; bram_bank < 4; bram_bank++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 554 | { BUILDSTDERR: | ~ BUILDSTDERR: 555 | debug("BRAM: Setting bank %d.\n", bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 556 | write_byte(ofs, crc_value, file_offset, 0x11); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 557 | write_byte(ofs, crc_value, file_offset, bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 558 | BUILDSTDERR: | BUILDSTDERR: 559 | for (int offset = 0; offset < this->bram_height; offset += bram_chunk_size) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 560 | { BUILDSTDERR: | ~ BUILDSTDERR: 561 | vector bram_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 562 | int width = this->bram_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 563 | if(this->device == "5k" && ((bram_bank % 2) == 1)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 564 | width = width / 2; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 565 | for (int bram_y = 0; bram_y < bram_chunk_size; bram_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 566 | for (int bram_x = 0; bram_x < width; bram_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 567 | bram_bits.push_back(this->bram[bram_bank][bram_x][bram_y+offset]); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 568 | BUILDSTDERR: | BUILDSTDERR: 569 | debug("BRAM: Setting bank offset to %d.\n", offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 570 | write_byte(ofs, crc_value, file_offset, 0x82); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 571 | write_byte(ofs, crc_value, file_offset, offset >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 572 | write_byte(ofs, crc_value, file_offset, offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 573 | BUILDSTDERR: | BUILDSTDERR: 574 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 575 | debug("BRAM: Setting bank width to %d.\n", width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 576 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 577 | write_byte(ofs, crc_value, file_offset, (width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 578 | write_byte(ofs, crc_value, file_offset, (width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 579 | } BUILDSTDERR: | ~ BUILDSTDERR: 580 | BUILDSTDERR: | BUILDSTDERR: 581 | BUILDSTDERR: | BUILDSTDERR: 582 | debug("BRAM: Writing bank %d data.\n", bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 583 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 584 | write_byte(ofs, crc_value, file_offset, 0x03); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 585 | for (int i = 0; i < int(bram_bits.size()); i += 8) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 586 | uint8_t byte = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 587 | for (int j = 0; j < 8; j++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 588 | byte = (byte << 1) | (bram_bits[i+j] ? 1 : 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 589 | write_byte(ofs, crc_value, file_offset, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 590 | } BUILDSTDERR: | ~ BUILDSTDERR: 591 | BUILDSTDERR: | BUILDSTDERR: 592 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 593 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 594 | } BUILDSTDERR: | ~ BUILDSTDERR: 595 | } BUILDSTDERR: | ~ BUILDSTDERR: 596 | } BUILDSTDERR: | ~ BUILDSTDERR: 597 | BUILDSTDERR: | BUILDSTDERR: 598 | debug("Writing CRC value.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 599 | write_byte(ofs, crc_value, file_offset, 0x22); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 600 | uint8_t crc_hi = crc_value >> 8, crc_lo = crc_value; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 601 | write_byte(ofs, crc_value, file_offset, crc_hi); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 602 | write_byte(ofs, crc_value, file_offset, crc_lo); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 603 | BUILDSTDERR: | BUILDSTDERR: 604 | debug("Wakeup.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 605 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 606 | write_byte(ofs, crc_value, file_offset, 0x06); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 607 | BUILDSTDERR: | BUILDSTDERR: 608 | debug("Padding byte.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 609 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 610 | } BUILDSTDERR: | ~ BUILDSTDERR: 611 | BUILDSTDERR: | BUILDSTDERR: 612 | void FpgaConfig::read_ascii(std::istream &ifs, bool nosleep) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 613 | { BUILDSTDERR: | ~ BUILDSTDERR: 614 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 615 | info("Parsing ascii file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 616 | BUILDSTDERR: | BUILDSTDERR: 617 | bool got_device = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 618 | this->cram.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 619 | this->bram.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 620 | this->freqrange = "low"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 621 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 622 | BUILDSTDERR: | BUILDSTDERR: 623 | bool reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 624 | string line, command; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 625 | BUILDSTDERR: | BUILDSTDERR: 626 | while (reuse_line || getline(ifs, line)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 627 | { BUILDSTDERR: | ~ BUILDSTDERR: 628 | reuse_line = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 629 | BUILDSTDERR: | BUILDSTDERR: 630 | std::istringstream is(line); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 631 | is >> command; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 632 | BUILDSTDERR: | BUILDSTDERR: 633 | if (command.empty()) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 634 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 635 | BUILDSTDERR: | BUILDSTDERR: 636 | debug("Next command: %s\n", line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 637 | BUILDSTDERR: | BUILDSTDERR: 638 | if (command == ".comment") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 639 | { BUILDSTDERR: | ~ BUILDSTDERR: 640 | this->initblop.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 641 | this->initblop.push_back(0xff); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 642 | this->initblop.push_back(0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 643 | BUILDSTDERR: | BUILDSTDERR: 644 | while (getline(ifs, line)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 645 | { BUILDSTDERR: | ~ BUILDSTDERR: 646 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 647 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 648 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 649 | } BUILDSTDERR: | ~ BUILDSTDERR: 650 | BUILDSTDERR: | BUILDSTDERR: 651 | for (auto ch : line) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 652 | this->initblop.push_back(ch); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 653 | this->initblop.push_back(0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 654 | } BUILDSTDERR: | ~ BUILDSTDERR: 655 | BUILDSTDERR: | BUILDSTDERR: 656 | this->initblop.push_back(0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 657 | this->initblop.push_back(0xff); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 658 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 659 | } BUILDSTDERR: | ~ BUILDSTDERR: 660 | BUILDSTDERR: | BUILDSTDERR: 661 | if (command == ".device") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 662 | { BUILDSTDERR: | ~ BUILDSTDERR: 663 | if (got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 664 | error("More than one .device statement.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 665 | BUILDSTDERR: | BUILDSTDERR: 666 | is >> this->device; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 667 | BUILDSTDERR: | BUILDSTDERR: 668 | if (this->device == "384") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 669 | this->cram_width = 182; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 670 | this->cram_height = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 671 | this->bram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 672 | this->bram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 673 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 674 | if (this->device == "1k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 675 | this->cram_width = 332; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 676 | this->cram_height = 144; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 677 | this->bram_width = 64; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 678 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 679 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 680 | if (this->device == "8k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 681 | this->cram_width = 872; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 682 | this->cram_height = 272; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 683 | this->bram_width = 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 684 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 685 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 686 | if (this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 687 | this->cram_width = 692; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 688 | this->cram_height = 336; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 689 | this->bram_width = 160; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 690 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 691 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 692 | if (this->device == "u4k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 693 | this->cram_width = 692; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 694 | this->cram_height = 176; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 695 | this->bram_width = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 696 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 697 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 698 | if (this->device == "lm4k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 699 | this->cram_width = 656; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 700 | this->cram_height = 176; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 701 | this->bram_width = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 702 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 703 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 704 | error("Unsupported chip type '%s'.\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 705 | BUILDSTDERR: | BUILDSTDERR: 706 | this->cram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 707 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 708 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 709 | this->cram[i].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 710 | for (int x = 0; x < this->cram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 711 | this->cram[i][x].resize(((i % 2) == 1) ? (this->cram_height / 2 + 8) : this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 712 | } BUILDSTDERR: | ~ BUILDSTDERR: 713 | BUILDSTDERR: | BUILDSTDERR: 714 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 715 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 716 | int width = ((i % 2) == 1) ? (this->bram_width / 2) : this->bram_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 717 | this->bram[i].resize(width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 718 | for (int x = 0; x < width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 719 | this->bram[i][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 720 | } BUILDSTDERR: | ~ BUILDSTDERR: 721 | } else { BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 722 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 723 | this->cram[i].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 724 | for (int x = 0; x < this->cram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 725 | this->cram[i][x].resize(this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 726 | } BUILDSTDERR: | ~ BUILDSTDERR: 727 | BUILDSTDERR: | BUILDSTDERR: 728 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 729 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 730 | this->bram[i].resize(this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 731 | for (int x = 0; x < this->bram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 732 | this->bram[i][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 733 | } BUILDSTDERR: | ~ BUILDSTDERR: 734 | } BUILDSTDERR: | ~ BUILDSTDERR: 735 | BUILDSTDERR: | BUILDSTDERR: 736 | BUILDSTDERR: | BUILDSTDERR: 737 | got_device = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 738 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 739 | } BUILDSTDERR: | ~ BUILDSTDERR: 740 | BUILDSTDERR: | BUILDSTDERR: 741 | if (command == ".warmboot") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 742 | { BUILDSTDERR: | ~ BUILDSTDERR: 743 | is >> this->warmboot; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 744 | BUILDSTDERR: | BUILDSTDERR: 745 | if (this->warmboot != "disabled" && BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 746 | this->warmboot != "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 747 | error("Unknown warmboot setting '%s'.\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 748 | this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 749 | BUILDSTDERR: | BUILDSTDERR: 750 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 751 | } BUILDSTDERR: | ~ BUILDSTDERR: 752 | BUILDSTDERR: | BUILDSTDERR: 753 | // No ".nosleep" section despite sharing the same byte as .warmboot. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 754 | // ".nosleep" is specified when icepack is invoked, which is too late. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 755 | // So we inject the section based on command line argument. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 756 | if (nosleep) BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 757 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 758 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 759 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 760 | BUILDSTDERR: | BUILDSTDERR: 761 | if (command == ".io_tile" || command == ".logic_tile" || command == ".ramb_tile" || command == ".ramt_tile" || command.substr(0, 4) == ".dsp" || command == ".ipcon_tile") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 762 | { BUILDSTDERR: | ~ BUILDSTDERR: 763 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 764 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 765 | BUILDSTDERR: | BUILDSTDERR: 766 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 767 | is >> tile_x >> tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 768 | BUILDSTDERR: | BUILDSTDERR: 769 | CramIndexConverter cic(this, tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 770 | BUILDSTDERR: | BUILDSTDERR: 771 | if (("." + cic.tile_type + "_tile") != command) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 772 | error("Got %s statement for %s tile %d %d.\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 773 | command.c_str(), cic.tile_type.c_str(), tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 774 | BUILDSTDERR: | BUILDSTDERR: 775 | for (int bit_y = 0; bit_y < 16 && getline(ifs, line); bit_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 776 | { BUILDSTDERR: | ~ BUILDSTDERR: 777 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 778 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 779 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 780 | } BUILDSTDERR: | ~ BUILDSTDERR: 781 | BUILDSTDERR: | BUILDSTDERR: 782 | for (int bit_x = 0; bit_x < int(line.size()) && bit_x < cic.tile_width; bit_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 783 | if (line[bit_x] == '1') { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 784 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 785 | cic.get_cram_index(bit_x, bit_y, cram_bank, cram_x, cram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 786 | this->cram[cram_bank][cram_x][cram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 787 | } BUILDSTDERR: | ~ BUILDSTDERR: 788 | } BUILDSTDERR: | ~ BUILDSTDERR: 789 | BUILDSTDERR: | BUILDSTDERR: 790 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 791 | } BUILDSTDERR: | ~ BUILDSTDERR: 792 | BUILDSTDERR: | BUILDSTDERR: 793 | if (command == ".ram_data") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 794 | { BUILDSTDERR: | ~ BUILDSTDERR: 795 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 796 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 797 | BUILDSTDERR: | BUILDSTDERR: 798 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 799 | is >> tile_x >> tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 800 | BUILDSTDERR: | BUILDSTDERR: 801 | BramIndexConverter bic(this, tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 802 | BUILDSTDERR: | BUILDSTDERR: 803 | for (int bit_y = 0; bit_y < 16 && getline(ifs, line); bit_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 804 | { BUILDSTDERR: | ~ BUILDSTDERR: 805 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 806 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 807 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 808 | } BUILDSTDERR: | ~ BUILDSTDERR: 809 | BUILDSTDERR: | BUILDSTDERR: 810 | for (int bit_x = 256-4, ch_idx = 0; ch_idx < int(line.size()) && bit_x >= 0; bit_x -= 4, ch_idx++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 811 | { BUILDSTDERR: | ~ BUILDSTDERR: 812 | int value = -1; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 813 | if ('0' <= line[ch_idx] && line[ch_idx] <= '9') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 814 | value = line[ch_idx] - '0'; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 815 | if ('a' <= line[ch_idx] && line[ch_idx] <= 'f') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 816 | value = line[ch_idx] - 'a' + 10; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 817 | if ('A' <= line[ch_idx] && line[ch_idx] <= 'F') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 818 | value = line[ch_idx] - 'A' + 10; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 819 | if (value < 0) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 820 | error("Not a hex character: '%c' (in line '%s')\n", line[ch_idx], line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 821 | BUILDSTDERR: | BUILDSTDERR: 822 | for (int i = 0; i < 4; i++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 823 | if ((value & (1 << i)) != 0) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 824 | int bram_bank, bram_x, bram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 825 | bic.get_bram_index(bit_x+i, bit_y, bram_bank, bram_x, bram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 826 | this->bram[bram_bank][bram_x][bram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 827 | } BUILDSTDERR: | ~ BUILDSTDERR: 828 | } BUILDSTDERR: | ~ BUILDSTDERR: 829 | } BUILDSTDERR: | ~ BUILDSTDERR: 830 | BUILDSTDERR: | BUILDSTDERR: 831 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 832 | } BUILDSTDERR: | ~ BUILDSTDERR: 833 | BUILDSTDERR: | BUILDSTDERR: 834 | if (command == ".extra_bit") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 835 | { BUILDSTDERR: | ~ BUILDSTDERR: 836 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 837 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 838 | BUILDSTDERR: | BUILDSTDERR: 839 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 840 | is >> cram_bank >> cram_x >> cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 841 | this->cram[cram_bank][cram_x][cram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 842 | BUILDSTDERR: | BUILDSTDERR: 843 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 844 | } BUILDSTDERR: | ~ BUILDSTDERR: 845 | BUILDSTDERR: | BUILDSTDERR: 846 | if (command == ".sym") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 847 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 848 | BUILDSTDERR: | BUILDSTDERR: 849 | if (command.substr(0, 1) == ".") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 850 | error("Unknown statement: %s\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 851 | error("Unexpected data line: %s\n", line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 852 | } BUILDSTDERR: | ~ BUILDSTDERR: 853 | } BUILDSTDERR: | ~ BUILDSTDERR: 854 | BUILDSTDERR: | BUILDSTDERR: 855 | void FpgaConfig::write_ascii(std::ostream &ofs) const BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 856 | { BUILDSTDERR: | ~ BUILDSTDERR: 857 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 858 | info("Writing ascii file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 859 | BUILDSTDERR: | BUILDSTDERR: 860 | ofs << ".comment"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 861 | bool insert_newline = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 862 | for (auto ch : this->initblop) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 863 | if (ch == 0) { BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 864 | insert_newline = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 865 | } else if (ch == 0xff) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 866 | insert_newline = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 867 | } else { BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 868 | if (insert_newline) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 869 | ofs << '\n'; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 870 | ofs << ch; BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 871 | insert_newline = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 872 | } BUILDSTDERR: | ~ BUILDSTDERR: 873 | } BUILDSTDERR: | ~ BUILDSTDERR: 874 | BUILDSTDERR: | BUILDSTDERR: 875 | ofs << stringf("\n.device %s\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 876 | if (this->warmboot != "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 877 | ofs << stringf(".warmboot %s\n", this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 878 | BUILDSTDERR: | BUILDSTDERR: 879 | // As "nosleep" is an icepack command, we do not write out a ".nosleep" BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 880 | // section. However, we parse it in read_bits() and notify the user in BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 881 | // info. BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 882 | BUILDSTDERR: | BUILDSTDERR: 883 | typedef std::tuple tile_bit_t; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 884 | std::set tile_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 885 | BUILDSTDERR: | BUILDSTDERR: 886 | for (int y = 0; y <= this->chip_height()+1; y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 887 | for (int x = 0; x <= this->chip_width()+1; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 888 | { BUILDSTDERR: | ~ BUILDSTDERR: 889 | CramIndexConverter cic(this, x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 890 | BUILDSTDERR: | BUILDSTDERR: 891 | if (cic.tile_type == "corner" || cic.tile_type == "unsupported") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 892 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 893 | BUILDSTDERR: | BUILDSTDERR: 894 | ofs << stringf(".%s_tile %d %d\n", cic.tile_type.c_str(), x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 895 | BUILDSTDERR: | BUILDSTDERR: 896 | for (int bit_y = 0; bit_y < 16; bit_y++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 897 | for (int bit_x = 0; bit_x < cic.tile_width; bit_x++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 898 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 899 | cic.get_cram_index(bit_x, bit_y, cram_bank, cram_x, cram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 900 | tile_bits.insert(tile_bit_t(cram_bank, cram_x, cram_y)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 901 | if (cram_x > int(this->cram[cram_bank].size())) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 902 | error("cram_x %d (bit %d, %d) larger than bank size %lu\n", cram_x, bit_x, bit_y, this->cram[cram_bank].size()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 903 | } BUILDSTDERR: | ~ BUILDSTDERR: 904 | if (cram_y > int(this->cram[cram_bank][cram_x].size())) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 905 | error("cram_y %d (bit %d, %d) larger than bank %d size %lu\n", cram_y, bit_x, bit_y, cram_bank, this->cram[cram_bank][cram_x].size()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 906 | } BUILDSTDERR: | ~ BUILDSTDERR: 907 | ofs << (this->cram[cram_bank][cram_x][cram_y] ? '1' : '0'); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 908 | } BUILDSTDERR: | ~ BUILDSTDERR: 909 | ofs << '\n'; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 910 | } BUILDSTDERR: | ~ BUILDSTDERR: 911 | BUILDSTDERR: | BUILDSTDERR: 912 | if (cic.tile_type == "ramb") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 913 | { BUILDSTDERR: | ~ BUILDSTDERR: 914 | BramIndexConverter bic(this, x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 915 | ofs << stringf(".ram_data %d %d\n", x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 916 | BUILDSTDERR: | BUILDSTDERR: 917 | for (int bit_y = 0; bit_y < 16; bit_y++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 918 | for (int bit_x = 256-4; bit_x >= 0; bit_x -= 4) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 919 | int value = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 920 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 921 | int bram_bank, bram_x, bram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 922 | bic.get_bram_index(bit_x+i, bit_y, bram_bank, bram_x, bram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 923 | if (bram_x >= int(this->bram[bram_bank].size())) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 924 | error("%d %d bram_x %d higher than loaded bram size %lu\n",bit_x+i, bit_y, bram_x, this->bram[bram_bank].size()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: | | BUILDSTDERR: | std::vector >::size_type {aka unsigned int} BUILDSTDERR: icepack.cc:924:8: note: in expansion of macro 'error' BUILDSTDERR: 924 | error("%d %d bram_x %d higher than loaded bram size %lu\n",bit_x+i, bit_y, bram_x, this->bram[bram_bank].size()); BUILDSTDERR: | ^~~~~ BUILDSTDERR: icepack.cc:924:62: note: format string is defined here BUILDSTDERR: 924 | error("%d %d bram_x %d higher than loaded bram size %lu\n",bit_x+i, bit_y, bram_x, this->bram[bram_bank].size()); BUILDSTDERR: | ~~^ BUILDSTDERR: | | BUILDSTDERR: | long unsigned int BUILDSTDERR: | %u BUILDSTDERR: icepack.cc:53:41: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'std::vector::size_type' {aka 'unsigned int'} [-Wformat=] BUILDSTDERR: 53 | #define error(...) do { fprintf(stderr, "Error: " __VA_ARGS__); exit(1); } while (0) BUILDSTDERR: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 54 | #define panic(fmt, ...) do { fprintf(stderr, "Internal Error at %s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__); abort(); } while (0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 55 | BUILDSTDERR: | BUILDSTDERR: 56 | string vstringf(const char *fmt, va_list ap) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 57 | { BUILDSTDERR: | ~ BUILDSTDERR: 58 | string string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 59 | char *str = NULL; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 60 | BUILDSTDERR: | BUILDSTDERR: 61 | #ifdef _WIN32 BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 62 | int sz = 64, rc; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 63 | while (1) { BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 64 | va_list apc; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 65 | va_copy(apc, ap); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 66 | str = (char*)realloc(str, sz); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 67 | rc = vsnprintf(str, sz, fmt, apc); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 68 | va_end(apc); BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 69 | if (rc >= 0 && rc < sz) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 70 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 71 | sz *= 2; BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 72 | } BUILDSTDERR: | ~ BUILDSTDERR: 73 | #else BUILDSTDERR: | ~~~~~ BUILDSTDERR: 74 | if (vasprintf(&str, fmt, ap) < 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 75 | str = NULL; BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 76 | #endif BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 77 | BUILDSTDERR: | BUILDSTDERR: 78 | if (str != NULL) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 79 | string = str; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 80 | free(str); BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 81 | } BUILDSTDERR: | ~ BUILDSTDERR: 82 | BUILDSTDERR: | BUILDSTDERR: 83 | return string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 84 | } BUILDSTDERR: | ~ BUILDSTDERR: 85 | BUILDSTDERR: | BUILDSTDERR: 86 | string stringf(const char *fmt, ...) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 87 | { BUILDSTDERR: | ~ BUILDSTDERR: 88 | string string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 89 | va_list ap; BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 90 | BUILDSTDERR: | BUILDSTDERR: 91 | va_start(ap, fmt); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 92 | string = vstringf(fmt, ap); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 93 | va_end(ap); BUILDSTDERR: | ~~~~~~~~~~~ BUILDSTDERR: 94 | BUILDSTDERR: | BUILDSTDERR: 95 | return string; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 96 | } BUILDSTDERR: | ~ BUILDSTDERR: 97 | BUILDSTDERR: | BUILDSTDERR: 98 | // ================================================================== BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 99 | // FpgaConfig stuff BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 100 | BUILDSTDERR: | BUILDSTDERR: 101 | struct FpgaConfig BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 102 | { BUILDSTDERR: | ~ BUILDSTDERR: 103 | string device; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 104 | string freqrange; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 105 | string nosleep; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 106 | string warmboot; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 107 | BUILDSTDERR: | BUILDSTDERR: 108 | // cram[BANK][X][Y] BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 109 | int cram_width, cram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 110 | vector>> cram; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 111 | BUILDSTDERR: | BUILDSTDERR: 112 | // bram[BANK][X][Y] BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 113 | int bram_width, bram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 114 | vector>> bram; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 115 | BUILDSTDERR: | BUILDSTDERR: 116 | // data before preamble BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 117 | vector initblop; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 118 | BUILDSTDERR: | BUILDSTDERR: 119 | // bitstream i/o BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 120 | void read_bits(std::istream &ifs); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 121 | void write_bits(std::ostream &ofs) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 122 | BUILDSTDERR: | BUILDSTDERR: 123 | // icebox i/o BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 124 | void read_ascii(std::istream &ifs, bool nosleep); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 125 | void write_ascii(std::ostream &ofs) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 126 | BUILDSTDERR: | BUILDSTDERR: 127 | // netpbm i/o BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 128 | void write_cram_pbm(std::ostream &ofs, int bank_num = -1) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 129 | void write_bram_pbm(std::ostream &ofs, int bank_num = -1) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 130 | BUILDSTDERR: | BUILDSTDERR: 131 | // query chip type metadata BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 132 | int chip_width() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 133 | int chip_height() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 134 | vector chip_cols() const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 135 | BUILDSTDERR: | BUILDSTDERR: 136 | // query tile metadata BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 137 | string tile_type(int x, int y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 138 | int tile_width(const string &type) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 139 | BUILDSTDERR: | BUILDSTDERR: 140 | // cram bit manipulation BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 141 | void cram_clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 142 | void cram_fill_tiles(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 143 | void cram_checkerboard(int m = 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 144 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 145 | BUILDSTDERR: | BUILDSTDERR: 146 | struct CramIndexConverter BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 147 | { BUILDSTDERR: | ~ BUILDSTDERR: 148 | const FpgaConfig *fpga; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 149 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 150 | BUILDSTDERR: | BUILDSTDERR: 151 | string tile_type; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 152 | int tile_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 153 | int column_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 154 | BUILDSTDERR: | BUILDSTDERR: 155 | bool left_right_io; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 156 | bool right_half; BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 157 | bool top_half; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 158 | BUILDSTDERR: | BUILDSTDERR: 159 | int bank_num; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 160 | int bank_tx; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 161 | int bank_ty; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 162 | int bank_xoff; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 163 | int bank_yoff; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 164 | BUILDSTDERR: | BUILDSTDERR: 165 | CramIndexConverter(const FpgaConfig *fpga, int tile_x, int tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 166 | void get_cram_index(int bit_x, int bit_y, int &cram_bank, int &cram_x, int &cram_y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 167 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 168 | BUILDSTDERR: | BUILDSTDERR: 169 | struct BramIndexConverter BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 170 | { BUILDSTDERR: | ~ BUILDSTDERR: 171 | const FpgaConfig *fpga; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 172 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 173 | BUILDSTDERR: | BUILDSTDERR: 174 | int bank_num; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 175 | int bank_off; BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 176 | BUILDSTDERR: | BUILDSTDERR: 177 | BramIndexConverter(const FpgaConfig *fpga, int tile_x, int tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 178 | void get_bram_index(int bit_x, int bit_y, int &bram_bank, int &bram_x, int &bram_y) const; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 179 | }; BUILDSTDERR: | ~~ BUILDSTDERR: 180 | BUILDSTDERR: | BUILDSTDERR: 181 | static void update_crc16(uint16_t &crc, uint8_t byte) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 182 | { BUILDSTDERR: | ~ BUILDSTDERR: 183 | // CRC-16-CCITT, Initialize to 0xFFFF, No zero padding BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 184 | for (int i = 7; i >= 0; i--) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 185 | uint16_t xor_value = ((crc >> 15) ^ ((byte >> i) & 1)) ? 0x1021 : 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 186 | crc = (crc << 1) ^ xor_value; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 187 | } BUILDSTDERR: | ~ BUILDSTDERR: 188 | } BUILDSTDERR: | ~ BUILDSTDERR: 189 | BUILDSTDERR: | BUILDSTDERR: 190 | static uint8_t read_byte(std::istream &ifs, uint16_t &crc_value, int &file_offset) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 191 | { BUILDSTDERR: | ~ BUILDSTDERR: 192 | int byte = ifs.get(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 193 | BUILDSTDERR: | BUILDSTDERR: 194 | if (byte < 0) BUILDSTDERR: | ~~~~~~~~~~~~~ BUILDSTDERR: 195 | error("Unexpected end of file.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 196 | BUILDSTDERR: | BUILDSTDERR: 197 | file_offset++; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 198 | update_crc16(crc_value, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 199 | BUILDSTDERR: | BUILDSTDERR: 200 | return byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 201 | } BUILDSTDERR: | ~ BUILDSTDERR: 202 | BUILDSTDERR: | BUILDSTDERR: 203 | static void write_byte(std::ostream &ofs, uint16_t &crc_value, int &file_offset, uint8_t byte) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 204 | { BUILDSTDERR: | ~ BUILDSTDERR: 205 | ofs << byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 206 | file_offset++; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 207 | update_crc16(crc_value, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 208 | } BUILDSTDERR: | ~ BUILDSTDERR: 209 | BUILDSTDERR: | BUILDSTDERR: 210 | void FpgaConfig::read_bits(std::istream &ifs) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 211 | { BUILDSTDERR: | ~ BUILDSTDERR: 212 | int file_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 213 | uint16_t crc_value = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 214 | BUILDSTDERR: | BUILDSTDERR: 215 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 216 | info("Parsing bitstream file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 217 | BUILDSTDERR: | BUILDSTDERR: 218 | // skip initial comments until preamble is found BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 219 | BUILDSTDERR: | BUILDSTDERR: 220 | uint32_t preamble = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 221 | BUILDSTDERR: | BUILDSTDERR: 222 | while (1) BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 223 | { BUILDSTDERR: | ~ BUILDSTDERR: 224 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 225 | preamble = (preamble << 8) | byte; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 226 | if (preamble == 0xffffffff) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 227 | error("No preamble found in bitstream.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 228 | if (preamble == 0x7EAA997E) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 229 | info("Found preamble at offset %d.\n", file_offset-4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 230 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 231 | } BUILDSTDERR: | ~ BUILDSTDERR: 232 | initblop.push_back(byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 233 | } BUILDSTDERR: | ~ BUILDSTDERR: 234 | BUILDSTDERR: | BUILDSTDERR: 235 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 236 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 237 | initblop.pop_back(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 238 | BUILDSTDERR: | BUILDSTDERR: 239 | // main parser loop BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 240 | BUILDSTDERR: | BUILDSTDERR: 241 | int current_bank = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 242 | int current_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 243 | int current_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 244 | int current_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 245 | bool wakeup = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 246 | BUILDSTDERR: | BUILDSTDERR: 247 | this->cram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 248 | this->cram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 249 | BUILDSTDERR: | BUILDSTDERR: 250 | this->bram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 251 | this->bram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 252 | BUILDSTDERR: | BUILDSTDERR: 253 | while (!wakeup) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 254 | { BUILDSTDERR: | ~ BUILDSTDERR: 255 | // one command byte. the lower 4 bits of the command byte specify BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 256 | // the length of the command payload. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 257 | BUILDSTDERR: | BUILDSTDERR: 258 | uint8_t command = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 259 | uint32_t payload = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 260 | BUILDSTDERR: | BUILDSTDERR: 261 | for (int i = 0; i < (command & 0x0f); i++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 262 | payload = (payload << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 263 | BUILDSTDERR: | BUILDSTDERR: 264 | debug("Next command at offset %d: 0x%02x 0x%0*x\n", file_offset - 1 - (command & 0x0f), BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 265 | command, 2*(command & 0x0f), payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 266 | BUILDSTDERR: | BUILDSTDERR: 267 | uint16_t end_token; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 268 | BUILDSTDERR: | BUILDSTDERR: 269 | switch (command & 0xf0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 270 | { BUILDSTDERR: | ~ BUILDSTDERR: 271 | case 0x00: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 272 | switch (payload) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 273 | { BUILDSTDERR: | ~ BUILDSTDERR: 274 | case 0x01: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 275 | info("CRAM Data [%d]: %d x %d bits = %d bits = %d bytes\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 276 | current_bank, current_width, current_height, BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 277 | current_height*current_width, (current_height*current_width)/8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 278 | BUILDSTDERR: | BUILDSTDERR: 279 | this->cram_width = std::max(this->cram_width, current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 280 | this->cram_height = std::max(this->cram_height, current_offset + current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 281 | BUILDSTDERR: | BUILDSTDERR: 282 | this->cram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 283 | this->cram[current_bank].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 284 | for (int x = 0; x < current_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 285 | this->cram[current_bank][x].resize(this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 286 | BUILDSTDERR: | BUILDSTDERR: 287 | for (int i = 0; i < (current_height*current_width)/8; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 288 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 289 | for (int j = 0; j < 8; j++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 290 | int x = (i*8 + j) % current_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 291 | int y = (i*8 + j) / current_width + current_offset; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 292 | this->cram[current_bank][x][y] = ((byte << j) & 0x80) != 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 293 | } BUILDSTDERR: | ~ BUILDSTDERR: 294 | } BUILDSTDERR: | ~ BUILDSTDERR: 295 | BUILDSTDERR: | BUILDSTDERR: 296 | end_token = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 297 | end_token = (end_token << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 298 | if (end_token) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 299 | error("Expeded 0x0000 after CRAM data, got 0x%04x\n", end_token); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 300 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 301 | BUILDSTDERR: | BUILDSTDERR: 302 | case 0x03: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 303 | info("BRAM Data [%d]: %d x %d bits = %d bits = %d bytes\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 304 | current_bank, current_width, current_height, BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 305 | current_height*current_width, (current_height*current_width)/8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 306 | BUILDSTDERR: | BUILDSTDERR: 307 | this->bram_width = std::max(this->bram_width, current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 308 | this->bram_height = std::max(this->bram_height, current_offset + current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 309 | BUILDSTDERR: | BUILDSTDERR: 310 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 311 | this->bram[current_bank].resize(this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 312 | for (int x = 0; x < current_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 313 | this->bram[current_bank][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 314 | BUILDSTDERR: | BUILDSTDERR: 315 | for (int i = 0; i < (current_height*current_width)/8; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 316 | uint8_t byte = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 317 | for (int j = 0; j < 8; j++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 318 | int x = (i*8 + j) % current_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 319 | int y = (i*8 + j) / current_width + current_offset; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 320 | this->bram[current_bank][x][y] = ((byte << j) & 0x80) != 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 321 | } BUILDSTDERR: | ~ BUILDSTDERR: 322 | } BUILDSTDERR: | ~ BUILDSTDERR: 323 | BUILDSTDERR: | BUILDSTDERR: 324 | end_token = read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 325 | end_token = (end_token << 8) | read_byte(ifs, crc_value, file_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 326 | if (end_token) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 327 | error("Expeded 0x0000 after BRAM data, got 0x%04x\n", end_token); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 328 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 329 | BUILDSTDERR: | BUILDSTDERR: 330 | case 0x05: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 331 | debug("Resetting CRC.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 332 | crc_value = 0xffff; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 333 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 334 | BUILDSTDERR: | BUILDSTDERR: 335 | case 0x06: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 336 | info("Wakeup.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 337 | wakeup = true; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 338 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 339 | BUILDSTDERR: | BUILDSTDERR: 340 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 341 | error("Unknown command: 0x%02x 0x%02x\n", command, payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 342 | } BUILDSTDERR: | ~ BUILDSTDERR: 343 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 344 | BUILDSTDERR: | BUILDSTDERR: 345 | case 0x10: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 346 | current_bank = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 347 | debug("Set bank to %d.\n", current_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 348 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 349 | BUILDSTDERR: | BUILDSTDERR: 350 | case 0x20: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 351 | if (crc_value != 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 352 | error("CRC Check FAILED.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 353 | info("CRC Check OK.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 354 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 355 | BUILDSTDERR: | BUILDSTDERR: 356 | case 0x50: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 357 | if (payload == 0) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 358 | this->freqrange = "low"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 359 | else if (payload == 1) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 360 | this->freqrange = "medium"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 361 | else if (payload == 2) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 362 | this->freqrange = "high"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 363 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 364 | error("Unknown freqrange payload 0x%02x\n", payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 365 | info("Setting freqrange to '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 366 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 367 | BUILDSTDERR: | BUILDSTDERR: 368 | case 0x60: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 369 | current_width = payload + 1; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 370 | debug("Setting bank width to %d.\n", current_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 371 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 372 | BUILDSTDERR: | BUILDSTDERR: 373 | case 0x70: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 374 | current_height = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 375 | debug("Setting bank height to %d.\n", current_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 376 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 377 | BUILDSTDERR: | BUILDSTDERR: 378 | case 0x80: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 379 | current_offset = payload; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 380 | debug("Setting bank offset to %d.\n", current_offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 381 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 382 | BUILDSTDERR: | BUILDSTDERR: 383 | case 0x90: BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 384 | switch(payload) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 385 | { BUILDSTDERR: | ~ BUILDSTDERR: 386 | case 0: BUILDSTDERR: | ~~~~~~~ BUILDSTDERR: 387 | this->warmboot = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 388 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 389 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 390 | case 1: BUILDSTDERR: | ~~~~~~~ BUILDSTDERR: 391 | this->warmboot = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 392 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 393 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 394 | case 32: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 395 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 396 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 397 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 398 | case 33: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 399 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 400 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 401 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 402 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 403 | error("Unknown warmboot/nosleep payload 0x%02x\n", payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 404 | } BUILDSTDERR: | ~ BUILDSTDERR: 405 | info("Setting warmboot to '%s', nosleep to '%s'.\n", this->warmboot.c_str(), this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 406 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 407 | BUILDSTDERR: | BUILDSTDERR: 408 | default: BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 409 | error("Unknown command: 0x%02x 0x%02x\n", command, payload); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 410 | } BUILDSTDERR: | ~ BUILDSTDERR: 411 | } BUILDSTDERR: | ~ BUILDSTDERR: 412 | BUILDSTDERR: | BUILDSTDERR: 413 | if (this->cram_width == 182 && this->cram_height == 80) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 414 | this->device = "384"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 415 | else if (this->cram_width == 332 && this->cram_height == 144) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 416 | this->device = "1k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 417 | else if (this->cram_width == 872 && this->cram_height == 272) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 418 | this->device = "8k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 419 | else if (this->cram_width == 692 && this->cram_height == 336) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 420 | this->device = "5k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 421 | else if (this->cram_width == 692 && this->cram_height == 176) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 422 | this->device = "u4k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 423 | else if (this->cram_width == 656 && this->cram_height == 176) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 424 | this->device = "lm4k"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 425 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 426 | error("Failed to detect chip type.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 427 | BUILDSTDERR: | BUILDSTDERR: 428 | info("Chip type is '%s'.\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 429 | } BUILDSTDERR: | ~ BUILDSTDERR: 430 | BUILDSTDERR: | BUILDSTDERR: 431 | void FpgaConfig::write_bits(std::ostream &ofs) const BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 432 | { BUILDSTDERR: | ~ BUILDSTDERR: 433 | int file_offset = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 434 | uint16_t crc_value = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 435 | BUILDSTDERR: | BUILDSTDERR: 436 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 437 | info("Writing bitstream file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 438 | BUILDSTDERR: | BUILDSTDERR: 439 | for (auto byte : this->initblop) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 440 | ofs << byte; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 441 | BUILDSTDERR: | BUILDSTDERR: 442 | debug("Writing preamble.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 443 | write_byte(ofs, crc_value, file_offset, 0x7E); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 444 | write_byte(ofs, crc_value, file_offset, 0xAA); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 445 | write_byte(ofs, crc_value, file_offset, 0x99); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 446 | write_byte(ofs, crc_value, file_offset, 0x7E); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 447 | BUILDSTDERR: | BUILDSTDERR: 448 | debug("Setting freqrange to '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 449 | write_byte(ofs, crc_value, file_offset, 0x51); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 450 | if (this->freqrange == "low") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 451 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 452 | else if (this->freqrange == "medium") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 453 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 454 | else if (this->freqrange == "high") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 455 | write_byte(ofs, crc_value, file_offset, 0x02); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 456 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 457 | error("Unknown freqrange '%s'.\n", this->freqrange.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 458 | BUILDSTDERR: | BUILDSTDERR: 459 | debug("Resetting CRC.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 460 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 461 | write_byte(ofs, crc_value, file_offset, 0x05); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 462 | crc_value = 0xffff; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 463 | BUILDSTDERR: | BUILDSTDERR: 464 | { BUILDSTDERR: | ~ BUILDSTDERR: 465 | uint8_t nosleep_flag; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 466 | debug("Setting warmboot to '%s', nosleep to '%s'.\n", this->warmboot.c_str(), this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 467 | write_byte(ofs, crc_value, file_offset, 0x92); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 468 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 469 | BUILDSTDERR: | BUILDSTDERR: 470 | if (this->nosleep == "disabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 471 | nosleep_flag = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 472 | else if (this->nosleep == "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 473 | nosleep_flag = 1; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 474 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 475 | error("Unknown nosleep setting '%s'.\n", this->nosleep.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 476 | BUILDSTDERR: | BUILDSTDERR: 477 | if (this->warmboot == "disabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 478 | write_byte(ofs, crc_value, file_offset, 0x00 | nosleep_flag); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 479 | else if (this->warmboot == "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 480 | write_byte(ofs, crc_value, file_offset, 0x20 | nosleep_flag); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 481 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 482 | error("Unknown warmboot setting '%s'.\n", this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 483 | } BUILDSTDERR: | ~ BUILDSTDERR: 484 | BUILDSTDERR: | BUILDSTDERR: 485 | debug("CRAM: Setting bank width to %d.\n", this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 486 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 487 | write_byte(ofs, crc_value, file_offset, (this->cram_width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 488 | write_byte(ofs, crc_value, file_offset, (this->cram_width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 489 | if(this->device != "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 490 | debug("CRAM: Setting bank height to %d.\n", this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 491 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 492 | write_byte(ofs, crc_value, file_offset, this->cram_height >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 493 | write_byte(ofs, crc_value, file_offset, this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 494 | } BUILDSTDERR: | ~ BUILDSTDERR: 495 | BUILDSTDERR: | BUILDSTDERR: 496 | debug("CRAM: Setting bank offset to 0.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 497 | write_byte(ofs, crc_value, file_offset, 0x82); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 498 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 499 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 500 | BUILDSTDERR: | BUILDSTDERR: 501 | for (int cram_bank = 0; cram_bank < 4; cram_bank++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 502 | { BUILDSTDERR: | ~ BUILDSTDERR: 503 | vector cram_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 504 | int height = this->cram_height; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 505 | if(this->device == "5k" && ((cram_bank % 2) == 1)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 506 | height = height / 2 + 8; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 507 | for (int cram_y = 0; cram_y < height; cram_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 508 | for (int cram_x = 0; cram_x < this->cram_width; cram_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 509 | cram_bits.push_back(this->cram[cram_bank][cram_x][cram_y]); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 510 | BUILDSTDERR: | BUILDSTDERR: 511 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 512 | debug("CRAM: Setting bank height to %d.\n", height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 513 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 514 | write_byte(ofs, crc_value, file_offset, height >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 515 | write_byte(ofs, crc_value, file_offset, height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 516 | } BUILDSTDERR: | ~ BUILDSTDERR: 517 | BUILDSTDERR: | BUILDSTDERR: 518 | debug("CRAM: Setting bank %d.\n", cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 519 | write_byte(ofs, crc_value, file_offset, 0x11); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 520 | write_byte(ofs, crc_value, file_offset, cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 521 | BUILDSTDERR: | BUILDSTDERR: 522 | debug("CRAM: Writing bank %d data.\n", cram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 523 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 524 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 525 | for (int i = 0; i < int(cram_bits.size()); i += 8) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 526 | uint8_t byte = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 527 | for (int j = 0; j < 8; j++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 528 | byte = (byte << 1) | (cram_bits[i+j] ? 1 : 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 529 | write_byte(ofs, crc_value, file_offset, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 530 | } BUILDSTDERR: | ~ BUILDSTDERR: 531 | BUILDSTDERR: | BUILDSTDERR: 532 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 533 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 534 | } BUILDSTDERR: | ~ BUILDSTDERR: 535 | BUILDSTDERR: | BUILDSTDERR: 536 | int bram_chunk_size = 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 537 | BUILDSTDERR: | BUILDSTDERR: 538 | if (this->bram_width && this->bram_height) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 539 | { BUILDSTDERR: | ~ BUILDSTDERR: 540 | if(this->device != "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 541 | debug("BRAM: Setting bank width to %d.\n", this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 542 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 543 | write_byte(ofs, crc_value, file_offset, (this->bram_width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 544 | write_byte(ofs, crc_value, file_offset, (this->bram_width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 545 | } BUILDSTDERR: | ~ BUILDSTDERR: 546 | BUILDSTDERR: | BUILDSTDERR: 547 | BUILDSTDERR: | BUILDSTDERR: 548 | debug("BRAM: Setting bank height to %d.\n", this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 549 | write_byte(ofs, crc_value, file_offset, 0x72); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 550 | write_byte(ofs, crc_value, file_offset, bram_chunk_size >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 551 | write_byte(ofs, crc_value, file_offset, bram_chunk_size); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 552 | BUILDSTDERR: | BUILDSTDERR: 553 | for (int bram_bank = 0; bram_bank < 4; bram_bank++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 554 | { BUILDSTDERR: | ~ BUILDSTDERR: 555 | debug("BRAM: Setting bank %d.\n", bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 556 | write_byte(ofs, crc_value, file_offset, 0x11); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 557 | write_byte(ofs, crc_value, file_offset, bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 558 | BUILDSTDERR: | BUILDSTDERR: 559 | for (int offset = 0; offset < this->bram_height; offset += bram_chunk_size) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 560 | { BUILDSTDERR: | ~ BUILDSTDERR: 561 | vector bram_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 562 | int width = this->bram_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 563 | if(this->device == "5k" && ((bram_bank % 2) == 1)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 564 | width = width / 2; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 565 | for (int bram_y = 0; bram_y < bram_chunk_size; bram_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 566 | for (int bram_x = 0; bram_x < width; bram_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 567 | bram_bits.push_back(this->bram[bram_bank][bram_x][bram_y+offset]); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 568 | BUILDSTDERR: | BUILDSTDERR: 569 | debug("BRAM: Setting bank offset to %d.\n", offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 570 | write_byte(ofs, crc_value, file_offset, 0x82); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 571 | write_byte(ofs, crc_value, file_offset, offset >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 572 | write_byte(ofs, crc_value, file_offset, offset); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 573 | BUILDSTDERR: | BUILDSTDERR: 574 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 575 | debug("BRAM: Setting bank width to %d.\n", width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 576 | write_byte(ofs, crc_value, file_offset, 0x62); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 577 | write_byte(ofs, crc_value, file_offset, (width-1) >> 8); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 578 | write_byte(ofs, crc_value, file_offset, (width-1)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 579 | } BUILDSTDERR: | ~ BUILDSTDERR: 580 | BUILDSTDERR: | BUILDSTDERR: 581 | BUILDSTDERR: | BUILDSTDERR: 582 | debug("BRAM: Writing bank %d data.\n", bram_bank); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 583 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 584 | write_byte(ofs, crc_value, file_offset, 0x03); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 585 | for (int i = 0; i < int(bram_bits.size()); i += 8) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 586 | uint8_t byte = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~ BUILDSTDERR: 587 | for (int j = 0; j < 8; j++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 588 | byte = (byte << 1) | (bram_bits[i+j] ? 1 : 0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 589 | write_byte(ofs, crc_value, file_offset, byte); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 590 | } BUILDSTDERR: | ~ BUILDSTDERR: 591 | BUILDSTDERR: | BUILDSTDERR: 592 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 593 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 594 | } BUILDSTDERR: | ~ BUILDSTDERR: 595 | } BUILDSTDERR: | ~ BUILDSTDERR: 596 | } BUILDSTDERR: | ~ BUILDSTDERR: 597 | BUILDSTDERR: | BUILDSTDERR: 598 | debug("Writing CRC value.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 599 | write_byte(ofs, crc_value, file_offset, 0x22); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 600 | uint8_t crc_hi = crc_value >> 8, crc_lo = crc_value; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 601 | write_byte(ofs, crc_value, file_offset, crc_hi); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 602 | write_byte(ofs, crc_value, file_offset, crc_lo); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 603 | BUILDSTDERR: | BUILDSTDERR: 604 | debug("Wakeup.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 605 | write_byte(ofs, crc_value, file_offset, 0x01); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 606 | write_byte(ofs, crc_value, file_offset, 0x06); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 607 | BUILDSTDERR: | BUILDSTDERR: 608 | debug("Padding byte.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 609 | write_byte(ofs, crc_value, file_offset, 0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 610 | } BUILDSTDERR: | ~ BUILDSTDERR: 611 | BUILDSTDERR: | BUILDSTDERR: 612 | void FpgaConfig::read_ascii(std::istream &ifs, bool nosleep) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 613 | { BUILDSTDERR: | ~ BUILDSTDERR: 614 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 615 | info("Parsing ascii file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 616 | BUILDSTDERR: | BUILDSTDERR: 617 | bool got_device = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 618 | this->cram.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 619 | this->bram.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 620 | this->freqrange = "low"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 621 | this->warmboot = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 622 | BUILDSTDERR: | BUILDSTDERR: 623 | bool reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 624 | string line, command; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 625 | BUILDSTDERR: | BUILDSTDERR: 626 | while (reuse_line || getline(ifs, line)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 627 | { BUILDSTDERR: | ~ BUILDSTDERR: 628 | reuse_line = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 629 | BUILDSTDERR: | BUILDSTDERR: 630 | std::istringstream is(line); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 631 | is >> command; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 632 | BUILDSTDERR: | BUILDSTDERR: 633 | if (command.empty()) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 634 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 635 | BUILDSTDERR: | BUILDSTDERR: 636 | debug("Next command: %s\n", line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 637 | BUILDSTDERR: | BUILDSTDERR: 638 | if (command == ".comment") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 639 | { BUILDSTDERR: | ~ BUILDSTDERR: 640 | this->initblop.clear(); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 641 | this->initblop.push_back(0xff); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 642 | this->initblop.push_back(0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 643 | BUILDSTDERR: | BUILDSTDERR: 644 | while (getline(ifs, line)) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 645 | { BUILDSTDERR: | ~ BUILDSTDERR: 646 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 647 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 648 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 649 | } BUILDSTDERR: | ~ BUILDSTDERR: 650 | BUILDSTDERR: | BUILDSTDERR: 651 | for (auto ch : line) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 652 | this->initblop.push_back(ch); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 653 | this->initblop.push_back(0); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 654 | } BUILDSTDERR: | ~ BUILDSTDERR: 655 | BUILDSTDERR: | BUILDSTDERR: 656 | this->initblop.push_back(0x00); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 657 | this->initblop.push_back(0xff); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 658 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 659 | } BUILDSTDERR: | ~ BUILDSTDERR: 660 | BUILDSTDERR: | BUILDSTDERR: 661 | if (command == ".device") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 662 | { BUILDSTDERR: | ~ BUILDSTDERR: 663 | if (got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 664 | error("More than one .device statement.\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 665 | BUILDSTDERR: | BUILDSTDERR: 666 | is >> this->device; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 667 | BUILDSTDERR: | BUILDSTDERR: 668 | if (this->device == "384") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 669 | this->cram_width = 182; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 670 | this->cram_height = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 671 | this->bram_width = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 672 | this->bram_height = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 673 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 674 | if (this->device == "1k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 675 | this->cram_width = 332; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 676 | this->cram_height = 144; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 677 | this->bram_width = 64; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 678 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 679 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 680 | if (this->device == "8k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 681 | this->cram_width = 872; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 682 | this->cram_height = 272; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 683 | this->bram_width = 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 684 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 685 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 686 | if (this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 687 | this->cram_width = 692; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 688 | this->cram_height = 336; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 689 | this->bram_width = 160; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 690 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 691 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 692 | if (this->device == "u4k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 693 | this->cram_width = 692; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 694 | this->cram_height = 176; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 695 | this->bram_width = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 696 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 697 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 698 | if (this->device == "lm4k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 699 | this->cram_width = 656; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 700 | this->cram_height = 176; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 701 | this->bram_width = 80; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 702 | this->bram_height = 2 * 128; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 703 | } else BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 704 | error("Unsupported chip type '%s'.\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 705 | BUILDSTDERR: | BUILDSTDERR: 706 | this->cram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 707 | if(this->device == "5k") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 708 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 709 | this->cram[i].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 710 | for (int x = 0; x < this->cram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 711 | this->cram[i][x].resize(((i % 2) == 1) ? (this->cram_height / 2 + 8) : this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 712 | } BUILDSTDERR: | ~ BUILDSTDERR: 713 | BUILDSTDERR: | BUILDSTDERR: 714 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 715 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 716 | int width = ((i % 2) == 1) ? (this->bram_width / 2) : this->bram_width; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 717 | this->bram[i].resize(width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 718 | for (int x = 0; x < width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 719 | this->bram[i][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 720 | } BUILDSTDERR: | ~ BUILDSTDERR: 721 | } else { BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 722 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 723 | this->cram[i].resize(this->cram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 724 | for (int x = 0; x < this->cram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 725 | this->cram[i][x].resize(this->cram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 726 | } BUILDSTDERR: | ~ BUILDSTDERR: 727 | BUILDSTDERR: | BUILDSTDERR: 728 | this->bram.resize(4); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 729 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 730 | this->bram[i].resize(this->bram_width); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 731 | for (int x = 0; x < this->bram_width; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 732 | this->bram[i][x].resize(this->bram_height); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 733 | } BUILDSTDERR: | ~ BUILDSTDERR: 734 | } BUILDSTDERR: | ~ BUILDSTDERR: 735 | BUILDSTDERR: | BUILDSTDERR: 736 | BUILDSTDERR: | BUILDSTDERR: 737 | got_device = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 738 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 739 | } BUILDSTDERR: | ~ BUILDSTDERR: 740 | BUILDSTDERR: | BUILDSTDERR: 741 | if (command == ".warmboot") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 742 | { BUILDSTDERR: | ~ BUILDSTDERR: 743 | is >> this->warmboot; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 744 | BUILDSTDERR: | BUILDSTDERR: 745 | if (this->warmboot != "disabled" && BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 746 | this->warmboot != "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 747 | error("Unknown warmboot setting '%s'.\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 748 | this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 749 | BUILDSTDERR: | BUILDSTDERR: 750 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 751 | } BUILDSTDERR: | ~ BUILDSTDERR: 752 | BUILDSTDERR: | BUILDSTDERR: 753 | // No ".nosleep" section despite sharing the same byte as .warmboot. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 754 | // ".nosleep" is specified when icepack is invoked, which is too late. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 755 | // So we inject the section based on command line argument. BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 756 | if (nosleep) BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 757 | this->nosleep = "enabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 758 | else BUILDSTDERR: | ~~~~ BUILDSTDERR: 759 | this->nosleep = "disabled"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 760 | BUILDSTDERR: | BUILDSTDERR: 761 | if (command == ".io_tile" || command == ".logic_tile" || command == ".ramb_tile" || command == ".ramt_tile" || command.substr(0, 4) == ".dsp" || command == ".ipcon_tile") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 762 | { BUILDSTDERR: | ~ BUILDSTDERR: 763 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 764 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 765 | BUILDSTDERR: | BUILDSTDERR: 766 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 767 | is >> tile_x >> tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 768 | BUILDSTDERR: | BUILDSTDERR: 769 | CramIndexConverter cic(this, tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 770 | BUILDSTDERR: | BUILDSTDERR: 771 | if (("." + cic.tile_type + "_tile") != command) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 772 | error("Got %s statement for %s tile %d %d.\n", BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 773 | command.c_str(), cic.tile_type.c_str(), tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 774 | BUILDSTDERR: | BUILDSTDERR: 775 | for (int bit_y = 0; bit_y < 16 && getline(ifs, line); bit_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 776 | { BUILDSTDERR: | ~ BUILDSTDERR: 777 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 778 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 779 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 780 | } BUILDSTDERR: | ~ BUILDSTDERR: 781 | BUILDSTDERR: | BUILDSTDERR: 782 | for (int bit_x = 0; bit_x < int(line.size()) && bit_x < cic.tile_width; bit_x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 783 | if (line[bit_x] == '1') { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 784 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 785 | cic.get_cram_index(bit_x, bit_y, cram_bank, cram_x, cram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 786 | this->cram[cram_bank][cram_x][cram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 787 | } BUILDSTDERR: | ~ BUILDSTDERR: 788 | } BUILDSTDERR: | ~ BUILDSTDERR: 789 | BUILDSTDERR: | BUILDSTDERR: 790 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 791 | } BUILDSTDERR: | ~ BUILDSTDERR: 792 | BUILDSTDERR: | BUILDSTDERR: 793 | if (command == ".ram_data") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 794 | { BUILDSTDERR: | ~ BUILDSTDERR: 795 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 796 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 797 | BUILDSTDERR: | BUILDSTDERR: 798 | int tile_x, tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 799 | is >> tile_x >> tile_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 800 | BUILDSTDERR: | BUILDSTDERR: 801 | BramIndexConverter bic(this, tile_x, tile_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 802 | BUILDSTDERR: | BUILDSTDERR: 803 | for (int bit_y = 0; bit_y < 16 && getline(ifs, line); bit_y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 804 | { BUILDSTDERR: | ~ BUILDSTDERR: 805 | if (line.substr(0, 1) == ".") { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 806 | reuse_line = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 807 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 808 | } BUILDSTDERR: | ~ BUILDSTDERR: 809 | BUILDSTDERR: | BUILDSTDERR: 810 | for (int bit_x = 256-4, ch_idx = 0; ch_idx < int(line.size()) && bit_x >= 0; bit_x -= 4, ch_idx++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 811 | { BUILDSTDERR: | ~ BUILDSTDERR: 812 | int value = -1; BUILDSTDERR: | ~~~~~~~~~~~~~~~ BUILDSTDERR: 813 | if ('0' <= line[ch_idx] && line[ch_idx] <= '9') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 814 | value = line[ch_idx] - '0'; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 815 | if ('a' <= line[ch_idx] && line[ch_idx] <= 'f') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 816 | value = line[ch_idx] - 'a' + 10; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 817 | if ('A' <= line[ch_idx] && line[ch_idx] <= 'F') BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 818 | value = line[ch_idx] - 'A' + 10; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 819 | if (value < 0) BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 820 | error("Not a hex character: '%c' (in line '%s')\n", line[ch_idx], line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 821 | BUILDSTDERR: | BUILDSTDERR: 822 | for (int i = 0; i < 4; i++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 823 | if ((value & (1 << i)) != 0) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 824 | int bram_bank, bram_x, bram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 825 | bic.get_bram_index(bit_x+i, bit_y, bram_bank, bram_x, bram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 826 | this->bram[bram_bank][bram_x][bram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 827 | } BUILDSTDERR: | ~ BUILDSTDERR: 828 | } BUILDSTDERR: | ~ BUILDSTDERR: 829 | } BUILDSTDERR: | ~ BUILDSTDERR: 830 | BUILDSTDERR: | BUILDSTDERR: 831 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 832 | } BUILDSTDERR: | ~ BUILDSTDERR: 833 | BUILDSTDERR: | BUILDSTDERR: 834 | if (command == ".extra_bit") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 835 | { BUILDSTDERR: | ~ BUILDSTDERR: 836 | if (!got_device) BUILDSTDERR: | ~~~~~~~~~~~~~~~~ BUILDSTDERR: 837 | error("Missing .device statement before %s.\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 838 | BUILDSTDERR: | BUILDSTDERR: 839 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 840 | is >> cram_bank >> cram_x >> cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 841 | this->cram[cram_bank][cram_x][cram_y] = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 842 | BUILDSTDERR: | BUILDSTDERR: 843 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 844 | } BUILDSTDERR: | ~ BUILDSTDERR: 845 | BUILDSTDERR: | BUILDSTDERR: 846 | if (command == ".sym") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 847 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 848 | BUILDSTDERR: | BUILDSTDERR: 849 | if (command.substr(0, 1) == ".") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 850 | error("Unknown statement: %s\n", command.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 851 | error("Unexpected data line: %s\n", line.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 852 | } BUILDSTDERR: | ~ BUILDSTDERR: 853 | } BUILDSTDERR: | ~ BUILDSTDERR: 854 | BUILDSTDERR: | BUILDSTDERR: 855 | void FpgaConfig::write_ascii(std::ostream &ofs) const BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 856 | { BUILDSTDERR: | ~ BUILDSTDERR: 857 | debug("## %s\n", __PRETTY_FUNCTION__); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 858 | info("Writing ascii file..\n"); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 859 | BUILDSTDERR: | BUILDSTDERR: 860 | ofs << ".comment"; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 861 | bool insert_newline = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 862 | for (auto ch : this->initblop) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 863 | if (ch == 0) { BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 864 | insert_newline = true; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 865 | } else if (ch == 0xff) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 866 | insert_newline = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 867 | } else { BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 868 | if (insert_newline) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 869 | ofs << '\n'; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 870 | ofs << ch; BUILDSTDERR: | ~~~~~~~~~~ BUILDSTDERR: 871 | insert_newline = false; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 872 | } BUILDSTDERR: | ~ BUILDSTDERR: 873 | } BUILDSTDERR: | ~ BUILDSTDERR: 874 | BUILDSTDERR: | BUILDSTDERR: 875 | ofs << stringf("\n.device %s\n", this->device.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 876 | if (this->warmboot != "enabled") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 877 | ofs << stringf(".warmboot %s\n", this->warmboot.c_str()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 878 | BUILDSTDERR: | BUILDSTDERR: 879 | // As "nosleep" is an icepack command, we do not write out a ".nosleep" BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 880 | // section. However, we parse it in read_bits() and notify the user in BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 881 | // info. BUILDSTDERR: | ~~~~~~~~ BUILDSTDERR: 882 | BUILDSTDERR: | BUILDSTDERR: 883 | typedef std::tuple tile_bit_t; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 884 | std::set tile_bits; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 885 | BUILDSTDERR: | BUILDSTDERR: 886 | for (int y = 0; y <= this->chip_height()+1; y++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 887 | for (int x = 0; x <= this->chip_width()+1; x++) BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 888 | { BUILDSTDERR: | ~ BUILDSTDERR: 889 | CramIndexConverter cic(this, x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 890 | BUILDSTDERR: | BUILDSTDERR: 891 | if (cic.tile_type == "corner" || cic.tile_type == "unsupported") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 892 | continue; BUILDSTDERR: | ~~~~~~~~~ BUILDSTDERR: 893 | BUILDSTDERR: | BUILDSTDERR: 894 | ofs << stringf(".%s_tile %d %d\n", cic.tile_type.c_str(), x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 895 | BUILDSTDERR: | BUILDSTDERR: 896 | for (int bit_y = 0; bit_y < 16; bit_y++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 897 | for (int bit_x = 0; bit_x < cic.tile_width; bit_x++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 898 | int cram_bank, cram_x, cram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 899 | cic.get_cram_index(bit_x, bit_y, cram_bank, cram_x, cram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 900 | tile_bits.insert(tile_bit_t(cram_bank, cram_x, cram_y)); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 901 | if (cram_x > int(this->cram[cram_bank].size())) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 902 | error("cram_x %d (bit %d, %d) larger than bank size %lu\n", cram_x, bit_x, bit_y, this->cram[cram_bank].size()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 903 | } BUILDSTDERR: | ~ BUILDSTDERR: 904 | if (cram_y > int(this->cram[cram_bank][cram_x].size())) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 905 | error("cram_y %d (bit %d, %d) larger than bank %d size %lu\n", cram_y, bit_x, bit_y, cram_bank, this->cram[cram_bank][cram_x].size()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 906 | } BUILDSTDERR: | ~ BUILDSTDERR: 907 | ofs << (this->cram[cram_bank][cram_x][cram_y] ? '1' : '0'); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 908 | } BUILDSTDERR: | ~ BUILDSTDERR: 909 | ofs << '\n'; BUILDSTDERR: | ~~~~~~~~~~~~ BUILDSTDERR: 910 | } BUILDSTDERR: | ~ BUILDSTDERR: 911 | BUILDSTDERR: | BUILDSTDERR: 912 | if (cic.tile_type == "ramb") BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 913 | { BUILDSTDERR: | ~ BUILDSTDERR: 914 | BramIndexConverter bic(this, x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 915 | ofs << stringf(".ram_data %d %d\n", x, y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 916 | BUILDSTDERR: | BUILDSTDERR: 917 | for (int bit_y = 0; bit_y < 16; bit_y++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 918 | for (int bit_x = 256-4; bit_x >= 0; bit_x -= 4) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 919 | int value = 0; BUILDSTDERR: | ~~~~~~~~~~~~~~ BUILDSTDERR: 920 | for (int i = 0; i < 4; i++) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 921 | int bram_bank, bram_x, bram_y; BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 922 | bic.get_bram_index(bit_x+i, bit_y, bram_bank, bram_x, bram_y); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 923 | if (bram_x >= int(this->bram[bram_bank].size())) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 924 | error("%d %d bram_x %d higher than loaded bram size %lu\n",bit_x+i, bit_y, bram_x, this->bram[bram_bank].size()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 925 | break; BUILDSTDERR: | ~~~~~~ BUILDSTDERR: 926 | } BUILDSTDERR: | ~ BUILDSTDERR: 927 | if (bram_y >= int(this->bram[bram_bank][bram_x].size())) { BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: 928 | error("bram_y %d higher than loaded bram size %lu\n", bram_y, this->bram[bram_bank][bram_x].size()); BUILDSTDERR: | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: | | BUILDSTDERR: | std::vector::size_type {aka unsigned int} BUILDSTDERR: icepack.cc:928:8: note: in expansion of macro 'error' BUILDSTDERR: 928 | error("bram_y %d higher than loaded bram size %lu\n", bram_y, this->bram[bram_bank][bram_x].size()); BUILDSTDERR: | ^~~~~ BUILDSTDERR: icepack.cc:928:56: note: format string is defined here BUILDSTDERR: 928 | error("bram_y %d higher than loaded bram size %lu\n", bram_y, this->bram[bram_bank][bram_x].size()); BUILDSTDERR: | ~~^ BUILDSTDERR: | | BUILDSTDERR: | long unsigned int BUILDSTDERR: | %u g++ -o icepack -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld icepack.o -lm -lstdc++ ln -sf icepack iceunpack make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icepack' make -C iceprog all make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/iceprog' cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/libftdi1 -c -o iceprog.o iceprog.c cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/libftdi1 -c -o mpsse.o mpsse.c cc -o iceprog -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld iceprog.o mpsse.o -L/usr/local/lib -lm -lftdi1 -lusb-1.0 make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/iceprog' make -C icemulti all make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icemulti' g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/libftdi1 -c -o icemulti.o icemulti.cc g++ -o icemulti -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld icemulti.o -lm -lstdc++ make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icemulti' make -C icepll all make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icepll' g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/libftdi1 -c -o icepll.o icepll.cc g++ -o icepll -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld icepll.o -lm -lstdc++ make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icepll' python3 icebox_chipdb.py > chipdb-1k.new mv chipdb-384.new chipdb-384.txt python3 icebox_chipdb.py -8 > chipdb-8k.new mv chipdb-1k.new chipdb-1k.txt python3 icebox_chipdb.py -5 > chipdb-5k.new mv chipdb-5k.new chipdb-5k.txt python3 icebox_chipdb.py -4 > chipdb-lm4k.new mv chipdb-8k.new chipdb-8k.txt python3 icebox_chipdb.py -u > chipdb-u4k.new mv chipdb-lm4k.new chipdb-lm4k.txt make -C icetime all make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icetime' python3 timings.py > timings.inc.new mv timings.inc.new timings.inc g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/libftdi1 -DPREFIX='"/usr"' -DCHIPDB_SUBDIR='"icestorm"' -c -o iceutil.o iceutil.cc g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/libftdi1 -DPREFIX='"/usr"' -DCHIPDB_SUBDIR='"icestorm"' -c -o icetime.o icetime.cc mv chipdb-u4k.new chipdb-u4k.txt make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icebox' make -C icebram all make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icebram' g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/libftdi1 -c -o icebram.o icebram.cc g++ -o icebram -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld icebram.o -lm -lstdc++ make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icebram' g++ -o icetime -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld icetime.o iceutil.o -lm -lstdc++ make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icetime' + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.70baLL + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386 '!=' / ']' + rm -rf /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386 BUILDSTDERR: ++ dirname /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386 + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386 + cd icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1 + /usr/bin/make install DESTDIR=/builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386 'INSTALL=/usr/bin/install -p' PREFIX=/usr for dir in icebox icepack iceprog icemulti icepll icetime icebram; do \ /usr/bin/make -C $dir install || exit; \ done make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icebox' mkdir -p /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icebox mkdir -p /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin cp chipdb-384.txt /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icebox/ cp chipdb-1k.txt /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icebox/ cp chipdb-8k.txt /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icebox/ cp chipdb-5k.txt /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icebox/ cp chipdb-u4k.txt /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icebox/ cp chipdb-lm4k.txt /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icebox/ cp icebox.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox.py cp iceboxdb.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/iceboxdb.py cp icebox_chipdb.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox_chipdb cp icebox_diff.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox_diff cp icebox_explain.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox_explain cp icebox_asc2hlc.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox_asc2hlc cp icebox_hlc2asc.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox_hlc2asc cp icebox_colbuf.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox_colbuf cp icebox_html.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox_html cp icebox_maps.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox_maps cp icebox_vlog.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox_vlog cp icebox_stat.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox_stat make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icebox' make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icepack' mkdir -p /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin cp icepack /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icepack ln -sf icepack /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/iceunpack make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icepack' make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/iceprog' mkdir -p /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin cp iceprog /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/iceprog make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/iceprog' make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icemulti' mkdir -p /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin cp icemulti /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icemulti make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icemulti' make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icepll' mkdir -p /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin cp icepll /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icepll make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icepll' make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icetime' mkdir -p /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin mkdir -p /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icebox cp icetime /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icetime cp ../icefuzz/timings_*.txt /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icebox/ make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icetime' make[1]: Entering directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icebram' mkdir -p /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin cp icebram /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebram make[1]: Leaving directory '/builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1/icebram' + chmod +x /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebox.py + mv /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icebox /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icestorm + mv /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/iceboxdb.py /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icestorm + install -pm644 icefuzz/timings_hx1k.txt icefuzz/timings_hx8k.txt icefuzz/timings_lp1k.txt icefuzz/timings_lp384.txt icefuzz/timings_lp8k.txt icefuzz/timings_u4k.txt icefuzz/timings_up5k.txt /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/icestorm + /usr/lib/rpm/find-debuginfo.sh -j2 --strict-build-id -m -i --build-id-seed 0-0.7.20190311gitfa1c932.fc31 --unique-debug-suffix -0-0.7.20190311gitfa1c932.fc31.i386 --unique-debug-src-base icestorm-0-0.7.20190311gitfa1c932.fc31.i386 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 50000000 -S debugsourcefiles.list /builddir/build/BUILD/icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1 explicitly decompress any DWARF compressed ELF sections in /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebram explicitly decompress any DWARF compressed ELF sections in /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icetime extracting debug info from /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icebram extracting debug info from /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icetime explicitly decompress any DWARF compressed ELF sections in /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icepll extracting debug info from /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icepll explicitly decompress any DWARF compressed ELF sections in /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icemulti extracting debug info from /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icemulti explicitly decompress any DWARF compressed ELF sections in /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/iceprog extracting debug info from /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/iceprog explicitly decompress any DWARF compressed ELF sections in /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icepack extracting debug info from /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/bin/icepack /usr/lib/rpm/sepdebugcrcfix: Updated 6 CRC32s, 0 CRC32s did match. BUILDSTDERR: 1802 blocks + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python3 1 0 + /usr/lib/rpm/brp-python-hardlink + /usr/lib/rpm/redhat/brp-mangle-shebangs Processing files: icestorm-0-0.7.20190311gitfa1c932.fc31.i686 Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.JYxj5s + umask 022 + cd /builddir/build/BUILD + cd icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1 + DOCDIR=/builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/doc/icestorm + export LC_ALL=C + LC_ALL=C + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/doc/icestorm + cp -pr examples /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/doc/icestorm + exit 0 Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.TUM5ra + umask 022 + cd /builddir/build/BUILD + cd icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1 + LICENSEDIR=/builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/licenses/icestorm + export LC_ALL=C + LC_ALL=C + export LICENSEDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/licenses/icestorm + cp -pr README /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386/usr/share/licenses/icestorm + exit 0 Provides: icestorm = 0-0.7.20190311gitfa1c932.fc31 icestorm(x86-32) = 0-0.7.20190311gitfa1c932.fc31 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: /usr/bin/python3 libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.1.3) libc.so.6(GLIBC_2.3.4) libc.so.6(GLIBC_2.4) libc.so.6(GLIBC_2.7) libc.so.6(GLIBC_2.8) libftdi1.so.2 libgcc_s.so.1 libgcc_s.so.1(GCC_3.0) libm.so.6 libm.so.6(GLIBC_2.29) libstdc++.so.6 libstdc++.so.6(CXXABI_1.3) libstdc++.so.6(CXXABI_1.3.9) libstdc++.so.6(GLIBCXX_3.4) libstdc++.so.6(GLIBCXX_3.4.11) libstdc++.so.6(GLIBCXX_3.4.14) libstdc++.so.6(GLIBCXX_3.4.20) libstdc++.so.6(GLIBCXX_3.4.21) libstdc++.so.6(GLIBCXX_3.4.9) rtld(GNU_HASH) Processing files: icestorm-debugsource-0-0.7.20190311gitfa1c932.fc31.i686 Provides: icestorm-debugsource = 0-0.7.20190311gitfa1c932.fc31 icestorm-debugsource(x86-32) = 0-0.7.20190311gitfa1c932.fc31 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Processing files: icestorm-debuginfo-0-0.7.20190311gitfa1c932.fc31.i686 Provides: debuginfo(build-id) = 06f9037ab1c651d04d457a2232eb417c7ba6b01a debuginfo(build-id) = 137eac5a79bff429178fa8bd1baa822f62e5303b debuginfo(build-id) = 52b128f5804d8650c234e03d209b18b82fecf2aa debuginfo(build-id) = bf8d7783f56da9ed0f66b02bc855c4abdfad1198 debuginfo(build-id) = d894bf3440f2bfce9c5839f499d3b3eed3f61b71 debuginfo(build-id) = de483b3d7e23bf8dac443e8d66568ae3ad5f89ec icestorm-debuginfo = 0-0.7.20190311gitfa1c932.fc31 icestorm-debuginfo(x86-32) = 0-0.7.20190311gitfa1c932.fc31 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Recommends: icestorm-debugsource(x86-32) = 0-0.7.20190311gitfa1c932.fc31 Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386 Wrote: /builddir/build/RPMS/icestorm-0-0.7.20190311gitfa1c932.fc31.i686.rpm Wrote: /builddir/build/RPMS/icestorm-debugsource-0-0.7.20190311gitfa1c932.fc31.i686.rpm Wrote: /builddir/build/RPMS/icestorm-debuginfo-0-0.7.20190311gitfa1c932.fc31.i686.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.R3gjAK + umask 022 + cd /builddir/build/BUILD + cd icestorm-fa1c932452e8efe1dfcc6ff095e3f7130a7906b1 + /usr/bin/rm -rf /builddir/build/BUILDROOT/icestorm-0-0.7.20190311gitfa1c932.fc31.i386 + exit 0 Child return code was: 0