cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
308 Views
Registered: ‎10-15-2020

Xilinx ZCU102 -DDR Access

How to access PL DDR using C code from PS of Xilinx MPSoC-ZCU102?

I need to write the data to the DDR.What are the steps for that?How can I access the PS and PL DDR?

Based on my understanding,I think I am supposed to write a C Code that runs in PS of device.It will do the memory mapping and write my required values to the physical address of DDR.

So Can Anyone tell how it can be done? What is the keyword used to write values to DDR and to do Memory mapping??

Or if Possible can anyone share the C Code for that??

2 Replies
Highlighted
Visitor
Visitor
265 Views
Registered: ‎10-15-2020

In my design, I want to write to DDR and then I want to fetch the data from DDR memory and then pass them to PL to be processed, after that, the data will be written back to DDR memory.

Highlighted
Moderator
Moderator
155 Views
Registered: ‎01-09-2019

Hello @YaduS 

There are plenty of ways to access DDR and you can do so from both the PL and the PS side.  Writing C code would likely be running code within the PS to access either the DDR installed to the PSDDR controller or the PL DDR controller (there are 2 DDR memory devices installed on the ZCU102).

To start you will need to generate a design in Vivado so make sure to do that (you can create a very basic design by selecting Open Example Design... and choosing the ZCU102 board and going through the menu from there.

To your original question, I would take a look at the Zynq MP DRAM Diagnostics tests which will allow you to show reads and writes to DDR in the PS and see Eye diagram results.  I would suggest starting from there to see what that code is doing, and then build up from that point.  I will say that there are a ton of ways to do basic access to memory and it all depends on what you want to do.

I will also point you towards the Zynq Embedded Design Tutorial which could be of high value if you were to go through those steps: https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_1/ug1209-embedded-design-tutorial.pdf

Thanks,
Caleb
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------