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

gEDA-cvs: gaf.git: branch: master updated (1.7.1-20110619-271-g6db1ebe)



The branch, master has been updated
       via  6db1ebe332d3dd78367459dc4676af6fcce8b330 (commit)
       via  49fb5830b0990cc1f84a3ef966277dead9a6d847 (commit)
       via  90475267fe88bacd8c36121335904c58f7a76547 (commit)
      from  e8049ecbcab0dda94245b6ded9a2d89bfcf6733e (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
=========

 configure.ac                          |    2 +-
 gnetlist/scripts/Makefile.am          |    8 ++--
 utils/docs/Makefile.am                |    2 +-
 utils/docs/pads_backannotate.1        |   10 ++--
 utils/docs/pcb_backannotate.1         |   10 ++--
 utils/docs/sw2asc.1                   |   68 +++++++++++++++++++++++++++++++++
 utils/scripts/Makefile.am             |    8 ++--
 {gnetlist => utils}/scripts/sw2asc.in |    0 
 8 files changed, 88 insertions(+), 20 deletions(-)
 create mode 100644 utils/docs/sw2asc.1
 copy {gnetlist => utils}/scripts/sw2asc.in (100%)


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

commit 6db1ebe332d3dd78367459dc4676af6fcce8b330
Author: Dan McMahill <dan@xxxxxxxxxxxx>
Commit: Dan McMahill <dan@xxxxxxxxxxxx>

    Move the sw2asc script out of the gnetlist tree and into the utils tree where it belongs.
    
    This script is not really a gnetlist utility but rather one used to help extract
    some simulation results.  It is used with the SWITCAP2 switched capacitor circuit
    simulator which is supported by a gnetlist backend and gschem library.

:100644 100644 595d832... 6dc1ad1... M	configure.ac
:100644 100644 77fd832... 82d9b52... M	gnetlist/scripts/Makefile.am
:100644 100644 76e629b... d7b0633... M	utils/scripts/Makefile.am
:000000 100644 0000000... 84fab98... A	utils/scripts/sw2asc.in

commit 49fb5830b0990cc1f84a3ef966277dead9a6d847
Author: Dan McMahill <dan@xxxxxxxxxxxx>
Commit: Dan McMahill <dan@xxxxxxxxxxxx>

    Fix a few typos and also correctly identify -V with version and -v with verbose

:100644 100644 1d7792b... 2760aaf... M	utils/docs/pads_backannotate.1
:100644 100644 a856807... 8239dca... M	utils/docs/pcb_backannotate.1

commit 90475267fe88bacd8c36121335904c58f7a76547
Author: Dan McMahill <dan@xxxxxxxxxxxx>
Commit: Dan McMahill <dan@xxxxxxxxxxxx>

    Add man page for sw2asc.
    
    Affects-bug: lp-698849

:100644 100644 ab662ba... 2c02b1f... M	utils/docs/Makefile.am
:000000 100644 0000000... 0ce321a... A	utils/docs/sw2asc.1

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

commit 6db1ebe332d3dd78367459dc4676af6fcce8b330
Author: Dan McMahill <dan@xxxxxxxxxxxx>
Commit: Dan McMahill <dan@xxxxxxxxxxxx>

    Move the sw2asc script out of the gnetlist tree and into the utils tree where it belongs.
    
    This script is not really a gnetlist utility but rather one used to help extract
    some simulation results.  It is used with the SWITCAP2 switched capacitor circuit
    simulator which is supported by a gnetlist backend and gschem library.

diff --git a/configure.ac b/configure.ac
index 595d832..6dc1ad1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -239,7 +239,6 @@ AC_CONFIG_FILES([Makefile
                  gnetlist/scripts/annotate.sh
                  gnetlist/scripts/bom_xref.sh
                  gnetlist/scripts/bompp.sh
-                 gnetlist/scripts/sw2asc
                  gnetlist/lib/system-gnetlistrc
 
                  utils/Makefile
@@ -254,6 +253,7 @@ AC_CONFIG_FILES([Makefile
                  utils/lib/Makefile
                  utils/lib/system-gschlasrc
                  utils/scripts/Makefile
+                 utils/scripts/sw2asc
                  utils/src/Makefile
                  utils/tests/Makefile
                  utils/tests/gxyrs/Makefile
diff --git a/gnetlist/scripts/Makefile.am b/gnetlist/scripts/Makefile.am
index 77fd832..82d9b52 100644
--- a/gnetlist/scripts/Makefile.am
+++ b/gnetlist/scripts/Makefile.am
@@ -1,11 +1,11 @@
 
 EXTRA_DIST = bompp.sh.in annotate.sh.in unannotate.sh bom_xref.sh.in \
-	     sw2asc.in sch2eaglepos.sh
+	     sch2eaglepos.sh
 
-bin_SCRIPTS =  sw2asc sch2eaglepos.sh
+bin_SCRIPTS =  sch2eaglepos.sh
 
 MOSTLYCLEANFILES = *.log *~
 CLEANFILES = *.log *~
-DISTCLEANFILES = *.log core FILE *~ sw2asc bompp.sh annotate.sh bom_xref.sh
-MAINTAINERCLEANFILES = *.log *~ Makefile.in sw2asc bompp.sh annotate.sh \
+DISTCLEANFILES = *.log core FILE *~  bompp.sh annotate.sh bom_xref.sh
+MAINTAINERCLEANFILES = *.log *~ Makefile.in bompp.sh annotate.sh \
 		       bom_xref.sh
diff --git a/utils/scripts/Makefile.am b/utils/scripts/Makefile.am
index 76e629b..d7b0633 100644
--- a/utils/scripts/Makefile.am
+++ b/utils/scripts/Makefile.am
@@ -4,12 +4,12 @@
 
 bin_SCRIPTS = sarlacc_sym gschupdate gsymupdate refdes_renum \
 	      tragesym pads_backannotate pcb_backannotate garchive gsymfix.pl \
-	      gnet_hier_verilog.sh schdiff
+	      gnet_hier_verilog.sh schdiff sw2asc
 
 EXTRA_DIST = convert_sym.awk gpstoimage mk_char_tab.pl \
 	     sarlacc_sym gschupdate gsymupdate refdes_renum gsymfix.pl \
 	     tragesym pads_backannotate pcb_backannotate garchive.py \
-	     gnet_hier_verilog.sh schdiff
+	     gnet_hier_verilog.sh schdiff sw2asc.in
 
 ##  SDB's stuff to enable garchive.  This hardcodes the path to the
 ##  system libraries into garchive prior to installation.
@@ -20,5 +20,5 @@ garchive: $(srcdir)/garchive.py
 
 MOSTLYCLEANFILES = *.log *.ps core FILE tmp *~
 CLEANFILES = *.log *.ps core FILE tmp  *~
-DISTCLEANFILES = *.log core FILE tmp *~ garchive
-MAINTAINERCLEANFILES = *.log *.ps core FILE tmp *~ Makefile.in garchive
+DISTCLEANFILES = *.log core FILE tmp *~ garchive sw2asc
+MAINTAINERCLEANFILES = *.log *.ps core FILE tmp *~ Makefile.in garchive sw2asc
diff --git a/utils/scripts/sw2asc.in b/utils/scripts/sw2asc.in
new file mode 100644
index 0000000..84fab98
--- /dev/null
+++ b/utils/scripts/sw2asc.in
@@ -0,0 +1,231 @@
+#!@AWK@ -f
+#
+# gEDA - GPL Electronic Design Automation
+#
+# Copyright (C) 2003-2010 Dan McMahill
+#
+# 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.
+
+
+#
+# This is a script to extract out PRINT data from a SWITCAP simulation 
+# and write it to a format which gwave can read
+#
+
+BEGIN {
+  state_wait = 0;
+  state_skip_blank = 1;
+  state_read_data = 2;
+  state = state_wait;
+
+  analysis_none = 0;
+  analysis_SSS = 1;
+  analysis_SPECTRUM = 2;
+  analysis_FREQCOMP = 3;
+  analysis_TRAN = 4;
+  analysis = analysis_none;
+
+  progn = "sw2asc";
+
+  pat = "none";
+
+  variable_offset = 0;
+  nvars = 0;
+
+  for(i=1; i<ARGC; i=i+1) {
+    if(ARGV[i] ~ /^(-c)|(--copyright)$/) {
+      copyright();
+      exit 0;
+    } else if(ARGV[i] ~ /^((-h)|(--help))$/) {
+      usage();
+      exit 0;
+    } else if(ARGV[i] ~ /^((-v)|(--version))$/) {
+      copyright();
+      exit 0;
+    } else if(ARGV[i] ~ /^-.*/) {
+      printf("Unknown option: ""%s""\n", ARGV[i]) > "/dev/stderr";
+      usage();
+      close("/dev/stderr");
+      exit 1;
+    } 
+    printf("ARGV[%d] = %s\n", i, ARGV[i]);
+  }
+  infile = ARGV[ARGC-1];
+  
+  copyright();
+
+  printf("Loading SWITCAP output file [%s]\n", infile);
+}
+
+/^ Sinusoidal Steady State/ {
+  if( debug ) { printf("Start of SSS analysis\n"); }
+  analysis = analysis_SSS;
+  cnt_SSS = cnt_SSS + 1;
+  fileid = ".SSS." cnt_SSS;
+  pat = "^[ \t]*frequency";
+}
+
+/^ Spectral Analysis$/ {
+  if( debug ) { printf("Start of SPECTRUM analysis\n"); }
+  analysis = analysis_SPECTRUM;
+  cnt_SPECTRUM = cnt_SPECTRUM + 1;
+  fileid = ".SPECTRUM." cnt_SPECTRUM;
+  pat = "^not_implemented_yet$";
+  printf("Ignoring data from SPECTRUM analysis.\n");
+  printf("I haven't fully worked out how to always parse this\n");
+  printf("correctly.  Please write code to do this!!!\n\n");
+}
+
+/^ Spectral Analysis by Components$/ {
+  if( debug ) { printf("Start of FREQCOMP analysis\n"); }
+  analysis = analysis_FREQCOMP;
+  cnt_FREQCOMP = cnt_FREQCOMP + 1;
+  fileid = ".FREQCOMP." cnt_FREQCOMP;
+  pat = "^not_implemented_yet$";
+  printf("Ignoring data from FREQCOMP analysis.\n");
+  printf("I haven't fully worked out how to always parse this\n");
+  printf("correctly.  Please write code to do this!!!\n\n");
+}
+
+/^ Transient Analysis$/ {
+  if( debug ) { printf("Start of TRAN analysis\n"); }
+  analysis = analysis_TRAN;
+  cnt_TRAN = cnt_TRAN + 1;
+  fileid = ".TRAN." cnt_TRAN;
+  pat = "^[ \t]*time";
+}
+
+/^ Run Report$/ {
+  if( debug ) { printf("Start of Run Report\n"); }
+  analysis = analysis_none;
+  fileid = "none";
+  pat = "^this_is_the_run_report$";
+}
+
+/\*SWITCAP/ {
+  if( debug ) { printf("Saw *SWITCAP line\n"); }
+
+  if( variable_offset > 0 ) {
+    outf = infile fileid ".asc";
+    printf("Writing data to ""%s""\n", outf);
+    printf( "" ) > outf;
+    for(i = 1; i <= variable_offset; i = i + 1) {
+      printf("%s ", vnames[i]) >> outf;
+    }
+    printf("\n") >> outf;
+    
+    for(pt = 1; pt < cnt ; pt = pt + 1) {
+      if( debug > 1) { printf("point #%d: ", pt); }
+      for(i = 1; i <= variable_offset; i = i + 1) {
+	printf("%s ", data[i ":" pt]) >> outf;
+      }
+      printf("\n") >> outf;
+    }
+    close(outf);
+
+    variable_offset = 0;
+    nvars = 0;
+    for(k in data) { delete data[k]; }
+    num_analysis = num_analysis + 1;
+
+  } else {
+    if( debug ) { printf("No data to output yet\n"); }
+  }
+
+  next;
+}
+
+
+state == state_wait {
+  if( $0 ~ pat ) {
+    if( debug) { printf("state_wait: Variable start line:"); }
+    for(i=1; i<=NF; i=i+1) {
+      if( debug ) { printf("\tVariable #%d = %s\n", i, $i); }
+      vnames[i + variable_offset] = $i;
+    }
+    
+    nvars = NF;
+    
+    if( debug ) { printf("state_wait:  moving to state_skip_blank\n") };
+    state = state_skip_blank;
+  }
+  next;
+}
+
+state == state_skip_blank {
+  if( $0 == "" ) {
+    if( debug) { printf("state_skip_blank:  skipping blank line\n"); }
+    next; 
+  }
+  
+  cnt = 1;
+  if( debug ) { printf("state_skip_blank:  moving to state_read_data\n") };
+  state = state_read_data;
+}
+
+state == state_read_data {
+  if( $0 == "" ) {
+    variable_offset = variable_offset + nvars;
+    nvars = 0;
+    if( debug ) { printf("state_read_data:  moving to state_wait\n") };
+    state = state_wait;
+    next;
+  }
+
+  if( debug > 1 ) { printf("state_read_data: data = %s\n", $0); }
+  for(i=1; i<=NF; i=i+1) {
+    gsub(/d$/, "", $i);
+    data[i+variable_offset ":" cnt] = $i;
+  }
+  cnt = cnt + 1;
+  next;
+}
+
+END {
+  if( debug ) { printf("END.  Processed %d analyses.\n", num_analysis); };
+}
+
+
+function copyright() {
+  printf("gEDA/%s version %s\n", progn, "@VERSION@");
+  printf("gEDA/%s comes with ABSOLUTELY NO WARRANTY; see COPYING for more details.\n", progn);
+  printf("This is free software, and you are welcome to redistribute it under certain\n");
+  printf("conditions; please see the COPYING file for more details.\n\n");
+}
+
+function usage() {
+  printf("Usage:\n\n");
+  printf("\t%s -- -c|--copyright\n", progn);
+  printf("\t%s -- -h|--help\n", progn);
+  printf("\t%s -- -v|--version\n", progn);
+  printf("\t%s switcap.out\n", progn);
+  printf("\n");
+  printf("%s process the output file generated by the SWITCAP switched capacitor\n", progn);
+  printf("circuit simulator.  Data generated by SWITCAP ""PRINT"" statements is\n");
+  printf("extracted and written to an output file in an ASCII format which can be\n");
+  printf("directly loaded by the gwave waveform viewer or more easily loaded into\n");
+  printf("a tool such as scilab, octave, grace, or matlab.\n");
+  printf("\n");
+  printf("If multiple analyses are in the SWITCAP output file, then they are written\n");
+  printf("to individual files by %s.  The output file names are derived from the input\n", progn);
+  printf("file name by appending "".{SSS,TRAN}.#.asc"" to the name of the input file.\n");
+  printf("SSS is used for Sinusoidal Steady State analysis output and TRAN is used for.\n");
+  printf("TRANsient analysis output.  # corresponds to the analysis number (ie if you \n");
+  printf("have 3 SSS analyses in your file, you will end up with .SSS.1.asc, .SSS.2.asc,\n");
+  printf("and .SSS.3.asc.\n");
+  printf("\n");
+  
+}
+

commit 49fb5830b0990cc1f84a3ef966277dead9a6d847
Author: Dan McMahill <dan@xxxxxxxxxxxx>
Commit: Dan McMahill <dan@xxxxxxxxxxxx>

    Fix a few typos and also correctly identify -V with version and -v with verbose

diff --git a/utils/docs/pads_backannotate.1 b/utils/docs/pads_backannotate.1
index 1d7792b..2760aaf 100644
--- a/utils/docs/pads_backannotate.1
+++ b/utils/docs/pads_backannotate.1
@@ -5,11 +5,11 @@
 \- backannotates changes from a PADS engineering change order (ECO) file to schematic
 
 .SH SYNOPSIS
-.B pads_backannoate \-h\||\-\-help
+.B pads_backannotate \-h\||\-\-help
 
-.B pads_backannoate \-V\||\-\-version
+.B pads_backannotate \-V\||\-\-version
 
-.B pads_backannoate
+.B pads_backannotate
 [options]
 .I ecofile.eco infile1.sch [infile2.sch ...]  
 
@@ -34,10 +34,10 @@ whose names are generated by appending
 to the
 original file names.  The default is to overwrite the original.
 .TP
-\-V, \-\-verbose
+\-v, \-\-verbose
 operate verbosely
 .TP
-\-v, \-\-version
+\-V, \-\-version
 prints version information and exits
 
 .SH EXIT STATUS
diff --git a/utils/docs/pcb_backannotate.1 b/utils/docs/pcb_backannotate.1
index a856807..8239dca 100644
--- a/utils/docs/pcb_backannotate.1
+++ b/utils/docs/pcb_backannotate.1
@@ -5,11 +5,11 @@
 \- backannotates changes from a PCB annotation file to schematic
 
 .SH SYNOPSIS
-.B pcb_backannoate \-h\||\-\-help
+.B pcb_backannotate \-h\||\-\-help
 
-.B pcb_backannoate \-V\||\-\-version
+.B pcb_backannotate \-V\||\-\-version
 
-.B pcb_backannoate
+.B pcb_backannotate
 [options]
 .I ecofile.eco infile1.sch [infile2.sch ...]  
 
@@ -34,10 +34,10 @@ whose names are generated by appending
 to the
 original file names.  The default is to overwrite the original.
 .TP
-\-V, \-\-verbose
+\-v, \-\-verbose
 operate verbosely
 .TP
-\-v, \-\-version
+\-V, \-\-version
 prints version information and exits
 
 .SH EXIT STATUS

commit 90475267fe88bacd8c36121335904c58f7a76547
Author: Dan McMahill <dan@xxxxxxxxxxxx>
Commit: Dan McMahill <dan@xxxxxxxxxxxx>

    Add man page for sw2asc.
    
    Affects-bug: lp-698849

diff --git a/utils/docs/Makefile.am b/utils/docs/Makefile.am
index ab662ba..2c02b1f 100644
--- a/utils/docs/Makefile.am
+++ b/utils/docs/Makefile.am
@@ -16,7 +16,7 @@ else
 endif
 
 dist_man_MANS = gsch2pcb.1 grenum.1 gxyrs.1 pads_backannotate.1 \
-	pcb_backannotate.1 refdes_renum.1 schdiff.1
+	pcb_backannotate.1 refdes_renum.1 schdiff.1 sw2asc.1
 
 
 # Rules for converting man->html
diff --git a/utils/docs/sw2asc.1 b/utils/docs/sw2asc.1
new file mode 100644
index 0000000..0ce321a
--- /dev/null
+++ b/utils/docs/sw2asc.1
@@ -0,0 +1,68 @@
+.TH sw2asc 1 "June 19th, 2011" "gEDA Project" 1.7.1.20110619
+
+.SH NAME
+.B sw2asc
+\- converts a SWITCAP2 output file into ASCII data files that other tools can read
+
+.SH SYNOPSIS
+.B sw2asc \-c\||\-\-copyright
+
+.B sw2asc \-h\||\-\-help
+
+.B sw2asc \-V\||\-\-version
+
+.B sw2asc
+.I switcap.out
+
+.SH DESCRIPTION
+
+The
+.I sw2asc
+program reads the switcap.out output file produced by SWITCAP2 and produces
+a set of ASCII datafiles which can be more easily loaded into various waveform
+plotting programs. 
+
+Data generated by SWITCAP2 "PRINT" statements is;
+extracted and written to an output file in an ASCII format which can be
+directly loaded by the 
+.I gwave
+waveform viewer or more easily loaded into
+a tool such as 
+.I scilab
+,
+.I octave
+,
+.I grace,
+, or 
+.I matlab
+.
+
+If multiple analyses are in the SWITCAP2 output file, then they are written
+to individual files.  The output file names are derived from the input
+file name by appending ".{SSS,TRAN}.#.asc"" to the name of the input file.
+SSS is used for Sinusoidal Steady State analysis output and TRAN is used for.
+TRANsient analysis output.  # corresponds to the analysis number (ie if you
+have 3 SSS analyses in your file, you will end up with .SSS.1.asc, .SSS.2.asc,
+and .SSS.3.asc.
+
+.SH OPTIONS
+.TP
+\-c, \-\-copyright
+prints copyright information and exits
+.TP
+\-h, \-\-help
+prints help message and exits
+.TP
+\-V, \-\-version
+prints version information and exits
+
+.SH EXIT STATUS
+.I sw2asc
+will return 0 on success and non-zero
+if the command did not complete successfully.
+
+.SH SEE ALSO
+SWITCAP2 users manual
+
+
+




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