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} ...
随机推荐
- Spring/Maven/MyBatis配置文件结合properties文件使用
使用properties文件也叫注入,比如把一些常用的配置项写入到这个文件,然后在Spring的XML配置文件中使用EL表达式去获取. 这种方式不只Spring可以使用,同样MyBatis也可以使用, ...
- 源码分析-react2-根节点渲染
//FiberNode{ alternate : '通过该属性和后面的切片进行比较', child : '改切片的子切片', firstEffect : '当前要加入的切片', stateNode : ...
- CString、char*与string的区别
三者的区别 CString 是MFC或者ATL中的实现: string 是C++标准库中的实现: char* 为C编程中最常用的字符串指针,一般以’\0’为结束标志. string和CString均是 ...
- [Vue-rx] Handle Image Loading Errors in Vue.js with RxJS and domStreams
When an image fails to load, it triggers an error event. You can capture the error event and merge i ...
- 解决Mysql存储中文的问题
Mysql无法存储中文或者中文乱码,当然是编码的问题.你可以mysql -u root -p进入Mysql命令行环境,然后输入命令查看当前编码格式: mysql> show variables ...
- ubuntu下安装jre
jre下载地址:http://www.java.com/en/download/manual.jsp 1.将下载好的jre-7u55-linux-x64.tar.gz文件解压缩,得到jre1.7.0_ ...
- 《textanalytics》课程简单总结(1):两种word relations——Paradigmatic vs. Syntagmatic
coursera上的公开课<https://www.coursera.org/course/textanalytics>系列,讲的很不错哦. 1.两种关系:Paradigmatic vs. ...
- 配置远程连接mysql数据库 Connect to remote mysql database
设有本地机器(local machine), ip地址为localip 远程机器(remote machine), ip地址remoteip 要通过在local machine的终端连接remote ...
- 又发现2个高人写的Delphi图文并茂的消息研究
http://ymg97526.blog.163.com/blog/static/173658160201139101120862/http://ymg97526.blog.163.com/blog/ ...
- tiny4412 裸机程序 七、重定位代码到DRAM【转】
本文转载自:http://blog.csdn.net/eshing/article/details/37116637 一.关于DRAM 上一章我们讲解了如何对代码进行重定位,但是将代码重定位到只有25 ...