Skip to content

General

The bitstream file format accepted by the Cyclone IV (thus OpenFPGALoader) is .rbf (Raw Binary File), so this is the format to be analyzed.

The number of sections and the size of them depends on the model, more precisely on the size of the model, which increses on steps, in total of 3 different layouts.

There are 3 different kind of sections:

Position Name Size in bytes (without CRC) Comments
0 General 73 Always the same (almost). Probably some FPGA global configuration
1 Peripheral 5415 Very closely realted to pin configuration
2 Core Eveything else, subdivided in other sections

The FPGA "rejects" a not valid bitstream, which means that it simply does not ingest the bitstream and load from other mediums, for example the persistent storage.

This occurs at least when:

  • The CRC is not valid
  • Byte 0 of each section is no 0xff

CRC

The algorithm used in the bitstream is a custom CRC-16, with the following parameters:

  • poly: 0x8005
  • init: 0x2a7f
  • refin: true
  • refout: true

This CRC applies to both the peripheral section and the core one.