Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

Configure FPGA dynamically at run-time

Altera_Forum
Honored Contributor II
2,198 Views

Hello, 

 

I'm trying to change the FPGA configuration at run time using one of the generic SD images. I'm using the Ubuntu image from Terasic at the moment and the goal is to boot to Linux using this image, and then swap out FPGA configurations without having to reset the HPS (resetting the FPGA is fine). I want to have several bitstreams stored and swap to the most relevant one. 

 

I've looked around and although I think I'm finding information saying it's possible; I'm having a hard time finding out how to actually do it. Ideally I would like to use Linux commands and do something simple like 

 

cat myfpgaconfig.rbf > /dev/thefpga 

 

But if I have to use C and do it myself, that's okay too. I'm under the impression I want to interface with the FPGA manger if I am required to write it myself, but I wanted to ask if anyone knew of a "simple" solution or existing examples that would do this?  

 

I'm afraid I'm suffering from information overload looking at all the datasheets and documentation provided by Altera and could use some advice on what's important and what's not so important at the moment. 

 

Thanks!
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
839 Views

In Altera-s example Altera-SoCFPGA-Hardwarelib-FPGA-CV-GNU from SoC EDS present downloading of included .rbf to FPGA part for configuring it. 

For Linux similar code is absent. 

That theme discussed earlier -- many devices in FPGA may be initialized in Preloader etc. and after reconfiguring may not work after "cat myfpgaconfig.rbf > /dev/thefpga". Solution is too much beautiful in order to be living ! May be reload also and OS to perceive news :) 

On base given example is possible to write Linux driver that recipe your .rbf, need be knowed preceding .rbf version, read values of each register, write again after reconfiguring... And if user calls a command "cat mc.ini > /dev/thefpga" ? FPGA must wait next configaration :) 

I recommend using of only 1 .rbf, configure FPGA only once at boot and change its functionality with separate register for write commands if will be need mode change.
0 Kudos
Altera_Forum
Honored Contributor II
839 Views

I'm sure it's possible in some way. The User Manual hints at the MSEL switch configuration for programming from Linux, and Cyclone V manual seems to indicate the FPGA manager is the mechianism. Lastly, http://rocketboards.org/foswiki/documentation/gsrd131programmingfpga has a procedure very similar to what I'm looking for but I don't think it's for the DE1-SoC, since I don't have all of the directories listed in the instructions. 

 

In the meantime I'll keep probing.
0 Kudos
Reply