optimizations in instance (connected to wires/net labels) highlights
This commit is contained in:
parent
3611b95444
commit
821ebf06f2
|
|
@ -849,6 +849,7 @@ int place_symbol(int pos, const char *symbol_name, double x, double y, short rot
|
|||
xctx->inst[n].flip=symbol_name ? flip : 0;
|
||||
|
||||
xctx->inst[n].flags=0;
|
||||
xctx->inst[n].color=0;
|
||||
xctx->inst[n].sel=0;
|
||||
xctx->inst[n].node=NULL;
|
||||
xctx->inst[n].prop_ptr=NULL;
|
||||
|
|
|
|||
136
src/draw.c
136
src/draw.c
|
|
@ -1574,7 +1574,6 @@ void draw(void)
|
|||
double x1, y1, x2, y2;
|
||||
struct instentry *instanceptr;
|
||||
struct wireentry *wireptr;
|
||||
int ii;
|
||||
char *type=NULL;
|
||||
int use_hash;
|
||||
register int c,i;
|
||||
|
|
@ -1632,74 +1631,44 @@ void draw(void)
|
|||
xPoly *p = &xctx->poly[c][i];
|
||||
drawpolygon(c, NOW, p->x, p->y, p->points, p->fill, p->dash);
|
||||
}
|
||||
if(use_hash) {
|
||||
|
||||
/* --------------------------------- inst_ptr iterator 20171224 */
|
||||
/*loop thru all squares that intersect drawing area */
|
||||
for(init_inst_iterator(x1, y1, x2, y2); ( instanceptr = inst_iterator_next() ) ;) {
|
||||
int ptr;
|
||||
if(use_hash) init_inst_iterator(x1, y1, x2, y2);
|
||||
else i = -1;
|
||||
while(1) {
|
||||
if(use_hash) {
|
||||
if( !(instanceptr = inst_iterator_next())) break;
|
||||
i = instanceptr->n;
|
||||
ptr = xctx->inst[i].ptr;
|
||||
if( ptr !=-1) {
|
||||
symptr = ptr+xctx->sym;
|
||||
if( c==0 || /*draw_symbol call is needed on layer 0 to avoid redundant work (outside check) */
|
||||
symptr->lines[c] ||
|
||||
symptr->arcs[c] ||
|
||||
symptr->rects[c] ||
|
||||
symptr->polygons[c] ||
|
||||
((c==TEXTWIRELAYER || c==TEXTLAYER) && symptr->texts)) {
|
||||
|
||||
type = symptr->type;
|
||||
if(!(
|
||||
xctx->hilight_nets &&
|
||||
type &&
|
||||
(
|
||||
(
|
||||
IS_LABEL_SH_OR_PIN(type) && xctx->inst[i].node && xctx->inst[i].node[0] &&
|
||||
bus_hilight_lookup(xctx->inst[i].node[0], 0, XLOOKUP )
|
||||
) ||
|
||||
(
|
||||
!IS_LABEL_SH_OR_PIN(type) && (xctx->inst[i].flags & 4)
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
draw_symbol(ADD, c, instanceptr->n,c,0,0,0.0,0.0);
|
||||
}
|
||||
}
|
||||
} /*if( ptr !=-1) */
|
||||
}
|
||||
/* --------------------------------- /20171224 */
|
||||
} else {
|
||||
|
||||
for(i=0;i<xctx->instances;i++) {
|
||||
if(xctx->inst[i].ptr == -1) continue;
|
||||
symptr = (xctx->inst[i].ptr+ xctx->sym);
|
||||
if( c==0 || /*draw_symbol call is needed on layer 0 to avoid redundant work (outside check) */
|
||||
symptr->lines[c] ||
|
||||
symptr->arcs[c] ||
|
||||
symptr->rects[c] ||
|
||||
symptr->polygons[c] ||
|
||||
((c==TEXTWIRELAYER || c==TEXTLAYER) && symptr->texts)) {
|
||||
else {
|
||||
i++;
|
||||
if(i >= xctx->instances) break;
|
||||
}
|
||||
if(xctx->inst[i].ptr == -1) continue;
|
||||
symptr = (xctx->inst[i].ptr+ xctx->sym);
|
||||
if( c==0 || /*draw_symbol call is needed on layer 0 to avoid redundant work (outside check) */
|
||||
symptr->lines[c] ||
|
||||
symptr->arcs[c] ||
|
||||
symptr->rects[c] ||
|
||||
symptr->polygons[c] ||
|
||||
((c==TEXTWIRELAYER || c==TEXTLAYER) && symptr->texts)) {
|
||||
|
||||
|
||||
type = (xctx->inst[i].ptr+ xctx->sym)->type;
|
||||
if(!(
|
||||
xctx->hilight_nets &&
|
||||
type &&
|
||||
(
|
||||
(
|
||||
IS_LABEL_SH_OR_PIN(type) && xctx->inst[i].node && xctx->inst[i].node[0] &&
|
||||
bus_hilight_lookup(xctx->inst[i].node[0], 0, XLOOKUP )
|
||||
) ||
|
||||
(
|
||||
!IS_LABEL_SH_OR_PIN(type) && (xctx->inst[i].flags & 4)
|
||||
)
|
||||
)
|
||||
type = (xctx->inst[i].ptr+ xctx->sym)->type;
|
||||
if(!(
|
||||
xctx->hilight_nets && /* if no highlights ... */
|
||||
type && /* ... or no type ... */
|
||||
(
|
||||
( /* ... or inst is not hilighted ... */
|
||||
IS_LABEL_SH_OR_PIN(type) && xctx->inst[i].node && xctx->inst[i].node[0] &&
|
||||
bus_hilight_lookup(xctx->inst[i].node[0], 0, XLOOKUP )
|
||||
) ||
|
||||
(
|
||||
!IS_LABEL_SH_OR_PIN(type) && (xctx->inst[i].flags & 4)
|
||||
)
|
||||
) {
|
||||
draw_symbol(ADD, c, i,c,0,0,0.0,0.0);
|
||||
}
|
||||
)
|
||||
)
|
||||
) {
|
||||
draw_symbol(ADD, c, i,c,0,0,0.0,0.0); /* ... then draw current layer */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1709,33 +1678,26 @@ void draw(void)
|
|||
drawrect(c, END, 0.0, 0.0, 0.0, 0.0, 0);
|
||||
drawline(c, END, 0.0, 0.0, 0.0, 0.0, 0);
|
||||
}
|
||||
if(draw_single_layer==-1 || draw_single_layer==WIRELAYER){
|
||||
if(draw_single_layer==-1 || draw_single_layer==WIRELAYER) {
|
||||
|
||||
if(use_hash) {
|
||||
dbg(3, "using spatial hash table iterator\n");
|
||||
/*loop thru all squares that intersect drawing area */
|
||||
|
||||
for(init_wire_iterator(x1, y1, x2, y2); ( wireptr = wire_iterator_next() ) ;) {
|
||||
ii=wireptr->n;
|
||||
if(xctx->wire[ii].bus) {
|
||||
drawline(WIRELAYER, THICK, xctx->wire[ii].x1,xctx->wire[ii].y1,
|
||||
xctx->wire[ii].x2,xctx->wire[ii].y2, 0);
|
||||
}
|
||||
else
|
||||
drawline(WIRELAYER, ADD, xctx->wire[ii].x1,xctx->wire[ii].y1,
|
||||
xctx->wire[ii].x2,xctx->wire[ii].y2, 0);
|
||||
if(use_hash) init_wire_iterator(x1, y1, x2, y2);
|
||||
else i = -1;
|
||||
while(1) {
|
||||
if(use_hash) {
|
||||
if( !(wireptr = wire_iterator_next())) break;
|
||||
i = wireptr->n;
|
||||
}
|
||||
} else {
|
||||
for(i=0;i<xctx->wires;i++)
|
||||
{
|
||||
if(xctx->wire[i].bus) {
|
||||
drawline(WIRELAYER, THICK, xctx->wire[i].x1,xctx->wire[i].y1,
|
||||
xctx->wire[i].x2,xctx->wire[i].y2, 0);
|
||||
}
|
||||
else
|
||||
drawline(WIRELAYER, ADD, xctx->wire[i].x1,xctx->wire[i].y1,
|
||||
xctx->wire[i].x2,xctx->wire[i].y2, 0);
|
||||
else {
|
||||
i++;
|
||||
if(i >= xctx->wires) break;
|
||||
}
|
||||
if(xctx->wire[i].bus) {
|
||||
drawline(WIRELAYER, THICK, xctx->wire[i].x1,xctx->wire[i].y1,
|
||||
xctx->wire[i].x2,xctx->wire[i].y2, 0);
|
||||
}
|
||||
else
|
||||
drawline(WIRELAYER, ADD, xctx->wire[i].x1,xctx->wire[i].y1,
|
||||
xctx->wire[i].x2,xctx->wire[i].y2, 0);
|
||||
}
|
||||
update_conn_cues(1, draw_window);
|
||||
filledrect(WIRELAYER, END, 0.0, 0.0, 0.0, 0.0);
|
||||
|
|
|
|||
231
src/hilight.c
231
src/hilight.c
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
#include "xschem.h"
|
||||
|
||||
static int *inst_color=NULL;
|
||||
|
||||
static unsigned int hi_hash(const char *tok)
|
||||
{
|
||||
unsigned int hash = 0;
|
||||
|
|
@ -294,9 +292,9 @@ void delete_hilight_net(void)
|
|||
xctx->hilight_nets=0;
|
||||
for(i=0;i<xctx->instances;i++) {
|
||||
xctx->inst[i].flags &= ~4 ;
|
||||
xctx->inst[i].color = 0 ;
|
||||
}
|
||||
dbg(1, "delete_hilight_net(): clearing\n");
|
||||
my_free(766, &inst_color);
|
||||
xctx->hilight_color=0;
|
||||
}
|
||||
|
||||
|
|
@ -322,14 +320,14 @@ void hilight_net_pin_mismatches(void)
|
|||
symbol = xctx->sym + xctx->inst[j].ptr;
|
||||
npin = symbol->rects[PINLAYER];
|
||||
rct=symbol->rect[PINLAYER];
|
||||
dbg(1, "delete_hilight_net(): \n");
|
||||
dbg(1, "hilight_net_pin_mismatches(): \n");
|
||||
for(i=0;i<npin;i++) {
|
||||
my_strdup(24, &labname,get_tok_value(rct[i].prop_ptr,"name",0));
|
||||
my_strdup(25, &lab, expandlabel(labname, &mult));
|
||||
my_strdup(26, &netname, net_name(j,i,&mult, 0, 1));
|
||||
dbg(1, "delete_hilight_net(): i=%d labname=%s explabname = %s net = %s\n", i, labname, lab, netname);
|
||||
dbg(1, "hilight_net_pin_mismatches(): i=%d labname=%s explabname = %s net = %s\n", i, labname, lab, netname);
|
||||
if(netname && strcmp(lab, netname)) {
|
||||
dbg(1, "delete_hilight_net(): hilight: %s\n", netname);
|
||||
dbg(1, "hilight_net_pin_mismatches(): hilight: %s\n", netname);
|
||||
bus_hilight_lookup(netname, xctx->hilight_color, XINSERT);
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
}
|
||||
|
|
@ -528,6 +526,7 @@ int search(const char *tok, const char *val, int sub, int sel, int what)
|
|||
dbg(1, "search(): setting hilight flag on inst %d\n",i);
|
||||
xctx->hilight_nets=1;
|
||||
xctx->inst[i].flags |= 4;
|
||||
xctx->inst[i].color = hilight_layer;
|
||||
if(what==NOW) for(c=0;c<cadlayers;c++)
|
||||
draw_symbol(NOW, hilight_layer, i,c,0,0,0.0,0.0);
|
||||
}
|
||||
|
|
@ -808,6 +807,8 @@ void hilight_net(int to_waveform)
|
|||
int i, n;
|
||||
char *type;
|
||||
int sim_is_xyce;
|
||||
int hilight_connected_inst;
|
||||
struct hilight_hashentry *entry;
|
||||
|
||||
prepare_netlist_structs(0);
|
||||
dbg(1, "hilight_net(): entering\n");
|
||||
|
|
@ -838,6 +839,8 @@ void hilight_net(int to_waveform)
|
|||
dbg(1, "hilight_net(): setting hilight flag on inst %d\n",n);
|
||||
xctx->hilight_nets=1;
|
||||
xctx->inst[n].flags |= 4;
|
||||
xctx->inst[n].color = get_color(xctx->hilight_color);
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
}
|
||||
if(type && (!strcmp(type, "current_probe") || !strcmp(type, "vsource")) ) {
|
||||
if(to_waveform == GAW) send_current_to_gaw(sim_is_xyce, xctx->inst[n].instname);
|
||||
|
|
@ -847,6 +850,33 @@ void hilight_net(int to_waveform)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 0; i < xctx->instances; i++) {
|
||||
type = (xctx->inst[i].ptr+ xctx->sym)->type;
|
||||
hilight_connected_inst =
|
||||
!strcmp(get_tok_value(xctx->inst[i].prop_ptr, "highlight", 0), "true") ||
|
||||
!strcmp(get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "highlight", 0), "true");
|
||||
if(hilight_connected_inst && type && !IS_LABEL_SH_OR_PIN(type)) {
|
||||
int rects, j;
|
||||
if( (rects = (xctx->inst[i].ptr+ xctx->sym)->rects[PINLAYER]) > 0 ) {
|
||||
dbg(2, "draw_hilight_net(): hilight_connected_inst inst=%d, node=%s\n", i, xctx->inst[i].node[0]);
|
||||
for(j=0;j<rects;j++) {
|
||||
if( xctx->inst[i].node && xctx->inst[i].node[j]) {
|
||||
entry=bus_hilight_lookup(xctx->inst[i].node[j], 0, XLOOKUP);
|
||||
if(entry) {
|
||||
xctx->inst[i].flags |= 4;
|
||||
xctx->inst[i].color=get_color(entry->value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if( type && IS_LABEL_SH_OR_PIN(type) ) {
|
||||
entry=bus_hilight_lookup( get_tok_value(xctx->inst[i].prop_ptr,"lab",0) , 0, XLOOKUP);
|
||||
if(entry) xctx->inst[i].color=get_color(entry->value);
|
||||
}
|
||||
}
|
||||
|
||||
if(!incr_hilight) xctx->hilight_color++;
|
||||
if(enable_drill) {
|
||||
drill_hilight();
|
||||
|
|
@ -857,12 +887,16 @@ void hilight_net(int to_waveform)
|
|||
|
||||
void unhilight_net(void)
|
||||
{
|
||||
int i,n;
|
||||
int i,n, clear;
|
||||
char *type;
|
||||
int hilight_connected_inst;
|
||||
struct hilight_hashentry *entry;
|
||||
|
||||
prepare_netlist_structs(0);
|
||||
dbg(1, "unhilight_net(): entering\n");
|
||||
rebuild_selected_array();
|
||||
|
||||
|
||||
for(i=0;i<xctx->lastsel;i++)
|
||||
{
|
||||
n = xctx->sel_array[i].n;
|
||||
|
|
@ -879,11 +913,44 @@ void unhilight_net(void)
|
|||
} else {
|
||||
}
|
||||
xctx->inst[n].flags &= ~4;
|
||||
xctx->inst[n].color = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(i = 0; i < xctx->instances; i++) {
|
||||
type = (xctx->inst[i].ptr+ xctx->sym)->type;
|
||||
hilight_connected_inst =
|
||||
!strcmp(get_tok_value(xctx->inst[i].prop_ptr, "highlight", 0), "true") ||
|
||||
!strcmp(get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "highlight", 0), "true");
|
||||
if(hilight_connected_inst && type && !IS_LABEL_SH_OR_PIN(type)) {
|
||||
int rects, j;
|
||||
if( (rects = (xctx->inst[i].ptr+ xctx->sym)->rects[PINLAYER]) > 0 ) {
|
||||
dbg(2, "draw_hilight_net(): hilight_connected_inst inst=%d, node=%s\n", i, xctx->inst[i].node[0]);
|
||||
for(j=0;j<rects;j++) {
|
||||
clear = 1;
|
||||
if( xctx->inst[i].node && xctx->inst[i].node[j]) {
|
||||
entry=bus_hilight_lookup(xctx->inst[i].node[j], 0, XLOOKUP);
|
||||
if(entry) {
|
||||
clear = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(clear) {
|
||||
xctx->inst[i].flags &= ~4;
|
||||
xctx->inst[i].color=0;
|
||||
}
|
||||
}
|
||||
} else if( type && IS_LABEL_SH_OR_PIN(type) ) {
|
||||
entry=bus_hilight_lookup( get_tok_value(xctx->inst[i].prop_ptr,"lab",0) , 0, XLOOKUP);
|
||||
if(!entry) xctx->inst[i].color=0;
|
||||
}
|
||||
}
|
||||
|
||||
unselect_all();
|
||||
}
|
||||
|
||||
|
|
@ -924,13 +991,13 @@ void select_hilight_net(void)
|
|||
!strcmp(get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "highlight", 0), "true") ||
|
||||
!strcmp(get_tok_value(xctx->inst[i].prop_ptr, "highlight", 0), "true");
|
||||
if( xctx->inst[i].flags & 4) {
|
||||
dbg(1, "draw_hilight_net(): instance %d flags &4 true\n", i);
|
||||
dbg(1, "select_hilight_net(): instance %d flags &4 true\n", i);
|
||||
xctx->inst[i].sel = SELECTED;
|
||||
}
|
||||
else if(hilight_connected_inst) {
|
||||
int rects, j;
|
||||
dbg(2, "draw_hilight_net(): hilight_connected_inst inst=%d, node=%s\n", i, xctx->inst[i].node[0]);
|
||||
if( (rects = (xctx->inst[i].ptr+ xctx->sym)->rects[PINLAYER]) > 0 ) {
|
||||
dbg(2, "select_hilight_net(): hilight_connected_inst inst=%d, node=%s\n", i, xctx->inst[i].node[0]);
|
||||
for(j=0;j<rects;j++) {
|
||||
if( xctx->inst[i].node && xctx->inst[i].node[j]) {
|
||||
entry=bus_hilight_lookup(xctx->inst[i].node[j], 0, XLOOKUP);
|
||||
|
|
@ -956,14 +1023,13 @@ void select_hilight_net(void)
|
|||
void draw_hilight_net(int on_window)
|
||||
{
|
||||
int save_draw;
|
||||
char *type=NULL;
|
||||
int i,c;
|
||||
struct hilight_hashentry *entry;
|
||||
register double x1,y1,x2,y2;
|
||||
double x1,y1,x2,y2;
|
||||
xSymbol *symptr;
|
||||
int use_hash;
|
||||
struct wireentry *wireptr;
|
||||
int hilight_connected_inst;
|
||||
struct instentry *instanceptr;
|
||||
|
||||
if(!xctx->hilight_nets) return;
|
||||
prepare_netlist_structs(0);
|
||||
|
|
@ -976,102 +1042,52 @@ void draw_hilight_net(int on_window)
|
|||
use_hash = (xctx->wires> 2000 || xctx->instances > 2000 ) && (x2 - x1 < ITERATOR_THRESHOLD);
|
||||
if(use_hash) {
|
||||
hash_wires();
|
||||
hash_instances();
|
||||
}
|
||||
if(!use_hash) for(i=0;i<xctx->wires;i++)
|
||||
{
|
||||
if( (entry = bus_hilight_lookup(xctx->wire[i].node, 0, XLOOKUP)) ) {
|
||||
if(xctx->wire[i].bus)
|
||||
drawline(get_color(entry->value), THICK,
|
||||
xctx->wire[i].x1, xctx->wire[i].y1, xctx->wire[i].x2, xctx->wire[i].y2, 0);
|
||||
else
|
||||
drawline(get_color(entry->value), NOW,
|
||||
xctx->wire[i].x1, xctx->wire[i].y1, xctx->wire[i].x2, xctx->wire[i].y2, 0);
|
||||
if(cadhalfdotsize*xctx->mooz>=0.7) {
|
||||
if( xctx->wire[i].end1 >1 ) { /* 20150331 draw_dots */
|
||||
filledarc(get_color(entry->value), NOW, xctx->wire[i].x1, xctx->wire[i].y1, cadhalfdotsize, 0, 360);
|
||||
}
|
||||
if( xctx->wire[i].end2 >1 ) { /* 20150331 draw_dots */
|
||||
filledarc(get_color(entry->value), NOW, xctx->wire[i].x2, xctx->wire[i].y2, cadhalfdotsize, 0, 360);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else for(init_wire_iterator(x1, y1, x2, y2); ( wireptr = wire_iterator_next() ) ;) {
|
||||
i = wireptr->n;
|
||||
if( (entry = bus_hilight_lookup(xctx->wire[i].node, 0, XLOOKUP)) ) {
|
||||
if(xctx->wire[i].bus)
|
||||
drawline(get_color(entry->value), THICK,
|
||||
xctx->wire[i].x1, xctx->wire[i].y1, xctx->wire[i].x2, xctx->wire[i].y2, 0);
|
||||
else
|
||||
drawline(get_color(entry->value), NOW,
|
||||
xctx->wire[i].x1, xctx->wire[i].y1, xctx->wire[i].x2, xctx->wire[i].y2, 0);
|
||||
if(cadhalfdotsize*xctx->mooz>=0.7) {
|
||||
if( xctx->wire[i].end1 >1 ) { /* 20150331 draw_dots */
|
||||
filledarc(get_color(entry->value), NOW, xctx->wire[i].x1, xctx->wire[i].y1, cadhalfdotsize, 0, 360);
|
||||
}
|
||||
if( xctx->wire[i].end2 >1 ) { /* 20150331 draw_dots */
|
||||
filledarc(get_color(entry->value), NOW, xctx->wire[i].x2, xctx->wire[i].y2, cadhalfdotsize, 0, 360);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(use_hash) init_wire_iterator(x1, y1, x2, y2);
|
||||
else i = -1;
|
||||
while(1) {
|
||||
if(use_hash) {
|
||||
if( !(wireptr = wire_iterator_next())) break;
|
||||
i = wireptr->n;
|
||||
}
|
||||
else {
|
||||
i++;
|
||||
if(i >= xctx->wires) break;
|
||||
}
|
||||
if( (entry = bus_hilight_lookup(xctx->wire[i].node, 0, XLOOKUP)) ) {
|
||||
if(xctx->wire[i].bus)
|
||||
drawline(get_color(entry->value), THICK,
|
||||
xctx->wire[i].x1, xctx->wire[i].y1, xctx->wire[i].x2, xctx->wire[i].y2, 0);
|
||||
else
|
||||
drawline(get_color(entry->value), NOW,
|
||||
xctx->wire[i].x1, xctx->wire[i].y1, xctx->wire[i].x2, xctx->wire[i].y2, 0);
|
||||
if(cadhalfdotsize*xctx->mooz>=0.7) {
|
||||
if( xctx->wire[i].end1 >1 ) { /* 20150331 draw_dots */
|
||||
filledarc(get_color(entry->value), NOW, xctx->wire[i].x1, xctx->wire[i].y1, cadhalfdotsize, 0, 360);
|
||||
}
|
||||
if( xctx->wire[i].end2 >1 ) { /* 20150331 draw_dots */
|
||||
filledarc(get_color(entry->value), NOW, xctx->wire[i].x2, xctx->wire[i].y2, cadhalfdotsize, 0, 360);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dbg(1, "draw_hilight_net() : allocating inst_color %d bytes \n", xctx->instances*sizeof(int));
|
||||
my_realloc(145, &inst_color,xctx->instances*sizeof(int));
|
||||
for(i=0;i<xctx->instances;i++)
|
||||
{
|
||||
|
||||
x1=X_TO_SCREEN(xctx->inst[i].x1);
|
||||
x2=X_TO_SCREEN(xctx->inst[i].x2);
|
||||
y1=Y_TO_SCREEN(xctx->inst[i].y1);
|
||||
y2=Y_TO_SCREEN(xctx->inst[i].y2);
|
||||
inst_color[i]=0;
|
||||
if(OUTSIDE(x1,y1,x2,y2,xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2)) continue;
|
||||
/* /20150409 */
|
||||
|
||||
type = (xctx->inst[i].ptr+ xctx->sym)->type;
|
||||
|
||||
hilight_connected_inst =
|
||||
!strcmp(get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "highlight", 0), "true") ||
|
||||
!strcmp(get_tok_value(xctx->inst[i].prop_ptr, "highlight", 0), "true");
|
||||
if( xctx->inst[i].flags & 4) {
|
||||
dbg(1, "draw_hilight_net(): instance %d flags &4 true\n", i);
|
||||
inst_color[i]=PINLAYER;
|
||||
}
|
||||
else if(hilight_connected_inst) {
|
||||
int rects, j;
|
||||
if( (rects = (xctx->inst[i].ptr+ xctx->sym)->rects[PINLAYER]) > 0 ) {
|
||||
dbg(2, "draw_hilight_net(): hilight_connected_inst inst=%d, node=%s\n", i, xctx->inst[i].node[0]);
|
||||
for(j=0;j<rects;j++) {
|
||||
if( xctx->inst[i].node && xctx->inst[i].node[j]) {
|
||||
entry=bus_hilight_lookup(xctx->inst[i].node[j], 0, XLOOKUP);
|
||||
if(entry) {
|
||||
inst_color[i]=get_color(entry->value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if( type && IS_LABEL_SH_OR_PIN(type) ) {
|
||||
entry=bus_hilight_lookup( get_tok_value(xctx->inst[i].prop_ptr,"lab",0) , 0, XLOOKUP);
|
||||
if(entry) inst_color[i]=get_color(entry->value);
|
||||
}
|
||||
}
|
||||
|
||||
for(c=0;c<cadlayers;c++) {
|
||||
/* 20160414 from draw() */
|
||||
if(draw_single_layer!=-1 && c != draw_single_layer) continue;
|
||||
|
||||
for(i=0;i<xctx->instances;i++)
|
||||
{
|
||||
if(inst_color[i] )
|
||||
if(use_hash) init_inst_iterator(x1, y1, x2, y2);
|
||||
else i = -1;
|
||||
while(1) {
|
||||
if(use_hash) {
|
||||
if( !(instanceptr = inst_iterator_next())) break;
|
||||
i = instanceptr->n;
|
||||
}
|
||||
else {
|
||||
i++;
|
||||
if(i >= xctx->instances) break;
|
||||
}
|
||||
if(xctx->inst[i].color )
|
||||
{
|
||||
|
||||
x1=X_TO_SCREEN(xctx->inst[i].x1);
|
||||
x2=X_TO_SCREEN(xctx->inst[i].x2);
|
||||
y1=Y_TO_SCREEN(xctx->inst[i].y1);
|
||||
y2=Y_TO_SCREEN(xctx->inst[i].y2);
|
||||
if(OUTSIDE(x1,y1,x2,y2,xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2)) continue;
|
||||
dbg(1, "draw_hilight_net(): instance:%d\n",i);
|
||||
/* 20160414 from draw() */
|
||||
symptr = (xctx->inst[i].ptr+ xctx->sym);
|
||||
if( c==0 || /*draw_symbol call is needed on layer 0 to avoid redundant work (outside check) */
|
||||
symptr->lines[c] ||
|
||||
|
|
@ -1079,17 +1095,16 @@ void draw_hilight_net(int on_window)
|
|||
symptr->arcs[c] ||
|
||||
symptr->polygons[c] ||
|
||||
((c==TEXTWIRELAYER || c==TEXTLAYER) && symptr->texts)) {
|
||||
draw_symbol(ADD, inst_color[i], i,c,0,0,0.0,0.0);
|
||||
draw_symbol(ADD, xctx->inst[i].color, i,c,0,0,0.0,0.0);
|
||||
}
|
||||
filledrect(inst_color[i], END, 0.0, 0.0, 0.0, 0.0);
|
||||
drawarc(inst_color[i], END, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0);
|
||||
drawrect(inst_color[i], END, 0.0, 0.0, 0.0, 0.0, 0);
|
||||
drawline(inst_color[i], END, 0.0, 0.0, 0.0, 0.0, 0);
|
||||
filledrect(xctx->inst[i].color, END, 0.0, 0.0, 0.0, 0.0);
|
||||
drawarc(xctx->inst[i].color, END, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0);
|
||||
drawrect(xctx->inst[i].color, END, 0.0, 0.0, 0.0, 0.0, 0);
|
||||
drawline(xctx->inst[i].color, END, 0.0, 0.0, 0.0, 0.0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
draw_window = save_draw;
|
||||
/* display_hilights(); */
|
||||
}
|
||||
|
||||
/* show == 0 ==> create pins from highlight nets */
|
||||
|
|
|
|||
|
|
@ -900,6 +900,7 @@ void copy_objects(int what)
|
|||
xctx->inst[n].sel=0;
|
||||
xctx->inst[xctx->instances].flags = xctx->inst[n].flags;
|
||||
xctx->inst[xctx->instances].flags &= ~4; /* do not propagate hilight */
|
||||
xctx->inst[xctx->instances].color = 0;
|
||||
xctx->inst[xctx->instances].x0 = xctx->rx1+xctx->deltax;
|
||||
xctx->inst[xctx->instances].y0 = xctx->ry1+xctx->deltay;
|
||||
xctx->inst[xctx->instances].sel = SELECTED;
|
||||
|
|
|
|||
|
|
@ -277,6 +277,7 @@ void hash_inst_pin(int what, int i, int j)
|
|||
statusmsg(str,2);
|
||||
if(!netlist_count) {
|
||||
xctx->inst[i].flags |=4;
|
||||
xctx->inst[i].color = PINLAYER;
|
||||
xctx->hilight_nets=1;
|
||||
}
|
||||
}
|
||||
|
|
@ -699,6 +700,7 @@ void prepare_netlist_structs(int for_netlist)
|
|||
my_snprintf(str, S(str), "instance: %d (%s): no name attribute set", i, inst[i].name);
|
||||
statusmsg(str,2);
|
||||
inst[i].flags |=4;
|
||||
inst[i].color = PINLAYER;
|
||||
xctx->hilight_nets=1;
|
||||
}
|
||||
}
|
||||
|
|
@ -707,6 +709,7 @@ void prepare_netlist_structs(int for_netlist)
|
|||
my_snprintf(str, S(str), "Symbol: %s: no type attribute set", inst[i].name);
|
||||
statusmsg(str,2);
|
||||
inst[i].flags |=4;
|
||||
inst[i].color = PINLAYER;
|
||||
xctx->hilight_nets=1;
|
||||
}
|
||||
if(type && inst[i].node && IS_LABEL_OR_PIN(type) ) { /* instance must have a pin! */
|
||||
|
|
@ -1185,6 +1188,7 @@ int sym_vs_sch_pins()
|
|||
for(j = 0; j < xctx->instances; j++) {
|
||||
if(!strcmp(xctx->inst[j].name, xctx->sym[i].name)) {
|
||||
xctx->inst[j].flags |=4;
|
||||
xctx->inst[i].color = PINLAYER;
|
||||
xctx->hilight_nets=1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1201,6 +1205,7 @@ int sym_vs_sch_pins()
|
|||
for(j = 0; j < xctx->instances; j++) {
|
||||
if(!strcmp(xctx->inst[j].name, xctx->sym[i].name)) {
|
||||
xctx->inst[j].flags |=4;
|
||||
xctx->inst[i].color = PINLAYER;
|
||||
xctx->hilight_nets=1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1234,6 +1239,7 @@ int sym_vs_sch_pins()
|
|||
for(j = 0; j < xctx->instances; j++) {
|
||||
if(!strcmp(xctx->inst[j].name, xctx->sym[i].name)) {
|
||||
xctx->inst[j].flags |=4;
|
||||
xctx->inst[i].color = PINLAYER;
|
||||
xctx->hilight_nets=1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1257,6 +1263,7 @@ int sym_vs_sch_pins()
|
|||
for(k = 0; k < xctx->instances; k++) {
|
||||
if(!strcmp(xctx->inst[k].name, xctx->sym[i].name)) {
|
||||
xctx->inst[k].flags |=4;
|
||||
xctx->inst[i].color = PINLAYER;
|
||||
xctx->hilight_nets=1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -259,6 +259,7 @@ void match_merged_inst(int old)
|
|||
/* delete_inst_node(i); */ /* probably not needed */
|
||||
xctx->inst[i].ptr=-1; /*04112003 was 0 */
|
||||
xctx->inst[i].flags=0;
|
||||
xctx->inst[i].color=0;
|
||||
xctx->inst[i].name=NULL;
|
||||
xctx->inst[i].instname=NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -551,6 +551,7 @@ static void load_inst(int k, FILE *fd)
|
|||
fprintf(errfp,"WARNING: missing fields for INSTANCE object, ignoring.\n");
|
||||
read_line(fd, 0);
|
||||
} else {
|
||||
xctx->inst[i].color=0;
|
||||
xctx->inst[i].flags=0;
|
||||
xctx->inst[i].sel=0;
|
||||
xctx->inst[i].ptr=-1; /*04112003 was 0 */
|
||||
|
|
|
|||
|
|
@ -247,14 +247,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
else if(!strcmp(argv[1],"clear_hilights"))
|
||||
{
|
||||
cmd_found = 1;
|
||||
delete_hilight_net();
|
||||
draw();
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
else if(!strcmp(argv[1],"clear_netlist_dir") )
|
||||
{
|
||||
cmd_found = 1;
|
||||
|
|
|
|||
|
|
@ -211,6 +211,7 @@ void check_unique_names(int rename)
|
|||
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].flags |=4;
|
||||
xctx->inst[i].color = PINLAYER;
|
||||
xctx->hilight_nets=1;
|
||||
if(rename == 1) {
|
||||
if(first) {
|
||||
|
|
@ -2327,6 +2328,7 @@ const char *net_name(int i, int j, int *multip, int hash_prefix_unnamed_net, int
|
|||
statusmsg(errstr,2);
|
||||
if(!netlist_count) {
|
||||
xctx->inst[i].flags |=4;
|
||||
xctx->inst[i].color = PINLAYER;
|
||||
xctx->hilight_nets=1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -424,7 +424,6 @@ void alloc_xschem_data()
|
|||
xctx->hilight_table[i] = NULL;
|
||||
xctx->node_redraw_table[i] = NULL; /* move.c */
|
||||
}
|
||||
xctx->inst_color=NULL;
|
||||
xctx->window = xctx->save_pixmap = 0;
|
||||
xctx->xrect[0].width = xctx->xrect[0].height = xctx->xrect[0].x = xctx->xrect[0].y = 0;
|
||||
#if HAS_CAIRO==1
|
||||
|
|
|
|||
|
|
@ -456,6 +456,7 @@ typedef struct
|
|||
short rot;
|
||||
short flip;
|
||||
short sel;
|
||||
short color;
|
||||
short flags; /* bit 0: skip field, bit 1: flag for different textlayer for pin/labels
|
||||
* bit 2 : hilight flag.
|
||||
*/
|
||||
|
|
@ -551,7 +552,6 @@ typedef struct {
|
|||
int head_undo_ptr;
|
||||
struct node_hashentry *node_table[HASHSIZE];
|
||||
struct hilight_hashentry *hilight_table[HASHSIZE];
|
||||
int *inst_color;
|
||||
int hilight_nets;
|
||||
int hilight_color;
|
||||
unsigned int rectcolor; /* current layer */
|
||||
|
|
@ -586,7 +586,6 @@ typedef struct {
|
|||
int nl_sel, nl_sem;
|
||||
XSegment *biggridpoint;
|
||||
XPoint *gridpoint;
|
||||
|
||||
} Xschem_ctx;
|
||||
|
||||
struct Lcc { /* used for symbols containing schematics as instances (LCC, Local Custom Cell) */
|
||||
|
|
|
|||
|
|
@ -766,7 +766,7 @@ proc reroute_inst {fullinst pinattr pinval newnet} {
|
|||
proc reroute_net {old new} {
|
||||
xschem push_undo
|
||||
xschem set no_undo 1
|
||||
xschem clear_hilights
|
||||
xschem unhilight
|
||||
probe_net $old
|
||||
set old_nopath [regsub {.*\.} $old {}]
|
||||
set new_nopath [regsub {.*\.} $new {}]
|
||||
|
|
@ -4018,7 +4018,7 @@ if { ( $::OS== "Windows" || [string length [lindex [array get env DISPLAY] 1] ]
|
|||
.menubar.hilight.menu add command -label {Select hilight nets / pins} -command "xschem select_hilight_net" \
|
||||
-accelerator Alt+K
|
||||
.menubar.hilight.menu add command -label {Un-highlight all net/pins} \
|
||||
-command "xschem clear_hilights" -accelerator Shift+K
|
||||
-command "xschem unhilight" -accelerator Shift+K
|
||||
.menubar.hilight.menu add command -label {Un-highlight selected net/pins} \
|
||||
-command "xschem unhilight" -accelerator Ctrl+K
|
||||
# 20160413
|
||||
|
|
|
|||
Loading…
Reference in New Issue