We are now in the funniest part ! Believe me Guys , i gone through the basics of the tcl at first this week , studying how it works and what are possible pitfalls and various others along with why it is used in Vivado , how it is implemented in Vivado.
In this post i would like to give better insights regarding tcl and vivado tcl (Yeah , there is a voltage difference between the two )
Firstly the TCL (but i remember the TICK show)
Most of you guys are familiar to programing languages like Python ,if true then you already understand tcl but If not , no harm its just a piece of cake.
TCL like python is a Interpreter language meaning you talk to it (give a command at one time) then it replies to you (Prints Output or Do the task)and again you talk and it goes on(Simple isn't it ).
But it can also be used as a scripting language where a list of tasks (even the Algorithm) is fed to the tcl console and it executes all the commands One by One (Line by Line) to the End , ths is what it mainly helpfull in automating things in terms of applications like Vivado.
What you can Do with tcl ?
You can do pretty much anything (just like any programing language) such as creating and storing values(strings,Integers,Floating point Numbers) in variable using SET (command), printing on console (using PUTS ) , execute a math (usnig expr ) , Conditional Execution (using if else),Looping (using while,for) , using your own methods (functions) ,file operations,Creating lists,Searching , using Dictionaries ...
Why should we Reinvent the Wheel , Similarly there is good Starting guide which is very clear,easy to understand.I found it useful in understanding about tcl ,you guys can read it here Free of Cost:
http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html
After Reading atleast upto chapter 14 (i.e..,from 1.Introduction to 14.Adding New Commands to tcl ) then only you go with Vivado tcl
Note: I strongly recommend you to complete prescribed (1 to 14)chapter of above book , to make yourself free from typing commands dumbly as given by anyother person.It wont take much time but worth the time spent
What is Vivado tcl then ?
It can be simply seen that tcl is no different from programing langauge like python , in order to implement any custom operations for a specific application like Vivado , they need to create their own functions for each and every specific operation they would like to implement in that application Such as Creating New Project/Open a Project,Create Blockdesign,Create IP through (command line)IP-Integrator,Modify the configurations of the IP,change the External connections(DDR,IO) , Add new Connections,Evaluate design,set Timing Constrains and SoOn.
All these functions are implement through Vivado tcl in addition to normal tcl functions and Xilinx has a great document (UG894) to be read to get acquainted to using tcl in Vivado , It really saves your design time.
You can find that Xilinx Vivado TCL Document here :https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_1/ug894-vivado-tcl-scripting.pdf
https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_1/ug894-vivado-tcl-scripting.pdf
Note:Some versions of Xilinx may not support few vivado tcl commands implemented for later versions,So download the UG894 for that version(above is for 2018.1 version)
Simple Way to work with vivado tcl ?
When ever to run Xilinx Vivado , there would be tcl console at the Bottom , you can run tcl commands from there and practise using them.
You can also see "vivado.jou" file in the directory where vivado executable is present,it keeps track of the tcl commands executed in the previous session and their outputs are in "vivado.log" file , these files are of Great use when you want to see how each GUI click you made turned into a tcl command for that operation.
You can also see the tcl command to be used by performing it using GUI and see the tcl command generated at the tcl window tab.
Is there any Need to Learn TCL ?
It is purely based on your oblective.
If you want to automate some basic processes in creating design , it is best choice as we can export a tcl script to another computer and creaate an exact replica of the project with same configurations,ip integrations in single execution (Power of Command Line !)
Finally as always:
If you guys feel difficulty in understanding tcl,don't forget to ask me in comments, i will do my best to help you understand it better .
In the Next post i will show you how to implement other peripherals in our design using tcl , So see you In my Next Post
Remember : Make sure you guys read the tcl starter guide before starting On !