3
votes

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

3
Welcome to StackOverflow. Didn't googling "altera quartus rbf" and "quartus rbf to of" give you the necessary explanations? Questions asked on this site should be more specific.gvlasov

3 Answers

5
votes

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
5
votes

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.

0
votes

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