Page 1 of 1

Help with decompresion of FPGA bitstream

Posted: Sun Nov 10, 2019 8:55 pm
by goran.mahovlic
Hi to all,

we have FPGA board that have ESP32 on the board.
https://radiona.org/ulx3s/

EMARD - author of the board just used micropython for bitstream loading to FPGA and it is working great!
Next thing we would need is to decompress gzip or zip or anything that we can pack on linux machine
https://github.com/emard/esp32ecp5
I did try to use uzlib but did not get thing running.
Maybe someone here have some clues?

Re: Help with decompresion of FPGA bitstream

Posted: Sun Nov 10, 2019 10:24 pm
by dhylands
uzlib only deals with compressing/uncompressing the data portion of a file contained within a zipfile. It doesn't know how to actually parse a zip file.

I wrote some C code to add a uzipfile module as part of a larger commit which never got merged. You can see the code here:
https://github.com/dhylands/micropython ... f256f83f8d

You'll probably need to expand the uzipfile.c as github considers it to be a "large diff".

Parsing the zipfile file format is fairly straight forward, and you should be able to do it in Python using struct.