xilinx revision 328875
1204076Spjd 2204076Spjd#------------------------------------------------------------------------------ 3204076Spjd# $File: xilinx,v 1.8 2017/03/17 21:35:28 christos Exp $ 4204076Spjd# This is Aaron's attempt at a MAGIC file for Xilinx .bit files. 5204076Spjd# Xilinx-Magic@RevRagnarok.com 6204076Spjd# Got the info from FPGA-FAQ 0026 7204076Spjd# 8204076Spjd# Rewritten to use pstring/H instead of hardcoded lengths by O. Freyermuth, 9204076Spjd# fixes at least reading of bitfiles from Spartan 2, 3, 6. 10204076Spjd# http://www.fpga-faq.com/FAQ_Pages/0026_Tell_me_about_bit_files.htm 11204076Spjd# 12204076Spjd# First there is the sync header and its length 13204076Spjd0 beshort 0x0009 14204076Spjd>2 belong =0x0ff00ff0 15204076Spjd>>&0 belong =0x0ff00ff0 16204076Spjd>>>&0 byte =0x00 17204076Spjd>>>&1 beshort =0x0001 18204076Spjd>>>&3 string a Xilinx BIT data 19204076Spjd# Next is a Pascal-style string with the NCD name. We want to capture that. 20204076Spjd>>>>&0 pstring/H x - from %s 21204076Spjd# And then 'b' 22204076Spjd>>>>>&1 string b 23204076Spjd# Then the model / part number: 24204076Spjd>>>>>>&0 pstring/H x - for %s 25204076Spjd# Then 'c' 26204076Spjd>>>>>>>&1 string c 27204076Spjd# Then the build-date 28204076Spjd>>>>>>>>&0 pstring/H x - built %s 29204076Spjd# Then 'd' 30204076Spjd>>>>>>>>>&1 string d 31204076Spjd# Then the build-time 32204076Spjd>>>>>>>>>>&0 pstring/H x \b(%s) 33204076Spjd# Then 'e' 34204076Spjd>>>>>>>>>>>&1 string e 35204076Spjd# And length of data 36219620Strociny>>>>>>>>>>>>&0 belong x - data length 0x%x 37204076Spjd 38204076Spjd# Raw bitstream files 39204076Spjd0 long 0xffffffff 40204076Spjd>&0 belong 0xaa995566 Xilinx RAW bitstream (.BIN) 41204076Spjd