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# 56501

Vivado - How do you pass the argv/argc to TCL in the Vivado command line mode?


How do you pass the argv/argc to Tcl in the Vivado command line mode?


You can use the -tclargs option for Vivado.


vivado -mode batch -source test.tcl -tclargs 1 7

The test.tcl is as follows:

if { $argc != 2 } {
  puts "The script requires two numbers to be input." puts "For example, tclsh add.tcl 2 5". puts "Please try again." } else { puts [expr [lindex $argv 0] + [lindex $argv 1]] }

The lindex command returns the first and second items from the list of arguments entered at the command line. Items in a list are counted from zero.

AR# 56501
Date 10/23/2013
Status Active
Type General Article
  • Vivado Design Suite