From dd4e3a2406f97e19487aaaecbaaa3c542169e7af Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Fri, 16 May 2014 01:08:43 -0700 Subject: [PATCH] svf: Only read TDO back from the device if we actually need to look at the bits. This results in a 90% speedup on USB-Blaster, which serializes repeated TDI input against TDO readback; program time on an 5CGXFC5C6F27 part was dropped from 2m30s to 9s. Signed-off-by: Joshua Wise Change-Id: I92d5a8b800492283d619328549235b610528c338 Reviewed-on: http://openocd.zylin.com/2145 Reviewed-by: Paul Fertser Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/svf/svf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/svf/svf.c b/src/svf/svf.c index ac7c2c68..0d37c8ff 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -1171,7 +1171,7 @@ XXR_common: svf_add_check_para(0, svf_buffer_index, i); field.num_bits = i; field.out_value = &svf_tdi_buffer[svf_buffer_index]; - field.in_value = &svf_tdi_buffer[svf_buffer_index]; + field.in_value = (xxr_para_tmp->data_mask & XXR_TDO) ? &svf_tdi_buffer[svf_buffer_index] : NULL; if (!svf_nil) { /* NOTE: doesn't use SVF-specified state paths */ jtag_add_plain_dr_scan(field.num_bits, @@ -1261,7 +1261,7 @@ XXR_common: svf_add_check_para(0, svf_buffer_index, i); field.num_bits = i; field.out_value = &svf_tdi_buffer[svf_buffer_index]; - field.in_value = &svf_tdi_buffer[svf_buffer_index]; + field.in_value = (xxr_para_tmp->data_mask & XXR_TDO) ? &svf_tdi_buffer[svf_buffer_index] : NULL; if (!svf_nil) { /* NOTE: doesn't use SVF-specified state paths */ jtag_add_plain_ir_scan(field.num_bits, -- 2.39.5