bscan_virtex4 device

I am trying to use the jtag interface as a general purpose communication port. I looked at the GNAT module

formatting link
I think I understand the vhdl part. Now the other side at the pc. I am trying to write the user code into the device in order to get something done, but it doesn't seem to work. The script I use is as follows:

source c:/xilinx_7_1/ChipScope_Pro_7_1i/tcljtag.tcl

set handle [jtag_open] jtag_lock $handle jtag_autodetect $handle

jtag_shiftir $handle -buffer "0100001111" -endstate RTI -device 2

jtag_shiftdr $handle -buffer "1010101000000001" -endstate RTI -device 2

jtag_unlock $handle jtag_close $handle

A few questions about this:

- the virtex4 has up to four usercodes. What are the bit defines for these usercodes?

- is one usercode attached to one bscan_virtex4 component?

- how to deal with the endstates in the jtag_shiftir and jtag_shiftdr calls?

- is the script above something that should work or is it complete nonsense? (all I want to do is send the value 0x8055 to the second device in the jtag chain)

Extra information: I have instantiated the bscan_virtex4 component with the following generic

bscan_virtex4_inst : bscan_virtex4 generic map ( jtag_chain => 1 ) . . .

I assume the jtag_chain attribute matches with the usercode to use (jtag_chain of 1 will specify to use usercode 1), is this correct?

By the way, tcl is new for me (in the sense that I never programmed in tcl before).

TIA, Frank

Reply to
Frank van Eijkelenburg
Loading thread data ...

jtag instruction codes can be found in BSDL files your tcl script selects USER1 (instance with jtag_chaine=1) and send data to user logic

basically all your assumptions seem correct

I do use the BSCAN and user logic implemented custom jtag chains all the time, but from our own jtag component library so I can not tell if your tcl code should actually work, it seems like it might

antti

Reply to
Antti

I am testing with the next script:

======================================== source c:/xilinx_7_1/ChipScope_Pro_7_1i/tcljtag.tcl

set handle [jtag_open] jtag_lock $handle jtag_autodetect $handle

puts stderr "JTAG information" puts stderr "================" puts stderr "Number of devices in the chain: [jtag_devicecount $handle]" puts stderr "IR Length of device 1 is [jtag_irlength $handle 1]"

set oldir1 [jtag_shiftir $handle -buffer "01000011111111" -endstate RTI -device

1] puts stderr $oldir1

set oldir2 [jtag_shiftir $handle -buffer "11000011111111" -endstate RTI -device

1] puts stderr $oldir2

set oldir3 [jtag_shiftir $handle -buffer "01000111111111" -endstate RTI -device

1] puts stderr $oldir3

set oldir4 [jtag_shiftir $handle -buffer "11000111111111" -endstate TLR -device

1] puts stderr $oldir4

jtag_unlock $handle jtag_close $handle

======================================== I expected a different output for oldir1, 2, 3 and 4. But they are all equal:

JTAG information ================ Jtag_DeviceCount succeeded Number of devices in the chain: 4 Jtag_IRLength succeeded IR Length of device 1 is 14 Jtag_ShiftIR successful

10101111111111 Jtag_ShiftIR successful 10101111111111 Jtag_ShiftIR successful 10101111111111 Jtag_ShiftIR successful 10101111111111 Jtag_Unlock succeeded Jtag_Close successful

Could you give an explanation for this? How should I deal with the endstates? I want to shift the usercode instruction to the instruction register and after that shifting my own 16 bits data into the data register.

Does anybody has some example code for this? My jtag chain exists of 4 devices and device 1 (counting from 0) is the device I want to use.

I can't find much information on the internet, is this not commonly used?!

TIA, Frank

Reply to
Frank van Eijkelenburg

what you see is correct, the IR read back is always same as long as config status doesnt change,

as long as USERn is in IR register and Test logic reset state has not been entered any shift DR commands go FPGA fabric

Antti Lukats

Reply to
Antti

Thanks for the information. Meanwhile I found the stupid bug: there was no valid data put on the tdo input of the bscan_virtex4 component (only an unused signal). Now I can read back the value I expected.

Frank

Reply to
Frank van Eijkelenburg

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.