Chip123 科技應用創新平台

 找回密碼
 申請會員

QQ登錄

只需一步,快速開始

Login

用FB帳號登入

搜索
1 2 3 4
查看: 7990|回復: 1
打印 上一主題 下一主題

[問題求助] 版本ubuntu 11.10 軟體nanosim 無法執行錯誤?

[複製鏈接]
跳轉到指定樓層
1#
發表於 2012-5-6 13:58:13 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
10Chipcoin
各位大大好:
: O: |4 I8 V1 P5 r8 z; Q                      小弟執行nanosim時,卻無法跑出視窗來,有個錯誤可是我不清楚該如何解決?問題如下
% s  V! V/ l/ I% i4 i5 \3 G                      [: 113: 64: unexpected operator% @& w. y5 d5 R4 u
/opt/EDA/nanosim/cur/linux/ns/bin//scripts/nanosim: 1: Syntax error: Unterminated quoted string+ H0 C: ]0 v# R
有大大遇過這方面的問題或是指導我方向去解決, 謝謝. $ n3 c4 Y+ C* {; }
我在猜可能是這個檔案內的文字需要修改 但不知道該如何修改?6 x# x; E" B4 A! c( s; g
以下為/opt/EDA/nanosim/cur/linux/ns/bin//scripts/nanosim 的檔案內容:4 O+ e7 t- A1 n
    #!/bin/sh
$ d7 L8 C1 X, o  P# L#
( N. K" c  m2 R# Copyright (C) 2001 Synopsys INC
, u) u0 ^* U3 W: W# EPIC Dynamic Simulation Wrapper (DSW): I9 T8 s) y& s! U" B, ~$ O  U5 a
#
' B$ @9 k, Y: x3 F' V$ Q" Eeval ${DBG_EPIC_WRAPPER:+"set -x"}
# A0 w, z$ d, e. P$ ]4 X6 J% [' ]* S6 f+ I' t6 G2 e
if [ "$EPIC_WRAPPER_DVLP" = "" ]; then/ o5 T  z8 x3 q& T
    TEMP_ARCH="$SES_ARCH"
- _: A7 V- M( e7 L2 P  W* Relse% A* `; Y4 G! ^% {2 H% A
    TEMP_ARCH="$EPIC_ARCH"
' g$ N( z) @. _fi& f2 @. j' F1 J$ Y) P

" [% U8 c6 o9 T! l5 bscan_for_hva_args()
* Q9 a, h6 U1 j, y# D5 o{
/ g7 g6 s) b* \' p4 c  /bin/rm -f hva.init 1>&2% k, J# F) ~$ |. e; Z4 O
  while [ $# -gt 0 ]; do
& h# q; F7 z5 \6 U    case "$1" in  M4 F+ n/ ]# g7 S! b9 U7 t
      -vaf)
$ z9 Q9 u0 x4 u) k           have_vaf_flag=1
4 w9 n9 M9 @8 Z3 r           have_va_flag=0
. t: L9 E  g6 _           shift;" M# p  L) x* f$ R3 \) u# [$ b, r& O
           continue;1 i; {. C9 f9 z( v1 R
        ;;
( J1 |* I/ e2 M( b. B6 _4 m/ R) U      -va)
4 p8 ?5 j2 @; z( M- P% e: n: X           have_va_flag=1
, H- g2 |+ B$ t           have_vaf_flag=0
3 ~9 f! l; v& g$ w           shift;8 d4 s$ @$ W4 C: E
           continue;
+ E( z' `9 y5 H( Q        ;;3 O8 p( M/ \/ N! Y$ Q5 M7 o) g2 u6 l
      -*)9 U% \; Q: A3 O) r& M
           ARGV="$ARGV $1"
5 V! F8 N8 D) E9 A2 `4 I! i7 E9 u           have_va_flag=0
4 a6 c7 J4 I# n/ z9 i- k           have_vaf_flag=0" l$ x. ]$ G1 T5 G! ?
           shift;
. o. j9 G& X( b  `           continue;, V* k" O0 Q! n3 r' w3 R$ q% p% @
        ;;: k- v- _! T+ K! L3 j# ?8 h& ?
      *)
4 ]5 v9 k( G$ H# `           if [ x"$have_va_flag" = x"1" ] ; then
7 D# g- s5 E/ c% |              VA_FILE="$VA_FILE $1"
' t8 b, d5 [" P3 t           elif [ x"$have_vaf_flag" = x"1" ] ; then 9 Q, U- g* f7 h  _. Y
              X="`cat $1 | sed -e '/\;/d;`"! G2 s" X) G6 o" `
              for token in ${X}; do' F4 D& W- U, g6 h4 i. T9 g  }
                 VA_FILE="$VA_FILE $token"
$ y& b8 Q) y2 X7 B              done
+ ~3 Q# M/ }- N5 Q8 ?7 Q3 J           else/ n& j* w# G; v0 k- b2 L  @8 B9 Y
              ARGV="$ARGV $1"
. V4 j# |! h3 X           fi
: d6 t3 @. w$ C           shift;
! R, }' x% n8 Z        ;;
5 ?' T# b! N6 g% K" h3 K    esac
, `$ ]( _8 \- C; l6 H) t  done) T0 X* D: J: ^

6 c) r4 Q& ~. F; i  if [ x"$VA_FILE" != x"" ] ; then
1 a0 y! _! A3 J6 n% O# l- A0 Z##     /bin/echo " xxx ARGV $ARGV". J- s, s4 t8 N; I! F  h% ~" x/ X
       /bin/echo "choose nanosim $ARGV ;" > hva.init
! [% p! Q* ~8 k% i/ v" Y       echo vcs +ad=hva.init $VA_FILE -o simv
1 S& x5 p' g3 C6 [+ W       vcs +ad=hva.init $VA_FILE -o simv$ J- y, i- M# k# i# i
       exe_status=$?
+ I" S6 [( `* Z& n* }       if [ $exe_status != 100 ]; then
$ }0 p! V; [- b/ N          /bin/echo ""3 \! e. p5 {7 r! s7 z$ {7 t
          /bin/echo "ERROR: Execution of vcs exited with code $exe_status"$ O: ~8 O! Y& F5 ]: y$ D$ J. e
          /bin/echo ""
8 @4 {0 r; ]* l  j          exit $exe_status! E' d4 _) C) ^: u5 r5 I2 ]
       fi
  @1 G& o" T( T       hva_files="-n simv.daidir/amsVD.ntl simv.daidir/amsWRAP.spi"
: a) Q$ ]" w& g' B, ^( N       ARGV="$ARGV $hva_files"
: @6 y7 s5 W( T* o" B" ^8 e  fi
8 o% \- Y* f$ Q- ?# @3 T3 G}6 A# d' k$ a3 C" \: n6 ~
#-------------------------------------------------------------------------
$ Q6 Y: B* q! f2 H( i! g- K; u" K% T+ p+ z0 o0 c8 s6 X
cleanup()
; W$ {/ a% C; ~7 r" _( R{* x4 f; U1 X  X& D
    if [ -d "$rundir" ]; then
2 a0 Z' E7 \) y  `1 ^- P( k        # On AIX, a .nfsXXX file is created if libModel.o is removed
7 R: [* ^2 b- d( M        # so .epicrun is not removed because directory is not empty.  g$ s0 A9 [' z: J4 n8 n
        # Solution is to remove it again if the first rm failed
1 t8 w8 F. a  ^) r  e+ U        # (rm -rf $rundir || rm -rf $rundir) 1> /dev/null 2>&1, c) ]9 T; J" Y- D5 J4 m
        if [ "$EXTRA_CAPACITY" = "YES" ]; then% p" ~- A2 a- `/ U6 U( e
        chmod u+x $rundir/rpcidfile! j6 \6 N6 J* l4 F: E
        $rundir/rpcidfile6 _' U; M, Y9 |% M2 B: h
        rm $rundir/rpcidfile2 B+ t" r; G1 l* x
        fi- X( u5 q. C" N4 P- a) G7 i
        rm -rf $rundir' u2 u2 z5 d2 @+ [7 s7 H5 \
8 o+ y$ Q1 V5 J5 h. }
        #Due to NFS problem, we have to copy files needed to
9 }" p! W- Z( o        #/tmp/<temporary directory>, then symlink's files
! X6 l- J/ l; x7 f+ r  q, ^, ?        #to the local temporary 'rundir'. This avoids the problem
% ?" A* Q7 C1 d$ n4 @( A% C7 x        #to remove 'rundir'
0 v' o# a) g$ h' M: D2 Z        if [ "$EPIC_ARCH" = "RS6000_AIX_4" -o "$EPIC_ARCH" = "RS6000_AIX_5" -o "$EPIC_ARCH" = "aix64" ]; then9 c2 a) a  {( N7 x
          if [ -d "$tdir" ]; then
. C( Y0 J! V/ x            rm -rf $tdir
) e6 j$ w& H( u; i5 w          fi5 k% w* E0 n+ J8 b: W& J  E
        fi; {3 d; l" x4 m; J& {" C
    fi
9 {3 F' G; D; n: s2 H9 P    if [ ${exitstatus:-0} -eq $ld_err_code ]; then+ S9 D& G9 Y! s; u
        [ "$has_model" = "YES" ] && rm -f $cwd/libModel$suffix6 M4 _2 X2 `) u9 r
        [ "$has_custom" = "YES" ] && rm -f $cwd/libCustom$suffix
3 l: Z9 m4 `- K" P    fi7 k; `5 e6 O7 w+ t3 O9 c
    [ -f "$EPIC_SCRIPT_MESSAGES_FILE" ] && rm -f $EPIC_SCRIPT_MESSAGES_FILE 1>&2
/ Q) ]# |5 I4 v# p% H8 I    exit ${exitstatus:-0}$ R' a) o: W+ x& r% Z
}
# S1 E. c4 t  T1 o* X
# c& k# ^4 |7 l% l: d. J$ h6 YExit(). A6 _$ `0 @- e5 ^" z
{
% e( d! `; E% h    exitstatus=$1
+ v7 ^) L5 i0 B    exit $exitstatus6 s' }- R+ \6 s! C
}
" L1 C$ M' I- _. @7 `$ c
$ o% `9 I) a! d- V  {5 w1 e# get_epicrc filename keyword
7 I% z  b/ V; |6 v( _$ sget_epicrc()
1 A, \4 n: o0 b% f3 E{
5 F& H9 b/ @1 J5 J% O3 U  V; B7 o    [ -f $1 ] || exit 08 M  t1 \1 Z0 B2 W1 H* E3 ^
    key="/^$cmd2:/{print \$3}". H! [: Z# |: n# u
    awk -F":" "$key" $1% r6 @: g2 D8 v5 M/ ^
}& m, Y) q1 A7 F  z% n
' X  c- n7 {# S  L! o. H. o
#
( I) [- P: ]6 v+ Z# set datasize limit to hardlimit9 P- n$ A4 j5 i- [* p) n
#: k+ [! R" B3 r1 A! g1 O- v
set_data_limit()
" Y7 b! t5 i5 J  |& o{
5 o, h% K5 e# c1 T# X' T: `    dbglimit=06 O. e3 A4 T1 y( V: c" m) T* B3 x
    hardlimit=`ulimit -Hd`: o4 e" }9 S0 d/ v6 y7 y- }
    softlimit=`ulimit -d`* f  D; R* d) A" t
    desiredlimit=3500000& [" H/ s( j/ f0 |& r6 `3 G
    hardisunlimited=0
. ]1 H$ b( y( l, [( G1 T    softisunlimited=06 @' c1 R' B$ W1 k
    is64=0
) h7 d* i0 E& t, i5 ^; `- n/ l4 w8 d) W3 R, l' c% N
    case "$EPIC_ARCH" in" f6 e7 T$ C6 F9 U
    *SUN*64)
7 k6 F+ b  \3 x# X5 {/ o6 b4 X        is64=18 ~: X: H* s. R
        ;;( E. I* K9 o) ~1 v8 J$ L* a
    amd64)
. `  O3 n1 A  a7 l        is64=1
. ~3 K  S- Q4 `; a' }        ;;  q- x1 l3 n: E" l, v5 k
    x86sol64)
8 T* }3 v3 L2 F1 t        is64=1
# B9 Y) e) S1 h) y1 y        ;;  H: {* v2 h- ?1 _
    aix64)+ }( E, a! k# G# e* ^1 W; N
        is64=1" o  T9 `; |, L) H6 z
        ;;
( w/ {* x+ ]: _+ r/ l    suse64)
% |0 Y% ]: W8 r3 Z( o        is64=1
" F- |! K& ?. A        ;;
& ^& G. Y1 F3 o) E# a0 h    esac
: w5 E% P) q! S$ x7 U3 W
2 p1 K9 y* w, \4 g& ~/ f    if [ $dbglimit -eq 1 ]; then
# ^% L! C/ F' Y9 M* j) I. \        echo hard $hardlimit soft $softlimit
. l0 A6 X& K- h: W    fi& u# ]4 `* P* M- F" c6 B5 m1 Q

; s) {# v6 ^' G1 y    if [ x$softlimit = "xunlimited" ]; then% y' t' v4 \! `# ]- |+ {
        softisunlimited=1
: I) e9 B, J4 V7 T% O3 M    fi9 w. T, |  C2 A. d* @4 Y, a
/ \4 ~- a; g0 g; v
    if [ x$hardlimit = "xunlimited" ]; then
& S# t0 q/ r+ n0 D, M2 v        hardisunlimited=1
1 Z5 k; O2 @  }    fi7 K. D" E* J! c8 u8 j3 U

% N( a( A/ K7 r" i& b. v6 ^    # 64 bit machine should have bigger than 4G
! E; S- l) S- c3 w) R" V    if [ $is64 -eq 1 ]; then0 `5 s* p- j: {& ?" T! M
        desiredlimit=5000000
' M, o6 y+ `4 E4 j! E6 ~( \    fi
" h. `: }* m& X3 \2 x1 T4 K
2 Q* Y8 V# x: _0 e    if [ $hardisunlimited -eq 0 ]; then
/ e! ]1 X1 K7 o& A. T        if [ $hardlimit -lt $desiredlimit ]; then, b% c5 u7 H+ B) e8 }$ F
            echo "WARNING: datasize hard limit $hardlimit K is too small."1 C9 k; }; ^2 `6 J
        fi
$ Z9 J, V* d: k$ q' |6 m: D) C$ Q    fi
' ~% O% u- D4 C! _' ]2 R2 O2 x' j9 D( x
    if [ $hardlimit != $softlimit ]; then
, Q$ {! j2 ^# @* d( H        ulimit -Sd $hardlimit
* X+ g+ E6 c% ^  `  |: d#        echo "WARNING: datasize limit is set to `ulimit -Sd`"# r6 a5 l5 z1 [0 ~$ W0 C
    fi1 @% ~( H6 d1 l: O
5 Y) \$ m& ^5 Y# p2 x
    if [ $dbglimit -eq 1 ]; then# S. H0 e3 L/ x3 v" U" L
        echo datasize hard limit: `ulimit -Hd`8 e& t6 R' c- n+ ~+ g5 g" _6 ?( R" P4 h
        echo datasize soft limit: `ulimit -d`
6 ^) H8 K: T8 M; @' V  ^    fi
* j# `& u- h5 c8 ~}
0 v9 E! Z( N- }) C0 D  ^! ~; D
#: U( P# X4 F$ e4 b: ~* S1 R
# set stacksize limit to desired limit
! J8 |, n7 u( R4 G2 x2 D5 I: T## ~% Z* C4 u5 N/ B2 P2 [
set_stack_limit()$ h/ g5 P8 I; p6 w1 A7 j- ?
{1 ?8 t8 P7 C3 A& Z) C' L
    dbglimit=0$ ^% z* s- f% {/ p
    hardlimit=`ulimit -Hs`
5 F" M/ e$ v& h; V' W+ a2 t    softlimit=`ulimit -s`
& H% K% a) x9 w- T    desiredlimit=60000
- v: c, U$ k' `: P: K) U6 f    hardisunlimited=0, ]  p. |" h! P. T5 a- i) j
    softisunlimited=0
. j9 X5 H  }/ e! d# r    is64=0
6 z: N8 f: ^. w8 }5 E
$ o$ x1 }3 @; p& ~$ y. `    case "$EPIC_ARCH" in6 e( b9 i* ~! z4 B- u/ u; I
    *SUN*64)
' k9 y! d5 |4 }, w! k) q3 {        is64=1; ]6 H4 r) {  `! g7 O
        ;;
$ b6 Q% |; i. c, Z1 t8 t8 s    amd64)" Q( C) \" {) Q1 f7 E, ~
        is64=1
; B/ J0 e0 {- b) }' w        ;;
% w% I5 g4 @3 L9 Y$ k    x86sol64)( }( R$ V# Z' F3 S) D+ X" E# ?6 x! }3 {
        is64=1' [- }( c6 o/ D9 R) O/ C! F
        ;;
; o5 y. b& W3 n4 {9 U% A/ u, M4 ^    aix64)# |0 |* ^6 B3 {- v
        is64=15 ~+ H/ p* r" a; G3 \  W
        ;;- b( V/ t: |$ U0 q! u  j. L
    suse64)& z- a/ `- U1 n6 E
        is64=1
' p0 S# w$ F5 b& h6 s2 x) B: `        ;;: z0 p$ B. h7 e; D* s
    esac( M( }# D0 c- ]7 F

: _: A3 x5 N! [8 a' x6 @6 _if [ "$EPIC_WRAPPER_DVLP" = "" ]; then4 p$ P# z6 d7 r
    if [ $is64 -eq 1 ]; then" a( ?+ e% r7 j; G6 C0 D- b$ u+ G8 S
        desiredlimit=200000* Z9 r& R2 C8 j4 a& y! z& d
    fi6 E1 Q' o# @  J1 p6 B
else
4 D/ M1 @7 G8 M    case "$EPIC_ARCH" in6 b2 X& U9 _+ U! O% G4 `
    *SUN*64)
6 }7 I5 B9 W5 g' L/ P/ U        desiredlimit=200000! Z& T: \  ], R$ G5 X
        ;;
. Z; T1 @) N' D) ~9 P$ E+ R    esac
+ Q! A# {! Q4 j6 a! P4 ?* Hfi
" _# Q* t) t4 ]        - k+ O, G. ]2 C8 }) X
    if [ $dbglimit -eq 1 ]; then
4 L6 w/ m* Q( U/ _        echo hard $hardlimit soft $softlimit
: \/ o* `1 }7 W3 {0 t; o: g) B* X    fi
& S7 ^1 `5 D4 k: ^7 b2 P  h; @8 f
    #stacksize can not be unlimited, pick smaller number8 C( v0 J6 O' R& {( P* U; s- i% o

9 u2 i4 y; w; m2 t' }& d    stacklimit=$desiredlimit
* w9 {3 ]$ Y; z9 J* R/ p8 O
5 s% J2 ~# R7 f    if [ x$hardlimit = "xunlimited" ]; then
0 B! P9 i; e( F( z        hardisunlimited=1* S$ i; f, u! p* T. |! C
    fi5 B5 p2 y+ l5 r6 R! m5 G

7 i# V% ?* u% e% _$ W' M    if [ x$softlimit = "xunlimited" ]; then; a) u  E: w5 \+ m/ ~9 @0 y
        softisunlimited=1, a( {) R3 r& n  @4 C. y
    fi
) J& W# Y- e" a' u* n  X4 \/ s) e8 w" q3 G% o$ j: i! d. T$ a
    if [ $hardisunlimited -eq 0 ]; then
9 f1 W! H- t8 z        if [ $hardlimit -lt $desiredlimit ]; then
. f# A( Q& Y: P! P8 a. o            echo "WARNING: stacksize hard limit $hardlimit K is too small."6 B/ @8 I; F: P' n: k' z
            desiredlimit=$hardlimit
' v* {) R+ {) E: e            stacklimit=$desiredlimit# q4 T$ p1 D$ P' T* `
        fi
- `. v! X$ F: k5 r( W4 u% b/ K    fi3 l/ w6 C9 j& A, T6 A* [

4 r' G4 l9 l2 Y; y    # desiredlimit is set to proper value (< hardlimit)
0 b) L5 ?) U9 Z. i2 k, F* V, a
3 H1 M5 H% p* _" @# N, f$ W    if [ $softisunlimited -eq 0 ]; then
" E3 x3 {7 b1 T9 Q# {        if [ $softlimit -gt $desiredlimit ]; then; }) T+ L( i6 ~* q* |# p7 [
            stacklimit=$softlimit
, I, ~8 h8 [. {- z! E, G        fi
& T( b0 N% v% W$ p    fi
. [4 [) I2 a! q4 N* S" I  D- C# p
; I5 Y3 t' c( K% Q. c1 x& x    if [ $softlimit != $stacklimit ]; then
: U; m6 S5 ]& F' \8 q' |        ulimit -Ss $stacklimit) g# A' G/ }) r0 L) d
#        echo "WARNING: stacksize limit is set to `ulimit -Ss`"" F7 }& {/ z6 H9 K  t4 F
    fi: [* d! w# S( ~" C5 O' X/ S* O* k& r
: `0 B  `/ L6 _; ?( Z
    if [ $dbglimit -eq 1 ]; then4 b. B1 q) Z# p3 S
        echo stacksize hard limit: `ulimit -Hs`
" W) `8 b6 y; M5 ]- d' c% i        echo stackize soft limit: `ulimit -s`8 m2 `* S: }3 s$ f( w* [% B2 a9 ?
    fi
+ R6 L  i( d* e5 g- i$ ~}7 N- I" T8 }2 r/ e& o8 A& l

/ }! y3 i# R5 l3 X# }( u9 \3 E7 {open_epicscriptmessages()  Q; F% n2 m6 I9 R% e
{1 \5 x! O$ I. D( [; l
#generate  temp ".epicscriptmessages" file based on pid
% M" x/ `/ K. L; N0 fEPIC_SCRIPT_MESSAGES_FILE="$EPIC_SCRIPT_MESSAGES_FILE"$$' z, T9 X4 X- \) D& q& w
if [ -f $EPIC_SCRIPT_MESSAGES_FILE ]# Y1 N5 V( u9 R/ P
then * b$ c5 [) q6 Q3 O4 m" U
  until [ ! -f $EPIC_SCRIPT_MESSAGES_FILE ]
. i; V- u2 z! Z) [/ f; f6 o0 W  do/ f/ G. [9 l$ v; [0 X$ n/ k  I
    EPIC_SCRIPT_MESSAGES_FILE="$EPIC_SCRIPT_MESSAGES_FILE"$$8 D7 e* V- U, a( s/ P: j& n
  done' x0 L- ^- U1 K% B+ k  R0 W
fi; \# e; b, T* X, ?

9 P5 Y; V- @- H% ^' p: L9 Wexport EPIC_SCRIPT_MESSAGES_FILE
1 ?& r: V0 _$ k; L}
, j, D/ M: U& f5 f8 T' |7 K) `. Q' r* M% o- A; v

. s4 ]4 f0 T, O2 l, ycmdname=`basename $0`: R4 w' K) v0 J
postgres="n"
; |2 j  @3 ^: x7 c6 k/ uostore="n"" i: y* w4 C% D& ~' B2 M( `
gui="n"9 ?# A! ^& b/ b) w# V8 @
databaseOn="n"
4 o! u# H, h/ Nf_next=0. `7 d4 |1 w4 A
f_option=""& N( j, \2 O! d7 ^: z$ j
o_next=09 Q  d  h9 o2 q4 [7 u* q
o_option=""9 h8 A4 B+ S2 \+ \
workDir=""' K0 R3 ?# `( [' j8 I
workDir_next=00 K5 c1 R: I# V: m. P
errFile="powrmill.err"2 a4 p1 H+ g3 E$ ]
win32flags=""6 H9 ~" x5 M- c  C$ w' `
ln_default="ln -s"
) D7 R( \3 s# S  u8 ?
  j% m% P# ~7 ]8 g- `har_hilo_file="". }  j9 V5 n4 n: ~
have_har_flag=09 o# M1 L* u1 I3 G& {: d$ l
have_har_setup_flag=0
0 G9 E( s+ r6 G, O1 P3 f+ P& ^is_special_har_run=0
; A0 c; `$ k$ x5 Zhar_ofile_prefix=""1 ?: r; O) _- d& ]+ I" p, H

# ?3 e9 [& B; K; X# Zhave_va_flag=0
7 w- @, w/ @1 q$ N3 G, _+ Whave_vaf_flag=01 U1 H9 m# ?- S  @9 Z& ?
VAF_FILE=""$ v- S: M/ r% X2 [* ^2 n3 ~4 [2 {
VA_FILE=""* L3 ^! d) U! R" J* u- B5 a
ARGV=""1 ~1 [! f+ e4 X7 A
% z! h# O, i) K5 s
ORIGINAL_COMMAND_LINE=
* U. {& h" s% @LOOP_CTRL_FILE=".ns_ba_env"3 }% I' |+ |2 s! D: n9 C
ALTER_HK_FILE=".alter_hkf"
) h" x% ~2 o3 \  h  HALTER_COUNT_FILE=".alter_count"1 z7 b" e5 s6 R+ P+ K1 p
MONTE_IMG_FILE=".monte_img_f"
% R, C; y) l% }$ R# j3 x8 @) i4 fMONTE_COUNT_FILE=".monte_count", f/ b: ]* e# {) D
MONTE_CFG_FILE=".monte_cfg"
4 ?4 {+ v$ g) f0 t4 _; _# y% D( lEPIC_SCRIPT_MESSAGES_FILE=".epicscriptmessages"8 n0 q" g& G: s. |  c( h
( w$ z" r7 |0 Z$ }, ~/ k
open_epicscriptmessages $@
+ w& w. o. L0 w& |1 D7 T5 R
5 y% a( z& [: ]' o  F/ I  Yscan_for_hva_args $@
4 A+ _" ?8 W6 F9 `0 S! u; I( F3 ~! B1 s- M
scan_for_har_args()
- n' B" A4 F& ^5 n% m; b' i- v{
, F( A8 q0 y" O  while [ $# -gt 0 ]; do- ~# J( q% G# N  X
    case "$1" in( X7 g* L, g* j' ^0 K/ _
      -har)
6 |3 ]& l6 U5 z) J2 U% B           have_har_flag=16 [# d& d  S5 S. v& L6 \
           [ $# -gt 0 ] && shift( D; e8 u+ A5 T' y  T9 n+ u
           if [ $# -gt 0 -a `expr "$1" : '-.*'` -eq 0 ]; then4 Y! J5 f2 O" S; ~# x- q( H
             har_hilo_file=$1
8 S% J2 r* G8 y' \! z6 ^1 U             shift
% Z1 S% a; P+ [1 r( H; s* Y( f           fi8 b  y/ {) {* A& J
           if [ $# -gt 0 -a `expr "$1" : '-.*'` -eq 0 ]; then2 ~- m! b8 {$ V" Q  A
             echo "Too many arguments to -har flag. Only one hilo file allowed."
5 U. e0 I8 u+ F" J( a$ d4 E             exit 1/ C( q" X5 v8 e0 {  }
           fi6 A( F$ k- N; x2 ^
           break
, x7 ?. I( L% `8 K5 a! U! G        ;;- M  u; S8 ?5 N- x2 g: ]
      -har_setup)2 a( E  w0 e# I- Q
           have_har_setup_flag=1
" K, d* n& Y& l7 S1 r           break
" P0 s, p8 p% x. s; u2 u, C+ b        ;;/ E1 \; x2 x, i7 {
      *)& W$ P& R; A2 U% V0 W  u
        shift, [; K2 z( Q8 D7 E% B" X2 N
        ;;2 A  M( J3 j( C. b/ s6 p5 w
    esac, `  F9 A, m, F+ R1 c
  done
- J3 P7 `  J# L+ N5 t}
9 p% F3 z. h2 B2 }3 K
- n# t$ X( I! c9 h# i6 F5 w; Z1 Gscan_for_har_args $@
: R/ v, o; q! X1 b# R) ]0 m- o) V9 K3 H# P  T. h( d" p
for argv in $@2 q* M, R* ^  |5 H( }; o- _7 k
do
8 M' B! T2 B% P& w+ H+ ]% `3 G" e7 t   ORIGINAL_COMMAND_LINE="$ORIGINAL_COMMAND_LINE $argv"1 r) Z! B! Z1 N% |
    if [ $argv = "-gadb" ]; then% h- M- H/ ^3 h3 k
        databaseOn="y"
; E* ^! u, p* B        workDir_next=1
1 q9 V5 l: F$ O$ \1 h/ ?    elif [ $workDir_next -eq 1 ]; then
. f$ U2 q# \0 z4 _" X0 ~: ~        workDir=$argv
; p- S* V+ z3 p- l' m. q        workDir_next=0
1 Y" M1 W; ~* \    elif [ $argv = "-ga" ]; then
+ o% t: ~5 s. o0 A        gui="y"
9 Q) }4 `0 \+ j/ a1 p! T: J( j+ M% e9 o    elif [ $argv = "-f" ]; then7 u) j( D# b1 i* h* Y. E
        f_next=19 G: v# I/ [9 N
    elif [ $f_next -eq 1 ]; then
4 |, Z, N# l  d/ f0 G% H" a        f_option=$argv# n' j/ z' h: p% z: H
        f_next=0
# G5 L  n# K' J0 P    elif [ $argv = "-o" ]; then. i) {+ u! ?0 A) P
        o_next=12 Y. y( a: g. t5 C; J, p
    elif [ $o_next -eq 1 ]; then
# E0 X% m7 z( n. _, ~8 I6 C/ a        o_option=$argv5 S. O( W6 J/ l! x8 I# Y: x2 x) v8 M( a
        o_next=0% H) w" g$ x7 L, E$ Q! x
    fi
- n% a1 |* Y9 C' Pdone
" h6 r6 L& ?1 q5 E0 p$ yecho "Command line options: $ORIGINAL_COMMAND_LINE" >  $EPIC_SCRIPT_MESSAGES_FILE
+ z* A" ]) [$ @5 ^
$ D4 H; c% [7 Q  A+ _% b8 lif [ $databaseOn = "y" -o $gui = "y" ]; then1 o0 f2 u# t: U# o
  if [ $cmdname = "pathmill" ]; then" \" ]# }$ r1 c) N
    if [ "$EPIC_ARCH" = "SUN4_SUNOS_5"  -o "$EPIC_ARCH" = "SUN4_SUNOS_5_64" ]; then* z6 W" P; E% h& N
         ostore="y"1 x% R, W# k9 s
         postgres="n"
$ A- Z- \( H" k. G; x6 k+ v     else
, M- b: u0 j" |4 ^1 d# s* g- ~        echo "athmill GUI is supported on Solaris platforms only" 1>&2 5 r4 M. I' ]9 T; f. s
        exit" ]; X7 R3 a) @5 o; I
     fi
( l0 O' f5 U. E% j( _& L5 |  else
( Q6 M: I7 _7 \5 l6 s3 h9 O* M) g8 x    postgres="y"
& v8 w. K! J3 A         ostore="n"8 R, ^! i0 O  L/ k/ ]
  fi3 M5 L! i1 F4 n8 {/ H$ F
fi
+ K4 \8 ]( g4 [4 a& V" t6 L5 f0 l9 ?* D2 x
if [ $gui = "y" ]; then
; I) ~! c1 w9 K. ^    if [ $cmdname = "powrmill" ]; then( T* x5 I* X6 @# }+ g. V9 L% ~
        pwga $@
! d2 t) _2 K; @+ m+ w. L        exit! l! d6 w7 l9 X8 \) F, c: i/ j
    fi
6 ~9 q  `5 y# q3 o* E( {. h3 J1 L * ]' t. R+ E* r+ }6 x1 N4 L/ k$ B
    if [ $cmdname = "pathmill" ]; then
$ P; v: s+ c3 |        if [ $ostore = "y" ]; then/ P$ _" `& W1 l  G5 m
           ./pathfinder $@
' G& j$ B( F/ s: R8 r           exit; G% |4 ^$ T/ e5 s
        elif [ $postgres = "y" ]; then
6 `8 @4 x6 @9 q+ _2 y- a$ k* |" a1 i           pmga $@) _( F$ `! E, M: A; L' N9 @2 Y
           exit
+ n8 F# |1 h: J: `: E9 X. l  i        fi
0 f& t8 \+ B/ K+ ~5 y; f! |9 i3 [    fi/ r9 I! `5 k8 f
fi
# M5 i9 n" E& _* E$ |9 C6 V
' p0 |+ |1 e2 Y, j, Tif [ $databaseOn = "y" ]; then
8 T4 i/ m( n. @$ J   if [ $ostore = "y" ]; then& q* k3 p7 ?' {
      if [ -z "$workDir" ]; then0 P% h! ~. B3 o/ [
         echo "Error: Missing argument for -gadb option"
$ y! F" f# i9 r9 X$ j: d         Exit 1
) _: W! e" A( ?      fi$ |3 z3 `9 _$ v' w
   fi
4 m- Q; i1 e, @& b% O5 y, |8 u   if [ $postgres = "y" ]; then* U2 W! C+ ]" F
      if [ -z "$workDir" ]; then5 l3 {) n' D. P; O+ D
         echo "Error: Missing argument for -gadb option"
+ d' X1 F7 Q* ^2 k         Exit 1* N- d1 K/ \! t; m0 v: q1 s$ \* F
      fi
; z9 O* n" D) n/ l0 ?   fi
! q0 d( ?7 ?7 n! efi
6 d4 a0 U9 X8 a9 M! w5 h1 E) B. b# i5 ^2 K! ^2 S5 [. J' n
if [ $postgres = "y" ]; then
6 [# P( v/ @% [0 A$ w# ~- C& \6 L* O- i7 N# `; N
    if [ -r $EPIC_BIN/scripts/gui-init ]; then4 I+ u- I) x& ]* D$ k* f7 u
        . $EPIC_BIN/scripts/gui-init. ]/ X! Z$ `4 ^' z
    elif [ -r $SES_ROOT/bin/scripts/gui-init ]; then; d/ K2 x* [; b! `: g  a3 `
        . $SES_ROOT/bin/scripts/gui-init3 ]- `( U, a( R! ^5 h. p
    else: x0 p0 b! z) ?: F
        echo " ** Installation in \"$EPIC_HOME\" has been corrupted!" 1>&2
1 a3 `& h2 W4 p& U( S" Z        echo " file bin/scripts/gui-init is missing." 1>&2
/ B# y) p# |* S' T* k. b    fi/ h7 ]* ?' o( F6 n0 G
& F! T6 x1 X& p7 ]3 _3 c
    workfile -tool $cmdname $@' |* U/ H8 t$ ]  c# }! h- S( Y
fi
7 f& o2 q1 w: @8 T! `' x% u" Q
9 ~: d! c9 r! O( _: |if [ ! -z "$o_option" ]; then
' y9 n6 ?' N& ]0 [2 u6 K" z    errFile=${o_option}.err
6 \$ ?: V$ O" A. b2 Z1 y. r3 e* Velif [ ! -z "$f_option" ]; then
+ l/ f( Q+ r6 D$ H5 u$ l$ K    if [ -d $f_option ]; then
3 z2 J; I- ?, |; h        errFile=${f_option}/powrmill.err& u- E8 m. y' p/ N5 E5 c$ g9 S
    else errFile=${f_option}.err0 W! |. i4 J  o9 h5 a$ `. `& w* y
    fi0 U$ C/ x4 Y: D9 i% {
fi
; k" P3 `  h, L
/ U( k* d% }# p$ H6 f5 |, U6 ?0 E! h. z( ^
if [ "$EPIC_ARCH" = "RS6000_AIX_4" -o "$EPIC_ARCH" = "RS6000_AIX_5" -o "$EPIC_ARCH" = "aix64" ]; then0 F3 q, ?- o) `2 V1 f
  rundir=.epicrun, w2 {: w' i& x
else
0 e/ T8 L# _, s. v2 ^  rundir=.epicrun$$
. O5 |7 ]  O: V( Vfi" `3 k! o' v  t3 [7 N. p0 E' X0 w

) ]) F- ?0 L1 Plibpath="$rundir${EPIC_DLIM}$EPIC_DIR"7 w4 `- o8 F6 U; @& u1 j
  Q( u- ?2 z: H$ f. z6 I
cwd=`pwd -P`* I7 ]# T, U7 ^+ P0 S! O( Z# w
if [ $cmdname = "acehdl_w" ]; then
! k; w: L6 r) ?  cmd=`basename $0 .sun`1 q: [. v* m5 X# M- Q% W
  cmd=`basename $cmd _w`
  Z) ~" L* K% K3 p3 O8 ^3 Selse
, w* I& X' ~0 U5 b  cmd=`basename $0 .sun`
* H5 h! Y4 s! ~) {1 I( b5 k+ Sfi
# S# ?& m$ D; ?8 s0 Q
; s4 ?# x2 a9 \; x" Gcommand="$EPIC_EXEC/$cmd$EPIC_EXEX"# I# W5 q( o2 k4 ?7 m' T
[ ! -x "$command" ] && echo "$cmd: not installed!" 1>&2 && exit 1; Y& O; F' |3 [( j5 W5 F
4 |; Q- x+ x: U4 |5 A  T
# buildmod extracts -u/-fm options and calls genepiclib
* J6 ~) Q7 @5 S$ j$ e# J- ~, U# It also set the remaining options to variable CMDLINE: _+ {( p6 f# }1 s) e( p
# look up in .epicrc for -fm & -FM parameters
- H2 _: {+ v3 b; `5 |( B/ A1 ~
) L4 _. Z+ a! Rfmlist1="`get_epicrc ./.epicrc user_adfm_obj_modules`"
3 P6 @  {0 F: X5 B( B[ "$fmlist1" = "" ] && fmlist1="`get_epicrc $HOME/.epicrc user_adfm_obj_modules`"9 X7 M3 R- f  i' s; ~
[ "$fmlist1" = "" ] && fmlist1="`get_epicrc $EPIC_DIR/.epicrc user_adfm_obj_modules`"$ D$ O9 K5 C+ V* F: V6 s
" [& h' z2 [+ }/ f
FMlist1="`get_epicrc ./.epicrc user_adfm_obj_modules_force`"9 b1 g4 B" t8 }9 R) ~1 l; M
[ "$FMlist1" = "" ] && FMlist1="`get_epicrc $HOME/.epicrc user_adfm_obj_modules_force`"
% d; L2 M/ M: M9 J[ "$FMlist1" = "" ] && FMlist1="`get_epicrc $EPIC_DIR/.epicrc user_adfm_obj_modules_force`"
" d4 L5 y" x) I9 u5 ?, ]1 |! y, W( ^) B. R# w" `  H* _
if [ $# -gt 0 -o "$FMlist1" != "" -o "$fmlist1" != "" ]; then
/ h  r2 d' p3 U    # note that the buildmod script will set the CMDLINE variable
: h, i$ p" Y3 C    . $EPIC_BIN/scripts/buildmod
5 |4 t$ I  l9 K4 _# }  ?6 X9 `3 ^' Q  t$ A+ u# |
    #echo "This is the value of cmdline=$CMDLINE"
0 V% e3 S4 V" P6 h    #exit 0' x8 H* Z" p6 j! f- ^
% d% b. C! F" s1 f; G. M' @% Q
    # if a new timemill/powrmill/pathmill built, run the new one2 d, o; |7 r+ E7 z- @
    [ -x "$rundir/$cmd$EPIC_EXEX" ] && command="$rundir/$cmd$EPIC_EXEX"* i- h4 s* d- j$ m
fi8 F6 D8 f4 J0 @) l

3 \) B6 [" y; I3 i" `/ F" j% yif [ "$cmd" = "timemill" -o "$cmd" = "powrmill" -o "$cmd" = "nanosim" ]; then
( J! j% q7 H! O$ r& F% v6 H  if [ $have_har_flag -eq 1 ]; then
, X5 b, A! R0 o% y: e+ g( ^    is_special_har_run=1  R5 i+ v% U0 o3 j# u' M
    if [ "$o_option" = "" ]; then8 u5 O" q( b* ]/ o! y& X- R
      case $cmd in" g, V% G3 s) N) q8 T
        timemill)0 `; |  c7 t: s1 E$ P
          har_ofile_prefix=timemill6 t) I% p6 Q- [: _+ u' l: ]: Y
          ;;" ?  ]- d9 M$ y& ?% W2 g
        powrmill)* Z2 J  a4 H- D1 o/ f) G! r6 K8 k
          har_ofile_prefix=powrmill3 S/ {% I6 R, L9 s6 Y0 g6 |
          ;;
6 I0 K4 Q# q2 g: k        nanosim)
2 ?$ f( v# |: [/ U4 n7 e5 D* W          har_ofile_prefix=nanosim' n7 [& J9 @7 o  S4 m7 X- M
          ;;# U! v. Y% h8 ?, ~
      esac
1 F' _$ @- y) _5 w1 F$ v# e    else
# u0 d( h% z: i# c6 e      har_ofile_prefix=$o_option
% _7 o  |7 ^; ]1 m- M4 Z/ U- h3 ^+ O    fi
8 t- O9 W$ I% u( g" l fi7 O, `7 O6 _- q/ p2 @4 y5 P
fi
4 A7 M/ }" x+ w( z; Z  e- I5 Z3 R4 a' z
# Call Double precision version of the product if -D
$ F7 Y0 _* w) S4 P0 v# or simulation time > 1,000,000 ns.
- n$ S, @7 m4 o; M! }  f, mif [ "$cmd" = "timemill" -o "$cmd" = "powrmill" -o "$cmd" = "nanosim" -o "$cmd" = "railmill" -o "$cmd" = "pwarc" ]; then$ B# Z& p: a3 v! ~

# E) E7 Y. G; [0 |  # Now the binary always has the ACE feature3 U( d! d) T9 b( N& h
  USE_ACE=YES
) m7 g/ F* L4 ?" S5 q9 W
9 J5 s8 ]' s( a6 ?7 k  HAVE_DP=NO
) v$ j# H& T/ Z% {. a& a' _; q# N! `  EXTRA_CAPACITY=NO
3 B1 c: {& @$ f0 }* B  DB_REAL=${FORCE_DB_REAL:-"0"}5 T4 P7 {: H8 h$ t7 n$ R6 t
( L8 R- g4 M+ B& h0 B! U! @, g
  # Enhance for ACE ease of use
9 q9 F' n4 a) {- r% o8 k  j* d1 ], B  # If no command line option or only a -T option, do:" p( ?5 \# w* k  l6 L" D
  #   1. set -A option: I9 P' s" S' q# c9 k% [
  #   2. assume input file to be hspice
! `' e  m; A1 ~  #   3. set -o to input file prefix
/ C) s& a  j( r+ ]0 G% S  #   4. set -z to input file prefix) @% C; Z  k$ W
  #   5. set -c to default config file
! G: H: U* Z) z  C/ I0 c/ Y4 `  netlist=""* c0 [& V; P$ V0 y( a
  minusT=NO! h8 K' l( p; |
  useStdCmdOpt=0
4 K8 W6 l  C4 J0 g: s  prefix=""
/ u7 w, |  R0 W0 t' v$ b5 _0 u  circuitType=""
$ U5 T6 e  q5 n* w' c: h( Q9 p$ N  for opt in $CMDLINE
( X5 d2 K2 }0 r3 P  do( q6 [( x% h3 ~' _3 W5 H
    case "$opt" in 4 n: A" ~3 |0 O1 W5 C1 q
      -T)
6 ~7 ^  a+ A% i2 x5 b, f        minusT=YES+ h- Y* e' u6 P" W8 h5 U9 D
        ;;
& K, ?4 C8 F) i) i$ U4 q      -*)3 F; y6 y  _; e/ E3 |! Z& j8 O
        # using standard powrmill command line
+ W9 d) M; A1 e/ l+ e& n, ^        useStdCmdOpt=1: }" n6 a! y7 s1 i7 t6 `2 ?
        break
6 c* u: O  A$ ^9 y8 m3 e        ;;; N8 a  L! U: W
      *)7 l( o8 [- q6 h' N5 y
       if [ "$minusT" = "YES" ]; then
- ?8 \8 |+ ^3 b0 M9 O9 n         circuitType=$opt, R; V  _1 T2 n/ q6 Q- E
         minusT=NO  # reset flag9 r* e, [6 {2 c: l# ^; z6 b
       else
4 M: I. R' l! e         if [ "$netlist" = "" ]; then% M- B2 D& x& c# z0 a/ o
           prefix=`basename $opt`
  k% K1 _0 E6 Z3 [5 ]0 t1 K           prefix=`expr $prefix : '\([^.]*\)\..*' \| $prefix`
; C) X/ E8 `9 U5 b# Y* {. v         fi
  B9 s3 F0 z, ]8 E         netlist="$netlist $opt"9 j, D: V3 S) @9 R4 O- p  K/ T
       fi
  X; H$ ^. ?' A+ o( a       ;;
. s4 `' r. [; n' L- {+ J% [( F    esac
# L2 w2 Z8 A0 q/ s- t  done
. e# _& `4 I( m* `5 d1 r6 _8 X' v5 N2 P; Q9 ?! M% S' t

. x6 l3 t; _5 U/ z  if [ $useStdCmdOpt -eq 1 ]; then0 }" J. U% o# B9 Z4 G6 [- \. _. L
    # use standard powrmill/timemill command option
9 E. m$ p# z9 a    for opt in $CMDLINE
' U8 W! n! C6 ~8 J$ X    do. L' ~+ l# Y4 T( i6 J0 ^1 j
      case "$opt" in , ?7 g8 u& w; z9 Q( P* ^" x6 L! G
        -A)5 B$ u( f+ \: L4 |
            DB_REAL=1+ ?$ H8 Z* d: O6 k
            ;;" t8 \$ @5 p. ~+ h( T& W! U0 F9 e
      esac
- t" l) |$ ?: x- P1 J( \# a    done
2 d# Y1 N6 {# O1 m8 L    if [ "$netlist" != "" ]; then
  v5 }1 a& x8 @. o" `      CMDLINE="-nspice $CMDLINE"+ u1 L1 G3 _4 x5 G/ C' `$ u
    fi
& `6 {' Y- p' Q7 g" t5 x3 T5 x  else
8 I; r3 }% z, E, k. n0 e+ r" ?    if [ "$netlist" != "" ]; then0 D% [* z  a3 |" @
      EPIC_DEFAULT_CFG_DIR=${EPIC_DEFAULT_CFG_DIR:-"$EPIC_AUXX/etc/$cmd"}
$ `1 q( b- j& [! p/ u6 b9 Z4 c      # construct new command option! r0 k2 y" v' Q. N0 C" v
      if [ -f $cmd.ini  -a  "$circuitType" = "" ]; then; I# R* @* i: O2 d4 M
        CMDLINE="-nspice $cmd.ini $netlist"
/ \: n! {% m+ Y: R- b      else, M1 z4 Y6 P; ?" k1 D/ \
        if [ "$circuitType" = "" ]; then$ H: D/ ?) y+ w$ _4 w* @! |
          circuitType="msana"
0 j3 S, B+ n  }9 E8 h        fi, g7 a! c( \! w( r; e. k" z
        CMDLINE="-nspice $netlist -c $EPIC_DEFAULT_CFG_DIR/$circuitType.cfg"
2 y5 d5 Q: L1 `" K      fi
# K! p3 v& E+ ?( p      CMDLINE="$CMDLINE -A -o $prefix"; I, H9 [  c+ ~; t; i3 f
      DB_REAL=19 o% O( I; F& S6 Q- W# J3 @# M. F& Y
      echo $cmd $CMDLINE1 I: Y3 W% q4 f
    fi% C1 X) n: N6 e  q6 d' e
  fi
( p. R2 V( c9 E1 {9 K$ @" bfi # cmd is timemill or powrmill or nanosim or railmill or pwarc
% a& v( N- _5 Y& X
7 a% ], @7 l, \1 @9 q' C4 ]3 P4 F/ \[ "$HAVE_DP" = "YES" ] && [ -x "${command}_a" ] && command=$command"_a"; H6 W4 z  \9 q+ W6 P& W
[ "$USE_ACE" = "YES" -a "$DB_REAL" = "1" -a -x "${command}_a" ] && command=$command"_a"% I/ q1 w2 G* W+ Q
[ "$USE_ACE" = "YES" -a "$vlog_design" != "" -a -x "${command}_v" ] && command=$command"_v"" m' [, d# w  l

0 R0 q/ n% R6 ?$ Xif [ "$__engine_wrapper_called__" != "Indeed" ]; then
2 c7 X; _+ n3 `5 U/ Q    __engine_wrapper_called__=Indeed& ~3 K( B& ?6 ^  p( H
    if [ "$cmd" != "amps" ]; then3 T+ E2 s% }/ G; P) M% N
        export __engine_wrapper_called__
% ?" n  b0 v4 l* ^9 I    fi
: M) G! l3 C- @7 y1 ~4 Y9 ^
  D% ?/ y# H+ g2 M/ S) E& M    trap "cleanup" 0, P1 [5 }8 @4 T" y( W+ e: x1 B1 Z; b
    trap "" 28 j! R( K0 b5 s  y, c4 }
7 Z, s! E" r2 e' y/ u4 p
    [ -d "$rundir" ] && rm -fr $rundir1 V& J+ @6 K) d; n
    [ -d "$rundir" ] || mkdir $rundir( u. W$ w/ Z! j

7 B& z" H0 `1 H! B  ]( Z8 n, n    case "$EPIC_ARCH" in3 _4 S* N4 [5 C) I' |( K
    *SUN*64)   8 F2 D" W) C' n# z1 I; [. q1 v
        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH") p& ~8 T9 L" P% ]
        export LD_LIBRARY_PATH
, y0 K9 @! r% W( `        suffix=.so% o" G3 @2 Q9 ]* G
        ld_err_code=127$ }4 m3 f+ f: S0 W' p
        ;;
. Q6 Z9 M/ V( W2 Y    *SUN*4)   
6 E! b8 K; A/ [1 @' K        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH"
2 L2 O; e: ]0 E7 w6 t        export LD_LIBRARY_PATH
7 e, V% G! i. t8 _; ?        suffix=.so.1.0
2 f) x" G# \! E. ]+ A        ld_err_code=127
0 A  {1 p* |; _3 U: g* z: r        ;;# t5 [: P$ W9 @9 M' K7 w% A- u& c
    *SUN*5)   & u  O- D$ {. f( \2 b9 E( y
        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH"
8 `0 Y& M; ^1 a6 F) \( R5 Z( g        export LD_LIBRARY_PATH2 c5 O" a! }4 D5 m6 ^
        suffix=.so3 ]5 J  b8 K( [9 s2 V
        ld_err_code=1278 y1 e# ~$ U7 d' n$ x6 l
        ;;
' Y) w, ~2 K2 b) t; o6 N5 ?; J3 P5 [    x86sol*)   
/ t: a5 |3 ^$ O: L9 s' {        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH"( v9 D; u- ?4 E7 G1 R+ I
        export LD_LIBRARY_PATH0 x5 R  k* d3 R) y" U
        suffix=.so
; l4 N5 L8 d3 ]7 x  p' ^) E        ld_err_code=127( t' n" ~# q. a& M' _
        ;;3 h* O9 k! U+ e1 I
    *AIX* | aix64)   4 {; l! h1 q) ?) a5 Q! P
        # When genepiclib creates shared objects, it creates a import file and ! j% G' F5 k& X' {  t
        # uses timemill as program. So at exec time,program timemill is needed ( _& J! s4 x: u. `! [
        # in LIBPATH
! x& M: i5 ~/ n        $ln_default $command $rundir/foomill0 U5 P! J' l$ n! `% \. S0 N+ }
        LIBPATH="$libpathLIBPATH:/lib:/usr/lib"
  `9 z% l, P  ~# r        export LIBPATH2 T. h& W. `+ S
        suffix=.o
4 ]( [5 b1 N) e" g: O5 |# J        ld_err_code=8
# m: G% h/ |4 d9 a        if [ "$EPIC_ARCH" = "RS6000_AIX_4" -o "$EPIC_ARCH" = "RS6000_AIX_5" -o "$EPIC_ARCH" = "aix64" ]; then
1 i4 @) E7 f/ W5 w1 |, R          tdir=`echo "/tmp/d"$$`2 K; M- m- Z7 r) d- G$ Y- a
          [ -d "$tdir" ] || mkdir $tdir. _) d% M1 z7 J* |: c$ m) g
          if [ -f $EPIC_DIR/libCustom.o ]; then
2 n" T. O7 x& t/ |9 j             cp $EPIC_DIR/libCustom.o $tdir/
% A- a! m3 V3 J6 y- s5 D             $ln_default $tdir/libCustom.o $rundir/, o* s1 E/ b" R
          fi' u9 y2 |7 o% V( b4 I! b7 Z+ A
          if [ -f $EPIC_DIR/libModel.o ]; then
! u# G0 X/ r. ?3 W1 s$ U0 ]3 W* D             cp $EPIC_DIR/libModel.o $tdir/
' u! @7 x; u# e& m' T( U             $ln_default $tdir/libModel.o $rundir/
$ O0 ]/ I3 a1 _+ Z8 ^          fi
  q# Q' g4 j" K+ u; |          if [ -f $EPIC_DIR/libFuncModel.o ]; then  d" j. s  I- {3 \
             cp $EPIC_DIR/libFuncModel.o $tdir/) X# o6 g: y+ j
             $ln_default $tdir/libFuncModel.o $rundir/
. o' d7 B- u, ^+ A          fi2 [( p/ x: F8 x; [8 U
          if [ -f $EPIC_DIR/libFuncModel.34.o ]; then
' z* \. w: `% |% A% ]             cp $EPIC_DIR/libFuncModel.34.o $tdir/$ d' A% T% Z& I2 Y! D5 L
             $ln_default $tdir/libFuncModel.34.o $rundir/5 E$ O$ S/ M" n; N; J6 {
          fi1 a3 t4 N- w$ D  o# ~* |
        fi" R& n# e, {) V
        #Set the IBM flag to enable more shared segids' e. D; L# [1 o/ u, N
        EXTSHM="ON"; t. Y: p  h) E0 s  `
        export EXTSHM
, b3 Y: R5 p0 ]- m% S+ n5 U        ;;1 X" a8 Z$ p* }  t( K3 {  B. o
    *LINUX*)   
5 W2 F" M9 J" W+ v4 Q4 [        suffix=.so
3 V6 @5 C& G3 G, }, c        ld_err_code=13 R  m, ^8 F: E$ _
        ;;
7 F) r0 A. J! Y0 s    *amd64*)
4 [$ V  m) M! g; l/ T        suffix=.so
+ E( \) z4 |9 v+ ?6 h4 H        ld_err_code=14 o( _; M$ b) J- _: ?; A. K
        ;;
7 Q5 i& {0 i+ b    *suse64*)
0 ~3 d; h) ^* j2 i! }8 q        suffix=.so
! E  h9 x! R2 s. m9 M        ld_err_code=19 H. E# j8 a+ x5 R
        ;;) V# x8 U  F4 R: {
    *suse32*)    , q  S" g* Y/ ?- L/ B
        suffix=.so
. B6 w* X. q" c) l0 H. o) G% @# o        ld_err_code=1; E1 O/ D9 D: O/ @
        ;;
8 F3 t) h# Z! T) T    esac5 H% N) ~/ v- O* S& X

3 d* t" {* v' @; a; X3 g# S    [ "$has_custom" = "YES" ] && ulib="$ulib $cwd/libCustom$suffix"- ?3 G; D3 L* ?6 ?: C6 m" }7 P  [
    [ "$cmdname" != "timemill" ] && [ "$cmdname" != "powrmill" ] \
! C4 i' g5 f- t2 A        && [ "$cmdname" != "nanosim" ] \8 l& C; O- _/ w; U1 s0 H
        && [ "$has_model" = "YES" ]  && ulib="$ulib $cwd/libModel$suffix"
! S* Q; {- u' g5 m, J# h    [ "$_VA_" = "YES" ] && ulib="$ulib $cwd/libva$suffix", S9 F% k  D9 Q# S6 l
, L$ ~  d: F/ d% B! y
#Look for command line option for libFuncModel.so
2 E/ f; Z* b' H6 ~7 v1 J, e#    user_library_next=0  X% Z2 P9 `4 S- m! N7 q
    has_fmlib="") J8 ~# o! N& V. b
    for opt in $CMDLINE' c( E" i6 `  |9 F; Q( G7 o" t) R
    do
+ I2 O6 J; q9 v6 Q/ Z, r& P0 y/ L* A      case "$opt" in " Y# p& g6 m4 o# J; Y! A1 ?
        -fm)
5 m- S# I/ @2 J1 J% b! ?& l            CMDLINE="$CMDLINE $cwd/libModel$suffix"! U# I: ^; X' S, W! N
            ;;, ~! L8 \0 J2 V, n2 @/ R) \# [( D
        -fm_user_lib). h  y2 Q2 w5 s7 g: D
            has_fmlib="YES"
& k5 [" t. t9 P, T8 H; X+ u1 J#            user_library_next=1* W$ |, t, z) e2 ?; l7 R
            ;;
, \4 Y  ?( i8 H0 H0 @5 T! z        -xc)
2 \5 e$ K/ I4 D5 a4 U; m, z            if [ "$EXTRA_CAPACITY" = "NO" ]; then7 n" ~* n8 L. v+ r7 S
            EXTRA_CAPACITY=YES& x" [) q' w" K0 P7 h( a
            fi9 b$ K8 N+ d/ l% J* [. O6 Z
            ;;
3 }: J8 Z% I# x5 d: I#        *)
7 n4 {% ]7 U" U4 k; X- G#            if [ $user_library_next -eq 1 ]; then. c& h) h3 @5 Z
#                if [ -f "$opt" ]; then
5 z/ @) r& o7 G, U/ H" x#                    libfmodel=$opt
0 s, t) J; T  }6 ^#                else3 u, r; H* j8 W% `$ t2 M( {
#                    echo "-fm_user_lib: Specified file not found"0 ]; l- c/ K- ]; Q# L; n
#                    echo "-fm_user_lib: Specified file not found" >> .epicscriptmessages
' k* f. s8 t9 T- e#                fi
* i0 Z' {/ C$ ~. v3 Y$ B! m1 z  }#                user_library_next=0
6 j4 w& R! j) t9 l#            fi, Z2 S/ S8 u. i& J) ]
#            ;;
" V7 }" t0 U5 f# N; a6 I, p5 U4 k' }        esac
7 ]& `0 N1 G6 a+ u0 x    done
6 w$ N+ x# t1 h) i0 P3 j
0 L- J/ T$ j/ g# w( L    if [ $cmdname = "timemill" -o $cmdname = "powrmill" -o $cmdname = "nanosim" ]; then
6 H. h) C* o( U, B$ ]5 J  ]        flib=""
1 c1 ]# O2 Z; M2 H* ~) G( Z        if [ "$has_fmlib" = "" ]; then
# G$ q: a* w, h7 E( N, V  q$ ?+ }7 @3 h! X            flib="$flib `get_epicrc ./.epicrc user_libraries`"
; P& P, v8 R" C  u4 l            flib="$flib `get_epicrc $HOME/.epicrc user_libraries`", x. X5 ~8 ~, d. e
            flib="$flib `get_epicrc $EPIC_DIR/.epicrc user_libraries`"- G5 e& L7 B! _" J( E
        fi
0 _/ k  q. I- p/ g* z2 M    fi
5 W, O+ Q$ E% K! r* y! \1 [7 j0 f  q
   for i in $ulib
$ S. z& ]8 `; F8 I: K   do
. A: j/ w( M+ P2 _3 ~3 _       [ ! -f "$i" ] && continue
, A. s$ G7 M: w2 w7 N2 |       dir=`dirname $i`; cd $dir; dir=`pwd`; cd $cwd
8 d: Q, n- H; Y4 K5 N6 {       i="$dir/`basename $i`"
; X2 H3 Y7 q4 n6 [  |% `       case "$i" in
4 N. C+ x* O! w* L$ D- {       *libCustom$suffix*)    [ "$libcustom" = "" ] && libcustom=$i;;
+ p( K4 Z1 R3 T' `( W       *libFuncModel$suffix*) [ "$libfmodel" = "" ] && libfmodel=$i;;1 {' K5 K4 y) {* _* z( Q
       *libModel$suffix*)     [ "$libmodel"  = "" ] && libmodel=$i;;% F: d/ j1 o" d! k  Q: U% ]
       *libva$suffix)         [ "$libva"     = "" ] && libva=$i;;
9 Y- l' [  ~! }' \       esac- [) p0 N2 k. M2 _3 A
       [ "$libcustom" != "" -a "$libfmodel" != "" -a "$libmodel" != "" ] \
# R+ z& s) W; S9 I+ b        && break' r4 [& U, O2 B) ]/ {. R: q
   done
, H. b, g  u* u! v, P, p! U  L2 t  P: _$ Y1 ~: z: l. p, m0 k  d
   # symbolic link shared libraries to .epicrun$$
7 Z% y# ^3 D7 e& ~+ U    cd $EPIC_DIR; epicdir=`pwd`; cd $cwd
8 ~( a! \  U$ W! z4 ~2 F% L    if [ $cmdname != "timemill" -a $cmdname != "powrmill" -a $cmdname != "nanosim" ]; then5 t+ b7 ]' o- g5 X- c
        if [ "$libfmodel" != "" ]; then) b# N# P5 K0 z
             [ "$libfmodel" != "$epicdir/libFuncModel$suffix" ] && \; u, p' t; M' x  D* _+ ]& A) }5 d
             echo "Using $libfmodel ..."  && \. x  n8 t. r( l, d
             echo "Using $libfmodel ..." >>  $EPIC_SCRIPT_MESSAGES_FILE! M$ M9 e' `4 @
             if [ -f $rundir/libFuncModel$suffix ]; then) ?- Z9 l' \* J4 C
               rm $rundir/libFuncModel$suffix& r* Q/ t' h4 y$ d' M5 X; N) T: o
             fi& X3 I0 _! s" ^& x1 v1 T4 C: a
             $ln_default $libfmodel $rundir 1 x: F' z/ c2 w/ @
        fi& e  ]  q8 j. i9 Q
        if [ "$libmodel" != "" ]; then7 p" G  }' v: T+ `  k! {
             [ "$libmodel" != "$epicdir/libModel$suffix" ] && \
; W" B) C$ n! l! ~* d             echo "Using $libmodel ..." && \
# Y4 c7 W9 d  I6 w! X, y# B  S2 z             echo "Using $libmodel ..." >>  $EPIC_SCRIPT_MESSAGES_FILE+ _+ m5 w9 T- [9 Y
             if [ -f $rundir/libModel$suffix ]; then- k$ C* C+ a' q* I. `0 q" U/ d  y
               rm $rundir/libModel$suffix4 P" G( E; K- H
             fi4 z. o# y& g2 ]4 f+ y7 p) b8 @! I
             $ln_default $libmodel $rundir
. j7 v; {' Q# S: R  ?4 B/ d! X        fi
: c9 S5 p5 f6 q% L9 u$ Y   fi% Y' O3 F' |, v% y' [3 n
   if [ "$libcustom" != "" ]; then0 t; p& p, h) V9 O; y3 y' V/ k# q
        [ "$libcustom" != "$epicdir/libCustom$suffix" ] && \
' r- K% Z( V( o' Q2 h" s( t        echo "Using $libcustom ..."8 g4 r; |$ Y1 d  \6 [$ s
        if [ -f $rundir/libCustom$suffix ]; then! |; F- P4 g2 d' B& R
          rm $rundir/libCustom$suffix
( b+ {( [) j5 `! I        fi
8 E* Q/ g. E! b5 Z# F5 `, T/ U        $ln_default $libcustom $rundir 6 o" C3 g; u$ L5 N/ I. T1 ]
   fi
: T4 ~, a0 N7 y: v  |( g4 ]& W" S- g
   if [ "$flib" != "" -a "$flib" != "   " ]; then; C6 ~) h6 I' D" _7 x- N
        CMDLINE="$CMDLINE -fm_user_lib $flib"5 N: |, t$ c4 Q# s& B5 |
   fi. n: x# @' I/ m' a! d3 ]
  b' N. J1 L' V% O6 I% F
   if [ "$libva" != "" ]; then
/ }2 V- m9 ?# l% |7 y' s        if [ -f $rundir/libva$suffix ]; then+ V- ~6 B6 |! w! o  S' s' x" N
          rm $rundir/libva$suffix, a& L. O7 D, l4 r9 [/ G2 \) F9 q
        fi
' q' k7 K1 R" o        $ln_default $libva $rundir
; v) V+ Q& C9 \% K3 X( Y   fi! Y6 h4 u0 J3 g7 C6 q3 e
0 i2 X& I9 O. X5 a

1 B' Q0 q7 e0 U  z, Y; L    # VCORE design library
4 V8 P% Z% h/ X, ]  z+ F* k    if [ "$vlog_design" != "" ]; then+ r0 o) X  L5 k- u8 n1 P
        $ln_default $cwd/$vlog_design $rundir/`basename $vlog_design`
' g. F- K8 i( C    fi1 O' t/ _2 L6 m! K6 m* K

8 h0 A4 ~* w+ v    if [ "$EPIC_EXTRA_CAPACITY" = "1" ]; then" P7 e9 Q: ?* E8 ^
        EXTRA_CAPACITY=YES2 d) Q. z* \1 O; J
    fi# k% Q+ p0 q/ J9 I/ b! _% B8 b

4 r0 J% A0 \5 K+ F! D( y    [ "$EXTRA_CAPACITY" = "YES" -a "$USE_ACE" = "YES" -a "$DB_REAL" = "0" -a -x "${command}_xc" ] && command=$command"_xc"
  B/ T" Q- z! F    [ "$EXTRA_CAPACITY" = "YES" -a "$USE_ACE" = "YES" -a "$DB_REAL" = "1" -a -x "${command}_a_xc" ] && command=$command"_a_xc", V4 [  f+ N, W4 r" S
    #Create temp file if dual process is on! m- u, @9 @8 K2 n# o, {4 a  Y
    if [ "$EPIC_ARCH" = "SUN4_SUNOS_5" ]; then2 N! H# c" w2 Q' }6 \
        if [ "$EXTRA_CAPACITY" = "YES" ]; then( S8 J5 g5 l. x" `! j; L+ \3 a
            touch $rundir/rpcidfile
; v- O6 F. Z- w+ I1 M, j# Q        fi$ G0 [& h8 e  B- l$ d
    fi
0 g) K8 ~" R0 f, n6 ]  Kfi
6 {8 E/ a, U' B' L! j- c4 @8 _0 t( r1 L% ^, `
run_cmd()
& y+ L3 n& g3 v3 ^, _: x: X% G; w{
, |3 k9 M  `! |# s- q  command=$1
, _0 l  s# f" f' J) d' x  shift
; ~- l, g- j$ k! F4 M) p* p% U& \0 q( I6 O* c& X
  if [ x"$VA_FILE" != x"" ] ; then
, m1 \" i3 h" j! j) n" p     cmdline=$ARGV$ ~- X) G6 Y) U; O( \
  else2 K4 Y2 d' e' |& g# W  S
     cmdline=$@6 o  _! x2 p) K/ [( ?7 A
  fi
6 Z* o3 ]+ S9 X6 B9 b0 l: T( u8 S; L1 K0 E
  debug=${DEBUGGER:+"$DEBUGGER $command"};, h- C6 B* w  C# T  P7 t, ]: H

2 K! c; l  [. C  # To disable Exec-shield-randomize in RHEL3 U3+ when running nanosim and nanosim_a
$ D6 e: {0 U- S+ T  # so save-restore may work.0 C. L4 {# I5 `: p0 Q6 I& d" |
  setarchStr=
& G4 Q/ {/ R) Q6 ?* S  cmd2run=`basename $command`
( n$ e) v- |2 L" T: \' L0 j  if [ ${cmd2run} = 'nanosim' -o ${cmd2run} = 'nanosim_a' -o ${cmd2run} = 'powrmill' -o ${cmd2run} = 'timemill' ]; then
6 _! d$ P7 Y5 A5 n$ p) J: v    if [ "$EPIC_ARCH" = "IBMPC_LINUX_LINUX" ]; then
* X6 T6 i3 J) n7 L      setarchStr="setarch i386 -R "
1 c) K; m: `4 n* l    fi
( j  ^) \1 p% z( a    if [ "$EPIC_ARCH" = "linux" ]; then, b7 r0 y0 l! U- z
      setarchStr="setarch i386 -R "
; n" w1 c: f0 g" v6 p8 D- R    fi' I! L9 f; H3 x6 O7 C
    if [ "$EPIC_ARCH" = "amd64" ]; then
# j) W# W* _% W      setarchStr="setarch i686 -R "
, F0 n/ y" L2 X/ ^% B; u! _8 l    fi
7 ^. O& w' y* x2 F1 O$ }: o    if [ "$EPIC_ARCH" = "suse32" ]; then  z$ c: A0 t; e! I
      setarchStr="setarch_suse i386 -R "
& y6 K7 H1 p5 \    fi  w( K& u  i7 H/ F, |3 Q
    if [ "$EPIC_ARCH" = "suse64" ]; then
& r- x7 X( X+ X      setarchStr="setarch_suse i686 -R "; [& K9 ]* z* ]0 p
    fi
7 m5 i. H- C' U2 i4 Q( |+ k  fi
0 e/ g/ M8 S' ]3 f1 X8 K
9 b/ v# e' A( C) \8 H7 e  ret_stat=0
9 Z* P; M/ B; x8 ?) r' b  if [ -x "$command" ]; then( T. k1 k4 y; D8 z' f
      if [ "$debug" ]; then& G. }% S9 |+ N; D& s
        _debug_args_=$cmdline
! h  g& f6 t/ U4 @9 C0 m        . .epic-debug
3 L2 i9 l9 y" D& l1 \' C) s$ V5 L      else2 y# I8 v# d( v2 B: D! T. x
        DEBUGGER=; export DEBUGGER0 g6 t% e* ^9 f5 X# F& q$ m
        $setarchStr $command $cmdline
2 ?, M1 c5 D7 h' q, s      fi8 l8 F8 e6 x: X6 H8 R
      ret_stat=$?
( J- F/ }3 D- I6 K  G& U  else$ @+ t5 E8 S8 }
    echo "Corrupt installation, executable \"$1\" not found!"
  x" x% u/ z  P. K% I    ret_stat=1. I; z3 |1 P) Z1 ~# @: G
  fi
1 A: X% G/ G6 X% S" U}
: K9 J9 Y1 l) [% _' ~
- B8 }7 E  e' i( T# keep runing cmd if ctrl file exist
4 P* z1 p# O, c9 `8 \
# }: _1 t3 ]/ p1 [6 L- Crun_loop()
( j6 l3 n; o# t+ i: R{  T, }& L9 x1 J/ c$ E
  command=$1
% r6 Q- O+ {: A% o& h" r+ u  shift* ^! X3 X' n# |1 v

$ |+ M1 I% h, @# }  if [ x"$VA_FILE" != x"" ] ; then. x0 C" {5 Z- M- K8 d
     cmdline=$ARGV
- V) i5 x. G( W' ~3 ]+ l  else
0 B# a* b/ y3 K# g0 l5 C& y+ t: k/ q- D     cmdline=$@
* m% d( S/ m. ]2 O5 Q# C8 k1 P  fi
! I' r+ }' E# V" L3 F, o" ~/ {& K9 `6 i$ ^- ]
  while [ $ret_stat -eq 0 -a -r $LOOP_CTRL_FILE$$ ]; do" y/ f- o- W! c5 q8 ?, ?& _3 I
    . $LOOP_CTRL_FILE$$* W8 F0 e" w, X# [
    run_cmd $command $cmdline -banner 2
( i4 E6 r% z/ D7 i# n  done;
9 {: s; V8 Y6 y1 `  l9 f  N" j( q5 M4 d1 B3 T# Q
  if [ $ret_stat -ne 0 -a -r $LOOP_CTRL_FILE$$ ]; then% r* Z  b/ i% h3 i- g  k' N6 G& Q
    rm -f $LOOP_CTRL_FILE$$* E/ |3 j7 l" g3 u, m2 d
  fi5 X6 |8 b. x0 F1 \
}5 ~" L$ d7 {- _7 ?# s

3 S) R8 g( c' |/ [8 Yhar_check_ret_stat()
! K7 Z) p; e- ^) g6 Q+ Z0 S{$ f2 [4 r3 u& g
  if [ $ret_stat -ne 0 ]; then ) ]9 r' G- p" b' `: l  n9 l
    echo "Simulator returned with non-zero exit status. Stopping."
/ e( f) A! V4 B- Z    exit 1
) Q% v/ o# N4 Y5 z  fi' [7 c% S9 Q' F2 w' T0 w: k
}
* M, p6 e" D8 o/ z& q0 ^0 e$ e5 @8 O3 K% X$ W$ a9 f
#
2 C4 J9 n0 ?6 K6 S; n- P& U# set stacksize and datasize limit7 m, X0 Q/ t2 ~6 z& A
#9 H, b* b' W6 _/ x& B% Y
& P6 I4 ^- d- n3 j7 V, a
set_data_limit4 ?, v* s2 \: N2 ]
set_stack_limit3 j  _- Q- Q3 O

9 B+ v! w9 ]$ k& q1 i0 F2 k# o* R#rm -f $LOOP_CTRL_FILE
& O8 V) u1 x# ~
( @1 c) x5 _# M2 Brun_main()9 `. J, k2 H" L; f; p
{, ~% b( y- R9 }+ y
if [ $is_special_har_run -eq 1 ]; then
. K- c% l/ T6 H7 u  if [ "$har_ofile_prefix" = "" ]; then
; P0 E9 p6 J+ X/ Y% L" d    echo "Wrapper bug. Notify Synopsys technical support."
8 `; u2 Q' q9 l' t$ y    exit 1
+ o. B; M0 T! e% q  fi
" a/ w1 I) H7 G/ ?  if [ "$har_hilo_file" = "" ]; then# r; Y$ c$ |/ U
    # no user specified hi lo file - do both runs( G. s8 v7 @' Y" W0 B0 b& A1 N. [
    run_cmd $command $CMDLINE -har_one -har_setup
1 R& B( g; h5 W! F    if [ $ret_stat -ne 126 ]; then% i3 n, O! c; n7 v) W4 X6 ^- ?* ?
      har_check_ret_stat
. Y, v2 e1 C# A9 B      if [ -r $LOOP_CTRL_FILE$$ ]; then
4 M/ E3 Q# Z+ ^7 L/ {6 R        run_loop $command $CMDLINE -har_one -har_sim ${har_ofile_prefix}.hl; [3 Y" M3 t. p8 m$ ^+ q
        rm -f ${har_ofile_prefix}.hl
3 ~$ S: A" u+ c2 n      else4 F8 U% y# D# }$ ?
        run_cmd $command $CMDLINE -har_one -har_rmhilo -har_sim ${har_ofile_prefix}.hl
2 n% {: r8 J& U. [  W      fi
: R& K0 i' _( U3 C, v( o; Z- C    else0 j0 s& q* [5 v; b" H1 n3 [9 L
      ret_stat=08 R9 G, p6 y, r
    fi3 P, q  C$ R) k9 m2 G
  else
8 N; M2 J. P5 z0 i6 K9 ~, y    # user gave a hi lo file name4 b6 y2 x2 \7 _0 d/ Q8 U
    if [ -f $har_hilo_file -a -s $har_hilo_file ]; then/ S: E0 c* P: ], m9 U4 S4 e1 N# L! i
      # file exists - use it - only do sim run
. ~0 s; z4 g: n' _2 d      run_cmd $command $CMDLINE -har_one -har_ff -har_sim ${har_hilo_file}
* ~- x5 T; M; g9 v  t      run_loop $command $CMDLINE -har_one -har_ff -har_sim ${har_hilo_file}
, w$ T" w; e5 Q4 k$ X    else! T. O& g$ D- L! F- `. {+ j" D( V
      # no such file - generate it - do both runs
8 ~1 A4 W4 ~2 J3 p+ Q      run_cmd $command $CMDLINE -har_one -har_fnf -har_setup/ ]( F3 a  D6 s( b( U; K) c
      if [ $ret_stat -ne 126 ]; then
7 }. P5 }7 G$ g        har_check_ret_stat5 s  g; G. S! Z! |
        if [ ! -f ${har_ofile_prefix}.hl ]; then
& B4 H$ o' Z/ }, ?* P          echo "No hi lo file generated after setup phase. ", _$ l" \! V# x; j
          echo "Contact Synopsys technical support.": `4 m) @5 |0 U# }
          exit 1
& B' ]  i2 m/ }- s6 f* d7 l        else) X& `5 A3 D/ L/ t3 s) H
          if [ ${har_ofile_prefix}.hl != $har_hilo_file ]; then
' C% s# A" m' Q% r# Z0 P; ~! S            mv ${har_ofile_prefix}.hl $har_hilo_file0 H, C) a2 _; w3 Q( b
          fi
1 q. |$ c, f, E4 x+ E9 B. G        fi: f& L/ w6 s5 O
        if [ -r $LOOP_CTRL_FILE$$ ]; then
3 J) G3 M' g8 k! i$ Q$ M! b  b  N          run_loop $command $CMDLINE -har_one -har_sim $har_hilo_file
  |. K! {  w+ g/ o        else
# S6 b2 U- h+ w- X. ?; C6 r          run_cmd $command $CMDLINE -har_one -har_sim $har_hilo_file5 ?1 l* u# v+ ?$ V, r* E
        fi
! ?5 U6 {% M" g/ H! O      else : `. f6 J$ d" `: v& G
        ret_stat=06 Y8 ~9 b9 X! n9 [, S$ X
      fi5 ~1 q7 X( C" y
    fi9 ]" b+ N4 w5 h* Q% |
  fi# x8 G6 I/ ^: ]4 m
else  
& f* k  x5 W8 q% m# N0 k# z# don't loop if -har_setup9 R) d1 S; H1 u# D
  if [ $have_har_setup_flag -eq 1 ]; then
5 C- |- z. E# o4 j4 i; N4 }# x    run_cmd $command $CMDLINE
4 ?/ R$ k% s7 X  C( A' `6 b    if [ -r $LOOP_CTRL_FILE$$ ]; then6 F- V' p/ p4 X2 l- [6 J
      rm -f $LOOP_CTRL_FILE$$4 x( ], y' U+ Q* J7 z' ?- l" `
    fi
! o5 n7 a1 [. h# Y2 U! a! l( F  else
9 ^3 k. I, L8 b2 r1 A    run_cmd $command $CMDLINE; T) ~3 B* K3 |. K
    run_loop $command $CMDLINE
( n1 ~; I. n* w7 W6 A/ F% a  fi: ?, o+ g5 o; o9 k
fi3 P5 d% H* a  X" g, Y6 i& P
5 ~7 e- R( p/ f" l$ ^2 ^# v
if [ $ret_stat -eq 0 -a $cmdname = "powrmill" -a $postgres = "y" -a ! -z "$workDir" ]; then
9 Z3 c- w1 H$ e* }  pwCreateErrDB -w $workDir -e $errFile
) n  Y* b: ?" s; x8 M+ T# f+ I  ret_stat=$?
) m) l7 N% ?& \! d+ K- v5 ffi5 b  B+ ~7 S# |$ T# t9 g: v$ b. o
}
: g4 }  T% K0 p& t! s0 T6 @
4 \& m) S* t7 [* p: B/ y& j4 @, Mcleanup_alter()1 e! j; I, A5 M, ^: @
{
/ e; H0 C& j* j7 i   /bin/rm -f $ALTER_COUNT_FILE 1>&2' P2 e: z6 a6 C& m& `1 e) W5 |
   /bin/rm -f $ALTER_HK_FILE 1>&2
  j" z; j2 @% }/ Y* Z}- K: M  |5 ]1 }+ M

/ a1 Y6 r) P! L4 H; w* e( ]6 I#generate alter temp files based on pid
8 n5 d, B1 j1 {, u" rALTER_COUNT_FILE="$ALTER_COUNT_FILE"$$7 @* V! L% I* r* K2 k4 B
if [ -f $ALTER_COUNT_FILE ]
% ~; j/ T0 \- I) _then
* B/ ?" ]% I3 o. b" B3 s; {: B0 i  until [ ! -f $ALTER_COUNT_FILE ]
; a8 f: A4 ?! {! |  do( ]6 |+ U4 M9 _3 g0 i5 a0 v7 S) H
    ALTER_COUNT_FILE="$ALTER_COUNT_FILE"$$
# L/ L. w/ E/ d  done2 p; }2 _2 g# M* i0 j
fi
4 U7 M+ Y6 A/ O8 c4 v# sexport ALTER_COUNT_FILE
; H; o% s" }% c- _5 P: P* C  Z% @) e8 ?0 ?1 s  \
ALTER_HK_FILE="$ALTER_HK_FILE"$$
7 k% H7 D4 Z  U! Cif [ -f $ALTER_HK_FILE ]" l# H- g4 p2 K% z3 {( w
then
* F+ g) X1 |' ^. r0 U: ~, l  until [ ! -f $ALTER_HK_FILE ]0 D0 ^& G& D6 E! B
  do& i# a. y; I3 K( {/ ^
    ALTER_HK_FILE="$ALTER_HK_FILE"$$
% \6 n' V1 M+ @2 N  done
- @% h  F& F: i/ G4 Hfi
1 A' [! S; u9 Z. Texport ALTER_HK_FILE
/ Q! C" P: Q2 `3 n
0 ?+ U# P9 v1 B3 }# U#generate monte carlo related temp files based on pid0 F- m! r0 |6 N3 I7 s1 e- |/ g
cleanup_monte()
, m/ T8 J) U1 P1 Z0 K{
  \7 l5 d4 R" R, }# ~! h   /bin/rm -f $MONTE_IMG_FILE 1>&2/ E+ L& x; l" @. C
   /bin/rm -f $MONTE_IMG_FILE.gz 1>&2
7 X9 m& ~) W9 \$ g: ~   /bin/rm -f $MONTE_COUNT_FILE 1>&2" f" W' @' M# l- J4 n8 l
   /bin/rm -f $MONTE_CFG_FILE 1>&2
: ^  V$ H; f. Q$ q2 y! r}
. i) I: F8 W2 [) K. O* l8 M( D" _
MONTE_COUNT_FILE="$MONTE_COUNT_FILE"$$
: ^4 `5 Z# p3 M; X3 rif [ -f $MONTE_COUNT_FILE ]) n" U' {" N2 L, A5 \7 C# W  i
then
- k, M9 {1 I  h+ S  until [ ! -f $MONTE_COUNT_FILE ], p5 a- z, c  _8 z8 L( C* [$ z
  do( n8 W( z2 [- q7 M" `! p& c, y
    MONTE_COUNT_FILE="$MONTE_COUNT_FILE"$$3 w" o, U4 ^7 N1 h1 J4 ]; ~0 y
  done7 @/ f3 P5 p- U: |7 f% U+ I
fi
6 n  r7 h5 O  t4 G+ sexport MONTE_COUNT_FILE+ ~0 X8 Y' U; y& C
. ?2 @3 o$ s2 @. ^$ a- b
MONTE_IMG_FILE="$MONTE_IMG_FILE"$$
  ~0 m  O8 A$ I$ M. Nif [ -f $MONTE_IMG_FILE ]6 e$ |% w" G& p+ i1 k$ \4 m9 h
then, a) {) T! {7 z0 B% p! m( o
  until [ ! -f $MONTE_IMG_FILE ]$ s1 U* {. d$ X7 k2 m
  do
) \9 D5 a$ R1 O    MONTE_IMG_FILE="$MONTE_IMG_FILE"$$2 W' A/ Z. f* t( l5 f3 G
  done
! a! q' ~# f; Ofi% |! n) f) K) N
export MONTE_IMG_FILE  V* {! j' l* o

* c2 d+ m& u$ e+ O  q- ~* `MONTE_CFG_FILE="$MONTE_CFG_FILE"$$
5 Y/ K8 M  H" f6 S0 qif [ -f $MONTE_CFG_FILE ]
* `  a$ K3 S- Y3 @4 J4 Zthen
2 K% |" M3 q2 D( N) c. J9 X  until [ ! -f $MONTE_CFG_FILE ]2 t% o* J+ e! C% Q
  do6 O6 Z6 C# Q+ `6 e+ ]3 R# v
    MONTE_CFG_FILE="$MONTE_CFG_FILE"$$
8 i  Z( @5 F0 K1 p% I1 P  done
, b8 O' X. T/ d# P. ~9 P0 g& Ofi
9 O, M* A7 \" r- f! e+ ]7 S4 G8 \
2 J2 h0 h$ z3 ]0 ?2 g) @, {# main iteration
! G, g6 s$ [& S3 f2 O: nrun_main
* X6 T6 G4 ?' E! K3 O) i4 G* e) ^9 Q+ s' j- {) W4 b0 K
if [ $ret_stat -ne 0 ]
' f4 m2 B* g, Bthen ( n4 _0 z$ j9 b, P2 b
  cleanup_alter
" Z' m6 G2 @3 m  cleanup_monte
6 X' v" T3 B1 K& t  Exit $ret_stat
: W; C4 R5 f- n" u5 e/ w' e0 Jfi, Z1 u" \$ I- G

) ^3 @* Q; \9 o. q" R#Alter related iterations
4 P! Y! B  l8 [: m" c+ G$ t' {9 B
0 y0 a( K  ^5 g# |2 y% X5 O4 {iterations=0
: q& {$ y% Q0 b1 X5 ucount=02 m9 |( k1 e# p9 x: Y% K8 n9 Z* o
if test -s "$ALTER_COUNT_FILE"
- t8 I1 f9 M- F" p# C0 J  E7 H7 i& A; Tthen
' D- f6 k3 ~9 k: i- T. f9 G  if [ -r $ALTER_COUNT_FILE ]; then' S6 ^9 R& Z. {2 {+ j
   exec 7< $ALTER_COUNT_FILE
4 p9 X* E8 k8 `2 I# I! f( q   read iterations <&7
0 t7 d$ [; S+ F! F% c4 x fi: X: \5 N: T" V/ X3 q( i0 T* e
fi
: ], i4 G0 m2 I; |* ^. ?& M. V
3 V$ f& b0 v0 S# C  Z' vtrap 'echo Program Interrupt; cleanup_alter; exit 1'  22 V4 I. ^" G" n
while [ $count -lt $iterations ]8 _6 Y: f* [) v" V
do8 _3 b. G8 j4 x/ x- c% u
count=`expr $count + 1`
5 ~, M$ P4 ?/ b/ g3 q2 G5 d ALTER_COUNT=$count
* d/ T- L& _! L4 r* s export ALTER_COUNT
) ^6 O, J6 r1 F) r4 R0 y( O
: s/ _" |6 D" L: n3 |3 R6 B run_main  r! c% a: \2 @  S% k

. m2 d0 u0 C0 Fdone& O% S9 Q# I0 x* u* m
6 [1 U* y' B9 c8 T- B+ f6 ^) C" y
#Monte carlo related iterations8 T+ x) B6 f. v/ w  |/ Q( D6 j

: y3 V6 n. `1 A( g' r! |  {monte_runtime_summary()
% C6 X- U0 n- _" D6 a; @7 E{
4 o4 N, U2 p3 b( Z/ _. a0 b; j* q! A  keyword_1=real
# Y  r3 N  A7 ~6 A; b6 ^  keyword_2=user9 f. u5 O% @. w, u5 d+ V: U
  keyword_3=sys
' v- l. y1 j- j" z/ k5 |! A  ofile_prefix=nanosim
, ?4 K5 q! _( l" t/ U5 V  ^
( F. E6 K/ j: I7 h$ Y- Z8 U* _% D  if [ ! -z "$o_option" ]; then
7 W- |/ [2 ~* T1 A1 |4 n- x    logfile=${o_option}.log$ x4 }: [- T/ J  s) b
  else& c- @; q  P7 z9 z  d. b
    logfile=${ofile_prefix}.log
" c$ f: G4 ^- @' [5 t; x  fi
) ^4 I: V) d' E. ?7 A* K* w& d, X4 p" A( D( x9 d0 T: N* H2 D$ r3 Q
  if [ -f $logfile ]; then% u' S; d9 D/ F8 N
    echo "*** Monte Carlo Total Run Time Summary ***" >> $logfile      4 ~! q) h1 L6 S5 X& u, N
    cat $logfile | grep ${keyword_1} | grep ${keyword_2} | grep ${keyword_3} | awk 'BEGIN{ t_real=0; t_user=0; t_sys=0; } NF==6 { t_real=t_real+$1; t_user=t_user+$3; t_sys=t_sys+$5 } END{ print "\t", t_real, $2, t_user, $4, t_sys, $6 }' >> $logfile
  M9 V6 v% U. ~  fi7 r% r0 V6 |$ `/ e
}
, d0 V1 P2 m; T5 D/ q& G5 I3 l1 E& T6 h- n
next_monte=0) U# \! ~" z) S! \
cur_monte=0
* m$ f2 A+ ~1 ^2 \7 ], S
& S; n! E, d& H. G  eif test -s "$MONTE_COUNT_FILE"9 z' l/ L3 I% Q) ^
then! @. c* l8 {: g# x* }' B
  if [ -r $MONTE_COUNT_FILE ]; then
3 q) \2 m3 p: a) p( N   exec 8< $MONTE_COUNT_FILE5 C2 T* e  O6 |
   read next_monte <&8
+ @- ?" V0 N. t5 y4 [" `  fi
7 W' P3 z0 d3 Q4 G! p8 f" ~7 K( [fi
# M* p" E. V" R5 h: ]& F# u& {  z8 `1 F1 E6 K2 k
trap 'echo Program Interrupt; cleanup_monte; exit 1'  2
9 J$ Z2 m& @/ C% ^while [ $next_monte -gt 0 -a $next_monte != $cur_monte ]
7 M! `+ Z& k" n7 A" a0 M$ w0 ]0 u8 fdo4 i7 o1 h$ p5 e5 `# p
  NS_CURRENT_MONTE_COUNT=$next_monte
- E& C  x) p' c( o$ O  export NS_CURRENT_MONTE_COUNT
9 \. T; m  B" P
7 G: H" |7 O9 F1 W5 v, N7 V0 A; i8 j  echo "restore_ckt_state save_file=$MONTE_IMG_FILE" > $MONTE_CFG_FILE* G( c. U2 K( K8 z( k+ I
  CMDLINE="$CMDLINE -c $MONTE_CFG_FILE"
: {  t; H) n: r  V& h  run_main- V, f, `6 P8 P  P; W6 w4 \
" T) _& H. ]! U* n
  cur_monte=$next_monte
4 R0 r- c& S( ]  exec 8< $MONTE_COUNT_FILE8 K; l6 U3 d; `# s" L$ p% k& J2 A
  read next_monte <&8: q& n3 G! i- O  I5 B1 M4 T3 h4 B
done
! k4 c# q6 C# A1 q
( n8 U; X' f3 n1 B  Fif [ -f $MONTE_COUNT_FILE ]9 y( G% F+ S8 g* ~# y( W/ J
then
6 S* K" r+ P# [% o  monte_runtime_summary" u* [' w  b& J/ S8 t8 n+ P
fi; H, e" G7 y2 B8 D2 x) [* B4 q* N
9 N+ l: P* Z4 `" v8 I% g
cleanup_alter( O4 B5 v3 A' k& S& N5 n' N9 B/ E
cleanup_monte
) J$ Z- l4 Q5 M1 l9 B
2 E$ w, l/ y, O1 }- U$ JExit $ret_stat

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享分享 頂 踩 分享分享
2#
發表於 2012-5-24 09:22:22 | 只看該作者
nanosim有說支援ubuntu 11.10?為何不用RHEL5,這才是EDA的主流linux os
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

首頁|手機版|Chip123 科技應用創新平台 |新契機國際商機整合股份有限公司

GMT+8, 2024-5-18 11:48 AM , Processed in 0.143518 second(s), 16 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表