Byte-swapping can also be a requirement of this process and can also be managed by the tools. Byte-swapping is the translation of bits in the file from D[7-0] to a D[0-7] format.
This article will further detail how PROMGen can be used to preform these translations.
For more PROM File Articles and other Configuration Related Articles, see (Xilinx Answer 34104).
The following are typical use models and examples of how to use the tools.
1 - Transform a .mcs file into a .hex file. Here the -r flag is used as a "recursive' input flag into the promgen tool.
ex. promgen -p hex -r input.mcs -o output.hex
2 - Byte-swap an existing .mcs file. This is a two tier process which will first create a byte-swapped .hex file and then translate this to a .mcs file.
ex. promgen -p hex -b -r input.mcs -o temp.hex
promgen -p mcs -r temp.hex -o swapped.mcs
3 - Add other files into a prom file, this can be done with the -data_file flag.
This flag will translate .bin files into .hex data when translating to a .mcs file and here is an example of creating a .mcs file with a .bit and a binary user data file from a specific address.
ex. promgen -p mcs -u 0 input.bit -data_file u 80000 user_data.bin -o outfile.mcs
This flag will also translate .hex files into ASCII data in an .mcs file, so when adding a hex file that is intended to be a hex file first translate the file to a .bin file format using:
ex. promgen -p bin -r input.hex -o outfile.bin