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. Linux下汇编语言学习笔记70 ---

    这是17年暑假学习Linux汇编语言的笔记记录,参考书目为清华大学出版社 Jeff Duntemann著 梁晓辉译<汇编语言基于Linux环境>的书,喜欢看原版书的同学可以看<Ass ...

  2. Linux服务管理(Ubuntu服务管理工具sysv-rc-conf)(转)

    Linux运行级别 Linux系统任何时候都运行在一个指定的运行级上,并且不同的运行级的程序和服务都不同,所要完成的工作和要达到的目的都不同,系统可以在这些运行级之间进行切换,以完成不同的工作. 运行 ...

  3. NYOJ 16 矩形嵌套 (DAG上的DP)

    矩形嵌套 时间限制:3000 ms  |  内存限制:65535 KB 难度:4 描写叙述 有n个矩形,每个矩形能够用a,b来描写叙述.表示长和宽.矩形X(a,b)能够嵌套在矩形Y(c,d)中当且仅当 ...

  4. ci output

    ci output类可以将数据存起来,下面这个方法 a 代表的就是存起来的数据 public function(){ $data = array( 'name'=>'alice', ); $th ...

  5. 生成sde

    /// <summary> ///获取保存的SDE文件 /// </summary> /// <param name="sdePath">< ...

  6. 【解决】hive与hbase表结合级联查询的问题

    [Author]: kwu [解决]hive与hbase表结合级联查询的问题.hive两个表以上,关联查询时出现长时无法返回的情况. 同一时候也不出现,mr的进度百分比. 查询日志如图所看到的: 解决 ...

  7. swift 2.0 语法 数组

    import UIKit /*: 数组 * 格式 var arr:[Int] = [数值1, 数值2, 数值3] * 不可变数组  let  == NSArray * 可变数组    var */ l ...

  8. swift 2.0 语法 循环

    //: Playground - noun: a place where people can play import UIKit /*: for循环 * 基本用法和OC一致 * 条件表达式必须是bo ...

  9. The Pragmatic Programmer 读书笔记之中的一个 DRY-Don’t Repeat Youself

     The Pragmatic Programmer读书笔记之中的一个 DRY-Don't Repeat Youself 尽管自己买了非常多软件project方面的书,可是由于时间的问题.一直没有静 ...

  10. PowerDesigner中导入MYSQL数据库结构的步骤及问题解决

    今天在使用PowerDesigner,要导入MySql的表结构到PowerDesginer里, 记录下详细的操作步骤: 1.首先要确保机器安装了MySql的ODBC驱动,去http://dev.mys ...