[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: branch: master updated (1.0-20070526-101-g0cde8c1)



The branch, master has been updated
       via  0cde8c1cf6c863946c3d4acdc9e9165c99526bef (commit)
       via  b692c010f9ccf0b89ff1ad653ff1c5a812887cc3 (commit)
      from  dd995d808b9f4440db48d2daa2473a9d9cfd88ef (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gnetlist/ChangeLog                   |   12 ++
 gnetlist/scheme/Makefile.am          |    3 +-
 gnetlist/scheme/gnet-mathematica.scm |  206 ++++++++++++++++++++++++++++++++++
 3 files changed, 220 insertions(+), 1 deletions(-)
 create mode 100644 gnetlist/scheme/gnet-mathematica.scm


=================
 Commit Messages
=================

commit 0cde8c1cf6c863946c3d4acdc9e9165c99526bef
Author: Ales Hvezda <ahvezda@xxxxxxxx>
Date:   Thu Jul 5 01:52:04 2007 -0400

    Updated gnetlist ChangedLog to include the new backend addition

:100644 100644 73f041c... c7c3eb1... M	gnetlist/ChangeLog

commit b692c010f9ccf0b89ff1ad653ff1c5a812887cc3
Author: Ales Hvezda <ahvezda@xxxxxxxx>
Date:   Thu Jul 5 01:43:47 2007 -0400

    Added new gnetlist backend by John P. Doty

:100644 100644 b1fd79d... 43f2b96... M	gnetlist/scheme/Makefile.am
:000000 100644 0000000... 381d89c... A	gnetlist/scheme/gnet-mathematica.scm

=========
 Changes
=========

commit 0cde8c1cf6c863946c3d4acdc9e9165c99526bef
Author: Ales Hvezda <ahvezda@xxxxxxxx>
Date:   Thu Jul 5 01:52:04 2007 -0400

    Updated gnetlist ChangedLog to include the new backend addition

diff --git a/gnetlist/ChangeLog b/gnetlist/ChangeLog
index 73f041c..c7c3eb1 100644
--- a/gnetlist/ChangeLog
+++ b/gnetlist/ChangeLog
@@ -1,6 +1,18 @@
 # Do not edit this file - generated from version control history
 
 
+commit b692c010f9ccf0b89ff1ad653ff1c5a812887cc3
+Author: Ales Hvezda <ahvezda@xxxxxxxx>
+Date:   Thu Jul 5 01:43:47 2007 -0400
+
+    Added new gnetlist backend by John P. Doty
+
+commit dd995d808b9f4440db48d2daa2473a9d9cfd88ef
+Author: Ales Hvezda <ahvezda@xxxxxxxx>
+Date:   Thu Jul 5 01:36:31 2007 -0400
+
+    Updated ChangeLogs using ./update-changelogs.sh 1.0-20070526..master
+
 commit 099c49e5689afda4b8a5221dde73f9fdf1972ce7
 Author: Ales Hvezda <ahvezda@xxxxxxxx>
 Date:   Thu Jul 5 00:11:45 2007 -0400

commit b692c010f9ccf0b89ff1ad653ff1c5a812887cc3
Author: Ales Hvezda <ahvezda@xxxxxxxx>
Date:   Thu Jul 5 01:43:47 2007 -0400

    Added new gnetlist backend by John P. Doty

diff --git a/gnetlist/scheme/Makefile.am b/gnetlist/scheme/Makefile.am
index b1fd79d..43f2b96 100644
--- a/gnetlist/scheme/Makefile.am
+++ b/gnetlist/scheme/Makefile.am
@@ -18,7 +18,8 @@ DIST_SCM = gnet-PCB.scm gnet-allegro.scm gnet-bom.scm gnet-geda.scm \
 	   gnet-switcap.scm gnet-spice-sdb.scm gnet-drc2.scm \
 	   gnet-futurenet2.scm gnet-cascade.scm \
 	   gnet-redac.scm gnet-systemc.scm gnet-eagle.scm \
-	   gnet-pcbpins.scm gnet-calay.scm gnet-osmond.scm
+	   gnet-pcbpins.scm gnet-calay.scm gnet-osmond.scm \
+	   gnet-mathematica.scm
 
 
 EXTRA_DIST = $(DIST_SCM) $(SCM_SRCS)
diff --git a/gnetlist/scheme/gnet-mathematica.scm b/gnetlist/scheme/gnet-mathematica.scm
new file mode 100644
index 0000000..381d89c
--- /dev/null
+++ b/gnetlist/scheme/gnet-mathematica.scm
@@ -0,0 +1,206 @@
+;;; gEDA - GPL Electronic Design Automation
+;;; gnetlist - gEDA Netlist
+;;; Copyright (C) 2007 John P. Doty
+;;;
+;;; This program is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program; if not, write to the Free Software
+;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;; Netlister for symbolic circuit analysis using Mathematica.
+;; See the Mathematica notebook gEDA.nb (obtainable at www.noqsi.com)
+;; for usage.
+
+(define (mathematica:quoted thing port)
+   (write-char #\" port)
+   (display thing port)
+   (write-char #\" port)
+)
+
+(define (mathematica:write-pin-voltages netname pins port)
+   (if (not (null? pins))
+      (let ((pin (car pins)))
+         (display "v[" port)
+	 (mathematica:quoted (car pin) port)
+	 (display "," port)
+	 (mathematica:quoted (car (cdr pin)) port)
+	 (display "]=v[" port)
+	 (mathematica:quoted netname port)
+	 (display "];" port)
+	 (newline port)
+         (mathematica:write-pin-voltages netname (cdr pins) port)
+      )
+   )
+)
+
+
+(define (mathematica:write-voltages netnames port)
+  (if (not (null? netnames))
+      (let ((netname (car netnames)))
+         (mathematica:write-pin-voltages netname 
+	    (gnetlist:get-all-connections netname) port)
+         (mathematica:write-voltages (cdr netnames) port))))
+
+
+(define (mathematica:write-node-currents pins port)
+   (let ((pin (car pins)))
+      (display "i[" port)
+      (mathematica:quoted (car pin) port)
+      (display "," port)
+      (mathematica:quoted (car (cdr pin)) port)
+      (display "]" port)
+      (if (not (null? (cdr pins )))
+      	 (begin
+	    (display "+" port)
+	    (mathematica:write-node-currents (cdr pins) port)
+	 )
+      )
+   )
+)
+
+(define (mathematica:,newline port)
+   (display "," port)
+   (newline port)
+)
+
+
+(define (mathematica:write-currents netnames first port)
+   (if (not (null? netnames))
+      (let ((netname (car netnames)))
+         (if (not (equal? netname "GND"))
+            (begin
+	       (if (not first)
+	          (mathematica:,newline port)
+		)
+	       (mathematica:write-node-currents 
+	          (gnetlist:get-all-connections netname) port)
+ 	       (display "==0" port)
+	       (mathematica:write-currents (cdr netnames) #f port)
+             )
+	    (mathematica:write-currents (cdr netnames) first port)
+         )
+      )
+   )
+)
+
+(define (mathematica:write-device-value device value refdes port)
+   (display (string-downcase device) port)
+   (display "[value->" port)
+   (display value port)
+   (display "][" port)
+   (mathematica:quoted refdes port)
+   (display "]" port)
+)
+
+(define (mathematica:write-device-model model refdes port)
+   (display model port)
+   (display "[" port)
+   (mathematica:quoted refdes port)
+   (display "]" port)
+ )
+
+
+(define (mathematica:write-model refdes port)
+   (let ((device (gnetlist:get-package-attribute refdes "device"))
+         (value (gnetlist:get-package-attribute refdes "value"))
+         (model (gnetlist:get-package-attribute refdes "model")))
+      (if (equal? model "unknown")
+         (if (equal? value "unknown")
+	    (mathematica:write-device-value device (string-downcase refdes)
+	       refdes port)
+            (mathematica:write-device-value device value refdes port)
+	 )
+	 (mathematica:write-device-model model refdes port)
+      )
+   )
+)
+
+(define (mathematica:write-models refdeses first port)
+   (if (not (null? refdeses))
+      (let ((refdes (car refdeses)))
+         (if (not first)
+	    (mathematica:,newline port)
+	 )
+	 (mathematica:write-model refdes port)
+	 (mathematica:write-models (cdr refdeses) #f port)
+      )
+   )
+)
+
+(define (mathematica:list-voltages netnames first port)
+   (if (not (null? netnames))
+      (let ((netname (car netnames)))
+         (if (not (equal? netname "GND"))
+            (begin
+	       (if (not first)
+	          (mathematica:,newline port)
+		)
+		(display "v[" port)
+		(mathematica:quoted netname port)
+		(display "]" port)
+	        (mathematica:list-voltages (cdr netnames) #f port)
+             )
+	    (mathematica:list-voltages (cdr netnames) first port)
+         )
+      )
+   )
+)
+
+
+(define (mathematica:list-pin-currents pins port)
+   (if (not (null? pins))
+      (let ((pin (car pins)))
+         (mathematica:,newline port)
+	 (display "i[" port)
+         (mathematica:quoted (car pin) port)
+         (display "," port)
+         (mathematica:quoted (car (cdr pin)) port)
+         (display "]" port)
+	 (mathematica:list-pin-currents (cdr pins) port)
+      )
+   )
+)
+
+	       
+(define (mathematica:list-currents netnames port)
+   (if (not (null? netnames))
+      (let ((netname (car netnames)))
+	 (mathematica:list-pin-currents 
+	    (gnetlist:get-all-connections netname) port)
+	    (mathematica:list-currents (cdr netnames) port)
+      )
+   )
+)
+ 
+
+(define (mathematica output-filename)
+  (let ((port (open-output-file output-filename)) 
+  	(nets (gnetlist:get-all-unique-nets "dummy")))
+     (mathematica:write-voltages nets port)
+     (display "nodeEquations={" port)
+     (newline port)
+     (mathematica:write-currents nets #t port)
+     (display "};" port)
+     (newline port)
+     (display "modelEquations={" port)
+     (newline port)
+     (mathematica:write-models packages #t port)
+     (display "};" port)
+     (newline port)
+     (display "variables={" port)
+     (newline port)
+     (mathematica:list-voltages nets #t port)
+     (mathematica:list-currents nets port)
+     (display "};" port)
+     (newline port)
+   )
+)




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs