Forum Discussion
Altera_Forum
Honored Contributor
21 years agoHow to use the Nios DMA?
Hi, in order to improve the performance, I hope use the Nios DMA (Not Nios II) module to increase the transfer speed. But now I don't know how to use it. I simply use its subroutine on my origina...
Altera_Forum
Honored Contributor
21 years agoHere is soft for using DMA on NIOS2
void memcpy_my(int *where,int * from,int howmurch) { while ((IORD_ALTERA_AVALON_DMA_STATUS(WR_DMA_BASE) & ALTERA_AVALON_DMA_STATUS_BUSY_MSK)); IOWR_ALTERA_AVALON_DMA_CONTROL(WR_DMA_BASE,0); IOWR_ALTERA_AVALON_DMA_STATUS(WR_DMA_BASE, 0); IOWR_ALTERA_AVALON_DMA_LENGTH(WR_DMA_BASE, howmurch); IOWR_ALTERA_AVALON_DMA_RADDRESS(WR_DMA_BASE, from); IOWR_ALTERA_AVALON_DMA_WADDRESS(WR_DMA_BASE, where); IOWR_ALTERA_AVALON_DMA_CONTROL(WR_DMA_BASE,ALTERA_AVALON_DMA_CONTROL_GO_MSK | ALTERA_AVALON_DMA_CONTROL_BYTE_MSK| ALTERA_AVALON_DMA_CONTROL_WEEN_MSK| ALTERA_AVALON_DMA_CONTROL_LEEN_MSK); while ((IORD_ALTERA_AVALON_DMA_STATUS(WR_DMA_BASE) & ALTERA_AVALON_DMA_STATUS_BUSY_MSK));# ifdef DEBUG printf("\nDMA packet\nfrom 0x%x\nwhere - 0x%x\nhowmurch - %d",from,where,howmurch); short status=0;# endif }