Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Nested Subcircuits in Spice Scripting

Status
Not open for further replies.

Ahmad Bassam Sayed Ayoub

Newbie level 1
Joined
Jul 22, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
12
Please, I hope if anyone can help me with this error in this script.

I get this error:
Fatal error: b:mos:s: unknown controlling source mos:b1
doAnalyses: No such parameter on this device

I hope if anyone can help me.

Find below the circuit model script.

------------------------------------------------------------------------------------
Code:
xRC Transistor Subcircuit

vgb 1 0 2.5 ac 0.1
vcc 1003 0 5
ro 1003 1000 6e4
*Rso in the amplifier circuit, when zero as it sould it causes unstability.
rs0 1002 0 1
vb 1005 0  0 ac 0
xmos     1003 1002  1005   1  0  VC_MOSFET


*Subcircuit 	 D	S   B	   G	   Gnd				    		
.SUBCKT VC_MOSFET	 2  0101  14  1000  1001
cgd 1 211 15f
cgs 1 0100 15f
cbd 211 14 15f
cbs 0100 14 15f
*Rd in the transistor model
rd 2 211 100
*Rs in the transistor model
rs 0100 0101 100
bd 211 14 I=(-1*I(b2))
bs 14 0100 I=(1*I(b1))


.param nbeff=8E+29u;
.param tox=6E-3u;
.param e0=8.85E-6u;
.param esi=12.1104E+6u;
.param q=1.6E-13u;
.param eox=2.1025E+6u;
.param gamma0={(tox/(eox*e0))*((2*e0*esi*q*nbeff)^0.5)}
.param vfb=-0.42E+6u;
.param dibll=0.00118E+6u;
.param dible=-2.574E+6u;
.param vfbll=0.134E+6u;
.param vfble=-0.79E+6u;
.param csll=-0.0615E+6u;
.param csle=0.801E+6u;
.param leff=2.5u;
.param vfbm={vfb+((vfbll)*(leff)^vfble)}
.param gamma={gamma0*exp((csll)*(leff)^csle)}
.param vt=26E+3u;
.param ni=8.3E+21u;
.param phif={vt*log(nbeff/ni)}
.param vtr={1/vt}
.param gammar={1/(gamma0)^2}
.param alpha=0.07E+6u;
.param beta0=1.109E+6u;
.param z=2u;
.param miodop=541E+2u;
.param vsat=1.23E+11u;
.param n=10;
.param wk={leff/n}
.param cox={eox*e0/tox}
.param a1=alpha
.param a2={(miodop/(wk*vsat))^beta0}
.param a3=beta0
.param a4={((z*miodop)/wk)}
.param a5=cox
.param a6={sqrt(2*q*e0*esi*nbeff)}
.param coxn={(cox*leff*z)/n}
.param cn={(sqrt(q*e0*esi*nbeff/2))*leff*z/n}

b1    3  1001    v=gammar*((v(13,14)-vfb-v(3,1001))^2)-(vt*(exp((v(3,1001)-(2*phif))/vt)))
b2   13  1001    v=gammar*((v(3,14)-vfb-v(13,1001))^2)-(vt*(exp((v(13,1001)-v(211,14)-(2*phif))/vt)))

c11  1  3  coxn
c21  1  4  coxn
c31  1  5  coxn
c41  1  6  coxn
c51  1  7  coxn
c61  1  8  coxn
c71  1  9  coxn
c81  1 10  coxn
c91  1 11  coxn
c101 1 12  coxn

bv1  15 1001 v=sqrt(v(3))
bv2  16 1001 v=sqrt(v(4))
bv3  17 1001 v=sqrt(v(5))
bv4  18 1001 v=sqrt(v(6))
bv5  19 1001 v=sqrt(v(7))
bv6  20 1001 v=sqrt(v(8))
bv7  21 1001 v=sqrt(v(9))
bv8  22 1001 v=sqrt(v(10))
bv9  23 1001 v=sqrt(v(11))
bv10 24 1001 v=sqrt(v(12))

c1   3  14 cn/bv1
c2   4  14 cn/bv2
c3   5  14 cn/bv3
c4   6  14 cn/bv4
c5   7  14 cn/bv5
c6   8  14 cn/bv6
c7   9  14 cn/bv7
c8  10  14 cn/bv8
c9  11  14 cn/bv9
c10 12  14 cn/bv10

xvr     3  4	1000  1001  VC_RES1
xvr1    4  5	1000  1001  VC_RES1
xvr2    5  6	1000  1001  VC_RES1
xvr3    6  7	1000  1001  VC_RES1
xvr4    7  8	1000  1001  VC_RES1
xvr5    8  9  	1000  1001  VC_RES1
xvr6    9 10 	1000  1001  VC_RES1
xvr7   10 11	1000  1001  VC_RES1
xvr8   11 12	1000  1001  VC_RES1
xvr9   12 13	1000  1001  VC_RES1
.ENDS VC_MOSFET


.SUBCKT VC_RES1	500 600	900 800
.param nbeff=8E+29u;
.param tox=6E-3u;
.param e0=8.85E-6u;
.param esi=12.1104E+6u;
.param q=1.6E-13u;
.param eox=2.1025E+6u;
.param gamma0={(tox/(eox*e0))*((2*e0*esi*q*nbeff)^0.5)}
.param vfb=-0.42E+6u;
.param dibll=0.00118E+6u;
.param dible=-2.574E+6u;
.param vfbll=0.134E+6u;
.param vfble=-0.79E+6u;
.param csll=-0.0615E+6u;
.param csle=0.801E+6u;
.param leff=2.5u;
.param vfbm={vfb+((vfbll)*(leff)^vfble)}
.param gamma={gamma0*exp((csll)*(leff)^csle)}
.param vt=26E+3u;
.param ni=8.3E+21u;
.param phif={vt*log(nbeff/ni)}
.param vtr={1/vt}
.param gammar={1/(gamma0)^2}
.param alpha=0.07E+6u;
.param beta0=1.109E+6u;
.param z=2u;
.param miodop=541E+2u;
.param vsat=1.23E+11u;
.param n=10;
.param wk={leff/n}
.param cox={eox*e0/tox}
.param a1=alpha
.param a2={(miodop/(wk*vsat))^beta0}
.param a3=beta0
.param a4={((z*miodop)/wk)}
.param a5=cox
.param a6={sqrt(2*q*e0*esi*nbeff)}
.param coxn={(cox*leff*z)/n}
.param cn={(sqrt(q*e0*esi*nbeff/2))*leff*z/n}
*BRES2	500	700	V=I(Vsense)*((1+(a1*(v(900,800)-v(500))))+((1+(a2*((v(600,500))^(a3))))^(1/a3)))/((a4*abs(a5*(v(900,800)-v(500))))-(a6*(v(500))))	
BRES2	500	700	V=I(VSENSE)*(1)/(a4*abs(a5*(v(900,800)-v(500))))
VSENSE 700	600	0
.ENDS
------------------------------------------------------------------------------------------------------
 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top