increased MPSSE buffer size from 4k to 64k

mitigates performance decrease for mid-sized clock operations


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1411 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 16 years ago
parent 0fbdfba97b
commit d8ec16d65e

@ -1,3 +1,10 @@
2008-12-22 Arnim Laeuger <arniml@users.sourceforge.net>
* src/tap/usbconn/libftdi.c, src/tap/usbconn/libftd2xx.c,
include/usbconn/libftdx.h, src/tap/cable/ft2232.c:
increased MPSSE buffer size from 4k to 64k
mitigates performance decrease for mid-sized clock operations
2008-12-21 Kolja Waschk <kawk>
* src/svf/svf.c: Fix 2456021 - SVF compare_tdo flaw

@ -24,6 +24,7 @@
#define _USBCONN_LIBFTDX_H 1
#define FTDX_MAXSEND 4096
#define FTDX_MAXSEND_MPSSE (64 * 1024)
/* Maximum chunk to receive from ftdi/ftd2xx driver.
Larger values might speed up comm, but there's an upper limit

@ -931,8 +931,11 @@ ft2232_clock_schedule( cable_t *cable, int tms, int tdi, int n )
cx_cmd_queue( cmd_root, 0 );
while (n > 0)
{
if (cx_cmd_space( cmd_root, 4096 ) < 3)
if (cx_cmd_space( cmd_root, FTDX_MAXSEND_MPSSE ) < 4)
{
/* no space left for Clock Data plus Send Immediate
transfer queued commands to device and read receive data
to internal buffer */
cx_xfer( cmd_root, &imm_cmd, cable, COMPLETELY );
cx_cmd_queue( cmd_root, 0 );
}
@ -1054,6 +1057,10 @@ ft2232_transfer_schedule( cable_t *cable, int len, char *in, char *out )
/* reduce chunkbytes to the maximum amount we can receive in one step */
if (out && chunkbytes > FTDX_MAXRECV)
chunkbytes = FTDX_MAXRECV;
/* reduce chunkbytes to the maximum amount that fits into one buffer
for performance reasons */
if (chunkbytes > FTDX_MAXSEND_MPSSE - 4)
chunkbytes = FTDX_MAXSEND_MPSSE - 4;
/* restrict chunkbytes to the maximum amount that can be transferred
for one single operation */
if (chunkbytes > (1 << 16))

@ -432,6 +432,9 @@ usbconn_ftd2xx_mpsse_open( usbconn_t *conn )
if (status == FT_OK) if ((status = FT_Purge( fc, FT_PURGE_RX )) != FT_OK)
printf( _("%s(): Can't purge RX buffer.\n"), __FUNCTION__ );
if (status == FT_OK) if ((status = FT_SetUSBParameters( fc, FTDX_MAXSEND_MPSSE, FTDX_MAXSEND_MPSSE )) != FT_OK)
printf( _("%s(): Can't set USB parameters.\n"), __FUNCTION__ );
if (status == FT_OK) if ((status = FT_SetChars( fc, 0, 0, 0, 0 )) != FT_OK)
printf( _("%s(): Can't set special characters.\n"), __FUNCTION__ );

@ -461,6 +461,11 @@ usbconn_ftdi_mpsse_open( usbconn_t *conn )
r = seq_reset( fc );
if (r >= 0) r = seq_purge( fc, 1, 0 );
if (r >= 0) if ((r = ftdi_write_data_set_chunksize( fc, FTDX_MAXSEND_MPSSE )) < 0)
puts( ftdi_get_error_string( fc ) );
if (r >= 0) if ((r = ftdi_read_data_set_chunksize( fc, FTDX_MAXSEND_MPSSE )) < 0)
puts( ftdi_get_error_string( fc ) );
#ifdef LIBFTDI_UNIMPLEMENTED
if (r >= 0) if ((r = ftdi_set_event_char( fc, 0, 0 )) < 0)
puts( ftdi_get_error_string( fc ) );

Loading…
Cancel
Save