Chip123 科技應用創新平台

 找回密碼
 申請會員

QQ登錄

只需一步,快速開始

Login

用FB帳號登入

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

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

[複製鏈接]
跳轉到指定樓層
1#
發表於 2012-5-6 13:58:13 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
10Chipcoin
各位大大好:
$ a+ ^* ]9 L( K3 N# E3 }9 |. x- v( P                      小弟執行nanosim時,卻無法跑出視窗來,有個錯誤可是我不清楚該如何解決?問題如下) |2 k( ?, D( t0 L9 H2 Z
                      [: 113: 64: unexpected operator& g0 G/ ^; M5 H
/opt/EDA/nanosim/cur/linux/ns/bin//scripts/nanosim: 1: Syntax error: Unterminated quoted string& d. B! s+ I, C4 K" l/ c
有大大遇過這方面的問題或是指導我方向去解決, 謝謝.
8 c: Q+ J5 o4 S+ G; O8 j我在猜可能是這個檔案內的文字需要修改 但不知道該如何修改?
6 ~. u" X! j) w  _* ]以下為/opt/EDA/nanosim/cur/linux/ns/bin//scripts/nanosim 的檔案內容:% K! `  Y$ T& h4 e* B  V
    #!/bin/sh
% D; z' t5 @1 K" `6 l4 k2 O$ t#* W0 v1 _4 X- I! ]
# Copyright (C) 2001 Synopsys INC
' @1 |( m1 d/ ]: p% [8 i# EPIC Dynamic Simulation Wrapper (DSW)8 N  n; U% b$ X8 N. y* I8 X
#' A" e) C6 K9 t
eval ${DBG_EPIC_WRAPPER:+"set -x"}% B- a: v6 I/ N/ K% B

5 B. p; |3 ^5 y1 J6 B  S2 w% Kif [ "$EPIC_WRAPPER_DVLP" = "" ]; then% g8 F& N  i1 ~( M
    TEMP_ARCH="$SES_ARCH"
9 o3 w/ H! E- p9 j% W6 ?2 F8 delse* d/ D- f( t1 V; Z% ^8 Q, N
    TEMP_ARCH="$EPIC_ARCH"5 W6 ?) J- ^! ]0 c9 H; n5 S
fi8 Z% }, ]' y7 w  _" _9 b1 y; n
8 o( N, i: l7 R& M  a
scan_for_hva_args()* E  }: G- v  S, n7 @7 ^
{' R. s1 e$ J* G6 w2 ^
  /bin/rm -f hva.init 1>&2, Y# A" T- f: [4 E
  while [ $# -gt 0 ]; do4 ]$ {. g, y) y0 R8 i
    case "$1" in% e! U& C. H! ?7 V. h& p1 k( |
      -vaf)  w9 k5 {6 q% b0 _# w3 @
           have_vaf_flag=17 m! Z) o) h7 ?" A- P& q; O2 L. R
           have_va_flag=0! k; U. c  M% P0 f* ^* T
           shift;# d8 z+ `2 J6 S/ C- I8 z1 L3 b
           continue;
$ A1 q# I- J+ d/ f" o" A4 Q7 D        ;;
7 v. [& Z$ h8 R. [# r8 |' n& O      -va)
. A7 C+ J. b' R  p) j           have_va_flag=14 h8 y2 A. R* E6 H% E4 K/ O, Z
           have_vaf_flag=0
& b* C) Z- p* A           shift;
% P# s) Q1 O' x2 n  j           continue;& C$ U8 k; O3 `4 r! H* `
        ;;
4 U5 V! q4 p7 {2 W+ j- d      -*)
3 H" v; R3 y! @3 w           ARGV="$ARGV $1"/ l: c5 c" X+ ]# S, V5 d& J' ?+ p6 e
           have_va_flag=02 m4 q1 j+ b& a; ~2 h
           have_vaf_flag=0
  D3 R' @+ z& x7 x( _+ @           shift;7 O) N% y2 o$ f  Q$ _. X1 H
           continue;+ F, Z3 e/ @! O9 B8 ]
        ;;+ n3 ^: O4 L  N& M. ]
      *)
/ S! z4 R( z4 o           if [ x"$have_va_flag" = x"1" ] ; then 1 }) O% q5 V% {% T* ^2 i
              VA_FILE="$VA_FILE $1"- z( S; _' e4 y9 _! |8 |3 q% V
           elif [ x"$have_vaf_flag" = x"1" ] ; then
- g7 }! C& C. L7 K              X="`cat $1 | sed -e '/\;/d;`"
3 m6 K* A  G' X              for token in ${X}; do( A  M' r% a! n4 c4 f
                 VA_FILE="$VA_FILE $token"$ e) s' Q* q4 r! Z! Q" x$ X
              done / N- f; e, V+ }- u+ w2 d
           else7 _( A+ S' }6 y$ G; a
              ARGV="$ARGV $1"
6 o: r$ A9 E: d5 p" O           fi
5 J% q/ @' C0 u           shift;3 B& B" z5 W' |4 n
        ;;& Y$ c& |% C" k$ Q- W0 D  z9 `. O
    esac
/ x2 U& l. c" O, x0 x$ K  done2 b9 y+ ]1 C& |  [, `  x
. @' q* d* ?4 u, U' U/ ?
  if [ x"$VA_FILE" != x"" ] ; then
% O: W/ A% x8 [) M# s##     /bin/echo " xxx ARGV $ARGV"
/ p$ w4 f4 o4 f2 Q! E! Q, n       /bin/echo "choose nanosim $ARGV ;" > hva.init1 {6 B3 a1 s) W; j. N7 D
       echo vcs +ad=hva.init $VA_FILE -o simv( }3 c1 S! [) B
       vcs +ad=hva.init $VA_FILE -o simv' O  E7 [6 a7 S) ]
       exe_status=$?9 S) @* ~: K9 m9 E  E( {
       if [ $exe_status != 100 ]; then
4 ]  q4 p+ A9 N) {          /bin/echo ""
" m7 T) u, b$ Q. K          /bin/echo "ERROR: Execution of vcs exited with code $exe_status"
+ b& T$ g/ B3 h. I6 y          /bin/echo ""+ W$ X* E5 Q9 L$ v! J( E" Z; A( @
          exit $exe_status
5 u3 G: P$ K  Z       fi& @  O; ?# ?8 [6 v: @. y# j6 t
       hva_files="-n simv.daidir/amsVD.ntl simv.daidir/amsWRAP.spi"7 l2 u! |, u! l! C7 P$ [% y
       ARGV="$ARGV $hva_files"
5 v" l; a" g& ?) t4 L9 c; M  fi
; }; \% z7 e1 K# X$ p}# V" [/ |/ ]1 u* Y) n
#-------------------------------------------------------------------------
. {' R% `9 E" ?( X' x
! V/ G1 r, O! K, |' n& X3 ecleanup()8 N* y( g7 ]: W# Z4 o4 M
{
, ]3 h* u9 p) u9 h) ?6 Z    if [ -d "$rundir" ]; then
0 c" y5 q& S% g        # On AIX, a .nfsXXX file is created if libModel.o is removed
9 N$ T- \+ n, Z1 b        # so .epicrun is not removed because directory is not empty.4 D4 b+ \/ z; l; M
        # Solution is to remove it again if the first rm failed
; [- }. i* c+ V        # (rm -rf $rundir || rm -rf $rundir) 1> /dev/null 2>&1, P/ w: f; n' R$ T+ ~9 p4 R/ Y
        if [ "$EXTRA_CAPACITY" = "YES" ]; then
  I. O/ R& |9 `# E" G' p/ U        chmod u+x $rundir/rpcidfile
) `4 z* l1 L; P1 H# `" m, y2 ~        $rundir/rpcidfile9 z& f: g2 f! X. k3 h
        rm $rundir/rpcidfile  ]0 ^* _1 q+ W% N) Z
        fi
, N+ [9 ]( _0 D8 L) I8 q        rm -rf $rundir
. y* L1 P3 f/ ?5 a* j8 Z, A1 Q+ a$ ]* E1 o9 p
        #Due to NFS problem, we have to copy files needed to: D+ v# A* i9 ?+ k. M/ Y
        #/tmp/<temporary directory>, then symlink's files
4 R: ?# X; J" u. s. G6 U; f* p        #to the local temporary 'rundir'. This avoids the problem
& \: h! t  i' ^& g/ |) }- g8 i; m        #to remove 'rundir'' c2 {: _" W( F  f0 [' A
        if [ "$EPIC_ARCH" = "RS6000_AIX_4" -o "$EPIC_ARCH" = "RS6000_AIX_5" -o "$EPIC_ARCH" = "aix64" ]; then
' Z! m2 I2 Z1 Z          if [ -d "$tdir" ]; then6 ?  [7 L  {2 Z" P$ u, ]
            rm -rf $tdir) J# W' |4 a; {" w! ]3 \; @
          fi
) ~# U# g3 e  [" F1 e) ]        fi4 O4 U4 E% S6 C
    fi; J" G) |; |9 f. L; s
    if [ ${exitstatus:-0} -eq $ld_err_code ]; then/ W' E2 K( [, B* u8 S7 D$ f
        [ "$has_model" = "YES" ] && rm -f $cwd/libModel$suffix6 j, O: m- T# b: ^
        [ "$has_custom" = "YES" ] && rm -f $cwd/libCustom$suffix2 R  a3 e7 U0 U  i" T" x% w9 n
    fi! t5 b; Q  h& v  ]
    [ -f "$EPIC_SCRIPT_MESSAGES_FILE" ] && rm -f $EPIC_SCRIPT_MESSAGES_FILE 1>&2
6 c- ^9 {. F. z: x5 H    exit ${exitstatus:-0}3 j  Y! v& a/ @
}8 g& e! j! w' m2 l# o3 A+ w2 u
/ P; X) {: a5 r% S
Exit()
* t: }9 Y: n  f7 K9 w7 j7 }" c{& y' E" o$ C# h! _
    exitstatus=$1) k5 ]+ z, p2 n, L/ K
    exit $exitstatus$ w( `: _$ F4 s; Y7 \
}  O  t& V+ d% C( D
8 j9 G6 A1 K  N& W0 u6 i: j0 l/ Y8 T* z
# get_epicrc filename keyword2 W+ M( T* e5 i7 e3 i
get_epicrc()
: d4 x, a5 L& f- `{* ^2 [" O5 W0 t
    [ -f $1 ] || exit 0/ D9 E" L9 n2 L' a  L- Y% M
    key="/^$cmd2:/{print \$3}"
& l* q' S+ x  O    awk -F":" "$key" $1
9 n1 T/ E& y# G: r) U3 m7 u}
# c' c# l" a0 i6 J0 e% f+ m# D, |  L; K' b# G2 l- h+ L
#9 L% O2 u1 Z; Y( t6 ^& Q( p, |
# set datasize limit to hardlimit
) u  F6 l  H9 A$ N* H#
3 c* s" t6 t' @. J7 Sset_data_limit()% j; M6 b5 d; B1 B1 c3 c) R4 o7 U
{/ s5 I% i9 z7 a3 i0 G
    dbglimit=0
- h& ?/ d5 m0 ?7 v' A+ U: H- \+ A    hardlimit=`ulimit -Hd`
" v9 Z2 c4 t$ t, A5 x    softlimit=`ulimit -d`0 Q5 d' C1 q6 e" E
    desiredlimit=3500000
2 f0 t. s% O. L    hardisunlimited=0
& ~2 D7 v4 a5 h% C3 [    softisunlimited=0, `' H' s: K( I0 S
    is64=00 B& f) B, Z/ U' r! R8 f2 B
0 F: B( R1 n, c( l/ [1 o7 @
    case "$EPIC_ARCH" in
  _* `( f0 [- s& ?0 d7 C; |4 K    *SUN*64)
5 Y9 r) Q' e+ k5 b  G. v% y/ [        is64=1
( _* A4 C/ a. n' |2 i        ;;
/ H: E+ U6 m# B0 m; X( C4 ]    amd64)5 X/ b0 \' F& g- p& S' l! v
        is64=1
6 A6 U2 p# V! t' k2 V        ;;
& p' Q, y/ P0 P/ ?& T    x86sol64)
) P) T$ Z- t% R+ A        is64=1' e8 }" l2 ^4 E% n6 q4 \5 w
        ;;) l1 V/ r' ~& ]
    aix64)# [* I0 d9 Y/ M1 F& M+ V4 e  y: h
        is64=1
- `6 b) r& f; `        ;;
  m/ X! h6 u) x  X; \    suse64)8 l# L' E  K% V9 M
        is64=1
1 G/ ]+ p, o( g2 n- d5 v; \% K        ;;4 j% O" s! x: c1 {  w
    esac& `  s' j+ y- P, |2 T  q

" P' C5 I; D. S    if [ $dbglimit -eq 1 ]; then9 T: v8 O. |! |7 Y4 D
        echo hard $hardlimit soft $softlimit
. b, A/ d5 |  n- ^' C$ `    fi
2 B% y2 e6 Y+ O( M) y
# g' M" g" v4 Q1 A    if [ x$softlimit = "xunlimited" ]; then
; {9 t+ {  ^6 Z& n: R! J6 u% V        softisunlimited=1
$ |% O2 B1 c! @) j    fi
! |1 g9 T% G: P1 U. z
6 ]0 ^. G& [, f% o* _    if [ x$hardlimit = "xunlimited" ]; then4 U# g& a# q4 H* i5 x$ }2 s* a' H
        hardisunlimited=1
3 O1 }2 X4 _5 p) t2 f+ S/ \    fi  H1 v2 v& f( J9 C

( a) ]4 L6 b' d% k    # 64 bit machine should have bigger than 4G
! m5 P4 p$ W  k    if [ $is64 -eq 1 ]; then" v' k+ J( t4 D8 }
        desiredlimit=5000000
7 D7 Y4 ]5 }9 s; J3 y  q    fi
$ [6 Y* f& l# G9 {& H0 y' t- e7 i2 f5 ]1 e9 j3 C- h* I" c% D7 J
    if [ $hardisunlimited -eq 0 ]; then  M8 c) ~6 n: ], D: }0 ]
        if [ $hardlimit -lt $desiredlimit ]; then0 S/ ]1 ]5 O4 J' X% N  n  f% H
            echo "WARNING: datasize hard limit $hardlimit K is too small."
3 Z- R, I; ?, W. c% Z        fi9 {! s) p, z  U) u. X
    fi
$ x1 C3 D  F$ z# J& D& G7 R2 }8 O/ c* X' S8 w
    if [ $hardlimit != $softlimit ]; then  r& J6 e& I. `! t$ {' [
        ulimit -Sd $hardlimit
% S. C5 Q$ e& ?# e+ R' E#        echo "WARNING: datasize limit is set to `ulimit -Sd`"* f/ J- k, E3 C/ z
    fi: O- f/ A1 Z' o% e' C! p3 }( U" p

+ G5 }' ~2 E. i3 Y8 F, L5 M    if [ $dbglimit -eq 1 ]; then% w" A! \; y/ a! q; c. P3 m
        echo datasize hard limit: `ulimit -Hd`
  M, c3 B3 e8 s# c5 f& R        echo datasize soft limit: `ulimit -d`
" |2 D; S% q9 P! w7 s$ ?& z    fi" W" F, i- q: b. a
}3 Q: _! {( i) j! M; n* H
0 \6 ?1 t0 u& U9 v$ k
#
" e( p/ u( H; T6 F# set stacksize limit to desired limit$ m  c! S1 j* W4 c( p4 t5 O
#
' |* c5 t/ j0 [0 Y1 D0 A" a2 f# m( lset_stack_limit()
* L/ n) @; n, e0 V{
) k% B) t) S! I9 S; N4 Z4 h) ^    dbglimit=0) }% I7 Z" j# ~+ g( R5 A
    hardlimit=`ulimit -Hs`4 h6 }0 @4 P' r. L: N+ L, |* d! p
    softlimit=`ulimit -s`4 I" _7 m5 `8 ]  u  [, C
    desiredlimit=60000
3 n! d5 \1 X0 g8 a4 d6 N    hardisunlimited=0* x& W  N9 S# B$ D  T+ F
    softisunlimited=0- H' f5 i! F0 q/ {$ a& d
    is64=0% p% |$ T* \& {8 m4 ?1 L- [
1 J; P/ g+ c6 H0 K& z0 L! A6 s
    case "$EPIC_ARCH" in  p5 c2 [1 ~8 M. [  E5 x( e* Z
    *SUN*64)
% `2 B' f# y7 q- _- w        is64=1- `4 m- @% R  I& C& ?4 |
        ;;
3 U! ]8 ?* Q' o% Z7 A    amd64); [/ V6 u6 g2 ~
        is64=1" @8 {9 A5 E. `$ f( P8 |
        ;;
/ U: N5 x8 {8 M: R4 C7 q5 ^    x86sol64)
, n' n: ]. T0 v  ~; l# \- n        is64=1" O" F" U/ a2 Z  X! [. Q
        ;;
( s0 R1 _$ _) b, [: f8 ~. ?    aix64): p# V# s9 M. t/ [
        is64=1, e  C, h) c4 I) J: O% E
        ;;/ q2 N$ U9 [/ a$ Q$ |( @2 b8 j
    suse64)9 l  f3 @9 I5 |8 j7 h" k0 \
        is64=1* Q  k1 u9 ^# ]7 d# E' \" S" d
        ;;" D; y" O& s+ I7 W# n3 `
    esac
- p) X1 r& L0 Z# f; `( M1 z1 `. {1 F2 W. \3 h& V
if [ "$EPIC_WRAPPER_DVLP" = "" ]; then4 V  C6 |. ]* h0 w2 e# m, I1 W# J+ _6 d
    if [ $is64 -eq 1 ]; then
# `! W/ l- c6 ^  X        desiredlimit=2000006 Z3 W2 ~3 o* ~' O- \& c* i7 H( V3 o# U
    fi
; S0 G+ Z* h; U* [else5 }  w# H$ _! u* y  K
    case "$EPIC_ARCH" in8 x8 F- H0 T5 O- q
    *SUN*64)
( O0 z' X. B) V2 `) Z8 F; P        desiredlimit=200000% K, R. _5 R: O4 |1 g/ E* s' K; G
        ;;) H$ e8 f1 y. X: e2 J+ F* P
    esac( I& W& Y. l- N
fi
7 \% R& R8 k: ]8 f, Z! s1 l4 R. L        6 k9 h) n2 Z: Q9 S: a6 v/ Z
    if [ $dbglimit -eq 1 ]; then  z' v+ \3 z: Z" b3 b
        echo hard $hardlimit soft $softlimit
% W2 C! e2 I- a/ H# g- ~    fi6 X, Q+ ]* p) Q# E( c

' {: P+ J5 m  m3 `' \) h' y. H  R    #stacksize can not be unlimited, pick smaller number
4 a/ T& d* q4 ~# h5 N/ g0 a! C
  L3 Z2 T: @" N4 k5 S- R: p9 k    stacklimit=$desiredlimit) E4 B+ I, `- I$ [$ o- u
2 E9 `% _# R4 `( \( Y
    if [ x$hardlimit = "xunlimited" ]; then: O- G6 I9 B+ o/ J
        hardisunlimited=1
) Z9 S! o6 v0 U' ~% B% |0 n    fi( I2 D- D  [1 n, J4 D

! L7 T. A, t% L1 Q    if [ x$softlimit = "xunlimited" ]; then- |  t( W$ {5 ]+ ]
        softisunlimited=1
2 V! D: k: L0 Z" r5 X( w    fi
8 X# f6 o7 u% t- |, q. f8 c1 G
  e& o" C( ?# z. q, a8 P3 X4 f  w  W    if [ $hardisunlimited -eq 0 ]; then/ F0 v( s+ w( t* E, ]; y- V
        if [ $hardlimit -lt $desiredlimit ]; then/ F. ^7 R" G' d$ |+ q. k+ s
            echo "WARNING: stacksize hard limit $hardlimit K is too small."
9 ~: Y; I2 {) o4 @4 G4 F            desiredlimit=$hardlimit
7 h' r$ ^3 B+ X, P5 g. |            stacklimit=$desiredlimit
* c! Q5 L/ a5 d8 y4 \' m        fi- j3 E7 v( X- F6 G
    fi
6 l9 U- n/ @& l
$ x0 L6 z+ j  w, m    # desiredlimit is set to proper value (< hardlimit)
1 w% w( r# t2 }, v, j
# H( `( v8 ~! c! a  m# Q& R    if [ $softisunlimited -eq 0 ]; then
$ P' c9 X  L6 e& l        if [ $softlimit -gt $desiredlimit ]; then) P% j% `. Q! g7 y
            stacklimit=$softlimit# d; P; c! l& c( E
        fi
& u8 T) i) c6 L6 r" R% O) Q4 R    fi/ V' |, {6 v: x+ H' K5 l
1 R  s8 s# l" L) `9 F: c% b% h2 L
    if [ $softlimit != $stacklimit ]; then
% l2 p8 T. J2 G5 g! X9 @2 f% v) H0 T        ulimit -Ss $stacklimit
1 ^& b* A/ Q; Q; s( S: M( _#        echo "WARNING: stacksize limit is set to `ulimit -Ss`"! Y' H/ e( B3 l6 z+ ^$ ?5 q
    fi8 t+ A, i' g' M" ~# n8 `# `3 ]
9 |9 F* B% f  {  i# e9 B
    if [ $dbglimit -eq 1 ]; then- l  J9 i7 I: D( n- U
        echo stacksize hard limit: `ulimit -Hs`
  t# ^1 b# y. D8 l2 j        echo stackize soft limit: `ulimit -s`6 R* C9 Y5 L! r) i! t+ V- p6 A
    fi% S, q( S( |- v7 |8 d6 c) q* j
}. u9 w1 T9 A4 J+ I/ d
- S+ `+ R4 [: B6 \
open_epicscriptmessages()
( {9 r7 N' x. M, N{8 w! S! {  z: Y1 }! f
#generate  temp ".epicscriptmessages" file based on pid
6 R4 N7 ~& a0 AEPIC_SCRIPT_MESSAGES_FILE="$EPIC_SCRIPT_MESSAGES_FILE"$$
4 c% _/ R, \; i# \1 Qif [ -f $EPIC_SCRIPT_MESSAGES_FILE ]
- V/ O& _# ^8 Q- Athen
, q  W3 m6 P  C  until [ ! -f $EPIC_SCRIPT_MESSAGES_FILE ]* ^" j7 E+ l" ~4 ^! L% _; s+ J
  do5 T6 @; f6 u' q/ ]3 _
    EPIC_SCRIPT_MESSAGES_FILE="$EPIC_SCRIPT_MESSAGES_FILE"$$
$ P% L! G8 F( l) p  done! O3 y5 @0 s7 `& h
fi
% M# R+ K. V" R* E  F* }0 t
1 Y; `( W1 ]' L% i6 l' kexport EPIC_SCRIPT_MESSAGES_FILE
/ X0 |/ x+ n4 i1 E' @}+ V  g& R& G/ M+ k7 e+ X% G
& \+ T1 e/ e7 X

2 Q# Q4 N. [+ W, E9 y. pcmdname=`basename $0`8 n7 k3 M/ F* ]$ S. {
postgres="n"
9 Z' d! n( K! J6 Y1 O: @ostore="n"3 s2 x7 y5 u  ]6 j: Q4 M
gui="n"8 C$ L1 {; o% {, A
databaseOn="n"6 x% e7 B( O1 p( ?) I) U2 i
f_next=0/ h/ U' [  m2 m, K- y
f_option=""
8 x" Z$ f2 I) eo_next=0* D9 Q# v  }0 S  i' x/ i; f8 N. ^
o_option=""  }8 Y  P7 _8 g% O5 B8 L7 N
workDir="", T* V& D2 |2 R; l3 d+ X
workDir_next=02 G3 \/ c$ s+ W) e9 S
errFile="powrmill.err"+ ^$ Q- n; [, t- A0 h) a9 g+ T. L
win32flags=""9 n& y/ @  n' D  X8 g! E% H
ln_default="ln -s"
$ I2 s5 Q' s/ C( C2 w, _9 E4 Z: z" D7 L/ }1 k. ?
har_hilo_file=""# c% C# ~7 f; ]% W
have_har_flag=09 |; I, ~& L8 B
have_har_setup_flag=06 E3 r; s3 W) f! P2 f4 H( w
is_special_har_run=0* O. l2 z. C( V
har_ofile_prefix=""
: c7 d& q7 j! S" x& O0 W$ K2 J2 E* {  Q& a% A% s3 }
have_va_flag=0# U6 D! A/ }+ I) W/ C
have_vaf_flag=0* E% B7 X3 V, f, w
VAF_FILE=""( b) x" l2 V* ~3 s8 Q1 X- v
VA_FILE=""! {. c' J6 v5 y1 j9 q
ARGV=""
1 C/ j4 @- x! l7 c1 y, U% P& n8 p* J) H" d! P( ^0 M' A% L
ORIGINAL_COMMAND_LINE=
; }/ _" g( A$ d7 d# A  W8 @LOOP_CTRL_FILE=".ns_ba_env"1 l5 {; q- x# R3 i" E5 ~# m
ALTER_HK_FILE=".alter_hkf"9 X1 r2 _% j0 Q( t2 M: c4 n
ALTER_COUNT_FILE=".alter_count"2 h' R3 w% t! ?) U* y
MONTE_IMG_FILE=".monte_img_f"
8 Q# L9 b- I) @/ TMONTE_COUNT_FILE=".monte_count"
6 ^1 v, O. z0 h- U# }: ~6 b* U3 |MONTE_CFG_FILE=".monte_cfg"
  F1 g+ T  a& c, F- B: yEPIC_SCRIPT_MESSAGES_FILE=".epicscriptmessages"* A' [. _, K6 L! C3 D% Q  G

: V2 V- c3 f8 u& C9 hopen_epicscriptmessages $@0 R4 R5 e2 t. Y7 j) K, p

+ C# U7 i" C  b5 E( G  ~scan_for_hva_args $@7 ]+ E5 O& n5 J+ V4 F
% o/ f: V$ Z3 z) I
scan_for_har_args()
) q; U1 _2 h; B4 ?2 c+ j{" p# m) i* T. A$ H' _
  while [ $# -gt 0 ]; do
$ D; u2 c* U$ e# A* F    case "$1" in
3 W! T2 h! E# }' t0 l      -har). v5 x2 P9 M" `0 z# d, Q7 f
           have_har_flag=17 C: e0 ~1 ^2 j$ q
           [ $# -gt 0 ] && shift
0 V% d9 Z  |; k( k+ u  L! h           if [ $# -gt 0 -a `expr "$1" : '-.*'` -eq 0 ]; then
& B7 c8 C- l. n: M* V% Z             har_hilo_file=$1
+ e* p4 B, @8 h$ n/ O. D0 x             shift# W9 }4 m5 F  p' m5 b
           fi
( W' r! X$ Q0 U* w           if [ $# -gt 0 -a `expr "$1" : '-.*'` -eq 0 ]; then
7 [8 j" l, u9 |& _" f6 E: X             echo "Too many arguments to -har flag. Only one hilo file allowed."9 Y, G+ T+ s, y* K9 n" G  J
             exit 1
- m1 K6 C$ g" n: E           fi
0 J1 F+ G6 B# i, G4 E           break
  P3 S* G3 T1 d# c6 K        ;;
: F8 h! i: F) r' `9 ?7 d      -har_setup); G3 ^- o. c- ^& D/ X  Q8 Z" a
           have_har_setup_flag=1
* H3 t1 S: j& A. i. h; n" i           break
. H3 B. C) n) B5 a( A& T1 S        ;;
4 Z- d# J. R9 B! }. N6 E      *)
* x# o* r6 c( p/ ~# n3 n0 ^+ n* z        shift
0 H) W* G0 n) h( O        ;;
+ n, S8 G  C7 Q- a3 F    esac; L- p- ]( |, s
  done
0 w9 d( H+ ?. i, V, u2 t}
+ c% p8 P- I" _% M+ ]8 H$ }3 f: C" @; n7 s* n: j
scan_for_har_args $@
/ d6 {6 f# I2 ~5 _( W( E# {6 I7 ?6 ~1 b$ J& f) R" q
for argv in $@
3 s& N/ q- j, x1 H- f; y& n; kdo. E, Z: ]2 Q1 {- I6 s
   ORIGINAL_COMMAND_LINE="$ORIGINAL_COMMAND_LINE $argv"
2 {8 w4 ~, u6 N! w( j& f4 d3 U    if [ $argv = "-gadb" ]; then
: S# F$ ?: C9 p$ k9 {        databaseOn="y"" J9 A8 Z/ z& A& z# f
        workDir_next=1
; s7 D' x/ P! q5 W4 F    elif [ $workDir_next -eq 1 ]; then- H$ L6 ^1 x! k8 S
        workDir=$argv
6 c& b1 P1 h3 O: r        workDir_next=0$ Y: x) `$ `2 Y' `" B. C
    elif [ $argv = "-ga" ]; then( [/ i: ~. d- x( S
        gui="y"
1 @) ]0 a' c! C8 z+ M) f    elif [ $argv = "-f" ]; then: _1 p; ^+ u2 b6 t% J
        f_next=1" H$ d/ ?  D2 d" u
    elif [ $f_next -eq 1 ]; then5 E% ~: G% M/ j8 J0 a, p9 D
        f_option=$argv
. `( L% L5 X/ S' u( k        f_next=03 O8 Z9 v5 [. Y) L6 N
    elif [ $argv = "-o" ]; then; L/ r  [1 C% v' ~8 c) ^# c
        o_next=1
4 G# a2 ]" |0 C' b2 K/ \    elif [ $o_next -eq 1 ]; then
( w5 a" [0 B# Z3 M$ l        o_option=$argv
& k2 a6 H0 D7 _# b        o_next=06 @3 }  x2 j8 Z/ H0 F% J! ~
    fi
: x1 {( w5 b) R6 X* q5 M; hdone
$ k6 O" ]/ @9 F1 o) e% necho "Command line options: $ORIGINAL_COMMAND_LINE" >  $EPIC_SCRIPT_MESSAGES_FILE
' ^" z- P5 C8 F, {: @; i9 D9 X& E$ e
( d3 |0 p8 R( xif [ $databaseOn = "y" -o $gui = "y" ]; then0 z1 Y8 M6 M* W5 V; z1 {! W
  if [ $cmdname = "pathmill" ]; then4 d1 l& u; Q7 _
    if [ "$EPIC_ARCH" = "SUN4_SUNOS_5"  -o "$EPIC_ARCH" = "SUN4_SUNOS_5_64" ]; then
. G+ n; F( A% I. F( A: ]         ostore="y"# Z) Y& K/ v; ]
         postgres="n"4 W  G% W. L! K
     else1 N5 e6 D! R# k  S2 {
        echo "athmill GUI is supported on Solaris platforms only" 1>&2 * o% L+ G; j/ W7 N0 r
        exit7 g3 d* r. Z: ?0 N5 p
     fi
: U5 ?3 A; e' k, Z4 q" }  else
+ U/ s7 a( B  Q( V    postgres="y"
+ \+ e. l% R) E# s& N% D- w7 ^9 A         ostore="n"
, B8 [0 s6 L- O  fi
  q6 r8 L$ o9 y7 ifi
( z2 j5 D6 s% n: R. J
/ \0 y/ \/ r% k; O; h5 K! pif [ $gui = "y" ]; then* ]9 S& v8 {/ o& n
    if [ $cmdname = "powrmill" ]; then9 s3 Z2 S7 K3 N, J! |2 {. C; L
        pwga $@
, @) K3 s: y' D$ H& T        exit! ?) s. A, [. F& F
    fi( `1 U; p( L! @1 Q2 h
% d& c2 O; M4 X: i4 J1 E( J
    if [ $cmdname = "pathmill" ]; then
  ]8 Y" E) ^1 P$ a9 ^: g        if [ $ostore = "y" ]; then; X" V- y. M9 d
           ./pathfinder $@
$ H2 Q& Y/ o& x' P/ [           exit( E& I1 t& N6 G
        elif [ $postgres = "y" ]; then4 p7 I# ?8 }: v8 k# t2 F" i
           pmga $@6 J6 k' G$ C4 t+ M4 u
           exit
( o3 H7 Q/ w9 q5 }        fi( X; E- d7 P0 e" O  O$ T
    fi8 r, ?" i. ^5 Z2 n1 c
fi
1 p# ]) p. K  L/ Q& b! E* @* t" x% s
+ o6 Q1 |2 n% f3 Y/ Jif [ $databaseOn = "y" ]; then
1 X8 R, K2 M" F$ T   if [ $ostore = "y" ]; then
1 d0 v8 L7 R" W. r5 ]) S% q" Y) z      if [ -z "$workDir" ]; then. r2 Y6 K) x$ U  o
         echo "Error: Missing argument for -gadb option"9 s- Y+ }4 d7 A$ ]
         Exit 1: Y% l# |! [) `
      fi
+ |+ E3 |& R; E- B6 a' H: U   fi( k# m7 v$ z! L0 Z5 h8 m
   if [ $postgres = "y" ]; then0 [! B4 O6 \/ {# p4 G
      if [ -z "$workDir" ]; then+ b: M, a3 R& T' W* Q& Y+ I
         echo "Error: Missing argument for -gadb option"8 U/ ~% ?! j2 r0 Q9 t/ Q
         Exit 1! u/ V$ R) I1 O3 d6 _' @! ~+ c
      fi
9 A& H( }7 L) u. o   fi
, K9 y9 V1 }* \  I/ f- Gfi* L3 n0 Y) @9 n: {# T8 K: s

6 q2 l. v( K4 d4 w9 Tif [ $postgres = "y" ]; then
* A8 T. m: J& ?  F# f2 D7 _% [5 @, F4 _* |
    if [ -r $EPIC_BIN/scripts/gui-init ]; then1 y4 F$ A7 A  S& a. K) g
        . $EPIC_BIN/scripts/gui-init! G  |9 f0 r4 L$ k- k2 ?3 B
    elif [ -r $SES_ROOT/bin/scripts/gui-init ]; then/ F' b4 Q5 F; t4 L' W7 i
        . $SES_ROOT/bin/scripts/gui-init
9 D5 g3 \+ n; M- s& K    else1 S9 [% u" \$ S- E. X; u* h' `
        echo " ** Installation in \"$EPIC_HOME\" has been corrupted!" 1>&24 V) ]$ n& N: z
        echo " file bin/scripts/gui-init is missing." 1>&29 e- O1 `8 k: G. i( @
    fi0 n* ~+ d% |( n3 c

. L- G# c# i) w6 U9 l9 _: R' q    workfile -tool $cmdname $@
, g( ^  V5 J* _- Lfi/ j/ U( d$ n, O* l% a$ {

- I) f6 h$ I% W8 V5 O$ x' xif [ ! -z "$o_option" ]; then+ w# |9 O0 i0 j# ?7 }
    errFile=${o_option}.err" m1 y4 D4 S' M* }0 f. a0 r
elif [ ! -z "$f_option" ]; then
% T+ X, `1 j( o) w7 j' ^    if [ -d $f_option ]; then) y' i" w1 b" u4 j4 y
        errFile=${f_option}/powrmill.err
6 U' [( B! I' Q4 ]% w/ P    else errFile=${f_option}.err7 S: s( o, q% M/ u8 `
    fi
: s2 P- @1 [' c) f# pfi/ z  i* M, ~8 v3 R7 i
% Q  Z( `/ h+ e+ Z
7 t7 O; e% k; ^' D& X; M
if [ "$EPIC_ARCH" = "RS6000_AIX_4" -o "$EPIC_ARCH" = "RS6000_AIX_5" -o "$EPIC_ARCH" = "aix64" ]; then
5 r2 @$ a* X1 C% w4 m; L* }* S  rundir=.epicrun# y  e7 v+ |, S: l% G0 {: z/ U8 x
else5 x8 d. `$ E! y: w- C
  rundir=.epicrun$$2 @2 n( `3 ~8 \: \9 C
fi
# z- ?8 O4 Y; |$ G5 V1 Y
; ~! V+ E2 N0 [, X" }6 c: wlibpath="$rundir${EPIC_DLIM}$EPIC_DIR"' D; y5 V% H0 ]$ E! n
" T5 K/ F" X$ F6 w
cwd=`pwd -P`. g9 H5 a* c6 `# o: W/ G$ t. u
if [ $cmdname = "acehdl_w" ]; then# C3 [' P$ N  r0 y3 P; D
  cmd=`basename $0 .sun`
  M" i9 @! c- M  cmd=`basename $cmd _w`
- z) L: o2 Y& Welse
8 Y& m6 o# w( P+ i  cmd=`basename $0 .sun`  n# }7 z- D0 m! ~  d0 M1 u7 O. C. E
fi: P8 c4 N4 E. l  i
, s3 k# X- G6 N9 c" I  L
command="$EPIC_EXEC/$cmd$EPIC_EXEX"8 Y) J" m0 |! Q8 P9 ]4 X
[ ! -x "$command" ] && echo "$cmd: not installed!" 1>&2 && exit 13 |, U& ?5 a  S

7 m  k3 n7 E' v; Y( W8 G2 X# buildmod extracts -u/-fm options and calls genepiclib
# f- ^3 l* n8 Z) f* h( S# It also set the remaining options to variable CMDLINE+ q% G$ |; i, w, ?
# look up in .epicrc for -fm & -FM parameters5 J/ K8 L! ]7 @9 }
: E6 B) W7 o4 @! C" G0 V, a
fmlist1="`get_epicrc ./.epicrc user_adfm_obj_modules`"
. O' f& u1 f; N: G4 h[ "$fmlist1" = "" ] && fmlist1="`get_epicrc $HOME/.epicrc user_adfm_obj_modules`"& N& ^& u' R6 d$ ?% q/ {) }
[ "$fmlist1" = "" ] && fmlist1="`get_epicrc $EPIC_DIR/.epicrc user_adfm_obj_modules`"
* e$ @  @) m0 t) A2 y / b8 Z6 ?) Q4 @
FMlist1="`get_epicrc ./.epicrc user_adfm_obj_modules_force`"
. ]+ x* z" `/ Q. o! i6 s: B[ "$FMlist1" = "" ] && FMlist1="`get_epicrc $HOME/.epicrc user_adfm_obj_modules_force`"
2 f# d7 |: P  z7 v4 m[ "$FMlist1" = "" ] && FMlist1="`get_epicrc $EPIC_DIR/.epicrc user_adfm_obj_modules_force`"$ {2 U1 }1 U$ s/ l9 ?4 b  X, D

6 S- l; X; ]  E& Y2 E0 fif [ $# -gt 0 -o "$FMlist1" != "" -o "$fmlist1" != "" ]; then
5 w7 t7 I8 t2 F" C    # note that the buildmod script will set the CMDLINE variable. T/ b5 \$ u# [1 f
    . $EPIC_BIN/scripts/buildmod
  j; H+ e+ D9 K& e# a3 a+ y7 M' _( T5 Y% i
    #echo "This is the value of cmdline=$CMDLINE"
- j  m0 I% P) L( B    #exit 0
9 h# v1 s, M, m# K2 A; O& M8 o* T1 Y$ ?+ c
    # if a new timemill/powrmill/pathmill built, run the new one
+ O6 y2 ~' n; Q& m    [ -x "$rundir/$cmd$EPIC_EXEX" ] && command="$rundir/$cmd$EPIC_EXEX"+ T" @# T$ W& p' r
fi
6 V; X6 }, l, ^. d  A; d: |+ f+ Q/ Z& ?3 C2 R
if [ "$cmd" = "timemill" -o "$cmd" = "powrmill" -o "$cmd" = "nanosim" ]; then
. t) ^  ?0 b' S9 x; v6 p  if [ $have_har_flag -eq 1 ]; then
- w% @+ I0 f# ]4 R6 C& ?  A, p    is_special_har_run=1
6 v3 }6 r% T# G' T) i    if [ "$o_option" = "" ]; then: K/ m& P. X! o( O+ Z, h" W
      case $cmd in
8 a- ?& L  h" A7 `2 ~2 w% f9 J        timemill)
) Q# n$ _% W: i. t          har_ofile_prefix=timemill
! V2 q* `' ?3 j7 Q) F" m' |! z          ;;
' h, m6 k) U7 G; z2 d$ T        powrmill)9 u9 X7 X# e" ^  p& F
          har_ofile_prefix=powrmill
  m! x# i( e! Q! r$ T; K% s          ;;4 i* k# f( G: L
        nanosim), x) l. e( L+ [3 D
          har_ofile_prefix=nanosim) S: x4 Q) V* |1 [
          ;;
+ R3 U& r0 B1 N) v( |# [      esac, m8 r- ~' f; L( h* }$ O7 w0 ]
    else
9 l+ p5 M1 m/ g- n      har_ofile_prefix=$o_option% `2 _/ w- ^- T8 l6 }
    fi
8 d. {3 Z  g0 I. c' w/ o fi/ x% A2 @% S, [9 v0 q* G6 b
fi
3 T- V) E, Z7 i+ |( M. J# t0 c
6 S2 B; P- D+ Q) _# Call Double precision version of the product if -D
9 x8 Y( s" m5 Q0 ~2 a% P# or simulation time > 1,000,000 ns.  s& p+ i2 r# d( U. _
if [ "$cmd" = "timemill" -o "$cmd" = "powrmill" -o "$cmd" = "nanosim" -o "$cmd" = "railmill" -o "$cmd" = "pwarc" ]; then
5 I  E) ~8 G1 s, Z$ h% Q
# G, U: w; B. q7 b5 \7 P  # Now the binary always has the ACE feature
, H6 I2 b- p0 k  USE_ACE=YES
8 I7 ]- Q+ @4 j( \7 p
7 S1 E# k9 u& `0 F) d$ O  HAVE_DP=NO' U/ p" B. W' u! V, {, Q" K  V
  EXTRA_CAPACITY=NO
8 n4 t; g. N1 @5 ^# j8 m$ O  DB_REAL=${FORCE_DB_REAL:-"0"}0 W- r, B1 q: x. M  u3 `

# ~- T: s; l" k* w$ h/ l- i' I/ T% U  # Enhance for ACE ease of use, |' ^0 w! A' u' o5 }  V
  # If no command line option or only a -T option, do:2 p0 X" j; Z$ J; [
  #   1. set -A option9 _' I5 a" b- O# V' J% X) P
  #   2. assume input file to be hspice
' z5 J' J# ]; Q! I. w  #   3. set -o to input file prefix
' M8 `- m6 \, f) W+ Z  #   4. set -z to input file prefix
4 h+ o* W1 v# Y2 K% L' I  #   5. set -c to default config file2 v/ n6 n8 N: A
  netlist="") e8 @9 [6 M2 F3 \
  minusT=NO
* j3 L* @! l7 U  B! E  useStdCmdOpt=0
( {8 @+ P+ t0 c  R  prefix=""
9 A0 x- V! j$ h  circuitType=""4 \: A" ~/ z$ A$ D
  for opt in $CMDLINE
1 B: B2 C7 X0 L( J% u. e  do
& ~/ g1 y3 r# Y* F- ?; l) w" f    case "$opt" in * b# R/ J6 X% D1 w. b* d3 p  ^2 J
      -T)  k! \$ _7 _5 H) x  r5 A0 U5 C
        minusT=YES. ]( x- [3 B* e, t" y3 ]
        ;;/ s" y% l, }6 G; X2 E% W. u
      -*)
9 a. }! h# X. l6 l5 W        # using standard powrmill command line% H2 g7 t. E* {9 w
        useStdCmdOpt=13 e: @* Q  k( ^1 D8 ^
        break
' {/ E) C) {8 H- Z        ;;9 ~3 R* }1 K) F1 ~
      *)" m2 Y2 l' H: x1 d5 L: R4 J
       if [ "$minusT" = "YES" ]; then
$ w0 g% I9 i4 p, e/ a         circuitType=$opt
& S% f1 ?, }: Y2 O& q. s  q& e         minusT=NO  # reset flag
9 z  {" U8 p6 ~; a. F1 c       else / C- G- Z4 C! u% }0 V. B
         if [ "$netlist" = "" ]; then. ^. E, {$ N( w) E' L) O1 r
           prefix=`basename $opt`, O# ?6 G4 x8 N/ h* h% L6 N
           prefix=`expr $prefix : '\([^.]*\)\..*' \| $prefix`
/ L5 z: y% Z+ ^3 a+ E9 P1 d) B6 ~2 H         fi. y0 p5 T) I6 ^2 o7 k- n2 x
         netlist="$netlist $opt"1 _; T" D. T1 e
       fi1 [; a% S/ Q! p, @) f1 y5 G! }
       ;;) U- I3 }! t( b2 X1 t
    esac
, k# b+ |& c" C* }  done
$ }$ N* S7 U) ~: _  p6 e; ~' e. [) q; J  y8 P
$ o8 {0 w3 h6 u( \+ B
  if [ $useStdCmdOpt -eq 1 ]; then! X9 U; K. |) n% X1 i' Z: w
    # use standard powrmill/timemill command option
0 V7 ?. o7 Y6 j$ `; O3 r- A    for opt in $CMDLINE- t- B0 P4 j% }6 z
    do; @( x3 s0 |$ T4 a# ~( Q
      case "$opt" in ( o: c* g. M. n% P1 W
        -A)
0 ]3 g7 T" V! Y( L0 u$ ?) M* ^            DB_REAL=1, L+ R8 z& T/ T
            ;;
: U3 S+ C9 s& l/ P& a7 q; a      esac
4 A0 n) ^5 G5 |% E: S  h    done0 _( @) J9 d) U0 H! V
    if [ "$netlist" != "" ]; then
5 j9 \" D3 i4 ^      CMDLINE="-nspice $CMDLINE"
# y/ f  Y' x2 F1 V" N: b5 }. T! n    fi/ W6 L% ?: f; Y
  else
! y! t2 z5 |# U    if [ "$netlist" != "" ]; then
7 I, z$ z) ~7 T$ S4 Y: _8 l$ W/ D      EPIC_DEFAULT_CFG_DIR=${EPIC_DEFAULT_CFG_DIR:-"$EPIC_AUXX/etc/$cmd"}
6 M6 k; X9 L6 r" [/ M$ _      # construct new command option$ z. V5 [, U3 B( `
      if [ -f $cmd.ini  -a  "$circuitType" = "" ]; then
! ~4 W; j' F, @# A        CMDLINE="-nspice $cmd.ini $netlist"
8 c& C! z5 l  ^( U+ q- N; L1 ]+ X      else2 e$ t1 F; _3 o* c" k
        if [ "$circuitType" = "" ]; then9 r) H+ J0 s4 d* @
          circuitType="msana"
0 C4 h1 ^& Y1 I( F4 h        fi+ U* }& S! ^! P  N7 |$ Q% S: w
        CMDLINE="-nspice $netlist -c $EPIC_DEFAULT_CFG_DIR/$circuitType.cfg"2 m8 F. _, ~! n6 F% J
      fi, d2 b) g! Y+ y1 b3 X" d$ R$ F
      CMDLINE="$CMDLINE -A -o $prefix"- L; a* {7 K' h$ W
      DB_REAL=1
# C" S% M/ v: e7 J7 O0 z5 x      echo $cmd $CMDLINE
+ d. c1 J  w# G. `/ `/ x5 k! Y    fi
- m" n. s9 G9 E  fi+ M8 b" G% t0 K. l' A
fi # cmd is timemill or powrmill or nanosim or railmill or pwarc
* @  t2 C& U, r% l. z; o4 t
8 z2 @5 f6 @; a: Q* V[ "$HAVE_DP" = "YES" ] && [ -x "${command}_a" ] && command=$command"_a"( G) h/ A# S( o5 v: T
[ "$USE_ACE" = "YES" -a "$DB_REAL" = "1" -a -x "${command}_a" ] && command=$command"_a"
& X2 J0 y& [( Y& C+ `; _[ "$USE_ACE" = "YES" -a "$vlog_design" != "" -a -x "${command}_v" ] && command=$command"_v"; c# e( {1 H" z% G

: G+ W& X0 G. L& X% N. Aif [ "$__engine_wrapper_called__" != "Indeed" ]; then$ _7 Y2 ^9 g" {
    __engine_wrapper_called__=Indeed
5 T- }6 p* a0 h3 i6 `    if [ "$cmd" != "amps" ]; then# `1 Q' Y2 \! U4 L; ~: B3 ?
        export __engine_wrapper_called__
8 f' F9 F5 D6 f' m) }' n    fi
! z; P# ^) r9 }- P0 w$ _, B4 c
) G2 h7 x1 i9 k9 Q0 s+ h+ j    trap "cleanup" 0# a! X8 L% }+ ^5 N: ]
    trap "" 2( d+ r+ X- T/ D7 m' u

2 n$ b2 A! G! h; P0 s# d! u7 m    [ -d "$rundir" ] && rm -fr $rundir
( U( H3 @% m7 f/ \- }    [ -d "$rundir" ] || mkdir $rundir
$ p" i7 U+ s  m+ {' @! e% u) t
- J3 n) [2 ^# I% d  v2 @5 _) G! X    case "$EPIC_ARCH" in
6 X  `# ~8 q1 C% \    *SUN*64)   9 P3 G& |! @  b/ u
        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH", g) k% r, t' z& J+ K( T: ]! o( U+ u
        export LD_LIBRARY_PATH
4 v! S5 n1 B1 [  B        suffix=.so8 i' a  B8 y4 [3 H
        ld_err_code=127) @' ?* R! {2 f8 M0 @
        ;;
( e9 _3 }: @7 v9 P# `: T7 S    *SUN*4)   
; w. e6 o! Q2 K/ a, ]8 H        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH"
$ _+ {. \3 p. E, C8 g        export LD_LIBRARY_PATH) Q- ]* F* D8 k- v# x
        suffix=.so.1.0' a5 {; K0 x' y0 Y$ ^2 V+ I
        ld_err_code=127
4 S. a6 q6 M% E        ;;, p- I5 y. u! K6 t' a
    *SUN*5)   ) k$ G: ^& l" d+ v" M$ E
        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH"
( d5 R! I1 W! ^5 G3 ^5 s3 b% k# q        export LD_LIBRARY_PATH( k# E: K( o1 L, q/ s6 x
        suffix=.so8 A6 f  B! u, t9 t9 q0 [+ b& l, m
        ld_err_code=1270 Y5 U6 k5 ]( P- d# ]
        ;;* l" |! e0 u* w8 H2 \% u. U
    x86sol*)   $ n% M7 q1 [0 i' t& T7 \/ z) y
        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH"' ?/ z! s6 G- i- f6 H; s/ b2 P
        export LD_LIBRARY_PATH' R% |) D9 ]" F* |# I" s" F! d
        suffix=.so
4 q+ _" K# x; l1 r        ld_err_code=127, J4 J3 L4 j) [
        ;;9 ]* L3 K. F( W5 F" ~6 F, q7 ~
    *AIX* | aix64)   , |, x: u  D# M0 ?0 \
        # When genepiclib creates shared objects, it creates a import file and
  T& \, w3 {! z& q* I        # uses timemill as program. So at exec time,program timemill is needed
. J/ e2 R5 t* n+ J  \        # in LIBPATH
' \9 {4 L- Z; z        $ln_default $command $rundir/foomill
2 P1 N% t" N& `; S  A        LIBPATH="$libpathLIBPATH:/lib:/usr/lib"+ @0 U* f* G. {9 ]
        export LIBPATH
' m; {" c0 ]2 [" u        suffix=.o
5 [5 X. @: _( ^1 I" a: A/ D        ld_err_code=8
  P6 M4 Z% j3 a6 h        if [ "$EPIC_ARCH" = "RS6000_AIX_4" -o "$EPIC_ARCH" = "RS6000_AIX_5" -o "$EPIC_ARCH" = "aix64" ]; then$ ~( L' Q* c8 X. y: m* c
          tdir=`echo "/tmp/d"$$`
4 l- x. J$ v' R3 Q2 r! N4 H          [ -d "$tdir" ] || mkdir $tdir
1 e" L* `8 i: |. N5 K9 x$ r9 i! b          if [ -f $EPIC_DIR/libCustom.o ]; then; r5 R7 P/ E( l# I" _* K' c+ Q
             cp $EPIC_DIR/libCustom.o $tdir/# u9 q2 ?6 M. g; @9 w. Q
             $ln_default $tdir/libCustom.o $rundir/
+ R3 }/ j4 K. [5 p7 @6 s          fi: ~$ f3 N' v& ]. F/ K8 ]4 p
          if [ -f $EPIC_DIR/libModel.o ]; then
: x5 Q+ c9 I% B: @/ i# \) {             cp $EPIC_DIR/libModel.o $tdir/5 b  v& O# u% `
             $ln_default $tdir/libModel.o $rundir/" B/ w+ R/ Q5 B7 V
          fi3 y8 \3 G$ X- y8 l
          if [ -f $EPIC_DIR/libFuncModel.o ]; then# T4 X7 y0 }5 q2 j
             cp $EPIC_DIR/libFuncModel.o $tdir/* b) a" c7 s/ u. a
             $ln_default $tdir/libFuncModel.o $rundir/
: W' M! ~  d9 j3 o# q: K* l; c          fi
; }9 E, p/ l9 i& r; l0 Q5 o/ G$ m1 k; h4 [          if [ -f $EPIC_DIR/libFuncModel.34.o ]; then
3 p/ p& ~- b) e4 q, _             cp $EPIC_DIR/libFuncModel.34.o $tdir/, V$ A/ \4 \& ?: W6 f7 \5 j  s
             $ln_default $tdir/libFuncModel.34.o $rundir/, Y: f/ D; @, ?9 O; W8 V1 B
          fi
1 q& U% a5 p; R# \4 Z# L6 n8 ]        fi
' f' Q% {+ w8 Z- }% a$ f5 i+ y' r        #Set the IBM flag to enable more shared segids2 s2 H3 h; J8 O3 B, G/ u) _
        EXTSHM="ON") N9 R/ j- P; `. `1 n1 `
        export EXTSHM
' }/ h! g: T% `2 }- Y- q4 G# F        ;;( l, y. T! k) p% z# q) G& `
    *LINUX*)    & E( y; m+ X$ y$ Z' S- A; _  U
        suffix=.so
, m$ X: |/ b; h2 r3 c8 u8 o0 L        ld_err_code=1  a( E, ^: d& K
        ;;' f1 X. A3 o3 L' r0 L
    *amd64*)
- Z1 z& t) J) ?/ K; u+ i        suffix=.so
6 ^# _- z/ r. l        ld_err_code=13 c2 a' Y0 D9 T  x$ K3 B( _6 C
        ;;
: H: D3 d# L) T+ `    *suse64*)
5 d6 c7 t" O  ?) W+ S  s        suffix=.so7 J/ s9 G$ i3 n4 G. S, v% b+ x7 Q: F
        ld_err_code=11 {; s% t5 J. X0 C
        ;;
3 Y) t# _$ n! C: B0 c+ x! b6 ?    *suse32*)    1 q1 m, z! J& @
        suffix=.so+ n" q6 k  Z: Z5 p# K  `
        ld_err_code=1
6 _7 X2 e/ Z( u% u3 P* ?7 {        ;;
* [" }+ O5 D8 \3 J" o( T    esac" H( ]: M1 V3 c9 \( H
& H: s( }, p7 D" f- c
    [ "$has_custom" = "YES" ] && ulib="$ulib $cwd/libCustom$suffix"
1 b5 q: M! \: b1 C    [ "$cmdname" != "timemill" ] && [ "$cmdname" != "powrmill" ] \
' Z1 K! k8 r& X8 Z        && [ "$cmdname" != "nanosim" ] \
- ?6 A  E1 O8 J5 u( ^        && [ "$has_model" = "YES" ]  && ulib="$ulib $cwd/libModel$suffix"
# H. B: y; R! l+ j: t0 n    [ "$_VA_" = "YES" ] && ulib="$ulib $cwd/libva$suffix"
* [7 R* T. O9 t  v$ Z. }2 `1 d/ _1 ?3 A) |: s, p4 u8 |6 k
#Look for command line option for libFuncModel.so
0 Z# [% h2 k3 F2 }$ T# A0 b#    user_library_next=0. G# G" \: g$ c5 d8 `2 R$ p/ ?
    has_fmlib=""% J% ~. }" n0 ?6 v6 F
    for opt in $CMDLINE
# G) V7 i" i0 M  f& \# h# e$ l    do
& z0 G. X* s/ Z2 z: `5 J$ P      case "$opt" in
3 y6 P0 K, R! @; D3 {        -fm)' T1 ^! a& t1 x, _5 Z
            CMDLINE="$CMDLINE $cwd/libModel$suffix"
3 j- j) b# s( y6 U  L7 d            ;;! S; b% ~$ L3 k
        -fm_user_lib)5 H/ J1 E) \4 A" m
            has_fmlib="YES"
" z  k) @( I$ Z% M5 q#            user_library_next=1
' O! Y/ M3 |# X# K2 m! q            ;;, s% m/ b( `; q# M3 C( ~' V
        -xc) 3 f9 S1 L5 J0 n7 C/ T: I  q
            if [ "$EXTRA_CAPACITY" = "NO" ]; then
0 \. D" ^1 A8 ~" R            EXTRA_CAPACITY=YES
$ c, V2 U( g/ ~$ v- L            fi
0 c% V/ k7 b  M! q( O            ;;
( s( t) G6 x6 E: D#        *), R  J2 q% p) y3 F0 f8 N: Q7 A
#            if [ $user_library_next -eq 1 ]; then( ~7 J( d: q. x/ m. w
#                if [ -f "$opt" ]; then8 K7 r4 o/ Y8 n: ~8 x
#                    libfmodel=$opt
2 B' K5 q. o$ m) O# H: ]0 T( a#                else
0 p0 g: I3 s6 S! ^#                    echo "-fm_user_lib: Specified file not found"( v2 S( w  ?" ?0 B& @) r
#                    echo "-fm_user_lib: Specified file not found" >> .epicscriptmessages
( Q; f, n- H6 {$ N- D#                fi
7 p* }8 o0 L4 W4 ^0 w# O) M  C#                user_library_next=0
+ M. s, {% y- ?0 E0 ]7 u#            fi
- d/ a) v5 `0 {2 C#            ;;! P8 u4 u- e- Q" |
        esac
. T" j; y' Q# O    done
" }7 o, E: J9 y. _9 |
  w+ [- I' M3 T- b    if [ $cmdname = "timemill" -o $cmdname = "powrmill" -o $cmdname = "nanosim" ]; then8 }. h" C" z3 f1 o' s, v' `
        flib=""- S; T/ \. K. C8 C) y
        if [ "$has_fmlib" = "" ]; then& v# M( ]' }2 r1 i( Q5 a
            flib="$flib `get_epicrc ./.epicrc user_libraries`"4 c, k1 y7 I0 y2 _" x- F. c
            flib="$flib `get_epicrc $HOME/.epicrc user_libraries`") f0 z% I, c+ W$ n; M  O- |
            flib="$flib `get_epicrc $EPIC_DIR/.epicrc user_libraries`"3 S+ ]& U4 v- ?! y7 T4 P; u
        fi
- m! t2 P. n  r, ~    fi
# R0 }1 Q( m" U0 m
# B; M' H" U1 ^9 ?/ r, O   for i in $ulib
% C7 l6 Q' g- a% G   do, B! m* w/ D9 P5 u8 b9 j
       [ ! -f "$i" ] && continue
; @% V" B9 {5 r# L1 h! \! f# f       dir=`dirname $i`; cd $dir; dir=`pwd`; cd $cwd
$ n& p9 E7 j( [- w0 [) \. D0 G& L       i="$dir/`basename $i`"+ C; p, A. v- F3 i
       case "$i" in- K! q5 z. [& @: H
       *libCustom$suffix*)    [ "$libcustom" = "" ] && libcustom=$i;;
# S& Y5 V4 C9 R% U+ u* b2 O5 V       *libFuncModel$suffix*) [ "$libfmodel" = "" ] && libfmodel=$i;;1 X8 ^( o) y/ a. `
       *libModel$suffix*)     [ "$libmodel"  = "" ] && libmodel=$i;;
9 f8 i! q  E! `' r# q6 h% V) V8 l       *libva$suffix)         [ "$libva"     = "" ] && libva=$i;;6 F2 W/ W$ N1 _& u! g
       esac
9 [: C  E' f( i1 y1 I       [ "$libcustom" != "" -a "$libfmodel" != "" -a "$libmodel" != "" ] \
0 J" q+ d+ \( n1 j& M: Q7 C; x        && break
- J# e+ D* Y! T6 u" L* P/ O7 B   done
+ \/ P/ U$ |2 D2 c' n4 I' }" X1 d  |
   # symbolic link shared libraries to .epicrun$$
' P" v: v  z* t- N' |" U$ X  x1 \    cd $EPIC_DIR; epicdir=`pwd`; cd $cwd; X$ `$ n( F0 R
    if [ $cmdname != "timemill" -a $cmdname != "powrmill" -a $cmdname != "nanosim" ]; then/ w% O8 d( ~( E( M
        if [ "$libfmodel" != "" ]; then
5 ^3 F  \/ u2 W5 o8 `) k  z* `             [ "$libfmodel" != "$epicdir/libFuncModel$suffix" ] && \
2 @2 E* D2 h. c/ n3 o             echo "Using $libfmodel ..."  && \/ G; R* x6 ]" ^% m# P
             echo "Using $libfmodel ..." >>  $EPIC_SCRIPT_MESSAGES_FILE3 I3 P! y5 \- s; i* L% f
             if [ -f $rundir/libFuncModel$suffix ]; then
- B' |) y; n1 ^               rm $rundir/libFuncModel$suffix7 L% M& X" I( _# A: J
             fi
( f& [3 J5 \& J$ l, @+ U- t' `             $ln_default $libfmodel $rundir
( H2 j) }* k* Y; ^, M( s, C' |        fi9 Q0 H8 P6 d2 }! z1 I, j
        if [ "$libmodel" != "" ]; then
: K; O2 Y& C; Z) Q' g             [ "$libmodel" != "$epicdir/libModel$suffix" ] && \$ r: ^1 o. {; x, `
             echo "Using $libmodel ..." && \4 B+ j( ~9 a) v
             echo "Using $libmodel ..." >>  $EPIC_SCRIPT_MESSAGES_FILE- F: K7 N" `& a0 X; O, Q8 l
             if [ -f $rundir/libModel$suffix ]; then7 ^- ^. |) k  @5 F2 L
               rm $rundir/libModel$suffix$ {/ D0 [9 J: B7 i& S
             fi
3 H: t- G. {& `. t; ], b             $ln_default $libmodel $rundir / q1 e/ z: U1 Q. [2 f
        fi7 a+ r0 m, N7 ^! i) d5 g* W
   fi
" B6 T8 |0 S; i8 b" {" _. h' X   if [ "$libcustom" != "" ]; then( t4 O6 |6 R! b6 l# V* r  R
        [ "$libcustom" != "$epicdir/libCustom$suffix" ] && \/ b( Z4 X2 k8 V
        echo "Using $libcustom ..."5 ]. D# }; I5 O4 r
        if [ -f $rundir/libCustom$suffix ]; then! A0 R& \* ?, p( S5 x2 E+ V5 w# F
          rm $rundir/libCustom$suffix
0 c" C7 ^% y# c4 J+ ~. v- F        fi: a' y1 w, c) O- W' K% u
        $ln_default $libcustom $rundir
) }: I- A: h/ y1 b9 r   fi- p# N" E" A# b: z
% ~% w- H1 e: P1 r& {
   if [ "$flib" != "" -a "$flib" != "   " ]; then2 P! P* K2 g  ], D: q
        CMDLINE="$CMDLINE -fm_user_lib $flib"; v2 n2 C* V# i& N( I
   fi# F. z+ J3 |1 m2 V3 g1 }
* b- Q: E) ^9 b7 {) j4 ~: W
   if [ "$libva" != "" ]; then- M3 R9 I8 N6 L0 Y
        if [ -f $rundir/libva$suffix ]; then
: |7 V! b1 |) x% P3 [. x- ^4 p          rm $rundir/libva$suffix  X0 O3 X( B/ v% B% a+ E3 r7 w
        fi! B; ~! z! a5 X% `2 o
        $ln_default $libva $rundir 7 @* }% R5 q0 t  z0 Q
   fi0 t- a) E0 n8 H) }& p4 n
( n+ `9 o( a/ M
( P1 ^2 _' E$ Q; J; W$ _
    # VCORE design library3 n" J: h$ b  l/ u, C, I
    if [ "$vlog_design" != "" ]; then. N+ ?2 E6 B' |) i3 @
        $ln_default $cwd/$vlog_design $rundir/`basename $vlog_design`) K8 F& r3 p9 ]  T9 e
    fi
) _4 Q) h. P# f! z
) L% Y2 g# m6 V    if [ "$EPIC_EXTRA_CAPACITY" = "1" ]; then3 _# v- `! e& l% ?4 i4 f% d( a
        EXTRA_CAPACITY=YES
% V: M) g" z( X/ v! @4 x. t    fi
5 ]2 N0 H$ D& _; u& L! H# S6 Y! `2 j* l( O$ C/ _
    [ "$EXTRA_CAPACITY" = "YES" -a "$USE_ACE" = "YES" -a "$DB_REAL" = "0" -a -x "${command}_xc" ] && command=$command"_xc", y, h, j- [1 w* |% \6 W
    [ "$EXTRA_CAPACITY" = "YES" -a "$USE_ACE" = "YES" -a "$DB_REAL" = "1" -a -x "${command}_a_xc" ] && command=$command"_a_xc"
9 g7 v0 m' c: W/ M, s- F. ~' v    #Create temp file if dual process is on
; P. Q; i6 }: U& B7 U" I    if [ "$EPIC_ARCH" = "SUN4_SUNOS_5" ]; then, d2 E9 [1 c8 Y1 ], {% S9 Y4 N
        if [ "$EXTRA_CAPACITY" = "YES" ]; then
" w1 P/ R5 A1 ?; G( ~# O$ h            touch $rundir/rpcidfile
# g4 i7 E; y+ b% [3 R        fi
3 C+ O, d, u0 y    fi
$ S* V( Y% n) dfi
3 m2 X, K) G* m# a3 S
( C0 t+ r+ }- R4 g, nrun_cmd()
, g3 A# @! I& }3 S5 b6 }( Q{
& u( q3 F7 i. n! C1 ^! ]  command=$1
) |: {5 n, x4 x4 n  L; v  shift5 u) I, q1 m( _* G, A8 R. ^7 ^) r
+ e8 k# c0 F0 h! t. S' n
  if [ x"$VA_FILE" != x"" ] ; then: u5 [& U2 }& e- t  [7 {5 O. d
     cmdline=$ARGV$ ]# B+ Q- X8 ]8 w- v
  else
8 h" S1 |: U- H0 J; ?6 r2 A( j     cmdline=$@1 T5 X/ E' k2 u1 K3 Q; ^5 `. X0 [
  fi
: ^0 t* O1 ]4 x5 M$ K! Q9 `3 K/ Y! }% P. k% x2 C$ E" f
  debug=${DEBUGGER:+"$DEBUGGER $command"};+ L% Q* j' D/ l, }8 A9 C

5 X3 o$ T. P# ~/ [) P8 i9 {) ]  # To disable Exec-shield-randomize in RHEL3 U3+ when running nanosim and nanosim_a
: g; R+ k( Q9 ~/ l/ Q  # so save-restore may work.
4 S0 C; `) ?2 G7 W' A/ h  setarchStr=: y/ K5 k2 u( }0 n
  cmd2run=`basename $command`* r" n3 `3 K7 v. l8 k
  if [ ${cmd2run} = 'nanosim' -o ${cmd2run} = 'nanosim_a' -o ${cmd2run} = 'powrmill' -o ${cmd2run} = 'timemill' ]; then3 c' Z" r1 @5 E! V; Y- Q
    if [ "$EPIC_ARCH" = "IBMPC_LINUX_LINUX" ]; then
& \7 g6 X) Y% \- P$ J/ q( V, U      setarchStr="setarch i386 -R "
! N4 C2 r" b8 f' ~) Y3 r$ w6 J, q    fi4 E" F: N) m/ v" E: z
    if [ "$EPIC_ARCH" = "linux" ]; then- [; c" f- M% }2 y7 Y. v
      setarchStr="setarch i386 -R "1 u( Y  b/ L" a3 ?/ b0 N
    fi8 D; }. G; W; n' {8 h( E
    if [ "$EPIC_ARCH" = "amd64" ]; then+ W0 Z4 {% G4 {* Q3 X0 Y" I  F
      setarchStr="setarch i686 -R ", v8 n" \2 F8 K" G
    fi3 D6 l1 f) P% z& c, H$ z
    if [ "$EPIC_ARCH" = "suse32" ]; then; U4 B( @, u6 ]' f3 V
      setarchStr="setarch_suse i386 -R "/ {+ ?0 `% ^$ t6 g: F5 p! M
    fi) l0 v  L/ Q; j6 w$ {  M8 c
    if [ "$EPIC_ARCH" = "suse64" ]; then
3 C. @2 k- {  n, A) _' A      setarchStr="setarch_suse i686 -R "4 N" e. i2 }' S, y/ w
    fi
' [  w8 b) ?) t0 u& `  fi
, Y8 n% n0 @  u/ |8 y! u4 |1 u% A6 k* q& p" |* W/ q% _% ~
  ret_stat=0( k  v" `$ W  Q
  if [ -x "$command" ]; then, x0 O2 O6 f  }, d" k. @
      if [ "$debug" ]; then* C4 o. D  B( G8 S7 o$ U& o
        _debug_args_=$cmdline
  X6 C! Q+ I  C/ y: m        . .epic-debug. w1 m1 C, |' Y$ b& X
      else
9 \6 f8 L/ D5 W        DEBUGGER=; export DEBUGGER
* |6 d; `% O& @- i+ Y        $setarchStr $command $cmdline
- ]( E2 @% d: G      fi0 Q( L6 F0 J& L# ~2 m; Z, l
      ret_stat=$?8 k8 _) |8 E# J+ O' H
  else
' i4 D5 V$ B! d: g( c    echo "Corrupt installation, executable \"$1\" not found!"
  t; i/ n& g5 |5 R    ret_stat=1
2 p5 L% {& {3 F, L' c  fi
- ]5 s1 D( I- Y: y; [}
) Q+ W* g* t1 {: |. W5 V# K6 @1 j7 Z# R& t" X7 r2 m* Q
# keep runing cmd if ctrl file exist& W% R1 t* V: u2 R  S; L6 z

! j5 W, x4 w1 F! H2 ]& s0 hrun_loop(). x5 N  B/ v1 F5 X
{
$ d8 e4 W  ~, N7 }  command=$19 `0 z* d* v6 s! n: |) }
  shift5 w" V8 x1 ]- g& b9 N8 z6 j
+ M% x% G% `, s6 N5 V. r! ]
  if [ x"$VA_FILE" != x"" ] ; then* R* [! P" n1 Q- W7 G0 N
     cmdline=$ARGV
9 P1 K* [/ [4 w/ w" I# V  else
/ v$ E2 ^, {% g  U     cmdline=$@- P* i( \9 G+ Z6 l: W; ^- e1 L
  fi
; G: A, b4 y: E9 I# r9 E3 s3 H  M
  while [ $ret_stat -eq 0 -a -r $LOOP_CTRL_FILE$$ ]; do
) @8 O( K! A$ u  e% I    . $LOOP_CTRL_FILE$$2 U3 ^4 ~9 b" L( U1 ]( m
    run_cmd $command $cmdline -banner 2. _1 ]! f, o  G, L! X& I: L
  done;
3 S) c" p$ P& h
! g4 s. G5 L& d  if [ $ret_stat -ne 0 -a -r $LOOP_CTRL_FILE$$ ]; then
- Y% B1 g! _3 `! u, ?    rm -f $LOOP_CTRL_FILE$$$ @- O  E- e) \+ L7 z3 A
  fi
+ I% K9 d) j. a" R8 ], c4 ]}
$ w; k+ z" N; {$ K  }
3 g  Z# G* z/ m# }har_check_ret_stat()/ N: ^1 a0 s1 T: b5 a
{
* _' n* g0 w9 n1 A/ J  if [ $ret_stat -ne 0 ]; then , U8 l/ S% m, z% [) Z- h
    echo "Simulator returned with non-zero exit status. Stopping."
2 s0 @! a! s) Y8 D    exit 1
, Q: e- t* ]# e  fi
& O2 _9 w- j/ X, L, t/ N}
0 l4 b7 ~0 x& F7 i' y  C
; q4 C3 A4 C( W8 K( Z% |; R#. s6 I6 A. f4 J) [, {
# set stacksize and datasize limit1 S; t4 q* s9 ]% A0 y% z3 J2 v0 u
#6 h; J# w$ U! ^$ K* z) D1 u
  f; x& Y' p' o' y  h
set_data_limit+ ]. p, h  W; E5 y& e0 N
set_stack_limit
9 k( s3 r& G* {% j9 W8 W6 I! R
9 l/ a& l& G2 w#rm -f $LOOP_CTRL_FILE3 e! L( s- C# R
5 [1 C: x0 K3 g/ T( Y4 S9 _4 A
run_main()7 o( C7 M0 N( E+ d1 b( l( f
{
( \( {4 _) c) A) d( m" A' ]& K3 bif [ $is_special_har_run -eq 1 ]; then8 B* u* w9 _" y6 k9 H$ F$ b# A" q3 @
  if [ "$har_ofile_prefix" = "" ]; then
/ N% Z5 B6 R$ Z: J    echo "Wrapper bug. Notify Synopsys technical support."
$ s" {# D, U, m    exit 1, ]3 l/ }) S* B2 K4 h) f
  fi; q( p" f" K$ }% `7 u7 j3 B$ g
  if [ "$har_hilo_file" = "" ]; then
8 I3 u4 {# I2 m    # no user specified hi lo file - do both runs
9 {  u/ g" X& `+ A# V; c9 r2 c    run_cmd $command $CMDLINE -har_one -har_setup8 d: s7 n5 j, a# C1 D  b
    if [ $ret_stat -ne 126 ]; then
5 G# \$ ~6 o0 v+ G      har_check_ret_stat
+ w5 _+ K% j. T9 n& h  R      if [ -r $LOOP_CTRL_FILE$$ ]; then
8 P1 w- U1 h9 }( Z        run_loop $command $CMDLINE -har_one -har_sim ${har_ofile_prefix}.hl
* M+ y) X9 u9 b- z; M        rm -f ${har_ofile_prefix}.hl
" A9 [* p' C9 g- c3 s      else
. b3 `; G$ k, w5 x        run_cmd $command $CMDLINE -har_one -har_rmhilo -har_sim ${har_ofile_prefix}.hl
( V& O  P3 z( M& T. z; o, u: m      fi4 n* }% C; E  n5 F% Y3 t# [
    else# S# l2 h# }  m+ i6 Y* A
      ret_stat=0# H! G) ?( f! P* ^0 ^
    fi# q6 S3 i+ W2 S6 |7 C8 Q! ^
  else1 n5 r# t* {' z4 j* P2 A4 u3 E: n/ _
    # user gave a hi lo file name
. J2 L8 Q; g9 K6 I' _    if [ -f $har_hilo_file -a -s $har_hilo_file ]; then; o0 b4 o# U$ n( c+ `8 H: Z) W
      # file exists - use it - only do sim run
7 S5 R! C* Z, [      run_cmd $command $CMDLINE -har_one -har_ff -har_sim ${har_hilo_file}
0 f  ]) [' |( q& L/ G. y9 P      run_loop $command $CMDLINE -har_one -har_ff -har_sim ${har_hilo_file}
- S! y# V! j4 {: ~3 V! [% Z    else
# K) i0 P* c& A- k& J' y4 _" ~      # no such file - generate it - do both runs2 [, O3 x* t$ h  {7 g5 E7 i
      run_cmd $command $CMDLINE -har_one -har_fnf -har_setup. F0 Q" k# d# m4 m
      if [ $ret_stat -ne 126 ]; then
* W; L/ _8 a* i# j( v$ i& T        har_check_ret_stat
+ k6 o. ^# Q  k- w        if [ ! -f ${har_ofile_prefix}.hl ]; then$ ^) ^+ ~- i. a2 D0 {! a0 p: o
          echo "No hi lo file generated after setup phase. "# @8 ]2 X+ D2 E* p9 ]
          echo "Contact Synopsys technical support."" M* Q& ~- g5 e- t
          exit 1
$ ?- n$ a, Y/ \! T        else1 `/ ]: _3 U/ @) ~. r* f8 z) s
          if [ ${har_ofile_prefix}.hl != $har_hilo_file ]; then
: x0 Y: X7 Z- \            mv ${har_ofile_prefix}.hl $har_hilo_file
  |5 [6 B. L. z) u7 A5 W' h          fi$ [/ G4 W( k/ O2 R- O
        fi  R* B' k3 ?3 n0 n+ d1 P+ y7 f
        if [ -r $LOOP_CTRL_FILE$$ ]; then/ T- }7 M9 [1 `+ y9 f) x2 {/ K3 i% q
          run_loop $command $CMDLINE -har_one -har_sim $har_hilo_file
; ~5 k( L9 U; C! j/ D        else
7 m' V. u+ z' l) e  I0 E* G          run_cmd $command $CMDLINE -har_one -har_sim $har_hilo_file
. @) I" Q) b7 J. ?8 Q9 j        fi
9 m0 c$ k( ~( F% m% S. I, s; ?6 B      else
3 ?; i& s  x& l* m& @. V2 M        ret_stat=0
; Z( S1 b& a- t& V% q      fi0 ?5 c( z; J5 W) f: C) N; V8 j# w
    fi
0 h6 ?( Q5 q8 `1 G  fi
" _/ `, a8 X' ~1 V4 {else  . K+ h1 A0 e' k5 W, z
# don't loop if -har_setup0 R3 F# C/ T7 f) X6 a, O1 ?
  if [ $have_har_setup_flag -eq 1 ]; then
. m& c5 T+ N$ R+ B% X" t    run_cmd $command $CMDLINE
6 A: j, `) f( g" s/ {8 G0 }$ y    if [ -r $LOOP_CTRL_FILE$$ ]; then* L' K; E' |! n1 ]/ S5 r
      rm -f $LOOP_CTRL_FILE$$3 c: F; k! u& t3 [" @
    fi9 B2 h- ~6 _) ]; J5 d
  else+ d$ X5 Y4 w: [+ }( r! |# _9 x3 m
    run_cmd $command $CMDLINE
5 F0 x* _4 U/ n! b* n. O5 x    run_loop $command $CMDLINE3 X/ C, F6 c/ k
  fi" Y( V3 [3 E4 x% f% E
fi
1 x! A: ^% B2 z% p! G7 L5 r
9 f% O# m' S  g" j4 G2 Q% Sif [ $ret_stat -eq 0 -a $cmdname = "powrmill" -a $postgres = "y" -a ! -z "$workDir" ]; then
- X) R) W: K8 n  Q  pwCreateErrDB -w $workDir -e $errFile
0 p: o; E! F; d; \' R* U  ret_stat=$?
: M) t6 S4 O4 N9 t, Z  hfi/ d4 q, i$ t& A; W# E" n$ I
}
9 o" k% n/ ]& [9 w  b0 D- U$ e: H# z" |" _, m! O8 |- w6 `0 Q, ]
cleanup_alter(). x6 [' m% ~. x7 @  t) Z1 |
{) v" g  p2 |+ S7 G4 i
   /bin/rm -f $ALTER_COUNT_FILE 1>&2" F9 }! e- T  Z9 |( w( p5 u- _- _5 B* L
   /bin/rm -f $ALTER_HK_FILE 1>&2" O0 y+ B2 ~+ ^! n% F0 T# X' Y8 {
}
2 a7 S) \6 D# m/ I: G/ H* W  N
1 x0 R9 o& J$ ]/ `- C  N+ z$ p#generate alter temp files based on pid
8 ], f& t, @/ @" U# J# EALTER_COUNT_FILE="$ALTER_COUNT_FILE"$$; [3 i$ y8 C; ?( X, z* \% P% Q9 f
if [ -f $ALTER_COUNT_FILE ]
& E& @+ s" p6 ]( P: Dthen ' [/ g1 x5 e4 ]7 ^4 ^  S
  until [ ! -f $ALTER_COUNT_FILE ]
/ P5 C$ I8 @5 H$ F  do
& l. y! T+ Y& G    ALTER_COUNT_FILE="$ALTER_COUNT_FILE"$$9 b& D; H) v/ U" q
  done7 _, a$ V$ q0 _* L3 U) l9 }) w* i# F7 g
fi
& L8 t% K0 R0 n) i6 o7 qexport ALTER_COUNT_FILE
% F& D8 Z6 E/ N" e. z" T# O6 S: e* }) b# ?
ALTER_HK_FILE="$ALTER_HK_FILE"$$
. p0 q% p  B, R% S- n5 Mif [ -f $ALTER_HK_FILE ]
! Y6 J) e& d/ Y; \% u& Y! Hthen / G! U, {6 L; x8 u+ ^4 t) @
  until [ ! -f $ALTER_HK_FILE ]
7 N* p5 k+ I( ]7 g; u+ T/ E  do
1 V6 k1 |/ p6 f7 y# g7 Q& W! o2 q    ALTER_HK_FILE="$ALTER_HK_FILE"$$  j- k( \" g9 K$ F8 R6 U
  done
2 e) m$ V/ _# Wfi
! G* b+ O9 Q1 W6 X) F( |. N3 I5 ~export ALTER_HK_FILE
9 B% d" x8 i9 o+ A6 F' {
) @3 q7 A5 I0 @( b7 R3 S( g#generate monte carlo related temp files based on pid( D# T( u9 Q- ?7 J# |/ V) y
cleanup_monte()- Y5 V$ J. Q; r; ]$ [
{/ Y4 N; @6 Q& ^4 X) z4 W. u
   /bin/rm -f $MONTE_IMG_FILE 1>&2
6 c( J) _2 |8 i   /bin/rm -f $MONTE_IMG_FILE.gz 1>&2
1 X+ L' t3 s, f0 t4 Q3 Q   /bin/rm -f $MONTE_COUNT_FILE 1>&2
3 {7 e& v8 w' |   /bin/rm -f $MONTE_CFG_FILE 1>&2, J5 D4 [& c: d3 b: a: o* v5 W3 t
}
& h. d4 s, T, h# l; Q/ S" D6 ^$ m& y/ C/ I7 D
MONTE_COUNT_FILE="$MONTE_COUNT_FILE"$$
# w% ^0 ]" C( e' F. zif [ -f $MONTE_COUNT_FILE ]: ]3 T# `0 o& e7 B# i( u+ \
then
( ~- R8 f1 v3 y$ {4 E  until [ ! -f $MONTE_COUNT_FILE ]& W  H" S5 L( M4 z4 {
  do$ V  o& j5 Q3 H8 l1 C
    MONTE_COUNT_FILE="$MONTE_COUNT_FILE"$$
. W, R# h8 u7 g  done. _6 J8 ^1 r5 ?1 O* o4 M  c2 d: _
fi9 x+ F) g+ D9 k* ?$ y
export MONTE_COUNT_FILE. \3 {3 k' j" ?9 q% T% G. ~, ]

) W" Q5 R' \7 O9 y- D0 nMONTE_IMG_FILE="$MONTE_IMG_FILE"$$
5 L- r2 X' Z  \2 E* cif [ -f $MONTE_IMG_FILE ]) ]1 ~0 i& O* Y5 \
then- S$ N# j. Q/ G1 E4 |9 m
  until [ ! -f $MONTE_IMG_FILE ]1 U9 N5 @) r( K: d
  do
& C( b" v/ H  w3 s( j8 R1 h3 m: f    MONTE_IMG_FILE="$MONTE_IMG_FILE"$$5 u  b0 |; d# E+ W
  done
) W5 d1 s+ C  v' z" nfi, B: K: z. h% q- u. b, w" c9 d9 B+ N
export MONTE_IMG_FILE
" h  o3 c& I" c5 d* f( t6 P" ^2 c) e
MONTE_CFG_FILE="$MONTE_CFG_FILE"$$
/ U0 R- _% x  }" J2 Bif [ -f $MONTE_CFG_FILE ]& w+ G4 s3 r# N9 n7 k+ m' H
then0 y  ~* e! Q8 A* e) s
  until [ ! -f $MONTE_CFG_FILE ]' }& ?/ w+ r4 e4 c$ U
  do# d, E4 t  v3 O
    MONTE_CFG_FILE="$MONTE_CFG_FILE"$$& R# a  `7 p0 j
  done) V8 B  X3 @# A* V! U
fi
- W( G- G+ H5 H$ v  W$ Y$ }& d7 t9 u0 ?9 h5 k4 u1 R6 F
# main iteration2 e) j' ^$ w# c& T2 v  J1 S$ f
run_main
3 t4 t/ J" N+ z6 s  ?8 X/ H, f
6 y6 ]. Y4 Z% l  N7 Zif [ $ret_stat -ne 0 ]
. t; X* K- m) pthen : k5 ^2 |" i. e0 x5 T
  cleanup_alter
! Q. k& ]* L. N9 ]# A) Q6 ]% G  n  cleanup_monte: G+ b% w/ ]4 h# @, G# n. G
  Exit $ret_stat" `7 d% ]: Q, i, f- `0 C$ e
fi, ?! Q1 R- M* L. z; }0 i1 x! f  [

3 J+ X$ @9 A$ O4 |" n- Z" n& C8 v#Alter related iterations5 q! r9 W7 R2 z
$ [, i1 A$ B* Y
iterations=0
$ a' D8 L; a6 Q9 C8 E3 Wcount=0- X: q) p. |4 N3 ]# C& {
if test -s "$ALTER_COUNT_FILE"6 {, I* L. g: {* y6 q$ y
then2 X; T4 d& Q5 r+ u! {0 z+ n. I  S$ N
  if [ -r $ALTER_COUNT_FILE ]; then" E" U( A  v4 L, Q) ^8 \$ W
   exec 7< $ALTER_COUNT_FILE
1 E9 t9 m5 H2 e& ~4 r" S; ]9 S   read iterations <&7
. a: M8 v# d& V& u% N* T4 b2 _ fi
" J* [/ v4 |6 w9 F7 z" i8 l5 Cfi0 i$ o# x. u* o, ?3 r: v
) g. y% K( ]% c
trap 'echo Program Interrupt; cleanup_alter; exit 1'  2' p2 `) }. P5 V2 C5 u
while [ $count -lt $iterations ]
5 i; j$ F: y; p$ j) _* Q8 A9 Xdo
4 ]: _! j9 ?/ {8 q/ B2 V! p) V count=`expr $count + 1`
' Z" J! e0 h) |9 F% e' P4 o ALTER_COUNT=$count" |+ s6 b; B; n* l( r9 u
export ALTER_COUNT/ a8 V0 I4 ]' t8 H. f' ?+ D

9 D) H. f7 L( Q4 R6 Y run_main3 k) b8 X2 y! _
) o, ^: E7 J- j8 ~6 P8 N) `
done
  V3 S# a3 f# g0 i9 F% L0 ]$ f& Y( S7 T& K) Y2 s# [) Q
#Monte carlo related iterations
. G% E& v6 }, G/ H4 i$ @* I$ n$ H, i- I* Y* ?. G2 [
monte_runtime_summary()
9 Q: V* `5 \$ j* E8 l{
+ D- E! n5 R: U& _6 d  keyword_1=real
5 L9 o: j( t2 d4 {5 _  keyword_2=user
% u- L0 Y- ?! g  keyword_3=sys
) p) m9 Y3 U5 ^6 z  ofile_prefix=nanosim% W2 p0 @2 L" _2 D8 E% g7 _

, {; ?% G: t* D  if [ ! -z "$o_option" ]; then4 m$ B" K$ V8 n; `$ y, t; B
    logfile=${o_option}.log* u! M* c8 y( g: Z
  else
% z& t2 @5 Y9 e: Y+ x    logfile=${ofile_prefix}.log( b% r% w  Q) R* {1 `! l
  fi
! P' o+ D4 E$ ~
2 G" Q3 H0 Y% @) K7 {  if [ -f $logfile ]; then7 W. J/ f0 ?1 y6 ?, F7 r8 m
    echo "*** Monte Carlo Total Run Time Summary ***" >> $logfile      
* H: k2 g' e, D' Q4 w+ O7 x    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" g- Q6 j' r& ?' J- x
  fi  Q1 G. Y8 Q" k0 [
}
- o4 i- ]: Q4 x0 H3 t8 h5 }. _0 |, e# e3 q. i, v
next_monte=0. u. `; B6 O; K& v$ c+ h; P
cur_monte=0
8 T. Q& z0 L8 s0 }: f/ A9 z7 G( m" T! v$ d) {7 R+ `- d
if test -s "$MONTE_COUNT_FILE"
- O. `3 t  [5 Q3 N% C% z& zthen* y; v6 `3 i! g- t5 {
  if [ -r $MONTE_COUNT_FILE ]; then
9 `- W' B' h  t6 _/ \% y* C1 G& X   exec 8< $MONTE_COUNT_FILE& c7 g+ A5 {" ~- z" Y$ j. L6 f
   read next_monte <&8/ ^7 h; S8 D' E5 ]6 `0 R
  fi9 C$ [- P" M- ]0 `5 O8 d2 M
fi
6 @+ G, @0 |( [9 W8 k( ^  h0 v
' A' g* S$ h( b4 E+ Ptrap 'echo Program Interrupt; cleanup_monte; exit 1'  2
4 D& T: o1 \! v. mwhile [ $next_monte -gt 0 -a $next_monte != $cur_monte ]
$ h1 x. }6 l) F2 B5 Gdo& x# \# ?# T' r8 q9 c6 J
  NS_CURRENT_MONTE_COUNT=$next_monte
0 w) \% }+ Q2 G% ]- x  export NS_CURRENT_MONTE_COUNT
( {; }; g' v- `2 {5 c" j; J0 h
$ `& j7 S& S2 x& g  echo "restore_ckt_state save_file=$MONTE_IMG_FILE" > $MONTE_CFG_FILE  W3 r3 X2 \1 W( P( x% A' C
  CMDLINE="$CMDLINE -c $MONTE_CFG_FILE"
, m$ C/ E; z) G! v! f' I3 {  run_main
! L. }+ o8 H% h& m  l$ E  U
# t3 H# b. ]5 c. `5 I  cur_monte=$next_monte3 ?6 ]. P% {! Z  i
  exec 8< $MONTE_COUNT_FILE
4 O$ L& e6 i5 g4 d2 m9 a$ _, W. h/ K$ v  read next_monte <&8
. D, [% P: H6 Y7 E' H4 r' adone) T; D  G1 |, f" `
! D. e' u, I: ]+ o( u7 n' q
if [ -f $MONTE_COUNT_FILE ]
4 O5 s; C& M0 d5 p+ Qthen
% z( R. W6 D) _) [! y- L9 P) t2 l  monte_runtime_summary* j2 g1 E% {7 t' e+ s7 j) }7 t- H- [7 }
fi* C- G& }! H. ^
+ B  I. c. A! ?$ z* R3 X
cleanup_alter, @( ?1 V. x6 ~. t" D4 W+ y
cleanup_monte
4 I7 Q7 g* n. r5 {$ W( T. d) f
1 P0 K3 x5 `$ @/ _4 GExit $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-11-16 11:56 PM , Processed in 0.200011 second(s), 15 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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