From 5f104d447d6329166c50108701d3021a41e6947d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Thu, 14 Feb 2008 22:44:00 +0000 Subject: [PATCH] flush todo queue for transfers without output capture (if conservative flush strategy is not disabled) git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1016 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 6 ++++++ jtag/configure.ac | 15 +++++++++++++++ jtag/include/cable.h | 1 + jtag/src/tap/cable.c | 9 +++++++++ jtag/src/tap/chain.c | 9 +++++++-- 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 072f0b56..dcce6259 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,9 @@ +2008-02-14 Arnim Laeuger + + * src/tap/cable.c (cable_flush), src/tap/chain.c (chain_shift_data_registers_mode), + include/cable.h, configure.ac: follow conservative flush strategy for transfers + without output capture (if not disabled via configure --disable-conservative-flush) + 2008-02-14 Kolja Waschk * src/tap/chain.c: Enabled the new^2 implementation in tap_shift_register diff --git a/jtag/configure.ac b/jtag/configure.ac index 354a531e..5a602d11 100644 --- a/jtag/configure.ac +++ b/jtag/configure.ac @@ -381,6 +381,21 @@ AS_IF([test "x$jim" = xtrue], [ AM_CONDITIONAL(ENABLE_JIM, false) ]) + +dnl Use conservative flush? +AC_ARG_ENABLE(conservative_flush, +[ --enable-conservative-flush Perform conservative queue flushing (default is enabled)], +[case "${enableval}" in + yes) conservative_flush=true ;; + no) conservative_flush=false ;; + *) AC_MSG_ERROR(cab value ${enableval} for --enable-conservative-flush) ;; + esac], +[conservative_flush=true]) +AS_IF([test "x$conservative_flush" = xtrue], [ + AC_DEFINE(CONSERVATIVE_FLUSH, 1, [define if conservative queue flushing is enabled]) +]) + + AC_OUTPUT dnl diff --git a/jtag/include/cable.h b/jtag/include/cable.h index f6251444..53d4983e 100644 --- a/jtag/include/cable.h +++ b/jtag/include/cable.h @@ -38,6 +38,7 @@ typedef struct cable_driver_t cable_driver_t; typedef enum { OPTIONALLY, + CONSERVATIVELY, TO_OUTPUT, COMPLETELY } diff --git a/jtag/src/tap/cable.c b/jtag/src/tap/cable.c index 2aa51d70..f546cde5 100644 --- a/jtag/src/tap/cable.c +++ b/jtag/src/tap/cable.c @@ -142,6 +142,15 @@ cable_init( cable_t *cable ) void cable_flush ( cable_t *cable, cable_flush_amount_t how_much ) { + if (how_much == CONSERVATIVELY) + { +#ifdef CONSERVATIVE_FLUSH + how_much = COMPLETELY; +#else + how_much = OPTIONALLY; +#endif + } + cable->driver->flush( cable, how_much ); } diff --git a/jtag/src/tap/chain.c b/jtag/src/tap/chain.c index f6d67f19..9152157b 100644 --- a/jtag/src/tap/chain.c +++ b/jtag/src/tap/chain.c @@ -173,7 +173,6 @@ chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture shift the data register of each part in the chain one by one */ for (i = 0; i < ps->len; i++) { - puts("tap_defer_shift_register"); tap_defer_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 ); @@ -182,12 +181,18 @@ chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture if(capture_output) { for (i = 0; i < ps->len; i++) { - puts("tap_shift_register_output"); tap_shift_register_output( chain, ps->parts[i]->active_instruction->data_register->in, ps->parts[i]->active_instruction->data_register->out, (i + 1) == ps->len ? exit : EXITMODE_SHIFT ); } } + else + { + /* the todo queue should be flushed here when following a conservative strategy + since otherwise transfers without output capture wouldn't be submitted until + a transfer with output capture is executed */ + cable_flush( chain->cable, CONSERVATIVELY ); + } } void