- for( attempt=0; attempt<limit; ++attempt )
- {
- scan_field_t field;
-
- if( attempt>0 )
- {
- /* perform the XC9500 exception handling sequence shown in xapp067.pdf and
- illustrated in psuedo code at end of this file. We start from state
- DRPAUSE:
- go to Exit2-DR
- go to Shift-DR
- go to Exit1-DR
- go to Update-DR
- go to Run-Test/Idle
-
- This sequence should be harmless for other devices, and it
- will be skipped entirely if xrepeat is set to zero.
- */
-
- static tap_state_t exception_path[] = {
- TAP_DREXIT2,
- TAP_DRSHIFT,
- TAP_DREXIT1,
- TAP_DRUPDATE,
- TAP_IDLE,
- };
-
- jtag_add_pathmove( sizeof(exception_path)/sizeof(exception_path[0]), exception_path);
-
- LOG_USER("%s %d retry %d", op_name, xsdrsize, attempt);
- }
-
- field.tap = tap;
- field.num_bits = xsdrsize;
- field.out_value = dr_out_buf;
- field.out_mask = NULL;
- field.in_value = NULL;
-
- jtag_set_check_value(&field, dr_in_buf, dr_in_mask, NULL);
-
- if (tap == NULL)
- jtag_add_plain_dr_scan(1, &field, TAP_DRPAUSE);
- else
- jtag_add_dr_scan(1, &field, TAP_DRPAUSE);
-
- /* LOG_DEBUG("FLUSHING QUEUE"); */
- result = jtag_execute_queue();
- if (result == ERROR_OK)
- {
- matched = 1;
- break;
- }
- }