cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Pmn
Visitor
Visitor
555 Views
Registered: ‎02-05-2021

Zynq, Access PS DDR

Jump to solution

Hello all,

I am almost beginner with Zynq (I am using zcu102).

I have a basic question.

I used DMA and created a custom IP to write some data  from PL into the PS DDR (through HPC port).

Now I simply want to read the data already written into the PS DDR through the processor and send it back to PC using UART.

But I do not know how I can read data from PS DDR.

Is there any way that the processor can access DDR directly (only by addressing)?

If not, what is the standard way?

Could some one please  let me know what  the standard way of accessing PS DDR through the processor is?

 

Thakn you in avance

 

0 Kudos
1 Solution

Accepted Solutions
Nikhil_Thapa
Explorer
Explorer
407 Views
Registered: ‎05-28-2020

@Pmn ,

1. Do you have any suggestion how I should test the data written into DDR?

reading DDR or other options such as ILA?

Yes, you can also use ILA. But, to read the DDR content particularly, use XSCT commands. 

For example, if you want to read the memory content at location 0x81000000, then you will have to enter mrd 0x81000000.

For more other details, visit UG1208Chapter 3, Target Memory.

 

2. I wanted already to use Xil_In32 function to read memory. However, the problem was that I could not find the list of DDR addresses in Vitis (xparameters.c).

Do you know by chance which parameters listed in xparameters.c show addresses of DDR to be accessed?

No, you cannot find any list of addresses. If you looked carefully, you will get base address high address of PS DDR. Within these addresses, the data are actually read/written.

Nikhil_Thapa_0-1617546711268.png

Now the thing is, you have to find the address value, you specified in the DMA configuration code in SDK/Vitis. Actually, that address is the beginning address from where DMA starts writing the data onwards.

 

Thanks and Regards,

 

View solution in original post

8 Replies
Rmccarty
Adventurer
Adventurer
536 Views
Registered: ‎09-05-2020

C? Use a pointer. You need to also take care of cache coherency as well. If the data size isn't too large you can use ocm instead of ddr or the acp port can write directly into the L2(?) Cache.

0 Kudos
Nikhil_Thapa
Explorer
Explorer
481 Views
Registered: ‎05-28-2020

Hi @Pmn ,

I used DMA and created a custom IP to write some data  from PL into the PS DDR (through HPC port).

I firstly recommend you to check that the data is successfully written into DDR memory or not.

To read the DDR memory content from SDK/Vitis, you can use XSCT Console, where you have to enter the memory read command.

Is there any way that the processor can access DDR directly (only by addressing)?

Yes.

You can use Xil_In32() function to directly read the data from the given memory location. You can also use memory function, like, memcpy(). To use this function, you have to care about Data Cache.

 

Thanks and Regards,

Pmn
Visitor
Visitor
472 Views
Registered: ‎02-05-2021

Hi @Nikhil_Thapa 

thank you very much for your help.

 

1. Do you have any suggestion how I should test the data written into DDR?

reading DDR or other options such as ILA?

 

2. I wanted already to use Xil_In32 function to read memory. However, the problem was that I could not find the list of DDR addresses in Vitis (xparameters.c).

Do you know by chance which parameters listed in xparameters.c show addresses of DDR to be accessed?

 

thank you

0 Kudos
Pmn
Visitor
Visitor
470 Views
Registered: ‎02-05-2021

Hi @Rmccarty 

 

thank you for your answer,

  • could you please let me know what you mean from “take caring of cache coherency” And also pointer?

I did not get what you mean.

 

0 Kudos
Rmccarty
Adventurer
Adventurer
442 Views
Registered: ‎09-05-2020

How is the DMA working if you don't know the address?

Pointers are really basic C. I suggest you take a few steps back and learn some C as well as the basics of ARM core architecture.

0 Kudos
Nikhil_Thapa
Explorer
Explorer
408 Views
Registered: ‎05-28-2020

@Pmn ,

1. Do you have any suggestion how I should test the data written into DDR?

reading DDR or other options such as ILA?

Yes, you can also use ILA. But, to read the DDR content particularly, use XSCT commands. 

For example, if you want to read the memory content at location 0x81000000, then you will have to enter mrd 0x81000000.

For more other details, visit UG1208Chapter 3, Target Memory.

 

2. I wanted already to use Xil_In32 function to read memory. However, the problem was that I could not find the list of DDR addresses in Vitis (xparameters.c).

Do you know by chance which parameters listed in xparameters.c show addresses of DDR to be accessed?

No, you cannot find any list of addresses. If you looked carefully, you will get base address high address of PS DDR. Within these addresses, the data are actually read/written.

Nikhil_Thapa_0-1617546711268.png

Now the thing is, you have to find the address value, you specified in the DMA configuration code in SDK/Vitis. Actually, that address is the beginning address from where DMA starts writing the data onwards.

 

Thanks and Regards,

 

View solution in original post

Pmn
Visitor
Visitor
359 Views
Registered: ‎02-05-2021

Thank you very much @Nikhil_Thapa 

Great!

It is very helpful

Regards

0 Kudos
Nikhil_Thapa
Explorer
Explorer
274 Views
Registered: ‎05-28-2020

Hi @Pmn ,

It's great hearing from you.

If you think your problem/issue is solved, you can close the thread by "Accept as Solution".

 

Regards

0 Kudos