How to generate .rbf files in Altera Quartus?

∥☆過路亽.° 提交于 2020-08-23 06:52:52

问题


What are .rbf files and how can i generate them from the Quartus output file .sof on windows ?


回答1:


With Quartus II GUI go to File => Convert Programming Files, where .rbf can then be selected as output file, and the .sof can be given as input file.

The conversion setup can be saved from the GUI for use in a command line like

> quartus_cpf -c convert_sof_to_rbf.cof



回答2:


An RBF is a "Raw Binary File". It represents the raw data that will, for example, be loaded into a flash memory for initialising an FPGA on power-up.

A SOF is an "SRAM Object File". It contains the data required to initialise the FPGA directly.

Although you can output an RBF from Quartus (File -> Convert Programming Files...), I suspect from your question that you're looking for a way to directly convert a SOF to an RBF. This can be done using Altera's "NIOS II Command Shell", which can be run from the Quartus folder in the Start menu.

Note that although you need Quartus installed in order to do this, you don't need to pay for a subscription, because the NIOS II Command Shell works even if Quartus doesn't have a valid licence.

It's a two step process...

Step One

cd to the directory containing your SOF then type:

sof2flash --offset=0 --input="./your_file.sof" --output="./your_file.flash"

This converts the SOF file into a FLASH file, which is an ASCII representation of the desired RBF.

Step Two

Now type this:

nios2-elf-objcopy -I srec -O binary "./your_file.flash" "./your_file.rbf"

You will now have your RBF file, as required.




回答3:


An other alternative GUI free:

For use in command line in windows, you have to first launch the Altera Embedded Command Shell (Same idea on a linux system btw). On my computers, the file to launch are:

# on Windows
C:\intelFPGA\17.1\embedded\Embedded_Command_Shell.bat

# on Linux
/opt/altera/17.1/embedded/Embedded_Command_Shell.sh

Then you can use Quartus command lines programs.

To convert directly a sof to an rbf:

quartus_cpf -c my_input_file.sof my_output_file.rbf

You can also add options to compress the bitstream for example :

quartus_cpf -c -o bitstream_compression=on my_input_file.sof my_output_file.rbf


来源:https://stackoverflow.com/questions/28799960/how-to-generate-rbf-files-in-altera-quartus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!