cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
1,597 Views
Registered: ‎10-05-2010

How Do I use the VDMA IRQDelayCount?

Jump to solution

I have a design that will buffer more than 32 video images, so I'd like to try to reprogram the VDMA S2MM for every image. According the pg020, as soon as the VDMA starts to write an image, I can reprogram the starting address and vsize for the next image. I'm not exactly sure how to know when that time is; I think that the IRQDelayCount might be the way to go, but the description seems awful vague to me. The counter begins counting when it receives frame sync, and resets with the subsequent s_axis_s2mm_tvalid. There is no mention of what we are counting - is it just clocks after fsync?

 

What I am hoping is that after fsync, it counts out IRQDelayCount clocks, then fires the interrupt. However, I never see an interrupt, so I think that I'm doing something wrong.

 

My S2MM CR value is 0x08002001 - IRQDelayCount 8, Delay count enabled. The S2MM is synchronized to tuser[0]. I know that the interrupt output and S2MM are connected because I  get transfer errors if I misprogram the registers.

 

Will IRQDelayCount generate the interrupt that I need, and if so, how do I get it to work?

 

---

Joe Samson

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
1,875 Views
Registered: ‎08-02-2011

Another thought that you could do: take tvalid && tready && tuser directly to the interrupt controller.

www.xilinx.com

View solution in original post

0 Kudos
9 Replies
Highlighted
Explorer
Explorer
1,539 Views
Registered: ‎10-05-2010

Mods,

  There must be someone at Xilinx that understands how the VDMA works!

 

 

---

Joe

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
1,525 Views
Registered: ‎08-02-2011

Hi Joe,

 

I don't think the DlyCnt_IRQ is useful in 'fsync on tuser mode' because fsync event happens when tvalid=1 and tuser=1. So it resets immediately.

 

I would just use the FrmCnt_Irq (of course, set it up to issue an interrupt every frame).

 

In 'fsync on tuser mode,' FrmCnt_IRQ interrupts happen on tuser. By the time you service the interrupt, the VDMA will be happily transferring the current frame and you have the entire frame period for the software to calculate and re-configure for the next frame.

www.xilinx.com
Highlighted
Explorer
Explorer
1,518 Views
Registered: ‎10-05-2010

Can I use the frame count interrupt without setting frame count enable? When frame count enable is set, the transfer ends when the frame counter reaches 0.

 

From PG020:

" (FrameCntEn) Configures the S2MM channel to allow only IRQFrameCount number of transfers to occur. After the IRQFrameCount frames are completely transferred, the S2MM channel halts, DMACR.RS bit is deasserted, and the DMASR.Halted asserts when the channel has completely halted."

 

---

Joe

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
1,503 Views
Registered: ‎08-02-2011

You should be able to set FrmCnt_IrqEn separately from FrmCntEn:

 

forum.PNG

www.xilinx.com
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
1,876 Views
Registered: ‎08-02-2011

Another thought that you could do: take tvalid && tready && tuser directly to the interrupt controller.

www.xilinx.com

View solution in original post

0 Kudos
Highlighted
Explorer
Explorer
1,491 Views
Registered: ‎10-05-2010

Thanks for all the suggestions. I will go back to look at the frame count interrupt without the halt. My original plan was to halt at the end of every image, then reprogram and restart before the next image started. But reading PG020, I saw that the VDMA could be reprogrammed as soon as it began processing the current image; that is a great feature!

When I was using the frame count interrupt with halt, the interrupt didn't occur until the fsync of the next image. Too late to reprogram for the second image.

I had considered using tuser[0] directly, but I assume that there is some latency between when tuser  && tvalid && tready is asserted and when the VDMA actually starts a cycle and is OK for reprogramming. It would be just my luck that I'd occasionally start programming at the wrong time.

My twist on your suggestion is to use the fsync_out signal. I use it to set a flip-flop which is monitored by a microBlaze through a GPIO. When the signal goes high, the microblaze reprograms the VDMA and uses a GPIO output bit to clear the signal. That whole transaction takes a little over one image line of time. Once I work out the kinks I can convert to being interrupt driven and try out the AXI interrupt controller.

However, if I can just work with the interrupt features of the VDMA, I'd prefer that.

I'll mark your last suggestion as the acceptable solution to close this case.

---

Joe

Tags (1)
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
1,486 Views
Registered: ‎08-02-2011

Okay, that sounds good. Let me know if you run into any other issues.

 

Right, many of our video IP take care to double-buffer config registers that would have detrimental effects if changed in the middle of the frame. They commit the new settings only on frame boundaries.

 

Yeah exactly. It's a little quirk of the VDMA that the interrupt happens on fsync event which is often start of frame instead of at the end of the frame (there's an AR on it somewhere). So that wouldn't work if you're parking the VDMA between frames.

 

I had considered using tuser[0] directly, but I assume that there is some latency between when tuser  
&& tvalid && tready is asserted and when the VDMA actually starts a cycle and is OK for reprogramming.

When using 'fsync on tuser mode,' the registers should be committed exactly when tuser && tvalid && tready == 1 so I wouldn't expect there to be a possibility of issue here.

www.xilinx.com
0 Kudos
Highlighted
Observer
Observer
1,331 Views
Registered: ‎03-22-2018

I'm also not clear on the use and behavior of the vdma IRQDelayCount. As Jospeh asked above, what is being counted?

Is it counting clocks? pixels? lines? frames? Or something else? What is the intended use?

 

Thanks,

John

0 Kudos
Highlighted
Observer
Observer
214 Views
Registered: ‎07-25-2010

"DlyCnt_IRQ is not useful in 'fsync on tuser mode' " , infomation lile this is strongly recommended to explicitly added in pg020.....

The time the intrp go out is a little bit vague.... in pg020. We took a lot to debug .

Tags (1)
0 Kudos