diff --git a/XSchemWin/XSchemWix/Product.wxs b/XSchemWin/XSchemWix/Product.wxs index 0b4e10cb..53959cd6 100644 --- a/XSchemWin/XSchemWix/Product.wxs +++ b/XSchemWin/XSchemWix/Product.wxs @@ -1,6 +1,6 @@ - + diff --git a/XSchemWin/XSchemWix/heat_xschem_library.wxs b/XSchemWin/XSchemWix/heat_xschem_library.wxs index b7d8fb60..b6243ca6 100644 --- a/XSchemWin/XSchemWix/heat_xschem_library.wxs +++ b/XSchemWin/XSchemWix/heat_xschem_library.wxs @@ -3,5803 +3,5812 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -5826,6 +5835,7 @@ + @@ -6011,6 +6021,8 @@ + + diff --git a/XSchemWin/XSchemWix/xschem_library.wxs b/XSchemWin/XSchemWix/xschem_library.wxs index 08b0eeb5..0836512d 100644 --- a/XSchemWin/XSchemWix/xschem_library.wxs +++ b/XSchemWin/XSchemWix/xschem_library.wxs @@ -60,6 +60,9 @@ + + + @@ -617,6 +620,12 @@ + + + + + + @@ -5507,6 +5516,7 @@ + @@ -5692,6 +5702,8 @@ + + diff --git a/doc/xschem_man/developer_info.html b/doc/xschem_man/developer_info.html index 55998c43..95a68398 100644 --- a/doc/xschem_man/developer_info.html +++ b/doc/xschem_man/developer_info.html @@ -558,7 +558,10 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns" instance number to descend into for vector instances (default: 0).
  • descend_symbol
  •     Descend into the symbol view of selected component instance 
    -
  • display_hilights
  • +   
  • display_hilights [nets|instances]
  • +   Print a list of highlighted objects (nets, net labels/pins, instances)
    +   if 'instances' is specified list only instance highlights
    +   if 'nets' is specified list only net highlights 
    Print a list of highlighted objects (nets, net labels/pins, instances)
  • draw_graph [n] [flags]
  •     Redraw graph rectangle number 'n'.
    diff --git a/src/hilight.c b/src/hilight.c
    index 25407bf9..431dc91a 100644
    --- a/src/hilight.c
    +++ b/src/hilight.c
    @@ -128,15 +128,20 @@ static Hilight_hashentry *hilight_hash_lookup(const char *token, int value, int
     }
     
     /* wrapper function to hash highlighted instances, avoid clash with net names */
    -Hilight_hashentry *inst_hilight_hash_lookup(const char *token, int value, int what)
    +Hilight_hashentry *inst_hilight_hash_lookup(int i,  int value, int what)
     {
    +  const char *token = xctx->inst[i].instname;
       char *inst_tok = NULL;
       size_t len = strlen(token) + 2; /* token plus one more character and \0 */
    +  int label = 0;
       Hilight_hashentry *entry;
    +  if(IS_LABEL_SH_OR_PIN( (xctx->inst[i].ptr+xctx->sym)->type )) label = 1;
       dbg(1, "inst_hilight_hash_lookup: token=%s value=%d what=%d\n", token, value, what);
       inst_tok = my_malloc(_ALLOC_ID_, len);
       /* instance name uglyfication: add a space at beginning so it will never match a valid net name */
    -  my_snprintf(inst_tok, len, " %s", token);
    +  /* use 2 spaces for pins/labels to distinguish from other instances */
    +  if(label) my_snprintf(inst_tok, len, "  %s", token);
    +  else my_snprintf(inst_tok, len, " %s", token);
       entry = hilight_hash_lookup(inst_tok, value, what);
       my_free(_ALLOC_ID_, &inst_tok);
       return entry;
    @@ -183,20 +188,36 @@ Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int wha
       return ptr2;
     }
     
    -void display_hilights(char **str)
    +/* what:
    + *  1: list only nets
    + *  2: list only intances
    + *  3: list all
    + */
    +void display_hilights(int what, char **str)
     {
       int i;
       int first = 1;
    +  int instance = 0;
    +  const char *ptr;
       Hilight_hashentry *entry;
       for(i=0;ihilight_table[i];
         while(entry) {
    -      if(!first) my_strcat(_ALLOC_ID_, str, " ");
    -      my_strcat(_ALLOC_ID_, str,"{");
    -      my_strcat(_ALLOC_ID_, str, entry->path+1);
    -      my_strcat(_ALLOC_ID_, str, entry->token);
    -      my_strcat(_ALLOC_ID_, str,"}");
    -      first = 0;
    +      ptr = entry->token;
    +      if(ptr[0] == ' ' && ptr[1] == ' ' ) goto skip; /* do not list net labels / pins / net_show */
    +      if(ptr[0] == ' ') instance = 1;
    +      else instance = 0;
    +      dbg(1, "what=%d, instance=%d, token=%s\n", what, instance, ptr);
    +      if( ((what & 1) && !instance)  || ((what & 2) && instance) ) {
    +        if(instance) ptr++; /* skip uglyfication space */
    +        if(!first) my_strcat(_ALLOC_ID_, str, " ");
    +        my_strcat(_ALLOC_ID_, str,"{");
    +        my_strcat(_ALLOC_ID_, str, entry->path+1);
    +        my_strcat(_ALLOC_ID_, str, ptr);
    +        my_strcat(_ALLOC_ID_, str,"}");
    +        first = 0;
    +      }
    +      skip: 
           entry = entry->next;
         }
       }
    @@ -676,7 +697,7 @@ int search(const char *tok, const char *val, int sub, int sel)
                dbg(1, "search(): setting hilight flag on inst %d\n",i);
                /* xctx->hilight_nets=1; */  /* done in hilight_hash_lookup() */
                xctx->inst[i].color = col;
    -           inst_hilight_hash_lookup(xctx->inst[i].instname, col, XINSERT_NOREPLACE);
    +           inst_hilight_hash_lookup(i, col, XINSERT_NOREPLACE);
              }
            }
            if(sel==1) {
    @@ -827,7 +848,7 @@ static void drill_hilight(int mode)
               if( (entry=bus_hilight_hash_lookup(netbitname, 0, XLOOKUP)) ) {
                 if( hilight_connected_inst || (symbol->type && IS_LABEL_SH_OR_PIN(symbol->type)) ) {
                   xctx->inst[i].color = entry->value;
    -              inst_hilight_hash_lookup(xctx->inst[i].instname, entry->value, XINSERT_NOREPLACE); 
    +              inst_hilight_hash_lookup(i, entry->value, XINSERT_NOREPLACE); 
                 }
                 my_strdup(_ALLOC_ID_, &propagate_str, get_tok_value(rct[j].prop_ptr, "propag", 0));
                 if(propagate_str) {
    @@ -1222,7 +1243,7 @@ void propagate_hilights(int set, int clear, int mode)
                   if(entry) {
                     if(set) {
                       xctx->inst[i].color=entry->value;
    -                  inst_hilight_hash_lookup(xctx->inst[i].instname, entry->value, XINSERT_NOREPLACE);
    +                  inst_hilight_hash_lookup(i, entry->value, XINSERT_NOREPLACE);
                     } else {
                       nohilight_pins = 0; /* at least one connected net is hilighted: keep instance hilighted */
                     }
    @@ -1236,7 +1257,7 @@ void propagate_hilights(int set, int clear, int mode)
             }
           }
           else {
    -        entry=inst_hilight_hash_lookup(xctx->inst[i].instname, 0, XLOOKUP);
    +        entry=inst_hilight_hash_lookup(i, 0, XLOOKUP);
             if (entry && set) xctx->inst[i].color=entry->value;
           }
         /* ... else hilight/clear pin/label instances attached to hilight nets */
    @@ -1244,7 +1265,7 @@ void propagate_hilights(int set, int clear, int mode)
           entry=bus_hilight_hash_lookup( xctx->inst[i].node[0], 0, XLOOKUP);
           if(entry && set) {
             xctx->inst[i].color = entry->value;
    -        inst_hilight_hash_lookup(xctx->inst[i].instname, entry->value, XINSERT_NOREPLACE); 
    +        inst_hilight_hash_lookup(i, entry->value, XINSERT_NOREPLACE); 
           }
           else if(!entry && clear) xctx->inst[i].color = -10000;
         }
    @@ -1728,7 +1749,7 @@ void hilight_net(int viewer)
            dbg(1, "hilight_net(): setting hilight flag on inst %d\n",n);
            /* xctx->hilight_nets=1; */  /* done in hilight_hash_lookup() */
            xctx->inst[n].color = xctx->hilight_color;
    -       inst_hilight_hash_lookup(xctx->inst[n].instname, xctx->hilight_color, XINSERT_NOREPLACE);
    +       inst_hilight_hash_lookup(n, xctx->hilight_color, XINSERT_NOREPLACE);
            if(type &&  (!strcmp(type, "ammeter") || !strcmp(type, "vsource")) ) {
              if(viewer == XSCHEM_GRAPH)  send_current_to_graph(&s, sim_is_xyce, xctx->inst[n].instname);
              else if(viewer == GAW) send_current_to_gaw(sim_is_xyce, xctx->inst[n].instname);
    @@ -1770,7 +1791,7 @@ void unhilight_net(void)
            if( xctx->inst[n].node && IS_LABEL_SH_OR_PIN(type) ) { /* instance must have a pin! */
              bus_hilight_hash_lookup(xctx->inst[n].node[0], xctx->hilight_color, XDELETE);
            } else {
    -         inst_hilight_hash_lookup(xctx->inst[n].instname, xctx->hilight_color, XDELETE);
    +         inst_hilight_hash_lookup(n, xctx->hilight_color, XDELETE);
            }
          }
          xctx->inst[n].color = -10000;
    diff --git a/src/scheduler.c b/src/scheduler.c
    index 21ce6f68..9aac1e5d 100644
    --- a/src/scheduler.c
    +++ b/src/scheduler.c
    @@ -610,12 +610,19 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
           Tcl_ResetResult(interp);
         }
     
    -    /* display_hilights
    -     *   Print a list of highlighted objects (nets, net labels/pins, instances) */
    +    /* display_hilights [nets|instances]
    +     *   Print a list of highlighted objects (nets, net labels/pins, instances)
    +     *   if 'instances' is specified list only instance highlights
    +     *   if 'nets' is specified list only net highlights */
         else if(!strcmp(argv[1], "display_hilights"))
         {
           char *str = NULL;
    -      display_hilights(&str);
    +      int what = 3; /* nets and instances */
    +      if(argc > 2) {
    +        if(!strcmp(argv[2], "instances")) what = 2; /* instances only */
    +        else if(!strcmp(argv[2], "nets")) what = 1; /* nets only */
    +      }
    +      display_hilights(what, &str);
           Tcl_SetResult(interp, str, TCL_VOLATILE);
           my_free(_ALLOC_ID_, &str);
         }
    @@ -1488,7 +1495,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
                 dbg(1, "xschem hilight_instname: setting hilight flag on inst %d\n",inst);
                 /* xctx->hilight_nets=1; */  /* done in hilight_hash_lookup() */
                 xctx->inst[inst].color = xctx->hilight_color;
    -            inst_hilight_hash_lookup(xctx->inst[inst].instname, xctx->hilight_color, XINSERT_NOREPLACE);
    +            inst_hilight_hash_lookup(inst, xctx->hilight_color, XINSERT_NOREPLACE);
                 if(incr_hi) incr_hilight_color();
               }
               dbg(1, "hilight_nets=%d\n", xctx->hilight_nets);
    diff --git a/src/token.c b/src/token.c
    index 12ea4217..b7fffef7 100644
    --- a/src/token.c
    +++ b/src/token.c
    @@ -129,7 +129,7 @@ void check_unique_names(int rename)
           if( (entry = int_hash_lookup(&xctx->inst_table, upinst, i, XINSERT_NOREPLACE) ) && entry->value != i) {
             dbg(0, "check_unique_names(): found duplicate: i=%d name=%s\n", i, xctx->inst[i].instname);
             xctx->inst[i].color = -PINLAYER;
    -        inst_hilight_hash_lookup(xctx->inst[i].instname, -PINLAYER, XINSERT_NOREPLACE);
    +        inst_hilight_hash_lookup(i, -PINLAYER, XINSERT_NOREPLACE);
             if(rename == 1) {
               if(first) {
                 bbox(START,0.0,0.0,0.0,0.0);
    diff --git a/src/xschem.h b/src/xschem.h
    index ae9f9efd..53c69741 100644
    --- a/src/xschem.h
    +++ b/src/xschem.h
    @@ -1174,7 +1174,7 @@ extern int save(int confirm);
     extern void save_ascii_string(const char *ptr, FILE *fd, int newline);
     extern Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int what) ;
     /* wrapper function to hash highlighted instances, avoid clash with net names */
    -extern Hilight_hashentry *inst_hilight_hash_lookup(const char *token, int value, int what);
    +extern Hilight_hashentry *inst_hilight_hash_lookup(int i, int value, int what);
     extern Hilight_hashentry *hilight_lookup(const char *token, int value, int what);
     extern int search(const char *tok, const char *val, int sub, int sel);
     extern int process_options(int argc, char **argv);
    @@ -1502,7 +1502,7 @@ extern void unhilight_net();
     extern void propagate_hilights(int set, int clear, int mode);
     extern void  select_connected_wires(int stop_at_junction);
     extern void draw_hilight_net(int on_window);
    -extern void display_hilights(char **str);
    +extern void display_hilights(int what, char **str);
     extern void redraw_hilights(int clear);
     extern void set_tcl_netlist_type(void);
     extern int prepare_netlist_structs(int for_netlist);