0% found this document useful (0 votes)
196 views1 page

TCL 1 2004.12 JobAid e

TCL user guide
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
196 views1 page

TCL 1 2004.12 JobAid e

TCL user guide
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Getting Help Math Functions

help -v command
man command
Tcl JOB AID 1 expr expression
incr var_name
info body rpt_TNV
info args rpt_TNV
Fundamentals
printvar var_name
# TNV.tcl
redirect –variable rptstring \
String Commands List Commands {report_constraint –all_violators}
string equal glob set TNV [regexp –all VIOLATED $rptstring]
string match llength echo "The TNV is $TNV"
string first lappend # To run a script in the Synopsys tool
string last lindex source TNV.tcl
string range lrange
string length lsearch # Avoid exec if possible, potentially large memory footprint
string index linsert redirect –file tmp1212 \
join lminus {report_constraint –all_violators}
append split exec grep –c VIOLATED tmp1212
regexp concat file delete tmp1212
regsub list
format lreplace
scan lsort
Control Flow
# The argument expr below is evaluated in the same
subst # way that the command expr evaluates its argument
if {expr} {body}
proc metrics {header} { if {expr} {body} else {body}
global metrics_cpu_time if {expr} {body} elseif {expr} {body} else {body}
echo $header while {expr} {body}
for {start} {expr} {next} {body}
if {![info exists metrics_cpu_time]} { foreach loop_var list {body}
echo "CPU time since beginning [cputime]" switch string {pattern {body}}
} else { break
set new_time [expr [cputime] - $metrics_cpu_time] continue
echo "CPU time since last metrics $new_time"
} < > <=
echo "Peak memory usage [mem]" Boolean compare. Returns 0 if false, 1 if true
Operators for >= == !=
set metrics_cpu_time [cputime]
expr
return "" Logical OR. Returns 0 if both operands are
||
} zero, 1 otherwise
# To remove user defined variables
Logical NOT. Returns 1 if operand is zero, 0
unset metrics_cpu_time !
otherwise
Logical AND. Returns 1 if both operands are
The Power of Tcl workshop series &&
non-zero, 0 otherwise
http://training.synopsys.com
Copyright © Synopsys 2005 – Customer Education Services 50-V-041-SLG-003

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy