Main Page | Modules | File List | Globals | Related Pages

1 Executor Routines

Interpret and execute an XSVF buffer or file. More...

Defines

#define XE_UNKNOWN   1
#define XE_TDOMISMATCH   2
#define XE_ILLEGALCMD   4
#define XE_ILLEGALSTATE   5
#define XE_DATAOVERFLOW   6
#define XE_DATAUNDERFLOW   7
#define XCOMPLETE   0x00
#define XTDOMASK   0x01
#define XSIR   0x02
#define XSDR   0x03
#define XRUNTEST   0x04
#define XREPEAT   0x07
#define XSDRSIZE   0x08
#define XSDRTDO   0x09
#define XSETSDRMASKS   0x0A
#define XSDRINC   0x0B
#define XSDRB   0x0C
#define XSDRC   0x0D
#define XSDRE   0x0E
#define XSDRTDOB   0x0F
#define XSDRTDOC   0x10
#define XSDRTDOE   0x11
#define XSTATE   0x12
#define XENDIR   0x13
#define XENDDR   0x14
#define XSIR2   0x15
#define XCOMMENT   0x16
#define XWAIT   0x17
#define XUNKNOWN   0x18

Functions

void UpdateTdi (int len, u_char *tdi_val, int len2, u_char *tdi_val2, u_char *data_mask)
 Prepare the next TDI value for iterating XSDR.

int ReShift (int len, u_char *tdi_val, u_char *tdo_exp, u_char *tdo_msk, u_char sState, u_char eState, long delay, u_char retries)
 Repeat shifting out a TDI value until an expected TDO value appears.

int Shift (int len, u_char *tdi_val, u_char *tdo_exp, u_char sState, u_char eState)
 Shift next TDI value out and optionally capture TDO value.

int Execute (void)
 Execute an XSVF buffer.

int main (void)
 XSVF Executor.


Variables

u_char tdiVal [MAX_BITVEC_BYTES]
 TDI value buffer.

u_char tdiVal2 [MAX_BITVEC_BYTES]
 TDI value 2 buffer.

u_char tdoExp [MAX_BITVEC_BYTES]
 Expected TDO value buffer.

u_char tdoMask [MAX_BITVEC_BYTES]
 TDO mask buffer.

u_char dataMask [MAX_BITVEC_BYTES]
 Data mask buffer.

u_char addrMask [MAX_BITVEC_BYTES]
 Address mask buffer.


Detailed Description

Interpret and execute an XSVF buffer or file.


Define Documentation

#define XCOMMENT   0x16
 

XSVF command code. Embedded comment string follows.

Definition at line 199 of file xsvf.h.

Referenced by Execute().

#define XCOMPLETE   0x00
 

XSVF command code. End of XSVF buffer.

Definition at line 99 of file xsvf.h.

Referenced by Execute().

#define XE_DATAOVERFLOW   6
 

Error code. Bit string overflow.

Definition at line 89 of file xsvf.h.

Referenced by Execute(), and XsvfReadBitString().

#define XE_DATAUNDERFLOW   7
 

Error code. End of XSVF data reached without XCOMPLETE.

Definition at line 92 of file xsvf.h.

Referenced by XsvfGetByte(), XsvfGetLong(), XsvfGetShort(), XsvfInit(), XsvfReadBitString(), and XsvfSkipComment().

#define XE_ILLEGALCMD   4
 

Error code. XSVF buffer contains illegal command.

Definition at line 83 of file xsvf.h.

Referenced by Execute().

#define XE_ILLEGALSTATE   5
 

Error code. XSVF buffer contains illegal TAP state.

Definition at line 86 of file xsvf.h.

Referenced by TapStateChange().

#define XE_TDOMISMATCH   2
 

Error code. Captured TDO value differs from expected TDO value.

Definition at line 80 of file xsvf.h.

Referenced by ReShift().

#define XE_UNKNOWN   1
 

Error code. Unknown error.

Definition at line 77 of file xsvf.h.

#define XENDDR   0x14
 

XSVF command code. Set the XSDR/XSDRTDO end state to Run-Test-Idle (0) or Pause-DR (1).

Definition at line 193 of file xsvf.h.

Referenced by Execute().

#define XENDIR   0x13
 

XSVF command code. Set the XSIR end state to Run-Test-Idle (0) or Pause-IR (1).

Definition at line 190 of file xsvf.h.

Referenced by Execute().

#define XREPEAT   0x07
 

XSVF command code. Set the number of times that TDO is tested against the expected value before the programming operation is considered a failure.

Definition at line 126 of file xsvf.h.

Referenced by Execute().

#define XRUNTEST   0x04
 

XSVF command code. Set the number of microseconds the device should stay in the Run-Test-Idle state after each visit to the SDR state.

Definition at line 120 of file xsvf.h.

Referenced by Execute().

#define XSDR   0x03
 

XSVF command code. Go to the Shift-DR state and shift in the TDI value; compare the expected value from the last XSDRTDO command against the TDO value that was shifted out. Use the TDO mask which was generated by the last XTDOMASK instruction.

Definition at line 114 of file xsvf.h.

Referenced by Execute().

#define XSDRB   0x0C
 

XSVF command code. Go to the Shift-DR state and shift in the TDI value. No comparison of TDO value with the last specified expected value is performed.

Definition at line 150 of file xsvf.h.

Referenced by Execute().

#define XSDRC   0x0D
 

XSVF command code. Continue to stay in Shift-DR state and shift in the TDI value. No comparison of TDO value with the last specified expected value is performed.

Definition at line 156 of file xsvf.h.

Referenced by Execute().

#define XSDRE   0x0E
 

XSVF command code. Continue to stay in Shift-DR state and shift in the TDI value. At the end of the operation, go to the state specified in the last XENDDR command. No comparison of TDO value with the last specified expected value is performed.

Definition at line 163 of file xsvf.h.

Referenced by Execute().

#define XSDRINC   0x0B
 

Do iterating XSDR commands.

Definition at line 144 of file xsvf.h.

Referenced by Execute().

#define XSDRSIZE   0x08
 

XSVF command code. Set the length of the next XSDR/XSDRTDO records that follow.

Definition at line 129 of file xsvf.h.

Referenced by Execute().

#define XSDRTDO   0x09
 

XSVF command code. Go to the Shift-DR state and shift in the TDI value; compare the expected value against the TDO value that was shifted out. Use the TDO mask which was generated by the last XTDOMASK command.

The expected TDO value is re-used in successive XSDR commands.

Definition at line 138 of file xsvf.h.

Referenced by Execute().

#define XSDRTDOB   0x0F
 

XSVF command code. Go to the Shift-DR state and shift in the TDI value. Compare all bits of the expected value against the TDO value that is shifted out. No retries are performed.

Definition at line 170 of file xsvf.h.

Referenced by Execute().

#define XSDRTDOC   0x10
 

XSVF command code. Continue to stay in Shift-DR state and shift in the TDI value. Compare all bits of the expected value against the TDO value that is shifted out.

Definition at line 176 of file xsvf.h.

Referenced by Execute().

#define XSDRTDOE   0x11
 

XSVF command code. Continue to stay in Shift-DR state and shift in the TDI value. Compare all bits of the expected value against the TDO value that is shifted out. At the end of the operation, go to the state specified in the last XENDDR command. No retries are performed.

Definition at line 184 of file xsvf.h.

Referenced by Execute().

#define XSETSDRMASKS   0x0A
 

XSVF command code. Set SDR address and data masks for interatin XSDR commands.

Definition at line 141 of file xsvf.h.

Referenced by Execute().

#define XSIR   0x02
 

XSVF command code. Go to the Shift-IR state and shift in the TDI value. XSIR uses a single byte for the TDI size.

Definition at line 106 of file xsvf.h.

Referenced by Execute().

#define XSIR2   0x15
 

XSVF command code. Go to the Shift-IR state and shift in the TDI value. XSIR2 uses two bytes for the TDI size.

Definition at line 196 of file xsvf.h.

Referenced by Execute().

#define XSTATE   0x12
 

XSVF command code. Immediately set the TAP controller to Test-Logic-Reset (0) or Run-Test_idle (1).

Definition at line 187 of file xsvf.h.

Referenced by Execute().

#define XTDOMASK   0x01
 

XSVF command code. Set the TDO mask. Length has been specified by the last XSDRSIZE command.

Definition at line 102 of file xsvf.h.

Referenced by Execute().

#define XUNKNOWN   0x18
 

Unknown XSVF command code, indicates an error.

Definition at line 205 of file xsvf.h.

Referenced by XsvfGetCmd().

#define XWAIT   0x17
 

XSVF command code. Not implemented.

Definition at line 202 of file xsvf.h.


Function Documentation

int Execute void   )  [static]
 

Execute an XSVF buffer.

This routine interprets a compressed SVF command sequence following the Xilinx application note XAPP503.

Returns:
Zero on success, otherwise an error code is returned.

Definition at line 371 of file xsvfexec.c.

References addrMask, BitStringAdd(), BitStringOnes(), dataMask, DEFAULT_REPEAT, MAX_BITVEC_BYTES, PAUSE_DR, PAUSE_IR, ReShift(), RUN_TEST_IDLE, Shift(), SHIFT_DR, SHIFT_IR, TapStateChange(), TapStateInit(), tdiVal, tdiVal2, tdoExp, tdoMask, TEST_LOGIC_RESET, UpdateTdi(), XCOMMENT, XCOMPLETE, XE_DATAOVERFLOW, XE_ILLEGALCMD, XENDDR, XENDIR, XREPEAT, XRUNTEST, XSDR, XSDRB, XSDRC, XSDRE, XSDRINC, XSDRSIZE, XSDRTDO, XSDRTDOB, XSDRTDOC, XSDRTDOE, XSETSDRMASKS, XSIR, XSIR2, XSTATE, XsvfGetByte(), XsvfGetCmd(), XsvfGetError(), XsvfGetLong(), XsvfGetShort(), XsvfGetState(), XsvfReadBitString(), XsvfSkipComment(), and XTDOMASK.

Referenced by main().

int main void   ) 
 

XSVF Executor.

Program entry point.

Definition at line 581 of file xsvfexec.c.

References Execute(), XsvfExit(), and XsvfInit().

int ReShift int  len,
u_char *  tdi_val,
u_char *  tdo_exp,
u_char *  tdo_msk,
u_char  sState,
u_char  eState,
long  delay,
u_char  retries
[static]
 

Repeat shifting out a TDI value until an expected TDO value appears.

Parameters:
len Number of bits to shift.
tdi_val TDI value to shift out.
tdo_exp Expected TDO value. Set to NULL if not available.
tdo_msk Used to mask out don't care TDO values.
sState TAP state during shift operation, either SHIFT-DR or SHIFT-IR. No retries are allowed with SHIFT-IR.
eState TAP state after shift operation.
delay Idle time (in microseconds) after each shift.
retries Maximum number of retries. Ignored if expected TDO value is not available.
Returns:
Zero on success, otherwise an error code is returned.

Definition at line 204 of file xsvfexec.c.

References BitStringCmp(), CLR_TCK, CLR_TDI, GET_TDO, MAX_BITVEC_BYTES, PAUSE_DR, RUN_TEST_IDLE, SET_TCK, SET_TDI, SET_TMS, SHIFT_DR, TapStateChange(), TapStateInc(), XE_TDOMISMATCH, and XsvfDelay().

Referenced by Execute(), and Shift().

int Shift int  len,
u_char *  tdi_val,
u_char *  tdo_exp,
u_char  sState,
u_char  eState
[static]
 

Shift next TDI value out and optionally capture TDO value.

No delays and no retries are performed.

Parameters:
len Number of bits to shift.
tdi_val Pointer to TDI value buffer.
tdo_exp Pointer to expected TDO value buffer. If NULL, no TDO value will be read from the XSVF buffer and no comparision will take place.
sState TAP state during shift operation, either SHIFT-DR or SHIFT-IR.
eState TAP state after shift operation.
Returns:
Zero on success, otherwise an error code is returned.

Definition at line 324 of file xsvfexec.c.

References ReShift(), and XsvfReadBitString().

Referenced by Execute().

void UpdateTdi int  len,
u_char *  tdi_val,
int  len2,
u_char *  tdi_val2,
u_char *  data_mask
[static]
 

Prepare the next TDI value for iterating XSDR.

Parameters:
len Number of bits in the first TDI value.
tdi_val First TDI value, the one which will be updated.
len2 Number of bits in the second TDI value.
tdi_val2 Second TDI value.
data_mask The data mask used for the update.

Definition at line 156 of file xsvfexec.c.

Referenced by Execute().


© 2004 by egnite Software GmbH - visit http://www.ethernut.de/