Monday, December 13, 2004

A stupid problem I faced during a spice simulation

* inverter subckt
.SUBCKT NOT1_911 vdd gnd bn bp in out w_n='9*WN' w_p='9*WP'
MP out in vdd bp PMOS_1 W='w_p' L=0.07u AD='0.1u*w_p' PD='2*(0.1u+w_p)' AS='0.1u*w_p' PS='2*(0.1u+w_p)'
MN out in gnd bn NMOS_1 W='w_n' L=0.07u AD='0.1u*w_n' PD='2*(0.1u+w_n)' AS='0.1u*w_n' PS='2*(0.1u+w_n)'
.ENDS NOT1_911

* level converter sub_ckt
.SUBCKT LVLCON vddh vddl gnd in out w_n='1*WN' w_p='1*WP'
$mos PMOS_1 MP1 int1 out vddh vddh $p1*w_p 0.1u
$mos PMOS_1 MP2 out int1 vddh vddh $p2*w_p 0.1u
$mos NMOS_1 MN1 int1 in gnd gnd $n1*w_n 0.1u
$mos NMOS_1 MN2 out int2 gnd gnd $n2*w_n 0.1u
$cir_cmos NOT1_911 XINV vddl gnd gnd vddl in int2
.ENDS LVLCON

The inverter inside the level converter always gets w_n=WN and w_p=WP instead of the values I give in the subckt NOT1_911. I think it is because the parameter names are same for both subckts and it creates some kind of a confusion.

0 Comments:

Post a Comment

<< Home