Tcl之Lab1
Task 1. Use help
1) What is the default switch for the redirect command? -file
help -v redirect # or redirect -help
2) Use the very last example in the man page, can you use the -append switch when redirecting to a variable? Yes.
man redirect
Task 2. Count library cells
Count the number of muxes and xor gates available in the technology library core_slow.db. Given that:
- Library cells can be reported using the following command: report_lib core_slow.db
- All mux cells begin with the letters mx (eg mx2a1)
- All xor gates begin with the letters xor (eg xor3b15)
1) First method
# Redirect library report to a variable and use regexp
redirect -variable rptstring {report_lib core_slow.db} regexp -all mx $rptstring
-> 36
regexp -all cor $rptstring
-> 24
2) Second method
# Redirect the library report to a file and use the unix command grep
# This is the less desirable method due to the potentially large memory
# footprint required for the exec command
redirect tmp1212 {report_lib core_slow.db}
exec grep -c mx tmp1212
-> 36
exec grep -c xor tmp1212
-> 24 # Use grep without options to print each line containing a pattern
exec grep xor tmp1212
# Delete the file if desired
file delete tmp1212
Task 3. Analyze an unfamiliar script
proc clock_domain {args} {
# This Tcl procedure identifies the clocks constraining input ports
foreach_in_collection each_port [get_ports -quiet $args] {
set paths [get_timing_paths -from $each_port]
foreach_in_collection each_path $paths {
lappend port_array([get_object_name $each_port]) \
[get_object_name [get_attribute $each_path endpoint_clock]]
}
}
foreach item [array names port_array] {
echo "$item $port_array($item)"
}
}
1) How many commands are in this script? 12 commands
Use the aquare brackets to help identify the embeddd commands.
2) How many occurrences of variable substitution are there? 8 occurrences
Use the $ to help identify the variable names. This procedure is using a type of variable called arrays.
3) How many arguments are required for the proc command (recall that {} are used to identify a single argument)?
3 argumets. proc clock_domain {args} {body}
4) What symbol designates a comment in a script? #
5) What symbol will continute a command over several lines? \
Tcl之Lab1的更多相关文章
- Tcl internal variables
Tcl internal variables eryar@163.com 在Tcl中内置了一些变量,并赋予了一定的功能.内置变量列表如下: 变量名称 功能描述 argc 指命令行参数的个数. argv ...
- SDC Tcl package of Timequest
Tcl comand Tcl Commands all_clocks all_inputs all_outputs all_registers create_clock create_generate ...
- Oracle数据库操作分类DDL、DML、DCL、TCL类别清单异同
DDL Data Definition Language (DDL) statements are used to define the database structure or schema. S ...
- linux tcl expect 安装(转)
linux tcl expect 安装 一.Tcl安装 1. 下载:tcl8.4.20-src.tar.gz http://www.tcl.tk/software/tcltk/downloadnow ...
- 为Tcl编写C的扩展库
Tcl是一个比较简洁的脚本语言,官方地址 http://www.tcl.tk. tcl脚本加载C实现的动态库非常方便. 1. 为Tcl编写一个用C实现的扩展函数. #include <stdio ...
- Tcl
Tcl(发音 tickle)是一种脚本语言.由John Ousterhout创建.TCL经常被用于快速原型开发 RAD.脚本编程.GUI编程和测试等方面. Expect Expect是 另外一种非常流 ...
- MySQL TCL 整理
TCL(Transaction Control Language)事务控制语言SAVEPOINT 设置保存点ROLLBACK 回滚SET TRANSACTION
- TCL:使用、添加库文件
>直接引用工具自带的库文件 通过指令: .1查看能直接调用的库文件路径 #可以查到工具默认库文件路径,一般包括回显中的路径以及回显中路径的父路径. info library #D:/Script ...
- TCL:表格(xls)中写入数据
intToChar.tcl # input a number : 1 to 32 , you will get a char A to Z #A-Z:1-32 proc intToChar {int} ...
随机推荐
- 洛谷——P1103 书本整理
https://www.luogu.org/problem/show?pid=1103 题目描述 Frank是一个非常喜爱整洁的人.他有一大堆书和一个书架,想要把书放在书架上.书架可以放下所有的书,所 ...
- ISO和焦距
要说什么是ISO还要从传统胶片相机说起,ISO称作为感光度,它是衡量传统相机所使用胶片感光速度的国际统一指标,其反映了胶片感光时的速度(其实是银元素与光线的光化学反应速率).而对于现在并不使用胶片的数 ...
- Mybatis在Spring环境下的启动顺序
主要看三个类: mybatis-spring-1.2.2.jar包 -> org.mybatis.spring.SqlSessionFactoryBean mybatis-3.2.6.jar包 ...
- Linux中W与Who命令的使用
踢掉一个从某个终端连上的用户pkill -kill -t pts/0 ---------------------------------------------------------------- ...
- 在全程Linux環境部署IBM Lotus Domino/Notes 8.5
架設藍色巨人的協同合作訊息平台 在全程Linux環境部署IBM Lotus Domino/Notes 8.5 珊迪小姐 坊間幾乎所有探討IBM Domino/Notes的中文書籍,皆是以部署在Micr ...
- ios MetalPerformanceShaders 使用总结
MPSCNNConvolution 1.初始化时传人 UnsafePointer<Float> 时要传入w,不能是 &(w[0]).否则w其实传入失败,卷积的结果是nan或inf. ...
- URAL 1326. Bottle Taps(简单的状压dp)
题目不太好读懂,就是先给你一个n代表要从n个物品中买东西,然后告诉你这n个东西的单位价格,在给你m个集合的情况.就是每一个结合中有x件物品.他们合起来买的价格是k.这x件物品依次是:p1--px.之后 ...
- mysql创建用户,并授予权限
mysql> GRANT ALL PRIVILEGES ON *.* TO jiqing@"%" IDENTIFIED BY '123456'; Query OK, 0 ro ...
- nginx搭建基于http协议的视频点播服务器
1,于由自己的服务器上已经安装好nginx(具体安装方法见我的另一篇文章,Linux中安装nginx),所以不再安装. 2,下载nginx_mod_h264_streaming-2.2.7.tar.g ...
- 网页分享URL
<a href="tencent://Message/?Uin=QQ号码&Site=qq联系">点击联系</a> 1.新浪微博:<a href ...