Intel® Quartus® Prime Pro Edition User Guide: Scripting

ID 683432
Date 10/04/2021

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents device_dr_shift (::quartus::jtag)

The following table displays information for the device_dr_shift Tcl command:

Tcl Package and Version

Belongs to ::quartus::jtag

Syntax device_dr_shift [-h | -help] [-long_help] [-dr_value <data register value> ] -length <data register length> [-no_captured_dr_value] [-value_in_hex]
Arguments -h | -help Short help
-long_help Long help with examples and possible return values
-dr_value <data register value> Value of string operand type in either default binary or hexadecimal format to be written into the data register in the JTAG tap controller of the open device
-length <data register length> Length of the data register in the JTAG tap controller in the open device
-no_captured_dr_value Option not to return the data instruction register value. If this is specified, this DR scan may be packed together with the subsequent IR or DR scan until the device is unlocked or a captured value is requested
-value_in_hex Option to specify that the value string is represented in hexadecimal format

Writes the specified value into the data register of the JTAG tap controller of the open device. Returns the captured data register value. The captured value return can be disabled to improve the JTAG communication speed by packing multiple IR or DR scans together. The value is specified using either a binary string or a hexadecimal string. The bit on the left most side is the first bit shifted in. For example, using binary string "010001", the first bit shifted into the dr register is 1; the last bit is 0. The same string can be represented in hexadecimal as "11". The device must be locked before you can perform this operation.

Example Usage
# List all available programming hardware, and select the USB-Blaster.
# (Note: this example assumes only one USB-Blaster is connected.)
puts "Programming Hardware:"
foreach hardware_name [get_hardware_names] {
	puts $hardware_name
	if { [string match "USB-Blaster*" $hardware_name] } {
		set usbblaster_name $hardware_name
puts "\nSelect JTAG chain connected to $usbblaster_name.\n";

# List all devices on the chain, and select the first device on the chain.
puts "\nDevices on the JTAG chain:"
foreach device_name [get_device_names -hardware_name $usbblaster_name] {
	puts $device_name
	if { [string match "@1*" $device_name] } {
		set test_device $device_name
puts "\nSelect device: $test_device.\n";

# Open device 
open_device -hardware_name $usbblaster_name -device_name $test_device

# Retrieve device id code.
# IDCODE instruction value is 6; The ID code is 32 bits long.

# IR and DR shift should be locked together to ensure that other applications 
# will not change the instruction register before the id code value is shifted
# out while the instruction register is still holding the IDCODE instruction.
device_lock -timeout 10000
device_ir_shift -ir_value 6 -no_captured_ir_value
puts "IDCODE: 0x[device_dr_shift -length 32 -value_in_hex]"

# Close device
Return Value Code Name Code String Return
TCL_OK 0 INFO: Operation successful
TCL_ERROR 1 ERROR: Captured value cannot be disabled at the time when no value is shifted into data register.
TCL_ERROR 1 ERROR: A device has not been locked; exclusive communication must be obtained first.
TCL_ERROR 1 ERROR: A device has been locked by another application; exclusive communication cannot be granted within the specified timeout period.
TCL_ERROR 1 ERROR: The length of the value string specified does not match the length parameter specified.

Did you find the information on this page useful?

Characters remaining:

Feedback Message