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} ...
随机推荐
- 用信号量及其PV操作处理实际问题
43.现有3个生产者P1.P2.P3,他们都要生产橘子汁,每个生产者都已分别购得两种不同的原料,待购齐第三种原料后就可配制成橘子汁装瓶出售.有一供应商能源源不断的供应糖.水.橘子精,但每次只拿出一种原 ...
- Oracle创建表空间、用户名、密码步骤教程
第一步,以最高级别 SYSDBA 身份登录数据库 cmd 进入命令行 登录方式一: C:\Documents and Settings\Administrator>sqlplus sys/sys ...
- vue2的简单时间选择组件
github: https://github.com/longfei59418888/vui (记得给一个 start,以后有一起讨论,各种好组件) demo : http://60.205.2 ...
- Android学习之利用BitmapFactory工厂压缩图片
BufferedInputStream in = new BufferedInputStream( new FileInputStream(new File(path))); BitmapFactor ...
- eclipse中报错:java.lang.OutOfMemoryError: Java heap space
问题: 在eclipse中执行java程序.去重100多万的数据,报例如以下错误: java.lang.OutOfMemoryError: Java heap space 异常原因: 在JVM中假设9 ...
- WPF 下 label 的刷新
WPF下,label控件并没有什么 Refresh() 的方法.那么现在问题就来了. 假设有这么个场景:WPF窗体上有一个按钮,一个Label,按下按钮,触发一些耗时的操作:在操作之前,Label显示 ...
- 一次次迭代 百度语音生成 api 字幕 语音的同步性 关键
发音字符 数一样 D:\myv\semHAND9myuid1523961381.avi 0.7053863117786668 --------------- 深圳市雅超服饰有限公司是一家专业设计制作高 ...
- Script Library 配置 和 使用
Script Library有两个级别,Workspace级别和Project级别 使用:这里的package指的是Script Library下的文件夹名,和引用代码里的package没有关系
- Gift
[问题描述] 人生赢家老王在网上认识了一个妹纸,然后妹纸的生日到了,为了表示自己的心 意,他决定送她礼物.可是她喜爱的东西特别多,然而他的钱数有限,因此他想 知道当他花一定钱数后剩余钱数无法再购买任何 ...
- CF732 F Tourist Reform——边双连通分量
题目:http://codeforces.com/contest/732/problem/F 首先把边双缩点,边双内部 dfs 一个顺序一定是可以从每个点走到边双内部所有点的,因为它是以环为基本单位: ...