This Answer Record provides an explanation of the different commands in the SVF files created by Xilinx Software.
TRST (Test Reset)
Syntax: TRST trst_mode
This command describes the operation of the Optional Test Reset signal; it is described as OFF since the TRST pin does not exist on the XC9500 device. ON, OFF, Z, and ABSENT are the valid trst_mode states.
Syntax: ENDDR stable_state ENDIR stable_state
The ENDDR and ENDIR commands specify the state in which the TAP controller is forced into at the conclusion of a DR or IR scan. Once specified, the ENDDR/ENDIR commands remain in force unless overridden by another ENDDR/ENDIR command. Both, ENDDR and ENDIR are set to IDLE at startup. Valid stable_states are IRPAUSE, DRPAUSE, RESET, and IDLE.
ENDIR IDLE; ENDDR DRPAUSE;
Syntax: STATE [pathstate1 [pathstate2...[pathstaten]]] stable_state;
The STATE command is used to move the TAP controller from one stable state into another for test initialization, completion, etc. TDI and TDO are undefined during the STATE command. For every state path, it is assumed that at least one Test Clock is executed.
The pathstate1..n is an optional list of states that must be traversed through the TAP state diagram in order to reach the final stable state. Valid states are RESET, IDLE, DRSELECT, DRCAPTURE, DRSHIFT, DRPAUSE, DREXIT1, DREXIT2, DRUPDATE, IRSELECT, IRCAPTURE, IRSHIFT, IRPAUSE, IREXIT1, IREXIT2, and IRUPDATE. The TAP controller is forced to the stable_state. IRPAUSE, DRPAUSE, RESET, and IDLE are the valid stable states.
STATE RESET IDLE;
SDR, SIR (Scan Data Register, Scan Instruction Register)
These commands specify a SCAN pattern that can be applied to the target Data or Instruction registers. The length is a 32-bit unsigned decimal integer greater than 0 specifying the number of bits to be scanned.
[TDI (tdi)] is an optional value that is scanned in HEX. If this parameter is not present, the value of TDI to be scanned equals the previous SIR/SDR statement. The TDI parameter should be explicitly specified for the first command or when the length of the target register changes.
[TDO (tdo)] is the optional value that is compared against the actual value scanned out of target in HEX. If this parameter is not present, no comparison is performed.
[MASK (mask)] is the optional MASK that is used when comparing the TDO values against the actual values in HEX. A "1" in a specific bit position indicates a "care" condition, and a "0" indicates a "don't care". If this parameter is not present, the previously assigned value of MASK is used. If a new scan command changes the length of a data pattern with respect to a previous scan, the MASK parameter should be explicitly specified. If the TDO parameter is not specified, MASK is not used.
[SMASK (smask)] is the optional value that specifies whether TDI is "don't care" or "care" in HEX. A "1" in a specific bit position indicates a "care" condition, and a "0" indicates a "don't care". If this parameter is not present, the previously assigned value of SMASK is used. If a new scan command changes the length of a data pattern with respect to a previous scan, the SMASK parameter should be explicitly specified. The SMASK is used even if the TDI parameter is not present.
The RUNTEST command forces the TAP controller to the specified run state for a specified number of clocks, a specified length of time or both, and then moves it to the specified end state. Either run_count or min_time must be specified. If both are specified, RUNTEST executes until both conditions are satisfied or, until max_time has been exceeded.
The run_state is the optional stable state that the TAP controller is forced to during the RUNTEST command. IRPAUSE, DRPAUSE, RESET, and IDLE are the valid stable states. If run_state, is not specified, the RUNTEST command defaults to the earlier value that was specified. If none was specified, then the initial default is IDLE.
The run_count is the optional number of clocks that the TAP controller stays in the run state. It is a 32-bit unsigned decimal integer.
the run_clk specifies the optional clock used, either TCK or system clock.
the [min_time SEC] is the optional minimum amount of time in seconds that the RUNTEST command must execute for.
The [MAXIMUM max_time SEC] is the optional maximum amount of time in seconds that the RUNTEST command must execute for; it must be greater than min_time.
The [ENDSTATE end_state] is the optional state that the TAP controller is forced to after executing the specified number of clocks. The valid end_states are IRPAUSE, DRAPAUSE, RESET, and IDLE. If the end_state is not specified, the default end_state is used. When an end_state is specified, it is the default. When a run_state is specified, the new run_state becomes the default. When a run_state is not specified, the default end_state remains in effect. The initial default for the end_state is IDLE.
RUNTEST 1300000 TCK;
NOTE: The iMPACT generated SVF file assumes that the TCK is running at 1 MHz. This is critical for CPLD and PROM parts because there can be a requirement to wait for a fixed amount of time prior to the next operation. To ensure which RUNTEST commands have the wait time requirement, generate the SVF file with 6.1i iMPACT or later and check the "Use Absolute Time in SVF File" under Edit -> Preference.