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

Re: gEDA-user: Hybrid hierarchy



On Fri, 2008-06-27 at 20:52 +0100, Peter Clifton wrote:

> What I'd like to do is instantiate this block without any "/X1" in the
> refdes. IE.. turn name mangling off for this specific entity.
> 
> I tried deleting the "refdes=.." attribute for that block, and
> gnetlist
> then treated the block's contents as top-level entities ("K1", "K2"
> etc..).
> 
> I'm about to patch my gnetlist to keep the prefix up to this point,
> such
> that they become:
> 
> "X5/K1", "X5/K2" etc..

Turns out this was quite easy (easier than I'd expected):

Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Jun 27 21:37:53 2008 +0100

    Hybrid hierachy
    
    If a hierarchy block is missing its refdes=... attribute, insert
    it without any hierarchy prefix.
    
    (IE. its contents are instantiated at the same hierarchy level
    as its containing schematic).

diff --git a/gnetlist/src/s_traverse.c b/gnetlist/src/s_traverse.c
index 4f3328b..0ebd93a 100644
--- a/gnetlist/src/s_traverse.c
+++ b/gnetlist/src/s_traverse.c
@@ -153,7 +153,11 @@ s_traverse_sheet(TOPLEVEL * pr_current, OBJECT * start,
           s_hierarchy_create_uref(pr_current, temp_uref, hierarchy_tag);
         g_free(temp_uref);
       } else {
-        netlist->component_uref = NULL;
+        if (hierarchy_tag) {
+          netlist->component_uref = g_strdup (hierarchy_tag);
+        } else {
+          netlist->component_uref = NULL;
+        }
       }
       
       if (hierarchy_tag) {


Can anyone think what this breaks?

Should we print a warning to the console when this occurs (in-case
someone just forgot a refdes= attribute?)

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



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