//Info: Sample template for programming XILINX XCFxxP PROMS
//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 'ispen' instruction.
SIR 16 TDI (00e8) SMASK (ffff) ;
SDR 8 TDI (03) SMASK (ff) ;
//Loading device with 'idcode' instruction.
SIR 16 TDI (00fe) ;
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 ;
STATE RESET;
// Loading devices with 'ispen' or 'bypass'  instruction.
SIR 16 TDI (00e8) ;
SDR 8 TDI (d0) SMASK (ff) ;
// Loading device with a 'XSC_UNLOCK' instruction. 
SIR 16 TDI (aa55) ;
SDR 24 TDI (00003f) SMASK (ffffff) ;
// Loading device witha 'ISC_ERASE' instruction.  
ENDIR IRPAUSE;
SIR 16 TDI (00ec) ;
SDR 24 TDI (00003f) ;
ENDIR IDLE;
RUNTEST 140000000 TCK;
// Loading devices with 'conld' or 'bypass' instruction.
SIR 16 TDI (00f0) ;
RUNTEST 50 TCK;
STATE RESET;
// Loading devices with 'ispen' or 'bypass'  instruction.
SIR 16 TDI (00e8) ;
SDR 8 TDI (d0) SMASK (ff) ;
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
//Loading device with 'ispen' instruction.
SIR 16 TDI (00e8) ;
SDR 8 TDI (03) ;
// Loading device with 'XSC_DATA_BTC' instruction. 
SIR 16 TDI (00f2) ;
SDR 32 TDI (ffffffe0) SMASK (ffffffff) TDO (00000000) MASK (00000000) ;
// Loading device with a 'ISC_PROGRAM' instruction. 
SIR 16 TDI (00ea) ;
RUNTEST 120 TCK;
TIR 0 ;
HIR 0 ;
TDR 0 ;
HDR 0 ;
STATE RESET;
// Loading devices with 'ispen' or 'bypass'  instruction.
SIR 16 TDI (00e8) ;
SDR 8 TDI (d0) SMASK (ff) ;
--END

$CUTLINES(0)$

--LITERAL START
// Loading device with a 'ISC_DATA_SHIFT' instruction. 
SIR 16 TDI (00ed) ;
SDR 256 TDI ($DATA_INV(32)$) SMASK ($FILL(0xFF,32)$) ;
// Loading device with a 'ISC_ADDRESS_SHIFT' instruction. 
SIR 16 TDI (00eb) ;
SDR 24 TDI (000000) SMASK (ffffff) ;
// Loading device with a 'ISC_PROGRAM' instruction. 
SIR 16 TDI (00ea) ;
RUNTEST 1000 TCK;
// Loading device with a 'ISC_DATA_SHIFT' instruction. 
SIR 16 TDI (00ed) ;
SDR 256 TDI ($DATA_INV(32)$) SMASK ($FILL(0xFF,32)$) ;
// Loading device with a 'ISC_PROGRAM' instruction. 
SIR 16 TDI (00ea) ;
RUNTEST 1000 TCK;
--END

--REPEAT START
// Loading device with a 'ISC_DATA_SHIFT' instruction. 
SIR 16 TDI (00ed) ;
SDR 256 TDI ($DATA_INV(32)$) ;
// Loading device with a 'ISC_PROGRAM' instruction. 
SIR 16 TDI (00ea) ;
RUNTEST 1000 TCK;
--END

$CUTLINES(1)$

--LITERAL START
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
//Loading device with 'ispen' instruction.
SIR 16 TDI (00e8) ;
SDR 8 TDI (03) SMASK (ff) ;
// Loading device with a 'XSC_DATA_SUCR' instruction. 
SIR 16 TDI (000e) ;
SDR 16 TDI (fffc) SMASK (ffff) TDO (0000) MASK (0000) ;
// Loading device with a 'ISC_PROGRAM' instruction. 
SIR 16 TDI (00ea) ;
RUNTEST 60 TCK;
//Loading device with 'ispen' instruction.
SIR 16 TDI (00e8) ;
SDR 8 TDI (03) SMASK (ff) ;
//Loading device with 'ispen' instruction.
SIR 16 TDI (00e8) ;
SDR 8 TDI (03) ;
// Loading device witha 'XSC_DATA_CCB' instruction. 
SIR 16 TDI (000c) ;
SDR 16 TDI (fff9) SMASK (ffff) TDO (0000) MASK (0000) ;
// Loading device with a 'ISC_PROGRAM' instruction. 
SIR 16 TDI (00ea) ;
RUNTEST 60 TCK;
TIR 0 ;
HIR 0 ;
TDR 0 ;
HDR 0 ;
// Loading devices with 'conld' or 'bypass' instruction.
SIR 16 TDI (00f0) ;
RUNTEST 50 TCK;
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
//Loading device with 'ispen' instruction.
SIR 16 TDI (00e8) ;
SDR 8 TDI (03) SMASK (ff) ;
// Loading device with 'XSC_DATA_DONE' instruction. 
SIR 16 TDI (0009) ;
SDR 8 TDI (ce) TDO (00) MASK (00) ;
// Loading device with a 'ISC_PROGRAM' instruction. 
SIR 16 TDI (00ea) ;
RUNTEST 60 TCK;
TIR 0 ;
HIR 0 ;
TDR 0 ;
HDR 0 ;
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
//Loading device with 'ispen' instruction.
SIR 16 TDI (00e8) ;
SDR 8 TDI (03) ;
--END

$REWIND$
$ADDRESS(0x0000)$
$STEP(0x0400)$

--REPEAT START
// Loading device with a 'ISC_ADDRESS_SHIFT' instruction.
SIR 16 TDI (00eb) ;
SDR 24 TDI ($ADDRESS$) SMASK (ffffff) ;
// Loading device with a 'XSC_READ' instruction. 
SIR 16 TDI (00ef) ;
RUNTEST 15 TCK;
SDR $BSIZE$ TDI ($FILL(0x00,BSIZEB)$) SMASK ($FILL(0xFF,BSIZEB)$) TDO ($DATA_INV(BSIZEB)$) MASK ($FILL(0xFF,BSIZEB)$) ;
--END

--LITERAL START
// Check Device status. 
SIR 16 TDI (00e3) ;
SDR 8 TDI (00) SMASK (ff) TDO (36) MASK (7f) ;
//Loading device with 'conld' instruction.
SIR 16 TDI (00f0) ;
RUNTEST 50 TCK;
//Loading device with 'ispen' instruction.
SIR 16 TDI (00e8) ;
SDR 8 TDI (03) ;
//Loading device with 'conld' instruction.
SIR 16 TDI (00f0) ;
RUNTEST 50 TCK;
// Loading device with a 'config' instruction. 
SIR 16 TDI (00ee) TDO (0000) MASK (0000) ;
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
TIR 0 ;
HIR 0 ;
HDR 0 ;
TDR 0 ;
TIR 0 ;
HIR 0 ;
TDR 0 ;
HDR 0 ;
SIR 16 TDI (ffff) ;
SDR 1 TDI (00) SMASK (01) ;
--END
