User Tools

Site Tools


Sidebar

Go Back

Refresh

You are not allowed to add pages

library:fpga:configuration:xilnxfpga配置时的比特交换处理

Xilnx FPGA配置时的比特交换处理

http://www.xinsi.ltd


Bit swapping is the swapping of the bits within a byte. The MCS, EXO, and TEK PROM file formats are always bit swapped. The HEX file format can be bit swapped or not bit swapped, depending on user options. The bitstream files (BIT, RBT, and BIN) are never bit swapped.

ISE输出的Bit文件和Bin文件,可以看到同步字节是 0xAA 0x99 0x55 0x66

Traditionally, in SelectMAP x8 mode, configuration data is loaded one byte per CCLK, with the most-significant bit (MSB) of each byte presented to the D0 pin. Although this convention (D0 = MSB, D7 = LSB) differs from many other devices, it is consistent across all Xilinx® FPGAs. The bit-swap rule also applies to Spartan-6 FPGA BPI x8 modes.

在配置FPGA时,数据是比特调换的,即数据的最高位要送到D0脚,因此,发送0xAA (8’b1010_1010)时,应该在数据线上输出信号D[7:0]=8’b0101_0101。

若存储文件预先作比特转换,转换后的文件经MCU或直接输出到总线,则能符合比特交互要求。转换后,文件的同步字节是:0x55 0x99 0xAA 0x66,请检查确认文件的内容。以下是一个用于配置FPGA的预存文件(8位总线),可直接加载到FPGA上。

16位总线的配置文件如下:

结论:把ISE布线(PAR)输出的配置文件的每个字节做 d[7:0] = s[0:7]的交换,作为配置用的文件。

注意:Xilnx的PROMGen工具本身提供产生比特交换文件的功能,避免两次交换后生成错误文件。检查方法如上所述,打开最终文件,确认0x5599aa66的序列。

附: 未作比特交换的,ISE布线后生成的配置文件(原始bit文件,用于产生bin文件,包含信息头),同步流是AA 99 55 66

library/fpga/configuration/xilnxfpga配置时的比特交换处理.txt · Last modified: 2019/02/23 12:26 by admin