Jump to content
  • 0

How to read and download the fpga bitstream in an SPI flash by writing a Verilog / VHDL code (no Impact, or hardware manager).


herve

Question

Is it possible to write a VERILOG / VHDL code to download the programming file (fpga bitstream) to the hardware device (for example an SPI flash memory)?
I'm asking this, because I would like to transfer a bit stream into a spi flash memory, which will then be mounted on an fpga card for boot and configuration.
I have already written a few lines of code to write, read, and erase the contents of the 32 MB NOR flash memory (PMODSF3).
I tested my code and it works without problems!
However, how to read the bitstream, before writing it to the flash memory?

Do I only need to transfer the bitstream into flash memory or do I have to add a header and a footer in the memory before and after the transfer of the bitstream file?

Have you ever worked on a similar project?


N.B: I am using a Xilinx FPGA (Artix-7) on a customized board. I would like to find an alternative solution to the Xilinx hardware manager to program the SPI flash.
Any ideas, feedbacks and suggestions are welcomed!

Thank you

Hervé

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Hi,

you might look at the open-source xc3sprog utility, it shows how it's done. Nevermind the name, it works also with 7 series with minor modifications (such as IDCODE and flash ID).

I remember there is some header in the .bit file that is quite obviously for documentation purposes (open in text editor). But then, AFAIK it does no harm since the FPGA looks for some "magic" 32-bit word to recognize the start of the binary block. That is at least for JTAG-based upload (not sure about flash, I guess it's the same but I don't know).

You might have a quick look into the configuration guide https://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdf if it says anything about preparing a bitstream for flash.

Link to comment
Share on other sites

@herve,

There's an option for Vivado to create a ".bin" file.  Copy this directly to your flash device, starting with the first byte (unless you use warmboot, etc.), and you should be there.  Don't forget that you might also need to adjust the configuration load options as well.

Dan

Link to comment
Share on other sites

@xc6lx45 Thank you!

I will look at the open-source xc3sprog utility.

 

@Dan Thank you!

I know the vivado option to create a * .bin file :)
I will use a hex editor to open the bin file and read its contents.
Then I will try to transfer this content into the flash and check if the fpga can be configured from this flash memory at startup.

Herve

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...