0

I have a bunch of .sp files that need to be simulated with Cadence Spectre. Instead of run spectre as --

run spectre 1.sp->exit->run spectre 2.sp->exit->...

-- is there some kind of batch mode in Spectre so that i can launch Spectre once and execute these tasks sequentially (hold the spectre and run next task)? How can I achieve this?

I need this because each time launching the Spectre it needs check the license and does other things, costing unnecessary time.

Thanks in advance.

error message:

invalid command name "if{!0}"
while executing
"if{![eof $log]} {
    puts [gets $log]
  } else {
    close $log
    incr event_flag
  }"
    (procedure "GetData" line 3)
    invoked from within
"GetData file3"
can't wait for variable "event_flag": would wait forever
    while executing
LGMchili
  • 39
  • 6

1 Answers1

-1

You can use open command in tool interactive mode

#!/bin/sh  
# \
exec tclsh "$0" ${1+"$@"}

set event_flag 0 

proc GetData {log} {
    global event_flag
    if {![eof $log]} {
        puts [gets $log]
    } else {
        close $log
        incr event_flag
    }
}

# Run the following in loop   
set log [open "|spectre 1.sp"]
fconfigure $log -blocking 0
fileevent $log readable [ list GetData $log ]
vwait event_flag
Roman Kaganovich
  • 618
  • 2
  • 6
  • 27
  • Hi Roman, thank you very much for answering, but can you be much specific? I didn’t see there’s an open option when entered spectre interactive mode. – LGMchili Aug 05 '18 at 06:27
  • Just try to run the example for one interaction. The script will not continue till "spectre 1.sp" will not finished. Then wrap last 4 lines of code in loop , you only need to change 1.sp to 2.sp , etc. – Roman Kaganovich Aug 05 '18 at 07:47
  • Run the example you mean put them in a tcl file and run it with tclsh right? I just ran the example in tclsh, it gives “GetData file3” can’t wait for variable “event_flag”:would wait forever. – LGMchili Aug 05 '18 at 08:21
  • @LGMchili I've updated the example. Please try to run it as executable tcl file – Roman Kaganovich Aug 05 '18 at 08:38
  • it still reports the same err, did i miss something? i put the error message in the question, this is kind of important to me, please help me out. thanks a lot... – LGMchili Aug 05 '18 at 09:03
  • @LGMchili I've run my example with spectre , to be honest I'm not familiar with this tool, so I've used some spice file and it work as expected. I mean, I didn't get your error message. Please try to re-check your code. – Roman Kaganovich Aug 05 '18 at 10:30
  • 1
    The error message in the question is because you need a space between `if` and `{`. – Colin Macleod Aug 06 '18 at 11:52
  • This just runs spectre multiple times, multiple license checkouts. – Halsafar Jan 04 '20 at 18:31