2

I used to run a tcl script for the Cadence tools on a server, however, now the script fails to run.
The script is based on the following one:

#### Template Script for RTL->Gate-Level Flow
#### all basic steps except for DFT-scan

#### Fill in the <...> fields for your module 
#### and update library  search paths for your system

if {[file exists /proc/cpuinfo]} {
  sh grep "model name" /proc/cpuinfo
  sh grep "cpu MHz"    /proc/cpuinfo
}

#### Set up
set DESIGN test
set SYN_EFF medium
set MAP_EFF medium
set DATE test
set global_map_report 1
set map_fancy_names 1
set iopt_stats 1

set SYN_PATH "."
set _OUTPUTS_PATH outputs_${DATE}
set _LOG_PATH logs_${DATE}
set _REPORTS_PATH reports_${DATE}

set_attribute lib_search_path {. ./lib} / 
set_attribute hdl_search_path {. ./rtl} /
set_attribute information_level 7 /
set_attribute map_timing true /

set_attribute retime_reg_naming_suffix __retimed_reg /
set_attribute library lib
... continues

First I open a csh in order to run a csh script to setup the Cadence tools on the server, then I run source script.tcl. This used to work, however, now it fails with the following error:

Missing ].

And if I comment the first if:

set: Syntax Error.

What may have changed in the server for this to happen and how can I fix this? The script did not change, so its syntax is correct.

timrau
  • 22,578
  • 4
  • 51
  • 64
Deadlock
  • 799
  • 1
  • 7
  • 15
  • Do you `source script.tcl` in csh? – timrau Jan 17 '15 at 16:03
  • I was trying to, but in fact I forgot to run the cadence tool first, as in the answer from timrau – Deadlock Jan 17 '15 at 17:15
  • Sounds too good to be true. How did the "csh script to setup the Cadence tools" look like? Did it bring you into Cadence tool instead of staying in csh? – timrau Jan 17 '15 at 17:19

1 Answers1

2

As your comments in code described, you should call source script.tcl inside the tool, not in csh which doesn't understand Tcl syntax, nor in tclsh which doesn't understand those Cadence-specific Tcl commands.

Also, the two line

sh grep "model name" /proc/cpuinfo
sh grep "cpu MHz"    /proc/cpuinfo

should be

exec grep "model name" /proc/cpuinfo
exec grep "cpu MHz"    /proc/cpuinfo

since exec is the correct Tcl command for calling shell commands.

timrau
  • 22,578
  • 4
  • 51
  • 64