summaryrefslogtreecommitdiff
path: root/magic/Magdir/xilinx
diff options
context:
space:
mode:
Diffstat (limited to 'magic/Magdir/xilinx')
-rw-r--r--magic/Magdir/xilinx52
1 files changed, 27 insertions, 25 deletions
diff --git a/magic/Magdir/xilinx b/magic/Magdir/xilinx
index dd47aa1..91e84d9 100644
--- a/magic/Magdir/xilinx
+++ b/magic/Magdir/xilinx
@@ -1,38 +1,40 @@
#------------------------------------------------------------------------------
-# $File: xilinx,v 1.5 2013/01/08 03:06:50 christos Exp $
+# $File: xilinx,v 1.7 2014/04/30 21:41:02 christos Exp $
# This is Aaron's attempt at a MAGIC file for Xilinx .bit files.
# Xilinx-Magic@RevRagnarok.com
# Got the info from FPGA-FAQ 0026
#
+# Rewritten to use pstring/H instead of hardcoded lengths by O. Freyermuth,
+# fixes at least reading of bitfiles from Spartan 2, 3, 6.
+# http://www.fpga-faq.com/FAQ_Pages/0026_Tell_me_about_bit_files.htm
+#
# First there is the sync header and its length
0 beshort 0x0009
>2 belong =0x0ff00ff0
>>&0 belong =0x0ff00ff0
->>>&0 beshort =0x0000
->>>>&0 pstring a Xilinx BIT data
+>>>&0 byte =0x00
+>>>&1 beshort =0x0001
+>>>&3 string a Xilinx BIT data
# Next is a Pascal-style string with the NCD name. We want to capture that.
->>>>0x0F pstring x - from %s
-# It is followed by a NUL
->>>>>&1 byte 0x00
+>>>>&0 pstring/H x - from %s
# And then 'b'
->>>>>&2 string b
-# With the part number:
-#>>>>>&5 string 4v (Virtex4)
-#>>>>>&5 string 2v (Virtex II
-#>>>>>>&0 string !p \b)
-#>>>>>>&0 string p Pro)
->>>>>&4 pstring x - for %s
-# And then NUL / 'c' / Build Data / NUL / 'd' / Date / NUL / 'e' / Data Length
->>>>>>&1 byte 0x00
->>>>>>&2 string c
->>>>>>&4 pstring x - built %s
->>>>>>>&1 byte 0x00
->>>>>>>&2 string d
->>>>>>>&4 pstring x \b(%s)
->>>>>>>>&1 byte 0x00
->>>>>>>>&2 string e
->>>>>>>>&4 belong x - data length 0x%lx
+>>>>>&1 string b
+# Then the model / part number:
+>>>>>>&0 pstring/H x - for %s
+# Then 'c'
+>>>>>>>&1 string c
+# Then the build-date
+>>>>>>>>&0 pstring/H x - built %s
+# Then 'd'
+>>>>>>>>>&1 string d
+# Then the build-time
+>>>>>>>>>>&0 pstring/H x \b(%s)
+# Then 'e'
+>>>>>>>>>>>&1 string e
+# And length of data
+>>>>>>>>>>>>&0 belong x - data length 0x%x
+
# Raw bitstream files
-0 long 0xffffffff
->&0 belong 0xaa995566 Xilinx RAW bitstream (.BIN)
+0 long 0xffffffff
+>&0 belong 0xaa995566 Xilinx RAW bitstream (.BIN)