Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > how fast is the speed of slavefifo?

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



how fast is the speed of slavefifo?
Moderator:
RSKV

Post Reply
Follow this topic



how fast is the speed of slavefifo?

jogn_li posted on 21 Feb 2012 10:51 PM PST
Top Contributor
49 Forum Posts

 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?




Re: how fast is the speed of slavefifo?

aasi posted on 21 Feb 2012 01:30 AM PST
Cypress Employee
1073 Forum Posts

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
 



Re: how fast is the speed of slavefifo?

sodafarl posted on 21 Feb 2012 01:37 AM PST
Top Contributor
128 Forum Posts

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



Re: how fast is the speed of slavefifo?

Sil posted on 21 Feb 2012 08:45 AM PST
Top Contributor
93 Forum Posts

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



Re: how fast is the speed of slavefifo?

Chris R. posted on 21 Feb 2012 12:23 PM PST
Top Contributor
135 Forum Posts

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.



Re: how fast is the speed of slavefifo?

jogn_li posted on 21 Feb 2012 06:50 PM PST
Top Contributor
49 Forum Posts

 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 .


Re: how fast is the speed of slavefifo?

jogn_li posted on 21 Feb 2012 07:43 PM PST
Top Contributor
49 Forum Posts

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



Re: how fast is the speed of slavefifo?

Sil posted on 22 Feb 2012 11:02 PM PST
Top Contributor
93 Forum Posts

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



Re: how fast is the speed of slavefifo?

Chris R. posted on 22 Feb 2012 11:12 PM PST
Top Contributor
135 Forum Posts

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.



Re: how fast is the speed of slavefifo?

Sil posted on 22 Feb 2012 01:20 AM PST
Top Contributor
93 Forum Posts

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



Re: how fast is the speed of slavefifo?

sodafarl posted on 22 Feb 2012 01:36 AM PST
Top Contributor
128 Forum Posts

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

 



Re: how fast is the speed of slavefifo?

Chris R. posted on 22 Feb 2012 03:03 AM PST
Top Contributor
135 Forum Posts

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.



Re: how fast is the speed of slavefifo?

Sil posted on 22 Feb 2012 03:09 AM PST
Top Contributor
93 Forum Posts

What write / downstream performance do you achieve?



Re: how fast is the speed of slavefifo?

Chris R. posted on 22 Feb 2012 03:26 AM PST
Top Contributor
135 Forum Posts

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



Re: how fast is the speed of slavefifo?

sodafarl posted on 22 Feb 2012 03:50 AM PST
Top Contributor
128 Forum Posts

Thanks ChrisR



Re: how fast is the speed of slavefifo?

Vytautas2 posted on 22 Feb 2012 04:46 AM PST
Top Contributor
36 Forum Posts

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);
---
 
 



Re: how fast is the speed of slavefifo?

Vytautas2 posted on 22 Feb 2012 04:52 AM PST
Top Contributor
36 Forum Posts

  // 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

 



Re: how fast is the speed of slavefifo?

Chris R. posted on 22 Feb 2012 05:12 AM PST
Top Contributor
135 Forum Posts

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



Re: how fast is the speed of slavefifo?

Vytautas2 posted on 22 Feb 2012 05:23 AM PST
Top Contributor
36 Forum Posts

     endPointConfig.isoPkts = 3; // ???

    endPointConfig.burstLen = 16; // ???

 


Re: how fast is the speed of slavefifo?

Vytautas2 posted on 22 Feb 2012 05:29 AM PST
Top Contributor
36 Forum Posts

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



Re: how fast is the speed of slavefifo?

Chris R. posted on 22 Feb 2012 05:35 AM PST
Top Contributor
135 Forum Posts

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.



Re: how fast is the speed of slavefifo?

Sil posted on 22 Feb 2012 08:33 AM PST
Top Contributor
93 Forum Posts

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



Re: how fast is the speed of slavefifo?

dopak posted on 10 May 2012 02:42 AM PST
Member
7 Forum Posts

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



Re: how fast is the speed of slavefifo?

ProHerz posted on 15 May 2012 01:58 AM PST
Member
8 Forum Posts

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;

 



Re: how fast is the speed of slavefifo?

wqyao posted on 18 May 2012 01:59 AM PST
Member
9 Forum Posts

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


Re: how fast is the speed of slavefifo?

wqyao posted on 18 May 2012 02:06 AM PST
Member
9 Forum Posts

 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.



Re: how fast is the speed of slavefifo?

wqyao posted on 22 May 2012 09:02 PM PST
Member
9 Forum Posts

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!






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.