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} ...
随机推荐
- codevs——1430 素数判定
1430 素数判定 时间限制: 1 s 空间限制: 1000 KB 题目等级 : 青铜 Bronze 题解 题目描述 Description 质数又称素数.指在一个大于1的自然数中, ...
- [C++] 自己主动关闭右下角弹窗
近期腾讯.迅雷等各种client,都越发喜欢在屏幕的右下角弹框了. 有骨气的人当然能够把这些软件卸载了事,可是这些client在某些情况下却又还是实用的.怎么办呢? 作为码农,自己实现一个自己主动关闭 ...
- Spring MVC : Java模板引擎 Thymeleaf (二)
本文原计划直接介绍Thymeleaf的视图解析,但考虑到学习的方便,决定先构建一个spring-mvc. 以下的全部过程仅仅要一个记事本和JDK就够了. 第一步,使用maven构建一个web app. ...
- $.getJSON() 未能执行回调函数的缘由
$.getJSON() 方法使用 AJAX 的 HTTP GET 请求获取 JSON 数据. 语法 1 $.getJSON(url,data,success(data,status,xhr)) url ...
- 工作总结 datatable 里的 数据 rows Columns
json 格式数据 row 6行 每行 81 列 对应数据 col 81 列 每列代表字段
- 从IBM的计划中分析出中国重新相当然的错误选择吗
<IBM欲用物联网技术解决北京雾霾难题> http://security.zol.com.cn/469/4690141.html 读了上文.分析出的. 因为我没有太多的数据.不好分析. 有 ...
- "未能载入文件或程序集“XXX”或它的某一个依赖项。系统找不到指定的文件"的解决方式
今天在写反射调用的时候失败了,经过调试和分析,终于攻克了,以下我就详细说明. 一,报错的现象 未能载入文件或程序集"DalSQL"或它的某一个依赖项.系统找不到指定的文件. 说明: ...
- Server Tomcat v8.0 Server at localhost failed to start.
怎么办? 查资料的话别人会告诉你须要删除一个东西.这是一种方法.可是你的错误并不是通过这种方法能够解决. 比方像我 <url-pattern>login</url-pattern&g ...
- Flash--元件和实例
1.元件简述: 元件在Flash影片中是一种特殊的对象.在Flash中仅仅须要创建一次,然后能够在整部电影中重复使用而不会显著添加 文件大小. 事实上在使用元件时,我们一般使用的是该元件的实例,所以说 ...
- CodeForces 16B Burglar and Matches(贪心)
B. Burglar and Matches time limit per test 0.5 second memory limit per test 64 megabytes input stand ...