cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
9,521 Views
Registered: ‎03-21-2016

How to write data to BRAM from PL?

Hello,

 

I would like to transfer data (parts of video stream) from PL to PS. I thought that the best way would be using BRAM. I'd like to write data to BRAM from PL, than call inteerrupt (PL-PS) and read data with PS from BRAM. 

 

Could anyone help me to design it? I (think I) know how do read data from BRAM uisng PS, but I do not know how to access BRAM using PL. Any help would be appreciated! :)

 

Thank you!

Tags (3)
0 Kudos
4 Replies
Highlighted
Teacher
Teacher
9,484 Views
Registered: ‎03-31-2012

actually you can read/write a bram only from PL and you need extra provisions to get PS to read/write to it. In Zynq, if video data arrives through the PL pins, the easiest thing to do would be to write it to the DRAM directly; although that has its own problems related to caching.
- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
Highlighted
Newbie
Newbie
7,091 Views
Registered: ‎05-30-2016

Hi, did you find a solution to write in bram from pl?
I can see only zeros!

Thanks
Marina

0 Kudos
Highlighted
Visitor
Visitor
7,046 Views
Registered: ‎03-21-2016

Yes.

 

Here you have tutorials how to transfer data between PL and PS by AXI (and how to use BRAM Controller with PS):

https://www.youtube.com/watch?v=meQcwzC4Vtk&list=PL4D6H9w4Ihdp0YRExoQXfbVMRL1GgEPCm&index=6

https://www.youtube.com/watch?v=Vs0h0kue7p4&list=PL4D6H9w4Ihdp0YRExoQXfbVMRL1GgEPCm&index=7

 

For bigger amount of data I use BRAM Controller.

 

Firstly I write data from PL to BRAM, then I call interrupt in PS and later I read data from BRAM in PS, and clear inetrrupt.

 

 

0 Kudos
Highlighted
Newbie
Newbie
200 Views
Registered: ‎07-24-2017

I suggest you use a true dual-port BRAM, one port to be accessed by the PS using AXI BRAM Controller, the other accessed by a simple state machine in your PL. writing procedure to a BRAM is simple since you are only using the port for writing. consequently, it's enough to set write enable and BRAM enable pins of your port to the constant value '1'. in this case, by each address and data your state machine provides to the port of your Bram, a write operation to that address will be performed.

as you mentioned, your state machine can generate an interrupt to your PS subsystem when the writing operations to the Bram are complete and after that, your PS can respond to the received interrupt by reading the values from Bram using xil_in function 

Tags (1)
0 Kudos