微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 天线设计和射频技术 > finding max number with .alter in hspice+help

finding max number with .alter in hspice+help

时间:04-05 整理:3721RD 点击:
hello
i want to find maximum delay with hspice, i get different inputs with .alter to a gate and calculate its delay and compare to perivious delay, but the older results replaced with the new result when get second inputs with .alter? why this accure?
can someone help me? thanks.


my code is:
*Netlist for your Schematic
.param y=1.8
.global _VDD
V_VDD _VDD 0 y
***************inv********************
.subckt inv01 out in _VDD
M_1 out in 0 0 NENH W=1u L=.18u
M_2 out in _VDD _VDD PENH W=2u L=.18u
.ends
.subckt nand02 out in1 in2 _VDD
M_7 out in1 _VDD _VDD PENH W=2u L=180n
M_8 out in2 _VDD _VDD PENH W=2u L=180n
M_9 _3 in2 0 0 NENH W=1u L=180n
M_11 out in1 _3 0 NENH W=1u L=180n
.ends
.subckt nand03 out in_1 in_2 in_3 _VDD
M_7 out in_1 _VDD _VDD PENH W=2u L=180n
M_8 out in_2 _VDD _VDD PENH W=2u L=180n
M_6 out in_3 _VDD _VDD PENH W=2u L=180n
M_12 out in_1 _6 0 NENH W=1u L=180n
M_11 _6 in_2 _3 0 NENH W=1u L=180n
M_9 _3 in_3 0 0 NENH W=1u L=180n
.ends
.subckt nand04 out in_1 in_2 in_3 in_4 _VDD
M_7 out in_1 _VDD _VDD PENH W=2u L=180n
M_8 out in_2 _VDD _VDD PENH W=2u L=180n
M_6 out in_3 _VDD _VDD PENH W=2u L=180n
M_5 out in_4 _VDD _VDD PENH W=2u L=180n
M_12 out in_1 _6 0 NENH W=1u L=180n
M_11 _6 in_2 _3 0 NENH W=1u L=180n
M_9 _3 in_3 _1 0 NENH W=1u L=180n
M_10 _1 in_4 0 0 NENH W=1u L=180n
.ends
***************NORS*******************
.subckt nor02 out in_1 in_2 _VDD
M_7 _3 in_1 _VDD _VDD PENH W=2u L=180n
M_8 out in_2 _3 _VDD PENH W=2u L=180n
M_9 out in_1 0 0 NENH W=1u L=180n
M_1 out in_2 0 0 NENH W=1u L=180n
.ends
.subckt nor03 out in_1 in_2 in_3 _VDD
M_7 _1 in_1 _VDD _VDD PENH W=2u L=180n
M_8 _3 in_2 _1 _VDD PENH W=2u L=180n
M_6 out in_3 _3 _VDD PENH W=2u L=180n
M_9 out in_1 0 0 NENH W=1u L=180n
M_1 out in_2 0 0 NENH W=1u L=180n
M_2 out in_3 0 0 NENH W=1u L=180n
.ends
.subckt nor04 out in_1 in_2 in_3 in_4 _VDD
M_7 _1 in_1 _VDD _VDD PENH W=2u L=180n
M_8 _3 in_2 _1 _VDD PENH W=2u L=180n
M_6 _6 in_3 _3 _VDD PENH W=2u L=180n
M_5 out in_4 _6 _VDD PENH W=2u L=180n
M_9 out in_1 0 0 NENH W=1u L=180n
M_1 out in_2 0 0 NENH W=1u L=180n
M_2 out in_3 0 0 NENH W=1u L=180n
M_3 out in_4 0 0 NENH W=1u L=180n
.ends
x0 8 7 _VDD inv01
x1 9 6 _VDD inv01
x2 10 5 _VDD inv01
x3 11 4 _VDD inv01
x4 12 3 _VDD inv01
x5 13 2 _VDD inv01
x6 14 1 _VDD inv01
x7 15 0 _VDD inv01
x8 16 8 9 _VDD nand02
x9 17 7 6 _VDD nand02
x10 18 10 11 _VDD nand02
x11 19 5 4 _VDD nand02
x12 20 12 13 _VDD nand02
x13 21 3 2 _VDD nand02
x14 22 14 15 _VDD nand02
x15 23 1 0 _VDD nand02
x16 24 16 17 _VDD nand02
x17 25 17 7 _VDD nand02
x18 26 17 6 _VDD nand02
x19 27 18 19 _VDD nand02
x20 28 19 5 _VDD nand02
x21 29 19 4 _VDD nand02
x22 30 20 21 _VDD nand02
x23 31 21 3 _VDD nand02
x24 32 21 2 _VDD nand02
x25 33 22 23 _VDD nand02
x26 34 23 1 _VDD nand02
x27 35 23 0 _VDD nand02
x28 36 25 _VDD inv01
x29 37 26 _VDD inv01
x30 38 28 _VDD inv01
x31 39 29 _VDD inv01
x32 40 31 _VDD inv01
x33 41 32 _VDD inv01
x34 42 34 _VDD inv01
x35 43 35 _VDD inv01
x36 44 24 38 _VDD nand02
x37 45 24 39 _VDD nand02
x38 46 24 27 40 _VDD nand03
x39 47 24 27 41 _VDD nand03
x40 48 24 27 30 42 _VDD nand04
x41 49 24 27 30 43 _VDD nand04
x42 50 24 27 30 33 _VDD nand04
x43 51 44 _VDD inv01
x44 52 45 _VDD inv01
x45 53 46 _VDD inv01
x46 54 47 _VDD inv01
x47 55 48 _VDD inv01
x48 56 49 _VDD inv01
x49 57 50 _VDD inv01
x50 58 36 51 53 55 _VDD nor04
x51 59 37 52 54 56 _VDD nor04
x52 60 58 _VDD inv01
x53 61 59 _VDD inv01
.MODEL NENH NMOS (LEVEL = 49
+VERSION = 3.1 TNOM = 27 TOX = 4.1E-9
+XJ = 1E-7 NCH = 2.3549E17 VTH0 = 0.3932664
+K1 = 0.5826058 K2 = 6.016593E-3 K3 = 1E-3
+K3B = 1.4046112 W0 = 1E-7 NLX = 1.755425E-7
+DVT0W = 0 DVT1W = 0 DVT2W = 0
+DVT0 = 1.3156832 DVT1 = 0.397759 DVT2 = 0.0615187
+U0 = 280.5758609 UA = -1.208176E-9 UB = 2.159494E-18
+UC = 5.340577E-11 VSAT = 9.601364E4 A0 = 1.7852987
+AGS = 0.4008594 B0 = -3.73715E-9 B1 = -1E-7
+KETA = -1.136459E-3 A1 = 2.580625E-4 A2 = 0.9802522
+RDSW = 105.472458 PRWG = 0.5 PRWB = -0.2
+WR = 1 WINT = 0 LINT = 1.571909E-8
+XL = 0 XW = -1E-8 DWG = -7.918114E-9
+DWB = -3.223301E-9 VOFF = -0.0956759 NFACTOR = 2.4447616
+CIT = 0 CDSC = 2.4E-4 CDSCD = 0
+CDSCB = 0 ETA0 = 2.489084E-3 ETAB = -2.143433E-5
+DSUB = 0.0140178 PCLM = 0.7533987 PDIBLC1 = 0.1966545
+PDIBLC2 = 3.366782E-3 PDIBLCB = -0.1 DROUT = 0.7760158
+PSCBE1 = 8E10 PSCBE2 = 9.204421E-10 PVAG = 5.676338E-3
+DELTA = 0.01 RSH = 6.5 MOBMOD = 1
+PRT = 0 UTE = -1.5 KT1 = -0.11
+KT1L = 0 KT2 = 0.022 UA1 = 4.31E-9
+UB1 = -7.61E-18 UC1 = -5.6E-11 AT = 3.3E4
+WL = 0 WLN = 1 WW = 0
+WWN = 1 WWL = 0 LL = 0
+LLN = 1 LW = 0 LWN = 1
+LWL = 0 CAPMOD = 2 XPART = 0.5
+CGDO = 7.83E-10 CGSO = 7.83E-10 CGBO = 1E-12
+CJ = 9.969364E-4 PB = 0.8 MJ = 0.376826
+CJSW = 2.618614E-10 PBSW = 0.8321894 MJSW = 0.1020453
+CJSWG = 3.3E-10 PBSWG = 0.8321894 MJSWG = 0.1020453
+CF = 0 PVTH0 = -1.428269E-3 PRDSW = -4.3383092
+PK2 = 8.440537E-5 WKETA = 2.341504E-3 LKETA = -9.397952E-3
+PU0 = 15.2496815 PUA = 5.74703E-11 PUB = 1.593698E-23
+PVSAT = 857.5761302 PETA0 = 1.003159E-4 PKETA = -1.378026E-3)
.MODEL PENH PMOS (LEVEL = 49
+VERSION = 3.1 TNOM = 27 TOX = 4.1E-9
+XJ = 1E-7 NCH = 4.1589E17 VTH0 = -0.4045149
+K1 = 0.5513831 K2 = 0.0395421 K3 = 0
+K3B = 5.7116064 W0 = 1.003172E-6 NLX = 1.239563E-7
+DVT0W = 0 DVT1W = 0 DVT2W = 0
+DVT0 = 0.6078076 DVT1 = 0.2442982 DVT2 = 0.1
+U0 = 116.1690772 UA = 1.536496E-9 UB = 1.17056E-21
+UC = -9.96841E-11 VSAT = 1.324749E5 A0 = 1.9705728
+AGS = 0.4302931 B0 = 2.927795E-7 B1 = 6.182094E-7
+KETA = 2.115388E-3 A1 = 0.6455562 A2 = 0.3778114
+RDSW = 168.4877597 PRWG = 0.5 PRWB = -0.4990495
+WR = 1 WINT = 0 LINT = 3.029442E-8
+XL = 0 XW = -1E-8 DWG = -3.144339E-8
+DWB = -1.323608E-8 VOFF = -0.1008469 NFACTOR = 1.9293877
+CIT = 0 CDSC = 2.4E-4 CDSCD = 0
+CDSCB = 0 ETA0 = 0.0719385 ETAB = -0.0594662
+DSUB = 0.7367007 PCLM = 1.0462908 PDIBLC1 = 2.709018E-4
+PDIBLC2 = 0.0326163 PDIBLCB = -1E-3 DROUT = 9.231736E-4
+PSCBE1 = 1.060432E10 PSCBE2 = 3.062774E-9 PVAG = 15.0473867
+DELTA = 0.01 RSH = 7.6 MOBMOD = 1
+PRT = 0 UTE = -1.5 KT1 = -0.11
+KT1L = 0 KT2 = 0.022 UA1 = 4.31E-9
+UB1 = -7.61E-18 UC1 = -5.6E-11 AT = 3.3E4
+WL = 0 WLN = 1 WW = 0
+WWN = 1 WWL = 0 LL = 0
+LLN = 1 LW = 0 LWN = 1
+LWL = 0 CAPMOD = 2 XPART = 0.5
+CGDO = 6.54E-10 CGSO = 6.54E-10 CGBO = 1E-12
+CJ = 1.154124E-3 PB = 0.8414529 MJ = 0.406705
+CJSW = 2.50766E-10 PBSW = 0.8 MJSW = 0.3350647
+CJSWG = 4.22E-10 PBSWG = 0.8 MJSWG = 0.3350647
+CF = 0 PVTH0 = 2.252845E-3 PRDSW = 7.5306858
+PK2 = 1.57704E-3 WKETA = 0.0355518 LKETA = 7.806536E-3
+PU0 = -1.6701992 PUA = -5.63495E-11 PUB = 1E-21
+PVSAT = 49.8423856 PETA0 = 9.968409E-5 PKETA = -3.957099E-3)

.op
.tran 0.001ns 5ns
.meas tran tpLH trig v(7) val='0.5*y' TD=.5n rise =1
+ targ v(8) val='0.5*y' fall =1
.meas tran tpHL trig v(7) val='0.5*y' TD=.5n fall =1
+ targ v(8) val='0.5*y' rise =1
.meas tran tp param='((tpLH+tpHL)/2)'

.alter case1
v_1 7 0 DC=1.8 PULSE(0 'y' 2.45n .001n .001n 2.45n 5n)
.meas tran tmax1 param='tp'

.alter case2
.meas tran tmax2 param='(tp>tmax1)?tp:tmax1'
v_1 7 0 DC=1.8 PULSE('y' 0 2.45n .001n .001n 2.45n 5n)

.end

and the result is:
case1

****** transient analysis tnom= 25.000 temp= 25.000 *****
tplh= 2.0612E-11 targ= 2.4711E-09 trig= 2.4505E-09
tphl= 2.4429E-11 targ= 4.9259E-09 trig= 4.9015E-09
tp= 2.2521E-11
tmax1= 2.2521E-11
case2

****** transient analysis tnom= 25.000 temp= 25.000 *****
tplh= 2.0514E-11 targ= 4.9220E-09 trig= 4.9015E-09
tphl= 2.4500E-11 targ= 2.4750E-09 trig= 2.4505E-09
tp= 2.2507E-11
tmax1= 2.2507E-11
tmax2= 2.2507E-11

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top