Practical Exposure To Writing TCL With Examples - iVLSI - All About VLSI

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

iVLSI

all about VLSI


ivlsi.com Printed on January 3, 2024

Practical Exposure to writing TCL


with examples
December 10, 2020
Categories: Scripting, TCL
Tags: Practical Exposure, TCL Examples

Before explaining with the examples, let me clear few things.

⦁ Before going to write the script, first read all the blogs that I have mentioned in the TCL Scripting
section. Once you have the problem statement, then understand what your requirement is here
and then think how you can get the solution. Now try writing algorithm for the entire bridge
between problem statement and solution. Once done with the algorithm, start writing script step
by step with the validation over TCL shell or tool that you use.

If you have written one single script then write to me via comment or email. I would be happy to
see the change in you. I would be glad to see you learning and writing the TCL Script. If you want
to work on advance TCL writing, please let me know, we can further discuss.

⦁ Scripts examples that I am going to mention now can vary from tool to tool as few commands
vary when tool is di!erent. Some of the scripts will 100% work on ICC2 and some will work on
Innovus w.r.t physical design tools. You can learn to debug the script as this will help you to
enhance your debugging skills. Let me know via comment or email if you are looking for any help.

TCL Examples
1. Find out all the nets present in the design having length more than 200 micron.

foreach_in_collection net {
:
set dr_len dr_length]
if {$dr_len > “300”} {
echo “ $dr_len” >> nets_drLength.rpt
}
}

2. Find out the ports present in the design with direction as INPUT.

set OFILE
set ports “”

foreach_in_collection port {
puts $OFILE ]
}
close $OFILE

3. Find out the nets present in the design which are data and clock and dump into a file. You
may tweak the script according to your need.

set nets *

foreach net $nets {

set net_type net_type]


if {$net_type == “clock”} {
echo “ $net_type” >> nets_clk.rpt
} else {
echo “ $net_type” >> nets_data.rpt
}
}

4. Find out all the flops present in the design with their associated clocks.

set clks ]
foreach clk $clks {
all_registers -clock $clk
puts “register count of clock $clk : ]”
:
}
:

You might also like