Forum Discussion

Aflop's avatar
Aflop
Icon for Occasional Contributor rankOccasional Contributor
8 months ago

PCIe with DMA Memory Sizing

Background :

I am currently using the Arria 10 GX Devkit in preparation for a similar custom board. I have adapted the PCIe Avalon-MM DMA example which Intel provides and come up with a custom design which fits my needs in the moment. I am using Quartus 19.3 pro.

Problem :

The memory sector sizes which are returned when I run 'lspci' do not match those which I set in Platform Designer.

I have attached "pd_component" which shows the overall design of the platform designer component.

I have also attached "lspci_output" which shows what the command returns when the devkit is slotted in.

The table below shows the settings I input into platform designer and the lspci reported size

Bar#Data WidthTotal Memory(B)BaseEndlspci
232320000x00000x7cff32K
3850000x80000x938764K
43240000xa0000xaf9f64K
525610240xb0000xb3ff64K

Question :

How to I ensure the 'lspci' command returns the correct sizes of these memory sectors?

Thank you for your help.

7 Replies

  • Hi,

    The BAR2 requires 32KB so that size is assigned to this BAR.

    Though BAR3 requires only 5KB, a 64KB is assigned to this BAR because of the END addr 0x9387. Similar situation to BAR4 and BAR5.


    Regards,

    Rong


  • Aflop's avatar
    Aflop
    Icon for Occasional Contributor rankOccasional Contributor

    I need the lspci command to return the correct sizes of the memory BARs. Lets say I have 3 memory regions of 4KB how would I align these in memory such that lspci returns 4K for their respective sizes?

  • Aflop's avatar
    Aflop
    Icon for Occasional Contributor rankOccasional Contributor

    Assigning the address 0x0-0xfff for each on-chip RAM will result in an error because you are mapping 3 different RAM modules to the same memory region. Attached is a picture of the error.

    To clarify there is a previous project which has different memory modules mapped to different regions and the lspci command returns the correct sizing of these BARs, i.e. there is a 4K BAR not mapped to 0x0-0xfff. Unfortunately this project was done in AHDL and I do not have the time to decode it.

  • If you want multiple Bars to access one on-chip mem, please try AVMM Pipeline Bridge IP. You can define your address width there.


    Regards,

    Rong


    • Aflop's avatar
      Aflop
      Icon for Occasional Contributor rankOccasional Contributor

      This is not the accepted solution. I already have multiple BARs. I never said I wanted them to access one on-chip mem. Maybe it is the accepted solution for YOUR problem but it is not what I asked.

      I have multiple BARs access multiple on-chip Mem and it is working fine other than the lspci command does not reflect the correct size. I have moved on to other problems of more importance now. When I have time to investigate this again I will.