add writeFpgaHeader() and compressFpga