From 3e6a46826b281d56db031a279710e1fde5b9b32b Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Mon, 2 Apr 2018 11:02:27 +0200 Subject: [PATCH] add src/spicelib/devices/vdmos to ngspice --- src/spicelib/devices/dev.c | 2 ++ src/spicelib/devices/vdmos/vdmos.c | 1 + src/spicelib/devices/vdmos/vdmosdefs.h | 2 +- src/spicelib/devices/vdmos/vdmosinit.c | 4 ++-- src/spicelib/devices/vdmos/vdmosload.c | 1 + src/spicelib/parser/inp2m.c | 3 ++- src/spicelib/parser/inpdomod.c | 13 +++++++++++++ 7 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index a4c7bc6b7..a814e6cc0 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -119,6 +119,7 @@ int add_udn(int,Evt_Udn_Info_t **); #include "vccs/vccsitf.h" #include "vcvs/vcvsitf.h" #include "vsrc/vsrcitf.h" +#include "vdmos/vdmositf.h" #ifdef ADMS #include "adms/hicum0/hicum0itf.h" #include "adms/hicum2/hicum2itf.h" @@ -190,6 +191,7 @@ static SPICEdev *(*static_devices[])(void) = { get_vccs_info, get_vcvs_info, get_vsrc_info, + get_vdmos_info, #ifdef CIDER get_nbjt_info, diff --git a/src/spicelib/devices/vdmos/vdmos.c b/src/spicelib/devices/vdmos/vdmos.c index 264ce35f0..10c3a9086 100644 --- a/src/spicelib/devices/vdmos/vdmos.c +++ b/src/spicelib/devices/vdmos/vdmos.c @@ -2,6 +2,7 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1987 Thomas L. Quarles Modified: 2000 AlansFixes +VDMOS Model: 2018 Holger Vogt **********/ #include "ngspice/ngspice.h" diff --git a/src/spicelib/devices/vdmos/vdmosdefs.h b/src/spicelib/devices/vdmos/vdmosdefs.h index 5a7bdd19a..e7fc33e00 100644 --- a/src/spicelib/devices/vdmos/vdmosdefs.h +++ b/src/spicelib/devices/vdmos/vdmosdefs.h @@ -13,7 +13,7 @@ Modified: 2000 AlansFixes #include "ngspice/complex.h" #include "ngspice/noisedef.h" -/* declarations for level 1 MOSFETs */ +/* declarations for VDMOSFETs */ /* indices to the array of MOSFET(1) noise sources */ diff --git a/src/spicelib/devices/vdmos/vdmosinit.c b/src/spicelib/devices/vdmos/vdmosinit.c index 40904ef09..21f4d273a 100644 --- a/src/spicelib/devices/vdmos/vdmosinit.c +++ b/src/spicelib/devices/vdmos/vdmosinit.c @@ -9,8 +9,8 @@ SPICEdev VDMOSinfo = { .DEVpublic = { - .name = "Vdmos", - .description = "Level 1 MOSfet model with Meyer capacitance model", + .name = "VDMOS", + .description = "DMOS model based on Level 1 MOSFET model", .terms = &VDMOSnSize, .numNames = &VDMOSnSize, .termNames = VDMOSnames, diff --git a/src/spicelib/devices/vdmos/vdmosload.c b/src/spicelib/devices/vdmos/vdmosload.c index f39c6324a..f94a7602f 100644 --- a/src/spicelib/devices/vdmos/vdmosload.c +++ b/src/spicelib/devices/vdmos/vdmosload.c @@ -2,6 +2,7 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles Modified: 2000 AlansFixes +VDMOS: 2018 Holger Vogt **********/ #include "ngspice/ngspice.h" diff --git a/src/spicelib/parser/inp2m.c b/src/spicelib/parser/inp2m.c index a87772be1..392b05662 100644 --- a/src/spicelib/parser/inp2m.c +++ b/src/spicelib/parser/inp2m.c @@ -128,7 +128,8 @@ INP2M(CKTcircuit *ckt, INPtables *tab, struct card *current) #endif thismodel->INPmodType != INPtypelook("HiSIM2") && thismodel->INPmodType != INPtypelook("HiSIMHV1") && - thismodel->INPmodType != INPtypelook("HiSIMHV2")) + thismodel->INPmodType != INPtypelook("HiSIMHV2") && + thismodel->INPmodType != INPtypelook("VDMOS")) { LITERR ("incorrect model type"); return; diff --git a/src/spicelib/parser/inpdomod.c b/src/spicelib/parser/inpdomod.c index fc4f8dd64..0f0d375f3 100644 --- a/src/spicelib/parser/inpdomod.c +++ b/src/spicelib/parser/inpdomod.c @@ -212,6 +212,19 @@ char *INPdomodel(CKTcircuit *ckt, struct card *image, INPtables * tab) INPmakeMod(modname, type, image); } + /* ------ Check if model is a VDMOS FET ------- */ + else if ((strcmp(type_name, "vdmos") == 0) || + (strcmp(type_name, "vdmosn") == 0) || + (strcmp(type_name, "vdmosp") == 0)) { + type = INPtypelook("VDMOS"); + if (type < 0) { + err = + INPmkTemp + ("Device type VDMOS not available in this binary\n"); + } + INPmakeMod(modname, type, image); + } + /* -------- Check if model is a MOSFET --------- */ else if ((strcmp(type_name, "nmos") == 0) || (strcmp(type_name, "pmos") == 0)