TclSpice is an improved version of Berkeley Spice designed to be used with

the Tcl/Tk scripting language. The project is open-source (BSD license)
and based upon the NG-Spice source code base with many improvements

Features and Improvements
 - Fully Tcl scriptable - installs with 'package require spice' statement
 - Hspice syntax (SpicePP).
 - GUI interfaces, various (Tk).
 - SpiceWish (BLT graph widget)
 - BLT (tcl compatible) vectors for storage, manipulation and arithmetic
	upon Spice waveforms.
 - Xspice additions (Georgia Tech).
 - Trigger upon waveform events.
 - Spice 'simulator state' save and restore for rapid 'what-if' simulations
	(no longer need to re-simulate from the beginning each time a
	device value is changed).

Author:	Stefan Jones <stefan.jones@multigig.com>
WWW:	http://tclspice.sourceforge.net/

PR:		ports/99399
Submitted by:	Stanislav Sedov <ssedov@mbsd.msk.ru>
This commit is contained in:
Pav Lucistnik 2006-06-26 18:34:59 +00:00
parent a35a135b49
commit b32dace1ce
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=166388
16 changed files with 337 additions and 0 deletions

View File

@ -57,6 +57,7 @@
SUBDIR += slffea
SUBDIR += spice
SUBDIR += systemc
SUBDIR += tclspice
SUBDIR += tkgate
SUBDIR += tochnog
SUBDIR += transcalc

67
cad/tclspice/Makefile Normal file
View File

@ -0,0 +1,67 @@
# New ports collection makefile for: tclspice
# Date created: 2006-06-24
# Whom: Stanislav Sedov <stas@fonon.realnet>
#
# $FreeBSD$
#
PORTNAME= tclspice
PORTVERSION= 0.2.18
CATEGORIES= cad
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= tclspice
MAINTAINER= ssedov@mbsd.msk.ru
COMMENT= Improved version on SPICE3 suite with TCL scripting features
BUILD_DEPENDS= bltwish:${PORTSDIR}/x11-toolkits/blt \
${LOCALBASE}/lib/libtclreadline.so:${PORTSDIR}/devel/tclreadline
RUN_DEPENDS= ${BUILD_DEPENDS}
WRKSRC= ${WRKDIR}/${PORTNAME}
USE_AUTOTOOLS= aclocal:19 automake:19 autoconf:259 libtool:15
AUTOMAKE_ARGS= -c -a
USE_GMAKE= yes
ALL_TARGET= tcl
INSTALL_TARGET= install-tcl
INSTALLS_SHLIB= yes
SUB_FILES= pkg-message
OPTIONS= EXPERIMENTAL "Enable experimental features" on \
EXAMPLES "Install sample scrips" on
CONFIGURE_ARGS= --with-tcl=${LOCALBASE}/lib/tcl8.4
CONFIGURE_ENV= CFLAGS="-I${LOCALBASE}/include ${CFLAGS} -fPIC" \
LDFLAGS="-L${LOCALBASE}/lib"
ACLOCAL_ARGS= --acdir=${ACLOCAL_DIR} -I ${LOCALBASE}/share/aclocal
WISH= ${LOCALBASE}/bin/wish8.4
.include <bsd.port.pre.mk>
.if !defined(WITHOUT_EXPERIMENTAL)
CONFIGURE_ARGS+= --enable-experimental
.endif
.if !defined(WITHOUT_EXAMPLES)
PLIST_SUB+= EXAMPLES=""
.else
PLIST_SUB+= EXAMPLES="@comment "
.endif
post-patch:
.for FILE in spicewish tcl/plot.tcl tcl/vector_test.tcl
@${REINPLACE_CMD} -e 's|%%WISH%%|${WISH}|g' ${WRKSRC}/src/${FILE}
.endfor
post-install:
.if !defined(WITHOUT_EXAMPLES)
@${MKDIR} ${EXAMPLESDIR}
.for FILE in README example.cir plot.tcl vector_test.tcl
@${INSTALL_DATA} ${WRKSRC}/src/tcl/${FILE} ${EXAMPLESDIR}
.endfor
@${CAT} ${PKGMESSAGE}
.endif
.include <bsd.port.post.mk>

3
cad/tclspice/distinfo Normal file
View File

@ -0,0 +1,3 @@
MD5 (tclspice-0.2.18.tar.gz) = a7c02132ca74064611011f8dee6bd3d5
SHA256 (tclspice-0.2.18.tar.gz) = 0393a61b89a56b5dba2444a8914cb85b6212b552f2fbc80f0a822bfe04b74f5e
SIZE (tclspice-0.2.18.tar.gz) = 2985319

View File

@ -0,0 +1,49 @@
--- src/Makefile.am.orig Fri Jul 23 20:22:10 2004
+++ src/Makefile.am Sat Jun 24 03:43:15 2006
@@ -181,12 +181,12 @@
pkgIndex.tcl: pkgIndex.tcl.in
rm -f $@
- sed -e 's;%LIB_DIR%;$(TCL_PKG_PATH);g' $< | \
+ sed -e 's;%LIB_DIR%;$(libdir);g' $< | \
sed -e 's;%VERSION%;$(TCLSPICE_VERSION);g' > $@
spicepp.pl: spicepp.pl.in
rm -f $@
- sed -e 's;%LIB_DIR%;$(TCL_PKG_PATH);g' $< | \
+ sed -e 's;%LIB_DIR%;$(libdir);g' $< | \
sed -e 's;%VERSION%;$(TCLSPICE_VERSION);g' > $@
install-tcl: install-tcl-recursive install-tclspice install-data-am
@@ -199,17 +199,17 @@
done;
install-tclspice: $(TCL_FILES)
- $(mkinstalldirs) $(DESTDIR)$(TCL_PKG_PATH)
- $(INSTALL_DATA) libspice.so $(DESTDIR)$(TCL_PKG_PATH)
- $(mkinstalldirs) $(DESTDIR)$(TCL_PKG_PATH)/spice
- $(INSTALL_PROGRAM) spicepp.pl $(DESTDIR)$(TCL_PKG_PATH)/spice
- $(INSTALL_PROGRAM) measure_spice.pl $(DESTDIR)$(TCL_PKG_PATH)/spice
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+ $(INSTALL_DATA) libspice.so $(DESTDIR)$(libdir)
+ $(mkinstalldirs) $(DESTDIR)$(libdir)/tclspice
+ $(INSTALL_SCRIPT) spicepp.pl $(DESTDIR)$(libdir)/tclspice
+ $(INSTALL_SCRIPT) measure_spice.pl $(DESTDIR)$(libdir)/tclspice
@for f in $(TCL_SOURCE) ; do \
- echo $(INSTALL_DATA) $$f $(DESTDIR)$(TCL_PKG_PATH)/spice; \
- $(INSTALL_DATA) $$f $(DESTDIR)$(TCL_PKG_PATH)/spice; \
+ echo $(INSTALL_DATA) $$f $(DESTDIR)$(libdir)/tclspice; \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(libdir)/tclspice; \
done
$(mkinstalldirs) $(DESTDIR)$(bindir)
- $(INSTALL_PROGRAM) spicewish $(DESTDIR)$(bindir)
+ $(INSTALL_SCRIPT) spicewish $(DESTDIR)$(bindir)
tclspice.o: tclspice.c
$(COMPILE) -c -fpic tclspice.c -DTCLSPICE_version="\"$(TCLSPICE_VERSION)\""
@@ -229,4 +229,4 @@
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) all) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done;
- make $(TCL_FILES)
+ gmake $(TCL_FILES)

View File

@ -0,0 +1,11 @@
--- ./src/frontend/aspice.c.orig Sat Jun 24 01:39:15 2006
+++ ./src/frontend/aspice.c Sat Jun 24 01:39:39 2006
@@ -176,7 +176,7 @@
* whether the exit was normal or not.
*/
-#if defined(__NetBSD__) || defined(SOLARIS)
+#if defined(__NetBSD__) || defined(SOLARIS) || defined(__FreeBSD__)
pid_t status;
#else
union wait status;

View File

@ -0,0 +1,45 @@
--- ./src/frontend/parser/complete.c.orig Sat Jun 24 01:40:09 2006
+++ ./src/frontend/parser/complete.c Sat Jun 24 01:40:17 2006
@@ -415,7 +415,7 @@
# else
# ifdef HAVE_TERMIOS_H
-# if defined(__NetBSD__) || defined(__APPLE_CC__)
+# if defined(__NetBSD__) || defined(__APPLE_CC__) || defined(__FreeBSD__)
# define TCGETS
# define TCSETS
# endif
@@ -428,7 +428,7 @@
# endif
# endif
-# if defined(TERM_GET) || defined(__NetBSD__) || defined(__APPLE_CC__)
+# if defined(TERM_GET) || defined(__NetBSD__) || defined(__APPLE_CC__) || defined(__FreeBSD__)
static bool ison = FALSE;
if (cp_nocc || !cp_interactive || (ison == on))
@@ -436,7 +436,7 @@
ison = on;
if (ison == TRUE) {
-#if defined(__NetBSD__) || defined(__APPLE_CC__)
+#if defined(__NetBSD__) || defined(__APPLE_CC__) || defined(__FreeBSD__)
tcgetattr(fileno(cp_in),&OS_Buf);
#else
(void) ioctl(fileno(cp_in), TERM_GET, (char *) &OS_Buf);
@@ -445,13 +445,13 @@
sbuf.c_cc[VEOF] = 0;
sbuf.c_cc[VEOL] = ESCAPE;
sbuf.c_cc[VEOL2] = CNTRL_D;
-#if defined(__NetBSD__) || defined(__APPLE_CC__)
+#if defined(__NetBSD__) || defined(__APPLE_CC__) || defined(__FreeBSD__)
tcsetattr(fileno(cp_in),TCSANOW,&sbuf);
#else
(void) ioctl(fileno(cp_in), TERM_SET, (char *) &sbuf);
#endif
} else {
-#if defined(__NetBSD__) || defined(__APPLE_CC__)
+#if defined(__NetBSD__) || defined(__APPLE_CC__) || defined(__FreeBSD__)
tcsetattr(fileno(cp_in),TCSANOW,&OS_Buf);
#else
(void) ioctl(fileno(cp_in), TERM_SET, (char *) &OS_Buf);

View File

@ -0,0 +1,41 @@
--- src/frontend/resource.c.orig Sat Jun 24 04:53:17 2006
+++ src/frontend/resource.c Sat Jun 24 04:55:41 2006
@@ -311,7 +311,7 @@
static RETSIGTYPE
fault(void)
{
- signal(SIGSEGV, (SIGNAL_FUNCTION) fault); /* SysV style */
+ signal(SIGBUS, (SIGNAL_FUNCTION) fault); /* SysV style */
siglongjmp(env, 1);
}
#if !defined(__MINGW32__) && !defined(__APPLE_CC__)
@@ -321,7 +321,8 @@
char *low, *high, *at;
/* char *sbrk(int); */
long x;
- RETSIGTYPE (*orig_signal)( );
+ RETSIGTYPE (*orig_sigsegv)( );
+ RETSIGTYPE (*orig_sigbus)( );
if (getenv("SPICE_NO_DATASEG_CHECK"))
return 0;
@@ -330,7 +331,8 @@
low = 0;
high = (char *) ((unsigned long) sbrk(0) & ~((1 << LOG2_PAGESIZE) - 1));
- orig_signal = signal(SIGSEGV, (SIGNAL_FUNCTION) fault);
+ orig_sigsegv = signal(SIGSEGV, (SIGNAL_FUNCTION) fault);
+ orig_sigbus = signal(SIGBUS, (SIGNAL_FUNCTION) fault);
do {
@@ -358,7 +360,8 @@
} while (1);
- (void) signal(SIGSEGV, (SIGNAL_FUNCTION) orig_signal);
+ (void) signal(SIGSEGV, (SIGNAL_FUNCTION) orig_sigsegv);
+ (void) signal(SIGBUS, (SIGNAL_FUNCTION) orig_sigbus);
return (void *) high;
}
#endif

View File

@ -0,0 +1,10 @@
--- ./src/spicelib/devices/names.c.orig Sat Jun 24 02:01:08 2006
+++ ./src/spicelib/devices/names.c Sat Jun 24 02:01:17 2006
@@ -28,7 +28,6 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
-#include <malloc.h>
#define __NAMES_PRIVATE__
#include "names.h"

View File

@ -0,0 +1,11 @@
--- src/spicepp.pl.in.orig Sat Jun 24 03:44:04 2006
+++ src/spicepp.pl.in Sat Jun 24 03:44:16 2006
@@ -307,7 +307,7 @@
push(@xtra, ".control");
push(@xtra, "print time $trig $targ > meas.data");
push(@xtra, "echo $_ > meas.ctl");
- push(@xtra, "shell %LIB_DIR%/spice/measure_spice.pl $name");
+ push(@xtra, "shell %LIB_DIR%/tclspice/measure_spice.pl $name");
push(@xtra, ".endc");
splice(@deck,$i,1,@xtra);
@xtra=();

View File

@ -0,0 +1,11 @@
--- src/spicewish.orig Sat Jun 24 04:21:41 2006
+++ src/spicewish Sat Jun 24 04:21:59 2006
@@ -2,7 +2,7 @@
# 22/6/04 -ad
# the next line starts SpiceWish interactively with the given file name \
-exec wish "$0" "$@"
+exec %%WISH%% "$0" "$@"
package require spice
package require tclreadline

View File

@ -0,0 +1,10 @@
--- src/tcl/plot.tcl.orig Sat Jun 24 05:36:11 2006
+++ src/tcl/plot.tcl Sat Jun 24 05:36:33 2006
@@ -1,6 +1,6 @@
#!/bin/sh
# WishFix \
- exec wish -f "$0" ${1+"$@"}
+ exec %%WISH%% -f "$0" ${1+"$@"}
###
package require spice

View File

@ -0,0 +1,10 @@
--- src/tcl/vector_test.tcl.orig Sat Jun 24 05:37:20 2006
+++ src/tcl/vector_test.tcl Sat Jun 24 05:37:14 2006
@@ -1,6 +1,6 @@
#!/bin/sh
# WishFix \
- exec wish -f "$0" ${1+"$@"}
+ exec %%WISH%% -f "$0" ${1+"$@"}
###
package require BLT

View File

@ -0,0 +1,14 @@
--- src/xspice/icm/Makefile.orig Sat Jun 24 05:04:12 2006
+++ src/xspice/icm/Makefile Sat Jun 24 05:04:39 2006
@@ -12,9 +12,9 @@
-include .deps/cm.P
-include .deps/dlmain.P
-UPMAKE = make -f $(TOPDIR)../Makefile TOPDIR=$(TOPDIR)../
+UPMAKE = gmake -f $(TOPDIR)../Makefile TOPDIR=$(TOPDIR)../
-MAKE = make -f $(TOPDIR)Makefile TOPDIR=$(TOPDIR)
+MAKE = gmake -f $(TOPDIR)Makefile TOPDIR=$(TOPDIR)
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)

View File

@ -0,0 +1,7 @@
============================================================================
Example scrips was installed in %%EXAMPLESDIR%%. Take a
look on %%EXAMPLESDIR%%/README for additional information
on how to create your own Tcl scrips.
============================================================================

19
cad/tclspice/pkg-descr Normal file
View File

@ -0,0 +1,19 @@
TclSpice is an improved version of Berkeley Spice designed to be used with
the Tcl/Tk scripting language. The project is open-source (BSD license)
and based upon the NG-Spice source code base with many improvements
Features and Improvements
- Fully Tcl scriptable - installs with 'package require spice' statement
- Hspice syntax (SpicePP).
- GUI interfaces, various (Tk).
- SpiceWish (BLT graph widget)
- BLT (tcl compatible) vectors for storage, manipulation and arithmetic
upon Spice waveforms.
- Xspice additions (Georgia Tech).
- Trigger upon waveform events.
- Spice 'simulator state' save and restore for rapid 'what-if' simulations
(no longer need to re-simulate from the beginning each time a
device value is changed).
Author: Stefan Jones <stefan.jones@multigig.com>
WWW: http://tclspice.sourceforge.net/

28
cad/tclspice/pkg-plist Normal file
View File

@ -0,0 +1,28 @@
bin/spicewish
lib/libspice.so
lib/tclspice/controls.tcl
lib/tclspice/engUnits.tcl
lib/tclspice/gnuplot.tcl
lib/tclspice/measure.tcl
lib/tclspice/measure_spice.pl
lib/tclspice/nodeDialog.tcl
lib/tclspice/pkgIndex.tcl
lib/tclspice/readline.tcl
lib/tclspice/spicepp.pl
lib/tclspice/spicepp.tcl
lib/tclspice/spicewish.tcl
lib/tclspice/viewer.tcl
%%DATADIR%%/helpdir/ngspice.idx
%%DATADIR%%/helpdir/ngspice.txt
%%DATADIR%%/scripts/setplot
%%DATADIR%%/scripts/spectrum
%%DATADIR%%/scripts/spinit
%%EXAMPLES%%share/examples/tclspice/README
%%EXAMPLES%%share/examples/tclspice/example.cir
%%EXAMPLES%%share/examples/tclspice/plot.tcl
%%EXAMPLES%%share/examples/tclspice/vector_test.tcl
%%EXAMPLES%%@dirrm share/examples/tclspice
@dirrm lib/tclspice
@dirrm %%DATADIR%%/helpdir
@dirrm %%DATADIR%%/scripts
@dirrm %%DATADIR%%