Linked the new devices (mesa hfet1 hfet2) into the ngspice simulator

This commit is contained in:
pnenzi 2001-04-25 17:58:59 +00:00
parent a2ba74bcac
commit b07e35d150
7 changed files with 123 additions and 46 deletions

View File

@ -242,10 +242,13 @@ src/spicelib/devices/csw/Makefile \
src/spicelib/devices/dio/Makefile \
src/spicelib/devices/ind/Makefile \
src/spicelib/devices/isrc/Makefile \
src/spicelib/devices/hfet1/Makefile \
src/spicelib/devices/hfet2/Makefile \
src/spicelib/devices/jfet/Makefile \
src/spicelib/devices/jfet2/Makefile \
src/spicelib/devices/ltra/Makefile \
src/spicelib/devices/mes/Makefile \
src/spicelib/devices/mesa/Makefile \
src/spicelib/devices/mos1/Makefile \
src/spicelib/devices/mos2/Makefile \
src/spicelib/devices/mos3/Makefile \

View File

@ -36,10 +36,13 @@ DYNAMIC_DEVICELIBS = \
spicelib/devices/dio/libdio.la \
spicelib/devices/ind/libind.la \
spicelib/devices/isrc/libisrc.la \
spicelib/devices/hfet1/libhfet.la \
spicelib/devices/hfet2/libhfet2.la \
spicelib/devices/jfet/libjfet.la \
spicelib/devices/jfet2/libjfet2.la \
spicelib/devices/ltra/libltra.la \
spicelib/devices/mes/libmes.la \
spicelib/devices/mesa/libmesa.la \
spicelib/devices/mos1/libmos1.la \
spicelib/devices/mos2/libmos2.la \
spicelib/devices/mos3/libmos3.la \

View File

@ -6,10 +6,10 @@
#ifndef CKT
#define CKT "CKTdefs.h $Revision$ on $Date$ "
#define MAXNUMDEVS 36 /* Max number of possible devices PN:XXX may cause toubles*/
extern int DEVmaxnum; /* Not sure if still used */
#define MAXNUMDEVS 39 /* Max number of possible devices PN:XXX may cause toubles*/
extern int DEVmaxnum; /* Not sure if still used */
#define MAXNUMDEVNODES 4 /* Max No. of nodes per device */
/* Need to change for SOI devs ? */
/* Need to change for SOI devs ? */
#include "smpdefs.h"
#include "ifsim.h"
@ -258,6 +258,7 @@ extern int CKTdltMod( void *, void *);
extern int CKTdltNod( void *, void *);
extern int CKTdoJob( void *, int , void *);
extern void CKTdump( CKTcircuit *, double, void *);
extern void CKTncDump(CKTcircuit *);
extern int CKTfndAnal( void *, int *, void **, IFuid , void *, IFuid );
extern int CKTfndBranch( CKTcircuit *, IFuid);
extern int CKTfndDev( void *, int *, void **, IFuid , void *, IFuid );

View File

@ -20,15 +20,18 @@ SUBDIRS = \
dio \
ind \
isrc \
hfet1 \
hfet2 \
jfet \
jfet2 \
ltra \
mes \
mesa \
mos1 \
mos2 \
mos3 \
mos6 \
mos9 \
mos9 \
res \
sw \
tra \

View File

@ -35,7 +35,7 @@
#include "dev.h"
#define DEVICES_USED "asrc bjt bjt2 bsim1 bsim2 bsim3 bsim3v2 bsim3v1 bsim4 bsim3soipd bsim3soifd bsim3soidd cap cccs ccvs csw dio ind isrc jfet ltra mes mos1 mos2 mos3 mos6 mos9 res sw tra urc vccs vcvs vsrc"
#define DEVICES_USED "asrc bjt bjt2 bsim1 bsim2 bsim3 bsim3v2 bsim3v1 bsim4 bsim3soipd bsim3soifd bsim3soidd cap cccs ccvs csw dio hfet hfet2 ind isrc jfet ltra mes mesa mos1 mos2 mos3 mos6 mos9 res sw tra urc vccs vcvs vsrc"
/*
* Analyses
@ -70,12 +70,15 @@
#include "ccvs/ccvsitf.h"
#include "csw/cswitf.h"
#include "dio/dioitf.h"
#include "hfet1/hfetitf.h"
#include "hfet2/hfet2itf.h"
#include "ind/inditf.h"
#include "isrc/isrcitf.h"
#include "jfet/jfetitf.h"
#include "jfet2/jfet2itf.h"
#include "ltra/ltraitf.h"
#include "mes/mesitf.h"
#include "mesa/mesaitf.h"
#include "mos1/mos1itf.h"
#include "mos2/mos2itf.h"
#include "mos3/mos3itf.h"
@ -90,7 +93,7 @@
#include "vsrc/vsrcitf.h"
#define DEVNUM 36
#define DEVNUM 39
SPICEdev *DEVices[DEVNUM];
@ -118,25 +121,28 @@ spice_init_devices(void)
DEVices[15] = get_ccvs_info();
DEVices[16] = get_csw_info();
DEVices[17] = get_dio_info();
DEVices[18] = get_ind_info();
DEVices[19] = get_mut_info();
DEVices[20] = get_isrc_info();
DEVices[21] = get_jfet_info();
DEVices[22] = get_jfet2_info();
DEVices[23] = get_ltra_info();
DEVices[24] = get_mes_info();
DEVices[25] = get_mos1_info();
DEVices[26] = get_mos2_info();
DEVices[27] = get_mos3_info();
DEVices[28] = get_mos6_info();
DEVices[29] = get_mos9_info();
DEVices[30] = get_res_info();
DEVices[31] = get_sw_info();
DEVices[32] = get_tra_info();
DEVices[33] = get_vccs_info();
DEVices[34] = get_vcvs_info();
DEVices[35] = get_vsrc_info();
assert(36 == DEVNUM);
DEVices[18] = get_hfeta_info();
DEVices[19] = get_hfet2_info();
DEVices[20] = get_ind_info();
DEVices[21] = get_mut_info();
DEVices[22] = get_isrc_info();
DEVices[23] = get_jfet_info();
DEVices[24] = get_jfet2_info();
DEVices[25] = get_ltra_info();
DEVices[26] = get_mes_info();
DEVices[27] = get_mesa_info();
DEVices[28] = get_mos1_info();
DEVices[29] = get_mos2_info();
DEVices[30] = get_mos3_info();
DEVices[31] = get_mos6_info();
DEVices[32] = get_mos9_info();
DEVices[33] = get_res_info();
DEVices[34] = get_sw_info();
DEVices[35] = get_tra_info();
DEVices[36] = get_vccs_info();
DEVices[37] = get_vcvs_info();
DEVices[38] = get_vsrc_info();
assert(39 == DEVNUM);
}

View File

@ -3,6 +3,13 @@ Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1988 Thomas L. Quarles
**********/
/* Added code from macspice3f4 HFET1&2 and MESA model
Original note:
Added device calls for Mesfet models and HFET models
provided by Trond Ytterdal as of Nov 98
*/
#include "ngspice.h"
#include <stdio.h>
#include "ifsim.h"
@ -16,7 +23,6 @@ void INP2Z(void *ckt, INPtables * tab, card * current)
/* Zname <node> <node> <node> <model> [<val>] [OFF] [IC=<val>,<val>] */
int mytype; /* the type we looked up */
int type; /* the type the model says it is */
char *line; /* the part of the current line left to parse */
char *name; /* the resistor's name */
@ -36,11 +42,7 @@ void INP2Z(void *ckt, INPtables * tab, card * current)
void *mdfast; /* pointer to the actual model */
IFuid uid; /* uid for default model */
mytype = INPtypelook("MES");
if (mytype < 0) {
LITERR("Device type MES not supported by this binary\n");
return;
}
line = current->line;
INPgetTok(&line, &name, 1);
INPinsert(&name, tab);
@ -55,14 +57,26 @@ void INP2Z(void *ckt, INPtables * tab, card * current)
thismodel = (INPmodel *) NULL;
current->error = INPgetMod(ckt, model, &thismodel, tab);
if (thismodel != NULL) {
if (mytype != thismodel->INPmodType) {
LITERR("incorrect model type");
return;
}
type = mytype;
if ( thismodel->INPmodType != INPtypelook("MES")
&& thismodel->INPmodType != INPtypelook("MESA")
&& thismodel->INPmodType != INPtypelook("HFET1")
&& thismodel->INPmodType != INPtypelook("HFET2"))
{
LITERR("incorrect model type")
return;
}
type = thismodel->INPmodType;
mdfast = (thismodel->INPmodfast);
} else {
type = mytype;
type = INPtypelook("MES");
if (type < 0 ) {
LITERR("Device type MES not supported by this binary\n");
return;
}
if (!tab->defZmod) {
/* create default Z model */
IFnewUid(ckt, &uid, (IFuid) NULL, "Z", UID_MODEL,
@ -76,7 +90,7 @@ void INP2Z(void *ckt, INPtables * tab, card * current)
IFC(bindNode, (ckt, fast, 2, node2));
IFC(bindNode, (ckt, fast, 3, node3));
PARSECALL((&line, ckt, type, fast, &leadval, &waslead, tab));
if (waslead) {
if ( (waslead) && ( thismodel != INPtypelook("MES") ) ) {
ptemp.rValue = leadval;
GCA(INPpName, ("area", &ptemp, ckt, type, fast));
}

View File

@ -86,14 +86,61 @@ char *INPdomodel(void *ckt, card * image, INPtables * tab)
break;
}
INPmakeMod(modname, type, image);
} else if ((strcmp(typename, "nmf") == 0)
|| (strcmp(typename, "pmf") == 0)) {
type = INPtypelook("MES");
if (type < 0) {
err =
INPmkTemp
("Device type MES not available in this binary\n");
}
} else if ((strcmp(typename, "nmf") == 0)
|| (strcmp(typename, "pmf") == 0)
|| (strcmp(typename, "nhfet") == 0)
|| (strcmp(typename, "phfet") == 0)) {
err = INPfindLev( line, &lev );
switch ( lev )
{
case 0:
case 1:
type = INPtypelook("MES");
if (type < 0)
{
err = INPmkTemp("Device type MES not available\n");
}
break;
case 2:
type = INPtypelook("MESA");
if (type < 0)
{
err = INPmkTemp("Device type MES2 not availabe\n");
}
break;
case 3:
type = INPtypelook("MESA");
if (type < 0)
{
err = INPmkTemp("Device type MES2 not availabe\n");
}
break;
case 4:
type = INPtypelook("MESA");
if ( type < 0)
{
err = INPmkTemp(" Device type MESA not available\n");
}
break;
case 5:
type = INPtypelook("HFET1");
if ( type < 0)
{
err = INPmkTemp(" Device type HFET1 not available\n");
}
break;
case 6:
type = INPtypelook("HFET2");
if ( type < 0)
{
err = INPmkTemp(" Device type HFET2 not available in this binary\n");
}
break;
default:
err = INPmkTemp("only mesfet device level 1 and hfet level 5-6 supported\n");
break;
}
INPmakeMod(modname, type, image);
} else if (strcmp(typename, "urc") == 0) {
type = INPtypelook("URC");