Enabled new^2 implementation in tap_shift_register for [ 1832990 ] Speed improvements for USB cables

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1014 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Kolja Waschk 17 years ago
parent 1ab5f44f68
commit 96147a19fb

@ -1,4 +1,9 @@
008-02-14 Jie Zhang <jie.zhang@analog.com>
2008-02-14 Kolja Waschk <kawk>
* src/tap/chain.c: Enabled the new^2 implementation in tap_shift_register
(which was implemented 2008-02-03 but not proven (now it is...))
2008-02-14 Jie Zhang <jie.zhang@analog.com>
* src/bus/bf537_stamp.c: New.
* src/bus/bf548_ezkit.c: New.

@ -169,58 +169,7 @@ chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture
if (capture)
tap_capture_dr( chain );
#if 1
/* old implementation:
shift the data register of each part in the chain one by one */
for (i = 0; i < ps->len; i++) {
puts("tap_shift_register");
tap_shift_register( chain, ps->parts[i]->active_instruction->data_register->in,
capture_output ? ps->parts[i]->active_instruction->data_register->out : NULL,
(i + 1) == ps->len ? exit : EXITMODE_SHIFT );
}
#elif 1
{
/* new implementation:
combine the data registers of all parts in the chain into one temporary register,
shift once,
copy back the "out" data to the data registers of all parts */
int total_length = 0;
data_register *temp_reg;
char *part_str, *temp_str;
/* determine total length of all data registers for temporary register */
for (i = 0; i < ps->len; i++)
total_length += ps->parts[i]->active_instruction->data_register->in->len;
temp_reg = data_register_alloc( "TEMP", total_length );
/* combine "in" data of all registers */
temp_str = register_get_string( temp_reg->in );
temp_str[0] = '\0';
for (i = ps->len - 1; i >= 0; i--) {
part_str = register_get_string( ps->parts[i]->active_instruction->data_register->in );
strcat( temp_str, part_str );
}
register_init( temp_reg->in, temp_str );
/* shift once */
tap_shift_register( chain, temp_reg->in, capture_output ? temp_reg->out : NULL, exit );
if (capture_output) {
char *idx_string;
/* copy back the "out" data */
temp_str = register_get_string( temp_reg->out );
for (i = ps->len - 1, idx_string = temp_str; i >= 0; i--) {
part_str = register_get_string( ps->parts[i]->active_instruction->data_register->out );
strncpy( part_str, idx_string, ps->parts[i]->active_instruction->data_register->out->len );
register_init( ps->parts[i]->active_instruction->data_register->out, part_str );
idx_string += ps->parts[i]->active_instruction->data_register->out->len;
}
}
data_register_free( temp_reg );
}
#else
/* new^2 implementation: split into defer + retrieve part
/* new implementation: split into defer + retrieve part
shift the data register of each part in the chain one by one */
for (i = 0; i < ps->len; i++) {
@ -239,7 +188,6 @@ chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture
(i + 1) == ps->len ? exit : EXITMODE_SHIFT );
}
}
#endif
}
void

Loading…
Cancel
Save