2 Replies Latest reply on Nov 3, 2014 9:41 AM by tt.sun

    DMA Data Output Slow Help

    tt.sun

      I am trying to use the CyU3PDmaChannelGetBuffer and CyU3PDmaChannelCommitBuffer API to sent the data from CPU to GPIF bus manually and found it is not fast enough.

         

      I have also used a scope to trace  the output data.  I found that it takes 70-80 μs to complete.

         

      Is there a way to further reduce the running time to less than 30μs of this application like using low level DMA API?

         

      Thanks

         

      status=CyU3PDmaChannelGetBuffer(&AppDmaFpgaRegAccessManualOutHandle,&FpgaHostManualOutBuf_p, CYU3P_NO_WAIT);

         

      if (status != CY_U3P_SUCCESS)

         

      {

         

      return status;

         

      }

         

      //popular the Buffer of Register Read Address

         

      FpgaHostManualOutBuf_p.buffer[0]=(FpgaHostRegAddress&0x000000FF)>>0; /*Reg Read Address*/

         

      FpgaHostManualOutBuf_p.buffer[1]=(FpgaHostRegAddress&0x0000FF00)>>8; /*Reg Read Address*/

         

      FpgaHostManualOutBuf_p.buffer[2]=(FpgaHostRegAddress&0x00FF0000)>>16; /*Reg Read Address*/

         

      FpgaHostManualOutBuf_p.buffer[3]=(FpgaHostRegAddress&0xFF000000)>>24; /*Reg Read Address*/

         

      FpgaHostManualOutBuf_p.count=4;             /**< Byte count of valid data in buffer. */

         

      FpgaHostManualOutBuf_p.size=32;             /**< Actual size of the buffer in bytes. Should be a multiple of 16. */

         

      FpgaHostManualOutBuf_p.status=0;           

         


         

      status = CyU3PDmaChannelCommitBuffer (&AppDmaFpgaRegAccessManualOutHandle,FpgaHostManualOutBuf_p.count,0);

         

      if (status != CY_U3P_SUCCESS)

         

      {

         

      return status;

         

      }

         


         

      //get fpga register value;

         

      status = CyU3PGpifReadDataWords (1, CyFalse, 1, RegRrData_p, 0xF0000000);

         

      if (status != CY_U3P_SUCCESS)

         

      {

         

      return status;

         

      }

        • 1. Re: DMA Data Output Slow Help
          ki.leung

          If the count, size and status are all fixed, you can assign that first, and also use pointer to copy the content to your buffer

             
               **   
             
               uchar* ucptTemp;   
             
                  
             
               FpgaHostManualOutBuf_p.count=4;                
             
               FpgaHostManualOutBuf_p.size=32;   
             
               FpgaHostManualOutBuf_p.status=0;       
             
               ucptTemp = FpgaHostManualOutBuf_p.buffer;   
             
                  
             
               status=CyU3PDmaChannelGetBuffer(&AppDmaFpgaRegAccessManualOutHandle,&FpgaHostManualOutBuf_p, CYU3P_NO_WAIT);   
             
               if (status != CY_U3P_SUCCESS)   
             
               {   
             
                         return status;   
             
               }   
             
                  
             
               *ucptTemp++ = FpgaHostRegAddress;   
             
               FpgaHostRegAddress >>= 8;   
             
               *ucptTemp++ = FpgaHostRegAddress;   
             
               FpgaHostRegAddress >>= 8;   
             
               *ucptTemp++ = FpgaHostRegAddress;   
             
               FpgaHostRegAddress >>= 8;   
             
               *ucptTemp = FpgaHostRegAddress;   
             
                  
             
               status = CyU3PDmaChannelCommitBuffer (&AppDmaFpgaRegAccessManualOutHandle,FpgaHostManualOutBuf_p.count,0);   
             
               if (status != CY_U3P_SUCCESS)   
             
               {   
             
                         return status;   
             
               }   
             

          Hope this helps.

          • 2. Re: DMA Data Output Slow Help
            tt.sun

             Thank you H L,But the run time still not meet the requirements.

               

            The Code Disassembly display that the Cypress high level DMA API took most of the time.

               

            I need to continue find other solutions.

               

            Thank you all the same