diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 50ea0e15..cf66badf 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,14 @@ +2008-03-10 Arnim Laeuger + + [ 1911429 ] Read TDO data from instruction shift: + * doc/UrJTAG.txt: removed note about SIR deficiency + * src/svf/svf.c (svf_sxr): request TDO capture for SIR when command specifies TDO paramters + * src/tap/chain.c (chain_shift_instructions_mode): use defered shifting and capture TDO + output when requested + * src/part/instruction.c (instruction_alloc): allocate tap_register out + * include/chain.h: parameter capture_output added to chain_shift_instructions_mode() + * include/instruction.h: tap_register out added + 2008-03-03 Arnim Laeuger * src/tap/parport/ftd2xx.c (ftd2xx_mpsse_open): fix FT_SetChar() parameters diff --git a/jtag/doc/UrJTAG.txt b/jtag/doc/UrJTAG.txt index 0396e7c2..cba63b09 100644 --- a/jtag/doc/UrJTAG.txt +++ b/jtag/doc/UrJTAG.txt @@ -852,8 +852,6 @@ The implementation of some SVF commands has deficiencies. - PIOMAP command not supported. - RUNTEST SCK not supported. + The maximum time constraint is not guaranteed. - - SIR + - No check is done against the TDO parameter. - TRST + Parameters Z and ABSENT are not supported. - TIR, TDR commands not supported. + diff --git a/jtag/include/chain.h b/jtag/include/chain.h index 400f9019..280edaac 100644 --- a/jtag/include/chain.h +++ b/jtag/include/chain.h @@ -50,7 +50,7 @@ void chain_defer_clock( chain_t *chain, int tms, int tdi, int n ); int chain_set_trst( chain_t *chain, int trst ); int chain_get_trst( chain_t *chain ); void chain_shift_instructions( chain_t *chain ); -void chain_shift_instructions_mode( chain_t *chain, int capture, int exit ); +void chain_shift_instructions_mode( chain_t *chain, int capture_output, int capture, int exit ); void chain_shift_data_registers( chain_t *chain, int capture_output ); void chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture, int exit ); void chain_flush( chain_t *chain ); diff --git a/jtag/include/instruction.h b/jtag/include/instruction.h index 68e566d1..b28bd2a4 100644 --- a/jtag/include/instruction.h +++ b/jtag/include/instruction.h @@ -35,6 +35,7 @@ typedef struct instruction instruction; struct instruction { char name[MAXLEN_INSTRUCTION + 1]; tap_register *value; + tap_register *out; data_register *data_register; instruction *next; }; diff --git a/jtag/src/part/instruction.c b/jtag/src/part/instruction.c index 8ab42486..c5dd723c 100644 --- a/jtag/src/part/instruction.c +++ b/jtag/src/part/instruction.c @@ -49,7 +49,12 @@ instruction_alloc( const char *name, int len, const char *val ) i->value = register_alloc( len ); if (!i->value) { - free( i->name ); + free( i ); + return NULL; + } + i->out = register_alloc( len ); + if (!i->out) { + free( i->value ); free( i ); return NULL; } @@ -67,6 +72,9 @@ instruction_free( instruction *i ) if (!i) return; - register_free( i->value ); + if (i->value) + register_free( i->value ); + if (i->out) + register_free( i->out ); free( i ); } diff --git a/jtag/src/svf/svf.c b/jtag/src/svf/svf.c index 8d8dd84d..48b5e8e3 100644 --- a/jtag/src/svf/svf.c +++ b/jtag/src/svf/svf.c @@ -83,7 +83,6 @@ static int svf_trst_absent; static int svf_state_executed; /* protocol issued warnings */ -static int issued_sir_tdo; static int issued_runtest_maxtime; @@ -884,15 +883,14 @@ svf_sxr(chain_t *chain, enum generic_irdr_coding ir_dr, struct ths_params *param switch (ir_dr) { case generic_ir: svf_goto_state(chain, Shift_IR); - chain_shift_instructions_mode(chain, 0, EXITMODE_EXIT1); + chain_shift_instructions_mode(chain, + sxr_params->params.tdo ? 1 : 0, + 0, + EXITMODE_EXIT1); svf_goto_state(chain, endir); if (sxr_params->params.tdo) - if (!issued_sir_tdo) { - printf( _("Warning %s: checking of TDO not supported for SIR.\n"), "svf"); - printf( _(" This message is only displayed once.\n")); - issued_sir_tdo = 1; - } + result = svf_compare_tdo(sxr_params->params.tdo, sxr_params->params.mask, ir->out, loc); break; case generic_dr: @@ -1107,7 +1105,6 @@ svf_run(chain_t *chain, FILE *SVF_FILE, int stop_on_mismatch) svf_state_executed = 0; /* set back flags for issued warnings */ - issued_sir_tdo = 0; issued_runtest_maxtime = 0; diff --git a/jtag/src/tap/chain.c b/jtag/src/tap/chain.c index 55f676f9..9347f78b 100644 --- a/jtag/src/tap/chain.c +++ b/jtag/src/tap/chain.c @@ -114,7 +114,7 @@ chain_get_trst( chain_t *chain ) } void -chain_shift_instructions_mode( chain_t *chain, int capture, int exit ) +chain_shift_instructions_mode( chain_t *chain, int capture_output, int capture, int exit ) { int i; parts_t *ps; @@ -133,15 +133,35 @@ chain_shift_instructions_mode( chain_t *chain, int capture, int exit ) if (capture) tap_capture_ir( chain ); - for (i = 0; i < ps->len; i++) - tap_shift_register( chain, ps->parts[i]->active_instruction->value, NULL, - (i + 1) == ps->len ? exit : EXITMODE_SHIFT ); + + /* 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++) { + tap_defer_shift_register( chain, ps->parts[i]->active_instruction->value, + capture_output ? ps->parts[i]->active_instruction->out : NULL, + (i + 1) == ps->len ? exit : EXITMODE_SHIFT ); + } + + if(capture_output) + { + for (i = 0; i < ps->len; i++) { + tap_shift_register_output( chain, ps->parts[i]->active_instruction->value, + ps->parts[i]->active_instruction->out, + (i + 1) == ps->len ? exit : EXITMODE_SHIFT ); + } + } + else + { + /* give the cable driver a chance to flush if it's considered useful */ + cable_flush( chain->cable, TO_OUTPUT ); + } } void chain_shift_instructions( chain_t *chain ) { - chain_shift_instructions_mode( chain, 1, EXITMODE_IDLE ); + chain_shift_instructions_mode( chain, 0, 1, EXITMODE_IDLE ); } void