//Info: Sample template for programming XILINX SpartanII 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 5 TDI (09) SMASK (1f) ;
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 5 TDI (09) ;
SDR 32 TDI (00000000) TDO ($ID$) ;
//Loading device with 'bypass' instruction.
SIR 5 TDI (1f) ;
STATE RESET;
// Loading device with a `cfg_in` instruction. 
SIR 5 TDI (05) ;
SDR 288 TDI (00000000e00000008001000ca00000008001000cbcfd05008004800c66aa995500000000) SMASK (ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) ;
STATE RESET;
// Loading device with a `jstart` instruction. 
SIR 5 TDI (0c) ;
SDR 13 TDI (0000) SMASK (1fff) ;
STATE RESET;
// Loading device with a `cfg_in` instruction. 
SIR 5 TDI (05) ;
SDR 352 TDI (00000000e00000008001000ca00000008001000cfffc05008004800c100000008001000c66aa995500000000) SMASK (ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) ;
STATE RESET;
// Loading device with a `jstart` instruction. 
SIR 5 TDI (0c) ;
SDR 13 TDI (0000) SMASK (1fff) ;
STATE RESET;
// Loading device with a `cfg_in` instruction. 
SIR 5 TDI (05) ;
SDR 288 TDI (00000000e00000008001000ca00000008001000cb4fd05008004800c66aa995500000000) SMASK (ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) ;
STATE RESET;
// Loading device with a `jstart` instruction. 
SIR 5 TDI (0c) ;
SDR 13 TDI (0000) SMASK (1fff) ;
STATE RESET;
// Loading device with a `cfg_in` instruction. 
SIR 5 TDI (05) ;

SDR $SBITS$ TDI ($DATA_INV(-1)$) SMASK ($FILL(0xFF,-1)$);

STATE RESET;
// Loading device with a `jstart` instruction. 
SIR 5 TDI (0c) ;
SDR 13 TDI (0000) SMASK (1fff) ;
STATE RESET;
//Loading device with 'bypass' instruction.
SIR 5 TDI (1f) ;
//Loading device with 'bypass' instruction.
SIR 5 TDI (1f) ;
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
STATE RESET;
//Checking done pin status.
//Loading device with 'Bypass' instruction.
SIR 5 TDI (1f) TDO (05) MASK (04) ;
TIR 0 ;
HIR 0 ;
TDR 0 ;
HDR 0 ;
SIR 5 TDI (1f) ;
SDR 1 TDI (00) SMASK (01) ;
--END
