Chip123 科技應用創新平台

 找回密碼
 申請會員

QQ登錄

只需一步,快速開始

Login

用FB帳號登入

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

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

[複製鏈接]
跳轉到指定樓層
1#
發表於 2012-5-6 13:58:13 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
10Chipcoin
各位大大好:
. s8 J# D' k/ W4 x& W/ A                      小弟執行nanosim時,卻無法跑出視窗來,有個錯誤可是我不清楚該如何解決?問題如下
# L5 A6 O: {1 V8 |" @: d# d                      [: 113: 64: unexpected operator
4 w/ l4 o, M/ T7 G& j! h/opt/EDA/nanosim/cur/linux/ns/bin//scripts/nanosim: 1: Syntax error: Unterminated quoted string
9 I6 \* D6 c' B8 u! p' J有大大遇過這方面的問題或是指導我方向去解決, 謝謝. 8 A" n7 o& B0 _2 q1 G3 T$ }. E
我在猜可能是這個檔案內的文字需要修改 但不知道該如何修改?. S  A. x% c: j
以下為/opt/EDA/nanosim/cur/linux/ns/bin//scripts/nanosim 的檔案內容:) `% X6 ^$ Q" F  M. c
    #!/bin/sh/ D! L  F# v; s2 q0 g$ L& c/ x
#
1 o# c6 C2 i* `! t2 l2 Z# Copyright (C) 2001 Synopsys INC
) _, C1 @3 i8 i* P# EPIC Dynamic Simulation Wrapper (DSW)
  ]7 r1 z- S) G: E# X2 t& ]+ }$ H#
7 R% Q8 e0 X- I) B5 U$ Z+ Heval ${DBG_EPIC_WRAPPER:+"set -x"}
% o+ x) {! R3 j; t" y2 e+ W
! S# i# N: n8 c9 `3 q7 K4 Wif [ "$EPIC_WRAPPER_DVLP" = "" ]; then
: Y( |2 C& @8 L% h; d8 \    TEMP_ARCH="$SES_ARCH"
0 u0 z, q8 W6 b0 s! Ielse& d1 J) O: q6 C# _, B2 R. A0 X* x
    TEMP_ARCH="$EPIC_ARCH"
: k3 y7 C1 @6 }2 o" f" U. K( Afi
5 x) N( C4 g" d) ~" k8 q0 f5 r1 {- J- R) U8 e0 @
scan_for_hva_args()8 c# x" [+ o; F, r- e
{
/ i$ {4 V0 ]$ G  /bin/rm -f hva.init 1>&2; A9 _8 Y5 {7 H% K7 n
  while [ $# -gt 0 ]; do
- M+ G$ |3 x/ @) O( |3 B2 @" m    case "$1" in
  V0 P/ j' [$ A1 N9 _1 w      -vaf)* h" g/ a: P+ u  y$ R2 E* o- f
           have_vaf_flag=11 j# r- K+ N' Q2 L7 f
           have_va_flag=01 V2 a. |9 B9 R4 r" _7 i* T
           shift;
. k  M+ v: v. c7 m           continue;
% h8 S/ e6 n/ H  N6 f9 K* b        ;;! p1 |" q. b, |6 F' b
      -va)4 _! [- C3 I$ v0 |
           have_va_flag=1
" z3 k4 v3 r0 Q           have_vaf_flag=0: C9 E/ U" g, [1 N
           shift;
9 Q! v4 `% o4 a& V( L. ?           continue;) |0 Y; x) C  ]1 P
        ;;' j) v' D2 i* ?' [
      -*)
! [6 }: q1 j5 B           ARGV="$ARGV $1"
: H% n8 _2 @- f/ @7 K           have_va_flag=0$ G. _3 M! S/ N
           have_vaf_flag=0
6 _" e" |. \# g9 w: f           shift;
+ @9 G+ \1 t% x+ @  ~  e           continue;
% ^& J2 I( h( ~  m* S        ;;* X" Q9 _+ w2 }2 ~
      *)
: \& `# l$ X" ~# r/ J           if [ x"$have_va_flag" = x"1" ] ; then
! Z7 f4 ^  v: g" O4 V( F              VA_FILE="$VA_FILE $1"
# P" }1 Q1 Y' y! Z% a; w# e           elif [ x"$have_vaf_flag" = x"1" ] ; then * z1 b' B' N* O9 ~% q
              X="`cat $1 | sed -e '/\;/d;`"
6 c8 N" L- @$ y4 c8 L              for token in ${X}; do% k* A  t5 J7 u
                 VA_FILE="$VA_FILE $token"
: `/ b* d7 @! \% B+ p, d. {              done
: Q+ S4 m+ \1 Q4 d           else
, d$ s' u8 J2 T% h* L  ~* N              ARGV="$ARGV $1"% t4 y+ F% @. A! p* c
           fi
2 g, j3 @( f6 |1 S  r           shift;
2 T% j) x7 D% N4 z: t9 _        ;;
; g" ?; q; D9 d    esac2 r  u: {, T# B/ |" q7 a/ B
  done
) B3 f" Q% o% r( O" F2 \2 w8 U& T
1 Z3 |/ O' I4 W+ k2 l6 w# H  if [ x"$VA_FILE" != x"" ] ; then ' z! i* F* b- R  w
##     /bin/echo " xxx ARGV $ARGV"
, x8 r$ w8 _" Z% D4 |) V" X) t; a6 B       /bin/echo "choose nanosim $ARGV ;" > hva.init
1 P1 E) G* _% g& l. }9 [       echo vcs +ad=hva.init $VA_FILE -o simv- B  `0 Q9 V; g& h4 P9 m, o
       vcs +ad=hva.init $VA_FILE -o simv
  q3 b5 y3 c: I, {* Q' ?* Z       exe_status=$?
( C3 N7 M. A' k, {( L4 I# h       if [ $exe_status != 100 ]; then
7 `" h0 L' Y) ]" V          /bin/echo ""
, Y' h0 k1 n9 q1 V: e+ u/ y          /bin/echo "ERROR: Execution of vcs exited with code $exe_status"
7 y" Q* e  w) ], |          /bin/echo ""
7 d7 M7 o, N0 w+ Y; U" s" x' O          exit $exe_status# ~: h, o" D6 i  h% H0 d, S$ D
       fi; F, r. [% A/ j1 }, l* R
       hva_files="-n simv.daidir/amsVD.ntl simv.daidir/amsWRAP.spi"& A7 D; B: f! F0 b
       ARGV="$ARGV $hva_files"
- c! D9 w0 |% Z8 A" `5 ~  fi
/ R( a: z3 X% J2 q" [" O- J}( O$ L! L. P: @: p! m
#-------------------------------------------------------------------------
) c" w5 i6 j" K, q: b8 h+ T
3 \* b& M2 s$ ?2 C" Acleanup()" {/ \( i- u% n" d
{) B6 J6 U8 c- t; P9 a9 J1 l
    if [ -d "$rundir" ]; then
$ D. E" M2 x2 ?9 o        # On AIX, a .nfsXXX file is created if libModel.o is removed7 ^& |7 G7 l# n
        # so .epicrun is not removed because directory is not empty.
# C  B# V0 _  H$ A4 {( E        # Solution is to remove it again if the first rm failed
7 D7 I# ~& s+ l        # (rm -rf $rundir || rm -rf $rundir) 1> /dev/null 2>&1: H& S  [) ?/ W# X
        if [ "$EXTRA_CAPACITY" = "YES" ]; then
/ X+ w" w  A, b. E        chmod u+x $rundir/rpcidfile
9 \6 n- A% c) L3 h        $rundir/rpcidfile
9 U/ p% T. R) l4 y, @8 e        rm $rundir/rpcidfile
: r1 d' U  N- G& o! b        fi3 Z" m9 Y0 l. {# ^$ i" S
        rm -rf $rundir
+ i, L" L; g  B3 F/ C# R' E8 Y$ t% B  a
        #Due to NFS problem, we have to copy files needed to- Y: R( T. ~% [8 L7 ]
        #/tmp/<temporary directory>, then symlink's files
; s+ U% I) @# x3 n4 _$ @        #to the local temporary 'rundir'. This avoids the problem
3 O& b0 I* A+ I' t7 l        #to remove 'rundir': d8 P" z, j9 j& }% u2 S5 p. N
        if [ "$EPIC_ARCH" = "RS6000_AIX_4" -o "$EPIC_ARCH" = "RS6000_AIX_5" -o "$EPIC_ARCH" = "aix64" ]; then5 H# k% z+ s. n/ e
          if [ -d "$tdir" ]; then
# x9 O  X. O- {9 ?- H) y& }            rm -rf $tdir
: b& q  W9 ?. O          fi& A* X9 G- @" K. B+ m+ [
        fi' N' }- Y& s1 W& H
    fi
( c& t( t; \: ?. r! r: F    if [ ${exitstatus:-0} -eq $ld_err_code ]; then
0 J" U/ r! t# h- ~0 ^        [ "$has_model" = "YES" ] && rm -f $cwd/libModel$suffix1 L8 P6 X$ V7 M9 Z& b- K" ]+ d. _
        [ "$has_custom" = "YES" ] && rm -f $cwd/libCustom$suffix4 r# R  ~# y( `* ^; Z/ e  _
    fi8 Z& c( O6 G+ L! m/ ^
    [ -f "$EPIC_SCRIPT_MESSAGES_FILE" ] && rm -f $EPIC_SCRIPT_MESSAGES_FILE 1>&2" U" H$ Q3 o+ b9 _
    exit ${exitstatus:-0}2 o$ S- y6 _3 b
}
. i  R  n/ y) }# l5 k* x/ T: X; l! h/ L8 a  j1 K% Z. k
Exit()4 e" Y7 ^. E- y2 o; F5 @
{
1 A; ^9 b5 p( U    exitstatus=$1$ d5 _. X( D+ I. v
    exit $exitstatus2 j7 i! {* [& ?4 C
}2 B* r* u, k/ @: m. d/ x+ S# |
" x* f$ x3 N6 J. [
# get_epicrc filename keyword
! R/ ^& d* P0 \/ U/ m7 f. Iget_epicrc()
6 \6 t5 I& U  Z% X' @{; C% b. p1 c* e3 i/ V& k% a
    [ -f $1 ] || exit 02 t5 R6 C+ ~1 w6 O( @' d
    key="/^$cmd2:/{print \$3}"/ n% Q  p" [8 C) n( p) U# C
    awk -F":" "$key" $1  ^. e( Q/ w# H5 L$ s  J
}9 C. y) ?; a/ c# u

: U# Z; R  W7 R: c. w#; |2 n3 o( L/ T+ j* D( a" L
# set datasize limit to hardlimit6 e% T  ~# [8 b$ A# R- ^
#7 f; p8 U# z; B
set_data_limit()$ }9 F' C2 b5 M; e0 {
{
: [2 i. [4 j3 p    dbglimit=0
; z8 Z3 v: ]6 C  Z7 v    hardlimit=`ulimit -Hd`
2 v- {9 s' a- a9 _/ N% D" R5 |    softlimit=`ulimit -d`! u1 f6 v$ {' R3 \* v9 X
    desiredlimit=3500000
0 \% l/ z& w% N6 }& _3 _( d% O) t' }    hardisunlimited=0+ O0 W4 f& m6 x
    softisunlimited=04 R$ g. S1 x5 ], Q, \* s" @2 y
    is64=09 A- x% ]8 D: c. }  h3 V5 Z
, D1 G$ A/ E1 Z5 s% _/ }% W
    case "$EPIC_ARCH" in
5 H: z* K7 x6 ]% y    *SUN*64)1 `2 N$ x. l& @- l" s
        is64=1
- k3 e7 p5 l* e( u9 D        ;;! N8 u/ D% |8 q
    amd64)
, I$ G9 |7 B4 s" q; [        is64=1
6 n0 h/ E. v. f# Y$ I        ;;5 K) e, D4 I6 i, O2 F
    x86sol64)
: q* f$ e# b4 I3 [9 G& |6 h        is64=1: o9 n/ ]0 k! }  j+ I# N* Q$ q
        ;;
) I( U% D# U  P( m! M5 u0 X  W& E4 j3 G    aix64): F; }1 x% {+ h
        is64=1
. s8 U1 R0 K* i        ;;
% \; I8 K* G( J6 D    suse64)% [) x% S% d+ h0 z) ~! r# X
        is64=1+ b: Q4 M+ x& Z. {
        ;;$ ^2 v  \& E+ F) M! b
    esac
. h. N: A) X% i
& ^/ r6 I% ]4 c' ^! T    if [ $dbglimit -eq 1 ]; then2 V0 D9 ?% y$ j
        echo hard $hardlimit soft $softlimit
1 {* z8 J: b  U5 p) {; w' i    fi3 @- R5 h- ~, F& ~5 I

/ {4 e: k1 Y5 l. J' e    if [ x$softlimit = "xunlimited" ]; then& n8 X9 Q8 ^/ v% S$ H+ J
        softisunlimited=1
/ I( Z- _+ D9 L3 l- a# i* K3 o  z    fi
* h+ B! {3 C) `# I! l: H0 l
* }% _) C/ A# J1 M% d! m! M2 w4 b    if [ x$hardlimit = "xunlimited" ]; then1 c2 v- y4 ?6 V& i
        hardisunlimited=1$ l  l- s/ `5 [! U( O+ Y
    fi
$ J+ c" \8 q) Y; l# m8 v/ K4 V; U3 \
    # 64 bit machine should have bigger than 4G
8 _+ P- z1 J. E2 b1 [; j    if [ $is64 -eq 1 ]; then
# f; K. B9 e" N4 \        desiredlimit=5000000
$ P: W6 _" h7 b( M7 X: N    fi
4 w! }" S/ k3 R) K. j3 K5 w9 L% @6 W& x6 R2 C2 N. x
    if [ $hardisunlimited -eq 0 ]; then& T; I: D5 R# O# ~; I1 u0 y+ f9 _
        if [ $hardlimit -lt $desiredlimit ]; then  |( }6 B$ K3 H. ^* f) X& `3 y; s
            echo "WARNING: datasize hard limit $hardlimit K is too small.") b# W) w; ~/ G2 b
        fi
2 i9 e0 _6 k, E$ `7 N    fi
/ M3 _8 d0 D0 i6 Y) ~1 e
6 E1 J3 A! y& L5 W# U- C, ^    if [ $hardlimit != $softlimit ]; then, y, e: z0 C: \. B9 a& g5 H
        ulimit -Sd $hardlimit0 \7 D( l& {+ @( N( p0 `+ z5 [
#        echo "WARNING: datasize limit is set to `ulimit -Sd`"
- V, o3 {4 e# B7 _    fi
+ {% Y& [& P( L7 M3 ?7 I/ D6 [- v$ `9 `$ [+ R, o7 U  }
    if [ $dbglimit -eq 1 ]; then$ Q) ~, Y4 a8 [% o/ u) W
        echo datasize hard limit: `ulimit -Hd`3 m9 _1 e/ c  V' v/ r# X. ~/ \
        echo datasize soft limit: `ulimit -d`
( y& I  V: P6 Q5 K% E' X    fi8 k* r" m& ~; I; N: G
}
# [, {6 g' ~# G( L+ q/ ?( ]
1 {1 L2 Q* V3 ^+ m#
) x8 F; _% n! }/ Q, P" U# set stacksize limit to desired limit
% f* o$ |/ \: b: F9 P2 G& s#- x8 m$ \, ]$ Y% r4 d& c
set_stack_limit()
- A4 ], Y* q6 y{& c% R/ k7 R! W7 Y# N4 G8 f- |/ i0 o
    dbglimit=07 b# @6 G* p+ m8 [1 |- C+ L) a0 _
    hardlimit=`ulimit -Hs`5 B. j! F4 ?& J; V( i- u
    softlimit=`ulimit -s`5 s. c% R# [! C8 ?) M( _
    desiredlimit=60000
" ^5 k: |" v# |  L" o" M    hardisunlimited=0
+ C1 w) x& L) }8 w    softisunlimited=00 n* r5 H8 C- {( ~  p0 |- p
    is64=0
4 O) o# c' F' e% n; U" i# t5 r7 Y
    case "$EPIC_ARCH" in3 K& C* c& [6 G1 V
    *SUN*64)
/ ?+ T/ n4 C: T4 c' O  Z0 P9 t        is64=18 J1 u9 l) z* {6 \$ R4 C
        ;;8 g9 ]) d2 o1 ^8 Z0 j# J
    amd64)  B: K. j' U' i- }- J; y
        is64=11 V# A3 ]4 r, \  `
        ;;
2 W" K" Z8 }, G5 D5 X9 v) Z8 T    x86sol64)! }: D9 d! t# C; Y" P0 t! l# n
        is64=1) T) i$ _) F9 W! l* A
        ;;
. X" K& v- T) Z& y' o$ P; K    aix64)
9 x% U* m$ l6 ^* p/ M        is64=1
. l# \! j$ s1 c) b- w        ;;4 B6 W3 [- x, l- Z. }
    suse64)$ p; U: |+ C- M
        is64=1
' y4 \) x! n7 y* \# _* P        ;;3 Q$ G3 p$ M; C: Q
    esac
8 m! I/ V7 u  }7 ]  F0 n7 }9 m
% ^- e" F' U& M* I' ^" }9 Pif [ "$EPIC_WRAPPER_DVLP" = "" ]; then
) f1 V* g5 q" E" E    if [ $is64 -eq 1 ]; then4 u* S4 T3 `' F2 p9 N" D6 D
        desiredlimit=2000005 @+ [4 f  _# h) {" V$ x
    fi- o9 _9 W- w) M7 n# n4 N+ N
else3 Y5 F* T& {4 e6 W! c* O
    case "$EPIC_ARCH" in( w8 \0 C9 y0 \0 o6 ~1 u
    *SUN*64)6 t/ x6 [" l$ t" h: c7 l2 B2 Z
        desiredlimit=200000% i: Q. v; Q' C$ k% p; I
        ;;
/ t2 ^  m, i- m" R2 m( ?2 m9 H3 r2 G* c    esac* x! r8 `, m$ h
fi3 h  o! B$ Q/ y* o
        6 L" H, Z2 T& b* C
    if [ $dbglimit -eq 1 ]; then  \) \4 J- H- u1 [  H
        echo hard $hardlimit soft $softlimit! G+ @9 p6 j% @; |( Y& I1 u5 ?
    fi. B. N  I5 J; u! F0 ^' @- E

/ g+ p# Y7 C# V3 D" g( p    #stacksize can not be unlimited, pick smaller number/ ^* F" S, a8 V0 u8 t

& Q0 V3 ^( O0 e4 V9 d; p) y4 O    stacklimit=$desiredlimit
! q. {: ^  X& |) X9 h7 A. t# w! _- ]/ Q$ @
    if [ x$hardlimit = "xunlimited" ]; then+ K" x9 _% g9 c& l" x9 y4 Q
        hardisunlimited=17 h3 h/ x- ^9 L8 }7 h
    fi
$ R# ~+ E) Z" [$ N0 Y* j
- T7 |: E; q( h7 n( O    if [ x$softlimit = "xunlimited" ]; then1 Z+ i- {  n( X1 B& R) R- Z
        softisunlimited=1
* C% K2 d! V3 K, ^* x) K% s, N    fi' A  E! n2 p- ~+ k
* Z, S& E$ z4 e' |5 D% H% G6 p  t' i8 V
    if [ $hardisunlimited -eq 0 ]; then) ?! @0 h2 {' m" m+ p  e5 _6 w
        if [ $hardlimit -lt $desiredlimit ]; then
0 ?3 z% ]1 \( m% K- q5 o* k            echo "WARNING: stacksize hard limit $hardlimit K is too small."
* r9 f* w, a4 T  b, {% q            desiredlimit=$hardlimit
7 {) G, {# x8 x5 g  y8 q& Q! }- [) l            stacklimit=$desiredlimit
' ?; H" i  Q" h2 C% W6 S        fi+ o+ Y$ n% l9 m/ W- Q
    fi
0 D# D6 S, H7 n: Q/ ^# {, c! F# d* m8 n
    # desiredlimit is set to proper value (< hardlimit); j. e1 q- c. N1 |4 m0 j
8 S( M1 F" X: W* r) T4 h
    if [ $softisunlimited -eq 0 ]; then
3 s# Z  G3 L& X: c5 f" f        if [ $softlimit -gt $desiredlimit ]; then
1 ?  {* }3 D3 Z2 Z' L            stacklimit=$softlimit
) \- p  c( c2 r; l, p        fi- p. x; J9 h( E; h
    fi' q1 }5 L% x2 W7 _3 v9 }

* k. t# h8 y) {' j0 T& x$ _    if [ $softlimit != $stacklimit ]; then4 P" x4 L* r3 G. k/ x& M
        ulimit -Ss $stacklimit8 H8 K1 i- `# M/ ]3 H+ k+ m3 o1 w2 n( u
#        echo "WARNING: stacksize limit is set to `ulimit -Ss`"  Q  X+ I  D) W5 L7 v
    fi, }& X8 o+ T2 J# {) z0 c
7 S$ f8 f* M5 H
    if [ $dbglimit -eq 1 ]; then
( }' m( G) h/ \- S        echo stacksize hard limit: `ulimit -Hs`( e: t9 ~( d+ g0 S
        echo stackize soft limit: `ulimit -s`: c8 [3 a% R9 w2 j% P2 O
    fi4 a* F! h7 C  j6 l3 F0 @7 f2 J' D
}
+ {) w2 N4 c) X2 ]/ x
* b8 K* A! b# z0 A+ B+ J( v: Topen_epicscriptmessages()! t+ h$ Y' r+ c5 B  p2 x
{$ Q/ B; j. @4 d$ Q) E4 ?
#generate  temp ".epicscriptmessages" file based on pid
3 f% p" c: c- l7 ~  Y) wEPIC_SCRIPT_MESSAGES_FILE="$EPIC_SCRIPT_MESSAGES_FILE"$$; ?$ {# M% D4 J/ O0 I
if [ -f $EPIC_SCRIPT_MESSAGES_FILE ]
, O( z  W3 I9 z: ?; `. {, pthen
1 _% O; J% _4 l: O  until [ ! -f $EPIC_SCRIPT_MESSAGES_FILE ]6 l0 S+ B5 D" r2 M: i) d, y  v9 `
  do3 u8 d& {' C  Q% G
    EPIC_SCRIPT_MESSAGES_FILE="$EPIC_SCRIPT_MESSAGES_FILE"$$
) L+ x* `/ S3 O. m" T& l! G4 y  done  a3 b+ g! P1 L
fi# V" U9 U# m# Q3 l* L
5 ]) i  }0 f, u' W
export EPIC_SCRIPT_MESSAGES_FILE
  ?. V) F7 F8 u2 x. m9 T; K- y9 |}6 w. t4 W% \1 c# n# t' o' \- f
  ~$ _" x6 t5 z, O/ a" P
, u4 d' G. H3 @7 O% F$ b
cmdname=`basename $0`5 H, y5 E% B4 S5 M$ y2 U
postgres="n"
+ X# \# b1 V% M0 ?/ ~. S1 Sostore="n"
6 s% X" X$ [6 L) ?gui="n", u& h$ N! z) }3 Y
databaseOn="n"( f+ I. v$ F  u6 g! l
f_next=0
2 v- k  ~9 l2 p" z( n. e  jf_option=""
* \- |& [0 U& h5 |( jo_next=0
4 G6 ?0 E! ]# U0 T1 i2 Z& ]" bo_option=""
7 x! v/ p- I$ LworkDir=""
& D3 j! S7 Q9 G0 {8 X9 H/ JworkDir_next=05 x) z5 ?& ]/ ]4 i& ^
errFile="powrmill.err"8 D$ I- |7 G: r( K( }
win32flags=""8 U0 {- W  V% @8 ^
ln_default="ln -s"
% [1 S& v5 ]. I+ \) ~8 k- }6 g) o. Q2 O
har_hilo_file=""
; M) ], i% u; c% j3 p* qhave_har_flag=04 m( d/ K. Q* ]2 D
have_har_setup_flag=0
1 ^8 h- D5 V! }. c3 `# A) U6 Cis_special_har_run=0
6 F6 N5 x0 A: Y# ?/ a6 J2 `har_ofile_prefix=""3 }3 V- U* g6 t

$ u0 z- X# R6 j3 h' O* N- D2 bhave_va_flag=0( _9 T  U% B! i" H
have_vaf_flag=0
( e, [' F4 B) i* [" O3 D: yVAF_FILE=""8 c2 w1 e0 N' ^, y* s% ^5 y' D" [. z1 z, S
VA_FILE=""% x7 A# j) L% L3 M, ^
ARGV=""
# I$ B2 P! K4 h1 E/ u
7 E$ }% s% x- Y. \9 G% e7 M$ z% }ORIGINAL_COMMAND_LINE=, e7 P! C) Y: r9 f$ K' Y) a1 [* J
LOOP_CTRL_FILE=".ns_ba_env"* v7 \. I+ q+ @
ALTER_HK_FILE=".alter_hkf"1 R& R7 W. M! N; e. O1 _9 Y
ALTER_COUNT_FILE=".alter_count"( l" q0 _' Y9 x& Y- w! t+ J' @
MONTE_IMG_FILE=".monte_img_f"
4 w9 _: |& [! P1 TMONTE_COUNT_FILE=".monte_count"
% Q+ _3 Q; B& RMONTE_CFG_FILE=".monte_cfg"
4 G/ z  l! g: N6 SEPIC_SCRIPT_MESSAGES_FILE=".epicscriptmessages"
/ B8 t1 T# v9 [1 G: w  {6 K- d1 `$ ?: p4 c  u% m
open_epicscriptmessages $@
! u- o, v6 ~- l2 e- J/ i. f. V) d% }4 Z
# C9 _5 h: G3 a7 B5 S2 C7 Yscan_for_hva_args $@
3 _  |/ |! E5 K9 u8 R+ w& Z: e- x4 C( o- y& a" [  H- i
scan_for_har_args()% p" A: M: o9 P6 t
{
) Z' W8 |- H5 ^$ D. o& S- K  while [ $# -gt 0 ]; do7 a0 z4 D2 b5 H7 u+ }
    case "$1" in
$ X# {# n/ f! v2 c4 i& M6 Q      -har)$ V# g! D, [4 C( V% V4 `
           have_har_flag=1% s9 u8 @& b1 |
           [ $# -gt 0 ] && shift+ j7 Z$ t0 E7 X: `  `) g% ]- u2 A
           if [ $# -gt 0 -a `expr "$1" : '-.*'` -eq 0 ]; then8 V1 r& V6 E4 U: Y5 i; i+ q
             har_hilo_file=$1
- C6 |: z3 ]5 b  ^+ K7 R             shift
' m0 B" v. m4 T! v8 e           fi! g. C: w! i: B5 n
           if [ $# -gt 0 -a `expr "$1" : '-.*'` -eq 0 ]; then  }! s2 R2 [5 j) Q3 y
             echo "Too many arguments to -har flag. Only one hilo file allowed."  v2 t  D8 o* l  ?+ s- r' m$ R. y
             exit 17 o. t% m) S+ B( n
           fi& w/ ]. D/ r4 |" R- O
           break' q$ S6 d2 X% |. L' D$ z2 R  H' D+ [
        ;;5 n: e* k- E& g  I
      -har_setup)4 {: g; ^6 e/ l3 `6 V
           have_har_setup_flag=1
$ ]8 o& B3 T; J5 f           break
, D' l* g" ]" C* \        ;;7 W& i* a6 e! {. ^
      *)
2 s* A5 A7 U8 J1 k( J' {        shift$ Z, ^- O' P! H1 |& R
        ;;$ x7 j$ ]% m+ @+ @
    esac6 Z5 F( L) e3 f; h6 ?, l
  done
; D# q. n$ Q/ t. k& l7 N+ O% K. j0 ^}7 i% g, Z/ R0 z; K
  j: V  n8 p( u8 i" R
scan_for_har_args $@
' k/ ~# z4 G# |+ W& a8 ^6 j5 F* M! V- M
for argv in $@
! k  e& g/ _2 M. Z1 Q4 L0 Zdo% k' {7 i  S7 W5 j+ z9 e! f1 @/ _
   ORIGINAL_COMMAND_LINE="$ORIGINAL_COMMAND_LINE $argv": ~1 E# f9 S9 N+ Z6 h* y* W
    if [ $argv = "-gadb" ]; then9 S; c; f. r# i& L
        databaseOn="y"
9 f9 m; S8 r+ j7 G! W        workDir_next=18 C# V! A9 a2 t( X' @# V
    elif [ $workDir_next -eq 1 ]; then- X$ ?; E, G, K9 Z# F
        workDir=$argv
% K: N' J; N2 H0 D) Z- p7 d        workDir_next=0
8 E% n5 B0 H+ y- }* K# }$ d1 W5 q    elif [ $argv = "-ga" ]; then0 e5 h0 }' o4 w/ f
        gui="y"+ r3 b+ g% b) k' a
    elif [ $argv = "-f" ]; then
  _1 i! X9 W) ?6 u* e2 Q        f_next=19 ?8 P: v4 n1 ?/ t: ]2 F) @
    elif [ $f_next -eq 1 ]; then2 m& I7 v" h5 Q
        f_option=$argv
9 b# T$ I% h% r8 P: z        f_next=0
) o. O9 d0 j* n7 g    elif [ $argv = "-o" ]; then  S# _/ k( m3 v3 t( Y; d1 _
        o_next=1
# m  o( e" N  Y    elif [ $o_next -eq 1 ]; then0 D8 R% P$ S: t0 ^7 K; a/ K
        o_option=$argv
) x4 p3 Z5 R- `/ S3 h6 j7 Y( V        o_next=0
9 y7 {6 S) B% E1 u4 a. e2 W    fi
1 `( z. U  W: A$ xdone
( H* v7 J' N) s+ }9 w3 Necho "Command line options: $ORIGINAL_COMMAND_LINE" >  $EPIC_SCRIPT_MESSAGES_FILE * ^/ \) _- y' ]2 E
3 h) w: `! b# i/ h: h/ d
if [ $databaseOn = "y" -o $gui = "y" ]; then% n( }( ~* z; C9 t3 p
  if [ $cmdname = "pathmill" ]; then
# P0 b7 Q# A( [# L    if [ "$EPIC_ARCH" = "SUN4_SUNOS_5"  -o "$EPIC_ARCH" = "SUN4_SUNOS_5_64" ]; then0 G9 W; a# v+ t! [
         ostore="y"8 h5 L) T, y0 D- b
         postgres="n"
9 j& W6 G4 \( r0 t7 s8 i7 Q     else
. a6 t6 d4 d( ~$ f5 }        echo "athmill GUI is supported on Solaris platforms only" 1>&2 * ~/ Z  c# P. d7 _/ C
        exit
6 X$ y- c; J5 H6 X) g     fi" U0 [( _4 g/ M& J- z
  else
' [- A/ C$ K" i- P    postgres="y"
2 B  ]1 H) Z7 J7 U; f3 J         ostore="n"
3 p" W+ I. I  L  fi
9 V# a" P- @" _) ~% hfi7 @) Q  k1 y( ^6 K' G1 M

- K+ `# M$ r4 ]6 O+ P$ z* _+ sif [ $gui = "y" ]; then# K& A6 k3 s! x# n% P
    if [ $cmdname = "powrmill" ]; then6 u/ D( P. W3 P
        pwga $@$ D+ Z  F1 U2 v- x
        exit
1 i" V, u% g' b+ u9 |! x    fi
! Y; O8 J& w/ j
& `1 m9 N+ ^% J" u- [    if [ $cmdname = "pathmill" ]; then
' c! D( Q& I2 X( K( M$ O        if [ $ostore = "y" ]; then2 }7 E$ t3 o) C, ?- G
           ./pathfinder $@5 }& _( K) ]  J; f% G- a% X
           exit2 C6 L4 O% n) ^) g2 ?
        elif [ $postgres = "y" ]; then. ~0 ~% {1 b0 X* d, r0 S
           pmga $@
. J. ^. U/ `! D# i           exit3 Q9 K1 G& W6 T. V
        fi
# |; X2 @9 Z; b/ X- o* [: x    fi8 V$ K# R9 D7 n6 ^. z3 \& O1 B
fi+ L+ A& D% V' d+ a

- B0 W  L5 l. n$ Iif [ $databaseOn = "y" ]; then
5 H* `* Z" c1 V  i" A, T   if [ $ostore = "y" ]; then9 p8 U3 h% Z8 l5 z: R3 }8 K8 W
      if [ -z "$workDir" ]; then# l, h5 {% s; l) G. B+ p2 p( o  W
         echo "Error: Missing argument for -gadb option"4 ~! H% w5 }$ |9 L) p9 y
         Exit 1
- o0 Q$ F4 p- f- Z* A4 b      fi) ~5 C9 m( k3 R
   fi
- D4 @0 t1 e+ Y   if [ $postgres = "y" ]; then
5 e9 g0 Q9 u! n- D& P" T: U      if [ -z "$workDir" ]; then- T4 @9 v3 h, a9 r% M
         echo "Error: Missing argument for -gadb option"1 [1 w$ H& r; k$ y
         Exit 1
. D- x" ~- i) l( g0 S      fi
$ Q9 Z- J( o+ k% m3 H   fi. I6 A9 q* I2 D) Y
fi
2 T7 x" T: g  D3 w2 X$ ^6 b
9 _! }7 T# j# x2 W: m% jif [ $postgres = "y" ]; then- J9 _* \2 a8 Y* X# w8 N

# K7 |5 _6 v, o& ~    if [ -r $EPIC_BIN/scripts/gui-init ]; then  [1 g: K. _' b; G" u  z: K$ x
        . $EPIC_BIN/scripts/gui-init8 t6 }+ N% U( E
    elif [ -r $SES_ROOT/bin/scripts/gui-init ]; then  k/ h& T& Z9 p' j  N5 z
        . $SES_ROOT/bin/scripts/gui-init9 f* R) i+ J/ F/ L
    else' A% `$ J! q; w6 q8 t6 R
        echo " ** Installation in \"$EPIC_HOME\" has been corrupted!" 1>&2
2 J% l' ^9 N' B- e        echo " file bin/scripts/gui-init is missing." 1>&27 |& i" h. ]& Y- ]" P
    fi- k0 c; Y1 A/ j/ b+ H2 J$ {$ N

$ k" V- ~- s" q7 i6 y2 R    workfile -tool $cmdname $@
, |, ]7 u% j: J& {' Ffi/ D  G3 x# v& A! i0 f$ y2 V: L

3 k9 g: ~, W8 P1 X$ S( A3 p0 g  o4 ]5 Xif [ ! -z "$o_option" ]; then4 ?3 m' o6 U& r0 W9 Q% s
    errFile=${o_option}.err
1 l' }6 U+ U4 I6 V( P9 j3 Aelif [ ! -z "$f_option" ]; then3 O+ d0 U, ^" p0 B
    if [ -d $f_option ]; then
) i& k1 L3 W5 K3 K+ c1 r( Q" N        errFile=${f_option}/powrmill.err
, K" e. G6 c% V8 F    else errFile=${f_option}.err( f8 i! J/ S% S
    fi
; q7 v* F( i! j0 M8 ^fi
* C2 s9 v: @% n  B/ f, y( B# S& P0 L5 B
1 s/ B9 D! ~6 V& w( O2 ]0 t7 h  a2 X
if [ "$EPIC_ARCH" = "RS6000_AIX_4" -o "$EPIC_ARCH" = "RS6000_AIX_5" -o "$EPIC_ARCH" = "aix64" ]; then
& {* O) _! u& |# Z  W  rundir=.epicrun
& l* p' n' Z# g. Yelse, f: a7 r0 A0 Z+ K  `
  rundir=.epicrun$$
! p% q7 j4 e0 q* Y& @fi# V7 i$ w9 G* ]
7 G5 f% D1 s; [+ v2 X7 v, L* o
libpath="$rundir${EPIC_DLIM}$EPIC_DIR"2 G$ y; p3 c9 @, ^
% m' F3 g/ N3 w5 l0 W
cwd=`pwd -P`
1 I6 {( ^2 x3 i8 c) S; Vif [ $cmdname = "acehdl_w" ]; then- I5 p8 s9 \  a
  cmd=`basename $0 .sun`
% E. a2 R$ x4 @  cmd=`basename $cmd _w`- N+ X8 i& S3 J6 X; b9 B
else9 B1 k/ A3 |8 @0 O  n* @6 ]$ Z
  cmd=`basename $0 .sun`7 ~% l! K/ i1 m, n. ?
fi+ g0 W0 n! ]% a3 N8 U

7 |6 \+ P8 p, Q6 ^8 l' r* ?command="$EPIC_EXEC/$cmd$EPIC_EXEX"
& ?* H. N) f5 h. f[ ! -x "$command" ] && echo "$cmd: not installed!" 1>&2 && exit 1( |5 P' u7 h+ G. s  R1 N; b
5 V5 D5 n# }% W; q8 c- k- e; V! _* m
# buildmod extracts -u/-fm options and calls genepiclib# |$ A9 h7 `/ T) e2 I) i
# It also set the remaining options to variable CMDLINE
( `0 O+ q! e' ?. v! Y) Y# look up in .epicrc for -fm & -FM parameters
6 K5 |6 m* u4 d7 K: F  X0 [& n! E0 R
  ?. ?+ C; f/ ^4 t9 c2 efmlist1="`get_epicrc ./.epicrc user_adfm_obj_modules`"  _0 s8 ?# ?9 z" R8 |
[ "$fmlist1" = "" ] && fmlist1="`get_epicrc $HOME/.epicrc user_adfm_obj_modules`"
  d" F: r: @9 u  A[ "$fmlist1" = "" ] && fmlist1="`get_epicrc $EPIC_DIR/.epicrc user_adfm_obj_modules`"
0 i4 Y; o0 e' I% N; I3 J
: D2 }' c3 C" L8 I1 ^6 l- ]FMlist1="`get_epicrc ./.epicrc user_adfm_obj_modules_force`"
& Q& }2 H  n. J) Y- E/ `, P[ "$FMlist1" = "" ] && FMlist1="`get_epicrc $HOME/.epicrc user_adfm_obj_modules_force`"5 F+ A( ^9 p. r- K3 Q$ S" e4 A
[ "$FMlist1" = "" ] && FMlist1="`get_epicrc $EPIC_DIR/.epicrc user_adfm_obj_modules_force`"8 ~$ E; r! {* T8 l8 w
5 Y2 y0 b! M5 o2 f7 Z( o  l
if [ $# -gt 0 -o "$FMlist1" != "" -o "$fmlist1" != "" ]; then- l% L) r  m' {: w
    # note that the buildmod script will set the CMDLINE variable- u( s6 D7 W  K" x, G' F( @
    . $EPIC_BIN/scripts/buildmod& j  l8 Q+ \6 H) j
  A# Z$ y, j2 H: A0 Q, W4 v& Z# U! C
    #echo "This is the value of cmdline=$CMDLINE"
' Q8 D: A  [- _; a    #exit 0% [  L) u9 x- W, |- ^
% y: L" r. r& i2 p* ~; C' x
    # if a new timemill/powrmill/pathmill built, run the new one
% A" W5 y9 o+ a: T* {# f' s    [ -x "$rundir/$cmd$EPIC_EXEX" ] && command="$rundir/$cmd$EPIC_EXEX"
5 d) E/ X/ w6 v6 g6 l0 m' ?fi
. Z9 ?- k$ D$ u: ]
+ |) f+ B% V4 N5 V1 Qif [ "$cmd" = "timemill" -o "$cmd" = "powrmill" -o "$cmd" = "nanosim" ]; then
! R8 f3 a( _1 |: i6 n4 i; f  if [ $have_har_flag -eq 1 ]; then
! n- p, @4 w* L8 U    is_special_har_run=1! ?* i5 F6 T7 u- w
    if [ "$o_option" = "" ]; then: S7 N( H, {  K' j8 x
      case $cmd in
: C5 i; W0 ^' _2 d        timemill)6 y: l3 T+ ]. i; S' B. a3 t
          har_ofile_prefix=timemill
4 u' I4 g- \2 C          ;;  X: _1 l/ Q' ?+ K0 |+ `
        powrmill)8 I8 e& e  n- T
          har_ofile_prefix=powrmill
& E8 P+ E! K4 t' f0 `& b% @7 D# g          ;;
; r- @9 v, O8 C$ Y* r        nanosim)
! T5 z% f! D. y          har_ofile_prefix=nanosim
' @  ^/ a' K3 |1 H7 M3 y; v          ;;" ?" L; a+ s/ b! e0 M
      esac
+ G" R% T3 h7 _+ Z    else' v: H3 ~- U4 t7 E7 y  O
      har_ofile_prefix=$o_option+ s8 t( X* v8 w- C# O
    fi
- o9 @, Y* @/ p0 J. ~ fi9 L/ D" M  v& j0 x/ m- G3 t- q
fi
" F( R' X8 K- \! x- A' j7 O7 |% f- r4 l' J1 a8 w8 r0 `. z
# Call Double precision version of the product if -D
) l" I6 ~9 P( c8 D* a% }6 d# or simulation time > 1,000,000 ns., [  A. L" C6 X0 q% z4 I
if [ "$cmd" = "timemill" -o "$cmd" = "powrmill" -o "$cmd" = "nanosim" -o "$cmd" = "railmill" -o "$cmd" = "pwarc" ]; then+ J( K/ K, U# }5 U
- C  P0 }, C, m6 m: c
  # Now the binary always has the ACE feature  r& m2 j0 o0 S9 }
  USE_ACE=YES" y  m& b. {6 t: g7 f4 }3 Y

; q7 @6 b8 d1 |. F2 |: s) q3 I  HAVE_DP=NO% e4 D& ^3 G- c$ h
  EXTRA_CAPACITY=NO' \. x) C$ {# p7 k6 k! x  h
  DB_REAL=${FORCE_DB_REAL:-"0"}" d8 J4 V+ V' l8 h4 y( C: X
8 M- o4 @) S- w9 p6 F4 y
  # Enhance for ACE ease of use1 _7 C- e! W* u$ i8 v5 g
  # If no command line option or only a -T option, do:
; L! i6 m. e$ ~* M! N  #   1. set -A option/ G) k# X7 D% o" T* b8 i
  #   2. assume input file to be hspice
  u9 }& A# r( N2 n8 G, O  #   3. set -o to input file prefix+ d1 m" \" e4 Y2 p. n& t" ^' r# M
  #   4. set -z to input file prefix
( g  Y3 O8 I. i) w0 n, d  #   5. set -c to default config file
- R$ N" ]( ^& Q- V& A; x8 J& p  netlist=""
# e0 ^5 e  i( s" }; e  minusT=NO( y% ~" ?$ }+ O
  useStdCmdOpt=07 V# \7 s" [" ?8 G+ O4 h6 g
  prefix=""" ^. s8 ?9 `( X; I! {" R+ |
  circuitType=""
% ]: |  V9 K1 |3 }4 T' f4 d. ^: Y  for opt in $CMDLINE5 L) k& q- y+ ^7 W
  do1 {0 f( ?# M, M' f& \
    case "$opt" in
# M  d& n4 _0 L      -T)4 F2 G; h$ O1 x$ c" K* S3 x
        minusT=YES
, `6 T# Q7 [. f  q; L4 O# ~6 [        ;;7 Q+ Z( C* |$ \6 h
      -*)
0 t9 q3 |( L, A- ?# }& t4 h3 `        # using standard powrmill command line
% f" ?! D/ V4 C" c" {: W& c        useStdCmdOpt=1
9 s: G% r  z5 o        break
( O1 U0 |. G9 E: H& a" o        ;;
0 Y$ z- w0 K3 V4 e" J" |% U      *)+ D) r  A1 u! o, E
       if [ "$minusT" = "YES" ]; then0 U& s# r9 `/ }, h! d& O. K" I
         circuitType=$opt2 m. D/ d' f# l& V6 e. |6 C
         minusT=NO  # reset flag, E+ q  v- \( B" S/ |0 x- A
       else
: M; t7 H6 s7 D6 m' Y8 X         if [ "$netlist" = "" ]; then" \% J; Q7 q$ Z6 a: Q
           prefix=`basename $opt`9 c" l% M  t( G4 \- n
           prefix=`expr $prefix : '\([^.]*\)\..*' \| $prefix`
+ Y8 ~9 b1 ^3 G, w         fi5 y! q% N( M7 C
         netlist="$netlist $opt"
1 x  U9 t1 r, g       fi
9 e) w2 V) A" ~! S' V! Q( F' `       ;;& N4 j  t1 B/ L' I( t- l
    esac
3 |$ a) m! l( z# A4 {. B' j# A  done
' i1 Q; P9 @. D0 h7 Y/ j# U$ c+ }# o- |6 `0 M/ Z4 I2 f: |

* B8 c5 r* D/ G' K, Y  if [ $useStdCmdOpt -eq 1 ]; then
7 {6 x9 |- m0 Q, H7 A* a9 S    # use standard powrmill/timemill command option
5 |( ~9 x/ D% c5 @% j: i7 G    for opt in $CMDLINE
$ g* Q7 A- ~# ]/ ~    do+ ?0 x- p& P* _  Z3 Z; i  i
      case "$opt" in 8 |8 E' l- U' Y4 B$ A& b, w. g
        -A)
8 l7 i2 Z0 k1 k/ A! j0 x            DB_REAL=1
3 p: ^7 N" F+ K6 w0 N5 m9 _            ;;
& @, U& O( }: k! q/ m, S      esac
8 e* d% x" S0 X$ q  L$ W& Q1 D. A    done
' u7 t( o- ^% I  x5 Y    if [ "$netlist" != "" ]; then
& a/ q" E8 O* I& {      CMDLINE="-nspice $CMDLINE"
6 ]+ X3 E$ r+ n( V' I/ u    fi
" I9 o& n; I( T/ S1 m8 A  else
' S0 `; e4 b3 |8 ~    if [ "$netlist" != "" ]; then
" [" {$ j. S$ Q3 [& ?+ ?7 t# t3 E2 b      EPIC_DEFAULT_CFG_DIR=${EPIC_DEFAULT_CFG_DIR:-"$EPIC_AUXX/etc/$cmd"}
, }$ o9 f0 r$ U' O2 p% l, H      # construct new command option! K+ C- n+ u0 g) K
      if [ -f $cmd.ini  -a  "$circuitType" = "" ]; then
7 @+ e0 H" Q! I& q2 C        CMDLINE="-nspice $cmd.ini $netlist"
% }" d! M( d( t( z- J' G      else' Z* l& Y: ^( ]& @4 ?" R; j
        if [ "$circuitType" = "" ]; then
2 M3 ?2 k3 l% v2 y; z          circuitType="msana"
# L/ s/ P6 T: I0 {# W/ k# \2 s        fi4 s8 s7 P& f1 t9 J0 U
        CMDLINE="-nspice $netlist -c $EPIC_DEFAULT_CFG_DIR/$circuitType.cfg"
6 u/ m$ L% ]$ V& S5 B9 a      fi
$ y) x( \, Y: }' y& h9 d8 l- `      CMDLINE="$CMDLINE -A -o $prefix"; S6 g. b/ a8 F, O4 C0 d, P1 z& ~  i
      DB_REAL=1
, a0 p1 r0 e6 a8 R      echo $cmd $CMDLINE' k1 @! W( u- B: m4 ^7 T" t
    fi
  ~1 E; P. B& O9 g4 ^9 i  fi7 O) L3 |. N' r% \  @
fi # cmd is timemill or powrmill or nanosim or railmill or pwarc
- d5 Y2 H$ p* @
- c9 P4 b# y( S& Q1 ~4 K$ i; D4 x[ "$HAVE_DP" = "YES" ] && [ -x "${command}_a" ] && command=$command"_a"4 S0 k1 z) z* U( G
[ "$USE_ACE" = "YES" -a "$DB_REAL" = "1" -a -x "${command}_a" ] && command=$command"_a"  J/ \+ O5 x. G: _. s
[ "$USE_ACE" = "YES" -a "$vlog_design" != "" -a -x "${command}_v" ] && command=$command"_v"
! h9 q3 T: S# q9 w, f6 G8 N  s, \+ R1 d- ^: X2 C* B# ^  ^. {( f' R) F
if [ "$__engine_wrapper_called__" != "Indeed" ]; then
0 |, j) F  [7 \, Q" p' _    __engine_wrapper_called__=Indeed" h  Y' `, |- ~: {% l# G
    if [ "$cmd" != "amps" ]; then
$ m2 H2 @( d+ _+ W; @1 x        export __engine_wrapper_called__: d  F/ i& g. z0 T" `9 [
    fi
& ~: K: u; l1 R" Q1 R8 `0 t" N& S3 \
    trap "cleanup" 0: }5 A5 |; M* l* n- N* M. W( j
    trap "" 23 N  u: S6 Z+ ?: r
7 v6 H2 f# a/ \
    [ -d "$rundir" ] && rm -fr $rundir
% `4 J+ `. d/ z' L0 V! g    [ -d "$rundir" ] || mkdir $rundir  n/ O* @9 K9 d# ]
' F9 _6 S- y! k
    case "$EPIC_ARCH" in
( }/ `4 F8 o: E% U0 O2 z    *SUN*64)   1 O. h) q+ C0 T8 _; ]* @) s
        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH"
/ k- e' `6 _7 w        export LD_LIBRARY_PATH
! K9 m. C0 ]) V2 }2 E1 U        suffix=.so; u8 ^6 W6 S1 v
        ld_err_code=127* V9 T; |5 N* {& w% F. k' p' L
        ;;* K' i0 d! A, O$ G
    *SUN*4)   " r0 z# \2 ?% X) t
        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH"
9 H- S0 G' S; v6 U7 G; B; Q        export LD_LIBRARY_PATH3 z( L1 y" k. q, Z( G& T. x
        suffix=.so.1.0
# c  S0 X. G8 M' Z/ @6 `; J3 k        ld_err_code=127
. b  Q  y9 D: S8 ~$ n        ;;
: |9 {( x( m" J. P% }+ N    *SUN*5)   
2 [: U3 l6 h9 x/ }7 Q6 n! r7 W        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH"$ p: K" F/ E  l, o7 k5 Y4 T
        export LD_LIBRARY_PATH5 N3 z, _: u) Q8 I
        suffix=.so5 {) c+ w' I. X! G/ n8 q
        ld_err_code=127
9 ~/ c' l& H0 _. N* O" q        ;;, S. `6 {1 [. E5 V
    x86sol*)   
. w9 ]; j, i. t; I. x/ s        LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH"3 n$ C- I) l( e+ V
        export LD_LIBRARY_PATH
" b4 a2 K- [3 |% o) S; D) ^        suffix=.so
3 Y" ]0 U$ h* w8 a        ld_err_code=127
7 w7 [( C- [0 i0 R; `; p) q/ l- p2 N        ;;& K& d3 }% d2 L
    *AIX* | aix64)   ; D: N- M. l6 q7 U+ c# s. h; T
        # When genepiclib creates shared objects, it creates a import file and # I: s; |* }( J/ e# ]" l
        # uses timemill as program. So at exec time,program timemill is needed
4 A! U. A" U+ @        # in LIBPATH
& R5 U. [$ i* B2 S  b        $ln_default $command $rundir/foomill) ]: j3 k9 F: I0 A8 Q2 P9 L) ~
        LIBPATH="$libpathLIBPATH:/lib:/usr/lib"
- M" O2 `2 a" @. `! Y( E8 q, \        export LIBPATH& y' p1 J1 G: z
        suffix=.o! L% ^0 `# x. Q9 {( k
        ld_err_code=8: Q2 R0 _& J/ N; y. N5 A! `
        if [ "$EPIC_ARCH" = "RS6000_AIX_4" -o "$EPIC_ARCH" = "RS6000_AIX_5" -o "$EPIC_ARCH" = "aix64" ]; then' v+ X$ k" O% Z; b
          tdir=`echo "/tmp/d"$$`
# Q& Z0 V1 [5 W- O6 k) @1 e          [ -d "$tdir" ] || mkdir $tdir, g- D) u, h# d" M
          if [ -f $EPIC_DIR/libCustom.o ]; then
9 c6 H; V% ^2 m5 d& w! v             cp $EPIC_DIR/libCustom.o $tdir/2 h  W* t( m& _- H+ R& M2 k
             $ln_default $tdir/libCustom.o $rundir/. v, Y+ ~$ n- z0 V) \# K! j; d
          fi
/ A8 m7 k+ Y7 M& ^5 w2 q7 i/ P5 U1 [- T          if [ -f $EPIC_DIR/libModel.o ]; then) ^$ @# M2 `/ g/ B& ^# W  L
             cp $EPIC_DIR/libModel.o $tdir/* V$ f  w# J& X" A) S& ^
             $ln_default $tdir/libModel.o $rundir/: Z, x) R( c8 V. B4 i4 e: q% }3 l
          fi
" {4 Z: a$ P3 S2 I2 X) F& i0 f3 u          if [ -f $EPIC_DIR/libFuncModel.o ]; then
& Y; d- O4 W8 U/ i& J! R7 r             cp $EPIC_DIR/libFuncModel.o $tdir/& V0 V) F7 k3 h5 b/ X* Q
             $ln_default $tdir/libFuncModel.o $rundir/1 W7 B! t$ f: |8 f0 b9 f# L6 u
          fi0 z7 I3 ^0 t. W8 z/ `
          if [ -f $EPIC_DIR/libFuncModel.34.o ]; then+ a$ _9 `* G. Y% b8 s
             cp $EPIC_DIR/libFuncModel.34.o $tdir/
1 a! [) f! v$ J: I! [! m             $ln_default $tdir/libFuncModel.34.o $rundir/
8 q) W2 |- O# o" `. Y' w          fi5 P. C+ r- a5 V3 s( B7 \1 B
        fi
9 r/ J$ V" J  q& l        #Set the IBM flag to enable more shared segids( V$ g. C- `. `5 _
        EXTSHM="ON"$ p5 E/ U9 n5 G( k) ~0 R
        export EXTSHM
! m# t9 R9 n; D; U  t        ;;. v6 W5 d- N5 q7 C6 z0 `  k
    *LINUX*)      y2 [$ t& P2 g7 R* p7 O- x3 O
        suffix=.so% @: m! ~3 \: H9 E4 Q
        ld_err_code=1
+ c2 H. ~5 W6 C0 ], l( _* `        ;;2 R' \' t8 U+ p2 P% C2 y0 c8 a' w. [
    *amd64*)
8 {' }/ j2 {, U8 X* N        suffix=.so
" s) |; h7 O; O        ld_err_code=17 q$ J5 y" ?( k" B5 u
        ;;& x% E2 E8 E! b, d5 b# X
    *suse64*)5 _* Y: x6 i* I1 u: u) G3 M$ q% U
        suffix=.so
2 {3 j5 [2 R/ v- e5 A        ld_err_code=1
8 l6 e5 _, s4 b- I# w( _. z3 Z) s1 x        ;;) B% V" n) W4 m
    *suse32*)   
! I$ h1 C# E; X; O# D% O  J        suffix=.so
( y3 {2 q& [! Q' m3 @+ K+ L        ld_err_code=1
$ \" I4 k% O$ u/ a% }; S+ ~        ;;7 j/ N* t+ V; ~8 M1 N
    esac' C+ S. S4 p9 m2 _4 k7 a9 {

! l; o: Q5 Y- H0 j, O    [ "$has_custom" = "YES" ] && ulib="$ulib $cwd/libCustom$suffix"
0 h9 S( L0 D6 e: v- h    [ "$cmdname" != "timemill" ] && [ "$cmdname" != "powrmill" ] \
' M9 O+ D' Z8 B7 _2 e        && [ "$cmdname" != "nanosim" ] \
0 Y% [' U( `6 ^: r; X        && [ "$has_model" = "YES" ]  && ulib="$ulib $cwd/libModel$suffix"
2 M! N  F# ?& ]# N0 t, E    [ "$_VA_" = "YES" ] && ulib="$ulib $cwd/libva$suffix"9 L& M4 `/ j# ^* t

) y9 m+ e. R! y8 P- s- R8 O. W#Look for command line option for libFuncModel.so# _7 y& f0 k+ T+ ]% w
#    user_library_next=0/ G/ [! O4 i4 l; p$ I" O& y' o
    has_fmlib=""/ r. T# T7 G2 J* p! L8 N3 z# x
    for opt in $CMDLINE& H% y+ t3 K! c& w4 [/ z
    do" |$ x# a3 Z2 S9 A' Q+ W. h
      case "$opt" in 8 Q7 o* T# u4 `7 w( D; m
        -fm)) r4 }# ~' K% D! ~
            CMDLINE="$CMDLINE $cwd/libModel$suffix"
7 z" \5 u- M0 P: i/ h) I; Z2 Z            ;;  a$ A7 [- i1 J# ^5 d0 j+ l
        -fm_user_lib)
$ @- u5 c" q' J8 W3 g            has_fmlib="YES"
5 E4 O6 y8 c0 e9 H#            user_library_next=1
$ q$ J# N/ R- p: N" o            ;;
' ~- R0 q. E/ ^: r% B$ [        -xc) 2 i" A# y# W8 N- Z. L
            if [ "$EXTRA_CAPACITY" = "NO" ]; then
& z  B9 B( [1 G- \  f9 u" g            EXTRA_CAPACITY=YES, j4 v" s: j: Q9 C2 v6 D! ~
            fi( r/ ], ^: T9 D. Z
            ;;
. o* S! D4 H6 r) z, v, w#        *)' X( M( n% a' w$ q% j9 T9 Q
#            if [ $user_library_next -eq 1 ]; then
; M* I9 a% v8 \#                if [ -f "$opt" ]; then5 \) B  h3 _! d" L* m
#                    libfmodel=$opt  |% o3 o1 O: y( @( P. t2 S
#                else7 Y/ p' _5 q' o& T% G
#                    echo "-fm_user_lib: Specified file not found"
) r# i# O8 E; v' u: Y2 z5 S% d#                    echo "-fm_user_lib: Specified file not found" >> .epicscriptmessages
5 W( l$ A) W; {- |* k#                fi, @7 f* I& K/ @2 A: Q
#                user_library_next=02 T" u" w1 u+ Y' T9 A' o5 Y
#            fi
9 b* b. y% p) E" [$ G% N, \' F#            ;;& T0 p% p8 |$ H+ D$ }
        esac7 ^+ O/ P% d5 M% w/ g0 g/ y! ], D8 x
    done; c5 `6 Z& g7 q( T
8 S# P4 z& l% E. b' J
    if [ $cmdname = "timemill" -o $cmdname = "powrmill" -o $cmdname = "nanosim" ]; then
5 z% b9 z& O$ D( M        flib=""! J% x; K; _7 k
        if [ "$has_fmlib" = "" ]; then
$ P7 e/ ?2 k: V+ x' _& _* R            flib="$flib `get_epicrc ./.epicrc user_libraries`"
1 }2 M9 s2 q+ Q2 x- ^            flib="$flib `get_epicrc $HOME/.epicrc user_libraries`"
5 T0 X! e: G9 I1 _' g5 V            flib="$flib `get_epicrc $EPIC_DIR/.epicrc user_libraries`"# |8 _9 A, f, G# |
        fi
# b+ C4 ]4 O! S& L0 s    fi
1 C/ }& X9 ~1 A' p5 G% A+ r" p- A! [9 L) K5 J1 T! [
   for i in $ulib
. f# g, e0 x$ I6 e4 M) V4 O   do9 M) A7 S5 E; l7 Z
       [ ! -f "$i" ] && continue
6 \7 e4 @$ o+ L       dir=`dirname $i`; cd $dir; dir=`pwd`; cd $cwd
: _5 ~( {6 Y; R       i="$dir/`basename $i`"
9 J' _0 l' N3 K' t       case "$i" in( z1 s+ t  m- D/ v( v9 _% l
       *libCustom$suffix*)    [ "$libcustom" = "" ] && libcustom=$i;;- j+ O  g/ k2 N! X8 b( `' I
       *libFuncModel$suffix*) [ "$libfmodel" = "" ] && libfmodel=$i;;9 B; e7 \- n' a8 ^/ ~- m: e
       *libModel$suffix*)     [ "$libmodel"  = "" ] && libmodel=$i;;+ v6 ?" @  I: c3 m
       *libva$suffix)         [ "$libva"     = "" ] && libva=$i;;
# k$ z( A) e! u# t       esac
/ _  P2 `6 t- @& g+ X5 r       [ "$libcustom" != "" -a "$libfmodel" != "" -a "$libmodel" != "" ] \$ _5 P5 s4 g2 n6 U
        && break
( z# e4 \  M" s, V1 e/ D   done
6 o* N( l" Y, R6 ]) j2 k: G& Y  C5 @9 @7 V% s
   # symbolic link shared libraries to .epicrun$$0 E2 t3 j* E' J
    cd $EPIC_DIR; epicdir=`pwd`; cd $cwd
. ]0 y- v; U& z$ ^$ z& g    if [ $cmdname != "timemill" -a $cmdname != "powrmill" -a $cmdname != "nanosim" ]; then
; ^4 ]9 [# W4 Q! P        if [ "$libfmodel" != "" ]; then2 N6 O  b9 t: p$ o# J3 u
             [ "$libfmodel" != "$epicdir/libFuncModel$suffix" ] && \+ F" G6 `! W, g7 b9 ?
             echo "Using $libfmodel ..."  && \' ~( n5 x# I/ s0 j
             echo "Using $libfmodel ..." >>  $EPIC_SCRIPT_MESSAGES_FILE, A+ G& }$ \1 `- A# y
             if [ -f $rundir/libFuncModel$suffix ]; then9 ]! C/ x5 v6 P2 O0 u7 F) l
               rm $rundir/libFuncModel$suffix
  c& L, O: s8 k) S             fi
# ~; @. i- B; W: e9 T             $ln_default $libfmodel $rundir
) M( ]( K3 @( u8 v        fi
2 c1 B+ p  ^9 i. N9 ?/ x        if [ "$libmodel" != "" ]; then
  d2 B5 w, i+ T/ T7 e0 w9 V$ P             [ "$libmodel" != "$epicdir/libModel$suffix" ] && \
1 Q" H; b5 Z9 [& s8 {  u' I5 ]             echo "Using $libmodel ..." && \  ]! [+ Q$ A/ N) v" P
             echo "Using $libmodel ..." >>  $EPIC_SCRIPT_MESSAGES_FILE% J; T# U* I  J" s5 J% C  P& ^' u& K
             if [ -f $rundir/libModel$suffix ]; then8 `9 ?5 H+ u; A+ E' T
               rm $rundir/libModel$suffix
/ \% c( F4 d8 e" O             fi% F% `( t7 C- U1 o
             $ln_default $libmodel $rundir
7 B. K5 M  d$ A" T- U        fi1 p  W% C. \( U: f( c2 G7 E
   fi
, D+ `3 }# v% `) p2 t   if [ "$libcustom" != "" ]; then
" R& x& o; `; y+ t        [ "$libcustom" != "$epicdir/libCustom$suffix" ] && \
% m2 W( Z' `) ?. j3 D! V        echo "Using $libcustom ..."
9 }# g8 ^- Y. I* t% W$ }, `5 S        if [ -f $rundir/libCustom$suffix ]; then
  a, C5 ]* Y" ~( }" p# y          rm $rundir/libCustom$suffix* y' |9 B: Q$ _# w
        fi
$ i/ b% p2 O& ?9 i0 V        $ln_default $libcustom $rundir
5 W# [, Q) O4 C. ?5 u9 p( @   fi
9 P+ I' B& D' }5 H
3 y3 x, M5 i+ E7 k7 D8 p# `" y   if [ "$flib" != "" -a "$flib" != "   " ]; then& U# Z; n1 `  h. a
        CMDLINE="$CMDLINE -fm_user_lib $flib"
" D5 c3 i$ _/ {9 E5 t9 b' B   fi
- q* u9 k$ Q$ u
1 C( g  C+ O1 u' A/ w   if [ "$libva" != "" ]; then6 A4 ^' }' U4 E% S9 R  _
        if [ -f $rundir/libva$suffix ]; then. f" U  R; _! y$ a1 m  C
          rm $rundir/libva$suffix! X+ {. \8 q" m, t( p1 d
        fi& [4 g! A5 f  i* M$ r0 s% G. T6 A
        $ln_default $libva $rundir
/ {; u: z4 v0 M% E   fi
* f6 X% b  E! p' y" @! R1 L/ J4 o8 ?5 \2 w! p

9 k( N6 L: Z) l; z9 W7 y0 |    # VCORE design library$ M+ w: O- a1 ]
    if [ "$vlog_design" != "" ]; then
  }0 _6 b7 z' f/ _/ {" U) K        $ln_default $cwd/$vlog_design $rundir/`basename $vlog_design`
- ?8 W  B2 O3 y5 }3 R$ [, ^# q    fi
- x+ R0 k* E' Q7 M5 C8 l/ g0 z& e9 R% n
    if [ "$EPIC_EXTRA_CAPACITY" = "1" ]; then
  G2 G; x% I9 T5 \7 Q        EXTRA_CAPACITY=YES
: ]5 @1 h3 a* G    fi
; Z; x0 ^/ q7 [6 s% P$ b$ T& J* }. H* \& \; L$ v
    [ "$EXTRA_CAPACITY" = "YES" -a "$USE_ACE" = "YES" -a "$DB_REAL" = "0" -a -x "${command}_xc" ] && command=$command"_xc"9 ^/ k& `1 R# x! Q
    [ "$EXTRA_CAPACITY" = "YES" -a "$USE_ACE" = "YES" -a "$DB_REAL" = "1" -a -x "${command}_a_xc" ] && command=$command"_a_xc"
% U3 k- j! m4 ^    #Create temp file if dual process is on
1 o, V# }* ^, E8 y    if [ "$EPIC_ARCH" = "SUN4_SUNOS_5" ]; then/ h, @% t  y% Z8 D; o4 {( V0 y
        if [ "$EXTRA_CAPACITY" = "YES" ]; then
0 T6 Z3 i$ S' b1 q1 b1 E            touch $rundir/rpcidfile% }. T/ h9 G" p4 m6 F
        fi) P8 G% U9 e3 |( r1 s1 V
    fi# r1 p3 v7 U! r0 h7 R% {! i) S
fi- C8 G# n. K6 K3 h& T
. r+ [+ {3 s( e% b+ p
run_cmd()
. K& h' v( ?1 ?) g4 i) L{
$ V. h$ U: r; ~; I1 l8 k* i. K  command=$1
9 v$ `7 m8 _% M+ ~! \) t; i, K$ L  shift
& t; f7 j3 Q, ~& u
! D# y3 V  v5 T1 a! I- A  I, B  if [ x"$VA_FILE" != x"" ] ; then
! n: A. q, X% N, {- d     cmdline=$ARGV/ i' C$ v& {6 ]
  else7 I3 o# t0 g3 f! K4 G
     cmdline=$@1 t% Q" F; S; O2 _
  fi
& p: o3 p  `0 W0 w) o
9 B, @3 j( t# ~# L9 W  debug=${DEBUGGER:+"$DEBUGGER $command"};/ {! l( [8 v* q9 V$ M$ Y7 X
7 T+ v3 z5 ~- f8 B4 ^7 k# B. ~
  # To disable Exec-shield-randomize in RHEL3 U3+ when running nanosim and nanosim_a' ?) j5 T0 r1 t  C# H* X5 S) E' @
  # so save-restore may work.
+ T5 I$ @- u# B- p' @  setarchStr=+ ?, k9 r4 o" R1 s) P
  cmd2run=`basename $command`
6 p7 L- ~9 q2 u  if [ ${cmd2run} = 'nanosim' -o ${cmd2run} = 'nanosim_a' -o ${cmd2run} = 'powrmill' -o ${cmd2run} = 'timemill' ]; then4 V/ q4 `3 J  X6 }) j
    if [ "$EPIC_ARCH" = "IBMPC_LINUX_LINUX" ]; then
/ C4 f2 E* \/ H6 B9 \2 X      setarchStr="setarch i386 -R "8 g4 ~2 K1 F5 C
    fi
! g! o7 a9 f, r5 u; `- a    if [ "$EPIC_ARCH" = "linux" ]; then
9 t6 e9 P9 n9 x6 f' s) ]      setarchStr="setarch i386 -R "% U$ x, C  {2 u, z- q4 d
    fi
) w% n- m" i5 T. Z0 J2 f* O    if [ "$EPIC_ARCH" = "amd64" ]; then2 m& p5 @$ `  n7 U. b
      setarchStr="setarch i686 -R "
) a! _, v; B" o; ^5 u# A    fi
. E" R$ R2 y. m8 n0 x    if [ "$EPIC_ARCH" = "suse32" ]; then
  d! t  ]4 h5 L; y; X" ]      setarchStr="setarch_suse i386 -R "
5 r8 S' ?7 V& j. L8 G    fi; X  y3 I! X& T  s7 [- d2 c# K
    if [ "$EPIC_ARCH" = "suse64" ]; then
( h1 u+ x  H- C4 K      setarchStr="setarch_suse i686 -R "
; \  p$ F+ @; b" [8 x    fi: a  [6 m4 l4 X) n9 Q8 z
  fi
1 S# u/ V' X0 e
. J/ [; u7 P" r5 R" A$ B; q  ret_stat=02 ~- @+ g; R; }: p7 o* p
  if [ -x "$command" ]; then
4 H: ^4 c' k2 z7 H      if [ "$debug" ]; then
/ ~. ~) H! r# g; _0 C        _debug_args_=$cmdline
& j! a7 d+ |3 C5 J- ^8 H& L        . .epic-debug3 ?, ^# s* q: `- z  \4 @5 s
      else* d* r. s+ _1 w$ |7 t
        DEBUGGER=; export DEBUGGER' q' }4 S; F+ A3 C, C
        $setarchStr $command $cmdline
0 w7 N$ g; V0 L      fi
3 R7 ?1 d- ]- Y$ {- s      ret_stat=$?  a& ~: [2 D! }
  else/ b8 x# S+ C+ f6 Q
    echo "Corrupt installation, executable \"$1\" not found!"/ P/ U- _- O2 a/ d& T! E! r$ g
    ret_stat=1
3 f7 {: t  f% {4 u3 h  fi" r- h. ^! n: t- i4 N& G+ i
}- e( R! r9 ]* h4 v: l! z+ ~5 @
; L) Q0 q; z. @+ M0 T- s6 ]8 q. t
# keep runing cmd if ctrl file exist- Z' t; b5 X% c: h5 s- W( W
! K. A& J* `! k* E5 [
run_loop()
0 r" F) M* V3 ^9 r: m{6 D! y0 V" w9 H4 o- a
  command=$1
9 B" c, v; R9 n# d4 W- v  shift# y# T  @" N) W

' W, {9 M! ?' a% J1 G' R  if [ x"$VA_FILE" != x"" ] ; then
( o1 g/ \5 i+ M$ }     cmdline=$ARGV- I! T) Y# l& }- t+ R5 y& [
  else
4 ?  W% E, n3 ^1 O" f  b/ x6 i) Y     cmdline=$@- H# D/ b6 ?6 V0 Z; Q
  fi1 {& {7 g! {2 }

: W/ W: {& w9 M  w1 S" _9 o7 A, z  while [ $ret_stat -eq 0 -a -r $LOOP_CTRL_FILE$$ ]; do
# a$ S2 Y! V  f( u/ f. a* W, [    . $LOOP_CTRL_FILE$$% c7 s& J0 ]* B& @8 j
    run_cmd $command $cmdline -banner 29 b3 x, B' _( z5 I/ h, W
  done;6 S# M" a4 P/ a. p3 W% B

. n0 g; s* U! P4 \  if [ $ret_stat -ne 0 -a -r $LOOP_CTRL_FILE$$ ]; then
. @5 o& K' F. E3 r9 Q+ s    rm -f $LOOP_CTRL_FILE$$8 j9 E& v4 D1 Y5 X9 |% |/ Z6 B( }  B
  fi4 f! W/ e4 r% u) p
}$ J0 v- y7 [4 E# d: `" `# Y
  q2 h4 Y* s8 o9 H4 o) b+ G
har_check_ret_stat()
1 A; S0 U1 |% e/ K6 Y% a% l{% _9 H7 Q! j$ N3 J& O: y& N
  if [ $ret_stat -ne 0 ]; then * N# c( _" {- }6 S: Y8 M
    echo "Simulator returned with non-zero exit status. Stopping."
4 D8 Y* P' }3 z$ G% n' u    exit 14 k$ C0 p# E+ i& c- k
  fi
0 y) z) M/ w9 v}
, X5 B4 h9 _+ T- O. d& |/ P6 G  ^# \& ]7 d
#- G& D! b- R) @$ q) ]
# set stacksize and datasize limit& }( z" _  y# _( T+ W1 D
#
) ~4 t6 G, V' Y. f$ V/ T' ^4 Q' c& O/ `5 L( I5 K
set_data_limit
  P% d, l! v/ K7 U7 `2 K6 }! Z! Tset_stack_limit
, s0 z6 Y* u2 Y" X. D2 R( q3 E3 y: L* T; U$ L
#rm -f $LOOP_CTRL_FILE
2 K5 v- _: a& j' N, y$ d- I: }. ^3 t( b; Z- J0 L$ g
run_main()3 `; o; X+ z4 Z2 {9 Q
{3 l! L' V3 k" p, W. w, L# E
if [ $is_special_har_run -eq 1 ]; then" a: }! N' B. T4 a* ]3 y0 P
  if [ "$har_ofile_prefix" = "" ]; then5 S  l) c$ X0 x) n" E7 c
    echo "Wrapper bug. Notify Synopsys technical support."& L/ \, L, A2 I3 B
    exit 1
: G0 b+ `) ]  m7 F" b+ i/ J% a  fi
+ z  q2 A3 ~5 B3 @7 G) D+ r9 A  if [ "$har_hilo_file" = "" ]; then3 D( y- {" Q# K$ ^, ~3 ]
    # no user specified hi lo file - do both runs
5 v% [6 ]6 x: ^( Q, ?8 {9 Q    run_cmd $command $CMDLINE -har_one -har_setup4 a) I: ]' Z# ^8 F+ l+ A
    if [ $ret_stat -ne 126 ]; then
) S; i# {- ]4 \' v. c" Z      har_check_ret_stat
* J/ C; k. w. `      if [ -r $LOOP_CTRL_FILE$$ ]; then
" ?% X: V8 A& v, J2 j        run_loop $command $CMDLINE -har_one -har_sim ${har_ofile_prefix}.hl8 x& G3 h/ H# q+ o5 |
        rm -f ${har_ofile_prefix}.hl7 E* x: u( w; F
      else
# Y  }' w5 H# v: d& x- A# i3 x        run_cmd $command $CMDLINE -har_one -har_rmhilo -har_sim ${har_ofile_prefix}.hl
; d) l- j. U3 h: K; {: T( P2 ?, i      fi
2 ~  ]% i6 k, }7 c3 l# L    else3 C0 d; D5 K; s, [, k1 F1 J
      ret_stat=0
! P# z7 A8 S4 N: |+ L  U3 G' Y$ w$ g    fi
' L( z' H. D9 E7 t% M  else
% |- b/ i' @: I' }    # user gave a hi lo file name
1 e: ]2 S5 i+ B% A# X0 p- N    if [ -f $har_hilo_file -a -s $har_hilo_file ]; then0 h2 V6 `% D2 }! B6 J
      # file exists - use it - only do sim run
3 e) C. b, ?0 V( G( |5 |7 s9 X      run_cmd $command $CMDLINE -har_one -har_ff -har_sim ${har_hilo_file}
8 ~& Q2 V+ o! V& I8 H9 w      run_loop $command $CMDLINE -har_one -har_ff -har_sim ${har_hilo_file}$ [7 E9 [+ S) v! k+ V/ r. D
    else
. R/ P. p& z4 C+ K0 a3 |; f      # no such file - generate it - do both runs
/ U- z. e8 p$ N0 Z" o( U3 z      run_cmd $command $CMDLINE -har_one -har_fnf -har_setup9 {8 V8 `2 k7 R) I0 K" ~5 H' ~, ~3 K
      if [ $ret_stat -ne 126 ]; then8 X; R: f, Z- v2 f& J! D* Q
        har_check_ret_stat. [" Q" P  K9 K" \2 I1 e
        if [ ! -f ${har_ofile_prefix}.hl ]; then( V& I- u/ ?4 a% h# X, }
          echo "No hi lo file generated after setup phase. "
3 u3 {* z2 }; Y0 F- M5 R          echo "Contact Synopsys technical support.", A" Y/ |7 i$ Q
          exit 1* b) t6 o; K( b2 ~* N: ~
        else
) [6 S1 h9 A3 a1 I8 D/ P% [( R) e          if [ ${har_ofile_prefix}.hl != $har_hilo_file ]; then
* n6 Q' R) n! s; \4 B            mv ${har_ofile_prefix}.hl $har_hilo_file2 I& J' @! k- z; V6 N8 j
          fi# @* j9 f% v7 L' R/ y0 g
        fi. x6 p. `9 Z, _/ l( [0 |! a; t
        if [ -r $LOOP_CTRL_FILE$$ ]; then
: b& g' D  m( B  J          run_loop $command $CMDLINE -har_one -har_sim $har_hilo_file
/ l: j4 M5 h5 s9 |  S* u. g+ Z3 L        else
. }( }' m  D6 k2 t8 C: [7 v, Z& \          run_cmd $command $CMDLINE -har_one -har_sim $har_hilo_file7 A5 H2 S3 j7 W) _5 @
        fi
% q1 ~, t( Q6 ]      else
7 @  v/ ~, \0 f+ K        ret_stat=0
# I3 D9 h2 h* C% A      fi
0 E$ {: c7 m' N7 U) o3 f- C    fi
8 a) @; V2 y' J* a, C  fi
# L  a0 R! ]5 `1 ~& Felse  0 T9 P4 r* i3 Q' [  ~
# don't loop if -har_setup; V3 y" I( p5 |; }  `2 G% _
  if [ $have_har_setup_flag -eq 1 ]; then. {& x1 P9 c; H% O; d5 T  K
    run_cmd $command $CMDLINE  n. @7 ?& q7 b3 L1 v
    if [ -r $LOOP_CTRL_FILE$$ ]; then; U  p  k) r% U- e. T+ B
      rm -f $LOOP_CTRL_FILE$$' `% _! s8 J1 g" B
    fi
$ a$ T' N- `/ W' L  else! X' H; z0 `" y0 R
    run_cmd $command $CMDLINE3 R3 d! l! y9 B2 U0 s% J
    run_loop $command $CMDLINE' {- R7 M# s' D1 |/ r
  fi
; J: e$ O! t8 w$ K" P& B4 Q/ [fi& M6 V: l6 T: c% I5 u; B6 Q
  z9 g/ u  m6 M
if [ $ret_stat -eq 0 -a $cmdname = "powrmill" -a $postgres = "y" -a ! -z "$workDir" ]; then
5 R; A/ w- w9 X$ @  U' y  pwCreateErrDB -w $workDir -e $errFile" r5 ]) z* a2 }2 r9 Y" O; g, W0 ]; ^
  ret_stat=$?
- p& D% W: ^$ b) C( Q: dfi6 n! ?( }( I% f5 p
}' ^+ q& N8 O! t9 _4 Q, V( c7 a

5 i7 p, J2 _$ o  G4 {0 z& G0 ~% ocleanup_alter()
3 \  q/ E4 |' G3 R{
6 d" a; v) C/ |   /bin/rm -f $ALTER_COUNT_FILE 1>&2
9 Q: D) Y6 T3 _; e  \   /bin/rm -f $ALTER_HK_FILE 1>&2
/ q! K& U6 Q! n3 @: [& x" V4 x}
/ n; Y* _& g2 M$ U
8 \6 R5 x6 a6 V  u1 N7 h# T3 P#generate alter temp files based on pid0 z) N  p$ D" U) z: m: @: {
ALTER_COUNT_FILE="$ALTER_COUNT_FILE"$$9 \2 O5 c7 Q, |/ p+ b: G
if [ -f $ALTER_COUNT_FILE ]
5 _9 k6 E0 o( H" D! R: g) Mthen   K2 s- N2 y- D" c' z
  until [ ! -f $ALTER_COUNT_FILE ]
, O7 S! V6 O- L. E: |  do8 E+ o" U9 A% C. @! h+ {
    ALTER_COUNT_FILE="$ALTER_COUNT_FILE"$$
: y% d: ~* l5 ~/ O/ u* o; F  done
7 |( S6 z2 b5 b: d" ?* Vfi+ V* h0 U- `$ W
export ALTER_COUNT_FILE2 M' q0 w7 k  G6 l# d6 g

0 |, S2 s' F, J( G" f* lALTER_HK_FILE="$ALTER_HK_FILE"$$
# b: d% k! g2 d7 y$ ^if [ -f $ALTER_HK_FILE ]
6 n$ Y3 t) Y4 r& l: x$ |2 Rthen : d9 F" d2 Y  t* @; W. n
  until [ ! -f $ALTER_HK_FILE ]
" w/ T- G3 h' a3 y  do3 Z2 n5 E5 l8 c5 @, ]+ t
    ALTER_HK_FILE="$ALTER_HK_FILE"$$
" v( T$ s; g0 i6 [+ d  done# J# e; d* X( F4 T
fi
7 t4 [2 A2 x) Z- Dexport ALTER_HK_FILE
: \% I& r$ _" U0 q1 Z$ h9 Y( Q
1 u+ j. f4 N4 C* c#generate monte carlo related temp files based on pid  T* U5 V6 x8 `3 L4 t
cleanup_monte()
9 R  d9 r( Y' X3 b" r, d( c{
: K1 T4 H3 B' k; f* e- w   /bin/rm -f $MONTE_IMG_FILE 1>&25 [; y4 j  \8 @! u5 `
   /bin/rm -f $MONTE_IMG_FILE.gz 1>&24 T( q% b+ `1 Y
   /bin/rm -f $MONTE_COUNT_FILE 1>&2
6 ~! L! P$ {$ S+ q# Y   /bin/rm -f $MONTE_CFG_FILE 1>&2
( J+ G; D9 M3 p}2 q4 o5 P6 e* y
) @! w; b" b9 U9 v, f, }( _
MONTE_COUNT_FILE="$MONTE_COUNT_FILE"$$
  L- k" a% W. J( C) R7 j& wif [ -f $MONTE_COUNT_FILE ]4 w% T7 G' v7 b7 `2 |) l0 W
then
5 C1 m' E! y& t  _  until [ ! -f $MONTE_COUNT_FILE ]
8 ]9 d2 w# t. J  do$ r( e! I; X: ]& i
    MONTE_COUNT_FILE="$MONTE_COUNT_FILE"$$
  j8 _9 W) R$ C  done% n  k! Y: |7 F8 L' f! V
fi
/ F& b$ c& l8 W) L% G5 i, Kexport MONTE_COUNT_FILE
$ e! z! K. ?0 U8 W3 o. i; F: |9 M( l% S5 T0 A+ L$ b) G5 V! ]# F6 F
MONTE_IMG_FILE="$MONTE_IMG_FILE"$$+ `# N' E& ~; ^5 h8 v  L( S
if [ -f $MONTE_IMG_FILE ]
, z+ y6 _( M9 `+ M: q  Q6 O7 ?! ]then5 k/ {9 J2 K, o; k
  until [ ! -f $MONTE_IMG_FILE ]2 ?$ u- b7 ?8 w% {
  do) ?" a4 v, K7 d: ?2 t0 U% K* `' w& ^
    MONTE_IMG_FILE="$MONTE_IMG_FILE"$$- U2 E1 u& ~* O6 I$ x
  done
6 ^( w8 v/ A) ^, g) a2 ]- Jfi+ X8 ]8 v- A. n! x$ D
export MONTE_IMG_FILE
2 g4 b; p6 G1 s" o# e/ W6 Y6 s! X( b/ e. J4 F
MONTE_CFG_FILE="$MONTE_CFG_FILE"$$
, A4 C) G% x4 L& ^5 H" V$ [: ]if [ -f $MONTE_CFG_FILE ]
* h8 v- w; h+ _3 {) Lthen! m1 |2 z0 b9 }+ K% A8 `! H: p* Z2 H
  until [ ! -f $MONTE_CFG_FILE ]: c1 o% _7 b/ j0 f
  do
$ N3 W" I) g8 c, D6 k  u    MONTE_CFG_FILE="$MONTE_CFG_FILE"$$
- Q; [4 b6 L! e5 Q% Q  done3 I5 T# w$ e& G: v* L& b! b
fi/ s+ c* M1 o; Y" g0 [

! F5 E$ A- h, T, I# main iteration
& m$ E! Y" r( f  A9 drun_main( h' |8 `7 ]( O' s
. d8 G0 T. |, I5 d
if [ $ret_stat -ne 0 ]
+ Q, v7 U0 k. L! bthen + Y! R/ |& q' Q! |6 z* P
  cleanup_alter
* `& x# U1 t' E5 F/ |; q* v/ h  cleanup_monte+ v* h  h! m8 {: V9 s# o
  Exit $ret_stat  T" |: F4 b+ `9 H1 i
fi  X& T  X) D# k) p* e' O

. ?" H) k3 F) d* D7 m#Alter related iterations# ~9 M, H1 |0 V$ V5 Y3 A9 d
  z+ p* }* }5 k/ N. ?7 ~7 A$ d# h4 ~9 u
iterations=0
8 A4 `; Z2 i% b+ `, W4 f& |2 }count=0- `! a2 I/ w  w( G6 `# G
if test -s "$ALTER_COUNT_FILE"* f$ f- V* ^6 ~( A) j# @/ v
then
  z. w9 X# {5 c  if [ -r $ALTER_COUNT_FILE ]; then! u% @+ K6 L- @1 F
   exec 7< $ALTER_COUNT_FILE5 F8 h) r  h) e0 m; c+ ?
   read iterations <&7
- q8 t* h) Q2 F0 o fi
% G6 s- D% u; q( R- f$ Ifi
2 t" V" l& o( M/ D% D/ e) `2 Q' Q3 q3 G
trap 'echo Program Interrupt; cleanup_alter; exit 1'  2
: @+ A$ Y; A8 i2 G6 w% Zwhile [ $count -lt $iterations ]
4 l: U. _9 P5 w# _do3 l& f. P8 x# j- Y6 X, r* ?% g* x
count=`expr $count + 1`
+ P0 O8 O4 P1 S1 ]- q ALTER_COUNT=$count* X8 S0 ^) m8 K% S, v
export ALTER_COUNT5 d5 ^: h9 d, f. Y1 C( k7 |

( E; v1 M% Q' j) }# l( _ run_main
9 M# g! m% p# R0 x3 y; O6 c1 [9 |, _: p/ W& H
done
" ~  y! q' a; M% Q( ^: [) m+ T% \) w2 e# U& A& I5 t9 L
#Monte carlo related iterations
% K% o" ]( ~% u7 h# A) G3 s, m& A' k9 C7 \: N+ M
monte_runtime_summary()
0 i- i. e- q; m+ x1 M{
6 |. Q) y; d  M% N  keyword_1=real
* k8 j1 j. N! d  keyword_2=user
, J0 ]) d' f0 m: T  F# o& K  keyword_3=sys: L# n5 @; b9 r: c1 ~( H
  ofile_prefix=nanosim; I, Q2 j7 w8 B3 ?3 H- r5 u3 ]7 c

4 N1 {5 a* d1 D2 z  if [ ! -z "$o_option" ]; then
2 S2 `& S8 h( ~7 v6 g1 Z1 I    logfile=${o_option}.log
" J- h6 z% u; V5 A  else
5 @% B- q2 w7 T) B. G, l' S' r    logfile=${ofile_prefix}.log
; m( }% g5 y1 j  ^4 E  fi* n/ {  F; o' z7 ]1 B" |
# o, R4 O$ r" G' l5 n; @) {
  if [ -f $logfile ]; then
$ M$ k/ P4 P$ j; B    echo "*** Monte Carlo Total Run Time Summary ***" >> $logfile      
- ?: |! U9 F  N0 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) U! u$ r& g$ L3 I5 G' [1 p  fi; l  o& @  x- r8 Z
}0 I, J# Y5 {3 [/ @# T  R

/ c# ]+ U; q, a% wnext_monte=0( L( k( a4 U& b8 H8 [3 X$ k
cur_monte=0
8 k0 C( P( X/ l: j+ Z" f- c8 y7 L9 Y. G. ?
if test -s "$MONTE_COUNT_FILE"
3 C/ ~2 ?) m2 vthen7 U* ]- K/ B' c4 I1 {% G+ p; j
  if [ -r $MONTE_COUNT_FILE ]; then! q7 {2 g( g* N- W; H5 ]! C
   exec 8< $MONTE_COUNT_FILE1 ^; c, |: d- M  S$ b
   read next_monte <&8, n% X4 [( {+ \6 s: L# Q
  fi
0 E: Y' }8 G+ L: i! {+ dfi
8 O. f7 s/ ?4 v6 j
0 @9 l- q2 _1 Q. D9 S. dtrap 'echo Program Interrupt; cleanup_monte; exit 1'  2
4 j; y( ^5 ^" q" o4 ]while [ $next_monte -gt 0 -a $next_monte != $cur_monte ]9 h3 v$ X3 [# R+ K
do
, ?0 Q5 ]7 U- B  NS_CURRENT_MONTE_COUNT=$next_monte
! L/ R* a2 e' S  H' B# d. p  export NS_CURRENT_MONTE_COUNT3 m/ m0 j' j$ W* s4 S8 ?
! ?' g4 V2 s6 l0 P3 D
  echo "restore_ckt_state save_file=$MONTE_IMG_FILE" > $MONTE_CFG_FILE) R; {' X* V; N2 ^- O6 w  O$ N4 q# u3 v
  CMDLINE="$CMDLINE -c $MONTE_CFG_FILE"
* a+ F( _7 e# L5 Z# L+ |  run_main
! h9 d7 n; O3 N* t! z9 d) s7 J
" i5 I' S/ _: j. A# N  cur_monte=$next_monte
  n/ n* g& d. F( u+ ]% J  exec 8< $MONTE_COUNT_FILE+ D2 U( d# D* ]( L, [' |  [$ Q
  read next_monte <&8
1 {" d* x7 ]$ p6 x4 Sdone2 ]& \$ \2 O) ]' |4 E. S. s; ?5 k! v
* F0 X2 `- \& Q& S3 @4 q3 k( `
if [ -f $MONTE_COUNT_FILE ]2 J! G  O! b; }1 m: l0 B
then. k+ y+ Q, R+ h
  monte_runtime_summary4 e5 H/ ], j+ t- l$ g
fi
: P+ }% U0 ^$ `# o3 p" _% o2 p% q6 r( a; H9 A# ?# }2 q6 J: y: ]4 i" Z
cleanup_alter
$ y, g- ]* L  a2 D: ccleanup_monte
* h( u% `, L  N. O/ D1 `& }. Y$ |& l% q5 U: z5 u2 \
Exit $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-3 10:03 PM , Processed in 0.128008 second(s), 15 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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