179343712SPeter Avalos 279343712SPeter Avalos#------------------------------------------------------------------------------ 3*614728caSSascha Wildner# $File: xilinx,v 1.9 2021/04/26 15:56:00 christos Exp $ 479343712SPeter Avalos# This is Aaron's attempt at a MAGIC file for Xilinx .bit files. 579343712SPeter Avalos# Xilinx-Magic@RevRagnarok.com 679343712SPeter Avalos# Got the info from FPGA-FAQ 0026 779343712SPeter Avalos# 8e8af9738SPeter Avalos# Rewritten to use pstring/H instead of hardcoded lengths by O. Freyermuth, 9e8af9738SPeter Avalos# fixes at least reading of bitfiles from Spartan 2, 3, 6. 10e8af9738SPeter Avalos# http://www.fpga-faq.com/FAQ_Pages/0026_Tell_me_about_bit_files.htm 11e8af9738SPeter Avalos# 1279343712SPeter Avalos# First there is the sync header and its length 1379343712SPeter Avalos0 beshort 0x0009 1479343712SPeter Avalos>2 belong =0x0ff00ff0 1579343712SPeter Avalos>>&0 belong =0x0ff00ff0 16e8af9738SPeter Avalos>>>&0 byte =0x00 17e8af9738SPeter Avalos>>>&1 beshort =0x0001 18e8af9738SPeter Avalos>>>&3 string a Xilinx BIT data 1979343712SPeter Avalos# Next is a Pascal-style string with the NCD name. We want to capture that. 20e8af9738SPeter Avalos>>>>&0 pstring/H x - from %s 2179343712SPeter Avalos# And then 'b' 22e8af9738SPeter Avalos>>>>>&1 string b 23e8af9738SPeter Avalos# Then the model / part number: 24e8af9738SPeter Avalos>>>>>>&0 pstring/H x - for %s 25e8af9738SPeter Avalos# Then 'c' 26e8af9738SPeter Avalos>>>>>>>&1 string c 27e8af9738SPeter Avalos# Then the build-date 28e8af9738SPeter Avalos>>>>>>>>&0 pstring/H x - built %s 29e8af9738SPeter Avalos# Then 'd' 30e8af9738SPeter Avalos>>>>>>>>>&1 string d 31e8af9738SPeter Avalos# Then the build-time 32e8af9738SPeter Avalos>>>>>>>>>>&0 pstring/H x \b(%s) 33e8af9738SPeter Avalos# Then 'e' 34e8af9738SPeter Avalos>>>>>>>>>>>&1 string e 35e8af9738SPeter Avalos# And length of data 36*614728caSSascha Wildner>>>>>>>>>>>>&0 belong x - data length %#x 37e8af9738SPeter Avalos 38e8af9738SPeter Avalos# Raw bitstream files 39e8af9738SPeter Avalos0 long 0xffffffff 40e8af9738SPeter Avalos>&0 belong 0xaa995566 Xilinx RAW bitstream (.BIN) 41