how fast is the speed of slavefifo?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 I use the fpga+fx3+slavefifo to test the speed of transfer data to PC.

   

but the speed is 6MB/s,so slow,the firmware is use the SlaveFifoSync.

   

Any problem happened?

   

so there is any solutions to fixed it?

0 Likes
26 Replies
Anonymous
Not applicable

Please look at http://www.cypress.com/?rID=59492
A sync slave FIFO 2bit interface is used for this demonstration. 6MB/s is way too low.
What is the configuration/waveform you're using?

   

Regards,

   

Anand
 

0 Likes
LiMa_282146
Level 4
Level 4
First like given

Hi,

   

In the part of the code that creates a DMA channel change the type of DMA transfer from manual to auto. For example

   

change

   

 apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoPtoU,
            CY_U3P_DMA_TYPE_MANUAL, &dmaCfg);

   

to

   

 apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoPtoU,
            CY_U3P_DMA_TYPE_AUTO, &dmaCfg);

   

I would be interested to know what speed you get.

   

Sodafarl

0 Likes
Anonymous
Not applicable

I have achieved 78 MB/s for a 32 Bit slave fifo loopback configuration using Windows 7 and NEC uPD 720202 host adapter.

   

Still, this is far below the theoretical possible. Has somebody measured more than that and is able to give some hints how to improve the performance? Thanks.

   

-Silvio

0 Likes
Anonymous
Not applicable

I got ~300MB/s from FX3 to PC, with slave fifo, 32 bit, auto-mode, 16 packets per burst and 80 MHz PCLK on an AMD board with on-board NEC controller. Connecting the same hardware to a HP office system with PCIe host controller in a PCIe 1.1 slot, the speed is only ~180MB/s.

0 Likes
Anonymous
Not applicable

 Sodafarl

   
        
   
    thank you for eveything ! now the speed is 36M/s.   
   
        
   
        
   
        
   
        
   
    Chris R.   
   
        
   
    16 packets per burst?    
   
        
   
    I use the PCIe host controller in a PCIe 1.1 slot,but fx3 can not be detected by usb3.0.   
   
        
   
    so the speed is still 36M/s .   
0 Likes
Anonymous
Not applicable

 OK,now the speed is 80M/s.but it dit't stable.sometimes it can be detected as usb3.0 sometimes not. 

0 Likes
Anonymous
Not applicable

Chris, can you please specify the P/N of the AMD board you are using?

   

Does it make a difference if you specify burst length of 16 instead of 1? My PCIe NEC USB host controller doesn't recognise the FX3 anymore if i use burst lenght of 16, while the on-board ASmedia controller does 😞

   

Thanks for letting me know.

   

 

   

-Silvio

0 Likes
Anonymous
Not applicable

You get much more speed if you use the 16 packets per burst instead of one, but you have to set up this correctly in the descriptors, the dma config and so on. The 300MB/s I got on a Gigabyte GA-790FXTA-UD5 board with NEC controller even running Windows XP. I assume the controller is connected via PCIe 2.0 there.

0 Likes
Anonymous
Not applicable

Thanks Chris for detailled info. Now I've tested upstream and downstream bandwidth separately instead of using a loopback configuration. The outcome is that upstream (FX3 to PC) I get about 270 MB/s while donwstream (PC to FX3) only 80 MB/s.

   

What do you measure downstream? And have you tested a loopback configuration as well? Thanks.

   

 

   

-Silvio

0 Likes
LiMa_282146
Level 4
Level 4
First like given

Hi,

   

Chris R what application are you using to measure the bandwidth. Take the point about the burst length being configured correctly as in the descriptor file the burst length value is equal to n + 1 where n is the burst length number so if you want a burst packet length of 4 you set n = 3. However when configuring the endpoints in the main source file the packet burst length is equal to n so if you want 4, n = 4.

   

Sodafarl

0 Likes
Anonymous
Not applicable

I used my own application based on WinUSB Driver. I transferred hundrets of megabytes or even up to two gigabytes in one single blocking WinUSB read request and measured the time using the QueryPerformanceCounter function. WinUSB handles all packaging internally, so you can request every size you want, regardless of the burst settings and other low level stuff.

   

I set up the descriptors to 15 and the endpoint config to 16, the dma transfer size to 16*1024 byte in super speed mode.

0 Likes
Anonymous
Not applicable

What write / downstream performance do you achieve?

0 Likes
Anonymous
Not applicable

The downstream was slower, as far as I remember, I got 120MB/s on PCIe 1.1 and 220MB/s on the AMD board.

0 Likes
LiMa_282146
Level 4
Level 4
First like given

Thanks ChrisR

0 Likes
Anonymous
Not applicable

Hi,

   

Can anybody write in one place what values must be specified in Super Speed descriptor, isochronous endpoint configuration and DMA channel configuration in order to get max data transfer speed using slave FIFO ? Thanks.

   

   

// EP2 isochronous IN

   

0x07,                           // Descriptor size

   

CY_U3P_USB_ENDPNT_DESCR,        // Endpoint Descriptor Type

   

CY_FX_EP2_ISO,            // Endpoint address and description

   

CY_U3P_USB_EP_ISO,              // Iso End point Type

   

0x00,0x04,                      // Max packet size = 1024 bytes

   

0x01,                           // Servicing interval for data transfers

   

 

   

// Super Speed Endpoint Companion Descriptor

   

0x06,                           // Descriptor size

   

CY_U3P_SS_EP_COMPN_DESCR,    // SS Endpoint Companion Descriptor Type

   

0x02,                           // ??? 2+1=3 ??? Max no. of packets in a Burst 

   

0x0F,                           // ??? 15+1=16 ??? Mult.: Max number of packets

   

0x00,0x04                       // Bytes per interval : 1024

   
    ---   
   
        
   
    
      CyU3PMemSet((uint8_t *)&endPointConfig, 0, sizeof(endPointConfig));    
    
         endPointConfig.enable      = 1;    
    
         endPointConfig.epType      = CY_U3P_USB_EP_ISO;    
    
         endPointConfig.isoPkts      = 16; // ????    
    
         endPointConfig.burstLen      = 3; // ????    
    
         endPointConfig.pcktSize      = 1024;    
    
         apiRetStatus = CyU3PSetEpConfig(CY_FX_EP2_ISO, &endPointConfig);    
   
   
    ---   
   
        
   
    
         CyU3PMemSet ((uint8_t *)&dmaConfig, 0, sizeof (dmaConfig));    
    
      dmaConfig.size      = 1024;    
    
      dmaConfig.count      = 2; // ???    
    
      dmaConfig.dmaMode      = CY_U3P_DMA_MODE_BYTE;    
    
     ...    
   
   
    
     ---    
    
      apiRetStatus = CyU3PDmaChannelCreate(&glChFifoPtoU, CY_U3P_DMA_TYPE_AUTO, &dmaConfig);    
   
   
    ---   
   
        
   
        
0 Likes
Anonymous
Not applicable

  // Super Speed Endpoint Companion Descriptor

   

0x06,                           // Descriptor size

   

CY_U3P_SS_EP_COMPN_DESCR,    // SS Endpoint Companion Descriptor Type

   

0x0F,                           // ??? 15+1=16 ??? Max no. of packets in a Burst 

   

0x02,                           // ??? 2+1=3 ??? Mult.: Max number of packets

   

0x00,0x04                       // Bytes per interval : 1024

0 Likes
Anonymous
Not applicable

Endpoint:

   

 

   

epCfg.enable = CyTrue;
epCfg.epType = CY_U3P_USB_EP_BULK;
epCfg.burstLen = CY_FX_SLFIFO_PACKETS_PER_BURST;
epCfg.streams = 0;
epCfg.pcktSize = size;

   

 

   

DMA:

   

 

   

 if(CY_U3P_SUPER_SPEED == usbSpeed)size *= CY_FX_SLFIFO_PACKETS_PER_BURST;
/* Create a DMA MANUAL channel for U2P transfer.
* DMA size is set based on the USB speed. */

   

dmaCfg.size  = size;

   

 

   

Descriptor:

   

 

   

/* Super speed endpoint companion descriptor for producer EP */
    0x06,                           /* Descriptor size */
    CY_U3P_SS_EP_COMPN_DESCR,       /* SS endpoint companion descriptor type */
    CY_FX_SLFIFO_PACKETS_PER_BURST - 1,    /* Max no. of packets in a burst : 0: burst 1 packet at a time */
    0x00,                           /* Max streams for bulk EP = 0 (No streams) */
    0x00,0x00,                      /* Service interval for the EP : 0 for bulk */

   

 

   

And in the header file:

   

 

   

#define    CY_FX_SLFIFO_PACKETS_PER_BURST    (16)                    //SuperSpeed Packets per Burst

0 Likes
Anonymous
Not applicable

     endPointConfig.isoPkts = 3; // ???

   

    endPointConfig.burstLen = 16; // ???

   
        
0 Likes
Anonymous
Not applicable

 dmaConfig.count = 8; // ??? 2, 8 or what ?

0 Likes
Anonymous
Not applicable

isoPkts is only for iso endpoints. DMA buffers is 4 per dma channel at the moment in my design. But you can leave it unchanged at two buffers also.

0 Likes
Anonymous
Not applicable

Thanks for your help Chris. Now I set burst size to 16 for downstream channel and left the upstream channel at 1. Now I get 275 MB/s downstream and 280 MB/s upstream. The Loopback configuration acheives 145 MB/s but the bottleneck may be the DDR memory read and write access from the attached FPGA (data is written to DDR memory and read back).

   

 

   

-Silvio

0 Likes
Anonymous
Not applicable

http://www.cypress.com/?rID=59492

   

I've seen above demo.

   

Could you pls let me have the host pgm source & firmware source & FPGA src ?

   

On my board, the speed is 6MB/s.

   

Thanks

0 Likes
Anonymous
Not applicable

hello

   

if you go on as proposed you'll find yourself in troubles when connecting to usb2.0 (at least we did) . The device will not enumerate. Make sure you check for usb3.0 before setting the burstLen.

   

if(CY_U3P_SUPER_SPEED == usbSpeed) epCfg.burstLen = CY_FX_SLFIFO_PACKETS_PER_BURST;

0 Likes
Anonymous
Not applicable

hi!Vytautas2!

   

u can try this:

   

// Super Speed Endpoint Companion Descriptor

   

0x06,                           // Descriptor size

   

CY_U3P_SS_EP_COMPN_DESCR,    // SS Endpoint Companion Descriptor Type

   

0x0F,                           // ??? 1+15=16 ??? Max no. of packets in a Burst 

   

0x02,                           // ??? 1+2=3 ??? Mult.: Max number of packets

   

0x00,0xC0                      // reserved bandwith,Bytes per interval : 1024*3*16 (max packge counts per interval is 48)

   
    CyU3PMemSet((uint8_t *)&endPointConfig, 0, sizeof(endPointConfig));   
   
        endPointConfig.enable     = 1;   
   
        endPointConfig.epType     = CY_U3P_USB_EP_ISO;   
   
        endPointConfig.isoPkts     = 48; //iso packge counts per service period   
   
        endPointConfig.burstLen     = 16; //max burst size    
   
        endPointConfig.pcktSize     = 1024;   
   

 

   

CyU3PMemSet ((uint8_t *)&dmaConfig, 0, sizeof (dmaConfig));

   
    dmaConfig.size     = 1024*48; //notication:dmaConfig.size*dmaConfig.count <160kB   
   
    dmaConfig.count     = 3; //     
   
    dmaConfig.dmaMode     = CY_U3P_DMA_MODE_BYTE;   
   
        
   
    I think it can work normally   
0 Likes
Anonymous
Not applicable

 I tested the speed using  fpga+slavefifo+FX3   bulk ep , the speed is 350MB/S when the max burst size is 16 and using DMA AUTO,  I tested it using streamer of  cypress superspeed USBSuite, next time I wanna test it using ISO ep.

0 Likes
Anonymous
Not applicable

I tried the ISO using ep 3 or  7 ,and I referring to what u told ,but it failed ,it cannot transfer data successfully,someone can upload ur Firmware src codes of  USBIsoSourceSink?Thx!

0 Likes