Cyclone V SoC の HPS 内蔵 DMAC を利用しています。DMA 転送の転送完了イベントを有効にして実行したところ、DONE 割り込みが転送完了前に発生してしまうのですが、対策方法はありますか?
デバイス : Cyclone V
カテゴリ : SoC
DMAC 用のマイクロコードをプログラムする際に、完了イベント発行 (DMASEV) の前に、書込み用のメモリバリアー命令 (DMAWMB) を実行することで対策してください。
ARM のドキュメンにも、同対策方法が記載されています。
http://infocenter.arm.com/help/topic/com.arm.doc.ddi0424d/DDI0424D_dma330_r1p2_trm.pdf ※ 「Using events and interrupts」を参照してください。
---------------------------------------------------------------------------------------------
If you use the DMASEV instruction to notify a microprocessor when the DMAC completes a DMALD or DMAST instruction then ARM recommends that you insert a memory barrier instruction before the DMASEV.
Otherwise the DMAC might signal an interrupt before the AXI transfers complete.
---------------------------------------------------------------------------------------------