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. Servlet监听器(Listener)实例

    以下内容是翻译自http://www.journaldev.com/1945/servletcontextlistener-servlet-listener-example: 说明:web.xml的加 ...

  2. mysql 中间件

    http://f.dataguru.cn/thread-543718-1-1.html mysql-proxy是官方提供的mysql中间件产品可以实现负载平衡,读写分离,failover等,但其不支持 ...

  3. pojo类对应的就是数据库中的表,pojo类属性类型一定要用包装类Integer等

    pojo类对应的就是数据库中的表,pojo类属性类型一定要用包装类Integer等 pojo类对应的就是数据库中的表,pojo类属性类型一定要用包装类Integer等 pojo类对应的就是数据库中的表 ...

  4. 怎样编译和安装memcached

     怎样编译和安装memcached 编译和安装步骤: $ apt-get install git $ git clone https://github.com/memcached/memcache ...

  5. 第一章--linux基础

    (一):linux系统根文件夹结构 Unix-like系统中的"文件系统"的概念包含两个意思,第一个是"根文件系统",第二个是"存储类文件系统&quo ...

  6. C# 文件里的类不能进行设计,因此未能为该文件显示设计器

    C# 文件里的类不能进行设计,因此未能为该文件显示设计器 vs 一直打不开设计界面  仅仅能查看代码界面  这时候须要查看  代码中  是不是 从 form    继承 假设不是 窗口类型 改为 fo ...

  7. 运行Java -jar somefile.jar时发生了什么(二)

    (6)Java.c中的LoadMainClass 位置jdk/src/share/bin/java.c 该方法负责载入main函数所在的类. 该方法首先载入sun.launcher.LauncherH ...

  8. git-svn for mac

    熟练使用 git ,新公司用的是 svn,这就尴尬了,为了这个习惯问题,我还是毅然坚持使用 git,但是又不与公司的 svn 冲突,所以就找到了 git 的 git-svn 插件. 在 mac 上使用 ...

  9. research plan1111

    Hello prof.Choi 感谢您的来电,与您的这次通话我已经期盼了很久.我来做个自我介绍,我叫陈飞,今年27岁了,是河北地质大学计算机科学专业的本科毕业生.我非常想提高自己的学历,现在经过刘老师 ...

  10. oc80--copy

    // // main.m // Copy基本使用,拷贝的本质:修改其中一个不能影响另外一个. // 每个oc对象都有copy和mutableCopy方法,前提是必须遵守NSCopying协议实现cop ...