We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 67587

Vivado - The Tcl command "puts $::tcl_interactive" always returns "1"


If "puts $::tcl_interactive" is run in the Vivado Tcl shell using either batch or GUI mode, it always returns a value of 1.

According to the help on the command tcl_interactive:

"tcl_interactive Contains 1 if tclsh or wish is running interactively (no script was specified and standard input is a terminal-like device), 0 otherwise."

I need to execute different Tcl commands in Vivado according to the mode (batch or GUI) of Vivado.

I expect to be able to use the standard $::tcl_interactive Tcl variable, but it equals 1 in both modes of Vivado.

Is there another way to know the current mode Vivado is running?

In batch mode, I see an unexpected value:

source my_script.tcl
puts $::tcl_interactive
INFO: [Common 17-206] Exiting Vivado at Mon Jul 25 10:38:05 2016...

In GUI mode, I can see the expected value:

source ./my_script.tcl
puts $::tcl_interactive
INFO:[Common 17-206] Exiting Vivado at Mon Jul 25 10:48:23 2016...


Two possible options to work around this command limitation are:

  1. Use "$rdi::mode"

$rdi::mode returns one of following depending on how Vivado was started.

  • gui
  • batch
  • tcl
  1. Use -tclargs when starting Vivado to pass on a value to the script.
AR# 67587
Date 10/13/2016
Status Active
Type Known Issues
  • Vivado Design Suite - 2016.2
Page Bookmarked