From acb1c2892128b52e564fe8ff1acc69bb02906b6f Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Thu, 7 Jan 2021 16:35:57 +0100 Subject: [PATCH] find_inst_to_be_redrawn() fix speed issue when auto-net name showing is enabled: evaluate out of any operation loop, using hash table of changed nodes --- XSchemWin/XSchemWix/Product.wxs | 36 +- XSchemWin/XSchemWix/doc.wxs | 8 + XSchemWin/XSchemWix/heat_doc.wxs | 530 +-- XSchemWin/XSchemWix/heat_xschem_library.wxs | 3432 +++++++++---------- src/actions.c | 4 +- src/draw.c | 4 +- src/editprop.c | 23 +- src/move.c | 74 +- src/netlist.c | 14 +- src/psprint.c | 4 +- src/select.c | 9 +- src/token.c | 4 +- src/xschem.h | 3 +- 13 files changed, 2097 insertions(+), 2048 deletions(-) diff --git a/XSchemWin/XSchemWix/Product.wxs b/XSchemWin/XSchemWix/Product.wxs index 02647718..3705fd3a 100644 --- a/XSchemWin/XSchemWix/Product.wxs +++ b/XSchemWin/XSchemWix/Product.wxs @@ -1,6 +1,6 @@ - + @@ -10,9 +10,31 @@ - + - + + + + + + + + + + @@ -81,6 +103,10 @@ = "8.6"]]> + + + + @@ -106,6 +132,9 @@ + + + @@ -283,6 +312,7 @@ + diff --git a/XSchemWin/XSchemWix/doc.wxs b/XSchemWin/XSchemWix/doc.wxs index 24755e64..63398ebf 100644 --- a/XSchemWin/XSchemWix/doc.wxs +++ b/XSchemWin/XSchemWix/doc.wxs @@ -453,6 +453,12 @@ + + + + + + @@ -944,6 +950,8 @@ + + diff --git a/XSchemWin/XSchemWix/heat_doc.wxs b/XSchemWin/XSchemWix/heat_doc.wxs index 086b926c..40453ec2 100644 --- a/XSchemWin/XSchemWix/heat_doc.wxs +++ b/XSchemWin/XSchemWix/heat_doc.wxs @@ -3,790 +3,796 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -944,6 +950,8 @@ + + diff --git a/XSchemWin/XSchemWix/heat_xschem_library.wxs b/XSchemWin/XSchemWix/heat_xschem_library.wxs index 77c60e56..1bf7b924 100644 --- a/XSchemWin/XSchemWix/heat_xschem_library.wxs +++ b/XSchemWin/XSchemWix/heat_xschem_library.wxs @@ -3,5177 +3,5177 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/actions.c b/src/actions.c index b39696d7..59e883fd 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1662,8 +1662,8 @@ void new_wire(int what, double mx_snap, double my_snap) if(show_pin_net_names) { prepare_netlist_structs(0); bbox(START , 0.0 , 0.0 , 0.0 , 0.0); - find_inst_to_be_redrawn(xctx->wire[xctx->wires-1].node); - find_inst_hash_clear(); + int_hash_lookup(xctx->node_redraw_table, xctx->wire[xctx->wires-1].node, 0, XINSERT_NOREPLACE); + find_inst_to_be_redrawn(); bbox(SET , 0.0 , 0.0 , 0.0 , 0.0); draw(); bbox(END , 0.0 , 0.0 , 0.0 , 0.0); diff --git a/src/draw.c b/src/draw.c index 4e9f8efc..abe5f14e 100644 --- a/src/draw.c +++ b/src/draw.c @@ -476,12 +476,12 @@ void draw_symbol(int what,int c, int n,int layer,short tmp_flip, short rot, ROTATION(rot, flip, 0.0,0.0,text.x0,text.y0,x1,y1); textlayer = c; /* do not allow custom text color on PINLAYER hilighted instances */ - if( !(xctx->inst[n].color == PINLAYER)) { + if( !(xctx->inst[n].color == -PINLAYER)) { textlayer = symptr->text[j].layer; if(textlayer < 0 || textlayer >= cadlayers) textlayer = c; } /* display PINLAYER colored instance texts even if PINLAYER disabled */ - if(xctx->inst[n].color == PINLAYER || enable_layer[textlayer]) { + if(xctx->inst[n].color == -PINLAYER || enable_layer[textlayer]) { #if HAS_CAIRO==1 textfont = symptr->text[j].font; if((textfont && textfont[0]) || symptr->text[j].flags) { diff --git a/src/editprop.c b/src/editprop.c index 6f2b57e6..a6ab7a87 100644 --- a/src/editprop.c +++ b/src/editprop.c @@ -934,15 +934,6 @@ void update_symbol(const char *result, int x) only_different=atoi(tclgetvar("preserve_unchanged_attrs") ); copy_cell=atoi(tclgetvar("user_wants_copy_cell") ); bbox(START,0.0,0.0,0.0,0.0); - if(show_pin_net_names) { - prepare_netlist_structs(0); - for(k = 0; k < (xctx->inst[i].ptr + xctx->sym)->rects[PINLAYER]; k++) { - if( xctx->inst[i].node && xctx->inst[i].node[k]) { - find_inst_to_be_redrawn(xctx->inst[i].node[k]); - } - } - find_inst_hash_clear(); - } /* 20191227 necessary? --> Yes since a symbol copy has already been done in edit_symbol_property() -> tcl edit_prop, this ensures new symbol is loaded from disk. if for some reason a symbol with matching name is loaded in xschem this @@ -967,6 +958,16 @@ void update_symbol(const char *result, int x) if(xctx->sel_array[k].type!=ELEMENT) continue; i=xctx->sel_array[k].n; + if(show_pin_net_names) { + int j; + prepare_netlist_structs(0); + for(j = 0; j < (xctx->inst[i].ptr + xctx->sym)->rects[PINLAYER]; j++) { + if( xctx->inst[i].node && xctx->inst[i].node[j]) { + int_hash_lookup(xctx->node_redraw_table, xctx->inst[i].node[j], 0, XINSERT_NOREPLACE); + } + } + } + /* 20171220 calculate bbox before changes to correctly redraw areas */ /* must be recalculated as cairo text extents vary with zoom factor. */ symbol_bbox(i, &xctx->inst[i].x1, &xctx->inst[i].y1, &xctx->inst[i].x2, &xctx->inst[i].y2); @@ -1056,11 +1057,10 @@ void update_symbol(const char *result, int x) prepare_netlist_structs(0); for(j = 0; j < (xctx->inst[i].ptr + xctx->sym)->rects[PINLAYER]; j++) { if( xctx->inst[i].node && xctx->inst[i].node[j]) { - find_inst_to_be_redrawn(xctx->inst[i].node[j]); + int_hash_lookup(xctx->node_redraw_table, xctx->inst[i].node[j], 0, XINSERT_NOREPLACE); } } } - find_inst_hash_clear(); } if(xctx->hilight_nets) for(i=0; i < xctx->instances; i++) { char *type = (xctx->inst[i].ptr+ xctx->sym)->type; @@ -1071,6 +1071,7 @@ void update_symbol(const char *result, int x) } } } + find_inst_to_be_redrawn(); /* redraw symbol with new props */ bbox(SET,0.0,0.0,0.0,0.0); dbg(1, "update_symbol(): redrawing inst_ptr.txtprop string\n"); diff --git a/src/move.c b/src/move.c index 32a60531..cca4bf04 100644 --- a/src/move.c +++ b/src/move.c @@ -468,46 +468,52 @@ void draw_selection(GC g, int interruptable) xctx->movelastsel = i; } -void find_inst_hash_clear(void) -{ - free_int_hash(xctx->node_redraw_table); -} - -void find_inst_to_be_redrawn(const char *node) +/* A list of electrical nodes that could potentially have been changed is previously hashed + * into xctx->node_redraw_table, find all connected instances/wires and set bbox of areas + * that potentially need to be redraw (show net names on symbol pins) + */ +void find_inst_to_be_redrawn() { + struct int_hashentry *ientry; int i, p, rects; xSymbol * sym; - - if(int_hash_lookup(xctx->node_redraw_table, node, 0, XINSERT_NOREPLACE)) return; - dbg(1, "find_inst_to_be_redrawn(): node=%s\n", node); for(i=0; i < xctx->instances; i++) { sym = xctx->inst[i].ptr + xctx->sym; rects = sym->rects[PINLAYER]; for(p = 0; p < rects; p++) { - if(node && xctx->inst[i].node[p] && !strcmp(xctx->inst[i].node[p], node )) { - symbol_bbox(i, &xctx->inst[i].x1, &xctx->inst[i].y1, &xctx->inst[i].x2, &xctx->inst[i].y2 ); - bbox(ADD, xctx->inst[i].x1, xctx->inst[i].y1, xctx->inst[i].x2, xctx->inst[i].y2 ); + if(xctx->inst[i].node && xctx->inst[i].node[p]) { + ientry = int_hash_lookup(xctx->node_redraw_table, xctx->inst[i].node[p], 0, XLOOKUP); + if(ientry) { + /* dbg(0, "find_inst_to_be_redrawn(): inst to be redrawn: %d\n", i); */ + symbol_bbox(i, &xctx->inst[i].x1, &xctx->inst[i].y1, &xctx->inst[i].x2, &xctx->inst[i].y2 ); + bbox(ADD, xctx->inst[i].x1, xctx->inst[i].y1, xctx->inst[i].x2, xctx->inst[i].y2 ); + break; + } } } } for(i=0;i < xctx->wires; i++) { - if(node && xctx->wire[i].node && !strcmp(xctx->wire[i].node, node )) { - if(xctx->wire[i].bus){ - int ov, y1, y2; - ov = INT_BUS_WIDTH(xctx->lw)> cadhalfdotsize ? INT_BUS_WIDTH(xctx->lw) : CADHALFDOTSIZE; - if(xctx->wire[i].y1 < xctx->wire[i].y2) { y1 = xctx->wire[i].y1-ov; y2 = xctx->wire[i].y2+ov; } - else { y1 = xctx->wire[i].y1+ov; y2 = xctx->wire[i].y2-ov; } - bbox(ADD, xctx->wire[i].x1-ov, y1 , xctx->wire[i].x2+ov , y2 ); - } else { - int ov, y1, y2; - ov = cadhalfdotsize; - if(xctx->wire[i].y1 < xctx->wire[i].y2) { y1 = xctx->wire[i].y1-ov; y2 = xctx->wire[i].y2+ov; } - else { y1 = xctx->wire[i].y1+ov; y2 = xctx->wire[i].y2-ov; } - bbox(ADD, xctx->wire[i].x1-ov, y1 , xctx->wire[i].x2+ov , y2 ); + if(xctx->wire[i].node) { + ientry = int_hash_lookup(xctx->node_redraw_table, xctx->wire[i].node, 0, XLOOKUP); + if(ientry) { + if(xctx->wire[i].bus){ + int ov, y1, y2; + ov = INT_BUS_WIDTH(xctx->lw)> cadhalfdotsize ? INT_BUS_WIDTH(xctx->lw) : CADHALFDOTSIZE; + if(xctx->wire[i].y1 < xctx->wire[i].y2) { y1 = xctx->wire[i].y1-ov; y2 = xctx->wire[i].y2+ov; } + else { y1 = xctx->wire[i].y1+ov; y2 = xctx->wire[i].y2-ov; } + bbox(ADD, xctx->wire[i].x1-ov, y1 , xctx->wire[i].x2+ov , y2 ); + } else { + int ov, y1, y2; + ov = cadhalfdotsize; + if(xctx->wire[i].y1 < xctx->wire[i].y2) { y1 = xctx->wire[i].y1-ov; y2 = xctx->wire[i].y2+ov; } + else { y1 = xctx->wire[i].y1+ov; y2 = xctx->wire[i].y2-ov; } + bbox(ADD, xctx->wire[i].x1-ov, y1 , xctx->wire[i].x2+ov , y2 ); + } } } } + free_int_hash(xctx->node_redraw_table); } void copy_objects(int what) @@ -922,18 +928,18 @@ void copy_objects(int what) bbox(ADD, xctx->inst[n].x1, xctx->inst[n].y1, xctx->inst[n].x2, xctx->inst[n].y2 ); if(show_pin_net_names) for(p = 0; p < (xctx->inst[n].ptr + xctx->sym)->rects[PINLAYER]; p++) { if( xctx->inst[n].node && xctx->inst[n].node[p]) { - find_inst_to_be_redrawn(xctx->inst[n].node[p]); + int_hash_lookup(xctx->node_redraw_table, xctx->inst[n].node[p], 0, XINSERT_NOREPLACE); } } } if(show_pin_net_names && xctx->sel_array[i].type == WIRE) { - find_inst_to_be_redrawn(xctx->wire[n].node); + int_hash_lookup(xctx->node_redraw_table, xctx->wire[n].node, 0, XINSERT_NOREPLACE); } } } - if(show_pin_net_names) find_inst_hash_clear(); } /* end for(k=0;ksym)->rects[PINLAYER]; p++) { if( inst[n].node && inst[n].node[p]) { - find_inst_to_be_redrawn(inst[n].node[p]); + int_hash_lookup(xctx->node_redraw_table, xctx->inst[n].node[p], 0, XINSERT_NOREPLACE); } } } if(show_pin_net_names && xctx->sel_array[i].type == WIRE) { - find_inst_to_be_redrawn(wire[n].node); + int_hash_lookup(xctx->node_redraw_table, xctx->wire[n].node, 0, XINSERT_NOREPLACE); } } - if(show_pin_net_names) find_inst_hash_clear(); + find_inst_to_be_redrawn(); for(k=0;klastsel;i++) @@ -1467,18 +1473,18 @@ void move_objects(int what, int merge, double dx, double dy) bbox(ADD, inst[n].x1, inst[n].y1, inst[n].x2, inst[n].y2 ); if(show_pin_net_names) for(p = 0; p < (inst[n].ptr + xctx->sym)->rects[PINLAYER]; p++) { if( inst[n].node && inst[n].node[p]) { - find_inst_to_be_redrawn(inst[n].node[p]); + int_hash_lookup(xctx->node_redraw_table, xctx->inst[n].node[p], 0, XINSERT_NOREPLACE); } } } if(show_pin_net_names && xctx->sel_array[i].type == WIRE) { - find_inst_to_be_redrawn(wire[n].node); + int_hash_lookup(xctx->node_redraw_table, xctx->wire[n].node, 0, XINSERT_NOREPLACE); } } } - if(show_pin_net_names) find_inst_hash_clear(); } /*end for(k=0;kinst[i].name, j, prop_ptr); statusmsg(str,2); if(!netlist_count) { - xctx->inst[i].color = PINLAYER; + xctx->inst[i].color = -PINLAYER; xctx->hilight_nets=1; } } @@ -695,7 +695,7 @@ void prepare_netlist_structs(int for_netlist) strcmp(type, "use")) { my_snprintf(str, S(str), "instance: %d (%s): no name attribute set", i, inst[i].name); statusmsg(str,2); - inst[i].color = PINLAYER; + inst[i].color = -PINLAYER; xctx->hilight_nets=1; } } @@ -703,7 +703,7 @@ void prepare_netlist_structs(int for_netlist) char str[2048]; my_snprintf(str, S(str), "Symbol: %s: no type attribute set", inst[i].name); statusmsg(str,2); - inst[i].color = PINLAYER; + inst[i].color = -PINLAYER; xctx->hilight_nets=1; } if(type && inst[i].node && IS_LABEL_OR_PIN(type) ) { /* instance must have a pin! */ @@ -1179,7 +1179,7 @@ int sym_vs_sch_pins() statusmsg(str,2); for(j = 0; j < xctx->instances; j++) { if(!strcmp(xctx->inst[j].name, xctx->sym[i].name)) { - xctx->inst[i].color = PINLAYER; + xctx->inst[i].color = -PINLAYER; xctx->hilight_nets=1; } } @@ -1195,7 +1195,7 @@ int sym_vs_sch_pins() statusmsg(str,2); for(j = 0; j < xctx->instances; j++) { if(!strcmp(xctx->inst[j].name, xctx->sym[i].name)) { - xctx->inst[i].color = PINLAYER; + xctx->inst[i].color = -PINLAYER; xctx->hilight_nets=1; } } @@ -1228,7 +1228,7 @@ int sym_vs_sch_pins() statusmsg(str,2); for(j = 0; j < xctx->instances; j++) { if(!strcmp(xctx->inst[j].name, xctx->sym[i].name)) { - xctx->inst[i].color = PINLAYER; + xctx->inst[i].color = -PINLAYER; xctx->hilight_nets=1; } } @@ -1251,7 +1251,7 @@ int sym_vs_sch_pins() statusmsg(str,2); for(k = 0; k < xctx->instances; k++) { if(!strcmp(xctx->inst[k].name, xctx->sym[i].name)) { - xctx->inst[i].color = PINLAYER; + xctx->inst[i].color = -PINLAYER; xctx->hilight_nets=1; } } diff --git a/src/psprint.c b/src/psprint.c index ee7b2243..e87e7703 100644 --- a/src/psprint.c +++ b/src/psprint.c @@ -589,12 +589,12 @@ static void ps_draw_symbol(int n,int layer, short tmp_flip, short rot, double xo ROTATION(rot, flip, 0.0,0.0,text.x0,text.y0,x1,y1); textlayer = layer; /* do not allow custom text color on PINLAYER hilighted instances */ - if( !(xctx->inst[n].color == PINLAYER)) { + if( !(xctx->inst[n].color == -PINLAYER)) { textlayer = (xctx->inst[n].ptr+ xctx->sym)->text[j].layer; if(textlayer < 0 || textlayer >= cadlayers) textlayer = layer; } /* display PINLAYER colored instance texts even if PINLAYER disabled */ - if(xctx->inst[n].color == PINLAYER || enable_layer[textlayer]) { + if(xctx->inst[n].color == -PINLAYER || enable_layer[textlayer]) { my_snprintf(ps_font_family, S(ps_font_name), "Helvetica"); my_snprintf(ps_font_name, S(ps_font_name), "Helvetica"); textfont = symptr->text[j].font; diff --git a/src/select.c b/src/select.c index 920ef148..12105e48 100644 --- a/src/select.c +++ b/src/select.c @@ -352,19 +352,16 @@ void delete(void) if(show_pin_net_names && type && IS_LABEL_OR_PIN(type) ) { for(p = 0; p < (xctx->inst[n].ptr + xctx->sym)->rects[PINLAYER]; p++) { if( xctx->inst[n].node && xctx->inst[n].node[p]) { - find_inst_to_be_redrawn(xctx->inst[n].node[p]); + int_hash_lookup(xctx->node_redraw_table, xctx->inst[n].node[p], 0, XINSERT_NOREPLACE); } } } } if(show_pin_net_names && xctx->sel_array[i].type == WIRE && xctx->wire[n].node) { - find_inst_to_be_redrawn(xctx->wire[n].node); + int_hash_lookup(xctx->node_redraw_table, xctx->wire[n].node, 0, XINSERT_NOREPLACE); } } - if(show_pin_net_names) { - find_inst_hash_clear(); - } - + find_inst_to_be_redrawn(); /* already done above diff --git a/src/token.c b/src/token.c index 145f01ae..d995ab99 100644 --- a/src/token.c +++ b/src/token.c @@ -210,7 +210,7 @@ void check_unique_names(int rename) if(comma_pos) *comma_pos = '\0'; dbg(1, "check_unique_names(): checking %s\n", start); if( (entry = inst_hash_lookup(table, start, i, XINSERT_NOREPLACE, strlen(start)) ) && entry->value != i) { - xctx->inst[i].color = PINLAYER; + xctx->inst[i].color = -PINLAYER; xctx->hilight_nets=1; if(rename == 1) { if(first) { @@ -2326,7 +2326,7 @@ const char *net_name(int i, int j, int *multip, int hash_prefix_unnamed_net, int i, j, xctx->inst[i].instname ) ; statusmsg(errstr,2); if(!netlist_count) { - xctx->inst[i].color = PINLAYER; + xctx->inst[i].color = -PINLAYER; xctx->hilight_nets=1; } } diff --git a/src/xschem.h b/src/xschem.h index 8ce9b0f2..e1d6752c 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -1031,8 +1031,7 @@ extern void arc_3_points(double x1, double y1, double x2, double y2, double x3, extern void move_objects(int what,int merge, double dx, double dy); extern void redraw_w_a_l_r_p_rubbers(void); /* redraw wire, arcs, line, polygon rubbers */ extern void copy_objects(int what); -extern void find_inst_to_be_redrawn(const char *node); -extern void find_inst_hash_clear(void); +extern void find_inst_to_be_redrawn(); extern void pan(int what); extern void pan2(int what, int mx, int my); extern void zoom_rectangle(int what);