Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

need help on dma

Altera_Forum
Honored Contributor II
1,089 Views

I have a custom logic wrote by myself. There's a DCFIFO in the logic. And when the fifo is full, NIOS II cpu will get an interrupt, then cpu will get(read) data out of the fifo. Every thing seems all right. 

 

But when i use DMA to do the same thing as cpu does, I just can't get right data. The avalon mm slave interface of my custom logic is below. Could anybody give me someadvice? 

 

 

 

 

rdclk <= csi_clk; --rdclk is the read clock of the dcfifo process(csi_reset, csi_clk) begin if csi_reset = '1' then rdreq <= '0'; else if falling_edge(csi_clk) then if avs_read = '1' and avs_address = "001" then rdreq <= '1'; --rdreq is read request of dcfifo else rdreq <= '0'; end if; end if; end process; process(csi_reset, csi_clk) begin if csi_reset= '1' then avs_readdata <= (others=>'0'); else if rising_edge(csi_clk) then if (avs_read = '1' and avs_chipselect = '1') then if avs_address = "001" then avs_readdata <= q; --q is output of dcfifo end if end if; end if; end if; end process;
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
407 Views

Don't use the falling edge, do everything on the rising edge. 

You may want to configure your FIFO in showahead mode or add an extra read cycle on your Avalon interface. 

It could be a god idea to use a tool such as SignalTap to see what is happening on your Avalon slave interface.
0 Kudos
Reply