FPGA bit vs bin file

Applications, development tools, FPGA, C, WEB
Post Reply
makkie2002
Posts: 10
Joined: Sat Feb 28, 2015 1:24 am

FPGA bit vs bin file

Post by makkie2002 » Wed Mar 04, 2015 11:10 pm

Hello,

I was browsing the SD card of my Pitaya in search for the FPGA bitstream. I can not find it anywhere.

It seems that the SD card is not used to program the FPGA logic. Is this correct? Is the FPGA logic programmed from a EEPROM at startup?

If so, is it possible to program a bitstream directly to the FPGA without having to replace the existing EEPROM configuration? That would be nice for newbies to experiment with the FPGA code without having to mess with a working configuration in the EEPROM.

What is the difference between a .bit or .bin file? Has this to do with the fact that .bit can by directly put on the FPGA and the .bin file is for programming the EEPROM?

Kind regards,

Newbie Marc

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: FPGA bit vs bin file

Post by Nils Roos » Thu Mar 05, 2015 12:13 am

Hi Marc,

The fpga bitstream is encapsulated in the boot.bin file on the SD card and is loaded into the fpga by the boot ROM startup code.

The boot.bin file can not be used to program the fpga after the boot ROM finishes, because there's other stuff in there too - to be precise, the first stage bootloader and the u-boot second stage bootloader.

To reprogram the fpga after boot you can use the reconfiguration device /dev/xdefcfg which accepts files in the prom format. The wiki and one or two threads around this forum have all the info you need for that - search for 'promgen'.

With the latest ecosystem, the /dev/xdevcfg also accepts the bitstream files from Vivado, but only for a limited number of times per boot (my experience is you can load 3 bit files, then the driver emits an error and will only accept prom files afterwards).

makkie2002
Posts: 10
Joined: Sat Feb 28, 2015 1:24 am

Re: FPGA bit vs bin file

Post by makkie2002 » Thu Mar 05, 2015 10:03 am

Thanks ... this makes things more clear for me!

The problem is that promgen is not part of Vivado.
I had to install it from the ISE image.
Is there no Vivado equivalent of promgen ?

Marc

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: FPGA bit vs bin file

Post by Nils Roos » Thu Mar 05, 2015 4:10 pm

There is no promgen bundled with Vivado; Xilinx recommends to install LabTools which also has the promgen utility. The hd-footprint of LabTools is slightly lighter than that of ISE ...

makkie2002
Posts: 10
Joined: Sat Feb 28, 2015 1:24 am

Re: FPGA bit vs bin file

Post by makkie2002 » Tue Mar 17, 2015 12:56 am

Hi,

I have noticed a recent commit on the GitHub page related to .bit files: https://github.com/RedPitaya/RedPitaya/ ... fc68cb287e.

Does this solve the problems? Can the native Vivado .bit files now be used?

Regards

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: FPGA bit vs bin file

Post by Nils Roos » Tue Mar 17, 2015 1:58 am

Yes, you can now use the Vivado bitstream files unmodified to reprogram the FPGA via /dev/xdevcfg

(provided you rebuild the ecosystem from these sources, of course - an official ecosystem release with those changes is not yet available)

makkie2002
Posts: 10
Joined: Sat Feb 28, 2015 1:24 am

Re: FPGA bit vs bin file

Post by makkie2002 » Tue Mar 17, 2015 9:02 am

Nils,

Cool. Thanks once more. Do you plan to release an updated sd-card image for download any time soon?

Marc

pavel-demin
Posts: 33
Joined: Tue Dec 23, 2014 10:52 pm

Re: FPGA bit vs bin file

Post by pavel-demin » Tue Mar 17, 2015 1:25 pm

Hi,

Just found a python script that replaces promgen:

https://github.com/topic-embedded-produ ... -to-bin.py

The command to convert .bit to .bin is

Code: Select all

python fpga-bit-to-bin.py --flip bitstream.bit bistream.bin
The resulting .bin file can be used to reconfigure the Red Pitaya FPGA:

Code: Select all

cat bistream.bin > /dev/xdevcfg
I tested it with the SD card image from the Red Pitaya User Manual and it worked.

Cheers,

Pavel

amin
Posts: 54
Joined: Mon Feb 06, 2017 12:31 pm

Re: FPGA bit vs bin file

Post by amin » Sun Oct 22, 2017 1:17 pm

hi pavel-demin

how to run command fpga-bit-to-bin.py in phyton. sorry i dont have experience using phyton.
after i run command, should i copy paste this code

Code: Select all

python fpga-bit-to-bin.py --flip bitstream.bit bistream.bin
in phyton?

I got this error after run command fpga-bit-to-bin.py:

Code: Select all

usage: fpga-bit-to-bin.py [-h] [-f] bitfile binfile
fpga-bit-to-bin.py: error: the following arguments are required: bitfile, binfile
Thanks,
Amin

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: FPGA bit vs bin file

Post by pavel » Sun Oct 22, 2017 1:34 pm

Hi Amin,

This is a very old thread.

Converting .bit files to .bin is not needed anymore.

Cheers,

Pavel

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 27 guests