UPGRADE YOUR BROWSER

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"

Description

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
1
INFO: [Common 17-206] Exiting Vivado at Mon Jul 25 10:38:05 2016...


In GUI mode, I can see the expected value:

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

Solution

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 Created 07/26/2016
Last Updated 10/13/2016
Status Active
Type Known Issues
Tools
  • Vivado Design Suite - 2016.2