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. graylog 市场

    https://marketplace.graylog.org/addons/246dc332-7da7-4016-b2f9-b00f722a8e79

  2. Android GIS开发系列-- 入门季(1) 起点

    前言 这个系列,待最终完成更新,大家体谅点,第一版本全部是参考的网络教程,最近会逐步的细化更新为可以直接使用的情况. 本系列的开发基于AS (  Android Studio ), 和ArcGIS 的 ...

  3. HDOJ 5402 Travelling Salesman Problem 模拟

    行数或列数为奇数就能够所有走完. 行数和列数都是偶数,能够选择空出一个(x+y)为奇数的点. 假设要空出一个(x+y)为偶数的点,则必须空出其它(x+y)为奇数的点 Travelling Salesm ...

  4. curl -O 下载文件

    curl -O 下载文件 学习了:http://blog.csdn.net/wulong710/article/details/53127606 curl -O http://a.b.c/a.tar ...

  5. wpf slider进度条的样式模板,带有进度颜色显示

    效果图: 仅仅需在前台加上这段代码就可以: <UserControl.Resources> <!--笔刷--> <LinearGradientBrush x:Key=&q ...

  6. myeclipse中Servlet出错

    在myeclipse中Servlet总是出错,执行的时候一直提示找不到出现404错误, 然后把代码拷贝到eclipse ee中就没有问题,一直不理解怎么回事. 然后发了好长时间试了好些方法,结果把my ...

  7. 跟我一起写Makefile:概述

    什么是makefile?也许非常多Winodws的程序猿都不知道这个东西.由于那些Windows的集成开发环境(integrateddevelopment environment,IDE)都为你做了这 ...

  8. 第三章、Tiny4412 U-BOOT移植三 时钟设置【转】

    本文转自:http://blog.csdn.net/eshing/article/details/37521789 这一章说明配置时钟频率基本原理 OK,接着说,这次先讲讲CPU的系统时钟.U-BOO ...

  9. [转]Dialog

    在Android开发中,我们经常会需要在Android界面上弹出一些对话框,比如询问用户或者让用户选择.这些功能我们叫它Android Dialog对话框,在我们使用Android的过程中,我归纳了一 ...

  10. 那些有意思的Github

    https://github.com/ngosang/trackerslist Linux下那些有趣的命令.. https://www.linu&xp&robe.com/linux-i ...