From 63a6a8767e84fa6ccd6bd684b101af87a7b8a41f Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Sun, 20 Dec 2020 02:09:38 +0100 Subject: [PATCH] resolved a slow path introduced in commit db6bee26 / r1406 ( rebuild xctx-hilight_nets) return; dbg(3, "draw_hilight_net(): xctx->prep_hi_structs=%d\n", xctx->prep_hi_structs); @@ -1045,7 +1045,6 @@ void draw_hilight_net(int on_window) if(use_hash) init_inst_iterator(x1, y1, x2, y2); else i = -1; while(1) { - char *type; if(use_hash) { if( !(instanceptr = inst_iterator_next())) break; i = instanceptr->n; @@ -1054,12 +1053,6 @@ void draw_hilight_net(int on_window) i++; if(i >= xctx->instances) break; } - type = (xctx->inst[i].ptr+ xctx->sym)->type; - /* after an undo xctx->inst[i].color is gone, so rebuild it for labels/pins */ - if( type && xctx->inst[i].color == 0 && IS_LABEL_SH_OR_PIN(type) ) { - entry=bus_hilight_lookup(xctx->inst[i].lab, 0, XLOOKUP); - if(entry) xctx->inst[i].color = get_color(entry->value); - } if(xctx->inst[i].color ) { symptr = (xctx->inst[i].ptr+ xctx->sym); diff --git a/src/netlist.c b/src/netlist.c index c414c1d6..f616ddac 100644 --- a/src/netlist.c +++ b/src/netlist.c @@ -631,6 +631,7 @@ void prepare_netlist_structs(int for_netlist) double rx1,ry1; struct wireentry *wptr; struct instpinentry *iptr; + struct hilight_hashentry *entry; int i,j, rects, generic_rects; char *dir=NULL; char *type=NULL; @@ -1041,6 +1042,16 @@ void prepare_netlist_structs(int for_netlist) my_free(840, &class); my_free(841, &global_node); dbg(2, "prepare_netlist_structs(): returning\n"); + + if(xctx->hilight_nets) for(i=0;iinstances;i++){ + /* after an undo/load/hierarchy descend/return + * xctx->inst[i].color is gone, so rebuild it for labels/pins */ + char *type = (xctx->inst[i].ptr+ xctx->sym)->type; + if(type && xctx->inst[i].color == 0 && IS_LABEL_SH_OR_PIN(type) ) { + entry=bus_hilight_lookup(xctx->inst[i].lab, 0, XLOOKUP); + if(entry) xctx->inst[i].color = get_color(entry->value); + } + } } int sym_vs_sch_pins()