如何用条件选项调用Tcl命令 [英] How to call Tcl command with conditional option

查看:248
本文介绍了如何用条件选项调用Tcl命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在调用Tcl命令时有条件地附加选项。我使用Xilinx Tcl命令synth_design,如 UG835 p.1042使用Tcl版本8.5。

I want to conditionally append options when calling a Tcl command. I'm using a Xilinx Tcl command synth_design as indicated in UG835 p.1042 using Tcl version 8.5.

例如,我想要:


  1. 构建一个数据结构,该数据结构将追加 -verilog_define MACRO 中的0个或多个数据结构,其中 -verilog_define 不是字符串,而是一个选项,

  2. 将该结构以其展开形式传递给该命令。

  1. build a data structure that will append 0 or more of -verilog_define MACRO where -verilog_define is not a string but an option, and
  2. pass that structure to the command in its expanded form.

这里:

synth_design -top ${top}_top -part ${part} -verilog_define MACRO1 -verilog_define MACRO2
                                           ^-------------------------------------------^

成为:

synth_design -top ${top}_top -part ${part} ???
                                           ^-^


推荐答案

$ c> {*} $ makro (扩展)

With {*}$makro (expansion)

例如:

set makro {-verilog_define MACRO1 -verilog_define MACRO2}
synth_design -top ${top}_top -part ${part} {*}$makro

这篇关于如何用条件选项调用Tcl命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆