PATCH: Further separation of devices and ngspice


To ng-spice-devel <ng-spice-devel@ieee.ing.uniroma1.it>
From "Arno W. Peters" <a.w.peters@ieee.org>
Date Sat, 29 Apr 2000 16:04:34 +0200
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
Reply-To ng-spice-devel@ieee.ing.uniroma1.it
User-Agent Mutt/1.1.12i

Due to the inablility to commit any changes into the CVS repository, I
have prepared a good old-fashioned patch.

The attached patch implements a further separation of the devices code
and the ngspice source code.  I moved the initialization of the
devices structure into the devices directory and updated main.c to
this new reality.

Additional changes in this patch:

 o  A TODO list.  Add your own suggestions to it.

 o  Resistor test (respar.cir) moved into test infrastructure.


Happy hacking,
-- 
Arno
diff -ruN ngspice.orig/DEVICES ngspice/DEVICES
--- ngspice.orig/DEVICES        Thu Apr 27 22:03:57 2000
+++ ngspice/DEVICES     Sat Apr 29 14:29:11 2000
@@ -1,8 +1,9 @@
 DEVICES
 
-------------------------------------------------------------------------------
 
-This file contains the status of devices available in ng-spice. This file 
will
-be updated every time  the device cospecific code is altered/changed.
+This file contains the status of devices available in ng-spice. This
+file will be updated every time the device cospecific code is
+altered/changed.
 
 
                      **************************************
@@ -16,10 +17,10 @@
       Initial Release
 
 RES - Resistor
-      This is a modified version of the spice3 resistance model. This model
-      supports different ac and dc values (ac=...). This changes are 
-      introduced by Serban Popescu. This device needs more testing.
-      TO BE TESTED AND IMPROVED.
+      This is a modified version of the spice3 resistance model. This
+      model supports different ac and dc values (ac=...). This changes
+      are introduced by Serban Popescu. This device needs more
+      testing.  TO BE TESTED AND IMPROVED.
       
                      
                     **************************************
@@ -27,39 +28,39 @@
                     **************************************
                     
 TRA  - Transmission line
-     Initial release
+      Initial release
      
 LTRA - Lossy Transmission line
-     Initial release
+      Initial release
      
 URC  - Uniform distributed RC line
-     Initial release                
+      Initial release               
 
 
                      **************************************
                      **********    V/I Sources   **********
                      **************************************
 
- ASRC  - Arbitrary Source
-       Initial Release
+ASRC  - Arbitrary Source
+      Initial Release
 
- CCCS  - Current Controlled Current Source
-       Initial Release
+CCCS  - Current Controlled Current Source
+      Initial Release
 
- CCVS  - Current Controlled Voltage Source
-       Initial Release
+CCVS  - Current Controlled Voltage Source
+      Initial Release
       
- ISRC  - Independent Current Source
-       Initial Release
+ISRC  - Independent Current Source
+      Initial Release
       
- VCCS  - Voltage Controlled Current Source
-       Initial Release
+VCCS  - Voltage Controlled Current Source
+      Initial Release
 
- VCVS  - Voltage Controlled Voltage Source
-       Initial Release
+VCVS  - Voltage Controlled Voltage Source
+      Initial Release
 
- VSRC  - Indipendent Voltage Source
-       Initial Release
+VSRC  - Independent Voltage Source
+      Initial Release
 
                      
                     **************************************
@@ -67,37 +68,37 @@
                      **************************************
                     
 CSW - Current controlled switch
-    Initial release
+      Initial release
 
 SW  - Voltage controlled switch                     
-    Initial release               
+      Initial release             
                   
                     
                      **************************************
                      **********      Diodes      **********
                      **************************************
 
- DIO   - Junction Diode
-       Initial Release 
+DIO   - Junction Diode
+      Initial Release 
 
                      
                     **************************************
                      *********** Bipolar Devices **********
                      **************************************
       
- BJT   - Bipolar Junction Transistor
-       Initial Relelase
+BJT   - Bipolar Junction Transistor
+      Initial Relelase
 
 
                      **************************************
                      **********   FET Devices    **********
                      **************************************
                     
- JFET  - Junction Field Effect transistor
-       Initial Release
+JFET  - Junction Field Effect transistor
+      Initial Release
         
- JFET2 - Jfet PS model
-       Initial release. TO BE TESTED
+JFET2 - Jfet PS model
+      Initial release. TO BE TESTED
 
                 
                     **************************************
@@ -105,51 +106,51 @@
                      **************************************
                
 MES - MESfet model
-    Initial release
+      Initial release
                
                
                     **************************************
                      *********     MOS devices    *********
                      **************************************
  
- MOS1  - Level 1 MOS model
-       Initial Release
+MOS1  - Level 1 MOS model
+      Initial Release
 
- MOS2  - Level 2 MOS model
-       Initial Release
+MOS2  - Level 2 MOS model
+      Initial Release
 
- MOS3  - Level 3 MOS model
-       Initial Release
+MOS3  - Level 3 MOS model
+      Initial Release
 
- MOS6  - Level 6 MOS model
-       Initial Release
+MOS6  - Level 6 MOS model
+      Initial Release
 
- BSIM1 - BSIM model level 1
-       Initial Release
+BSIM1 - BSIM model level 1
+      Initial Release
 
- BSIM2 - BSIM model level 2
-       Initial Release
+BSIM2 - BSIM model level 2
+      Initial Release
 
- BSIM3 - BSIM model level 3
-       This is the BSIM3v3.2.2 model from Berkeley device group.
-       You can find some test netlists with results for this model 
-       at http://www-device.eecs.berkeley.edu/~bsim3. 
+BSIM3 - BSIM model level 3
+      This is the BSIM3v3.2.2 model from Berkeley device group.  You
+      can find some test netlists with results for this model at
+      http://www-device.eecs.berkeley.edu/~bsim3.
         
 
- BSIM3v1 - BSIM model level 3
-         This is the BSIM3v3.1 model modified by Serban Popescu. This
-        is level 49 model. It is an implementation that supports
-        HDIF and M parameters. Test netlists are available at the URL
-        above.
-        TO BE TESTED AND IMPROVED. 
-
- BSIM3v2 - BSIM model level 3
-         This is the BSIM3v3.2 model. It is proved only for compatibility
-        with existing netlists and parameters files. As always, tests are
-        availabe on the Berkeley's device group site (at the above URL).
+BSIM3v1 - BSIM model level 3
+      This is the BSIM3v3.1 model modified by Serban Popescu. This is
+      level 49 model. It is an implementation that supports HDIF and M
+      parameters. Test netlists are available at the URL above.  TO BE
+      TESTED AND IMPROVED.
+
+BSIM3v2 - BSIM model level 3
+      This is the BSIM3v3.2 model. It is proved only for compatibility
+      with existing netlists and parameters files. As always, tests
+      are availabe on the Berkeley's device group site (at the above
+      URL).
 
- BSIM4   - BSIM model level 4 (0.18 um)
-         Initial Release. TO BE TESTED.
+BSIM4   - BSIM model level 4 (0.18 um)
+      Initial Release. TO BE TESTED.
         
         
                      **************************************     
@@ -158,10 +159,10 @@
 
 
 BSIM3SOI_DD - SOI model (dynamic depletion)
-            NOT YET IMPLEMENTED.
+      NOT YET IMPLEMENTED.
 
 BSIM3SOI_FD - SOI model (fully depleted devices)
-            NOT YET IMPLEMENTED.
+      NOT YET IMPLEMENTED.
 
 BSIM3SOI_PD - SOI model (partially depleted devices)
-            NOT YET IMPLEMENTED.
+      NOT YET IMPLEMENTED.
diff -ruN ngspice.orig/TODO ngspice/TODO
--- ngspice.orig/TODO   Thu Jan  1 01:00:00 1970
+++ ngspice/TODO        Sat Apr 29 15:47:53 2000
@@ -0,0 +1,39 @@
+List of Things To Do
+====================
+
+
+Standards conformance
+---------------------
+
+Add proper copyright headers to every source, header, documentation
+and other files
+
+Fix all compiler warnings
+
+Remove smktemp() in favor of tmpfile(); Note: different symantics!
+
+
+
+Usability issues
+------------------
+
+Plug all memory leaks (use debauch from
+http://quorum.tamu.edu/jon/gnu/ to find them)
+
+Either get help program functioning again; OR interface to webbrowser,
+info reader and get rid of all help-related code.  Option 2 is the
+most appealing.
+
+
+Refactorings
+------------
+
+Make devices dynamically loadable (perhaps use framework from glib)
+
+Separate out analysis code in much the same way as the devices code
+
+Separate ngspice and nutmeg; i.e., no more SIMULATOR define
+
+Integrate bsim3, bsim3v1, bsim3v2 to use a single codebase instead of
+three only slighty differing implementations
+
diff -ruN ngspice.orig/src/Makefile.am ngspice/src/Makefile.am
--- ngspice.orig/src/Makefile.am        Thu Apr 27 22:03:58 2000
+++ ngspice/src/Makefile.am     Sat Apr 29 14:14:55 2000
@@ -67,6 +67,7 @@
 ngspice_LDADD = \
        spice.o \
        frontend/libfte.a \
+       devices/libdev.a \
        $(DYNAMIC_DEVICELIBS) \
        analysis/libckt.a \
        parser/libparser.a \
diff -ruN ngspice.orig/src/devices/Makefile.am ngspice/src/devices/Makefile.am
--- ngspice.orig/src/devices/Makefile.am        Thu Apr 27 22:03:58 2000
+++ ngspice/src/devices/Makefile.am     Sat Apr 29 13:47:40 2000
@@ -34,5 +34,10 @@
        vcvs    \
        vsrc
 
+lib_LIBRARIES = libdev.a
+
+libdev_a_SOURCES = dev.c
+
+INCLUDES = -I$(top_srcdir)/src/include
 
 MAINTAINERCLEANFILES = Makefile.in
diff -ruN ngspice.orig/src/devices/dev.c ngspice/src/devices/dev.c
--- ngspice.orig/src/devices/dev.c      Thu Jan  1 01:00:00 1970
+++ ngspice/src/devices/dev.c   Sat Apr 29 14:10:02 2000
@@ -0,0 +1,126 @@
+/* Configuration file for ng-spice */
+#include <config.h>
+
+#include "dev.h"
+#include "devdefs.h"
+
+/*
+ * Devices
+ */
+#define DEV_asrc
+#define DEV_bjt
+#define DEV_bsim1
+#define DEV_bsim2
+#define DEV_bsim3
+#define DEV_bsim4
+#define DEV_bsim3v1
+#define DEV_bsim3v2
+#define DEV_cap
+#define DEV_cccs
+#define DEV_ccvs
+#define DEV_csw
+#define DEV_dio
+#define DEV_ind
+#define DEV_isrc
+#define DEV_jfet
+#define DEV_jfet2
+#define DEV_ltra
+#define DEV_mes
+#define DEV_mos1
+#define DEV_mos2
+#define DEV_mos3
+#define DEV_mos6
+#define DEV_res
+#define DEV_sw
+#define DEV_tra
+#define DEV_urc
+#define DEV_vccs
+#define DEV_vcvs
+#define DEV_vsrc
+
+#define DEVICES_USED "asrc bjt bsim1 bsim2 bsim3 bsim3v2 bsim3v1 cap cccs 
+ccvs csw dio ind isrc jfet ltra mes mos1 mos2 mos3 mos6 res sw tra urc vccs 
+vcvs vsrc"
+
+#include "asrc/asrcitf.h"
+#include "bjt/bjtitf.h"
+#include "cap/capitf.h"
+#include "cccs/cccsitf.h"
+#include "ccvs/ccvsitf.h"
+#include "csw/cswitf.h"
+#include "dio/dioitf.h"
+#include "ind/inditf.h"
+#include "isrc/isrcitf.h"
+#include "mos1/mos1itf.h"
+#include "mos6/mos6itf.h"
+#include "res/resitf.h"
+#include "sw/switf.h"
+#include "vccs/vccsitf.h"
+#include "vcvs/vcvsitf.h"
+#include "vsrc/vsrcitf.h"
+#include "bsim1/bsim1itf.h"
+#include "bsim2/bsim2itf.h"
+#include "bsim3/bsim3itf.h"
+#include "bsim4/bsim4itf.h"
+#include "bsim3v1/bsim3v1itf.h"
+#include "bsim3v2/bsim3v2itf.h"
+#include "mos2/mos2itf.h"
+#include "mos3/mos3itf.h"
+#include "jfet/jfetitf.h"
+#include "jfet2/jfet2itf.h"
+#include "mes/mesitf.h"
+#include "ltra/ltraitf.h"
+#include "tra/traitf.h"
+#include "urc/urcitf.h"
+
+
+SPICEdev *DEVices[] = {
+
+       /* URC must appear before the resistor, capacitor, and diode */
+        &URCinfo,
+        &ASRCinfo,
+        &BJTinfo,
+        &B1info,
+        &B2info,
+        &BSIM3info,
+       &B4info,
+       &BSIM3V2info,
+       &BSIM3V1info,
+        &CAPinfo,
+        &CCCSinfo,
+        &CCVSinfo,
+        &CSWinfo,
+        &DIOinfo,
+        &INDinfo,
+        &MUTinfo,
+        &ISRCinfo,
+        &JFETinfo,
+        &JFET2info,
+        &LTRAinfo,
+        &MESinfo,
+        &MOS1info,
+        &MOS2info,
+        &MOS3info,
+        &MOS6info,
+        &RESinfo,
+        &SWinfo,
+        &TRAinfo,
+        &VCCSinfo,
+        &VCVSinfo,
+        &VSRCinfo,
+};
+
+
+/* my internal global constant for number of device types */
+int DEVmaxnum = sizeof(DEVices)/sizeof(SPICEdev *);
+
+
+int
+num_devices(void)
+{
+    return sizeof(DEVices)/sizeof(SPICEdev *);
+}
+
+IFdevice **
+devices_ptr(void)
+{
+    return (IFdevice **) DEVices;
+}
diff -ruN ngspice.orig/src/devices/dev.h ngspice/src/devices/dev.h
--- ngspice.orig/src/devices/dev.h      Thu Jan  1 01:00:00 1970
+++ ngspice/src/devices/dev.h   Sat Apr 29 14:07:55 2000
@@ -0,0 +1,10 @@
+#ifndef _DEV_H
+#define _DEV_H
+
+#include <ifsim.h>
+
+int num_devices(void);
+IFdevice **devices_ptr(void);
+
+#endif
+
diff -ruN ngspice.orig/src/main.c ngspice/src/main.c
--- ngspice.orig/src/main.c     Thu Apr 27 22:03:58 2000
+++ ngspice/src/main.c  Sat Apr 29 14:15:40 2000
@@ -23,6 +23,7 @@
 #include "ftedev.h"
 #include "ftedebug.h"
 #include "const.h"
+#include "devices/dev.h"
 
 #ifdef HAVE_PWD_H
 #include <pwd.h>
@@ -160,6 +161,11 @@
 
 int SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator)
 {
+#ifdef SIMULATOR
+    SIMinfo.numDevices = num_devices();
+    SIMinfo.devices = devices_ptr();
+#endif /* SIMULATOR */
+
     SPfrontEnd = frontEnd;
     *simulator = &SIMinfo;
     CONSTroot2 = sqrt(2.);
diff -ruN ngspice.orig/src/ngspice.c ngspice/src/ngspice.c
--- ngspice.orig/src/ngspice.c  Thu Apr 27 22:03:58 2000
+++ ngspice/src/ngspice.c       Sat Apr 29 14:10:50 2000
@@ -16,41 +16,6 @@
 #define AN_noise
 #define AN_sense
 
-/*
- * Devices
- */
-#define DEV_asrc
-#define DEV_bjt
-#define DEV_bsim1
-#define DEV_bsim2
-#define DEV_bsim3
-#define DEV_bsim4
-#define DEV_bsim3v1
-#define DEV_bsim3v2
-#define DEV_cap
-#define DEV_cccs
-#define DEV_ccvs
-#define DEV_csw
-#define DEV_dio
-#define DEV_ind
-#define DEV_isrc
-#define DEV_jfet
-#define DEV_jfet2
-#define DEV_ltra
-#define DEV_mes
-#define DEV_mos1
-#define DEV_mos2
-#define DEV_mos3
-#define DEV_mos6
-#define DEV_res
-#define DEV_sw
-#define DEV_tra
-#define DEV_urc
-#define DEV_vccs
-#define DEV_vcvs
-#define DEV_vsrc
-
-#define DEVICES_USED "asrc bjt bsim1 bsim2 bsim3 bsim3v2 bsim3v1 cap cccs 
ccvs csw dio ind isrc jfet ltra mes mos1 mos2 mos3 mos6 res sw tra urc vccs 
vcvs vsrc"
 #define ANALYSES_USED "op dc tf ac tran pz disto noise sense"
 
 /**********
@@ -65,42 +30,10 @@
 
 
 #include <stdio.h>
-#include "noisedef.h"
 #include "devdefs.h"
+#include "noisedef.h"
 #include "suffix.h"
 
-#include "asrc/asrcitf.h"
-#include "bjt/bjtitf.h"
-#include "cap/capitf.h"
-#include "cccs/cccsitf.h"
-#include "ccvs/ccvsitf.h"
-#include "csw/cswitf.h"
-#include "dio/dioitf.h"
-#include "ind/inditf.h"
-#include "isrc/isrcitf.h"
-#include "mos1/mos1itf.h"
-#include "mos6/mos6itf.h"
-#include "res/resitf.h"
-#include "sw/switf.h"
-#include "vccs/vccsitf.h"
-#include "vcvs/vcvsitf.h"
-#include "vsrc/vsrcitf.h"
-#include "bsim1/bsim1itf.h"
-#include "bsim2/bsim2itf.h"
-#include "bsim3/bsim3itf.h"
-#include "bsim4/bsim4itf.h"
-#include "bsim3v1/bsim3v1itf.h"
-#include "bsim3v2/bsim3v2itf.h"
-#include "mos2/mos2itf.h"
-#include "mos3/mos3itf.h"
-#include "jfet/jfetitf.h"
-#include "jfet2/jfet2itf.h"
-#include "mes/mesitf.h"
-#include "ltra/ltraitf.h"
-#include "tra/traitf.h"
-#include "urc/urcitf.h"
-
-
 
 extern SPICEanalysis OPTinfo;
 extern SPICEanalysis ACinfo;
@@ -129,44 +62,6 @@
 };
 
 int ANALmaxnum = sizeof(analInfo)/sizeof(SPICEanalysis*);
-SPICEdev *DEVices[] = {
-
-       /* URC must appear before the resistor, capacitor, and diode */
-        &URCinfo,
-        &ASRCinfo,
-        &BJTinfo,
-        &B1info,
-        &B2info,
-        &BSIM3info,
-       &B4info,
-       &BSIM3V2info,
-       &BSIM3V1info,
-        &CAPinfo,
-        &CCCSinfo,
-        &CCVSinfo,
-        &CSWinfo,
-        &DIOinfo,
-        &INDinfo,
-        &MUTinfo,
-        &ISRCinfo,
-        &JFETinfo,
-        &JFET2info,
-        &LTRAinfo,
-        &MESinfo,
-        &MOS1info,
-        &MOS2info,
-        &MOS3info,
-        &MOS6info,
-        &RESinfo,
-        &SWinfo,
-        &TRAinfo,
-        &VCCSinfo,
-        &VCVSinfo,
-        &VSRCinfo,
-};
-
-/* my internal global constant for number of device types */
-int DEVmaxnum = sizeof(DEVices)/sizeof(SPICEdev *);
 /* XXX Should be -1 ? There is always an extra null element at the end ? */
 static char * specSigList[] = {
     "time"
@@ -179,47 +74,47 @@
 };
 
 IFsimulator SIMinfo = {
-    "ngspice",      /* name */
-    "Circuit level simulation program",  /* more about me */
-    Spice_Version,  /* version */
-
-    CKTinit,        /* newCircuit function */
-    CKTdestroy,     /* deleteCircuit function */
-
-    CKTnewNode,     /* newNode function */
-    CKTground,      /* groundNode function */
-    CKTbindNode,    /* bindNode function */
-    CKTfndNode,     /* findNode function */
-    CKTinst2Node,   /* instToNode function */
-    CKTsetNodPm,    /* setNodeParm function */
-    CKTaskNodQst,   /* askNodeQuest function */
-    CKTdltNod,      /* deleteNode function */
-
-    CKTcrtElt,      /* newInstance function */
-    CKTparam,       /* setInstanceParm function */
-    CKTask,         /* askInstanceQuest function */
-    CKTfndDev,      /* findInstance funciton */
-    CKTdltInst,     /* deleteInstance function */
-
-    CKTmodCrt,      /* newModel function */
-    CKTmodParam,    /* setModelParm function */
-    CKTmodAsk,      /* askModelQuest function */
-    CKTfndMod,      /* findModel function */
-    CKTdltMod,      /* deleteModel function */
-
-    CKTnewTask,     /* newTask function */
-    CKTnewAnal,     /* newAnalysis function */
-    CKTsetAnalPm,   /* setAnalysisParm function */
-    CKTaskAnalQ,    /* askAnalysisQuest function */
-    CKTfndAnal,     /* findAnalysis function */
-    CKTfndTask,     /* findTask function */
-    CKTdelTask,     /* deleteTask function */
+    "ngspice",                 /* name */
+    "Circuit level simulation program",        /* more about me */
+    Spice_Version,             /* version */
+
+    CKTinit,                   /* newCircuit function */
+    CKTdestroy,                        /* deleteCircuit function */
+
+    CKTnewNode,                        /* newNode function */
+    CKTground,                 /* groundNode function */
+    CKTbindNode,               /* bindNode function */
+    CKTfndNode,                        /* findNode function */
+    CKTinst2Node,              /* instToNode function */
+    CKTsetNodPm,               /* setNodeParm function */
+    CKTaskNodQst,              /* askNodeQuest function */
+    CKTdltNod,                 /* deleteNode function */
+
+    CKTcrtElt,                 /* newInstance function */
+    CKTparam,                  /* setInstanceParm function */
+    CKTask,                    /* askInstanceQuest function */
+    CKTfndDev,                 /* findInstance funciton */
+    CKTdltInst,                        /* deleteInstance function */
+
+    CKTmodCrt,                 /* newModel function */
+    CKTmodParam,               /* setModelParm function */
+    CKTmodAsk,                 /* askModelQuest function */
+    CKTfndMod,                 /* findModel function */
+    CKTdltMod,                 /* deleteModel function */
+
+    CKTnewTask,                        /* newTask function */
+    CKTnewAnal,                        /* newAnalysis function */
+    CKTsetAnalPm,              /* setAnalysisParm function */
+    CKTaskAnalQ,               /* askAnalysisQuest function */
+    CKTfndAnal,                        /* findAnalysis function */
+    CKTfndTask,                        /* findTask function */
+    CKTdelTask,                        /* deleteTask function */
 
-    CKTdoJob,       /* doAnalyses function */
-    CKTtrouble,            /* non-convergence message function */
+    CKTdoJob,                  /* doAnalyses function */
+    CKTtrouble,                        /* non-convergence message function */
 
-    sizeof(DEVices)/sizeof(SPICEdev *),
-    (IFdevice**)DEVices,
+    0,                         /* Initialized in SIMinit() */
+    NULL,                      /* Initialized in SIMinit() */
 
     sizeof(analInfo)/sizeof(SPICEanalysis *),
     (IFanalysis **)analInfo,
diff -ruN ngspice.orig/tests/Makefile.am ngspice/tests/Makefile.am
--- ngspice.orig/tests/Makefile.am      Thu Apr 27 22:04:01 2000
+++ ngspice/tests/Makefile.am   Sat Apr 29 14:18:57 2000
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-TESTS = diffpair.sh fourbitadder.sh resistor.sh
+TESTS = diffpair.sh fourbitadder.sh resistor.sh respart.sh
 
 TESTS_ENVIRONMENT = $(SHELL)
 
@@ -13,6 +13,8 @@
        fourbitadder.cir        \
        fourbitadder.out        \
        resistor.cir            \
-       resistor.out
+       resistor.out            \
+       respart.cir             \
+       respart.out
 
 MAINTAINERCLEANFILES = Makefile.in
diff -ruN ngspice.orig/tests/resistance/respart.cir 
ngspice/tests/resistance/respart.cir
--- ngspice.orig/tests/resistance/respart.cir   Thu Apr 27 22:04:01 2000
+++ ngspice/tests/resistance/respart.cir        Thu Jan  1 01:00:00 1970
@@ -1,9 +0,0 @@
-* Resistive partition with different ratios for AC/DC (Print V(2))
-
-vin 1 0 DC 1V AC 1V
-r1  1 2 5K
-r2  2 0 5K ac=15k
-
-.OP
-.AC DEC 10 1 10K
-.END
diff -ruN ngspice.orig/tests/respart.cir ngspice/tests/respart.cir
--- ngspice.orig/tests/respart.cir      Thu Jan  1 01:00:00 1970
+++ ngspice/tests/respart.cir   Sat Apr 29 14:18:31 2000
@@ -0,0 +1,9 @@
+* Resistive partition with different ratios for AC/DC (Print V(2))
+
+vin 1 0 DC 1V AC 1V
+r1  1 2 5K
+r2  2 0 5K ac=15k
+
+.OP
+.AC DEC 10 1 10K
+.END
diff -ruN ngspice.orig/tests/respart.out ngspice/tests/respart.out
--- ngspice.orig/tests/respart.out      Thu Jan  1 01:00:00 1970
+++ ngspice/tests/respart.out   Sat Apr 29 14:19:32 2000
@@ -0,0 +1,46 @@
+
+Circuit: * Resistive partition with different ratios for AC/DC (Print V(2))
+
+Circuit: * Resistive partition with different ratios for AC/DC (Print V(2))
+
+
+
+Operating point information:
+
+       Node    Voltage
+       ----    -------
+       V(2)    5.000000e-01
+       V(1)    1.000000e+00
+
+       Source  Current
+       ------  -------
+
+       vin#branch      -1.00000e-04
+
+ Resistor models (Simple linear resistor)
+ model             R
+
+       rsh         0
+    narrow         0
+       tc1         0
+       tc2         0
+      defw     1e-05
+
+ Resistor: Simple linear resistor
+ device           r2        r1
+ model             R         R
+resistance     5e+03     5e+03
+        ac   1.5e+04     5e+03
+         i    0.0001    0.0001
+         p     5e-05     5e-05
+
+ Vsource: Independent voltage source
+ device          vin
+        dc         1
+     acmag         1
+         i   -0.0001
+         p    0.0001
+
+
+
+
diff -ruN ngspice.orig/tests/respart.sh ngspice/tests/respart.sh
--- ngspice.orig/tests/respart.sh       Thu Jan  1 01:00:00 1970
+++ ngspice/tests/respart.sh    Sat Apr 29 14:19:21 2000
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+. $srcdir/config.sh
+spicetest respart

PGP signature


Partial thread listing: