📄 idcode.jam
字号:
&& (read_data[num_devices + 2] == 0)
&& (read_data[num_devices + 3] == 0)
&& (read_data[num_devices + 4] == 0)
&& (read_data[num_devices + 5] == 1)
&& (read_data[num_devices + 6] == 0)
&& (read_data[num_devices + 7] == 0)
&& (read_data[num_devices + 8] == 1)
&& (read_data[num_devices + 9] == 1)
&& (read_data[num_devices + 10] == 0)
&& (read_data[num_devices + 11] == 0)
&& (read_data[num_devices + 12] == 0)
&& (read_data[num_devices + 13] == 0)
&& (read_data[num_devices + 14] == 1)
&& (read_data[num_devices + 15] == 0);
IF (pattern_det == 0) THEN PRINT " ****************************************************************************";
IF (pattern_det == 0) THEN PRINT " *** Chain Continuity Failure (3) -- DR of Bypass detects an unexpected ***";
IF (pattern_det == 0) THEN PRINT " *** non-zero pattern ***";
IF (pattern_det == 0) THEN PRINT " *** Check JTAG Chain -- Probably a break in TDI to TDO chain between ***";
IF (pattern_det == 0) THEN PRINT " *** devices #",num_devices," and #", num_devices+1, " (counting from TDO) because ", num_devices, " zeros were shifted ***";
IF (pattern_det == 0) THEN PRINT " *** out successfully before encountering the unexpected values. ***";
IF (pattern_det == 0) THEN PRINT " *** Check Signal Integrity ***";
IF (pattern_det == 0) THEN PRINT " ****************************************************************************";
IF (pattern_det == 0) THEN EXIT(2);
PRINT " Number of Devices is ", num_devices;
IF (num_devices == 0) THEN PRINT " ****************************************************************************";
IF (num_devices == 0) THEN PRINT " *** Chain Continuity Failure (4) -- DR of Bypass shows Chain length of ***";
IF (num_devices == 0) THEN PRINT " *** zero devices ***";
IF (num_devices == 0) THEN PRINT " *** Check JTAG Chain; Check Signal Integrity ***";
IF (num_devices == 0) THEN PRINT " ****************************************************************************";
IF (num_devices == 0) THEN EXIT(2);
IF (num_devices > 100) THEN PRINT " ****************************************************************************";
IF (num_devices > 100) THEN PRINT " *** Error: Number devices in chain exceeds maximum number of devices ***";
IF (num_devices > 100) THEN PRINT " *** that this file can support. ***";
IF (num_devices > 100) THEN PRINT " ****************************************************************************";
IF (num_devices > 100) THEN EXIT(2);
ENDPROC;
PROCEDURE compute_ir_length USES data_chain;
PRINT "******************************************************************************";
PRINT "IR Length Calculator";
IRSCAN max_ir_length*2, zeros_ones[(max_ir_length*2-1)..0], CAPTURE read_data[(max_ir_length*2-1)..0];
ir_length = 0;
INTEGER i_irlen;
FOR i_irlen = (max_ir_length) TO (max_ir_length*2-1);
IF (read_data[i_irlen] == 0) THEN ir_length = ir_length + 1;
NEXT i_irlen;
PRINT " Instruction Register Length is ", ir_length;
ENDPROC;
PROCEDURE read_the_idcode USES data_chain;
PRINT "******************************************************************************";
PRINT "IDCODE Reader";
STATE RESET;
DRSCAN max_idlength, all_ones[max_idlength-1..0], CAPTURE id_capture[max_idlength-1..0];
PRINT " ---------- | ---- ------------------- ------------- - |";
PRINT " TDO -> TDI | Rev Device Mfgr 1 |";
PRINT " ---------- | ---- ------------------- ------------- - |";
offset = 0;
FOR i_device = 1 to num_devices;
IF (id_capture[offset] == 0) THEN GOTO no_optional_idcode_read;
'IDCODE supported
PRINT " Device #", i_device, " | " ,
'revision
id_capture[offset + 31], id_capture[offset + 30], id_capture[offset + 29], id_capture[offset + 28], " ",
'device
id_capture[offset + 27], id_capture[offset + 26], id_capture[offset + 25], id_capture[offset + 24], " ",
id_capture[offset + 23], id_capture[offset + 22], id_capture[offset + 21], id_capture[offset + 20], " ",
id_capture[offset + 19], id_capture[offset + 18], id_capture[offset + 17], id_capture[offset + 16], " ",
id_capture[offset + 15], id_capture[offset + 14], id_capture[offset + 13], id_capture[offset + 12], " ",
'vendor
id_capture[offset + 11], id_capture[offset + 10], id_capture[offset + 9], id_capture[offset + 8], " ",
id_capture[offset + 7], id_capture[offset + 6], id_capture[offset + 5], id_capture[offset + 4], " ",
id_capture[offset + 3], id_capture[offset + 2], id_capture[offset + 1], " ",
'mandatory 1
id_capture[offset], " | ";
offset = offset + 32;
GOTO end_device_idcode_read;
'IDCODE not supported
no_optional_idcode_read:
PRINT " Device #", i_device, " | .... .... .... .... .... .... .... ... 0 | No IDCODE support";
offset = offset+1;
end_device_idcode_read:
NEXT i_device;
PRINT " ---------- | ---- ------------------- ------------- - |";
' Should add test for remaining bits being 1
ENDPROC;
PROCEDURE device_identifier USES data_chain, compare_one_idval, compare_known_idvals;
PRINT "******************************************************************************";
PRINT "Device Identifier -- Search for device name from list of device IDCODE values";
PRINT " ---------- | ------------------- ------------- |";
PRINT " TDO -> TDI | Device Mfgr |";
PRINT " ---------- | ------------------- ------------- |";
offset = 0;
FOR i_device = 1 to num_devices;
IF (id_capture[offset] == 0) THEN GOTO no_optional_idcode_ident;
'IDCODE supported
CALL compare_known_idvals;
offset = offset + 32;
GOTO end_device_idcode_ident;
'IDCODE not supported
no_optional_idcode_ident:
PRINT " Device #", i_device, " | No IDCODE support |";
offset = offset+1;
end_device_idcode_ident:
NEXT i_device;
PRINT " ---------- | ------------------- ------------- - |";
' Should add test for remaining bits being 1
ENDPROC;
PROCEDURE compare_known_idvals USES data_chain, compare_one_idval;
id_match_cum = 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -