Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

Why restart CPU is a must after slot in PCIe card (SV dev kit) during run time

I'm using Altera Stratix V devkit configure as PCIe Gen3 speed.

I have couple of silly questions regarding the interfacing...

1.) First of all, I will use external power supply for the devkit...I slot in the PCIe card during the CPU run time. after I program the dev kit, why they can't have normal link up? Why i must restart the CPU in order to get both of them works?

2.) Also, when everytime the link go wrong in a half way, I need to repeat 2 step in order to recover the link

- reprogram the devkit

- restart CPU

Would anyone mind to explain why i need to keep on repeating this?

Thanks and Regards,

fpga89

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I have couple of silly questions regarding the interfacing...

    --- Quote End ---

    These questions are related to how a PCIe system is initialized. In PCIe the root-complex is responsible for setting up all the end-points. The "default" for a standard PC is that the BIOS sets up the PCIe memory windows at boot time. This fact causes the problems you are seeing. Here's several use-cases for you;

    1. Power-on and manual FPGA download

    Power-on your PC, and hit ESC (or whatever) to pause on the BIOS screen. Download your Stratix V kit PCIe end-point design. Exit the BIOS and allow your PC to continue booting.

    When you exit the BIOS you are performing a warm-reboot, where the BIOS rescans the PCIe bus, finds your device, and configures it.

    2. Power-on and auto FPGA download (configuration from on-board Flash)

    This is similar to (1), except that the FPGA must configure within 100ms to ensure it is alive when the PC BIOS enumerates the PCIe bus.

    3. Manual FPGA configuration after the PC has booted.

    In this case, if you reconfigure the FPGA, the PCIe registers come up at their reset values, not with the values the PC "saw" when you powered-on the machine. You can "cheat" and manually reprogram the values that were previously in the PCIe end-point registers (if you wrote down their values), or you can force the PC to re-enumerate the PCIe bus (which is fairly easy under Linux).

    If you read the PCIe specification, this should be in there somewhere.

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Any one interested in writing an application to allow FPGA configuration without reboot? That can be a big time saver. I found this hint on the hooks available in Windows world. http://stackoverflow.com/questions/22203316/reset-fpga-based-pcie-card-and-restore-its-config-space

    --- Quote End ---

    There should be no need to create a hack. The "correct" way is to force re-enumeration of the PCI/PCIe buses. This works under Linux already. The question is how to do this under Windows. It is possible, since I can plug and unplug my ExpressCard (which is PCIe) and I think it gets detected "plug-and-play" style ... but that could be poor recollection on my part.

    Cheers,

    Dave