Forum Discussion

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

Cyclone V SoC Dev Kit PCIe End Port Example

I am trying to get the Cyclone V SoC Development Kit Board to behave as a PCIe End Port. I want to plug this board into a PCIe 4x slot on a PC motherboard running windows. This Dev Kit Board is really setup to be a root port and has a root port connector. So I can't plug the dev kit board directly into a slot on the motherboard. To solve this problem I purchased a male-to-male 4x adapter cable that also acts as a RX-to-TX crossover cable. A PCIe end port example design is included in the files I downloaded from Altera for the C5SoC dev kit. I had to make a few adjustments to the .qsf file, but I was able to get this end port example generated in qsys and compiled in quartus 13.1sp1. My problem is when I download the .sof into the dev kit fpga, the pc mother board doesn't seem to recognize it. I added a jtag master and a register to the design so I can read the PCIe LTSSM state bits. Using system console to read these bits, the PCIe controller appears to be going back and forth between the detect-quiet state and the polling-active state. My crossover adapter cable is fairly long (15"). I've ordered a shorter one (2") to see if this may be my problem. It will be a couple days before I get the 2" cable. In the mean time, I wanted to see if anyone else has tried to get the Cyclone V SoC Dev Kit Board to work as a PCIe End Port?

20 Replies

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

    Hi kstolp,

    The example designs with the "Qsys PCIe core fails timing" thread used the PCIe Hard IP clock to clock the Qsys system primarily because that was how the first few examples I looked at implemented a simple design. In general I would not recommend doing this, but would instead use a local clock source, eg., a 100MHz Qsys clock should be fine. This allows you to implement a JTAG-to-Avalon-MM bridge into your Qsys system that will work regardless of the state of the PCIe clock.

    The approach you are taking should work just fine, and would be the recommended approach.

    There's a couple of things you can do;

    1. Use a PCIe logic analyzer to trace the traffic that occurs when the system works and when it does not.

    2. Use the SignalTap II logic analyzer to trace the traffic (if you do not have access to a PCIe analyzer)

    3. Create a simulation and look to see whether you can "boot" your system, eg., enumerate the PCIe end-point and then access your Qsys system.

    I'd recommend having (3) regardless of whether you do (1) or (2) as it forces you to really understand what needs to occur to get your system up-and-running. Once you have traces from (1) or (2), you can update your simulation to implement the same access sequence (eg., redundant accesses performed by the root-complex).

    Cheers,

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

    Hi Dave,

    My Question is a lil out of track but I would like you to ans this since You look Quite polished with PCIe related stuff.

    I want to know If I can test PCIe Root Port without Connecting/attaching Endpoint with Linux Kernels.

    Thanks

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

    Hi Angad,

    --- Quote Start ---

    I want to know If I can test PCIe Root Port without Connecting/attaching Endpoint with Linux Kernels.

    --- Quote End ---

    You mean you just want to see if the wires on the PCIe connector are working? If the root-complex is an FPGA, then sure, you can do whatever you like.

    For example, you can test a high-speed transceiver by configuring it in BIST mode and have it generate a PRBS pattern, or you can use a transceiver IP core and configure it manually and have it output a desired pattern. For example, a square wave at a low enough frequency that you can see it on a scope. You can also loop back the TX and RX differential signals using a PCIe breakout cable (Samtec sell them).

    http://www.samtec.com/technical-specifications/default.aspx?seriesmaster=pcrf

    I use this type of cable (the one with the peripheral style connector) as a way to access transceivers on kits that do not have HSMC or FMC connectors.

    Cheers,

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

    --- Quote Start ---

    Hi Angad,

    You mean you just want to see if the wires on the PCIe connector are working? If the root-complex is an FPGA, then sure, you can do whatever you like.

    For example, you can test a high-speed transceiver by configuring it in BIST mode and have it generate a PRBS pattern, or you can use a transceiver IP core and configure it manually and have it output a desired pattern. For example, a square wave at a low enough frequency that you can see it on a scope. You can also loop back the TX and RX differential signals using a PCIe breakout cable (Samtec sell them).

    http://www.samtec.com/technical-specifications/default.aspx?seriesmaster=pcrf

    I use this type of cable (the one with the peripheral style connector) as a way to access transceivers on kits that do not have HSMC or FMC connectors.

    Cheers,

    Dave

    --- Quote End ---

    Hi Dave,

    Thanks for the quick response.

    I am testing the following design: http://rocketboards.org/foswiki/view/projects/pcierootportwithmsi

    If you Look into "Open Issue" - FB 165881 – Kernel can’t boot up if don’t have end point

    I have applied the patch that they are giving. It works fine on the Dev kit, But I tried the same patch for Other Cyclone V Device(5CSXFC6C6U23I7ES) The patch seems to fail.

    Basically from the patch I understood that the RootPort is being forced to complete the Enumeration But I dont understand why it wont work for other device other than Dev kit.

    Regards

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

    Hi Angad,

    --- Quote Start ---

    I am testing the following design: http://rocketboards.org/foswiki/view/projects/pcierootportwithmsi

    If you Look into "Open Issue" - FB 165881 – Kernel can’t boot up if don’t have end point

    I have applied the patch that they are giving. It works fine on the Dev kit, But I tried the same patch for Other Cyclone V Device(5CSXFC6C6U23I7ES) The patch seems to fail.

    Basically from the patch I understood that the RootPort is being forced to complete the Enumeration But I dont understand why it wont work for other device other than Dev kit.

    --- Quote End ---

    That is a terrible issue - its like saying "Sorry, your PC cannot boot if you do not have a card in the PCIe slot"!!!

    Sorry, I've steered clear of the SoC devices for exactly this type of reason. I expected "teething" problems and didn't want to be the one to find them (been there, done that with earlier new generation devices).

    I didn't read any of the code. Perhaps there is just a "bad decision" in the RTL or in the bootloader code that is the cause of this issue.

    Cheers,

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

    --- Quote Start ---

    Hi Angad,

    That is a terrible issue - its like saying "Sorry, your PC cannot boot if you do not have a card in the PCIe slot"!!!

    Sorry, I've steered clear of the SoC devices for exactly this type of reason. I expected "teething" problems and didn't want to be the one to find them (been there, done that with earlier new generation devices).

    I didn't read any of the code. Perhaps there is just a "bad decision" in the RTL or in the bootloader code that is the cause of this issue.

    Cheers,

    Dave

    --- Quote End ---

    Hi Dave,

    Haha..that's exactly how I feel at this point of time when the Kernel hangs!!..

    I have been seeking help from RocketBoards as well as Altera FAE but have not got any contextual solution to this issue. I don't know why would anyone make a device specific patch for a generic hard IP. Let me know if you get the time to go through the Patch and figure out a quick fix to the issue which I could try out.

    Thanks

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

    Hi Angad,

    --- Quote Start ---

    I have been seeking help from RocketBoards as well as Altera FAE but have not got any contextual solution to this issue. I don't know why would anyone make a device specific patch for a generic hard IP. Let me know if you get the time to go through the Patch and figure out a quick fix to the issue which I could try out.

    --- Quote End ---

    Sorry, I won't get a chance to look at the patch. I recommending filing a Service Request directly with Altera (use the Altera web site) and see if they can help. At least you might get a chance to chat with the person who created the patch and see why it is needed and whether there is a better solution.

    Cheers,

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

    Hello,

    I am also facing the same issue "Kernel hangs after 'Starting kernel' ". Can you please message the link for the patch? I coudn't find rp_rtl.zip file in cv_soc_rp_full_design.tar.gz or cv_soc_rp_simple_design.tar.gz(As per solution for FB 165881 – Kernel can’t boot up if don’t have end point). Regards Kushal
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hello,

    I am also facing the same issue "Kernel hangs after 'Starting kernel' ". Can you please message the link for the patch? I coudn't find rp_rtl.zip file in cv_soc_rp_full_design.tar.gz or cv_soc_rp_simple_design.tar.gz(As per solution for FB 165881 – Kernel can’t boot up if don’t have end point). Regards Kushal

    --- Quote End ---

    Hi Kaushal,

    I am sure you would be using 13.1 or older version of Quartus. Use the latest version of Quartus 14.0 or higher. the issue has been addressed by Altera. For the higher version we do not require any patch hence Rocket boards have removed the patch from their site.

    Regards

    Angad