【发布时间】:2017-04-07 18:39:47
【问题描述】:
我有两个脚本,一个被另一个调用。
我正在尝试使用命令行参数运行这些,但问题是,参数没有反映到第二个脚本中。
完整解释:
**Script 1 : run_simulation**
prelayout_${1}_${2}.v.gz
-input dump.sh
**Script 2 : dump.sh**
prelayout__${1}_${2}_tetsbench_ctl.
现在当我执行./run_simulation edt_intest chain
两个参数都反映在第一个脚本中,但没有反映在第二个脚本中,即它仍在读取prelayout__${1}_${2}_tetsbench_ctl。
那么,如何将参数导出到 dump.sh ?
提前致谢。
使用的工具是 irun(ncsim)。
脚本 1: run_simulate
`irun \` `-v lib1 \` `-v lib2 \` `./prelayout_${1}_${2}_testbench.v.gz \` <-- this is testbench `-input dump.sh \` `-f file_list \` `-top prelayout_${1}_${2}_testbench_v_ctl \` <-- top module of testbench `+notimingchecks \` `-log ${1}_${2}.log` <-- log file
脚本 2:dump.sh
`set tb_top prelayout_${1}_${2}_testbench_v_ctl` `force $tb_top.q_reg1.Q 1` `force $tb_top.q_reg2.Q 1`因此,当我运行命令 ./run_simulate edt_intest chain 时,run_simulate 中的所有变量都会更新,但 dump.sh 中不会更新或文件列表。
如何实现?
【问题讨论】:
-
为什么不直接从第一个脚本中调用第二个脚本,然后将 ${1} 和 ${2} 添加到参数中?
-
您的意思是使用“-input dump.sh ${1} ${2}”吗?如果是。我已经尝试过它不接受它并给出错误。 “-input”也是一个模拟工具选项,不确定它会接受它。
标签: shell command-line-arguments