微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > RFIC设计学习交流 > 请教一个HSPICE做monte carlo 分析的问题

请教一个HSPICE做monte carlo 分析的问题

时间:10-02 整理:3721RD 点击:
初学
做DC分析
四个电阻
想随机取不同的值 对通过的电流进行DC扫描
看电压

four resistors
.option modmonte=1
.param bias=1m
.param rsheet=agauss(100,5,3)
i1 0 1 bias
i2 0 2 bias
i3 0 3 bias
i4 0 4 bias
r1 1 0 resistor l=10u
r2 2 0 resistor l=10u
r3 3 0 resistor l=10u
r4 4 0 resistor l=10u
.model resistor R w=1u l=3u rsh=rsheet
.op
.dc bias 1m 2m 0.1m sweep monte=1
.print v(1) v(2) v(3) v(4)
.end

结果看到:

*** monte carloindex =1 ***
MODEL PARAMETER MONTE CARLO DEFINITIONS
0:r1
rsheet
resistor=98.23

0:r2
rsheet
resistor=99.77

0:r3
rsheet
resistor=100.3

0:r4
rsheet
resistor=98.24

******
four resistors
******dc transfer curvestnom=25.000 temp=25.000
******
MONTE CARLO PARAMETER DEFINITIONS
rsheet
x
biasvoltagevoltagevoltagevoltage
1234
1.00000m982.3457m997.6751m1.0026982.3688m
1.10000m1.08061.08061.08061.0806
1.20000m1.17881.17881.17881.1788
1.30000m1.27711.27711.27711.2771
1.40000m1.37531.37531.37531.3753
1.50000m1.47361.47361.47361.4736
1.60000m1.57181.57181.57181.5718
1.70000m1.67001.67001.67001.6700
1.80000m1.76831.76831.76831.7683
1.90000m1.86651.86651.86651.8665
2.00000m1.96471.96471.96471.9647
发现电阻值是不同,那应该在DC的每个点上对应不同的电压值,但仿真结果是DC扫描的第一个点4个电压值不同,但之后每个点的值都一样了,不知道是哪里设置的问题,还是语法错误,请指教!
谢谢了

*** monte carloindex =1 ***
MODEL PARAMETER MONTE CARLO DEFINITIONS
******
four resistors
******dc transfer curvestnom=25.000 temp=25.000
******
MONTE CARLO PARAMETER DEFINITIONS
rsheet1
r1=100.8
rsheet2
r2=98.23
rsheet3
r3=99.77
rsheet4
r4=100.3
x
biasvoltagevoltagevoltagevoltage
1234
1.00000m100.7644m98.2346m99.7675m100.2603m
1.10000m110.8408m108.0580m109.7443m110.2863m
1.20000m120.9173m117.8815m119.7210m120.3124m
1.30000m130.9937m127.7049m129.6978m130.3384m
1.40000m141.0701m137.5284m139.6745m140.3644m
1.50000m151.1466m147.3519m149.6513m150.3905m
1.60000m161.2230m157.1753m159.6280m160.4165m
1.70000m171.2994m166.9988m169.6048m170.4425m
1.80000m181.3759m176.8222m179.5815m180.4686m
1.90000m191.4523m186.6457m189.5583m190.4946m
2.00000m201.5288m196.4691m199.5350m200.5206m
y

不知道是不是符合lz的仿真要求
我觉得仅仅做蒙特卡罗分析没什么价值 重要的应该是做最坏情况分析 只是我一直搞不定 如果lz有所研究的话不妨讨论下  

谢谢您的交流!
不过和我的本来想法还有一些差别,因为我想随机的是模型里的某个参数,比如MOS管的Vth0,而不是W或L
我本身的语句里 rsh 是一个模型中的参数*.model resistor R w=1u l=3u rsh=rsheet
而引用resistor这个模型时预设rsheet为变量,随机取值。
而在您的修改中
直接调用了理想电阻,没用模型resistor,理想电阻的阻值是在调用时可以外部修改的,所以如果这样的话,直接设一个rsheet,就可以搞定了
four resistors
.option modmonte=1
.param bias=1m
.param rsheet=agauss(100,5,3)
i1 0 1 bias
i2 0 2 bias
i3 0 3 bias
i4 0 4 bias
r1 1 0 rsheet
r2 2 0 rsheet
r3 3 0 rsheet
r4 4 0 rsheet
.op
.dc bias 1m 2m 0.1m sweep monte=1
.print v(1) v(2) v(3) v(4)
.end
结果
rsheet
r1=100.8r2=98.23
r3=99.77r4=100.3
x
biasvoltagevoltagevoltagevoltage
1234
1.00000m100.7644m98.2346m99.7675m100.2603m
1.10000m110.8408m108.0580m109.7443m110.2863m
1.20000m120.9173m117.8815m119.7210m120.3124m
1.30000m130.9937m127.7049m129.6978m130.3384m
1.40000m141.0701m137.5284m139.6745m140.3644m
1.50000m151.1466m147.3519m149.6513m150.3905m
1.60000m161.2230m157.1753m159.6280m160.4165m
1.70000m171.2994m166.9988m169.6048m170.4425m
1.80000m181.3759m176.8222m179.5815m180.4686m
1.90000m191.4523m186.6457m189.5583m190.4946m
2.00000m201.5288m196.4691m199.5350m200.5206m
或许讨论电阻没什么明显的意义。
所以我想问的是MOS管,在做MC分析的时候,由于引用一个MOS模型时,自己能修改的量是W和L,这个可以随机,比如:
.PARAMXW=GAUSS(10u,0.01,3)
M1 1 2 3 4 n18 L=0.5u W=XW
但是,对于Vth0,如果也想随机的话,一般怎末设置?
我没有什么好办法,只能去修改库,比如:
库里有VTH0= '0.401815+DVTH_N18'
我自己又加了一项 VTH0= '0.401815+DVTH_N18+XVTH_0'
然后在外部随机 'XVTH_0'
但是在应用中
如果有M1 M2 两个管子都用这个模型
由于已经加了modmonte=1
在瞬态仿真中,可以随机出两个不同的VTH0,
但在DC扫面时,就发现类似前述的电阻的问题,算第一个点取不同VTH0,后面的点又相同了,而我希望的是一直按不同的VTH0计算所有点。
不知道是什么问题,希望能跟您交流!

对worst case分析,我了解的不多,我选择做MC分析的原因是想在系统中引入随机的失调误差,然后利用校准模块去校准,比如比较器的输入对管M1,M2,MC分析可以产生随机的VHT1 VTH2,可能引起比较器的误翻转.
而对worst case分析,我个人理解其结果是使M1,M2两管最慢,但两管还是没有失调,只能影响比较器速度,我了解不多,不知道worst case分析能不能产生失调等非理想因素,如果可以的话,请您指点一下,我可以试试,呵呵!

luguo luguo xuexi zhong

这个帖子好顶起来 希望大家继续讨论

为什么不看manual呢

对于Vth0,如果也想随机,可以在gate上串联一个 高斯分布的vth_shift

monte

这个TOPIC我喜欢,希望更多的人能参与讨论哈

多谢小编,学习了

好东西啊

感谢小编,受教了~

hi guys
thanks to eetop and its cool member i finally find standard tsmc 65nm hspice PDK
but my problem is i dont know how to do monte carlo analysis with it
the library name is "crn65lp_2d5_lk_v1d7.l" you can find it easlly in eetop
can any of you guys give me an example on it plz?

LZ有解决吗?无论的Resistance还是MOS,如果将变量定义在了Model card中,做MC分析,每次仿真都是调用同一个数值,所以仿真出来的结果一样。
我也期待大牛解答。希望大家积极讨论。

Hi, there
Re-ran your simulation using completely identical netlist copied 'n pasted from your thread directly with hspice version 2012.06-sp1
********Monte=1
MODEL PARAMETER MONTE CARLO DEFINITIONS
00
0:r1
rsheet
resistor=98.23

00
0:r2
rsheet
resistor=99.77

00
0:r3
rsheet
resistor=100.3

00
0:r4
rsheet
resistor=98.24
******
four resistors
******dc transfer curves tnom=25.000 temp=25.000 *****
MONTE CARLO PARAMETER DEFINITIONS
rsheet
x
biasvoltagevoltagevoltagevoltage
1234
1.00000m982.3457m997.6751m1.0026982.3688m
1.10000m1.08061.09741.10291.0806
1.20000m1.17881.19721.20311.1788
1.30000m1.27701.29701.30341.2771
1.40000m1.37531.39671.40361.3753
1.50000m1.47351.49651.50391.4736
1.60000m1.57181.59631.60421.5718
1.70000m1.67001.69601.70441.6700
1.80000m1.76821.79581.80471.7683
1.90000m1.86651.89561.90491.8665
2.00000m1.96471.99542.00521.9647
y

********Monte=2
*** monte carloindex =1 ***
MODEL PARAMETER MONTE CARLO DEFINITIONS
00
0:r1
rsheet
resistor=98.23

00
0:r2
rsheet
resistor=99.77

00
0:r3
rsheet
resistor=100.3

00
0:r4
rsheet
resistor=98.24
******
four resistors
******dc transfer curves tnom=25.000 temp=25.000 *****
MONTE CARLO PARAMETER DEFINITIONS
rsheet
x
biasvoltagevoltagevoltagevoltage
1234
1.00000m982.3457m997.6751m1.0026982.3688m
1.10000m1.08061.09741.10291.0806
1.20000m1.17881.19721.20311.1788
1.30000m1.27701.29701.30341.2771
1.40000m1.37531.39671.40361.3753
1.50000m1.47351.49651.50391.4736
1.60000m1.57181.59631.60421.5718
1.70000m1.67001.69601.70441.6700
1.80000m1.76821.79581.80471.7683
1.90000m1.86651.89561.90491.8665
2.00000m1.96471.99542.00521.9647
y
-----------------------------------------------
*** monte carloindex =2 ***
MODEL PARAMETER MONTE CARLO DEFINITIONS
00
0:r1
rsheet
resistor=97.98

00
0:r2
rsheet
resistor=101.9

00
0:r3
rsheet
resistor=101.8

00
0:r4
rsheet
resistor=98.24
MONTE CARLO PARAMETER DEFINITIONS
rsheet
x
biasvoltagevoltagevoltagevoltage
1234
1.00000m979.7572m1.01861.0184982.4214m
1.10000m1.07771.12041.12021.0807
1.20000m1.17571.22231.22201.1789
1.30000m1.27371.32421.32391.2771
1.40000m1.37171.42601.42571.3754
1.50000m1.46961.52791.52761.4736
1.60000m1.56761.62971.62941.5719
1.70000m1.66561.73161.73121.6701
1.80000m1.76361.83351.83311.7684
1.90000m1.86151.93531.93491.8666
2.00000m1.95952.03722.03671.9648
y
Thanks

这个帖子好顶起来 希望大家继续讨论

这个帖子不错。小编可以找找文献看看worst仿真

who know it?!

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

网站地图

Top