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
Give Feedback device_virtual_ir_shift (::quartus::jtag)

The following table displays information for the device_virtual_ir_shift Tcl command:

Tcl Package and Version

Belongs to ::quartus::jtag

Syntax device_virtual_ir_shift [-h | -help] [-long_help] -instance_index <instance index> -ir_value <instruction register value> [-no_captured_ir_value] [-show_equivalent_device_ir_dr_shift]
Arguments -h | -help Short help
-long_help Long help with examples and possible return values
-instance_index <instance index> The index of the virtual JTAG instance
-ir_value <instruction register value> Value to be written into the instruction register in this instance. Operand must be of a TCL numerical type such as decimal (10), hexadecimal (0xa), or octal number (012)
-no_captured_ir_value Option to not return the captured instruction register value. If this is specified, this IR scan may be packed together with the subsequent IR or DR scan until the device is unlocked or a captured value is requested
-show_equivalent_device_ir_dr_shift Option to show equivalent device ir and dr shifts performed by this command

Writes the specified value into the instruction register of the specified virtual JTAG instance in the open device. Returns the captured instruction register value. You can disable the captured value return to improve the JTAG communication speed by packing multiple IR or DR scans together. The command also activates the target instance such that the consequent virtual DR shift operations are applied to this instance before the device is unlocked. Before any virtual DR shift operation, this command must be executed first to activate the instance. The device must be locked first before this operation.

Example Usage
# List all available programming hardwares, and select the USBBlaster.
# (Note: this example assumes only one USBBlaster connected.)
puts "Programming Hardwares:"
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

# The follow virtual JTAG IR and DR shift sequence engage with
# the example virtual JTAG instance.
# Two instructions: SAMPLE (1) FEED (2)
# SAMPLE instruction samples a 8-bit bus; the captured value shows the number of sample performed.
# FEED instruction supplies a 8-bit value to the logic connected to this instance.
# Both data registers corresponding to the IR are 8 bit wide.

# Send SAMPLE instruction to IR, read captured IR for the sampling number.
# Capture the DR register for the current sampled value.
device_lock -timeout 10000
puts "Current LED Value (sample #[device_virtual_ir_shift -instance_index 0 -ir_value 1]): [device_virtual_dr_shift -instance_index 0  -length 8 -value_in_hex]"

# Send FEED instruction to IR, read a two-digit hex string from the console, 
# then send the new value to the DR register.
puts "\nType in 2 digits in hexadecimal to update the LED:"
gets stdin update_value
device_lock -timeout 10000
device_virtual_ir_shift -instance_index 0 -ir_value 2 -no_captured_ir_value
device_virtual_dr_shift -instance_index 0  -length 8 -dr_value $update_value -value_in_hex -no_captured_dr_value

# Close device
Return Value Code Name Code String Return
TCL_OK 0 INFO: Operation successful
TCL_ERROR 1 ERROR: The specified virtual JTAG instance cannot be found.
TCL_ERROR 1 ERROR: One of the options, mfg_id, type_id and version is specified, but not all. All of them are required.
TCL_ERROR 1 ERROR: A device has not been locked; exclusive communication must be obtained first.