//Info: Sample template for programming XILINX Virtex 4 FPGA
//Info: Created with output from Impact

--LITERAL START
TRST OFF;
ENDIR IDLE;
ENDDR IDLE;
STATE RESET;
STATE IDLE;
TIR 0 ;
HIR 0 ;
TDR 0 ;
HDR 0 ;
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
//Loading device with 'idcode' instruction.
SIR 10 TDI (03c9) SMASK (03ff) ;
SDR 32 TDI (00000000) SMASK (ffffffff) TDO ($ID$) MASK ($IDMASK$) ;
TIR 0 ;
HIR 0 ;
TDR 0 ;
HDR 0 ;
TIR 0 ;
HIR 0 ;
TDR 0 ;
HDR 0 ;
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
//Loading device with 'idcode' instruction.
SIR 10 TDI (03c9) ;
SDR 32 TDI (00000000) TDO ($ID$) ;
//Loading device with 'bypass' instruction.
SIR 10 TDI (03ff) ;
// Loading device with a `ISC_ENABLE` instruction. 
ENDIR IRPAUSE;
SIR 10 TDI (03d0) ;
SDR 5 TDI (15) SMASK (1f) ;
ENDIR IDLE;
RUNTEST 12 TCK;
// Loading device with a `ISC_PROGRAM_SECURITY` instruction. 
ENDIR IRPAUSE;
SIR 10 TDI (03d2) ;
SDR 32 TDI (00000000) SMASK (ffffffff) ;
ENDIR IDLE;
RUNTEST 9 TCK;
// Loading device with a `ISC_DISABLE` instruction. 
SIR 10 TDI (03d7) ;
RUNTEST 12 TCK;
// Loading device with a `jprogram` instruction. 
SIR 10 TDI (03cb) ;
RUNTEST 1 TCK;
// Loading device with a `bypass` instruction. 
SIR 10 TDI (03ff) ;
RUNTEST 21000 TCK;
// Loading device with a `cfg_in` instruction. 
SIR 10 TDI (03c5) ;
RUNTEST 100000 TCK;
// Check init_complete in ircapture.
//Loading device with 'Bypass' instruction.
SIR 10 TDI (03ff) TDO (0010) MASK (0010) ;
// Loading device with a `jprogram` instruction. 
SIR 10 TDI (03cb) ;
RUNTEST 1 TCK;
// Loading device with a `bypass` instruction. 
SIR 10 TDI (03ff) ;
RUNTEST 21000 TCK;
// Loading device with a `cfg_in` instruction. 
SIR 10 TDI (03c5) ;
RUNTEST 100000 TCK;
// Check init_complete in ircapture.
//Loading device with 'Bypass' instruction.
SIR 10 TDI (03ff) TDO (0010) ;
STATE RESET;
// Loading device with a `cfg_in` instruction. 
SIR 10 TDI (03c5) TDO (0000) MASK (0000) ;
SDR $SBITS$ TDI ($DATA_INV(-1)$) SMASK ($FILL(0xFF,-1)$);
// Loading device with a `jstart` instruction. 
SIR 10 TDI (03cc) ;
RUNTEST 12 TCK;
//Loading device with 'bypass' instruction.
SIR 10 TDI (03ff) ;
//Loading device with 'bypass' instruction.
SIR 10 TDI (03ff) ;
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
// Loading device with a `jstart` instruction. 
SIR 10 TDI (03cc) ;
RUNTEST 12 TCK;
// Loading device with a `cfg_in` instruction. 
SIR 10 TDI (03c5) ;
SDR 224 TDI (0000000000000000200000008001000c0000000466aa9955ffffffff) SMASK (ffffffffffffffffffffffffffffffffffffffffffffffffffffffff) ;
//Checking done pin status.
//Loading device with 'Bypass' instruction.
SIR 10 TDI (03ff) TDO (0021) MASK (0020) ;
TIR 0 ;
HIR 0 ;
TDR 0 ;
HDR 0 ;
SIR 10 TDI (03ff) ;
SDR 1 TDI (00) SMASK (01) ;
--END
