cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
818 Views
Registered: ‎01-20-2017

Using VDMA to write 3 still images and then view - fails to write to one frame

Jump to solution

I'm using Vivado 2017.4 with a Kintex 7 FPGA.  I have a VDMA block hooked up to a MIG that interfaces with external DDR3 memory.  My VDMA block is connected and configured as follows:VDMA_connections.PNG

 

vdma_pg_setup.PNG

 

vdma_pg2_setup.PNG

 

 

I use a custom core to send data to and read data from the memory via the VDMA streams.

I'm trying to write three simple test patterns to memory and then read them back.  During each 'write', I do the following:

1. I unpark the write (S2MM channel)

2. I then park the channel on a particular frame (using the PARK_PTR_REG)

3. I trigger the write of data to memory using a push-button on my PCB

====> And then I repeat this 2 more times

My problem is that when I do this one of the three frames does not receive the test pattern data correctly.  I think it has something to do with the read channel interfering with the writes but I have tried different techniques such as:

a) NOT starting the VDMA read channel until after the writes are complete.

b) Parking the read channel on an adjacent frame before each write is performed

c) Trying to 'stop' the read channel during writes (bit 0 of the control registers) and then restarting it after.

However, none of these techniques seems to work.

Can anyone tell me what I might be doing wrong?

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
712 Views
Registered: ‎10-04-2017

Re: Using VDMA to write 3 still images and then view - fails to write to one frame

Jump to solution

Hi @efpkopin,

 

If you are only moving still images, I would suggest using a regular DMA. This way you don't have to deal with the overhead of starting and stopping the VDMA or synchronization/master/slave settings. 

*You are correct, the VDMA was written to deal with free-flowing video and not for single images. 

 

Don't forget to reply, kudo, and accept as solution.

Xilinx Video Design Hub

View solution in original post

6 Replies
Highlighted
Moderator
Moderator
750 Views
Registered: ‎10-04-2017

Re: Using VDMA to write 3 still images and then view - fails to write to one frame

Jump to solution

Hi @efpkopin,

We have several VDMA examples, but I think going through our tutorials may be helpful for you.

 

Video Series 24: Using the AXI VDMA in Triple Buffer Mode

Video Series 25: Debugging issues on the AXI VDMA IP

Video Series 26: Examples of advanced uses of the AXI VDMA IP

Also, take a look at PG71 general use cases.


If you are still having issues, please include a diagram of your Video Pipe. Video source-> VDMA1? -> Memory-> VDMA2? ->Somewhere -> VDMA3? Back to mem?
Also include your test points, where in the pipe you are verifying the data, and where you see the problem introduced. VDMA1? VDMA2? VDMA3?

Thanks and regards

 

Don't forget to reply, kudo, and accept as solution.

Xilinx Video Design Hub
0 Kudos
Highlighted
Moderator
Moderator
748 Views
Registered: ‎11-09-2015

Re: Using VDMA to write 3 still images and then view - fails to write to one frame

Jump to solution

HI @efpkopin 

Just look at you genlock configuration. As both sides are master you are basically letting them do whatever you want. So you are not protecting a frame buffer to be read while it is written into.

You have to have one side as master and one side as slave.

You might want to read the Genlock Synchronization of the PG020. Unfortunatly I did not have time to write a Video Series Article to explain this.

Regards


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Adventurer
Adventurer
722 Views
Registered: ‎01-20-2017

Re: Using VDMA to write 3 still images and then view - fails to write to one frame

Jump to solution

@florentw, thanks for the response.  I did read the Genlock Synchronization section.  I think my situation is different than most others where video is free-flowing.  I simply want to write still images to memory and then display them later on, one at a time.  So really I don't want any synchronization between the writes and reads ... or, said another way: I was planning to control the synchronization by, e.g. parking the read channel, writing my sample images, then parking the write channel and adjusting the "read channel park frame number" to display each image.  In this case, I think setting both GenLock Modes to Master is the right thing to do.  Do you agree?

0 Kudos
Highlighted
Moderator
Moderator
713 Views
Registered: ‎10-04-2017

Re: Using VDMA to write 3 still images and then view - fails to write to one frame

Jump to solution

Hi @efpkopin,

 

If you are only moving still images, I would suggest using a regular DMA. This way you don't have to deal with the overhead of starting and stopping the VDMA or synchronization/master/slave settings. 

*You are correct, the VDMA was written to deal with free-flowing video and not for single images. 

 

Don't forget to reply, kudo, and accept as solution.

Xilinx Video Design Hub

View solution in original post

Highlighted
Moderator
Moderator
604 Views
Registered: ‎11-09-2015

Re: Using VDMA to write 3 still images and then view - fails to write to one frame

Jump to solution

@efpkopin wrote:

@florentw, thanks for the response.  I did read the Genlock Synchronization section.  I think my situation is different than most others where video is free-flowing.  I simply want to write still images to memory and then display them later on, one at a time.  So really I don't want any synchronization between the writes and reads ... or, said another way: I was planning to control the synchronization by, e.g. parking the read channel, writing my sample images, then parking the write channel and adjusting the "read channel park frame number" to display each image.  In this case, I think setting both GenLock Modes to Master is the right thing to do.  Do you agree?


Well, it might work to have both side set with Master but you need to make sure the SW prevents the read and write operation to happen on the same frame buffer. So you would need to run the write operation for 1 frame then wait for the interrupt then you can move to the next frame buffer for the write and read in the first one for one frame.

You need to make sure the VDMA is not in free-running mode, else this is not gonna work


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Highlighted
Adventurer
Adventurer
576 Views
Registered: ‎01-20-2017

Re: Using VDMA to write 3 still images and then view - fails to write to one frame

Jump to solution

@Anonymous, I half agree with you. I think the proper thing to do in my case is use both a DMA and a VDMA. The DMA can be used as a write-only (S2MM) interface, so I can write the data values into memory. However the VDMA in read-only mode is best for sending the images to an output display, where I do want to park on a frame and then repeatedly cycle on that image. My only problem is I'm having trouble getting the DMA to respond - but I'll make that the topic of a separate question. Thanks for the help.