Forum Discussion

greenlantern01's avatar
greenlantern01
Icon for Occasional Contributor rankOccasional Contributor
1 year ago

On-Chip Memory Read/Write Issue

Hello,

I am using a DE10 Standard FPGA board along with DC2390 daughter card.

I am trying to use a FIFO and On-Chip Memory (RAM or ROM) module together. Capture data from the FPGA, send that data to the FIFO, read from the FIFO and then store it in the On-Chip Memory via a DMA, and then read data from the memory from HPS. I am using the memory in dual port mode.

Could you direct me to where I can find the register map for the On-Chip Memory? I need to send chip select signals and write enable or read enable signals.

Thank you & Regards

15 Replies

  • sstrell's avatar
    sstrell
    Icon for Super Contributor rankSuper Contributor

    Check the system.h file which is created as part of the second stage bootloader based on the .sopcinfo file. The header file includes all the macros needed for accessing components connected to the processor.

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

      Okay! I think I got it! Thank you!

      Do I need to mmap the second port of the sram as well? I only see a single base address for the sram.

      But in the qsys I see two addresses. (Shared above)

      Thanks

      • sstrell's avatar
        sstrell
        Icon for Super Contributor rankSuper Contributor

        It's a true dual port RAM so the second port would get added to the header file as well.

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

      Hi Sheng,

      Thanks for sharing these links.

      I am assuming the SDRAM controller is specifically made for the SDRAM. Can the DMA be used for it? Can the DMA Controller be used for the on-chip ram?

      Thanks

  • ShengN_altera's avatar
    ShengN_altera
    Icon for Super Contributor rankSuper Contributor

    Hi,


    May I know is this another question on the DMA Controller?


    Thanks,

    Regards,

    Sheng


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

      Hi Sheng,

      I read the documentation for the Quartus Prime 17.0 which didn't mention DMA controller compatible with Cyclone V. I compiled the design with the Quartus version 23.1 and I see some activity on signal tap from the DMA pins.

      This is a question regarding the On-Chip Memory (RAM or ROM) Intel FPGA IP module. I have instantiated this module in the Qsys in the dual port mode and enabled "Initialize Memory Content". After loading this design on the FPGA I run a C code from the linux on the FPGA which tries to access the memory. Below is how the memory is connected to the HPS:

      I am trying to mmap. What would be the base address for the on-chip memory FPGA ip? According to the HPS memory map, the ocram base address is 0xFFFF0000. I tried doing that but I get segmentation error.

      The next I tried is 0xC0000000 since it is connected to the mai axi bus, and then add the offset address which is 0x08000000 (as shown in the qsys). I am able to read a constant value from this address. Would that be correct?

      How to access the second port? Do I need to mmap it again?

  • ShengN_altera's avatar
    ShengN_altera
    Icon for Super Contributor rankSuper Contributor

    Hi,


    Please provide us any further update or feedback whether the problem resolved with the above suggested steps?


    Thanks,

    Regards,

    Sheng


  • RichardT_altera's avatar
    RichardT_altera
    Icon for Super Contributor rankSuper Contributor

    May I know is there any update in regards to this case?

    Do you need any further assistance?


    Regards,

    Richard Tan


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

      Hello,

      I was able to make the DMA controller work. The data from the FIFO is being sent to the SRAM.

      I am now trying to figure out if I can increase the DMA transfer speed. I am sweeping signals from 1Hz to 5Khz. I can see signals till 1Khz decently, however, after that the data starts breaking and is distorted after 2KHz.

      Thanks for your time and assistance!

      Regards