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的更多相关文章

  1. Tcl internal variables

    Tcl internal variables eryar@163.com 在Tcl中内置了一些变量,并赋予了一定的功能.内置变量列表如下: 变量名称 功能描述 argc 指命令行参数的个数. argv ...

  2. SDC Tcl package of Timequest

    Tcl comand Tcl Commands all_clocks all_inputs all_outputs all_registers create_clock create_generate ...

  3. Oracle数据库操作分类DDL、DML、DCL、TCL类别清单异同

    DDL Data Definition Language (DDL) statements are used to define the database structure or schema. S ...

  4. linux tcl expect 安装(转)

    linux tcl expect 安装 一.Tcl安装 1.  下载:tcl8.4.20-src.tar.gz http://www.tcl.tk/software/tcltk/downloadnow ...

  5. 为Tcl编写C的扩展库

    Tcl是一个比较简洁的脚本语言,官方地址 http://www.tcl.tk. tcl脚本加载C实现的动态库非常方便. 1. 为Tcl编写一个用C实现的扩展函数. #include <stdio ...

  6. Tcl

    Tcl(发音 tickle)是一种脚本语言.由John Ousterhout创建.TCL经常被用于快速原型开发 RAD.脚本编程.GUI编程和测试等方面. Expect Expect是 另外一种非常流 ...

  7. MySQL TCL 整理

    TCL(Transaction Control Language)事务控制语言SAVEPOINT 设置保存点ROLLBACK  回滚SET TRANSACTION

  8. TCL:使用、添加库文件

    >直接引用工具自带的库文件 通过指令: .1查看能直接调用的库文件路径 #可以查到工具默认库文件路径,一般包括回显中的路径以及回显中路径的父路径. info library #D:/Script ...

  9. 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} ...

随机推荐

  1. FreeMarker与Servlet结合示例

    一.最原始示例 1.引入POM依赖 <!-- https://mvnrepository.com/artifact/org.freemarker/freemarker --> <de ...

  2. NetCore发布WebApi项目到IIS服务器中

    1.确保已在机器上安装Net Core Runtime,,下载地址: https://dotnet.microsoft.com/download 2.点击WebApi项目右键->发布,选择IIS ...

  3. docker Cannot start container [8] System error: exec format error

    docker Cannot start container  [8] System error: exec format error 学习了:https://www.aliyun.com/jiaoch ...

  4. shell 例程 —— 解决redis读取稳定性

    问题背景: php读取线上redis数据,常常不稳定,数据响应时有时无. 解决方法:多次读取.每次读取全部上一次没读出的数据,直到全部获取. 本文实现用shell进行多次redis数据读取, 每次取出 ...

  5. LeetCode 953. Verifying an Alien Dictionary (验证外星语词典)

    题目标签:HashMap 题目给了我们一个 order 和 words array,让我们依照order 来判断 words array 是否排序. 利用hashmap 把order 存入 map, ...

  6. 桌面系统集成WEB认证系统方案

    最近做的一个项目,有WEB版.WPF版.手机版.领导想集成集团的一个现成的认证系统,姑且称这个认证系统名为 W4认证系统. W4认证系统有如下特点: 1.现成的 2.是个单点登录系统 3.不支持oAu ...

  7. Android:解决Gradle DSL method not found: 'runProguard()' 问题

    将Android Studio升级至最新版(1.0 RC 4)之后,运行项目时出现问题: Gradle DSL method not found: 'runProguard()' 从字面就能看出来,出 ...

  8. 如何根据configure.ac和Makefile.am为开源代码产生当前平台的Makefile

    1 2 3 4 5 6 7 8 9 //根据configure.in和Makefile.am生成makefile的步骤,基于UBUNTU 12.04 1.autoscan (可选) 2.aclocal ...

  9. jQuery的jsop,jsonp跨域请求

    https://www.cnblogs.com/chiangchou/p/jsonp.html

  10. myeclipse配背景色

    1:使jsp,html等页面为纯黑色. 2:发现JS的背景颜色还是默认的.而且还是块状的.将它设置背景为黑色的. *效果图: 参考:http://blog.csdn.net/ltqwby/articl ...