2003-08-01 Stefan Jones <stefan.jones@multigig.com>
* configure.in src/xspice/icm/* src/xspice/lib/*.cm src/xspice/Makefile.am : Added some easy to use makefiles for codemodels and reordered Removed binary files Added icm to build list
This commit is contained in:
parent
6e80733381
commit
fdda4ca4b7
|
|
@ -11,6 +11,13 @@
|
|||
|
||||
* src/frontend/{com_let.c,device.c,evaluate.c}:
|
||||
more memory leak fixes by Vera Albrecht <albrecht@danalyse.de>
|
||||
|
||||
* configure.in src/xspice/icm/* src/xspice/lib/*.cm
|
||||
src/xspice/Makefile.am :
|
||||
Added some easy to use makefiles for codemodels and reordered
|
||||
Removed binary files
|
||||
Added icm to build list
|
||||
|
||||
|
||||
2003-07-18 Vera Albrecht <albrecht@danalyse.de>
|
||||
|
||||
|
|
|
|||
|
|
@ -498,8 +498,7 @@ src/maths/sparse/Makefile \
|
|||
src/misc/Makefile \
|
||||
src/xspice/Makefile \
|
||||
src/xspice/cm/Makefile \
|
||||
src/xspice/icm/Makefile \
|
||||
src/xspice/icm/icm_spice2poly/Makefile \
|
||||
src/xspice/icm/makedefs \
|
||||
src/xspice/mif/Makefile \
|
||||
src/xspice/evt/Makefile \
|
||||
src/xspice/enh/Makefile \
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ EXTRA_DIST = README
|
|||
## libs. It is currently compiled manually, last.
|
||||
##SUBDIRS = mif cm enh evt ipc idn icm
|
||||
|
||||
SUBDIRS = mif cm enh evt ipc idn cmpp
|
||||
SUBDIRS = mif cm enh evt ipc idn cmpp icm
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/src/include -I$(top_srcdir)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,85 @@
|
|||
# The master makefile to make spiceopuse (TM) like codemodels
|
||||
# Under the GPLV2 or later license
|
||||
# 2003 - Stefan Jones <stefan.jones@multigig.com>
|
||||
|
||||
include $(TOPDIR)makedefs
|
||||
|
||||
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
|
||||
|
||||
-include .deps/ifspec.P
|
||||
-include .deps/cfunc.P
|
||||
-include .deps/cm.P
|
||||
-include .deps/dlmain.P
|
||||
|
||||
UPMAKE = make -f $(TOPDIR)../Makefile TOPDIR=$(TOPDIR)../
|
||||
|
||||
MAKE = make -f $(TOPDIR)Makefile TOPDIR=$(TOPDIR)
|
||||
|
||||
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
|
||||
|
||||
all:
|
||||
@for x in $(CMDIRS) ; do \
|
||||
( cd $$x && $(UPMAKE) $$x-mods ) ; done
|
||||
|
||||
clean:
|
||||
@for x in $(CMDIRS) ; do \
|
||||
( cd $$x && $(UPMAKE) $$x-mods-clean ) ; done
|
||||
-rm -rf .deps
|
||||
|
||||
ifspec.c: ifspec.ifs
|
||||
-rm -f $@
|
||||
$(CMPP) -ifs
|
||||
|
||||
cfunc.c: cfunc.mod
|
||||
-rm -f $@
|
||||
$(CMPP) -mod
|
||||
|
||||
dlmain.c: $(TOPDIR)/dlmain.c
|
||||
-cp $(TOPDIR)/dlmain.c .
|
||||
|
||||
objects.inc cmextrn.h cminfo.h udnextrn.h udninfo.h: modpath.lst udnpath.lst
|
||||
-rm -f cmextrn.h cminfo.h objects.inc udnextrn.h udninfo.h
|
||||
$(CMPP) -lst
|
||||
|
||||
dlmain.o: cmextrn.h cminfo.h udnextrn.h udninfo.h
|
||||
|
||||
%.cm: dlmain.o objects.inc
|
||||
@echo $@: objects.inc dlmain.o \\ > .deps/cm.P ; \
|
||||
for x in `cat udnpath.lst` `cat modpath.lst ` ; do \
|
||||
echo $$x/cfunc.o $$x/ifspec.o \\ >> .deps/cm.P ; done ; \
|
||||
echo "" >> .deps/cm.P
|
||||
$(COMPILE) $(LDFLAGS) -o $@ `cat objects.inc ` dlmain.o
|
||||
|
||||
%-mods: modpath.lst udnpath.lst
|
||||
@for x in `cat udnpath.lst` `cat modpath.lst ` ; do \
|
||||
( cd $$x && $(UPMAKE) objs ) ; done
|
||||
@target=`echo $@ | sed s/-mods//`; $(MAKE) $$target.cm
|
||||
|
||||
%-mods-clean:
|
||||
@target=`echo $@ | sed s/-mods-clean//` && rm -f $$target.cm && \
|
||||
for x in `cat udnpath.lst` `cat modpath.lst ` ; do \
|
||||
( cd $$x && $(UPMAKE) objs-clean ) ; done
|
||||
-rm -f cmextrn.h cminfo.h objects.inc udnextrn.h udninfo.h \
|
||||
dlmain.c dlmain.o
|
||||
-rm -rf .deps
|
||||
|
||||
|
||||
objs: ifspec.o cfunc.o
|
||||
|
||||
objs-clean:
|
||||
-rm -f cfunc.c ifspec.c cfunc.o ifspec.o
|
||||
-rm -rf .deps
|
||||
|
||||
%.o: %.c
|
||||
@echo '$(COMPILE) -c $<'; \
|
||||
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
|
||||
@-cp .deps/$(*F).pp .deps/$(*F).P; \
|
||||
tr ' ' '\012' < .deps/$(*F).pp \
|
||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
||||
>> .deps/$(*F).P; \
|
||||
rm .deps/$(*F).pp
|
||||
|
||||
makedefs: $(srcdir)/makedefs.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
|
@ -1,194 +0,0 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
#
|
||||
# Hacked on 5.23.2003 by SDB
|
||||
|
||||
|
||||
SUBDIRS = icm_spice2poly
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/src/include
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
EXTRA_DIST = README modpath.lst udnpath.lst spice2poly.cm dlmain.c
|
||||
|
||||
|
||||
# Edit these to point to your Opus installation
|
||||
CMPPDIR = $(top_srcdir)/src/xspice/cmpp
|
||||
OPUS_INCLUDE_DIR = $(top_srcdir)/src/include
|
||||
|
||||
|
||||
##------ automake definitions below. ------
|
||||
##
|
||||
|
||||
## Yes, listing all this stuff is ugly, but I wasn't clever enough to
|
||||
## find a better way to make it work.
|
||||
|
||||
SYSTEM_LIBS = -lm -lncurses -L/usr/X11R6/lib -lX11 -lXt -lXext -lXmu -lXaw -lSM -lICE
|
||||
|
||||
LOCAL_LIBS = -lcmxsp,-levtxsp,-lidnxsp,-lipcxsp,-lenhxsp,-lmifxsp,-ldev,-lckt,-linp,-lparser,-lhlp,-linp,-lderiv,-lcmaths,-lpoly,-lni,-lsparse,-lmisc,-lfte,-lplotting
|
||||
|
||||
DEVICE_LIBS = -lasrc,-lbjt,-lbsim1,-lbsim2,-lbsim3,-lbsim3v1,-lbsim3v2,-lbsim4,-lcap,-lbsim3soipd,-lbsim3soifd,-lbsim3soidd,-lcccs,-lccvs,-lccvs,-lcpl,-lcsw,-ldio,-lind,-lisrc,-lhfet,-lhfet2,-ljfet,-ljfet2,-lltra,-lmes,-lmesa,-lmos1,-lmos2,-lmos3,-lmos6,-lmos9,-lres,-lsoi3,-lsw,-ltxl,-ltra,-lurc,-lvccs,-lvcvs,-lvsrc
|
||||
|
||||
|
||||
|
||||
LOCAL_LIB_DIRS = \
|
||||
-L$(top_srcdir)/src/xspice/cm/ \
|
||||
-L$(top_srcdir)/src/xspice/enh/ \
|
||||
-L$(top_srcdir)/src/xspice/evt/ \
|
||||
-L$(top_srcdir)/src/xspice/idn/ \
|
||||
-L$(top_srcdir)/src/xspice/ipc/ \
|
||||
-L$(top_srcdir)/src/xspice/mif/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ \
|
||||
-L$(top_srcdir)/src/spicelib/analysis/ \
|
||||
-L$(top_srcdir)/src/spicelib/parser/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/frontend/parser/ \
|
||||
-L$(top_srcdir)/src/frontend/help/ \
|
||||
-L$(top_srcdir)/src/maths/deriv/ \
|
||||
-L$(top_srcdir)/src/maths/cmaths/ \
|
||||
-L$(top_srcdir)/src/maths/poly/ \
|
||||
-L$(top_srcdir)/src/maths/ni/ \
|
||||
-L$(top_srcdir)/src/maths/sparse/ \
|
||||
-L$(top_srcdir)/src/misc/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/frontend/ \
|
||||
-L$(top_srcdir)/src/frontend/plotting/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/spicelib/devices/asrc/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bjt/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim1/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim2/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3v1/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3v2/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim4/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cap/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_pd/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_fd/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_dd/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cccs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ccvs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ccvs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cpl/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/csw/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/dio/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/spicelib/devices/ind/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/isrc/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/hfet1/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/hfet2/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/jfet/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/jfet2/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ltra/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mes/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mesa/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos1/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos2/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos3/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos6/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos9/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/res/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/soi3/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/sw/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/txl/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/tra/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/urc/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vccs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vcvs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vsrc/
|
||||
|
||||
|
||||
EXTRA_LIB_DIRS = \
|
||||
-L$(top_srcdir)/src/xspice/cm/.libs/ \
|
||||
-L$(top_srcdir)/src/xspice/enh/.libs/ \
|
||||
-L$(top_srcdir)/src/xspice/evt/.libs/ \
|
||||
-L$(top_srcdir)/src/xspice/idn/.libs/ \
|
||||
-L$(top_srcdir)/src/xspice/ipc/.libs/ \
|
||||
-L$(top_srcdir)/src/xspice/mif/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/analysis/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/parser/.libs/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/frontend/parser/.libs/ \
|
||||
-L$(top_srcdir)/src/frontend/help/.libs/ \
|
||||
-L$(top_srcdir)/src/maths/deriv/.libs/ \
|
||||
-L$(top_srcdir)/src/maths/cmaths/.libs/ \
|
||||
-L$(top_srcdir)/src/maths/poly/.libs/ \
|
||||
-L$(top_srcdir)/src/maths/ni/.libs/ \
|
||||
-L$(top_srcdir)/src/maths/sparse/.libs \
|
||||
-L$(top_srcdir)/src/misc/.libs/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/frontend/.libs/ \
|
||||
-L$(top_srcdir)/src/frontend/plotting/.libs/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/spicelib/devices/asrc/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bjt/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim1/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim2/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3v1/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3v2/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim4/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cap/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_pd/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_fd/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_dd/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cccs/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ccvs/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ccvs/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cpl/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/csw/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/dio/.libs/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/spicelib/devices/ind/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/isrc/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/hfet1/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/hfet2/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/jfet/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/jfet2/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ltra/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mes/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mesa/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos1/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos2/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos3/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos6/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos9/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/res/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/soi3/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/sw/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/txl/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/tra/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/urc/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vccs/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vcvs/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vsrc/.libs/
|
||||
|
||||
clean: clean-recursive
|
||||
rm -f cmextrn.h cminfo.h udnextrn.h udninfo.h *.o
|
||||
|
||||
|
||||
cmextrn.h: modpath.lst $(SUBDIRS)/cfunc.c $(SUBDIRS)/ifspec.c
|
||||
$(CMPPDIR)/cmpp -lst
|
||||
|
||||
cminfo.h: modpath.lst $(SUBDIRS)/cfunc.c $(SUBDIRS)/ifspec.c
|
||||
$(CMPPDIR)/cmpp -lst
|
||||
|
||||
udnextrn.h: udnpath.lst $(SUBDIRS)/cfunc.c $(SUBDIRS)/ifspec.c
|
||||
$(CMPPDIR)/cmpp -lst
|
||||
|
||||
udninfo.h: udnpath.lst $(SUBDIRS)/cfunc.c $(SUBDIRS)/ifspec.c
|
||||
$(CMPPDIR)/cmpp -lst
|
||||
|
||||
all: spice2poly.cm
|
||||
|
||||
spice2poly.cm: $(SUBDIRS)/cfunc.o $(SUBDIRS)/ifspec.o dlmain.o
|
||||
$(top_srcdir)/libtool --mode=link $(CC) -module -shared -fPIC -o spice2poly.cm \
|
||||
$(SUBDIRS)/cfunc.o $(SUBDIRS)/ifspec.o dlmain.o \
|
||||
$(SYSTEM_LIBS) $(LOCAL_LIB_DIRS) \
|
||||
-Wl,--start-group -Wl,$(LOCAL_LIBS) -Wl,--end-group -ldl \
|
||||
-Wl,--rpath,/usr/local/geda/lib/ng-spice-rework
|
||||
|
||||
dlmain.o: dlmain.c cmextrn.h udnextrn.h cminfo.h udninfo.h
|
||||
$(CC) -fPIC -I$(OPUS_INCLUDE_DIR) $(INCLUDES) $(CFLAGS) -DCM_LINUX -c dlmain.c
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Modify these to include general information about the library
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
char inf_Title[]="icm_poly.cm";
|
||||
char inf_Version[]="0.1";
|
||||
char inf_Description[]="Code model implementation of SPICE2 poly.";
|
||||
char inf_Author[]="Hacked together by SDB, June 2003.";
|
||||
char inf_Copyright[]="Released under GPL";
|
||||
|
||||
|
|
@ -1,408 +0,0 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Build cmextrn.h, cminfo.h, udnextrn.h and udninfo.h from udnpath.lst and
|
||||
// modpath.lst using 'cmpp -lst'. Then compile this file and link it with
|
||||
// cm and udn object files to produce a dll that can be loaded by the
|
||||
// spice opus simulator at run-time.
|
||||
//
|
||||
// Author: Arpad Buermen
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#include "dlinfo.h"
|
||||
|
||||
#include <devdefs.h>
|
||||
#include <evtudn.h>
|
||||
#include "port.h"
|
||||
#include "misc.h"
|
||||
#include "cmextrn.h"
|
||||
#include "udnextrn.h"
|
||||
#include "dllitf.h"
|
||||
|
||||
// This one is automatically set by the compiler
|
||||
char inf_Date[]=__DATE__;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Do not modify anything below this line
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
SPICEdev *cmDEVices[] = {
|
||||
#include "cminfo.h"
|
||||
NULL
|
||||
};
|
||||
|
||||
int cmDEVicesCNT = sizeof(cmDEVices)/sizeof(SPICEdev *)-1;
|
||||
|
||||
Evt_Udn_Info_t *cmEVTudns[] = {
|
||||
#include "udninfo.h"
|
||||
NULL
|
||||
};
|
||||
|
||||
int cmEVTudnCNT = sizeof(cmEVTudns)/sizeof(Evt_Udn_Info_t *)-1;
|
||||
|
||||
// Pointer to core info structure containing pointers to core functions.
|
||||
struct coreInfo_t *coreitf;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Functions that return pointers to structures.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#ifdef CM_WINDOWS
|
||||
#undef CM_EXPORT
|
||||
#define CM_EXPORT __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#ifdef CM_LINUX
|
||||
#undef CM_EXPORT
|
||||
#define CM_EXPORT extern
|
||||
#endif
|
||||
|
||||
int cmopusvers = 2;
|
||||
|
||||
// This one checks the opus dynamic link version.
|
||||
CM_EXPORT void *CMsysvers() {
|
||||
return (void *)&cmopusvers;
|
||||
}
|
||||
|
||||
// This one returns the title
|
||||
CM_EXPORT void *CMtitle() {
|
||||
return (void *)inf_Title;
|
||||
}
|
||||
|
||||
// This one returns the version
|
||||
CM_EXPORT void *CMversion() {
|
||||
return (void *)inf_Version;
|
||||
}
|
||||
|
||||
// This one returns the date
|
||||
CM_EXPORT void *CMdate() {
|
||||
return (void *)inf_Date;
|
||||
}
|
||||
|
||||
// This one returns the description
|
||||
CM_EXPORT void *CMdescription() {
|
||||
return (void *)inf_Description;
|
||||
}
|
||||
|
||||
// This one returns the author
|
||||
CM_EXPORT void *CMauthor() {
|
||||
return (void *)inf_Author;
|
||||
}
|
||||
|
||||
// This one returns the copyright
|
||||
CM_EXPORT void *CMcopyright() {
|
||||
return (void *)inf_Copyright;
|
||||
}
|
||||
|
||||
// This one returns the device table
|
||||
CM_EXPORT void *CMdevs() {
|
||||
return (void *)cmDEVices;
|
||||
}
|
||||
|
||||
// This one returns the device count
|
||||
CM_EXPORT void *CMdevNum() {
|
||||
return (void *)&cmDEVicesCNT;
|
||||
}
|
||||
|
||||
// This one returns the UDN table
|
||||
CM_EXPORT void *CMudns() {
|
||||
return (void *)cmEVTudns;
|
||||
}
|
||||
|
||||
// This one returns the UDN count
|
||||
CM_EXPORT void *CMudnNum() {
|
||||
return (void *)&cmEVTudnCNT;
|
||||
}
|
||||
|
||||
// This one returns the pointer to the pointer to the core interface structure
|
||||
CM_EXPORT void *CMgetCoreItfPtr() {
|
||||
return (void *)(&coreitf);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// These functions call the real core functions of SPICE OPUS using the
|
||||
// pointers in coreitf structure.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
void MIF_INP2A(
|
||||
GENERIC *ckt, /* circuit structure to put mod/inst structs in */
|
||||
INPtables *tab, /* symbol table for node names, etc. */
|
||||
card *current /* the card we are to parse */
|
||||
) {
|
||||
(coreitf->dllitf_MIF_INP2A)(ckt,tab,current);
|
||||
}
|
||||
|
||||
char * MIFgetMod(
|
||||
GENERIC *ckt,
|
||||
char **name,
|
||||
INPmodel **model,
|
||||
INPtables *tab
|
||||
) {
|
||||
return (coreitf->dllitf_MIFgetMod)(ckt,name,model,tab);
|
||||
}
|
||||
|
||||
IFvalue * MIFgetValue(
|
||||
GENERIC *ckt,
|
||||
char **line,
|
||||
int type,
|
||||
INPtables *tab,
|
||||
char **err
|
||||
) {
|
||||
return (coreitf->dllitf_MIFgetValue)(ckt,line,type,tab,err);
|
||||
}
|
||||
|
||||
|
||||
int MIFsetup(
|
||||
SMPmatrix *matrix,
|
||||
GENmodel *inModel,
|
||||
CKTcircuit *ckt,
|
||||
int *state
|
||||
) {
|
||||
return (coreitf->dllitf_MIFsetup)(matrix,inModel,ckt,state);
|
||||
}
|
||||
|
||||
int MIFunsetup(
|
||||
GENmodel *inModel,
|
||||
CKTcircuit *ckt
|
||||
) {
|
||||
return (coreitf->dllitf_MIFunsetup)(inModel,ckt);
|
||||
}
|
||||
|
||||
int MIFload(
|
||||
GENmodel *inModel,
|
||||
CKTcircuit *ckt
|
||||
) {
|
||||
return (coreitf->dllitf_MIFload)(inModel,ckt);
|
||||
}
|
||||
|
||||
|
||||
int MIFmParam(
|
||||
int param_index,
|
||||
IFvalue *value,
|
||||
GENmodel *inModel
|
||||
) {
|
||||
return (coreitf->dllitf_MIFmParam)(param_index,value,inModel);
|
||||
}
|
||||
|
||||
int MIFask(
|
||||
CKTcircuit *ckt,
|
||||
GENinstance *inst,
|
||||
int param_index,
|
||||
IFvalue *value,
|
||||
IFvalue *select
|
||||
) {
|
||||
return (coreitf->dllitf_MIFask)(ckt,inst,param_index,value,select);
|
||||
}
|
||||
|
||||
int MIFmAsk(
|
||||
CKTcircuit *ckt,
|
||||
GENmodel *inModel,
|
||||
int param_index,
|
||||
IFvalue *value
|
||||
) {
|
||||
return (coreitf->dllitf_MIFmAsk)(ckt,inModel,param_index,value);
|
||||
}
|
||||
|
||||
int MIFtrunc(
|
||||
GENmodel *inModel,
|
||||
CKTcircuit *ckt,
|
||||
double *timeStep
|
||||
) {
|
||||
return (coreitf->dllitf_MIFtrunc)(inModel,ckt,timeStep);
|
||||
}
|
||||
|
||||
int MIFconvTest(
|
||||
GENmodel *inModel,
|
||||
CKTcircuit *ckt
|
||||
) {
|
||||
return (coreitf->dllitf_MIFconvTest)(inModel,ckt);
|
||||
}
|
||||
|
||||
int MIFdelete(
|
||||
GENmodel *inModel,
|
||||
IFuid name,
|
||||
GENinstance **inst
|
||||
) {
|
||||
return (coreitf->dllitf_MIFdelete)(inModel,name,inst);
|
||||
}
|
||||
|
||||
int MIFmDelete(
|
||||
GENmodel **inModel,
|
||||
IFuid modname,
|
||||
GENmodel *model
|
||||
) {
|
||||
return (coreitf->dllitf_MIFmDelete)(inModel,modname,model);
|
||||
}
|
||||
|
||||
void MIFdestroy(
|
||||
GENmodel **inModel
|
||||
) {
|
||||
(coreitf->dllitf_MIFdestroy)(inModel);
|
||||
}
|
||||
|
||||
char *MIFgettok(
|
||||
char **s
|
||||
) {
|
||||
return (coreitf->dllitf_MIFgettok)(s);
|
||||
}
|
||||
|
||||
|
||||
char *MIFget_token(
|
||||
char **s,
|
||||
Mif_Token_Type_t *type
|
||||
) {
|
||||
return (coreitf->dllitf_MIFget_token)(s,type);
|
||||
}
|
||||
|
||||
|
||||
Mif_Cntl_Src_Type_t MIFget_cntl_src_type(
|
||||
Mif_Port_Type_t in_port_type,
|
||||
Mif_Port_Type_t out_port_type
|
||||
) {
|
||||
return (coreitf->dllitf_MIFget_cntl_src_type)(in_port_type,out_port_type);
|
||||
}
|
||||
|
||||
char *MIFcopy(char *c) {
|
||||
return (coreitf->dllitf_MIFcopy)(c);
|
||||
}
|
||||
|
||||
|
||||
void cm_climit_fcn(double in, double in_offset, double cntl_upper,
|
||||
double cntl_lower, double lower_delta,
|
||||
double upper_delta, double limit_range,
|
||||
double gain, int percent, double *out_final,
|
||||
double *pout_pin_final, double *pout_pcntl_lower_final,
|
||||
double *pout_pcntl_upper_final) {
|
||||
(coreitf->dllitf_cm_climit_fcn)(in,in_offset,cntl_upper,cntl_lower,lower_delta,
|
||||
upper_delta,limit_range,gain,percent,out_final,
|
||||
pout_pin_final,pout_pcntl_lower_final,
|
||||
pout_pcntl_upper_final);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void cm_smooth_corner(double x_input, double x_center, double y_center,
|
||||
double domain, double lower_slope, double upper_slope,
|
||||
double *y_output, double *dy_dx) {
|
||||
(coreitf->dllitf_cm_smooth_corner)(x_input,x_center,y_center,domain,lower_slope,
|
||||
upper_slope,y_output,dy_dx);
|
||||
}
|
||||
|
||||
void cm_smooth_discontinuity(double x_input, double x_lower, double y_lower,
|
||||
double x_upper, double y_upper,
|
||||
double *y_output, double *dy_dx) {
|
||||
(coreitf->dllitf_cm_smooth_discontinuity)(x_input,x_lower,y_lower,x_upper,y_upper,
|
||||
y_output,dy_dx);
|
||||
}
|
||||
|
||||
double cm_smooth_pwl(double x_input, double *x, double *y, int size,
|
||||
double input_domain, double *dout_din) {
|
||||
return (coreitf->dllitf_cm_smooth_pwl)(x_input,x,y,size,input_domain,dout_din);
|
||||
}
|
||||
|
||||
double cm_analog_ramp_factor(void) {
|
||||
return (coreitf->dllitf_cm_analog_ramp_factor)();
|
||||
}
|
||||
|
||||
void *cm_analog_alloc(int tag, int bytes) {
|
||||
return (coreitf->dllitf_cm_analog_alloc)(tag,bytes);
|
||||
}
|
||||
|
||||
void *cm_analog_get_ptr(int tag, int timepoint) {
|
||||
return (coreitf->dllitf_cm_analog_get_ptr)(tag,timepoint);
|
||||
}
|
||||
|
||||
int cm_analog_integrate(double integrand, double *integral, double *partial) {
|
||||
return (coreitf->dllitf_cm_analog_integrate)(integrand,integral,partial);
|
||||
}
|
||||
|
||||
int cm_analog_converge(double *state) {
|
||||
return (coreitf->dllitf_cm_analog_converge)(state);
|
||||
}
|
||||
|
||||
int cm_analog_set_temp_bkpt(double time) {
|
||||
return (coreitf->dllitf_cm_analog_set_temp_bkpt)(time);
|
||||
}
|
||||
|
||||
int cm_analog_set_perm_bkpt(double time) {
|
||||
return (coreitf->dllitf_cm_analog_set_perm_bkpt)(time);
|
||||
}
|
||||
|
||||
void cm_analog_not_converged(void) {
|
||||
(coreitf->dllitf_cm_analog_not_converged)();
|
||||
}
|
||||
|
||||
void cm_analog_auto_partial(void) {
|
||||
(coreitf->dllitf_cm_analog_auto_partial)();
|
||||
}
|
||||
|
||||
void *cm_event_alloc(int tag, int bytes){
|
||||
return (coreitf->dllitf_cm_event_alloc)(tag,bytes);
|
||||
}
|
||||
|
||||
void *cm_event_get_ptr(int tag, int timepoint) {
|
||||
return (coreitf->dllitf_cm_event_get_ptr)(tag,timepoint);
|
||||
}
|
||||
|
||||
int cm_event_queue(double time) {
|
||||
return (coreitf->dllitf_cm_event_queue)(time);
|
||||
}
|
||||
|
||||
char *cm_message_get_errmsg(void) {
|
||||
return (coreitf->dllitf_cm_message_get_errmsg)();
|
||||
}
|
||||
|
||||
int cm_message_send(char *msg) {
|
||||
return (coreitf->dllitf_cm_message_send)(msg);
|
||||
}
|
||||
|
||||
double cm_netlist_get_c(void) {
|
||||
return (coreitf->dllitf_cm_netlist_get_c)();
|
||||
}
|
||||
|
||||
double cm_netlist_get_l(void) {
|
||||
return (coreitf->dllitf_cm_netlist_get_l)();
|
||||
}
|
||||
|
||||
Complex_t cm_complex_set(double real, double imag) {
|
||||
return (coreitf->dllitf_cm_complex_set)(real,imag);
|
||||
}
|
||||
|
||||
Complex_t cm_complex_add(Complex_t x, Complex_t y) {
|
||||
return (coreitf->dllitf_cm_complex_add)(x,y);
|
||||
}
|
||||
|
||||
Complex_t cm_complex_subtract(Complex_t x, Complex_t y) {
|
||||
return (coreitf->dllitf_cm_complex_subtract)(x,y);
|
||||
}
|
||||
|
||||
Complex_t cm_complex_multiply(Complex_t x, Complex_t y) {
|
||||
return (coreitf->dllitf_cm_complex_multiply)(x,y);
|
||||
}
|
||||
|
||||
Complex_t cm_complex_divide(Complex_t x, Complex_t y) {
|
||||
return (coreitf->dllitf_cm_complex_divide)(x,y);
|
||||
}
|
||||
|
||||
FILE * cm_stream_out(void) {
|
||||
return (coreitf->dllitf_cm_stream_out)();
|
||||
}
|
||||
|
||||
FILE * cm_stream_in(void) {
|
||||
return (coreitf->dllitf_cm_stream_in)();
|
||||
}
|
||||
|
||||
FILE * cm_stream_err(void) {
|
||||
return (coreitf->dllitf_cm_stream_err)();
|
||||
}
|
||||
|
||||
char * tmalloc_internal(size_t s, int clean, const char *f, int l, int sw) {
|
||||
return (coreitf->dllitf_tmalloc)(s,clean,f,l,sw);
|
||||
}
|
||||
|
||||
char * trealloc_internal(char *ptr, size_t s, const char *f, int l, int sw) {
|
||||
return (coreitf->dllitf_trealloc)(ptr,s,f,l,sw);
|
||||
}
|
||||
|
||||
void tfree_internal(char *ptr, const char *f, int l, int sw) {
|
||||
(coreitf->dllitf_tfree)(ptr,f,l,sw);
|
||||
}
|
||||
|
|
@ -1,193 +0,0 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
#
|
||||
# Makefile.am hand-crafted by SDB on 5.25.2003 to create POLY
|
||||
# codemodel shared object. To enable simulation of POLY controlled sources,
|
||||
# do the following:
|
||||
#
|
||||
|
||||
# Edit this to point to cmpp in your installation.
|
||||
CMPPDIR = $(top_srcdir)/src/xspice/cmpp
|
||||
|
||||
##------ automake definitions below. ------
|
||||
##
|
||||
|
||||
## Yes, listing all this stuff is ugly, but I wasn't clever enough to
|
||||
## find a better way to make it work.
|
||||
|
||||
SYSTEM_LIBS = -lm -lncurses -L/usr/X11R6/lib -lX11 -lXt -lXext -lXmu -lXaw -lSM -lICE
|
||||
|
||||
LOCAL_LIBS = -lcmxsp,-levtxsp,-lidnxsp,-lipcxsp,-lenhxsp,-lmifxsp,-ldev,-lckt,-linp,-lparser,-lhlp,-linp,-lderiv,-lcmaths,-lpoly,-lni,-lsparse,-lmisc,-lfte,-lplotting
|
||||
|
||||
DEVICE_LIBS = -lasrc,-lbjt,-lbsim1,-lbsim2,-lbsim3,-lbsim3v1,-lbsim3v2,-lbsim4,-lcap,-lbsim3soipd,-lbsim3soifd,-lbsim3soidd,-lcccs,-lccvs,-lccvs,-lcpl,-lcsw,-ldio,-lind,-lisrc,-lhfet,-lhfet2,-ljfet,-ljfet2,-lltra,-lmes,-lmesa,-lmos1,-lmos2,-lmos3,-lmos6,-lmos9,-lres,-lsoi3,-lsw,-ltxl,-ltra,-lurc,-lvccs,-lvcvs,-lvsrc
|
||||
|
||||
|
||||
LOCAL_LIB_DIRS = \
|
||||
-L$(top_srcdir)/src/xspice/cm/ \
|
||||
-L$(top_srcdir)/src/xspice/enh/ \
|
||||
-L$(top_srcdir)/src/xspice/evt/ \
|
||||
-L$(top_srcdir)/src/xspice/idn/ \
|
||||
-L$(top_srcdir)/src/xspice/ipc/ \
|
||||
-L$(top_srcdir)/src/xspice/mif/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ \
|
||||
-L$(top_srcdir)/src/spicelib/analysis/ \
|
||||
-L$(top_srcdir)/src/spicelib/parser/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/frontend/parser/ \
|
||||
-L$(top_srcdir)/src/frontend/help/ \
|
||||
-L$(top_srcdir)/src/maths/deriv/ \
|
||||
-L$(top_srcdir)/src/maths/cmaths/ \
|
||||
-L$(top_srcdir)/src/maths/poly/ \
|
||||
-L$(top_srcdir)/src/maths/ni/ \
|
||||
-L$(top_srcdir)/src/maths/sparse/ \
|
||||
-L$(top_srcdir)/src/misc/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/frontend/ \
|
||||
-L$(top_srcdir)/src/frontend/plotting/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/spicelib/devices/asrc/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bjt/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim1/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim2/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3v1/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3v2/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim4/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cap/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_pd/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_fd/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_dd/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cccs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ccvs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ccvs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cpl/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/csw/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/dio/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/spicelib/devices/ind/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/isrc/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/hfet1/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/hfet2/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/jfet/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/jfet2/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ltra/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mes/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mesa/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos1/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos2/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos3/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos6/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos9/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/res/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/soi3/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/sw/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/txl/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/tra/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/urc/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vccs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vcvs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vsrc/
|
||||
|
||||
|
||||
EXTRA_LIB_DIRS = \
|
||||
-L$(top_srcdir)/src/xspice/cm/.libs/ \
|
||||
-L$(top_srcdir)/src/xspice/enh/.libs/ \
|
||||
-L$(top_srcdir)/src/xspice/evt/.libs/ \
|
||||
-L$(top_srcdir)/src/xspice/idn/.libs/ \
|
||||
-L$(top_srcdir)/src/xspice/ipc/.libs/ \
|
||||
-L$(top_srcdir)/src/xspice/mif/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/analysis/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/parser/.libs/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/frontend/parser/.libs/ \
|
||||
-L$(top_srcdir)/src/frontend/help/.libs/ \
|
||||
-L$(top_srcdir)/src/maths/deriv/.libs/ \
|
||||
-L$(top_srcdir)/src/maths/cmaths/.libs/ \
|
||||
-L$(top_srcdir)/src/maths/poly/.libs/ \
|
||||
-L$(top_srcdir)/src/maths/ni/.libs/ \
|
||||
-L$(top_srcdir)/src/maths/sparse/.libs \
|
||||
-L$(top_srcdir)/src/misc/.libs/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/frontend/.libs/ \
|
||||
-L$(top_srcdir)/src/frontend/plotting/.libs/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/spicelib/devices/asrc/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bjt/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim1/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim2/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3v1/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3v2/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim4/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cap/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_pd/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_fd/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/bsim3soi_dd/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cccs/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ccvs/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ccvs/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/cpl/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/csw/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/dio/.libs/ \
|
||||
\
|
||||
-L$(top_srcdir)/src/spicelib/devices/ind/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/isrc/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/hfet1/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/hfet2/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/jfet/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/jfet2/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/ltra/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mes/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mesa/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos1/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos2/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos3/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos6/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/mos9/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/res/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/soi3/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/sw/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/txl/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/tra/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/urc/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vccs/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vcvs/.libs/ \
|
||||
-L$(top_srcdir)/src/spicelib/devices/vsrc/.libs/
|
||||
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/src/include -I$(top_srcdir)
|
||||
|
||||
EXTRA_DIST = cfunc.mod ifspec.ifs README cfunc.c ifspec.c README
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
##------ Make targets listed below. ------
|
||||
|
||||
all: cfunc.o ifspec.o
|
||||
|
||||
clean:
|
||||
rm -f *.o *.cm *.la
|
||||
rm -fR .libs
|
||||
|
||||
cfunc.o: cfunc.c
|
||||
$(CC) -fPIC $(INCLUDES) $(CFLAGS) -c cfunc.c
|
||||
|
||||
ifspec.o: ifspec.c
|
||||
$(CC) -fPIC $(INCLUDES) $(CFLAGS) -c ifspec.c
|
||||
|
||||
# Don't use the below targets unless you know what you are doing!
|
||||
#
|
||||
# Hint: if you create ifspec.c using cmpp, you need to replace MIFunsetup
|
||||
# with NULL in ifspec.c before making ifspec.o (compiling with gcc) because
|
||||
# MIFunsetup is apparently unimplemented.
|
||||
#
|
||||
#cclean: clean
|
||||
# rm -f cfunc.c ifspec.c
|
||||
#
|
||||
#cfunc.c: cfunc.mod
|
||||
# $(CMPPDIR)/cmpp -mod cfunc.mod
|
||||
#
|
||||
#ifspec.c: ifspec.ifs
|
||||
# $(CMPPDIR)/cmpp -ifs
|
||||
|
||||
|
||||
|
|
@ -1,305 +0,0 @@
|
|||
#line 1 "cfunc.mod"
|
||||
#include "cm.h"
|
||||
#line 1 "cfunc.mod"
|
||||
/* ===========================================================================
|
||||
FILE cfunc.mod
|
||||
|
||||
MEMBER OF process XSPICE
|
||||
|
||||
Copyright 1991
|
||||
Georgia Tech Research Corporation
|
||||
Atlanta, Georgia 30332
|
||||
All Rights Reserved
|
||||
|
||||
PROJECT A-8503
|
||||
|
||||
AUTHORS
|
||||
|
||||
9/12/91 Bill Kuhn
|
||||
|
||||
MODIFICATIONS
|
||||
|
||||
<date> <person name> <nature of modifications>
|
||||
|
||||
SUMMARY
|
||||
|
||||
This file contains the definition of a code model polynomial controlled
|
||||
source compatible with SPICE 2G6 poly sources.
|
||||
|
||||
INTERFACES
|
||||
|
||||
spice2poly()
|
||||
|
||||
REFERENCED FILES
|
||||
|
||||
None.
|
||||
|
||||
NON-STANDARD FEATURES
|
||||
|
||||
None.
|
||||
|
||||
=========================================================================== */
|
||||
|
||||
/*
|
||||
|
||||
This code model implements the non-linear polynomial controlled sources
|
||||
available in SPICE 2G6. An automatic translator added into the simulator
|
||||
front end is used to map 2G6 syntax into a call to this model in the
|
||||
required syntax.
|
||||
|
||||
This model may also be called directly as follows:
|
||||
|
||||
a1 [ <input(s)> ] <output> xxx
|
||||
.model xxx spice2poly ( coef = [ <list of 2G6 compatible coefficients> ] )
|
||||
|
||||
Refer to the 2G6 User Guide for an explanation of the coefficients.
|
||||
|
||||
|
||||
This model is patterned after the FORTRAN code used in the 2G6 simulator.
|
||||
Function cm_poly() below performs the functions of subroutines NLCSRC and
|
||||
EVPOLY. Function evterm() performs the function of subroutine EVTERM,
|
||||
and function nxtpwr() performs the function of subroutine NXTPWR.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
void *malloc(int);
|
||||
void free(void *);
|
||||
|
||||
/* SPICE 2G6 type utility functions */
|
||||
static double evterm(double x, int n);
|
||||
static void nxtpwr(int *pwrseq, int pdim);
|
||||
|
||||
|
||||
|
||||
|
||||
void spice2poly (Mif_Private_t *private)
|
||||
{
|
||||
int num_inputs; /* Number of inputs to model */
|
||||
int num_coefs; /* Number of coefficients */
|
||||
int *exp; /* List of exponents in products */
|
||||
/* One for each input */
|
||||
|
||||
int i; /* Counter */
|
||||
int j; /* Counter */
|
||||
int k; /* Counter */
|
||||
|
||||
double *in; /* Values of inputs to model */
|
||||
double *coef; /* Values of coefficients */
|
||||
|
||||
double sum; /* Temporary for accumulating sum of terms */
|
||||
double product; /* Temporary for accumulating product */
|
||||
|
||||
double *acgains; /* Static variable holding AC gains for AC analysis */
|
||||
|
||||
|
||||
/* Get number of input values */
|
||||
|
||||
num_inputs = private->conn[0]->size;
|
||||
|
||||
/* If this is the first call to the model, allocate the static variable */
|
||||
/* array */
|
||||
|
||||
if(private->circuit.init) {
|
||||
acgains = malloc(num_inputs * sizeof(double));
|
||||
for(i = 0; i < num_inputs; i++)
|
||||
acgains[i] = 0.0;
|
||||
private->inst_var[0]->element[0].pvalue = acgains;
|
||||
}
|
||||
else
|
||||
acgains = private->inst_var[0]->element[0].pvalue;
|
||||
|
||||
/* If analysis type is AC, use the previously computed DC partials */
|
||||
/* for the AC gains */
|
||||
|
||||
if(private->circuit.anal_type == MIF_AC) {
|
||||
for(i = 0; i < num_inputs; i++) {
|
||||
acgains = private->inst_var[0]->element[0].pvalue;
|
||||
private->conn[1]->port[0]->ac_gain[0].port[i].real = acgains[i];
|
||||
private->conn[1]->port[0]->ac_gain[0].port[i].imag = 0.0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get input values and coefficients to local storage for faster access */
|
||||
|
||||
in = malloc(num_inputs * sizeof(double));
|
||||
for(i = 0; i < num_inputs; i++)
|
||||
in[i] = private->conn[0]->port[i]->input.rvalue;
|
||||
|
||||
num_coefs = private->param[0]->size;
|
||||
|
||||
coef = malloc(num_coefs * sizeof(double));
|
||||
for(i = 0; i < num_coefs; i++)
|
||||
coef[i] = private->param[0]->element[i].rvalue;
|
||||
|
||||
|
||||
/* Allocate the array of exponents used in computing the poly terms */
|
||||
exp = malloc(num_inputs * sizeof(int));
|
||||
|
||||
/* Initialize the exponents to zeros */
|
||||
for(i = 0; i < num_inputs; i++)
|
||||
exp[i] = 0;
|
||||
|
||||
|
||||
/* Compute the output of the source by summing the required products */
|
||||
for(i = 1, sum = coef[0]; i < num_coefs; i++) {
|
||||
|
||||
/* Get the list of powers for the product terms in this term of the sum */
|
||||
nxtpwr(exp, num_inputs);
|
||||
|
||||
/* Form the product of the inputs taken to the required powers */
|
||||
for(j = 0, product = 1.0; j < num_inputs; j++)
|
||||
product *= evterm(in[j], exp[j]);
|
||||
|
||||
/* Add the product times the appropriate coefficient into the sum */
|
||||
sum += coef[i] * product;
|
||||
}
|
||||
private->conn[1]->port[0]->output.rvalue = sum;
|
||||
|
||||
|
||||
/* Compute and output the partials for each input */
|
||||
for(i = 0; i < num_inputs; i++) {
|
||||
|
||||
/* Reinitialize the exponent list to zeros */
|
||||
for(j = 0; j < num_inputs; j++)
|
||||
exp[j] = 0;
|
||||
|
||||
/* Compute the partials by summing the required products */
|
||||
for(j = 1, sum = 0.0; j < num_coefs; j++) {
|
||||
|
||||
/* Get the list of powers for the product terms in this term of the sum */
|
||||
nxtpwr(exp, num_inputs);
|
||||
|
||||
/* If power for input for which partial is being evaluated */
|
||||
/* is zero, the term is a constant, so the partial is zero */
|
||||
if(exp[i] == 0)
|
||||
continue;
|
||||
|
||||
/* Form the product of the inputs taken to the required powers */
|
||||
for(k = 0, product = 1.0; k < num_inputs; k++) {
|
||||
/* If input is not the one for which the partial is being taken */
|
||||
/* take the term to the specified exponent */
|
||||
if(k != i)
|
||||
product *= evterm(in[k], exp[k]);
|
||||
/* else, take the derivative of this term as n*x**(n-1) */
|
||||
else
|
||||
product *= exp[k] * evterm(in[k], exp[k] - 1);
|
||||
}
|
||||
|
||||
/* Add the product times the appropriate coefficient into the sum */
|
||||
sum += coef[j] * product;
|
||||
}
|
||||
|
||||
private->conn[1]->port[0]->partial[0].port[i] = sum;
|
||||
|
||||
/* If this is DC analysis, save the partial for use as AC gain */
|
||||
/* value in an AC analysis */
|
||||
|
||||
if(private->circuit.anal_type == MIF_DC)
|
||||
acgains[i] = sum;
|
||||
}
|
||||
|
||||
/* Free the allocated items and return */
|
||||
free(in);
|
||||
free(coef);
|
||||
free(exp);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Function evterm computes the value of x**n */
|
||||
|
||||
static double evterm(
|
||||
double x,
|
||||
int n)
|
||||
{
|
||||
double product; /* Temporary accumlator for forming the product */
|
||||
|
||||
product = 1.0;
|
||||
while(n > 0) {
|
||||
product *= x;
|
||||
n--;
|
||||
}
|
||||
|
||||
return(product);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
This function is a literal translation of subroutine NXTPWR in SPICE 2G6.
|
||||
This was done to guarantee compatibility with the ordering of
|
||||
coefficients used by 2G6. The 2G6 User Guide does not completely define
|
||||
the algorithm used and the GOTO loaded FORTRAN code is difficult to unravel.
|
||||
Therefore, a one-to-one translation was deemed the safest approach.
|
||||
|
||||
No attempt is made to document the function statements since no documentaton
|
||||
is available in the 2G6 code. However, it can be noted that the code
|
||||
appears to generate the exponents of the product terms in the sum-of-products
|
||||
produced by the following expansion for two and three dimensional polynomials:
|
||||
|
||||
2D (a + b) ** n
|
||||
3D (a + (b + c)) ** n
|
||||
|
||||
where n begins at 1 and increments as needed for as many terms as there are
|
||||
coefficients on the polynomial source SPICE deck card, and where terms that
|
||||
are identical under the laws of associativity are dropped. Thus, for example,
|
||||
the exponents for the following sums are produced:
|
||||
|
||||
2D a + b + a**2 + ab + b**2 + c**3 + ...
|
||||
3D a + b + c + a**2 + a*b + a*c + b**2 + bc + c**2 + a**3 + ...
|
||||
|
||||
*/
|
||||
|
||||
/* Define a macro to tranlate between FORTRAN-style array references */
|
||||
/* and C-style array references */
|
||||
|
||||
#define PWRSEQ(x) pwrseq[x - 1]
|
||||
|
||||
|
||||
static void nxtpwr(
|
||||
int *pwrseq, /* Array of exponents */
|
||||
int pdim)
|
||||
{
|
||||
int i;
|
||||
int k;
|
||||
int km1;
|
||||
int psum;
|
||||
|
||||
if(pdim == 1) goto stmt80;
|
||||
k = pdim;
|
||||
stmt10: if(PWRSEQ(k) != 0) goto stmt20;
|
||||
k = k - 1;
|
||||
if(k != 0) goto stmt10;
|
||||
goto stmt80;
|
||||
stmt20: if(k == pdim) goto stmt30;
|
||||
PWRSEQ(k) = PWRSEQ(k) - 1;
|
||||
PWRSEQ(k+1) = PWRSEQ(k+1) + 1;
|
||||
goto stmt100;
|
||||
stmt30: km1 = k - 1;
|
||||
for(i = 1; i <= km1; i++)
|
||||
if(PWRSEQ(i) != 0) goto stmt50;
|
||||
stmt40: PWRSEQ(1) = PWRSEQ(pdim) + 1;
|
||||
PWRSEQ(pdim) = 0;
|
||||
goto stmt100;
|
||||
stmt50: psum = 1;
|
||||
k = pdim;
|
||||
stmt60: if(PWRSEQ(k-1) >= 1) goto stmt70;
|
||||
psum = psum + PWRSEQ(k);
|
||||
PWRSEQ(k) = 0;
|
||||
k = k - 1;
|
||||
goto stmt60;
|
||||
stmt70: PWRSEQ(k) = PWRSEQ(k) + psum;
|
||||
PWRSEQ(k-1) = PWRSEQ(k-1) - 1;
|
||||
goto stmt100;
|
||||
stmt80: PWRSEQ(1) = PWRSEQ(1) + 1;
|
||||
|
||||
stmt100: return;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,187 +0,0 @@
|
|||
|
||||
/*
|
||||
* Structures for model: spice2poly
|
||||
*
|
||||
* Automatically generated by cmpp preprocessor
|
||||
*
|
||||
* !!! DO NOT EDIT !!!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// #include "prefix.h"
|
||||
#include <stdio.h>
|
||||
#include "ngspice.h"
|
||||
#include "devdefs.h"
|
||||
#include "ifsim.h"
|
||||
#include "mifdefs.h"
|
||||
#include "mifproto.h"
|
||||
#include "mifparse.h"
|
||||
// #include "suffix.h"
|
||||
|
||||
|
||||
static IFparm MIFmPTable[] = {
|
||||
IOP("coef", 0, (IF_REAL|IF_VECTOR), "2g6 compatible spice card coefficient list"),
|
||||
};
|
||||
|
||||
|
||||
static IFparm MIFpTable[] = {
|
||||
OP("acgains", 1, IF_STRING, "partial derivatives from dc analysis used for ac gains"),
|
||||
};
|
||||
|
||||
|
||||
static Mif_Port_Type_t MIFportEnum0[] = {
|
||||
MIF_DIFF_VOLTAGE,
|
||||
MIF_DIFF_CURRENT,
|
||||
MIF_VSOURCE_CURRENT,
|
||||
};
|
||||
|
||||
|
||||
static char *MIFportStr0[] = {
|
||||
"vd",
|
||||
"id",
|
||||
"vnam",
|
||||
};
|
||||
|
||||
|
||||
static Mif_Port_Type_t MIFportEnum1[] = {
|
||||
MIF_DIFF_VOLTAGE,
|
||||
MIF_DIFF_CURRENT,
|
||||
};
|
||||
|
||||
|
||||
static char *MIFportStr1[] = {
|
||||
"vd",
|
||||
"id",
|
||||
};
|
||||
|
||||
|
||||
static Mif_Conn_Info_t MIFconnTable[] = {
|
||||
{
|
||||
"in",
|
||||
"input",
|
||||
MIF_IN,
|
||||
MIF_DIFF_VOLTAGE,
|
||||
"vd",
|
||||
3,
|
||||
MIFportEnum0,
|
||||
MIFportStr0,
|
||||
MIF_TRUE,
|
||||
MIF_TRUE,
|
||||
1,
|
||||
MIF_FALSE,
|
||||
0,
|
||||
MIF_FALSE,
|
||||
},
|
||||
{
|
||||
"out",
|
||||
"output",
|
||||
MIF_OUT,
|
||||
MIF_DIFF_VOLTAGE,
|
||||
"vd",
|
||||
2,
|
||||
MIFportEnum1,
|
||||
MIFportStr1,
|
||||
MIF_FALSE,
|
||||
MIF_FALSE,
|
||||
0,
|
||||
MIF_FALSE,
|
||||
0,
|
||||
MIF_FALSE,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
static Mif_Param_Info_t MIFparamTable[] = {
|
||||
{
|
||||
"coef",
|
||||
"2g6 compatible spice card coefficient list",
|
||||
MIF_REAL,
|
||||
MIF_FALSE,
|
||||
{MIF_FALSE, 0, 0.0, {0.0, 0.0}, NULL},
|
||||
MIF_FALSE,
|
||||
{MIF_FALSE, 0, 0.0, {0.0, 0.0}, NULL},
|
||||
MIF_FALSE,
|
||||
{MIF_FALSE, 0, 0.0, {0.0, 0.0}, NULL},
|
||||
MIF_TRUE,
|
||||
MIF_FALSE,
|
||||
0,
|
||||
MIF_TRUE,
|
||||
2,
|
||||
MIF_FALSE,
|
||||
0,
|
||||
MIF_FALSE,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
static Mif_Inst_Var_Info_t MIFinst_varTable[] = {
|
||||
{
|
||||
"acgains",
|
||||
"partial derivatives from dc analysis used for ac gains",
|
||||
MIF_STRING,
|
||||
MIF_FALSE,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
extern void spice2poly(Mif_Private_t *);
|
||||
|
||||
static int val_terms = 0;
|
||||
static int val_numNames = 0;
|
||||
static int val_numInstanceParms = 1;
|
||||
static int val_numModelParms = 1;
|
||||
static int val_sizeofMIFinstance = sizeof(MIFinstance);
|
||||
static int val_sizeofMIFmodel = sizeof(MIFmodel);
|
||||
|
||||
SPICEdev spice2poly_info = {
|
||||
{ "spice2poly",
|
||||
"2g6 compatible polynomial controlled source",
|
||||
&val_terms,
|
||||
&val_numNames,
|
||||
NULL,
|
||||
&val_numInstanceParms,
|
||||
MIFpTable,
|
||||
&val_numModelParms,
|
||||
MIFmPTable,
|
||||
spice2poly,
|
||||
2,
|
||||
MIFconnTable,
|
||||
1,
|
||||
MIFparamTable,
|
||||
1,
|
||||
MIFinst_varTable,
|
||||
},
|
||||
NULL,
|
||||
MIFmParam,
|
||||
MIFload,
|
||||
MIFsetup,
|
||||
NULL, /* removed by sdb MIFunsetup, */
|
||||
NULL,
|
||||
NULL,
|
||||
MIFtrunc,
|
||||
NULL,
|
||||
MIFload,
|
||||
NULL,
|
||||
MIFdestroy,
|
||||
MIFmDelete,
|
||||
MIFdelete,
|
||||
NULL,
|
||||
MIFask,
|
||||
MIFmAsk,
|
||||
NULL,
|
||||
MIFconvTest,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&val_sizeofMIFinstance,
|
||||
&val_sizeofMIFmodel,
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
cmpp -mod cfunc.mod
|
||||
cmpp -ifs
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
# Edit this file to set global include paths,
|
||||
# compiler info and subdirs
|
||||
|
||||
# Directory sturcture
|
||||
SHELL = @SHELL@
|
||||
srcdir = @srcdir@
|
||||
top_builddir = ../../..
|
||||
top_srcdir = @top_srcdir@
|
||||
subdir = src/xspice/icm
|
||||
|
||||
# C compiler to use
|
||||
CC = @CC@
|
||||
|
||||
# Spice header include path
|
||||
INCLUDES = -I$(TOPDIR)$(top_srcdir)/src/include -I$(TOPDIR)$(top_builddir)
|
||||
|
||||
# CFLAGS to use here
|
||||
CFLAGS = @CFLAGS@ -fPIC -DCM_LINUX
|
||||
|
||||
# Path to the cmpp utility
|
||||
CMPP = $(TOPDIR)$(top_builddir)/src/xspice/cmpp/cmpp
|
||||
|
||||
# Flags to use when linking shared library
|
||||
LDFLAGS = -shared
|
||||
|
||||
# The codemodels to make
|
||||
CMDIRS = spice2poly
|
||||
|
|
@ -1 +0,0 @@
|
|||
icm_spice2poly/*.o
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
#
|
||||
# JW 3/9/01 - had a go and makeing an autoconf script.
|
||||
|
||||
noinst_LIBRARIES = libidnxsp.a
|
||||
|
||||
libidnxsp_a_SOURCES = \
|
||||
ifspec.c \
|
||||
cfunc.c
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/src/include
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
ifspec.c:
|
||||
cmpp -ifs
|
||||
cfunc.c:
|
||||
cmpp -mod cfunc.mod
|
||||
|
|
@ -1,307 +0,0 @@
|
|||
#line 1 "cfunc.mod"
|
||||
#include "cm.h"
|
||||
#line 1 "cfunc.mod"
|
||||
/* ===========================================================================
|
||||
FILE cfunc.mod
|
||||
|
||||
MEMBER OF process XSPICE
|
||||
|
||||
Copyright 1991
|
||||
Georgia Tech Research Corporation
|
||||
Atlanta, Georgia 30332
|
||||
All Rights Reserved
|
||||
|
||||
PROJECT A-8503
|
||||
|
||||
AUTHORS
|
||||
|
||||
9/12/91 Bill Kuhn
|
||||
|
||||
MODIFICATIONS
|
||||
|
||||
<date> <person name> <nature of modifications>
|
||||
|
||||
SUMMARY
|
||||
|
||||
This file contains the definition of a code model polynomial controlled
|
||||
source compatible with SPICE 2G6 poly sources.
|
||||
|
||||
INTERFACES
|
||||
|
||||
icm_poly()
|
||||
|
||||
REFERENCED FILES
|
||||
|
||||
None.
|
||||
|
||||
NON-STANDARD FEATURES
|
||||
|
||||
None.
|
||||
|
||||
=========================================================================== */
|
||||
|
||||
/*
|
||||
|
||||
This code model implements the non-linear polynomial controlled sources
|
||||
available in SPICE 2G6. An automatic translator added into the simulator
|
||||
front end is used to map 2G6 syntax into a call to this model in the
|
||||
required syntax.
|
||||
|
||||
This model may also be called directly as follows:
|
||||
|
||||
a1 [ <input(s)> ] <output> xxx
|
||||
.model xxx poly ( coef = [ <list of 2G6 compatible coefficients> ] )
|
||||
|
||||
Refer to the 2G6 User Guide for an explanation of the coefficients.
|
||||
|
||||
|
||||
This model is patterned after the FORTRAN code used in the 2G6 simulator.
|
||||
Function cm_poly() below performs the functions of subroutines NLCSRC and
|
||||
EVPOLY. Function evterm() performs the function of subroutine EVTERM,
|
||||
and function nxtpwr() performs the function of subroutine NXTPWR.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
void *malloc(int);
|
||||
void free(void *);
|
||||
|
||||
/* SPICE 2G6 type utility functions */
|
||||
static double evterm(double x, int n);
|
||||
static void nxtpwr(int *pwrseq, int pdim);
|
||||
|
||||
|
||||
|
||||
|
||||
void icm_poly (Mif_Private_t *private)
|
||||
{
|
||||
int num_inputs; /* Number of inputs to model */
|
||||
int num_coefs; /* Number of coefficients */
|
||||
int *exp; /* List of exponents in products */
|
||||
/* One for each input */
|
||||
|
||||
int i; /* Counter */
|
||||
int j; /* Counter */
|
||||
int k; /* Counter */
|
||||
|
||||
double *in; /* Values of inputs to model */
|
||||
double *coef; /* Values of coefficients */
|
||||
|
||||
double sum; /* Temporary for accumulating sum of terms */
|
||||
double product; /* Temporary for accumulating product */
|
||||
|
||||
double *acgains; /* Static variable holding AC gains for AC analysis */
|
||||
|
||||
/* debug statement */
|
||||
printf("In icm_poly!!! . . . .\n");
|
||||
|
||||
/* Get number of input values */
|
||||
|
||||
num_inputs = private->conn[0]->size;
|
||||
|
||||
/* If this is the first call to the model, allocate the static variable */
|
||||
/* array */
|
||||
|
||||
if(private->circuit.init) {
|
||||
acgains = malloc(num_inputs * sizeof(double));
|
||||
for(i = 0; i < num_inputs; i++)
|
||||
acgains[i] = 0.0;
|
||||
private->inst_var[0]->element[0].pvalue = acgains;
|
||||
}
|
||||
else
|
||||
acgains = private->inst_var[0]->element[0].pvalue;
|
||||
|
||||
/* If analysis type is AC, use the previously computed DC partials */
|
||||
/* for the AC gains */
|
||||
|
||||
if(private->circuit.anal_type == MIF_AC) {
|
||||
for(i = 0; i < num_inputs; i++) {
|
||||
acgains = private->inst_var[0]->element[0].pvalue;
|
||||
private->conn[1]->port[0]->ac_gain[0].port[i].real = acgains[i];
|
||||
private->conn[1]->port[0]->ac_gain[0].port[i].imag = 0.0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get input values and coefficients to local storage for faster access */
|
||||
|
||||
in = malloc(num_inputs * sizeof(double));
|
||||
for(i = 0; i < num_inputs; i++)
|
||||
in[i] = private->conn[0]->port[i]->input.rvalue;
|
||||
|
||||
num_coefs = private->param[0]->size;
|
||||
|
||||
coef = malloc(num_coefs * sizeof(double));
|
||||
for(i = 0; i < num_coefs; i++)
|
||||
coef[i] = private->param[0]->element[i].rvalue;
|
||||
|
||||
|
||||
/* Allocate the array of exponents used in computing the poly terms */
|
||||
exp = malloc(num_inputs * sizeof(int));
|
||||
|
||||
/* Initialize the exponents to zeros */
|
||||
for(i = 0; i < num_inputs; i++)
|
||||
exp[i] = 0;
|
||||
|
||||
|
||||
/* Compute the output of the source by summing the required products */
|
||||
for(i = 1, sum = coef[0]; i < num_coefs; i++) {
|
||||
|
||||
/* Get the list of powers for the product terms in this term of the sum */
|
||||
nxtpwr(exp, num_inputs);
|
||||
|
||||
/* Form the product of the inputs taken to the required powers */
|
||||
for(j = 0, product = 1.0; j < num_inputs; j++)
|
||||
product *= evterm(in[j], exp[j]);
|
||||
|
||||
/* Add the product times the appropriate coefficient into the sum */
|
||||
sum += coef[i] * product;
|
||||
}
|
||||
private->conn[1]->port[0]->output.rvalue = sum;
|
||||
|
||||
|
||||
/* Compute and output the partials for each input */
|
||||
for(i = 0; i < num_inputs; i++) {
|
||||
|
||||
/* Reinitialize the exponent list to zeros */
|
||||
for(j = 0; j < num_inputs; j++)
|
||||
exp[j] = 0;
|
||||
|
||||
/* Compute the partials by summing the required products */
|
||||
for(j = 1, sum = 0.0; j < num_coefs; j++) {
|
||||
|
||||
/* Get the list of powers for the product terms in this term of the sum */
|
||||
nxtpwr(exp, num_inputs);
|
||||
|
||||
/* If power for input for which partial is being evaluated */
|
||||
/* is zero, the term is a constant, so the partial is zero */
|
||||
if(exp[i] == 0)
|
||||
continue;
|
||||
|
||||
/* Form the product of the inputs taken to the required powers */
|
||||
for(k = 0, product = 1.0; k < num_inputs; k++) {
|
||||
/* If input is not the one for which the partial is being taken */
|
||||
/* take the term to the specified exponent */
|
||||
if(k != i)
|
||||
product *= evterm(in[k], exp[k]);
|
||||
/* else, take the derivative of this term as n*x**(n-1) */
|
||||
else
|
||||
product *= exp[k] * evterm(in[k], exp[k] - 1);
|
||||
}
|
||||
|
||||
/* Add the product times the appropriate coefficient into the sum */
|
||||
sum += coef[j] * product;
|
||||
}
|
||||
|
||||
private->conn[1]->port[0]->partial[0].port[i] = sum;
|
||||
|
||||
/* If this is DC analysis, save the partial for use as AC gain */
|
||||
/* value in an AC analysis */
|
||||
|
||||
if(private->circuit.anal_type == MIF_DC)
|
||||
acgains[i] = sum;
|
||||
}
|
||||
|
||||
/* Free the allocated items and return */
|
||||
free(in);
|
||||
free(coef);
|
||||
free(exp);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Function evterm computes the value of x**n */
|
||||
|
||||
static double evterm(
|
||||
double x,
|
||||
int n)
|
||||
{
|
||||
double product; /* Temporary accumlator for forming the product */
|
||||
|
||||
product = 1.0;
|
||||
while(n > 0) {
|
||||
product *= x;
|
||||
n--;
|
||||
}
|
||||
|
||||
return(product);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
This function is a literal translation of subroutine NXTPWR in SPICE 2G6.
|
||||
This was done to guarantee compatibility with the ordering of
|
||||
coefficients used by 2G6. The 2G6 User Guide does not completely define
|
||||
the algorithm used and the GOTO loaded FORTRAN code is difficult to unravel.
|
||||
Therefore, a one-to-one translation was deemed the safest approach.
|
||||
|
||||
No attempt is made to document the function statements since no documentaton
|
||||
is available in the 2G6 code. However, it can be noted that the code
|
||||
appears to generate the exponents of the product terms in the sum-of-products
|
||||
produced by the following expansion for two and three dimensional polynomials:
|
||||
|
||||
2D (a + b) ** n
|
||||
3D (a + (b + c)) ** n
|
||||
|
||||
where n begins at 1 and increments as needed for as many terms as there are
|
||||
coefficients on the polynomial source SPICE deck card, and where terms that
|
||||
are identical under the laws of associativity are dropped. Thus, for example,
|
||||
the exponents for the following sums are produced:
|
||||
|
||||
2D a + b + a**2 + ab + b**2 + c**3 + ...
|
||||
3D a + b + c + a**2 + a*b + a*c + b**2 + bc + c**2 + a**3 + ...
|
||||
|
||||
*/
|
||||
|
||||
/* Define a macro to tranlate between FORTRAN-style array references */
|
||||
/* and C-style array references */
|
||||
|
||||
#define PWRSEQ(x) pwrseq[x - 1]
|
||||
|
||||
|
||||
static void nxtpwr(
|
||||
int *pwrseq, /* Array of exponents */
|
||||
int pdim)
|
||||
{
|
||||
int i;
|
||||
int k;
|
||||
int km1;
|
||||
int psum;
|
||||
|
||||
if(pdim == 1) goto stmt80;
|
||||
k = pdim;
|
||||
stmt10: if(PWRSEQ(k) != 0) goto stmt20;
|
||||
k = k - 1;
|
||||
if(k != 0) goto stmt10;
|
||||
goto stmt80;
|
||||
stmt20: if(k == pdim) goto stmt30;
|
||||
PWRSEQ(k) = PWRSEQ(k) - 1;
|
||||
PWRSEQ(k+1) = PWRSEQ(k+1) + 1;
|
||||
goto stmt100;
|
||||
stmt30: km1 = k - 1;
|
||||
for(i = 1; i <= km1; i++)
|
||||
if(PWRSEQ(i) != 0) goto stmt50;
|
||||
stmt40: PWRSEQ(1) = PWRSEQ(pdim) + 1;
|
||||
PWRSEQ(pdim) = 0;
|
||||
goto stmt100;
|
||||
stmt50: psum = 1;
|
||||
k = pdim;
|
||||
stmt60: if(PWRSEQ(k-1) >= 1) goto stmt70;
|
||||
psum = psum + PWRSEQ(k);
|
||||
PWRSEQ(k) = 0;
|
||||
k = k - 1;
|
||||
goto stmt60;
|
||||
stmt70: PWRSEQ(k) = PWRSEQ(k) + psum;
|
||||
PWRSEQ(k-1) = PWRSEQ(k-1) - 1;
|
||||
goto stmt100;
|
||||
stmt80: PWRSEQ(1) = PWRSEQ(1) + 1;
|
||||
|
||||
stmt100: return;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,302 +0,0 @@
|
|||
/* ===========================================================================
|
||||
FILE cfunc.mod
|
||||
|
||||
MEMBER OF process XSPICE
|
||||
|
||||
Copyright 1991
|
||||
Georgia Tech Research Corporation
|
||||
Atlanta, Georgia 30332
|
||||
All Rights Reserved
|
||||
|
||||
PROJECT A-8503
|
||||
|
||||
AUTHORS
|
||||
|
||||
9/12/91 Bill Kuhn
|
||||
|
||||
MODIFICATIONS
|
||||
|
||||
<date> <person name> <nature of modifications>
|
||||
|
||||
SUMMARY
|
||||
|
||||
This file contains the definition of a code model polynomial controlled
|
||||
source compatible with SPICE 2G6 poly sources.
|
||||
|
||||
INTERFACES
|
||||
|
||||
icm_poly()
|
||||
|
||||
REFERENCED FILES
|
||||
|
||||
None.
|
||||
|
||||
NON-STANDARD FEATURES
|
||||
|
||||
None.
|
||||
|
||||
=========================================================================== */
|
||||
|
||||
/*
|
||||
|
||||
This code model implements the non-linear polynomial controlled sources
|
||||
available in SPICE 2G6. An automatic translator added into the simulator
|
||||
front end is used to map 2G6 syntax into a call to this model in the
|
||||
required syntax.
|
||||
|
||||
This model may also be called directly as follows:
|
||||
|
||||
a1 [ <input(s)> ] <output> xxx
|
||||
.model xxx poly ( coef = [ <list of 2G6 compatible coefficients> ] )
|
||||
|
||||
Refer to the 2G6 User Guide for an explanation of the coefficients.
|
||||
|
||||
|
||||
This model is patterned after the FORTRAN code used in the 2G6 simulator.
|
||||
Function cm_poly() below performs the functions of subroutines NLCSRC and
|
||||
EVPOLY. Function evterm() performs the function of subroutine EVTERM,
|
||||
and function nxtpwr() performs the function of subroutine NXTPWR.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
void *malloc(int);
|
||||
void free(void *);
|
||||
|
||||
/* SPICE 2G6 type utility functions */
|
||||
static double evterm(double x, int n);
|
||||
static void nxtpwr(int *pwrseq, int pdim);
|
||||
|
||||
|
||||
|
||||
|
||||
void icm_poly (ARGS)
|
||||
{
|
||||
int num_inputs; /* Number of inputs to model */
|
||||
int num_coefs; /* Number of coefficients */
|
||||
int *exp; /* List of exponents in products */
|
||||
/* One for each input */
|
||||
|
||||
int i; /* Counter */
|
||||
int j; /* Counter */
|
||||
int k; /* Counter */
|
||||
|
||||
double *in; /* Values of inputs to model */
|
||||
double *coef; /* Values of coefficients */
|
||||
|
||||
double sum; /* Temporary for accumulating sum of terms */
|
||||
double product; /* Temporary for accumulating product */
|
||||
|
||||
double *acgains; /* Static variable holding AC gains for AC analysis */
|
||||
|
||||
|
||||
/* Get number of input values */
|
||||
|
||||
num_inputs = PORT_SIZE(in);
|
||||
|
||||
/* If this is the first call to the model, allocate the static variable */
|
||||
/* array */
|
||||
|
||||
if(INIT) {
|
||||
acgains = malloc(num_inputs * sizeof(double));
|
||||
for(i = 0; i < num_inputs; i++)
|
||||
acgains[i] = 0.0;
|
||||
STATIC_VAR(acgains) = acgains;
|
||||
}
|
||||
else
|
||||
acgains = STATIC_VAR(acgains);
|
||||
|
||||
/* If analysis type is AC, use the previously computed DC partials */
|
||||
/* for the AC gains */
|
||||
|
||||
if(ANALYSIS == MIF_AC) {
|
||||
for(i = 0; i < num_inputs; i++) {
|
||||
acgains = STATIC_VAR(acgains);
|
||||
AC_GAIN(out,in[i]).real = acgains[i];
|
||||
AC_GAIN(out,in[i]).imag = 0.0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get input values and coefficients to local storage for faster access */
|
||||
|
||||
in = malloc(num_inputs * sizeof(double));
|
||||
for(i = 0; i < num_inputs; i++)
|
||||
in[i] = INPUT(in[i]);
|
||||
|
||||
num_coefs = PARAM_SIZE(coef);
|
||||
|
||||
coef = malloc(num_coefs * sizeof(double));
|
||||
for(i = 0; i < num_coefs; i++)
|
||||
coef[i] = PARAM(coef[i]);
|
||||
|
||||
|
||||
/* Allocate the array of exponents used in computing the poly terms */
|
||||
exp = malloc(num_inputs * sizeof(int));
|
||||
|
||||
/* Initialize the exponents to zeros */
|
||||
for(i = 0; i < num_inputs; i++)
|
||||
exp[i] = 0;
|
||||
|
||||
|
||||
/* Compute the output of the source by summing the required products */
|
||||
for(i = 1, sum = coef[0]; i < num_coefs; i++) {
|
||||
|
||||
/* Get the list of powers for the product terms in this term of the sum */
|
||||
nxtpwr(exp, num_inputs);
|
||||
|
||||
/* Form the product of the inputs taken to the required powers */
|
||||
for(j = 0, product = 1.0; j < num_inputs; j++)
|
||||
product *= evterm(in[j], exp[j]);
|
||||
|
||||
/* Add the product times the appropriate coefficient into the sum */
|
||||
sum += coef[i] * product;
|
||||
}
|
||||
OUTPUT(out) = sum;
|
||||
|
||||
|
||||
/* Compute and output the partials for each input */
|
||||
for(i = 0; i < num_inputs; i++) {
|
||||
|
||||
/* Reinitialize the exponent list to zeros */
|
||||
for(j = 0; j < num_inputs; j++)
|
||||
exp[j] = 0;
|
||||
|
||||
/* Compute the partials by summing the required products */
|
||||
for(j = 1, sum = 0.0; j < num_coefs; j++) {
|
||||
|
||||
/* Get the list of powers for the product terms in this term of the sum */
|
||||
nxtpwr(exp, num_inputs);
|
||||
|
||||
/* If power for input for which partial is being evaluated */
|
||||
/* is zero, the term is a constant, so the partial is zero */
|
||||
if(exp[i] == 0)
|
||||
continue;
|
||||
|
||||
/* Form the product of the inputs taken to the required powers */
|
||||
for(k = 0, product = 1.0; k < num_inputs; k++) {
|
||||
/* If input is not the one for which the partial is being taken */
|
||||
/* take the term to the specified exponent */
|
||||
if(k != i)
|
||||
product *= evterm(in[k], exp[k]);
|
||||
/* else, take the derivative of this term as n*x**(n-1) */
|
||||
else
|
||||
product *= exp[k] * evterm(in[k], exp[k] - 1);
|
||||
}
|
||||
|
||||
/* Add the product times the appropriate coefficient into the sum */
|
||||
sum += coef[j] * product;
|
||||
}
|
||||
|
||||
PARTIAL(out,in[i]) = sum;
|
||||
|
||||
/* If this is DC analysis, save the partial for use as AC gain */
|
||||
/* value in an AC analysis */
|
||||
|
||||
if(ANALYSIS == MIF_DC)
|
||||
acgains[i] = sum;
|
||||
}
|
||||
|
||||
/* Free the allocated items and return */
|
||||
free(in);
|
||||
free(coef);
|
||||
free(exp);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Function evterm computes the value of x**n */
|
||||
|
||||
static double evterm(
|
||||
double x,
|
||||
int n)
|
||||
{
|
||||
double product; /* Temporary accumlator for forming the product */
|
||||
|
||||
product = 1.0;
|
||||
while(n > 0) {
|
||||
product *= x;
|
||||
n--;
|
||||
}
|
||||
|
||||
return(product);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
This function is a literal translation of subroutine NXTPWR in SPICE 2G6.
|
||||
This was done to guarantee compatibility with the ordering of
|
||||
coefficients used by 2G6. The 2G6 User Guide does not completely define
|
||||
the algorithm used and the GOTO loaded FORTRAN code is difficult to unravel.
|
||||
Therefore, a one-to-one translation was deemed the safest approach.
|
||||
|
||||
No attempt is made to document the function statements since no documentaton
|
||||
is available in the 2G6 code. However, it can be noted that the code
|
||||
appears to generate the exponents of the product terms in the sum-of-products
|
||||
produced by the following expansion for two and three dimensional polynomials:
|
||||
|
||||
2D (a + b) ** n
|
||||
3D (a + (b + c)) ** n
|
||||
|
||||
where n begins at 1 and increments as needed for as many terms as there are
|
||||
coefficients on the polynomial source SPICE deck card, and where terms that
|
||||
are identical under the laws of associativity are dropped. Thus, for example,
|
||||
the exponents for the following sums are produced:
|
||||
|
||||
2D a + b + a**2 + ab + b**2 + c**3 + ...
|
||||
3D a + b + c + a**2 + a*b + a*c + b**2 + bc + c**2 + a**3 + ...
|
||||
|
||||
*/
|
||||
|
||||
/* Define a macro to tranlate between FORTRAN-style array references */
|
||||
/* and C-style array references */
|
||||
|
||||
#define PWRSEQ(x) pwrseq[x - 1]
|
||||
|
||||
|
||||
static void nxtpwr(
|
||||
int *pwrseq, /* Array of exponents */
|
||||
int pdim)
|
||||
{
|
||||
int i;
|
||||
int k;
|
||||
int km1;
|
||||
int psum;
|
||||
|
||||
if(pdim == 1) goto stmt80;
|
||||
k = pdim;
|
||||
stmt10: if(PWRSEQ(k) != 0) goto stmt20;
|
||||
k = k - 1;
|
||||
if(k != 0) goto stmt10;
|
||||
goto stmt80;
|
||||
stmt20: if(k == pdim) goto stmt30;
|
||||
PWRSEQ(k) = PWRSEQ(k) - 1;
|
||||
PWRSEQ(k+1) = PWRSEQ(k+1) + 1;
|
||||
goto stmt100;
|
||||
stmt30: km1 = k - 1;
|
||||
for(i = 1; i <= km1; i++)
|
||||
if(PWRSEQ(i) != 0) goto stmt50;
|
||||
stmt40: PWRSEQ(1) = PWRSEQ(pdim) + 1;
|
||||
PWRSEQ(pdim) = 0;
|
||||
goto stmt100;
|
||||
stmt50: psum = 1;
|
||||
k = pdim;
|
||||
stmt60: if(PWRSEQ(k-1) >= 1) goto stmt70;
|
||||
psum = psum + PWRSEQ(k);
|
||||
PWRSEQ(k) = 0;
|
||||
k = k - 1;
|
||||
goto stmt60;
|
||||
stmt70: PWRSEQ(k) = PWRSEQ(k) + psum;
|
||||
PWRSEQ(k-1) = PWRSEQ(k-1) - 1;
|
||||
goto stmt100;
|
||||
stmt80: PWRSEQ(1) = PWRSEQ(1) + 1;
|
||||
|
||||
stmt100: return;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,194 +0,0 @@
|
|||
|
||||
/*
|
||||
* Structures for model: poly
|
||||
*
|
||||
* Automatically generated by cmpp preprocessor
|
||||
*
|
||||
* !!! DO NOT EDIT !!!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// #include "prefix.h"
|
||||
#include <stdio.h>
|
||||
#include "spice.h"
|
||||
#include "devdefs.h"
|
||||
#include "ifsim.h"
|
||||
#include "mifdefs.h"
|
||||
#include "mifproto.h"
|
||||
#include "mifparse.h"
|
||||
// #include "suffix.h"
|
||||
|
||||
|
||||
static IFparm MIFmPTable[] = {
|
||||
IOP("coef", 0, (IF_REAL|IF_VECTOR), "2g6 compatible spice card coefficient list"),
|
||||
};
|
||||
|
||||
|
||||
static IFparm MIFpTable[] = {
|
||||
OP("acgains", 1, IF_STRING, "partial derivatives from dc analysis used for ac gains"),
|
||||
};
|
||||
|
||||
|
||||
static Mif_Port_Type_t MIFportEnum0[] = {
|
||||
MIF_VOLTAGE,
|
||||
MIF_DIFF_VOLTAGE,
|
||||
MIF_CURRENT,
|
||||
MIF_DIFF_CURRENT,
|
||||
MIF_VSOURCE_CURRENT,
|
||||
};
|
||||
|
||||
|
||||
static char *MIFportStr0[] = {
|
||||
"v",
|
||||
"vd",
|
||||
"i",
|
||||
"id",
|
||||
"vnam",
|
||||
};
|
||||
|
||||
|
||||
static Mif_Port_Type_t MIFportEnum1[] = {
|
||||
MIF_VOLTAGE,
|
||||
MIF_DIFF_VOLTAGE,
|
||||
MIF_CURRENT,
|
||||
MIF_DIFF_CURRENT,
|
||||
};
|
||||
|
||||
|
||||
static char *MIFportStr1[] = {
|
||||
"v",
|
||||
"vd",
|
||||
"i",
|
||||
"id",
|
||||
};
|
||||
|
||||
|
||||
static Mif_Conn_Info_t MIFconnTable[] = {
|
||||
{
|
||||
"in",
|
||||
"input",
|
||||
MIF_IN,
|
||||
MIF_VOLTAGE,
|
||||
"v",
|
||||
5,
|
||||
MIFportEnum0,
|
||||
MIFportStr0,
|
||||
MIF_TRUE,
|
||||
MIF_TRUE,
|
||||
1,
|
||||
MIF_FALSE,
|
||||
0,
|
||||
MIF_FALSE,
|
||||
},
|
||||
{
|
||||
"out",
|
||||
"output",
|
||||
MIF_OUT,
|
||||
MIF_VOLTAGE,
|
||||
"v",
|
||||
4,
|
||||
MIFportEnum1,
|
||||
MIFportStr1,
|
||||
MIF_FALSE,
|
||||
MIF_FALSE,
|
||||
0,
|
||||
MIF_FALSE,
|
||||
0,
|
||||
MIF_FALSE,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
static Mif_Param_Info_t MIFparamTable[] = {
|
||||
{
|
||||
"coef",
|
||||
"2g6 compatible spice card coefficient list",
|
||||
MIF_REAL,
|
||||
MIF_FALSE,
|
||||
{MIF_FALSE, 0, 0.0, {0.0, 0.0}, NULL},
|
||||
MIF_FALSE,
|
||||
{MIF_FALSE, 0, 0.0, {0.0, 0.0}, NULL},
|
||||
MIF_FALSE,
|
||||
{MIF_FALSE, 0, 0.0, {0.0, 0.0}, NULL},
|
||||
MIF_TRUE,
|
||||
MIF_FALSE,
|
||||
0,
|
||||
MIF_TRUE,
|
||||
2,
|
||||
MIF_FALSE,
|
||||
0,
|
||||
MIF_FALSE,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
static Mif_Inst_Var_Info_t MIFinst_varTable[] = {
|
||||
{
|
||||
"acgains",
|
||||
"partial derivatives from dc analysis used for ac gains",
|
||||
MIF_STRING,
|
||||
MIF_FALSE,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
extern void icm_poly(Mif_Private_t *);
|
||||
|
||||
static int val_terms = 0;
|
||||
static int val_numNames = 0;
|
||||
static int val_numInstanceParms = 1;
|
||||
static int val_numModelParms = 1;
|
||||
static int val_sizeofMIFinstance = sizeof(MIFinstance);
|
||||
static int val_sizeofMIFmodel = sizeof(MIFmodel);
|
||||
|
||||
SPICEdev icm_poly_info = {
|
||||
{ "poly",
|
||||
"2g6 compatible polynomial controlled source",
|
||||
&val_terms,
|
||||
&val_numNames,
|
||||
NULL,
|
||||
&val_numInstanceParms,
|
||||
MIFpTable,
|
||||
&val_numModelParms,
|
||||
MIFmPTable,
|
||||
icm_poly,
|
||||
2,
|
||||
MIFconnTable,
|
||||
1,
|
||||
MIFparamTable,
|
||||
1,
|
||||
MIFinst_varTable,
|
||||
},
|
||||
NULL,
|
||||
MIFmParam,
|
||||
MIFload,
|
||||
MIFsetup,
|
||||
MIFunsetup,
|
||||
NULL,
|
||||
NULL,
|
||||
MIFtrunc,
|
||||
NULL,
|
||||
MIFload,
|
||||
NULL,
|
||||
MIFdestroy,
|
||||
MIFmDelete,
|
||||
MIFdelete,
|
||||
NULL,
|
||||
MIFask,
|
||||
MIFmAsk,
|
||||
NULL,
|
||||
MIFconvTest,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&val_sizeofMIFinstance,
|
||||
&val_sizeofMIFmodel,
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
/* ===========================================================================
|
||||
FILE ifspec.ifs
|
||||
|
||||
MEMBER OF process XSPICE
|
||||
|
||||
Copyright 1991
|
||||
Georgia Tech Research Corporation
|
||||
Atlanta, Georgia 30332
|
||||
All Rights Reserved
|
||||
|
||||
PROJECT A-8503
|
||||
|
||||
AUTHORS
|
||||
|
||||
9/12/91 Bill Kuhn
|
||||
|
||||
MODIFICATIONS
|
||||
|
||||
<date> <person name> <nature of modifications>
|
||||
|
||||
SUMMARY
|
||||
|
||||
This file contains the definition of a code model polynomial controlled
|
||||
source compatible with SPICE 2G6 poly sources.
|
||||
|
||||
INTERFACES
|
||||
|
||||
None.
|
||||
|
||||
REFERENCED FILES
|
||||
|
||||
None.
|
||||
|
||||
NON-STANDARD FEATURES
|
||||
|
||||
None.
|
||||
|
||||
=========================================================================== */
|
||||
|
||||
NAME_TABLE:
|
||||
|
||||
Spice_Model_Name: poly
|
||||
C_Function_Name: icm_poly
|
||||
Description: "2G6 compatible polynomial controlled source"
|
||||
|
||||
|
||||
PORT_TABLE:
|
||||
|
||||
Port_Name: in out
|
||||
Description: "input" "output"
|
||||
Direction: in out
|
||||
Default_Type: v v
|
||||
Allowed_Types: [v,vd,i,id,vnam] [v,vd,i,id]
|
||||
Vector: yes no
|
||||
Vector_Bounds: [1 -] -
|
||||
Null_Allowed: no no
|
||||
|
||||
|
||||
PARAMETER_TABLE:
|
||||
|
||||
Parameter_Name: coef
|
||||
Description: "2G6 compatible spice card coefficient list"
|
||||
Data_Type: real
|
||||
Default_Value: -
|
||||
Limits: -
|
||||
Vector: yes
|
||||
Vector_Bounds: [2 -]
|
||||
Null_Allowed: no
|
||||
|
||||
|
||||
STATIC_VAR_TABLE:
|
||||
|
||||
Static_Var_Name: acgains
|
||||
Data_Type: pointer
|
||||
Description: "Partial derivatives from DC analysis used for AC gains"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
cmpp -mod cfunc.mod
|
||||
cmpp -ifs
|
||||
Binary file not shown.
|
|
@ -1,2 +1 @@
|
|||
icm_spice2poly
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue