odification to parsing function for new device model (BSIM3SOIDD). Prepended

ng to binaries and manpages. Online help works again (at least!). Corrected
a bug in cktsgen.
This commit is contained in:
pnenzi 2001-01-21 17:24:23 +00:00
parent 0733ec6973
commit d1d4832b65
23 changed files with 258 additions and 58 deletions

View File

@ -1,3 +1,18 @@
2001-01-21 Paolo Nenzi <p.nenzi@ieee.org>
* bsim3soi_dd/*: BSIM3SOI (DD) support added as level 11. Added tests in
tests directory (tests/bsim3soidd/*).
* ???: Integrated patch form Alan Gillespie <Alan.Gillespie@analog.com>
to revert the spice raw format to the spice3 original.
* configure.in: corrected a bug that broke the on line help system.
Help system now works again but its text is a little bit outdated.
* ???: all binaries now have ng prependend, so ngspice can be installed
with other spice flavours.
2000-10-18 Arno W. Peters <A.W.Peters@ieee.org>
* Makefile.am: Changes for notes dir -> NOTES file conversion.

View File

@ -179,4 +179,11 @@ BSIM3SOI_PD - SOI model (partially depleted devices)
hierarchy. Test circuits come from the bsim3soi
web site at:
http://www-device.eecs.berkeley.edu/~bsimsoi
BSIM3SOI_DD - SOI Model (dynamic depletion model)
Initial Release Ver: 2.1. TO BE TESTED.
DD model has been integrated as level= 11
There is a bsim3soidd directory under the
test hierarchy. Test circuits come from bsim3soi
web site at:
http://www-device.eecs.berkeley.edu/~bsimsoi

View File

@ -5,7 +5,7 @@ dnl Create a configuration header
AM_CONFIG_HEADER(config.h)
dnl Initialize automake stuff
AM_INIT_AUTOMAKE(ng-spice-rework,13)
AM_INIT_AUTOMAKE(ng-spice-rework,14)
dnl --enable-ansi : try to force --ansi option to the compiler
@ -173,7 +173,7 @@ else
fi
AC_DEFINE_UNQUOTED(NGSPICEBINDIR, "`echo $dprefix/bin`" )
AC_DEFINE_UNQUOTED(NGSPICEDATADIR, "`echo $dprefix/share/ng-spice`" )
AC_DEFINE_UNQUOTED(NGSPICEDATADIR, "`echo $dprefix/share/ng-spice-rework`" )
AC_DEFINE_UNQUOTED(NGSPICEBUILDDATE, "`date`" )
@ -216,6 +216,7 @@ src/spicelib/devices/bsim4/Makefile \
src/spicelib/devices/bsim3v2/Makefile \
src/spicelib/devices/bsim3soi_pd/Makefile \
src/spicelib/devices/bsim3soi_fd/Makefile \
src/spicelib/devices/bsim3soi_dd/Makefile \
src/spicelib/devices/cap/Makefile \
src/spicelib/devices/cccs/Makefile \
src/spicelib/devices/ccvs/Makefile \
@ -256,5 +257,6 @@ tests/filters/Makefile \
tests/polezero/Makefile \
tests/resistance/Makefile \
tests/bsim3soipd/Makefile \
tests/bsim3soifd/Makefile
tests/bsim3soifd/Makefile \
tests/bsim3soidd/Makefile
)

View File

@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
man_MANS = spice.1 nutmeg.1 sconvert.1
man_MANS = ngspice.1 ngnutmeg.1 ngsconvert.1
EXTRA_DIST = $(man_MANS)

View File

@ -2,7 +2,7 @@
SUBDIRS = misc maths frontend spicelib include
bin_PROGRAMS = ngspice nutmeg help sconvert proc2mod multidec makeidx
bin_PROGRAMS = ngspice ngnutmeg nghelp ngsconvert ngproc2mod ngmultidec makeidx
EXTRA_DIST = ngspice.txt ngspice.idx
@ -10,6 +10,9 @@ helpdatadir = $(pkgdatadir)/helpdir
helpdata_DATA = ngspice.idx ngspice.txt
initdatadir = $(pkgdatadir)/scripts
initdata_DATA = spinit setplot spectrum
DYNAMIC_DEVICELIBS = \
@ -24,6 +27,7 @@ DYNAMIC_DEVICELIBS = \
spicelib/devices/cap/libcap.la \
spicelib/devices/bsim3soi_pd/libbsim3soipd.la \
spicelib/devices/bsim3soi_fd/libbsim3soifd.la \
spicelib/devices/bsim3soi_dd/libbsim3soidd.la \
spicelib/devices/cccs/libcccs.la \
spicelib/devices/ccvs/libccvs.la \
spicelib/devices/ccvs/libccvs.la \
@ -77,13 +81,13 @@ spice.o: main.c
## nutmeg:
nutmeg_SOURCES = \
ngnutmeg_SOURCES = \
main.c \
conf.c \
conf.h \
nutmeg.c
ngnutmeg.c
nutmeg_LDADD = \
ngnutmeg_LDADD = \
frontend/libfte.a \
frontend/plotting/libplotting.a \
frontend/parser/libparser.a \
@ -96,9 +100,9 @@ nutmeg_LDADD = \
## help:
help_SOURCES = help.c
nghelp_SOURCES = nghelp.c
help_LDADD = \
nghelp_LDADD = \
frontend/help/libhlp.a \
frontend/parser/libparser.a \
frontend/libfte.a \
@ -107,11 +111,11 @@ help_LDADD = \
## sconvert:
sconvert_SOURCES = sconvert.c
ngsconvert_SOURCES = ngsconvert.c
sconvert_LDADD = \
ngsconvert_LDADD = \
frontend/libfte.a \
frontend/parser/libparser.a \
misc/libmisc.a
@ -119,9 +123,9 @@ sconvert_LDADD = \
## proc2mod:
proc2mod_SOURCES = proc2mod.c
ngproc2mod_SOURCES = ngproc2mod.c
proc2mod_LDADD = \
ngproc2mod_LDADD = \
frontend/parser/libparser.a \
spicelib/parser/libinp.a \
misc/libmisc.a
@ -130,9 +134,9 @@ proc2mod_LDADD = \
## multidec:
multidec_SOURCES = multidec.c
ngmultidec_SOURCES = ngmultidec.c
multidec_LDADD = \
ngmultidec_LDADD = \
maths/sparse/libsparse.a \
misc/libmisc.a

View File

@ -6,7 +6,7 @@
#ifndef CKT
#define CKT "CKTdefs.h $Revision$ on $Date$ "
#define MAXNUMDEVS 33 /* Max number of possible devices; */
#define MAXNUMDEVS 34 /* 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 ? */

64
src/setplot Normal file
View File

@ -0,0 +1,64 @@
* set the current working plot
.control
begin
unset resp
if $argc
set resp = $argv[1]
else
if $?plots = 0
echo Error: there aren\'t any plots currently loaded.
goto bottom
else
if $#plots = 0
echo Error: there aren\'t any plots currently loaded.
goto bottom
end
end
if $?resp = 0
set oldplot = $curplot
echo ' Type the name of the desired plot:'
echo ''
echo ' new New plot'
foreach pl $plots
set curplot = $pl
strcmp i $pl $oldplot
if $i = 0
echo "Current $pl $curplottitle ({$curplotname})"
else
echo " $pl $curplottitle ({$curplotname})"
end
end
set curplot = $oldplot
echo -n '? '
set resp = $<
end
end
strcmp i $resp ""
if $i = 0
goto bottom
end
strcmp i $resp new
if $i = 0
set curplot = new
goto bottom
end
foreach pl $plots
strcmp i $resp $pl
if $i = 0
set curplot = $pl
goto bottom
end
end
echo Error: no such plot name $resp
label bottom
unset resp i pl newflag oldplot
end

83
src/spectrum Normal file
View File

@ -0,0 +1,83 @@
* Fourier Series Function for SPICE
.control
begin
if ($argc lt 4)
echo Error: Too few arguments.
echo ' 'Spectrum produces a plot containing a fourier series transformation of
echo ' 'the specified vectors
echo usage: spectrum startfreq stop step vec [[vec] ...]
goto bottom
end
if ( time eq time )
foreach vec $argv[4-len]
if ( $vec eq $vec )
else
goto bottom
end
end
else
echo ' 'Spectrum can not work without a time vector from a transient analysis.
goto bottom
end
set dt=$curplot
set title=$curplottitle
set curplot=new
set scratch=$curplot
let span={$dt}.time[length({$dt}.time)-1]-{$dt}.time[0]
if ($argv[3] gt 0.999/span)
let fpoints= ( $argv[2] - $argv[1] ) / $argv[3] +1
if (fpoints < 2)
echo frequency start stop or step not correctly specified
goto cleanup
end
else
echo Error: time span is not long enough for a step frequency of $argv[3] Hz
goto cleanup
end
let lent = length({$dt}.time)
set lent = "$&lent"
let nyquist = {$lent}/2/span
if ($argv[2] gt nyquist)
echo Error: The nyquist limit is exceeded, try a frequency less than "$&nyquist" Hz
goto cleanup
end
set fpoints="$&fpoints"
set curplot=new
set spec=$curplot
set curplottitle=$title
set curplotname='Spectrum Analysis'
let frequency=vector( $fpoints )*$argv[3]
dowhile frequency[1] < ( $argv[1] + 1e-9 )
let frequency = frequency + $argv[3]
end
foreach vec $argv[4-len]
let $vec = vector( $fpoints ) + j(vector( $fpoints ))
reshape $vec [{$fpoints}]
end
set curplot=$scratch
let npers=1
let test = span-2/$argv[3] + 1e-9
while test > 0
let npers = npers + 1
let test = test-1/$argv[3]
end
let ircle = 2*pi*max(-1,({$dt}.time-{$dt}.time[{$lent}-1])*{$argv[3]}/npers)
let win = 1 - cos(ircle)
let ircle = npers*ircle
let circle = ircle * ({$spec}.frequency[0]/$argv[3] - 1)
let k=vector( $fpoints )
foreach k "$&k"
let circle = circle + ircle
foreach vec $argv[4-len]
let tmp = win*{$dt}.{$vec}
let {$spec}.{$vec}[{$k}] = 2*(mean(cos(circle)*tmp),mean(sin(circle)*tmp))
end
end
label cleanup
destroy $scratch
unset fpoints dt scratch spec vec k title lent
label bottom
end

View File

@ -1,3 +1,8 @@
2000-01-21 Paolo Nenzi <p.nenzi@ieee.org>
* cktsgen.c: corrected a bug that caused segfault on sensitivity
analysis.
2000-07-28 Arno W. Peters <A.W.Peters@ieee.org>
* cktpzstr.c: Reversed a patch that went in between ng-spice-0.2

View File

@ -156,7 +156,7 @@ sgen_next(sgen **xsg)
i = sg->dev;
if (i > DEVmaxnum)
if (i >= DEVmaxnum) /* PN: Segafult if not = */
done = 1;
sg->first_model = sg->next_model = sg->devlist[i];

View File

@ -11,6 +11,7 @@ SUBDIRS = \
bsim3v2 \
bsim3soi_pd \
bsim3soi_fd \
bsim3soi_dd \
cap \
cccs \
ccvs \

View File

@ -35,7 +35,7 @@
#include "dev.h"
#define DEVICES_USED "asrc bjt bsim1 bsim2 bsim3 bsim3v2 bsim3v1 bsim4 bsim3soipd bsim3soifd cap cccs ccvs csw dio ind isrc jfet ltra mes mos1 mos2 mos3 mos6 res sw tra urc vccs vcvs vsrc"
#define DEVICES_USED "asrc bjt bsim1 bsim2 bsim3 bsim3v2 bsim3v1 bsim4 bsim3soipd bsim3soifd bsim3soidd cap cccs ccvs csw dio ind isrc jfet ltra mes mos1 mos2 mos3 mos6 res sw tra urc vccs vcvs vsrc"
/*
* Analyses
@ -63,6 +63,7 @@
#include "bsim4/bsim4itf.h"
#include "bsim3soi_pd/b3soipditf.h"
#include "bsim3soi_fd/b3soifditf.h"
#include "bsim3soi_dd/b3soidditf.h"
#include "cap/capitf.h"
#include "cccs/cccsitf.h"
#include "ccvs/ccvsitf.h"
@ -87,7 +88,7 @@
#include "vsrc/vsrcitf.h"
#define DEVNUM 33
#define DEVNUM 34
SPICEdev *DEVices[DEVNUM];
@ -107,29 +108,30 @@ spice_init_devices(void)
DEVices[ 8] = get_bsim4_info();
DEVices[ 9] = get_b3soipd_info();
DEVices[10] = get_b3soifd_info();
DEVices[11] = get_cap_info();
DEVices[12] = get_cccs_info();
DEVices[13] = get_ccvs_info();
DEVices[14] = get_csw_info();
DEVices[15] = get_dio_info();
DEVices[16] = get_ind_info();
DEVices[17] = get_mut_info();
DEVices[18] = get_isrc_info();
DEVices[19] = get_jfet_info();
DEVices[20] = get_jfet2_info();
DEVices[21] = get_ltra_info();
DEVices[22] = get_mes_info();
DEVices[23] = get_mos1_info();
DEVices[24] = get_mos2_info();
DEVices[25] = get_mos3_info();
DEVices[26] = get_mos6_info();
DEVices[27] = get_res_info();
DEVices[28] = get_sw_info();
DEVices[29] = get_tra_info();
DEVices[30] = get_vccs_info();
DEVices[31] = get_vcvs_info();
DEVices[32] = get_vsrc_info();
assert(33 == DEVNUM);
DEVices[11] = get_b3soidd_info();
DEVices[12] = get_cap_info();
DEVices[13] = get_cccs_info();
DEVices[14] = get_ccvs_info();
DEVices[15] = get_csw_info();
DEVices[16] = get_dio_info();
DEVices[17] = get_ind_info();
DEVices[18] = get_mut_info();
DEVices[19] = get_isrc_info();
DEVices[20] = get_jfet_info();
DEVices[21] = get_jfet2_info();
DEVices[22] = get_ltra_info();
DEVices[23] = get_mes_info();
DEVices[24] = get_mos1_info();
DEVices[25] = get_mos2_info();
DEVices[26] = get_mos3_info();
DEVices[27] = get_mos6_info();
DEVices[28] = get_res_info();
DEVices[29] = get_sw_info();
DEVices[30] = get_tra_info();
DEVices[31] = get_vccs_info();
DEVices[32] = get_vcvs_info();
DEVices[33] = get_vsrc_info();
assert(34 == DEVNUM);
}

View File

@ -86,14 +86,15 @@ INP2M (void *ckt, INPtables * tab, card * current)
if (thismodel != NULL)
{
if ((thismodel->INPmodType != INPtypelook ("B3SOIPD")) &&
(thismodel->INPmodType != INPtypelook ("B3SOIFD"))
(thismodel->INPmodType != INPtypelook ("B3SOIFD")) &&
(thismodel->INPmodType != INPtypelook ("B3SOIDD"))
)
{
/* if model is not variable node B3SOIPD model, error! */
LITERR ("only level 9-10 B3SOI(PD | FD) can have 7 nodes") return;
/* if model is not variable node B3SOIPD/FD/DD model, error! */
LITERR ("only level 9-10 B3SOI(PD | FD | DD) can have 7 nodes") return;
}
else
{ /* if looking at B3SOIPD model, allocate the 7th node */
{ /* if looking at B3SOIPD/FD/DD model, allocate the 7th node */
INPtermInsert (ckt, &nname5, tab, &node5);
INPtermInsert (ckt, &nname6, tab, &node6);
INPtermInsert (ckt, &nname7, tab, &node7);
@ -103,14 +104,15 @@ INP2M (void *ckt, INPtables * tab, card * current)
else
{ /* 7th token is a model - only have 6 terminal device */
if ((thismodel->INPmodType != INPtypelook ("B3SOIPD")) &&
(thismodel->INPmodType != INPtypelook ("B3SOIFD"))
(thismodel->INPmodType != INPtypelook ("B3SOIFD")) &&
(thismodel->INPmodType != INPtypelook ("B3SOIDD"))
)
{
/* if model is not variable node B3SOIPD model, error! */
LITERR ("only level 9-10 B3SOI(PD | FD) can have 6 nodes") return;
/* if model is not variable node B3SOIPD/FD/DD model, error! */
LITERR ("only level 9-10 B3SOI(PD | FD | DD) can have 6 nodes") return;
}
else
{ /* if looking at B3SOIPD model, allocate the 6th node */
{ /* if looking at B3SOIPD/FD/DD model, allocate the 6th node */
INPtermInsert (ckt, &nname5, tab, &node5);
INPtermInsert (ckt, &nname6, tab, &node6);
model = nname7;
@ -120,14 +122,15 @@ INP2M (void *ckt, INPtables * tab, card * current)
else
{ /* 6th token is a model - only have 5 terminal device */
if ((thismodel->INPmodType != INPtypelook ("B3SOIPD")) &&
(thismodel->INPmodType != INPtypelook ("B3SOIFD"))
(thismodel->INPmodType != INPtypelook ("B3SOIFD")) &&
(thismodel->INPmodType != INPtypelook ("B3SOIDD"))
)
{
/* if model is not variable node B3SOIPD model, error! */
LITERR ("only level 9-10 B3SOI(PD | FD) can have 5 nodes") return;
/* if model is not variable node B3SOIPD/FD/DD model, error! */
LITERR ("only level 9-10 B3SOI(PD | FD | DD) can have 5 nodes") return;
}
else
{ /* if looking at B3SOIPD model, allocate the 5th node */
{ /* if looking at B3SOIPD/FD/DD model, allocate the 5th node */
INPtermInsert (ckt, &nname5, tab, &node5);
model = nname6; /* make model point to the correct token */
}
@ -157,6 +160,7 @@ INP2M (void *ckt, INPtables * tab, card * current)
&& thismodel->INPmodType != INPtypelook ("BSIM3")
&& thismodel->INPmodType != INPtypelook ("B3SOIPD")
&& thismodel->INPmodType != INPtypelook ("B3SOIFD")
&& thismodel->INPmodType != INPtypelook ("B3SOIDD")
&& thismodel->INPmodType != INPtypelook ("BSIM4")
&& thismodel->INPmodType != INPtypelook ("BSIM3V1")
&& thismodel->INPmodType != INPtypelook ("BSIM3V2"))
@ -189,7 +193,8 @@ INP2M (void *ckt, INPtables * tab, card * current)
IFC (bindNode, (ckt, fast, 3, node3));
IFC (bindNode, (ckt, fast, 4, node4));
if ((thismodel->INPmodType == INPtypelook ("B3SOIPD")) ||
(thismodel->INPmodType == INPtypelook ("B3SOIFD"))
(thismodel->INPmodType == INPtypelook ("B3SOIFD")) ||
(thismodel->INPmodType == INPtypelook ("B3SOIDD"))
)
{
switch (nodeflag)

View File

@ -170,7 +170,15 @@ char *INPdomodel(void *ckt, card * image, INPtables * tab)
INPmkTemp
("Device type B3SOIFD not available in this binary\n");
}
break;
break;
case 11:
type = INPtypelook("B3SOIDD");
if (type < 0) {
err =
INPmkTemp
("Device type B3SOIDD not available in this binary\n");
}
break;
case 14:
type = INPtypelook("BSIM4");
if (type < 0) {

4
src/spinit Normal file
View File

@ -0,0 +1,4 @@
* Standard spice and nutmeg init file
alias exit quit
alias acct rusage all
set x11lineararcs