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

gEDA-cvs: branch: master updated (1.1.2.20070818-1-g0aad767)



The branch, master has been updated
       via  0aad767df307a70d9fefc73fb08a49908cc26706 (commit)
      from  9f3b4e2520b8dc5adf3b77fd0dfbe1beec8398ef (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/configure.ac                              |    1 +
 gnetlist/include/prototype.h                       |    1 +
 gnetlist/src/s_hierarchy.c                         |   43 ++++++++++++++++++++
 gnetlist/tests/Makefile.am                         |    2 +-
 .../tests/{hierarchy => hierarchy2}/Makefile.am    |   15 +++----
 .../gafrc.hierarchy2}                              |    0 
 gnetlist/tests/hierarchy2/hierarchy2.geda          |   34 +++++++++++++++
 gnetlist/tests/hierarchy2/top.sch                  |   36 ++++++++++++++++
 gnetlist/tests/hierarchy2/under.sch                |   36 ++++++++++++++++
 gnetlist/tests/hierarchy2/under.sym                |   28 +++++++++++++
 10 files changed, 186 insertions(+), 10 deletions(-)
 copy gnetlist/tests/{hierarchy => hierarchy2}/Makefile.am (56%)
 copy gnetlist/tests/{hierarchy/gnetlistrc.hierarchy => hierarchy2/gafrc.hierarchy2} (100%)
 create mode 100644 gnetlist/tests/hierarchy2/hierarchy2.geda
 create mode 100644 gnetlist/tests/hierarchy2/top.sch
 create mode 100644 gnetlist/tests/hierarchy2/under.sch
 create mode 100644 gnetlist/tests/hierarchy2/under.sym


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

commit 0aad767df307a70d9fefc73fb08a49908cc26706
Author: Ales Hvezda <ahvezda@xxxxxxxx>
Date:   Sun Sep 2 16:50:29 2007 -0400

    Fix for Bug#1776547: graphical versus source
    
    The usage described in Bug#1776547 is pretty unique, but it might be handy
    to support in general.  The recursive source= and graphical= behavior is
    a unexpected side effect of the traversal of graphical symbols/components
    (552e06e921e4b6eb758b9483d1913c39b3fef5f5).  The fix is to explicitly
    check for the graphical= attribute and if it is found to not further
    traverse the hierarchy.  Regression tests were added so this behavior
    doesn't change in the future.

:100644 100644 372a384... fbe6e50... M	gnetlist/configure.ac
:100644 100644 4ad4fd1... 8f1e583... M	gnetlist/include/prototype.h
:100644 100644 8fd5f67... cc29d7d... M	gnetlist/src/s_hierarchy.c
:100644 100644 0ff4e17... 682ac99... M	gnetlist/tests/Makefile.am
:000000 100644 0000000... 71f0735... A	gnetlist/tests/hierarchy2/Makefile.am
:000000 100644 0000000... 8f48bfc... A	gnetlist/tests/hierarchy2/gafrc.hierarchy2
:000000 100644 0000000... a88ad8c... A	gnetlist/tests/hierarchy2/hierarchy2.geda
:000000 100644 0000000... 93c6a73... A	gnetlist/tests/hierarchy2/top.sch
:000000 100644 0000000... a110edb... A	gnetlist/tests/hierarchy2/under.sch
:000000 100644 0000000... 3ff81f5... A	gnetlist/tests/hierarchy2/under.sym

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

commit 0aad767df307a70d9fefc73fb08a49908cc26706
Author: Ales Hvezda <ahvezda@xxxxxxxx>
Date:   Sun Sep 2 16:50:29 2007 -0400

    Fix for Bug#1776547: graphical versus source
    
    The usage described in Bug#1776547 is pretty unique, but it might be handy
    to support in general.  The recursive source= and graphical= behavior is
    a unexpected side effect of the traversal of graphical symbols/components
    (552e06e921e4b6eb758b9483d1913c39b3fef5f5).  The fix is to explicitly
    check for the graphical= attribute and if it is found to not further
    traverse the hierarchy.  Regression tests were added so this behavior
    doesn't change in the future.

diff --git a/gnetlist/configure.ac b/gnetlist/configure.ac
index 372a384..fbe6e50 100644
--- a/gnetlist/configure.ac
+++ b/gnetlist/configure.ac
@@ -436,6 +436,7 @@ AC_CONFIG_FILES([Makefile
 		 examples/Makefile 
 		 tests/Makefile 
 		 tests/hierarchy/Makefile 
+		 tests/hierarchy2/Makefile 
 		 tests/drc2/Makefile
 		 tests/spice-sdb/Makefile
 		 tests/spice-sdb/inputs/Makefile
diff --git a/gnetlist/include/prototype.h b/gnetlist/include/prototype.h
index 4ad4fd1..8f1e583 100644
--- a/gnetlist/include/prototype.h
+++ b/gnetlist/include/prototype.h
@@ -62,6 +62,7 @@ char *s_hierarchy_create_netname(TOPLEVEL *pr_current, char *basename, char *hie
 char *s_hierarchy_create_netattrib(TOPLEVEL *pr_current, char *basename, char *hierarchy_tag);
 void s_hierarchy_remove_uref_mangling(TOPLEVEL *pr_current, NETLIST *head);
 char *s_hierarchy_return_baseuref(TOPLEVEL *pr_current, char *uref);
+int s_hierarchy_graphical_search(OBJECT* o_current, int count);
 /* s_misc.c */
 void verbose_print(char *string);
 void verbose_done(void);
diff --git a/gnetlist/src/s_hierarchy.c b/gnetlist/src/s_hierarchy.c
index 8fd5f67..cc29d7d 100644
--- a/gnetlist/src/s_hierarchy.c
+++ b/gnetlist/src/s_hierarchy.c
@@ -50,6 +50,7 @@ s_hierarchy_traverse(TOPLEVEL * pr_current, OBJECT * o_current,
     int looking_inside = FALSE;
     int loaded_flag = FALSE;
     char *current_filename;
+    int graphical=FALSE;
 
     attrib = o_attrib_search_name_single_count(o_current, "source", 0);
 
@@ -57,12 +58,23 @@ s_hierarchy_traverse(TOPLEVEL * pr_current, OBJECT * o_current,
     if (attrib == NULL) {
 	attrib = o_attrib_search_name(o_current->complex->prim_objs,
 				      "source", count);
+
 	looking_inside = TRUE;
 #if DEBUG
 	printf("going to look inside now\n");
 #endif
     }
 
+    graphical = s_hierarchy_graphical_search(o_current, count);
+    if (graphical) {
+	/* Do not bother traversing the hierarchy if the symbol has an */
+	/* graphical attribute attached to it. */
+	if (attrib) {
+	    g_free(attrib);
+ 	    attrib = NULL;
+	}
+    }
+
     while (attrib) {
 
 	/* look for source=filename,filename, ... */
@@ -148,6 +160,16 @@ s_hierarchy_traverse(TOPLEVEL * pr_current, OBJECT * o_current,
 	    attrib = o_attrib_search_name(o_current->complex->prim_objs,
 					  "source", count);
 	}
+
+        graphical = s_hierarchy_graphical_search(o_current, count);
+        if (graphical) {
+	  /* Do not bother looking further in the hierarchy if the symbol */
+          /* has an graphical attribute attached to it. */
+	  if (attrib) {
+	     g_free(attrib);
+	     attrib = NULL;
+          } 
+       }
     }
 }
 
@@ -616,3 +638,24 @@ char *s_hierarchy_return_baseuref(TOPLEVEL * pr_current, char *uref)
 
     return (return_value);
 }
+
+int 
+s_hierarchy_graphical_search(OBJECT* o_current, int count)
+{
+    char *graphical_attrib;
+    graphical_attrib = o_attrib_search_name_single_count(o_current, 
+                                                         "graphical", count);
+
+    if (graphical_attrib == NULL) {
+       graphical_attrib = o_attrib_search_name(o_current->complex->prim_objs,
+                                               "graphical", count);
+    }
+ 
+    if (graphical_attrib) {
+      g_free(graphical_attrib);      
+      return TRUE;
+    }
+  
+    return FALSE;
+}
+
diff --git a/gnetlist/tests/Makefile.am b/gnetlist/tests/Makefile.am
index 0ff4e17..682ac99 100644
--- a/gnetlist/tests/Makefile.am
+++ b/gnetlist/tests/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = hierarchy drc2 spice-sdb
+SUBDIRS = hierarchy hierarchy2 drc2 spice-sdb
 
 EXTRA_DIST = runtest.sh \
 	     7447.vhdl README amp.spice cascade.sch cascade.cascade \
diff --git a/gnetlist/tests/hierarchy2/Makefile.am b/gnetlist/tests/hierarchy2/Makefile.am
new file mode 100644
index 0000000..71f0735
--- /dev/null
+++ b/gnetlist/tests/hierarchy2/Makefile.am
@@ -0,0 +1,29 @@
+## Process this file with automake to produce Makefile.in
+
+EXTRA_DIST = gafrc.hierarchy2 hierarchy2.geda top.sch under.sch under.sym
+
+# Temporarily disabled make check, since this is interfering with 
+# make distcheck
+check_SCRIPTS = tests
+
+BUILDDIR=$(top_builddir)/tests/hierarchy2
+SRCDIR=$(srcdir)
+
+tests:
+	rm -f $(BUILDDIR)/new_*
+	( export TESTDIR=$(SRCDIR); \
+	  echo $$TESTDIR; \
+	  cp -f $(SRCDIR)/gafrc.hierarchy2 $(BUILDDIR)/gafrc; \
+	  gnetlist \
+	     -o $(BUILDDIR)/new_hierarchy2.geda -g geda \
+	     $(SRCDIR)/top.sch )
+	diff $(SRCDIR)/hierarchy2.geda $(BUILDDIR)/new_hierarchy2.geda; \
+	rm -f $(BUILDDIR)/gafrc
+
+MOSTLYCLEANFILES = new_* core *.log FILE *.ps *~
+CLEANFILES = new_* core *.log FILE *.ps *~
+DISTCLEANFILES = *.log core FILE *~ prototype.bak
+MAINTAINERCLEANFILES = new_* core *.log FILE *.ps *~ Makefile.in configure
+
+
+
diff --git a/gnetlist/tests/hierarchy2/gafrc.hierarchy2 b/gnetlist/tests/hierarchy2/gafrc.hierarchy2
new file mode 100644
index 0000000..8f48bfc
--- /dev/null
+++ b/gnetlist/tests/hierarchy2/gafrc.hierarchy2
@@ -0,0 +1,22 @@
+(source-library "${TESTDIR}")
+(component-library "${TESTDIR}")
+;(net-naming-priority "label")
+
+;(hierarchy-traversal "disabled")
+;(hierarchy-uref-mangle "disabled") 
+;(hierarchy-netname-mangle "disabled")
+;(hierarchy-netattrib-mangle "disabled")
+
+;(hierarchy-netname-separator ".")
+;(hierarchy-uref-separator ".")
+;(hierarchy-netattrib-separator ".")
+
+;(hierarchy-netname-order "prepend")
+;(hierarchy-uref-order "prepend")
+;(hierarchy-netattrib-order "prepend")
+
+
+
+
+
+
diff --git a/gnetlist/tests/hierarchy2/hierarchy2.geda b/gnetlist/tests/hierarchy2/hierarchy2.geda
new file mode 100644
index 0000000..a88ad8c
--- /dev/null
+++ b/gnetlist/tests/hierarchy2/hierarchy2.geda
@@ -0,0 +1,34 @@
+START header
+
+gEDA's netlist format
+Created specifically for testing of gnetlist
+
+END header
+
+START components
+
+U102/Uunder device=7400
+U100/Uunder device=7400
+
+END components
+
+START renamed-nets
+
+U102/unnamed_net3 -> two
+U102/unnamed_net4 -> two
+U100/unnamed_net1 -> one
+U100/unnamed_net2 -> one
+
+END renamed-nets
+
+START nets
+
+U102/GND : U102/Uunder 7 
+U102/Vcc : U102/Uunder 14 
+two : U102/Uunder 1, U102/Uunder 3 
+U100/GND : U100/Uunder 7 
+U100/Vcc : U100/Uunder 14 
+one : U100/Uunder 1, U100/Uunder 3 
+
+END nets
+
diff --git a/gnetlist/tests/hierarchy2/top.sch b/gnetlist/tests/hierarchy2/top.sch
new file mode 100644
index 0000000..93c6a73
--- /dev/null
+++ b/gnetlist/tests/hierarchy2/top.sch
@@ -0,0 +1,36 @@
+v 20070818 1
+C 40000 40000 0 0 0 title-B.sym
+C 44100 45900 1 0 0 under.sym
+{
+T 44400 47100 5 10 1 1 0 0 1
+device=symbol
+T 44400 47300 5 10 1 1 0 0 1
+source=under.sch
+T 44400 47500 5 10 1 1 0 0 1
+refdes=U100
+}
+N 46200 46400 47100 46400 4
+N 47100 46400 47100 44700 4
+N 47100 44700 43400 44700 4
+{
+T 43500 44800 5 10 1 1 0 0 1
+netname=one
+}
+N 43400 44700 43400 46400 4
+N 43400 46400 44100 46400 4
+C 48900 45900 1 0 0 under.sym
+{
+T 49200 47100 5 10 1 1 0 0 1
+device=symbol
+T 49200 47300 5 10 1 1 0 0 1
+refdes=U102
+}
+N 51000 46400 51900 46400 4
+N 51900 46400 51900 44700 4
+N 51900 44700 48200 44700 4
+{
+T 48300 44800 5 10 1 1 0 0 1
+netname=two
+}
+N 48200 44700 48200 46400 4
+N 48200 46400 48900 46400 4
diff --git a/gnetlist/tests/hierarchy2/under.sch b/gnetlist/tests/hierarchy2/under.sch
new file mode 100644
index 0000000..a110edb
--- /dev/null
+++ b/gnetlist/tests/hierarchy2/under.sch
@@ -0,0 +1,36 @@
+v 20070818 1
+C 40000 40000 0 0 0 title-B.sym
+C 46700 46800 1 0 0 7400-1.sym
+{
+T 47200 47700 5 10 0 0 0 0 1
+device=7400
+T 47000 47700 5 10 1 1 0 0 1
+refdes=Uunder
+T 47200 49050 5 10 0 0 0 0 1
+footprint=DIP14
+}
+N 45900 47500 46700 47500 4
+C 48600 47200 1 0 0 out-1.sym
+{
+T 48600 47500 5 10 0 0 0 0 1
+device=OUTPUT
+T 48600 47500 5 10 1 1 0 0 1
+refdes=out
+}
+C 45300 47400 1 0 0 in-1.sym
+{
+T 45300 47700 5 10 0 0 0 0 1
+device=INPUT
+T 45300 47700 5 10 1 1 0 0 1
+refdes=in
+}
+N 48000 47300 48600 47300 4
+C 51100 45800 1 0 0 under.sym
+{
+T 51400 47000 5 10 1 1 0 0 1
+device=symbol
+T 51400 47200 5 10 1 1 0 0 1
+source=under.sch
+T 51100 45800 5 10 1 0 0 0 1
+graphical=1
+}
diff --git a/gnetlist/tests/hierarchy2/under.sym b/gnetlist/tests/hierarchy2/under.sym
new file mode 100644
index 0000000..3ff81f5
--- /dev/null
+++ b/gnetlist/tests/hierarchy2/under.sym
@@ -0,0 +1,28 @@
+v 20070818 1
+B 300 0 1500 1100 3 0 0 0 -1 -1 0 -1 -1 -1 -1 -1
+P 0 500 300 500 1 0 0
+{
+T -1000 500 5 10 0 0 180 0 1
+pintype=unknown
+T 355 495 5 10 1 1 0 0 1
+pinlabel=in
+T 205 545 5 10 1 1 0 6 1
+pinnumber=1
+T -1000 500 5 10 0 0 180 0 1
+pinseq=0
+}
+P 2100 500 1800 500 1 0 0
+{
+T 3100 500 5 10 0 0 0 0 1
+pintype=unknown
+T 1745 495 5 10 1 1 0 6 1
+pinlabel=out
+T 1895 545 5 10 1 1 0 0 1
+pinnumber=2
+T 3100 500 5 10 0 0 0 0 1
+pinseq=0
+}
+T 300 1200 8 10 1 1 0 0 1
+device=symbol
+T 300 1400 8 10 1 1 0 0 1
+source=under.sch




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