11–50 Altera Corporation
Stratix Device Handbook, Volume 2 July 2005
Configuration Schemes
Example Jam File that Reads the IDCODE
Figure 11–27 illustrates the flexibility and utility of the Jam STAPL. The
example reads the IDCODE out of a single device in a JTAG chain.
1 The array variable, I_IDCODE, is initialized with the IDCODE
instruction bits ordered the LSB first (on the left) to most
significant bit (MSB) (on the right). This order is important
because the array field in the IRSCAN instruction is always
interpreted, and sent, MSB to LSB.
Figure 11–27. Example Jam File Reading IDCODE
Capture-IR IRCAPTURE
Shift-IR IRSHIFT
Exit1-IR IREXIT1
Pause-IR IRPAUSE
Exit2-IR IREXIT2
Update-IR IRUPDATE
Table 11–14. Reserved Keywords (Part 2 of 2)
IEEE Std. 1149.1 JTAG State Names Jam Reserved State Names
BOOLEAN read_data[32];
BOOLEAN I_IDCODE[10] = BIN 1001101000; ‘assumed
BOOLEAN ONES_DATA[32] = HEX FFFFFFFF;
INTEGER i;
‘Set up stop state for IRSCAN
IRSTOP IRPAUSE;
‘Initialize device
STATE RESET;
IRSCAN 10, I_IDCODE[0..9]; ‘LOAD IDCODE INSTRUCTION
STATE IDLE;
WAIT 5 USEC, 3 CYCLES;
DRSCAN 32, ONES_DATA[0..31], CAPTURE
read_data[0..31];
‘CAPTURE IDCODE
PRINT “IDCODE:”;
FOR i=0 to 31;
PRINT read_data[i];
NEXT i;
EXIT 0;