Success! Subscription added.
Success! Subscription removed.
Sorry, you must verify to complete this action. Please click the verification link in your email. You may re-send via your profile.
Altera offers several configuration schemes for configuring FPGAs. This page should give an overview of the configuration schemes, give hints when to use a specific scheme and how to implement a specific scheme.
The two general schemes Altera offers are the passive and the active configuration scheme. For the passive scheme the FPGA is configured by an external device. For the active scheme the FPGA configures itself according to the MSEL setting.
Passive schemes are used when you are using an external configuration device. This could be a microcontroller, ECPx-device or a Max II CPLD. There could be several reasons why you want to chose a passive configuration scheme:
Use an active configuration scheme in the following cases:
This should give you a hint if the active or passive configuration scheme will be better suited for you project.
There is a page which gives you an overview of the configuration modes supported by the different FPGAs: Device Configuration Schemes
The Passive Parallel Synchronous and Passive Parallel Asynchronous don't seem to be used in newer devices. That was the reason why they are omitted in the list above.
Configuration Schem | Address (byte mode) | Address (word mode) |
---|---|---|
Active Serial (AS) x1 | ||
Active Serial (AS) x4 | ||
Active Parallel (AP) | 0x20000 | 0x10000 |
You can follow these steps if you store your FPGA configuration in flash device. Altera offers several software tools for creating flash images and programming them onto the Flash device. Depending on the system you are developing you have to take different approaches.
The Flash programming using the PFL function is pretty easy to use and is recommended to programm the FPGA bitstream into the Flash memory. If you're using a Nios II processor in your design have a look at [[1]] on how to program the Nios II software onto the Flash.
If your setup looks like this:
you can use the PFL (Parallel Flash Loader) component to program the flash (Parallel Flash Loader handbook). You can either create your own PFL design or you can you use the Factory default PFL image provided by Altera. If you don't have any explicit reasons then stick to the Factory default PFL image.
After you have synthesized your project you should have a .sof file with the bitstream for your FPGA. This bitstream has to be converted to a .pof file. For this select in Quartus II' -> File-> Convert Programming Files....
You have to select the configuration device, the configuration mode and the output file name in this dialog. If you want to store several designs in you configuration device you can add up to eight sof pages. Depending on the configuration mode you need to select either Configuration Master or SOF Data and then add the generated .sof file. Only the passive and the active parallel modes are supported by this tool.
After you have created the .pof file you can create a new Quartus II Programmer project. For this start the programmer: Quartus II -> Tools -> Programmer. Delete all devices which already exist. Then add your FPGA: Edit -> Add Device... and select your device. Select the device and add your configuration device: Edit -> Attach Flash Device.... Select the configuration device and select Edit -> Change File and select your generated .pof file. When you select Program/Confgiure you will see that the software automatically adds a Factory default PFL image to your FPGA device.
Now you can program your device and your FPGA should boot from your configuration device after reset.
If you have a Nios II processor system and the Flash is accessible from the processor system you can use this approach to program the FPGA. You can either use the graphical front end Nios II Flash Programmer which is a front end for the command line tools, or you can use the command line tools directly. For the prerequisites in using the Nios II Flash Programmer have a look at Nios II Flash Programmer User Guide Table 1 - 1.
If you want to program the flash from the command line you have to do the following three steps
Example bash script for programming the flash memory:
#!/bin/bash
# This script programs the flash
# generate flash files
sof2flash --input="./toplevel.sof" --output="./programming_files/fpga_configuration.flash" --verbose --activeparallel --offset=0x20000
elf2flash --input="./software/program/program.elf" --output="./programming_files/niosii_firmware.flash" --boot="${QUARTUS_ROOT_DIR}/nios2eds/components/altera_nios2/boot_loader_cfi.srec" --base=0x6000000 --end=0x67FFFFF --reset=0x6400000 --verbose
# download Nios II design
nios2-configure-sof "./toplevel_sammelplatine.sof"
# nios2-download "./software/adas1128/adas.elf" -g # download and start the software for the Nios II processor
# optional: erase the flash memory before programming
# nios2-flash-programmer --erase-all --base=0x6000000 --id=0xABBA --verbose
# program flash files
nios2-flash-programmer "./programming_files/fpga_configuration.flash" --base=0x6000000 --id=0xABBA --program --verbose
nios2-flash-programmer "./programming_files/niosii_firmware.flash" --base=0x6000000 --id=0xABBA --program --verbose
In this case the flash memory starts at address 0x6000000 of the Nios II system. The Nios II program code will be stored beginning at address 0x6400000 and the Nios II Reset vector is also set to this address. In this case the configuration mode selected for the FPGA was Active Parallel which has a default offset of 0x20000 (all addresses are binary addresses).
Community support is provided Monday to Friday. Other contact methods are available here.
Intel does not verify all solutions, including but not limited to any file transfers that may appear in this community. Accordingly, Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.
For more complete information about compiler optimizations, see our Optimization Notice.