xilinx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #------------------------------------------------------------------------------
  2. # $File: xilinx,v 1.10 2022/12/18 14:59:32 christos Exp $
  3. # This is Aaron's attempt at a MAGIC file for Xilinx .bit files.
  4. # Xilinx-Magic@RevRagnarok.com
  5. # Got the info from FPGA-FAQ 0026
  6. #
  7. # Rewritten to use pstring/H instead of hardcoded lengths by O. Freyermuth,
  8. # fixes at least reading of bitfiles from Spartan 2, 3, 6.
  9. # http://www.fpga-faq.com/FAQ_Pages/0026_Tell_me_about_bit_files.htm
  10. #
  11. # First there is the sync header and its length
  12. 0 beshort 0x0009
  13. >2 belong =0x0ff00ff0
  14. >>&0 belong =0x0ff00ff0
  15. >>>&0 byte =0x00
  16. >>>&1 beshort =0x0001
  17. >>>&3 string a Xilinx BIT data
  18. # Next is a Pascal-style string with the NCD name. We want to capture that.
  19. >>>>&0 pstring/H x - from %s
  20. # And then 'b'
  21. >>>>>&1 string b
  22. # Then the model / part number:
  23. >>>>>>&0 pstring/H x - for %s
  24. # Then 'c'
  25. >>>>>>>&1 string c
  26. # Then the build-date
  27. >>>>>>>>&0 pstring/H x - built %s
  28. # Then 'd'
  29. >>>>>>>>>&1 string d
  30. # Then the build-time
  31. >>>>>>>>>>&0 pstring/H x \b(%s)
  32. # Then 'e'
  33. >>>>>>>>>>>&1 string e
  34. # And length of data
  35. >>>>>>>>>>>>&0 belong x - data length %#x
  36. # Raw bitstream files
  37. 0 long 0xffffffff
  38. >&0 belong 0xaa995566 Xilinx RAW bitstream (.BIN)
  39. # AXLF (xclbin) files used by AMD/Xilinx accelerators.
  40. # The file format is defined by XRT source tree:
  41. # https://github.com/Xilinx/XRT/blob/master/src/runtime_src/core/include/xclbin.h
  42. # Display file size, creation date, accelerator shell name, xclbin uuid and
  43. # number of sections.
  44. 0 string xclbin2 AMD/Xilinx accelerator AXLF (xclbin) file
  45. >0x130 lequad x \b, %lld bytes
  46. >0x138 leqdate x \b, created %s
  47. >0x160 string >0 \b, shell "%.64s"
  48. >0x1a0 ubelong x \b, uuid %08x
  49. >0x1a4 ubeshort x \b-%04x
  50. >0x1a6 ubeshort x \b-%04x
  51. >0x1a8 ubeshort x \b-%04x
  52. >0x1aa ubelong x \b-%08x
  53. >0x1ae ubeshort x \b%04x
  54. >0x1c0 lelong x \b, %d sections