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

gEDA-cvs: gaf.git: branch: stable-1.4 updated (1.4.2-20081220-7-g416c290)



The branch, stable-1.4 has been updated
       via  416c2900bcc126171a28e33341b90d9d49848ab8 (commit)
       via  794d0f1c804d366a0840a9ffc63e6bdf5da27b6b (commit)
       via  469f81a602ea8c5228f1553f6ee785499f24905e (commit)
       via  66140fd3956e8d4523c8a7ecc63e519144b9c4c6 (commit)
       via  51926b0107a70e944c494f9a5a76d379b217f9fb (commit)
       via  7b17b576aac3f59d880d5d28234833b3a9d82e26 (commit)
       via  f8749da75c18866778067b6ad04adfebce80559c (commit)
      from  f3c81e69811a60559b9a25dd9890c2e2df85e27a (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/scheme/gnet-systemc.scm |  276 ++++++++++++++++++++------------------
 gschem/src/g_hook.c              |    2 +-
 gschem/src/o_delete.c            |   17 +++
 gschem/src/o_move.c              |   50 +++++--
 gschem/src/o_text.c              |    8 +
 gschem/src/x_multiattrib.c       |   13 ++
 6 files changed, 219 insertions(+), 147 deletions(-)


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

commit 416c2900bcc126171a28e33341b90d9d49848ab8
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Sun Dec 21 23:38:41 2008 +0000

    Enable promotion of attributes when adding a component from guile.
    
    g_add_component()/add-component-at-xy was adding component with
    attribute promotion turned off.  This change fixes bug [#1932474].
    
    (cherry picked from commit f154fcb921e75e7940e0b4dbd9ad5bab6a61e704)

:100644 100644 303e058... 6368fe0... M	gschem/src/g_hook.c

commit 794d0f1c804d366a0840a9ffc63e6bdf5da27b6b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 23:38:41 2008 +0000

    o_move_end_rubberband(): Rework creating connectivity lists. Fix #2017356
    
    We were previously making a lists of pre- and post-move connected objects
    incrementally as we moved each individual object being stretched.
    
    In some cases this meant that as we moved one object, we artifically
    changed the connectivity of future ones to be moved, making the
    resulting connectivity lists inaccurate. In some examples, the objects
    being stretched themselves appeared in the lists.
    
    We want to avoid this, since if we delete a stretched object when
    it reaches zero length, we don't want that object to be referenced in
    the list of connected objects. Since we don't want to do more work
    than necessary re-drawing affected objects on screen, it is generally
    desirable to keep the lists as accurate as possible.
    
    To avoid the problem with incremental updates, build the connectivity
    lists before and after the entire move operation for stretched objects.
    
    This alone doesn't fix the case where a stretched object being deleted
    happens to touch another to start with. We have to check when deleting
    an object for its presence in the prev_conn_objects list. We check and
    remove _all_ references to the deleted object from that list.
    
    Thanks go to Patrick Bernaud for the test-case for this very tricky to
    reproduce bug, and an initial patch.
    
    (based on commit c69785fe267e2cdc70e2748dfab7268fbdcc3e7e)
    
    Edited since the STRETCH list is not a GList in the 1.4.x series, and
    other cleanup work on this file is not present.

:100644 100644 83b7082... 26bba5d... M	gschem/src/o_move.c

commit 469f81a602ea8c5228f1553f6ee785499f24905e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 23:38:40 2008 +0000

    gschem: Remove stretched object from stretch list if we delete it
    
    When a stretched object becomes zero length when rubberbanding, we
    delete it. We must also remember to delete it from the stretch list,
    otherwise it will be referenced later, and could cause a crash.
    
    NB: This isn't the whole story.. the before / after connectivity
        lists can still reference the deleted object and cause a crash.
    
    (based on commit fe8640898cb843b72e1c3cc01ee52c33db736ccf)
    
    Edited since the STRETCH list is not a GList in the 1.4.x series, and
    other cleanup work on this file is not present.

:100644 100644 0f46158... 83b7082... M	gschem/src/o_move.c

commit 66140fd3956e8d4523c8a7ecc63e519144b9c4c6
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 23:38:40 2008 +0000

    gschem: Check for self-connecting COMPLEX before deleting. Fix #1912859
    
    Remove any references to objects inside the COMPLEX being deleted
    when we build the list of objects to redraw on screen following the
    COMPLEX's deletion.
    
    This fixes a crash observed when deleting symbols with co-incident pins.
    
    (Based on commit 3d8b3efb5a4ce8672133658ccdbe5c57d341f0fc)
    
    Edited because OBJECT->complex_parent is only set on the HEAD node of
    a complex's prim_objs. Rather than traversing the whole object list to
    find the HEAD node each time, instead check each connected object against
    each of the deleted object's prim_objs.

:100644 100644 df45421... 108e3b9... M	gschem/src/o_delete.c

commit 51926b0107a70e944c494f9a5a76d379b217f9fb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 23:38:40 2008 +0000

    gschem: Don't add invalid attributes to the multiattrib dialog list
    
    Since we can't edit them, don't treat them as attributes.
    
    Gschem validates attributes upon creation, so an invalid attribute
    attached to an object must come from a hand-edited file, or a text
    object which has been attached to an object. (Validation that the
    text item is a valid attribute isn't performed in that code-path).
    
    In the future we might want to add validation of attributes at
    file-load and at before attaching text OBJECTs to a COMPLEX.
    
    (based on commit b14f3bf215963529b89f650ff3bd6f0b0c90450f)
    
    Edited to match old behaviour of o_attrib_get_name_value()

:100644 100644 d8cd0ea... 26ec40b... M	gschem/src/x_multiattrib.c

commit 7b17b576aac3f59d880d5d28234833b3a9d82e26
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 22:19:13 2008 +0000

    gnetlist: Fixup systemc backend
    
    Don't escape < and > characters in strings, as guile doesn't like this.
    
    Apply similar fixes as those made to the VHDL and verilog backends after
    some changes in gnetlist to accomodate slotting in spice-sdb. Since the
    netlist backend is loaded before gnetlist has traversed the schematic, it
    must not execute any code which queries gnetlist on load. All such work
    is to be done only when gnetlist invokes the "systemc" method.
    
    Move (define c_p #f) to outside (systemc:components ...)'s (lambda ...)
    function, since guile doesn't appreciate us mixing declarations and
    expressions. This variable is tested and (set! c_p #t) later on, which
    doesn't feel very scheme like. The fix works for now though.
    
    Check to see if the regexp matched netname, checking for "name<type>" has
    hit a match before trying to get a piece of that match. If the regexp
    returns #f, instead just treat the identifier as a "name" and use that.
    This allows net names which don't conform to the regexp to at least give
    some vaguely sensible output, without crashing the backend.
    
    Comment some debugging prints to stdout, giving a cleaner looking run.
    
    (cherry picked from commit bfd49ad477a49235c3e5ee1eda54e5009f6e347a
                    and commit d13aadcbac4af912e0555b3696b59fc904c6cd9f)

:100644 100644 a9f4a44... a2c5eb7... M	gnetlist/scheme/gnet-systemc.scm

commit f8749da75c18866778067b6ad04adfebce80559c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 22:12:15 2008 +0000

    gschem: Ensure we invalidate the region of text's origin marker
    
    Also ensure we invalidate the "I" marker if the text is invisible

:100644 100644 ba7464a... 1af35a4... M	gschem/src/o_text.c

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

commit 416c2900bcc126171a28e33341b90d9d49848ab8
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Sun Dec 21 23:38:41 2008 +0000

    Enable promotion of attributes when adding a component from guile.
    
    g_add_component()/add-component-at-xy was adding component with
    attribute promotion turned off.  This change fixes bug [#1932474].
    
    (cherry picked from commit f154fcb921e75e7940e0b4dbd9ad5bab6a61e704)

diff --git a/gschem/src/g_hook.c b/gschem/src/g_hook.c
index 303e058..6368fe0 100644
--- a/gschem/src/g_hook.c
+++ b/gschem/src/g_hook.c
@@ -727,7 +727,7 @@ SCM g_add_component(SCM page_smob, SCM scm_comp_name, SCM scm_x, SCM scm_y,
                     x, y, 
                     angle, mirror,
                     clib, comp_name, 
-                    selectable, FALSE);
+                    selectable, TRUE);
   
   /* 
    * For now, do not redraw the newly added complex, since this might cause

commit 794d0f1c804d366a0840a9ffc63e6bdf5da27b6b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 23:38:41 2008 +0000

    o_move_end_rubberband(): Rework creating connectivity lists. Fix #2017356
    
    We were previously making a lists of pre- and post-move connected objects
    incrementally as we moved each individual object being stretched.
    
    In some cases this meant that as we moved one object, we artifically
    changed the connectivity of future ones to be moved, making the
    resulting connectivity lists inaccurate. In some examples, the objects
    being stretched themselves appeared in the lists.
    
    We want to avoid this, since if we delete a stretched object when
    it reaches zero length, we don't want that object to be referenced in
    the list of connected objects. Since we don't want to do more work
    than necessary re-drawing affected objects on screen, it is generally
    desirable to keep the lists as accurate as possible.
    
    To avoid the problem with incremental updates, build the connectivity
    lists before and after the entire move operation for stretched objects.
    
    This alone doesn't fix the case where a stretched object being deleted
    happens to touch another to start with. We have to check when deleting
    an object for its presence in the prev_conn_objects list. We check and
    remove _all_ references to the deleted object from that list.
    
    Thanks go to Patrick Bernaud for the test-case for this very tricky to
    reproduce bug, and an initial patch.
    
    (based on commit c69785fe267e2cdc70e2748dfab7268fbdcc3e7e)
    
    Edited since the STRETCH list is not a GList in the 1.4.x series, and
    other cleanup work on this file is not present.

diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 83b7082..26bba5d 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -455,6 +455,20 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
   OBJECT *object;
   int x, y;
   int whichone;
+  GList *iter;
+
+  /* save a list of objects the stretched objects
+     are connected to before we move them. */
+  for (s_current = toplevel->page_current->stretch_head->next;
+       s_current != NULL; s_current = s_current->next) {
+    object = s_current->object;
+
+    if (object != NULL &&
+        (object->type == OBJ_NET ||
+         object->type == OBJ_BUS)) {
+      *other_objects = s_conn_return_others (*other_objects, object);
+    }
+  }
 
   /* skip over head */
   s_current = toplevel->page_current->stretch_head->next;
@@ -472,9 +486,7 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
         
         case (OBJ_NET):
           
-          /* save the other objects and remove object's connections */
-          *other_objects =
-            s_conn_return_others(*other_objects, object);
+          /* remove the object's connections */
           s_conn_remove(toplevel, object);
 
           x = object->line->x[whichone];
@@ -500,12 +512,11 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
             s_stretch_remove (toplevel->page_current->stretch_head, object);
             toplevel->page_current->stretch_tail =
               s_stretch_return_tail (toplevel->page_current->stretch_head);
+            *other_objects = g_list_remove_all (*other_objects, object);
           } else {
             o_net_recalc(toplevel, object);
             s_tile_update_object(toplevel, object);
             s_conn_update_object(toplevel, object);
-            *connected_objects =
-              s_conn_return_others(*connected_objects, object);
             *objects = g_list_append(*objects, object);
           }
 
@@ -519,9 +530,7 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
 
         case (OBJ_BUS):
 
-          /* save the other objects and remove object's connections */
-          *other_objects =
-            s_conn_return_others(*other_objects, object);
+          /* remove the object's connections */
           s_conn_remove(toplevel, object);
 
           x = object->line->x[whichone];
@@ -545,12 +554,11 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
             s_stretch_remove (toplevel->page_current->stretch_head, object);
             toplevel->page_current->stretch_tail =
               s_stretch_return_tail (toplevel->page_current->stretch_head);
+            *other_objects = g_list_remove_all (*other_objects, object);
           } else {
             o_bus_recalc(toplevel, object);
             s_tile_update_object(toplevel, object);
             s_conn_update_object(toplevel, object);
-            *connected_objects =
-              s_conn_return_others(*connected_objects, object);
             *objects = g_list_append(*objects, object);
           }
 
@@ -561,13 +569,19 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
     s_current = s_next;
   }
 
+  /* save a list of objects the stretched objects
+     are now connected to after we moved them. */
+  for (iter = *objects; iter != NULL; iter = g_list_next (iter)) {
+    object = iter->data;
+    *connected_objects = s_conn_return_others (*connected_objects, object);
+  }
+
 #if DEBUG
   /*! \bug FIXME: moved_objects doesn't exist? */
   /*printf("%d\n", g_list_length(*moved_objects));*/
   printf("%d\n", g_list_length(*other_objects));
   printf("%d\n", g_list_length(*connected_objects));
 #endif
-
 }
 
 /*! \todo Finish function documentation!!!

commit 469f81a602ea8c5228f1553f6ee785499f24905e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 23:38:40 2008 +0000

    gschem: Remove stretched object from stretch list if we delete it
    
    When a stretched object becomes zero length when rubberbanding, we
    delete it. We must also remember to delete it from the stretch list,
    otherwise it will be referenced later, and could cause a crash.
    
    NB: This isn't the whole story.. the before / after connectivity
        lists can still reference the deleted object and cause a crash.
    
    (based on commit fe8640898cb843b72e1c3cc01ee52c33db736ccf)
    
    Edited since the STRETCH list is not a GList in the 1.4.x series, and
    other cleanup work on this file is not present.

diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 0f46158..83b7082 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -451,7 +451,7 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
 			   GList** other_objects, GList** connected_objects)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
-  STRETCH *s_current;
+  STRETCH *s_current, *s_next;
   OBJECT *object;
   int x, y;
   int whichone;
@@ -461,6 +461,9 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
 
   while (s_current != NULL) {
     
+    /* Store this now, since we may delete the current item */
+    s_next = s_current->next;
+
     object = s_current->object;
     if (object) {
       whichone = s_current->whichone;
@@ -492,9 +495,11 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
           object->line->x[whichone] = x;
           object->line->y[whichone] = y;
 
-
           if (o_move_zero_length(object)) {
             o_delete_net(w_current, object);
+            s_stretch_remove (toplevel->page_current->stretch_head, object);
+            toplevel->page_current->stretch_tail =
+              s_stretch_return_tail (toplevel->page_current->stretch_head);
           } else {
             o_net_recalc(toplevel, object);
             s_tile_update_object(toplevel, object);
@@ -537,6 +542,9 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
 
           if (o_move_zero_length(object)) {
             o_delete_bus(w_current, object);
+            s_stretch_remove (toplevel->page_current->stretch_head, object);
+            toplevel->page_current->stretch_tail =
+              s_stretch_return_tail (toplevel->page_current->stretch_head);
           } else {
             o_bus_recalc(toplevel, object);
             s_tile_update_object(toplevel, object);
@@ -550,7 +558,7 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
       }
     }
     
-    s_current = s_current->next;
+    s_current = s_next;
   }
 
 #if DEBUG

commit 66140fd3956e8d4523c8a7ecc63e519144b9c4c6
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 23:38:40 2008 +0000

    gschem: Check for self-connecting COMPLEX before deleting. Fix #1912859
    
    Remove any references to objects inside the COMPLEX being deleted
    when we build the list of objects to redraw on screen following the
    COMPLEX's deletion.
    
    This fixes a crash observed when deleting symbols with co-incident pins.
    
    (Based on commit 3d8b3efb5a4ce8672133658ccdbe5c57d341f0fc)
    
    Edited because OBJECT->complex_parent is only set on the HEAD node of
    a complex's prim_objs. Rather than traversing the whole object list to
    find the HEAD node each time, instead check each connected object against
    each of the deleted object's prim_objs.

diff --git a/gschem/src/o_delete.c b/gschem/src/o_delete.c
index df45421..108e3b9 100644
--- a/gschem/src/o_delete.c
+++ b/gschem/src/o_delete.c
@@ -120,12 +120,29 @@ void o_delete_complex(GSCHEM_TOPLEVEL *w_current, OBJECT *obj)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
   GList *other_objects = NULL;
+  GList *iter, *iter_next;
 
   o_cue_undraw_complex(w_current, obj);
   o_erase_single(w_current, obj);
 
   other_objects = s_conn_return_complex_others(other_objects, obj);
 
+  /* Check for complex which self-connects, e.g. coincident pins.
+   * Remove any other_objects which are inside the complex.
+   */
+  for (iter = other_objects; iter != NULL; iter = iter_next) {
+    OBJECT *conn_obj = iter->data;
+    OBJECT *prim_obj = obj->complex->prim_objs;
+    iter_next = g_list_next (iter);
+    while (prim_obj != NULL) {
+      if (prim_obj == conn_obj) {
+        other_objects = g_list_delete_link (other_objects, iter);
+        break;
+      }
+      prim_obj = prim_obj->next;
+    }
+  }
+
   o_complex_delete(toplevel, obj);
 
   /*! \todo special case hack no return_tail. why? */

commit 51926b0107a70e944c494f9a5a76d379b217f9fb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 23:38:40 2008 +0000

    gschem: Don't add invalid attributes to the multiattrib dialog list
    
    Since we can't edit them, don't treat them as attributes.
    
    Gschem validates attributes upon creation, so an invalid attribute
    attached to an object must come from a hand-edited file, or a text
    object which has been attached to an object. (Validation that the
    text item is a valid attribute isn't performed in that code-path).
    
    In the future we might want to add validation of attributes at
    file-load and at before attaching text OBJECTs to a COMPLEX.
    
    (based on commit b14f3bf215963529b89f650ff3bd6f0b0c90450f)
    
    Edited to match old behaviour of o_attrib_get_name_value()

diff --git a/gschem/src/x_multiattrib.c b/gschem/src/x_multiattrib.c
index d8cd0ea..26ec40b 100644
--- a/gschem/src/x_multiattrib.c
+++ b/gschem/src/x_multiattrib.c
@@ -1887,14 +1887,17 @@ static void multiattrib_get_property (GObject *object,
  */
 void multiattrib_update (Multiattrib *multiattrib)
 {
+  TOPLEVEL *toplevel;
   GtkListStore *liststore;
   GtkTreeIter iter;
   OBJECT **object_attribs, *o_current;
   gint i;
   gboolean sensitive;
   GtkStyle *style;
+  gchar *name, *value;
 
   g_assert (GSCHEM_DIALOG (multiattrib)->w_current != NULL);
+  toplevel = GSCHEM_DIALOG (multiattrib)->w_current->toplevel;
 
   /* clear the list of attributes */
   liststore = (GtkListStore*)gtk_tree_view_get_model (multiattrib->treeview);
@@ -1926,6 +1929,16 @@ void multiattrib_update (Multiattrib *multiattrib)
     for (i = 0, o_current = object_attribs[i];
          o_current != NULL;
          i++, o_current = object_attribs[i]) {
+
+      /* Don't add invalid attributes to the list */
+      if (!o_attrib_get_name_value (o_current->text->string, &name, &value)) {
+        g_free (name);
+        g_free (value);
+        continue;
+      }
+      g_free (name);
+      g_free (value);
+
       gtk_list_store_append (liststore, &iter);
       gtk_list_store_set (liststore, &iter,
                           COLUMN_ATTRIBUTE, o_current,

commit 7b17b576aac3f59d880d5d28234833b3a9d82e26
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 22:19:13 2008 +0000

    gnetlist: Fixup systemc backend
    
    Don't escape < and > characters in strings, as guile doesn't like this.
    
    Apply similar fixes as those made to the VHDL and verilog backends after
    some changes in gnetlist to accomodate slotting in spice-sdb. Since the
    netlist backend is loaded before gnetlist has traversed the schematic, it
    must not execute any code which queries gnetlist on load. All such work
    is to be done only when gnetlist invokes the "systemc" method.
    
    Move (define c_p #f) to outside (systemc:components ...)'s (lambda ...)
    function, since guile doesn't appreciate us mixing declarations and
    expressions. This variable is tested and (set! c_p #t) later on, which
    doesn't feel very scheme like. The fix works for now though.
    
    Check to see if the regexp matched netname, checking for "name<type>" has
    hit a match before trying to get a piece of that match. If the regexp
    returns #f, instead just treat the identifier as a "name" and use that.
    This allows net names which don't conform to the regexp to at least give
    some vaguely sensible output, without crashing the backend.
    
    Comment some debugging prints to stdout, giving a cleaner looking run.
    
    (cherry picked from commit bfd49ad477a49235c3e5ee1eda54e5009f6e347a
                    and commit d13aadcbac4af912e0555b3696b59fc904c6cd9f)

diff --git a/gnetlist/scheme/gnet-systemc.scm b/gnetlist/scheme/gnet-systemc.scm
index a9f4a44..a2c5eb7 100644
--- a/gnetlist/scheme/gnet-systemc.scm
+++ b/gnetlist/scheme/gnet-systemc.scm
@@ -46,9 +46,9 @@
 ;; match on a systemc identifier like:  netname<type>
 (define systemc-reg (make-regexp
                         (string-append "^(" id-regexp ")[[:space:]]*"
-                                       "\<"
+                                       "<"
                                        "[[:space:]]*(" id-regexp ")[[:space:]]*"
-                                       "\>" )))
+                                       ">" )))
 
 ;; match on a systemc identifier like:  netname
 (define simple-id-reg (make-regexp 
@@ -217,11 +217,11 @@
 	 (simple-id (regexp-exec simple-id-reg netname))
 	 (systemc   (regexp-exec systemc-reg netname)))
 
-      (newline)
-      (display "    systemc:net-parse ")
-      (if systemc (begin (display systemc) (display "->") (display (match:substring systemc 2) )))
-      (if simple-id (display simple-id))
-      (newline)
+;;      (newline)
+;;      (display "    systemc:net-parse ")
+;;      (if systemc (begin (display systemc) (display "->") (display (match:substring systemc 2) )))
+;;      (if simple-id (display simple-id))
+;;      (newline)
 
       ;; check over each expression type, and build the appropriate
       ;; result
@@ -248,7 +248,7 @@
        ;; just a systemc signal?
        (systemc
          (begin 
-            (display "done systemc")(newline)
+;;            (display "done systemc")(newline)
            (list (match:substring systemc 1)
              (list (string->number (match:substring systemc 2))
                (match:substring systemc 2)
@@ -365,109 +365,115 @@
 ;;  return a list of net description objects
 ;;
 
-(define the-nets '())
-
-(define systemc:get-nets 
-  (begin 
-    (for-each 
-     (lambda (netname)
-       ; parse the netname, and see if it is already on the list
-       (let* ((parsed (systemc:net-parse netname))
-	      (listed (assoc (car parsed) the-nets)))
-
-(display  "systemc:get-nets(parsed)-> ")
-(display parsed)(display " (listed)-> ")
-(display listed)
-(newline)
-
-	 (if listed
-	     (begin ; it is, do some checks, and update the record
-	       ;; extract fields from list
-	       (let* ((list-name       (car listed))
-		      (list-n1         (car (cadr listed)))
-		      (list-n2         (cadr (cadr listed)))
-		      (list-increasing (caddr (cadr listed)))
-		      (list-sure       (cadddr (cadr listed)))
-		      (list-real       (cadddr (cdr (cadr listed))))
-		      
-		      (name            (car parsed))
-		      (n1              (car (cadr parsed)))
-		      (n2              (cadr (cadr parsed)))
-		      (increasing      (caddr (cadr parsed)))
-		      (sure            (cadddr (cadr parsed)))
-		      (real            (cadddr (cdr (cadr parsed))))
-
-		      (consistant      (or (and list-increasing increasing)
-					   (and (not list-increasing) 
-						(not increasing))))
-		      
-		     )
-
-		 (cond
-		  ((and list-sure consistant)
-		   (begin
-		     (set-cdr! listed
-			       (systemc:update-record n1 n2
-						      list-n1 list-n2
-						      increasing
-						      #t
-						      real)
-			       )))
-		   ((and list-sure (not sure) (zero? n1) (zero? n2))
-		    '() ;; this is a net without any expression, leave it
-		    )
-		  ((and list-sure (not consistant))
-		   (begin      ;; order is inconsistent
-		     (display 
-		      (string-append "Warning: Net `" real "' has a " 
-				     "bit order that conflicts with "
-				     "the original definition of `"
-				     list-real "', ignoring `"
-				     real "'"
-				     ))
-		     (newline))) 
-		   ((and (not list-sure) sure consistant)
-		    (begin
-		      (set-cdr! listed
-				(systemc:update-record n1 n2
-						       list-n1 list-n2
-						       increasing
-						       #t
-						       real))))
-		    
-		   ((and (not list-sure) sure (not consistant))
-		    (begin
-		      (set-cdr! listed
-				(systemc:update-record n1 n2
-						       list-n2 list-n1
-						       increasing
-						       #t
-						       real))))
-		   ((and (not list-sure) (not sure))
-		    (begin
-		      (set-cdr! listed
-				(systemc:update-record n1 n2
-						       list-n1 list-n2
-						       increasing
-						       #f
-						       real))))
-		   (else
-		    (begin
-		      (display "This should never happen!")
-		      (newline)))
-		   )
-	     )
-	 )
-       (begin ; it is not, just add it to the end
-	 (set! the-nets 
-	       (append the-nets 
-		       (list parsed))))
-       ))
-(display  "systemc:get-nets(parsed)-> ")
-     )
-     
-    all-unique-nets)
-    the-nets))
+(define systemc:get-nets '())
+
+(define systemc:get-nets-once!
+  (lambda nil
+    (define the-nets '())
+    (set! systemc:get-nets
+      (begin
+        (for-each
+          (lambda (netname)
+            ; parse the netname, and see if it is already on the list
+            (let* ((parsed (systemc:net-parse netname))
+                   (listed (assoc (car parsed) the-nets)))
+
+;;             (display  "systemc:get-nets(parsed)-> ")
+;;             (display parsed)(display " (listed)-> ")
+;;             (display listed)
+;;             (newline)
+
+             (if listed
+                 (begin ; it is, do some checks, and update the record
+                   ;; extract fields from list
+                   (let* ((list-name       (car listed))
+                          (list-n1         (car (cadr listed)))
+                          (list-n2         (cadr (cadr listed)))
+                          (list-increasing (caddr (cadr listed)))
+                          (list-sure       (cadddr (cadr listed)))
+                          (list-real       (cadddr (cdr (cadr listed))))
+
+                          (name            (car parsed))
+                          (n1              (car (cadr parsed)))
+                          (n2              (cadr (cadr parsed)))
+                          (increasing      (caddr (cadr parsed)))
+                          (sure            (cadddr (cadr parsed)))
+                          (real            (cadddr (cdr (cadr parsed))))
+
+                          (consistant      (or (and list-increasing increasing)
+                                               (and (not list-increasing)
+                                                    (not increasing))))
+
+                         )
+
+                     (cond
+                      ((and list-sure consistant)
+                       (begin
+                         (set-cdr! listed
+                                   (systemc:update-record n1 n2
+                                                          list-n1 list-n2
+                                                          increasing
+                                                          #t
+                                                          real)
+                                   )))
+                       ((and list-sure (not sure) (zero? n1) (zero? n2))
+                        '() ;; this is a net without any expression, leave it
+                        )
+                      ((and list-sure (not consistant))
+                       (begin      ;; order is inconsistent
+                         (display
+                          (string-append "Warning: Net `" real "' has a "
+                                         "bit order that conflicts with "
+                                         "the original definition of `"
+                                         list-real "', ignoring `"
+                                         real "'"
+                                         ))
+                         (newline)))
+                       ((and (not list-sure) sure consistant)
+                        (begin
+                          (set-cdr! listed
+                                    (systemc:update-record n1 n2
+                                                           list-n1 list-n2
+                                                           increasing
+                                                           #t
+                                                           real))))
+
+                       ((and (not list-sure) sure (not consistant))
+                        (begin
+                          (set-cdr! listed
+                                    (systemc:update-record n1 n2
+                                                           list-n2 list-n1
+                                                           increasing
+                                                           #t
+                                                           real))))
+                       ((and (not list-sure) (not sure))
+                        (begin
+                          (set-cdr! listed
+                                    (systemc:update-record n1 n2
+                                                           list-n1 list-n2
+                                                           increasing
+                                                           #f
+                                                           real))))
+                       (else
+                        (begin
+                          (display "This should never happen!")
+                          (newline)))
+                       )
+                 )
+             )
+           (begin ; it is not, just add it to the end
+             (set! the-nets
+                   (append the-nets
+                           (list parsed))))
+           ))
+;;         (display  "systemc:get-nets(parsed)-> ")
+         )
+
+        all-unique-nets)
+      the-nets)
+    )
+    systemc:get-nets
+))
 
 ;;
 ;;  Display wires from the design
@@ -503,8 +509,8 @@
     (newline p)
     (for-each (lambda (wire)          ; print a wire statement for each
     ;;            (let ((name (car wire)) (n1 (car (cadr wire))) (n2 (cadr (cadr wire))) (increasing (caddr (cadr wire)))))
-    (display "/* Wires from the design */")(newline)
-                (display "systemc:write-wires -> ")(display wire)(newline)
+;;    (display "/* Wires from the design */")(newline)
+;;                (display "systemc:write-wires -> ")(display wire)(newline)
 		(display "sc_signal<" p)
                 (display (cadr (cadr wire)) p)        
 		(display "> " p)
@@ -556,11 +562,13 @@
 ;;        ...
 ;;    );
 ;;
+
+(define c_p #f)
+
 (define systemc:components
   (lambda (packages port)
     (begin
-
-      (define c_p #f)
+      (set! c_p #f)
       (display "/* Package instantiations */" port) (newline port)
 
       (for-each (lambda (package)         ; loop on packages
@@ -654,21 +662,24 @@
 ;;
 (define systemc:display-pin
     (lambda (pin positional port)
-      (begin
-	(if positional
-	    (begin    ; output a positional port instanace
-	      (display "  /* " port)
-	      (display (car pin) port)  ; add in name for debugging
-	      (display " */ " port )
-	      (display (cdr pin) port))
-	    (begin    ; else output a named port instance 
-	      (display "." port)
-	      ; Display the escaped version of the identifier
-	      (systemc:display-escaped-identifier (car pin) port)
-	      (display "(" port)
-              (display (match:substring (regexp-exec systemc-reg (cdr pin)) 1) port)
-;;	      (systemc:display-escaped-identifier (cdr pin) port)
-	      (display ")" port))))))
+      (let
+          ((systemc (regexp-exec systemc-reg (cdr pin))))
+          (begin
+            (if positional
+                (begin    ; output a positional port instanace
+                  (display "  /* " port)
+                  (display (car pin) port)  ; add in name for debugging
+                  (display " */ " port )
+                  (display (cdr pin) port))
+                (begin    ; else output a named port instance
+                  (display "." port)
+                  ; Display the escaped version of the identifier
+                  (systemc:display-escaped-identifier (car pin) port)
+                  (display "(" port)
+                  (if systemc
+                    (display (match:substring systemc 1) port)
+                    (systemc:display-escaped-identifier (cdr pin) port))
+                  (display ")" port)))))))
     
 	 
 
@@ -679,10 +690,11 @@
   (lambda (output-filename)
     (let ((port (open-output-file output-filename)))
       (begin
+        (systemc:get-nets-once!)
 	(systemc:write-top-header port)
-        (display "***** start write-wires ********")(newline)
+;;        (display "***** start write-wires ********")(newline)
 	(systemc:write-wires port)
-        (display "***** end write-wires ********")(newline)
+;;        (display "***** end write-wires ********")(newline)
 	(systemc:write-continuous-assigns port)
 	(systemc:components packages port)
 	(systemc:write-bottom-footer port)

commit f8749da75c18866778067b6ad04adfebce80559c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Dec 21 22:12:15 2008 +0000

    gschem: Ensure we invalidate the region of text's origin marker
    
    Also ensure we invalidate the "I" marker if the text is invisible

diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index ba7464a..1af35a4 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -173,6 +173,10 @@ void o_text_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 		      screen_y1+small_dist,
 		      screen_x1+small_dist,
 		      screen_y1+small_dist);
+        o_invalidate_rect(w_current, screen_x1,
+                                     screen_y1,
+                                     screen_x1 + small_dist,
+                                     screen_y1 + small_dist);
       }	
     }
     
@@ -220,6 +224,10 @@ void o_text_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 		  screen_y1+small_dist, 
 		  screen_x1-small_dist, 
 		  screen_y1-small_dist);
+    o_invalidate_rect(w_current, screen_x1 - small_dist,
+                                 screen_y1 - small_dist,
+                                 screen_x1 + small_dist,
+                                 screen_y1 + small_dist);
   }
 }
 




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