catbstream.py
=============

This is a simple program that allows for concatenating two FPGA bitstreams
into one contiguous bitstream. It is intended for applications where two
bitstreams are stored on a Flash chip for applications such as MultiBoot.

The script asks the user for the bitstream file names (two input and one
output) and stores the concatenated version of the two bitstreams to the
output file. The second second bitstream starts on a sector boundary. If the
first bitstream is smaller than the second, the script pads with zeroes until
the sector boundary.

The output bitstream of two concatenated bitstreams would look like this:

0x000000     ================================
                      bitstream 1
                      bitstream 1
                      bitstream 1
[end bs1]    ...................0000000000000
             00000000000000000000000000000000
[next sect]  ================================
                      bitstream 2
             ================================

At the time of writing of this readme, the file is designed for M25P flash
chips, which have 64kB sectors. To change the sector boundaries, all one needs
to do is change line 17 in the file for the sector boundary on his or her
flash of choice:

  # 0x10000 is the sector boundary in the M25P flash
  lt = 0x10000 - (len(a1)%0x10000)

