How do you change model parameters for every transistor.

17 views
Skip to first unread message

Mehmet Cirit

unread,
May 26, 2026, 10:22:23 PM (7 days ago) May 26
to xyce-users
Is there a shorter way to do this other than creating a specific model
Name for each instance? 

I tried

.subckt X a b c d vto=1
.model Y nmos vto='vto'
m  a b c d Y l=1 w=2
.ends

It does  seem to use vto1 = 1 irrespective of how I set it. Doesn't embedding the model in a sub circuit make it a private model?

Thanks

--

Dr. Mehmet A. Cirit                    Phone:  (408) 647-6025
Library Technologies, Inc.        Cell:       (408) 647-6025
19959 Lanark Lane                   http://www.libtech.com
Saratoga, CA 95070                 Email: m...@libtech.com

Thomas Russo

unread,
May 26, 2026, 10:43:55 PM (7 days ago) May 26
to xyce-users
It is indeed supposed to be the case that if you embed a model card inside a subckt model, that the model is local to the subcircuit instance and should respect the model parameters.

In fact, I tested it out by copying a subcircuit netlist from Xyce_Regression/Netlists/SUBCKT/subckt_a1.cir and modifying it to do just that, and it clearly does use the parameter passed in as the VTO.  

```
TEST A1 of subcircuit regression tests

.subckt INV1 IN OUT VDD GND VTO=1.6
.MODEL cd4012_nmos NMOS (
+ LEVEL = 3 UO = 190   VTO = 'VTO'   TOX = 6E-08   NSUB = 8.601E+15
+ NSS = 0   RS = 13.21   RD = 11.59   RSH = 0   IS = 1E-14
+ VMAX = 4.206E+04 NFS=1E10  GAMMA=0.37 PHI=0.65
+ XJ = 7.1E-06   LD = 8.6E-07   DELTA = 0   THETA = 0.0021   ETA = 0.057   KAPPA = 0.15
+ KP = 2.161E-05  L=5u W=175u
+ CBD=0.1P CBS=0.1P PB=0.81 CGSO=2P CGBO=4P CGDO=2P CJ=2E-4 MJ=0.5 CJSW=1E-9
+ MJSW=0.5 JS=1E-8 TPG=0 KF=1E-25 AF=1 FC=0.5 TNOM=27)
.MODEL cd4012_pmos PMOS (
+ LEVEL = 3  UO = 310  VTO = '-VTO'  TOX = 6E-08  NSUB = 5.701E+15
+ NSS = 0    VMAX = 5.374E+04   RS = 5.359   RD = 93.66   RSH = 0   IS = 1E-14
+ XJ = 7.9E-06   LD = 3E-08   DELTA = 0   THETA = 0.0278   ETA = 0.535   KAPPA = 0.643
+ KP = 1.711E-05 L=5u W=270u GAMMA=0.37 PHI=0.65 NFS=1E10
+ CBD=0.1P CBS=0.1P PB=0.81 CGSO=2P CGBO=4P CGDO=2P CJ=2E-4 MJ=0.5 CJSW=1E-9
+ MJSW=0.5 JS=1E-8 TPG=0 KF=1E-25 AF=1 FC=0.5 TNOM=27)

MN1 OUT IN GND GND CD4012_NMOS L=5u W=175u
MP1 OUT IN VDD VDD CD4012_PMOS L=5u W=270u
.ends

Xinv1 IN MID VDD 0 INV1 VTO=1.6
Xinv2 MID OUT VDD 0 INV1 VTO=1.0
VDDdev VDD 0 5V
RIN IN 1 1K
VIN1  1 0  5V PULSE (5V 0V 1.5us 5ns 5ns 1.5us 3.01us)
R1    OUT  0  10K
C2    OUT  0  0.1p

.op
.tran 20ns 30us
.print tran PRECISION=10 WIDTH=19 v(out) v(in) v(1)


.end
```

If one runs this, one gets the .op output that shows 1.6/-1.6 being used for VTO in the XINV1 mosfets and 1.0/-1.0 in the XINV2 mosfets:
```
Number of MOSFET level 3 models: 4
          name XINV1:CD4012_NMOSXINV1:CD4012_PMOSXINV2:CD4012_NMOSXINV2:CD4012_PMOS
          type            NMOS           PMOS           NMOS           PMOS
         level               3              3              3              3
...
            VTO            1.6           -1.6              1             -1
...
```

Tom Russo

unread,
May 26, 2026, 10:53:17 PM (7 days ago) May 26
to xyce-users
I should also note that the Xyce regression test Xyce_Regression/Netlists/SUBCKT/subckt_a4.cir already has such a test, which is compared against a baseline (subckt_a0) that uses two different pairs of model cards with different VTOs:
```
TEST A4 of subcircuit regression tests
* **********************************************************************
* A simple pair of MOSFET level 3 inverters
* The inverters are constructed from dissimilar mosfets, just for testing
* purposes
*
* Test A4 uses a single inverter subcircuit with a model statement that
* includes parameters from the subcircuit line. It also uses parameters for
* the widths of the N and P mosfets.  By construction it should be identical
* to case A0
*
* Author:   $Author$
* Revision: $Revision$
* Date:     $Date$
*
* **********************************************************************

.subckt INV1 IN OUT VDD GND PARAMS: WN=100u WP=200u VTON=1.679 VTOP=-1.6
MN1 OUT IN GND GND CD4012_NMOS L=5u W={WN}
MP1 OUT IN VDD VDD CD4012_PMOS L=5u W={WP}
***** original mosfets
.MODEL cd4012_nmos NMOS (
+ LEVEL = 3 UO = 190   VTO = {VTON}   TOX = 6E-08   NSUB = 8.601E+15

+ NSS = 0   RS = 13.21   RD = 11.59   RSH = 0   IS = 1E-14
+ VMAX = 4.206E+04 NFS=1E10  GAMMA=0.37 PHI=0.65
+ XJ = 7.1E-06   LD = 8.6E-07   DELTA = 0   THETA = 0.0021   ETA = 0.057   KAPPA = 0.15
+ KP = 2.161E-05  L=5u W=175u
+ CBD=0.1P CBS=0.1P PB=0.81 CGSO=2P CGBO=4P CGDO=2P CJ=2E-4 MJ=0.5 CJSW=1E-9
+ MJSW=0.5 JS=1E-8 TPG=0 KF=1E-25 AF=1 FC=0.5 TNOM=27)
.MODEL cd4012_pmos PMOS (
+ LEVEL = 3  UO = 310  VTO = {VTOP}  TOX = 6E-08  NSUB = 5.701E+15

+ NSS = 0    VMAX = 5.374E+04   RS = 5.359   RD = 93.66   RSH = 0   IS = 1E-14
+ XJ = 7.9E-06   LD = 3E-08   DELTA = 0   THETA = 0.0278   ETA = 0.535   KAPPA = 0.643+ KP = 1.711E-05 L=5u W=270u GAMMA=0.37 PHI=0.65 NFS=1E10

+ CBD=0.1P CBS=0.1P PB=0.81 CGSO=2P CGBO=4P CGDO=2P CJ=2E-4 MJ=0.5 CJSW=1E-9
+ MJSW=0.5 JS=1E-8 TPG=0 KF=1E-25 AF=1 FC=0.5 TNOM=27)
.ends


Xinv1 IN MID VDD 0 INV1 PARAMS: WN=175u WP=270u
Xinv2 MID OUT VDD 0 INV1 PARAMS: WN=175u WP=270u VTON=1.0 VTOP=-1.0

VDDdev  VDD     0       5V
RIN     IN      1       1K
VIN1  1 0  5V PULSE (5V 0V 1.5us 5ns 5ns 1.5us 3.01us)
R1    OUT  0  10K  
C2    OUT  0  0.1p

.tran 20ns 30us
.print tran PRECISION=10 WIDTH=19 v(out) v(in) v(1)


.end
```

So it does at least work when used this way.


--
You received this message because you are subscribed to the Google Groups "xyce-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xyce-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/xyce-users/fc71f45a-46ba-4ae9-9c5e-31c5b634a65fn%40googlegroups.com.


Mehmet Cirit

unread,
May 27, 2026, 2:19:12 AM (7 days ago) May 27
to Tom Russo, xyce-users
Thanks, Tom. Your support is much appreciated. It was my mistake. I was checking if the simulation results would change after making some changes in the process models. I was changing the wrong parameter, which had no effect on the simulation.

I also use some commercial simulators. It takes a few days to months to get a response. You are amazing.

Reply all
Reply to author
Forward
0 new messages