Forum Discussion

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

PCIe Completion ID

I am implementing a PCIe endpoint with the Altera IP. I need to know the endpoint's Completer ID to send it back in the descriptor of read completions. On other core's I've worked with this was output from the PCIe Core so you could see the ID after enumeration, although I find no documentation to that effect.

How can I determine my ID?

Thanks,

rdburns

3 Replies

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

    Do I need to drop in altpcierd_tl_cfg_sample.vhd from the example design to pull the bus and device number out of the configuration space?

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

    --- Quote Start ---

    I am implementing a PCIe endpoint with the Altera IP. I need to know the endpoint's Completer ID to send it back in the descriptor of read completions. On other core's I've worked with this was output from the PCIe Core so you could see the ID after enumeration, although I find no documentation to that effect.

    How can I determine my ID?

    Thanks,

    rdburns

    --- Quote End ---

    As far as I know (but I think there will be another way to do it) you have to determine it by having a look at the control menu (windows) or use lspci (Linux). The ID consists of the bus number (7:0), the device number (4:0) and the function number (2:0) (see PCIe Spec). Thats the manual way if you, like me, doing some kind of prototyping. If you want to use you're card in different systems I would suggest doing it this way:

    Let the driver send the ID to your fpga or write it in the memory and let the fpga read the memory.

    I have to admit I'm relativly new to the topic, so correct me if I'm wrong/ theres a much more efficient way.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I think the proper way is to drop in altpcierd_tl_cfg_sample.vhd, you can then get the bus and device number as an output from that port. Seems to work properly in simulation.

    Thanks,