add write header and compress fpga