santoshchiniwar
Junior Member level 1
hi all
I wanted to vary subcircuit parameter (CMOS) width in hspice...
i have writtern NAND as subcircuit which is called in some other circuit know i have initiated .param width_n and width_p as nmos and pmos width respectively, now i wanted to vary this parameter from other circuit, As shown in the following code. Please correct me if i am wrong in this code ...
.SUBCKT Nand Y A B VDD GND
.param width_N
.param width_P
Mp1 Y A VDD VDD CMOSP L=0.18u W=width_P
Mp2 Y B VDD VDD CMOSP L=0.18u W=width_P
Mn1 Y A X GND CMOSN L=0.18u W=width_N
Mn2 X B GND GND CMOSN L=0.18u W=width_N
.ENDS
** Nand Gates Description
X1 P A B VDD GND Nand
X2 Q A P VDD GND Nand
X3 R B P VDD GND Nand
X4 S Q R VDD GND Nand
X5 C P P VDD GND Nand
VDD VDD GND dc 5v
VA A GND PULSE(0 5 0 0 0 5n 40n)
VB B GND PULSE(0 5 0 0 0 10n 40n)
** Analysis
.TRAN 200p 20n
** Output
.PRINT TRAN V(A) V(B) V(S) V(C)
.alter width 360e-9
width width_N=360e-9 width_P=430e-9
.END
I wanted to vary subcircuit parameter (CMOS) width in hspice...
i have writtern NAND as subcircuit which is called in some other circuit know i have initiated .param width_n and width_p as nmos and pmos width respectively, now i wanted to vary this parameter from other circuit, As shown in the following code. Please correct me if i am wrong in this code ...
.SUBCKT Nand Y A B VDD GND
.param width_N
.param width_P
Mp1 Y A VDD VDD CMOSP L=0.18u W=width_P
Mp2 Y B VDD VDD CMOSP L=0.18u W=width_P
Mn1 Y A X GND CMOSN L=0.18u W=width_N
Mn2 X B GND GND CMOSN L=0.18u W=width_N
.ENDS
** Nand Gates Description
X1 P A B VDD GND Nand
X2 Q A P VDD GND Nand
X3 R B P VDD GND Nand
X4 S Q R VDD GND Nand
X5 C P P VDD GND Nand
VDD VDD GND dc 5v
VA A GND PULSE(0 5 0 0 0 5n 40n)
VB B GND PULSE(0 5 0 0 0 10n 40n)
** Analysis
.TRAN 200p 20n
** Output
.PRINT TRAN V(A) V(B) V(S) V(C)
.alter width 360e-9
width width_N=360e-9 width_P=430e-9
.END