FPGA reloading on a PCI card

Hi All,

I have a PCI card with a PCI bridge implemented in the
FPGA. The FPGA performs other functions besides acting
as a PCI bridge.

One of the requirements of the card’s driver is to
reload the FPGA at runtime upon user request. The
FPGA is reloaded from withing the card so no PCI
traffic is involved.

Questions:

  1. Do I have to ask PNP to remove my device prior
    reloading the FPGA ?
  2. Can I stall the system for the FPGA reload time
    (0.5sec) ?
  3. What will happen if I just reload the FPGA with my
    device driver running ?

Regards,
Stas.


Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail

Hi Stas,

Hi All,

I have a PCI card with a PCI bridge implemented in the
FPGA. The FPGA performs other functions besides acting
as a PCI bridge.

One of the requirements of the card’s driver is to
reload the FPGA at runtime upon user request. The
FPGA is reloaded from withing the card so no PCI
traffic is involved.

I’ll try to answer the bits that I can.

I’m assuming here that the FPGA being reloaded does not affect the actual
PCI interface (in the sense that when the device is being reprogrammed, it
does not operate or respond to any signal on the PCI bus itself, so the
board acts like it’s in tri-state). If not, you’d better think of a way to
make the FPGA behave this way… Put another way, the FPGA should NOT be
trying to do anything during the reprogramming phase.

Also, I’m assuming that your FPGA isn’t performing any sysmtem critical
operations, such as disk-I/O.

Questions:

  1. Do I have to ask PNP to remove my device prior
    reloading the FPGA ?

I can’t answer that, but there are others on this list that may be able to.

  1. Can I stall the system for the FPGA reload time
    (0.5sec) ?

You can. Just like you CAN put your hand on a hot hob when cooking, it
doesn’t make it a good idea… Why would you need to do this?

  1. What will happen if I just reload the FPGA with my
    device driver running ?

As long as you do one of the following:

  • do not get any requests to the driver due to higher level software being
    aware of FPGA reprogramming.
  • handle the reprogramming case by returning a suitable “try again” error
    code and discarding the request to the driver.
  • queue any requests and say “i’ll deal with it later”, and then deal with
    them when the FPGA is reprogrammed. [This obviously assumes that any request
    will work the same way after reprogramming as it does before {obivously
    modulo fixes implemented in the new FPGA program}]
  • a combination of above…

I presume that you can implement some sort of IOCTL or IRP that is
REPROGRAM_FPGA_START and REPROGRAM_FPGA_DONE, which will set and restore the
state of a driver internal flag.

This is just some ideas, not a complete solution… I’m sure others on this
mailing list can come up with other ideas and suggestions.


Mats

Regards,
Stas.

“Stas Desy” wrote in message news:xxxxx@ntdev…
> Hi All,
>
> I have a PCI card with a PCI bridge implemented in the
> FPGA. The FPGA performs other functions besides acting
> as a PCI bridge.
>
> One of the requirements of the card’s driver is to
> reload the FPGA at runtime upon user request. The
> FPGA is reloaded from withing the card so no PCI
> traffic is involved.
>
> Questions:
> 1) Do I have to ask PNP to remove my device prior
> reloading the FPGA ?
> 2) Can I stall the system for the FPGA reload time
> (0.5sec) ?
> 3) What will happen if I just reload the FPGA with my
> device driver running ?
>
> Regards,
> Stas.

Hi,
If your FPGA implements a generic PCI-PCI bridge, the devices behind the bridge,
which you don’t control, might try to access the PCI bus while you are
reprogramming the bridge - that will be a problem.
So, I think that you should ask PNP to remove your bridge (and consequently all
devices behind it) device before reprogramming it.

regards,
Tzvetan