cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cnie
Observer
Observer
10,280 Views
Registered: ‎11-06-2012

How to change the bitstream of the PCI E device at runtime without re-boot?

Jump to solution

Hi guys,

 

Currently, I am working on debugging a fpga-based pci express device. I need download serveral versions of bitstream files very often to compare and  debug .

 

I know, if under windows OS, we could use PnP manger to disable and enable a PCI device. If the fpga device is disabled first, and then I download a different bitstream file to the FPGA(with the same vendor ID and device ID, but different user logics); then enable this device again. This device will work well (BAR access) as new logics without any re-boot process. 

 

My question is how could I do the same "disable - download - enable" process chain under linux OS? As I know, there is no PnP manager in Linux. How could I disable/enable a pci device under terminal or using other tools?

 

Any idea? Thank you in advance.

 

Best regards

0 Kudos
1 Solution

Accepted Solutions
barco2
Adventurer
Adventurer
16,942 Views
Registered: ‎02-13-2009

If you have full control of the driver and can make sure that nobody accesses the device during reconfiguration, you could simply backup the BARs, the command register and the MSI stuff, and restore it when the new bitstream is loaded. I have done this and it worked well. Maybe ther was sth. in the PCI Express Capability which had to be backed up and restored as well, I don't remember this anymore.

 

Regards

Martin

View solution in original post

0 Kudos
2 Replies
barco2
Adventurer
Adventurer
16,943 Views
Registered: ‎02-13-2009

If you have full control of the driver and can make sure that nobody accesses the device during reconfiguration, you could simply backup the BARs, the command register and the MSI stuff, and restore it when the new bitstream is loaded. I have done this and it worked well. Maybe ther was sth. in the PCI Express Capability which had to be backed up and restored as well, I don't remember this anymore.

 

Regards

Martin

View solution in original post

0 Kudos
cnie
Observer
Observer
10,263 Views
Registered: ‎11-06-2012

Martin,

 

Thank you, I tried back up the configuration space first, then reconfigure the device, then write the configuration space back. It works well. 

 

regards

C

0 Kudos