Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCIe example does not work. #1

Open
ciniml opened this issue Oct 23, 2023 · 8 comments
Open

PCIe example does not work. #1

ciniml opened this issue Oct 23, 2023 · 8 comments

Comments

@ciniml
Copy link

ciniml commented Oct 23, 2023

Hi.

I'm trying to run the PCIe demo, the bitstream in https://github.com/sipeed/TangMega-138KPro-example/blob/main/pcie/PCIe2.0_dma_demo/pcie_dma_demo.gar , but the board is not recognized as PCIe device at all.

I've tried both

  1. program to SRAM and reboot the PCIe host PC (warm boot)
  2. program to flash and turn on the PCIe host PC (cold boot)

but nothing worked for me.

After some investigation, I've found that the physical constraint in the archived project seems for GOWIN PCIe DVK, not for Tang Mega 138K.

So, could you provide the prebuilt bitstream and correct physical constraint to check my board works correctly?

@kyonmiriam
Copy link
Collaborator

Perhaps U could try this pre-built bitstream first, It is verified on Tang Mega 138K,
pcie_dma_demo.zip

@ciniml
Copy link
Author

ciniml commented Oct 24, 2023

Thanks for providing the pre-build bitstream.

I've modified the physical constraint and comment out define dvk_brd line in top_define.v this morning and the board got recognized as a PCIe device.

Here is the modified physical constraint file I've confirmed to work in my environment.
dvk_cfg_v2.zip

But there are another problem about the DMA transfer demo. The demo hangs after around 250 transfer when I run the loop.sh script.

I'll try the pre-build bitstream and check that the demo runs well.

@kyonmiriam
Copy link
Collaborator

Thanks for UR physical constraint file, I will verify it.
In addition, what does the 250 transfer mean? Could U let me know Is it 250 times or what other parameters?

@ciniml
Copy link
Author

ciniml commented Oct 25, 2023

The number shown by this line of loop.sh. I think it means number of runs of DMA transfer test.

https://github.com/sipeed/TangMega-138KPro-example/blob/main/pcie/PCIe2.0_dma_demo/gowin_pcie_demo/gowin_pcie_demo/loop.sh#L11

I confirmed that my board was recognized as a PCIe device with the pre-build bitstream.

I had another TangMega138K user check whether the DMA demo works with both the bitstream I built and the pre-built bitstream.
He reported that it runs without any issues.
It seems like the problem might be specific to my environment, so I will look into it.

@kko-smol
Copy link

kko-smol commented Jan 8, 2024

Hi. I have too issues with this example.
I have 2 devices:

  1. Jetson TX2 - doesn't detect the board. I tried pre built bitstream, build my-own it stream, add pauses to pcie-controller driver(suggestion from Jetson forum). But TX2 doesn't see device.
  2. x86_64 with ubuntu(6.2.0-26-generic #26~22.04.1-Ubuntu SMP) - it may detect pcie device sometimes, but it is totally unstable. I have to make a lot of actions like reset board, run rescan, reboot PC and so on to make it visible. But when PC detected card - demo application doesn't work. irq counter in /proc/interrupts doesn't increase and demo application got stall.

What would you recommend to check?

In gowin ide I see timings error: div_clk is 100Mhz, but timing analysis say it can work only at ~82Mhz. Do you have same and design works?

@kyonmiriam
Copy link
Collaborator

Hi. I have too issues with this example. I have 2 devices:

1. Jetson TX2 - doesn't detect the board. I tried pre built bitstream, build my-own it stream, add pauses to pcie-controller driver(suggestion from Jetson forum). But TX2 doesn't see device.

2. x86_64 with ubuntu(6.2.0-26-generic #26~22.04.1-Ubuntu SMP) - it may detect pcie device sometimes, but it is totally unstable. I have to make a lot of actions like reset board, run rescan, reboot PC and so on to make it visible. But when PC detected card - demo application doesn't work. irq counter in /proc/interrupts doesn't increase and demo application got stall.

What would you recommend to check?

In gowin ide I see timings error: div_clk is 100Mhz, but timing analysis say it can work only at ~82Mhz. Do you have same and design works?

Here is reply:

  1. Unfortunately, in my own tests, this DEMO is not working when connecting the Raspberry Pi CM4 or 5, and it may be attributed to the compatibility of the ARM PCIe driver.
  2. For your x86_64 PC, maybe you should try to disable the Secure Boot in BIOS first. And don't forget to refer to the PCIe DMA Demo User Guide to modify boot arguments for your ubuntu. In fact, our test environment is Ubuntu 20.04 LTS, The updated system and kernel have not been tested yet. When GOWIN released a new update for this DEMO, I will test on the new system such as Ubuntu 22.04 ASAP.
  3. Since this demo is too old, it seams could not be correct synthesis in the 1.9.9 version of the GOWIN IDE. So try the prebuilt bitstream first, This demo should got a update soon.

@ZYTek2024
Copy link

ZYTek2024 commented Oct 6, 2024

Perhaps U could try this pre-built bitstream first, It is verified on Tang Mega 138K, pcie_dma_demo.zip
@kyonmiriam I ask if it is possible to upload the complete project?

@ZYTek2024
Copy link

Hi.

I'm trying to run the PCIe demo, the bitstream in https://github.com/sipeed/TangMega-138KPro-example/blob/main/pcie/PCIe2.0_dma_demo/pcie_dma_demo.gar , but the board is not recognized as PCIe device at all.

I've tried both

  1. program to SRAM and reboot the PCIe host PC (warm boot)
  2. program to flash and turn on the PCIe host PC (cold boot)

but nothing worked for me.

After some investigation, I've found that the physical constraint in the archived project seems for GOWIN PCIe DVK, not for Tang Mega 138K.

So, could you provide the prebuilt bitstream and correct physical constraint to check my board works correctly?

@ciniml May I ask if it is possible to upload the complete project? program to SRAM and reboot the PCIe host PC (warm boot),the only work.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants