DC/PT在任意位置停止执行脚本的方法

您所在的位置:网站首页 crispt怎么读 DC/PT在任意位置停止执行脚本的方法

DC/PT在任意位置停止执行脚本的方法

2023-11-27 06:47| 来源: 网络整理| 查看: 265

DC/PT在任意位置停止执行脚本的方法 现在的RTL综合的环境中,基本上都是用脚本写好的集成平台。每次项目只需要变更SDC和lib及设计相关的约束/设定即可。这样可以将设计者的经验不断积累并往下流传,后续的项目开发的时候可以极大的节省搭建环境的时间,让后端工程师专注于设计本身,而不是将经历放在环境的搭建和debug 上面。 不过,一个复杂一点的RTL综合环境很可能包含几十个TCL脚本。更为恶心的是,有写TCL脚本中,还会调用到外部的程序,如perl/shell之类的脚本,等待这些外部脚本执行完成之后,DC继续执行后续的TCL脚本。 每次项目开始的时候,都需要花一定的时间进行项目的移植,这时候环境总难免在某些过程中出错。或者,有时候,我们希望环境脚本执行到某一句的时候就停下来,不继续执行后续的脚本,但是,又希望DC程序不退出,以方便我查看当前的设计或者环境是否存在什么问题。 以前我的方法是,如果不希望执行某个行开始以后的所有脚本,我就将这一行以后的所有行都comment out掉。但是,这样做很麻烦。如果这一行是在main script中还好,如果这一句是在sub script(被main scipt 或者其他的sub script source的scipt)中,那么就要花很多的时间进行comment out了。不注意的情况下还很容易出错。 于是,我一直期待一个命令,执行这个命令之后,DC会停止执行后续的所有脚本。但是,翻遍了DC的command guide也没有找到这个命令。不知道synopsys为什么不设计一个这样的脚本。当然,不排除我看漏掉了的可能,也许别人时设计了的呢。 直到今天,重新看DC的students guide的时候,注意到了这个东西:

sh_continue_on_error

之前做项目的时候,由于设计中有批量对设计进行处理的命令,会出现一些意料之中的错误,所以这个命令总是会被有意无意地设置成true。以让DC在遇到错误的时候能够继续执行下去。但是,如果被设置成false,DC在执行的过程中,如果出错,就会停止后续脚本的执行,然后返回dc_shell的命令行。 如果我希望在某一句停下来,则执行了这一句之后,将sh_continue_on_error设置为false,然后执行一个错误的命令,然后,DC就会在发生错误的这一句停下来。然后我就可以进行我的操作了。这样,用这两行命令,也可以使DC在脚本的任意位置停下来。 命令如下: ~the line & above is your tcl code~~~ set sh_continue_on_error false HAhahahahah ;#这里随便写一个DC不存在的命令。然后DC执行到这里的时候就会停止下来。 ~the line & above is your tcl code~~~ 下面给出一个示例:

脚本stop_excute_script.tcl

set sh_continue_on_error_org_value $sh_continue_on_error set sh_continue_on_error false echo "SHAOKC0" current_design echo "SHAOKC1" ###the "HAhahahahah" will not be recognized by DesignCompiler.So,this line will cause an error. ###the DesignCompiler will stop at here. HAhahahahah echo "SHAOKC2" set sh_continue_on_error $sh_continue_on_error_org_value echo ""

执行的结果: 这里写图片描述

从上面的图中可以看出,source的脚本,在执行到 “HAhahahahah” 的时候,由于DC中没有这个命令,所以报错,从而导致DC退出脚本的执行,回到dc_shell命令行。

附录

下面是sh_continue_on_error的解释:

dc_shell> man sh_continue_on_error 3. Attributes and Variables Command Reference sh_continue_on_error NAME sh_continue_on_error Allows processing to continue when errors occur during script execution with the source command. TYPE Boolean DEFAULT application specific DESCRIPTION This variable is deprecated. It is recommended to use the -con- inue_on_error option to the source command instead of this variable because that option only applies to a single script, and not the entire application session. When set to true, the sh_continue_on_error variable allows processing to continue when errors occur. Under normal circumstances, when exe- cuting a script with the source command, Tcl errors (syntax and seman- tic) cause the execution of the script to terminate. When sh_continue_on_error is set to false, script execution can also terminate due to new error and warning messages based on the value of the sh_script_stop_severity variable. To determine the current value of the sh_continue_on_error variable, use the get_app_var sh_continue_on_error command. SEE ALSO get_app_var(2) set_app_var(2) source(2) sh_script_stop_severity(3)


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3