2 #------------------------------------------------------------------------------
3 # $File: xilinx,v 1.8 2017/03/17 21:35:28 christos Exp $
4 # This is Aaron's attempt at a MAGIC file for Xilinx .bit files.
5 # Xilinx-Magic@RevRagnarok.com
6 # Got the info from FPGA-FAQ 0026
8 # Rewritten to use pstring/H instead of hardcoded lengths by O. Freyermuth,
9 # fixes at least reading of bitfiles from Spartan 2, 3, 6.
10 # http://www.fpga-faq.com/FAQ_Pages/0026_Tell_me_about_bit_files.htm
12 # First there is the sync header and its length
15 >>&0 belong =0x0ff00ff0
18 >>>&3 string a Xilinx BIT data
19 # Next is a Pascal-style string with the NCD name. We want to capture that.
20 >>>>&0 pstring/H x - from %s
23 # Then the model / part number:
24 >>>>>>&0 pstring/H x - for %s
28 >>>>>>>>&0 pstring/H x - built %s
32 >>>>>>>>>>&0 pstring/H x \b(%s)
34 >>>>>>>>>>>&1 string e
36 >>>>>>>>>>>>&0 belong x - data length 0x%x
40 >&0 belong 0xaa995566 Xilinx RAW bitstream (.BIN)