We present an in-depth analysis of the Xilinx bitstream format. The information gathered in this paper allows bitstream compilation and decompilation. While not actually compromising current bitstream security, the easiness of the decompilation process should raise awareness about bitstream security issues. Available documentation from Xilinx and some custom assumptions about the bitstream format are presented and analyzed, so as to first gather a database mapping bitstream data to its related netlist elements, thanks to a suitable algorithm applied to a well-chosen bitstream. This database is then used as input to an efficient program which can compile a bitstream from a low-level textual description or conversely decompile a bitstream to the same textual description for any subsequent input. The whole process of database gathering and the decompilation of the bitstream format for a particular chip runs at about the speed of bitgen compilation. The sole process of compiling/decompili...