added menu option to load most recent file: ctrl-shift-o, fix menu entry "unhilight selected nets" (did unhilight all); removed a wire[].node clear in hash_wire() that caused broken connectivity. this data is cleared in delete_netlist_structs when needed.
This commit is contained in:
parent
6e8486bbf2
commit
582863f825
|
|
@ -406,7 +406,7 @@ void ask_new_file(void)
|
|||
|
||||
if( fullname[0] ) {
|
||||
dbg(1, "ask_new_file(): load file: %s\n", fullname);
|
||||
delete_hilight_net();
|
||||
clear_all_hilights();
|
||||
xctx->currsch = 0;
|
||||
unselect_all();
|
||||
remove_symbols();
|
||||
|
|
@ -851,7 +851,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].color=-1;
|
||||
xctx->inst[n].sel=0;
|
||||
xctx->inst[n].node=NULL;
|
||||
xctx->inst[n].prop_ptr=NULL;
|
||||
|
|
@ -1105,7 +1105,7 @@ void descend_schematic(int instnumber)
|
|||
if(xctx->hilight_nets)
|
||||
{
|
||||
prepare_netlist_structs(0);
|
||||
propagate_hilights(1);
|
||||
propagate_hilights(1, 0);
|
||||
}
|
||||
dbg(1, "descend_schematic(): before zoom(): prep_hash_inst=%d\n", xctx->prep_hash_inst);
|
||||
zoom_full(1, 0, 1, 0.97);
|
||||
|
|
@ -1157,7 +1157,7 @@ void go_back(int confirm) /* 20171006 add confirm */
|
|||
|
||||
if(xctx->hilight_nets) {
|
||||
if(prev_sch_type != CAD_SYMBOL_ATTRS) hilight_parent_pins();
|
||||
propagate_hilights(1);
|
||||
propagate_hilights(1, 0);
|
||||
}
|
||||
xctx->xorigin=xctx->zoom_array[xctx->currsch].x;
|
||||
xctx->yorigin=xctx->zoom_array[xctx->currsch].y;
|
||||
|
|
@ -1330,7 +1330,7 @@ void calc_drawing_bbox(xRect *boundbox, int selected)
|
|||
entry=bus_hilight_lookup(xctx->inst[i].lab, 0, XLOOKUP );
|
||||
if(entry) found = 1;
|
||||
}
|
||||
else if( (xctx->inst[i].color) ) {
|
||||
else if( xctx->inst[i].color != -1 ) {
|
||||
found = 1;
|
||||
}
|
||||
if(!found) continue;
|
||||
|
|
|
|||
|
|
@ -811,6 +811,11 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
new_arc(PLACE, 360.);
|
||||
break;
|
||||
}
|
||||
if(key=='O' && (state == (ControlMask|ShiftMask)) ) /* load most recent tile */
|
||||
{
|
||||
Tcl_VarEval(interp, "xschem load [lindex $recentfile 0]", NULL);
|
||||
break;
|
||||
}
|
||||
if(key=='O' && state == ShiftMask) /* Toggle light/dark colorscheme 20171113 */
|
||||
{
|
||||
dark_colorscheme=!dark_colorscheme;
|
||||
|
|
@ -922,19 +927,8 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
}
|
||||
if(key=='k' && state==ControlMask) /* unhilight net */
|
||||
{
|
||||
xRect boundbox;
|
||||
int big = xctx->wires> 2000 || xctx->instances > 2000 ;
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(!big) calc_drawing_bbox(&boundbox, 2);
|
||||
unhilight_net();
|
||||
/* undraw_hilight_net(1); */
|
||||
if(!big) {
|
||||
bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
bbox(ADD, boundbox.x1, boundbox.y1, boundbox.x2, boundbox.y2);
|
||||
bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
}
|
||||
draw();
|
||||
if(!big) bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
break;
|
||||
}
|
||||
if(key=='K' && state==(ControlMask|ShiftMask)) /* hilight net drilling thru elements */
|
||||
|
|
@ -963,7 +957,7 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
if(xctx->semaphore >= 2) break;
|
||||
enable_drill=0;
|
||||
if(!big) calc_drawing_bbox(&boundbox, 2);
|
||||
delete_hilight_net();
|
||||
clear_all_hilights();
|
||||
/* undraw_hilight_net(1); */
|
||||
if(!big) {
|
||||
bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
|
|
@ -1628,7 +1622,7 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
if(!prev_last_sel) {
|
||||
int big = xctx->wires> 2000 || xctx->instances > 2000 ;
|
||||
if(!big) calc_drawing_bbox(&boundbox, 2);
|
||||
delete_hilight_net();
|
||||
clear_all_hilights();
|
||||
/* undraw_hilight_net(1); */
|
||||
if(!big) {
|
||||
bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
|
|
|
|||
|
|
@ -193,15 +193,14 @@ void trim_wires(void)
|
|||
else
|
||||
xctx->wire[xctx->wires].bus=0;
|
||||
xctx->wire[xctx->wires].node=NULL;
|
||||
|
||||
my_strdup(28, &xctx->wire[xctx->wires].node, xctx->wire[j].node);
|
||||
xctx->wire[j].x1 = x0;
|
||||
xctx->wire[j].y1 = y0;
|
||||
hash_wire(XINSERT, xctx->wires, 0);
|
||||
|
||||
i--; /* redo current i iteration, since we break the 'j' loop due to changed wire hash table */
|
||||
hash_wire(XDELETE, j, 0); /* rehash since endpoint x1, y1 changed */
|
||||
hash_wire(XINSERT, j, 0);
|
||||
|
||||
xctx->wires++;
|
||||
changed = 1;
|
||||
break;
|
||||
|
|
@ -371,8 +370,9 @@ void trim_wires(void)
|
|||
set_modify(1);
|
||||
}
|
||||
} while(changed);
|
||||
dbg(1,"trim_wires(): doloops=%d changed=%d\n", doloops, changed);
|
||||
dbg(1, "trim_wires(): doloops=%d changed=%d\n", doloops, changed);
|
||||
my_free(115, &wireflag);
|
||||
|
||||
}
|
||||
|
||||
void break_wires_at_pins(void)
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@ void draw_symbol(int what,int c, int n,int layer,short tmp_flip, short rot,
|
|||
( /* ... and inst is hilighted ... */
|
||||
IS_LABEL_SH_OR_PIN(type) && xctx->inst[n].node && xctx->inst[n].node[0] &&
|
||||
bus_hilight_lookup(xctx->inst[n].node[0], 0, XLOOKUP )
|
||||
) || ( !IS_LABEL_SH_OR_PIN(type) && (xctx->inst[n].color)) )) {
|
||||
) || ( !IS_LABEL_SH_OR_PIN(type) && (xctx->inst[n].color != -1)) )) {
|
||||
xctx->inst[n].flags|=1; /* ... then SKIP instance now and for following layers */
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
469
src/hilight.c
469
src/hilight.c
|
|
@ -179,120 +179,107 @@ void create_plot_cmd(int viewer)
|
|||
}
|
||||
}
|
||||
|
||||
struct hilight_hashentry *hilight_lookup(const char *token, int value, int remove)
|
||||
/* token remove ... what ... */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* "whatever" 0,XINSERT insert in hash table if not in and return NULL */
|
||||
/* if already present just return entry address */
|
||||
/* return NULL otherwise */
|
||||
/* */
|
||||
/* "whatever" 1,XDELETE delete entry if found return NULL */
|
||||
/* "whatever" 2,XLOOKUP only look up element, dont insert */
|
||||
struct hilight_hashentry *hilight_lookup(const char *token, int value, int what)
|
||||
/* token what ... what ...
|
||||
* --------------------------------------------------------------------------
|
||||
* "whatever" XINSERT insert in hash table if not in and return NULL. If already present update
|
||||
* value if not NULL, retun new value, return NULL otherwise
|
||||
* "whatever" XINSERT_NOREPLACE same as XINSERT but do not replace existing value, return NULL if not found.
|
||||
* "whatever" XDELETE delete entry if found, return NULL
|
||||
* "whatever" XLOOKUP only look up element, dont insert, return NULL if not found.
|
||||
*/
|
||||
{
|
||||
unsigned int hashcode, index;
|
||||
struct hilight_hashentry *entry, *saveptr, **preventry;
|
||||
char *ptr;
|
||||
int s ;
|
||||
int depth=0;
|
||||
|
||||
if(token==NULL) return NULL;
|
||||
hashcode=hi_hash(token);
|
||||
index=hashcode % HASHSIZE;
|
||||
entry=xctx->hilight_table[index];
|
||||
preventry=&xctx->hilight_table[index];
|
||||
depth=0;
|
||||
while(1)
|
||||
{
|
||||
if( !entry ) /* empty slot */
|
||||
{
|
||||
if( remove==XINSERT ) /* insert data */
|
||||
{
|
||||
s=sizeof( struct hilight_hashentry );
|
||||
ptr= my_malloc(137, s );
|
||||
entry=(struct hilight_hashentry *)ptr;
|
||||
entry->next = NULL;
|
||||
entry->token = NULL;
|
||||
my_strdup(138, &(entry->token),token);
|
||||
entry->path = NULL;
|
||||
my_strdup(139, &(entry->path),xctx->sch_path[xctx->currsch]);
|
||||
entry->value=value;
|
||||
entry->hash=hashcode;
|
||||
*preventry=entry;
|
||||
xctx->hilight_nets=1; /* some nets should be hilighted .... 07122002 */
|
||||
}
|
||||
return NULL; /* whether inserted or not return NULL since it was not in */
|
||||
unsigned int hashcode, index;
|
||||
struct hilight_hashentry *entry, *saveptr, **preventry;
|
||||
char *ptr;
|
||||
int s ;
|
||||
int depth=0;
|
||||
|
||||
if(token==NULL) return NULL;
|
||||
hashcode=hi_hash(token);
|
||||
index=hashcode % HASHSIZE;
|
||||
entry=xctx->hilight_table[index];
|
||||
preventry=&xctx->hilight_table[index];
|
||||
depth=0;
|
||||
while(1) {
|
||||
if( !entry ) { /* empty slot */
|
||||
if( what==XINSERT || what == XINSERT_NOREPLACE) { /* insert data */
|
||||
s=sizeof( struct hilight_hashentry );
|
||||
ptr= my_malloc(137, s );
|
||||
entry=(struct hilight_hashentry *)ptr;
|
||||
entry->next = NULL;
|
||||
entry->token = NULL;
|
||||
my_strdup(138, &(entry->token),token);
|
||||
entry->path = NULL;
|
||||
my_strdup(139, &(entry->path),xctx->sch_path[xctx->currsch]);
|
||||
entry->value=value;
|
||||
entry->hash=hashcode;
|
||||
*preventry=entry;
|
||||
xctx->hilight_nets=1; /* some nets should be hilighted .... 07122002 */
|
||||
}
|
||||
return NULL; /* whether inserted or not return NULL since it was not in */
|
||||
}
|
||||
if( entry -> hash==hashcode && !strcmp(token,entry->token) &&
|
||||
!strcmp(xctx->sch_path[xctx->currsch], entry->path) ) { /* found matching tok */
|
||||
if(what==XDELETE) { /* remove token from the hash table ... */
|
||||
saveptr=entry->next;
|
||||
my_free(762, &entry->token);
|
||||
my_free(763, &entry->path);
|
||||
my_free(764, &entry);
|
||||
*preventry=saveptr;
|
||||
} else if(what == XINSERT ) {
|
||||
entry->value = value;
|
||||
}
|
||||
return entry; /* found matching entry, return the address */
|
||||
}
|
||||
preventry=&entry->next; /* descend into the list. */
|
||||
entry = entry->next;
|
||||
depth++;
|
||||
}
|
||||
if( entry -> hash==hashcode && !strcmp(token,entry->token) &&
|
||||
!strcmp(xctx->sch_path[xctx->currsch], entry->path) ) /* found matching tok */
|
||||
{
|
||||
if(remove==XDELETE) /* remove token from the hash table ... */
|
||||
{
|
||||
saveptr=entry->next;
|
||||
my_free(762, &entry->token);
|
||||
my_free(763, &entry->path);
|
||||
my_free(764, &entry);
|
||||
*preventry=saveptr;
|
||||
return NULL;
|
||||
}
|
||||
else /* found matching entry, return the address */
|
||||
{
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
preventry=&entry->next; /* descend into the list. */
|
||||
entry = entry->next;
|
||||
depth++;
|
||||
if(debug_var>=2)
|
||||
if(depth>200)
|
||||
fprintf(errfp, "hilight_lookup(): deep into the list: %d, index=%d, token=%s, hashcode=%d\n",
|
||||
depth, index, token, hashcode);
|
||||
}
|
||||
}
|
||||
|
||||
/* warning, in case of buses return only pointer to first bus element */
|
||||
struct hilight_hashentry *bus_hilight_lookup(const char *token, int value, int remove)
|
||||
struct hilight_hashentry *bus_hilight_lookup(const char *token, int value, int what)
|
||||
{
|
||||
char *start, *string_ptr, c;
|
||||
char *string=NULL;
|
||||
struct hilight_hashentry *ptr1=NULL, *ptr2=NULL;
|
||||
int mult;
|
||||
|
||||
if(token==NULL) return NULL;
|
||||
if( token[0] == '#') {
|
||||
my_strdup(140, &string, token);
|
||||
}
|
||||
else {
|
||||
my_strdup(141, &string, expandlabel(token,&mult));
|
||||
}
|
||||
|
||||
if(string==NULL) {
|
||||
return NULL;
|
||||
}
|
||||
string_ptr = start = string;
|
||||
while(1) {
|
||||
c=(*string_ptr);
|
||||
if(c==','|| c=='\0')
|
||||
{
|
||||
*string_ptr='\0'; /* set end string at comma position.... */
|
||||
/* insert one bus element at a time in hash table */
|
||||
dbg(2, "bus_hilight_lookup(): inserting: %s, value:%d\n", start,value);
|
||||
ptr1=hilight_lookup(start, value, remove);
|
||||
if(ptr1 && !ptr2) {
|
||||
ptr2=ptr1; /*return first non null entry */
|
||||
if(remove==2) break; /* 20161221 no need to go any further if only looking up element */
|
||||
}
|
||||
*string_ptr=c; /* ....restore original char */
|
||||
start=string_ptr+1;
|
||||
char *start, *string_ptr, c;
|
||||
char *string=NULL;
|
||||
struct hilight_hashentry *ptr1=NULL, *ptr2=NULL;
|
||||
int mult;
|
||||
|
||||
if(token==NULL) return NULL;
|
||||
if( token[0] == '#') {
|
||||
my_strdup(140, &string, token);
|
||||
}
|
||||
if(c==0) break;
|
||||
string_ptr++;
|
||||
}
|
||||
/* if something found return first pointer */
|
||||
my_free(765, &string);
|
||||
return ptr2;
|
||||
else {
|
||||
my_strdup(141, &string, expandlabel(token,&mult));
|
||||
}
|
||||
if(string==NULL) {
|
||||
return NULL;
|
||||
}
|
||||
string_ptr = start = string;
|
||||
while(1) {
|
||||
c=(*string_ptr);
|
||||
if(c==','|| c=='\0') {
|
||||
*string_ptr='\0'; /* set end string at comma position.... */
|
||||
/* insert one bus element at a time in hash table */
|
||||
dbg(2, "bus_hilight_lookup(): inserting: %s, value:%d\n", start,value);
|
||||
ptr1=hilight_lookup(start, value, what);
|
||||
if(ptr1 && !ptr2) {
|
||||
ptr2=ptr1; /*return first non null entry */
|
||||
if(what==XLOOKUP) break; /* 20161221 no need to go any further if only looking up element */
|
||||
}
|
||||
*string_ptr=c; /* ....restore original char */
|
||||
start=string_ptr+1;
|
||||
}
|
||||
if(c==0) break;
|
||||
string_ptr++;
|
||||
}
|
||||
/* if something found return first pointer */
|
||||
my_free(765, &string);
|
||||
return ptr2;
|
||||
}
|
||||
|
||||
void delete_hilight_net(void)
|
||||
void clear_all_hilights(void)
|
||||
{
|
||||
int i;
|
||||
if(!xctx->hilight_nets) return;
|
||||
|
|
@ -300,9 +287,9 @@ void delete_hilight_net(void)
|
|||
|
||||
xctx->hilight_nets=0;
|
||||
for(i=0;i<xctx->instances;i++) {
|
||||
xctx->inst[i].color = 0 ;
|
||||
xctx->inst[i].color = -1 ;
|
||||
}
|
||||
dbg(1, "delete_hilight_net(): clearing\n");
|
||||
dbg(1, "clear_all_hilights(): clearing\n");
|
||||
xctx->hilight_color=0;
|
||||
}
|
||||
|
||||
|
|
@ -336,7 +323,7 @@ void hilight_net_pin_mismatches(void)
|
|||
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, "hilight_net_pin_mismatches(): hilight: %s\n", netname);
|
||||
bus_hilight_lookup(netname, xctx->hilight_color, XINSERT);
|
||||
bus_hilight_lookup(netname, xctx->hilight_color, XINSERT_NOREPLACE);
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
}
|
||||
}
|
||||
|
|
@ -346,6 +333,7 @@ void hilight_net_pin_mismatches(void)
|
|||
my_free(714, &labname);
|
||||
my_free(715, &lab);
|
||||
my_free(716, &netname);
|
||||
propagate_hilights(1, 0);
|
||||
redraw_hilights();
|
||||
}
|
||||
|
||||
|
|
@ -432,7 +420,7 @@ void hilight_child_pins(void)
|
|||
((inst_number - 1) * mult + k - 1) % net_mult + 1), 0, XLOOKUP);
|
||||
xctx->currsch++;
|
||||
if(entry) {
|
||||
bus_hilight_lookup(find_nth(pin_node, ',', k), entry->value, XINSERT);
|
||||
bus_hilight_lookup(find_nth(pin_node, ',', k), entry->value, XINSERT_NOREPLACE);
|
||||
dbg(1, "hilight_child_pins(): inserting: %s\n", find_nth(pin_node, ',', k));
|
||||
}
|
||||
else {
|
||||
|
|
@ -458,7 +446,7 @@ int bus_search(const char*s)
|
|||
|
||||
int search(const char *tok, const char *val, int sub, int sel, int what)
|
||||
{
|
||||
int save_draw, hilight_layer = 7;
|
||||
int save_draw;
|
||||
int i,c, col = 7,tmp,bus=0;
|
||||
const char *str;
|
||||
char *type;
|
||||
|
|
@ -484,7 +472,6 @@ int search(const char *tok, const char *val, int sub, int sel, int what)
|
|||
|
||||
if(!sel) {
|
||||
col=xctx->hilight_color;
|
||||
hilight_layer = get_color(col);
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
}
|
||||
has_token = 0;
|
||||
|
|
@ -526,11 +513,11 @@ int search(const char *tok, const char *val, int sub, int sel, int what)
|
|||
if(!sel) {
|
||||
type = (xctx->inst[i].ptr+ xctx->sym)->type;
|
||||
if( type && IS_LABEL_SH_OR_PIN(type) ) {
|
||||
bus_hilight_lookup(xctx->inst[i].node[0], col, XINSERT); /* sets xctx->hilight_nets = 1; */
|
||||
bus_hilight_lookup(xctx->inst[i].node[0], col, XINSERT_NOREPLACE); /* sets xctx->hilight_nets = 1; */
|
||||
} else {
|
||||
dbg(1, "search(): setting hilight flag on inst %d\n",i);
|
||||
xctx->hilight_nets=1;
|
||||
xctx->inst[i].color = hilight_layer;
|
||||
xctx->inst[i].color = col;
|
||||
}
|
||||
}
|
||||
if(sel==1) {
|
||||
|
|
@ -557,7 +544,7 @@ int search(const char *tok, const char *val, int sub, int sel, int what)
|
|||
#endif
|
||||
{
|
||||
if(!sel) {
|
||||
bus_hilight_lookup(xctx->wire[i].node, col, XINSERT); /* sets xctx->hilight_nets = 1 */
|
||||
bus_hilight_lookup(xctx->wire[i].node, col, XINSERT_NOREPLACE); /* sets xctx->hilight_nets = 1 */
|
||||
}
|
||||
if(sel==1) {
|
||||
xctx->wire[i].sel = SELECTED;
|
||||
|
|
@ -575,7 +562,7 @@ int search(const char *tok, const char *val, int sub, int sel, int what)
|
|||
}
|
||||
}
|
||||
}
|
||||
if(!sel) propagate_hilights(1);
|
||||
if(!sel) propagate_hilights(1, 0);
|
||||
if(sel) for(c = 0; c < cadlayers; c++) for(i=0;i<xctx->lines[c];i++) {
|
||||
str = get_tok_value(xctx->line[c][i].prop_ptr, tok,0);
|
||||
if(get_tok_size) {
|
||||
|
|
@ -657,9 +644,6 @@ int search(const char *tok, const char *val, int sub, int sel, int what)
|
|||
if(found) return 1; else return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* "drill" option (pass through resistors or pass gates or whatever elements with */
|
||||
/* 'propagate_to' properties set on pins) */
|
||||
void drill_hilight(void)
|
||||
|
|
@ -673,13 +657,10 @@ void drill_hilight(void)
|
|||
const char *propagate_str;
|
||||
int propagate;
|
||||
struct hilight_hashentry *entry, *propag_entry;
|
||||
int count;
|
||||
|
||||
prepare_netlist_structs(0);
|
||||
count=0;
|
||||
while(1) {
|
||||
found=0;
|
||||
count++;
|
||||
for(i=0; i<xctx->instances;i++) {
|
||||
symbol = xctx->inst[i].ptr+xctx->sym;
|
||||
npin = symbol->rects[PINLAYER];
|
||||
|
|
@ -692,11 +673,8 @@ void drill_hilight(void)
|
|||
/* get net to propagate hilight to...*/
|
||||
my_strdup(144, &propagated_net, net_name(i, propagate, &mult, 1, 1));
|
||||
/* add net to highlight list */
|
||||
propag_entry = bus_hilight_lookup(propagated_net, entry->value, XINSERT);
|
||||
if(!propag_entry) {
|
||||
found=1; /* keep looping until no more nets are found. */
|
||||
}
|
||||
|
||||
propag_entry = bus_hilight_lookup(propagated_net, entry->value, XINSERT_NOREPLACE);
|
||||
if(!propag_entry) found=1; /* keep looping until no more nets are found. */
|
||||
}
|
||||
} /* for(j...) */
|
||||
} /* for(i...) */
|
||||
|
|
@ -708,18 +686,17 @@ void drill_hilight(void)
|
|||
|
||||
int hilight_netname(const char *name)
|
||||
{
|
||||
int ret = 0;
|
||||
struct node_hashentry *node_entry;
|
||||
prepare_netlist_structs(0);
|
||||
dbg(1, "hilight_netname(): entering\n");
|
||||
rebuild_selected_array();
|
||||
node_entry = bus_hash_lookup(name, "", XLOOKUP, 0, "", "", "", "");
|
||||
ret = node_entry ? 1 : 0;
|
||||
if(ret && !bus_hilight_lookup(name, xctx->hilight_color, XINSERT)) { /* sets xctx->hilight_nets=1 */
|
||||
if(node_entry && !bus_hilight_lookup(name, xctx->hilight_color, XINSERT_NOREPLACE)) { /* sets xctx->hilight_nets=1 */
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
propagate_hilights(1, 0);
|
||||
redraw_hilights();
|
||||
}
|
||||
return ret;
|
||||
return node_entry ? 1 : 0;
|
||||
}
|
||||
|
||||
static void send_net_to_gaw(int simtype, const char *node)
|
||||
|
|
@ -771,7 +748,6 @@ static void send_current_to_gaw(int simtype, const char *node)
|
|||
|
||||
if(!node || !node[0]) return;
|
||||
tok = node;
|
||||
/* c = get_color(xctx->hilight_color); */
|
||||
c = PINLAYER;
|
||||
sprintf(color_str, "%02x%02x%02x", xcolor_array[c].red>>8, xcolor_array[c].green>>8, xcolor_array[c].blue>>8);
|
||||
expanded_tok = expandlabel(tok, &tok_mult);
|
||||
|
|
@ -792,15 +768,13 @@ static void send_current_to_gaw(int simtype, const char *node)
|
|||
Tcl_VarEval(interp, "puts $gaw_fd {copyvar ", xctx->currsch>0 ? "V:" : "",
|
||||
strtoupper(p), strtoupper( xctx->currsch>0 ? t+1 : t ), "#branch",
|
||||
" p0 #", color_str, "}\nvwait gaw_fd\n", NULL);
|
||||
|
||||
}
|
||||
}
|
||||
my_free(1181, &p);
|
||||
my_free(1182, &t);
|
||||
|
||||
}
|
||||
|
||||
void propagate_hilights(int set)
|
||||
void propagate_hilights(int set, int clear)
|
||||
{
|
||||
int i, hilight_connected_inst;
|
||||
struct hilight_hashentry *entry;
|
||||
|
|
@ -815,36 +789,181 @@ void propagate_hilights(int set)
|
|||
type = (xctx->inst[i].ptr+ xctx->sym)->type;
|
||||
hilight_connected_inst = (xctx->inst[i].flags & 4) || ((xctx->inst[i].ptr+ xctx->sym)->flags & 4);
|
||||
if(hilight_connected_inst && type && !IS_LABEL_SH_OR_PIN(type)) {
|
||||
int rects, j, clear;
|
||||
int rects, j, nohilight_pins;
|
||||
if( (rects = (xctx->inst[i].ptr+ xctx->sym)->rects[PINLAYER]) > 0 ) {
|
||||
clear = 1;
|
||||
nohilight_pins = 1;
|
||||
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) {
|
||||
if(set) {
|
||||
xctx->inst[i].color=get_color(entry->value);
|
||||
xctx->inst[i].color=entry->value;
|
||||
} else {
|
||||
clear = 0;
|
||||
nohilight_pins = 0; /* at least one connected net is hilighted: keep instance hilighted */
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(clear && !set) {
|
||||
xctx->inst[i].color=0;
|
||||
if(nohilight_pins && clear) {
|
||||
xctx->inst[i].color=-1;
|
||||
}
|
||||
}
|
||||
} else if( type && IS_LABEL_SH_OR_PIN(type) ) {
|
||||
entry=bus_hilight_lookup( xctx->inst[i].lab, 0, XLOOKUP);
|
||||
if(entry && set) xctx->inst[i].color = get_color(entry->value);
|
||||
else if(!entry && !set) xctx->inst[i].color = 0;
|
||||
if(entry && set) xctx->inst[i].color = entry->value;
|
||||
else if(!entry && clear) xctx->inst[i].color = -1;
|
||||
}
|
||||
}
|
||||
xctx->hilight_nets = there_are_hilights();
|
||||
if(xctx->hilight_nets && enable_drill) drill_hilight();
|
||||
if(xctx->hilight_nets && enable_drill && set) drill_hilight();
|
||||
}
|
||||
|
||||
#define LOGIC_X -1
|
||||
#define STACKMAX 100
|
||||
int get_logic_value(int n)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eval_logic_expr(char *expr)
|
||||
{
|
||||
int stack[STACKMAX];
|
||||
int i, sp = 0;
|
||||
char *saveptr = NULL;
|
||||
char *ptr1;
|
||||
char *ptr2;
|
||||
char *arg;
|
||||
int res = 0;
|
||||
|
||||
my_strdup(1218, &saveptr, expr);
|
||||
ptr2 = saveptr;
|
||||
while( (arg = my_strtok_r(ptr2, " ", &ptr1)) ) {
|
||||
ptr2 = NULL;
|
||||
if(arg[0] == '~') {
|
||||
if(sp > 0) {
|
||||
sp--;
|
||||
if(stack[sp] != LOGIC_X) stack[sp] = !stack[sp];
|
||||
++sp;
|
||||
}
|
||||
} else if(arg[0] == '|') {
|
||||
if(sp > 1) {
|
||||
res = 0;
|
||||
for(i = sp - 2; i < sp; i++) {
|
||||
if(stack[i] == 1) {
|
||||
res = 1;
|
||||
break;
|
||||
}
|
||||
else if(stack[i] == LOGIC_X) {
|
||||
res = LOGIC_X;
|
||||
}
|
||||
}
|
||||
stack[sp - 2] = res;
|
||||
sp--;
|
||||
}
|
||||
} else if(arg[0] == '&') {
|
||||
if(sp > 1) {
|
||||
res = 1;
|
||||
for(i = sp - 2; i < sp; i++) {
|
||||
if(stack[i] == 0) {
|
||||
res = 0;
|
||||
break;
|
||||
}
|
||||
else if(stack[i] == LOGIC_X) {
|
||||
res = LOGIC_X;
|
||||
}
|
||||
}
|
||||
stack[sp - 2] = res;
|
||||
sp--;
|
||||
}
|
||||
} else if(arg[0] == '^') {
|
||||
if(sp > 1) {
|
||||
res = 0;
|
||||
for(i = sp - 2; i < sp; i++) {
|
||||
if(stack[i] != LOGIC_X) {
|
||||
res = res ^ stack[i];
|
||||
}
|
||||
else {
|
||||
res = LOGIC_X;
|
||||
break;
|
||||
}
|
||||
}
|
||||
stack[sp - 2] = res;
|
||||
sp--;
|
||||
}
|
||||
} else if(isdigit(arg[0])) {
|
||||
if(sp < STACKMAX) stack[sp++] = get_logic_value(atoi(arg));
|
||||
}
|
||||
}
|
||||
free(saveptr);
|
||||
return stack[0];
|
||||
}
|
||||
|
||||
|
||||
void toggle_net_logic_value()
|
||||
{
|
||||
int i, n, value, newvalue;
|
||||
char *type;
|
||||
struct hilight_hashentry *entry;
|
||||
xRect boundbox;
|
||||
int big = xctx->wires> 2000 || xctx->instances > 2000 ;
|
||||
|
||||
prepare_netlist_structs(0);
|
||||
rebuild_selected_array();
|
||||
if(!big) {
|
||||
calc_drawing_bbox(&boundbox, 2);
|
||||
bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
bbox(ADD, boundbox.x1, boundbox.y1, boundbox.x2, boundbox.y2);
|
||||
}
|
||||
for(i=0;i<xctx->lastsel;i++)
|
||||
{
|
||||
n = xctx->sel_array[i].n;
|
||||
switch(xctx->sel_array[i].type)
|
||||
{
|
||||
case WIRE:
|
||||
entry = bus_hilight_lookup(xctx->wire[n].node, 0, XLOOKUP);
|
||||
if(!entry) value = LOGIC_X;
|
||||
else if(!entry->value) value = 0;
|
||||
else value = 1;
|
||||
newvalue = (value + 2) % 3 - 1; /* next logic value LOGIC_X (-1), 0, 1 */
|
||||
here(value);
|
||||
here(newvalue);
|
||||
if(newvalue == LOGIC_X) {
|
||||
bus_hilight_lookup(xctx->wire[n].node, value, XDELETE);
|
||||
} else { /* sets xctx->hilight_nets=1 */
|
||||
bus_hilight_lookup(xctx->wire[n].node, newvalue, XINSERT);
|
||||
}
|
||||
break;
|
||||
case ELEMENT:
|
||||
type = (xctx->inst[n].ptr+ xctx->sym)->type;
|
||||
if( type && xctx->inst[n].node && IS_LABEL_SH_OR_PIN(type) ) { /* instance must have a pin! */
|
||||
entry = bus_hilight_lookup(xctx->inst[n].node[0], 0, XLOOKUP);
|
||||
if(!entry) value = LOGIC_X;
|
||||
else if(!entry->value) value = 0;
|
||||
else value = 1;
|
||||
newvalue = (value + 2) % 3 - 1; /* next logic value LOGIC_X (-1), 0, 1 */
|
||||
if(newvalue == LOGIC_X) bus_hilight_lookup(xctx->inst[n].node[0], value, XDELETE);
|
||||
/* sets xctx->hilight_nets=1 */
|
||||
else bus_hilight_lookup(xctx->inst[n].node[0], newvalue, XINSERT);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
propagate_hilights(1, 1);
|
||||
if(!big) {
|
||||
calc_drawing_bbox(&boundbox, 2);
|
||||
bbox(ADD, boundbox.x1, boundbox.y1, boundbox.x2, boundbox.y2);
|
||||
bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
}
|
||||
draw();
|
||||
if(!big) bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
tcleval("if { [info exists gaw_fd] } {close $gaw_fd; unset gaw_fd}\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void hilight_net(int to_waveform)
|
||||
{
|
||||
int i, n;
|
||||
|
|
@ -856,14 +975,12 @@ void hilight_net(int to_waveform)
|
|||
rebuild_selected_array();
|
||||
tcleval("sim_is_xyce");
|
||||
sim_is_xyce = atoi( tclresult() );
|
||||
for(i=0;i<xctx->lastsel;i++)
|
||||
{
|
||||
for(i=0;i<xctx->lastsel;i++) {
|
||||
n = xctx->sel_array[i].n;
|
||||
switch(xctx->sel_array[i].type)
|
||||
{
|
||||
switch(xctx->sel_array[i].type) {
|
||||
case WIRE:
|
||||
/* sets xctx->hilight_nets=1 */
|
||||
if(!bus_hilight_lookup(xctx->wire[n].node, xctx->hilight_color, XINSERT)) {
|
||||
if(!bus_hilight_lookup(xctx->wire[n].node, xctx->hilight_color, XINSERT_NOREPLACE)) {
|
||||
if(to_waveform == GAW) send_net_to_gaw(sim_is_xyce, xctx->wire[n].node);
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
}
|
||||
|
|
@ -872,14 +989,14 @@ void hilight_net(int to_waveform)
|
|||
type = (xctx->inst[n].ptr+ xctx->sym)->type;
|
||||
if( type && xctx->inst[n].node && IS_LABEL_SH_OR_PIN(type) ) { /* instance must have a pin! */
|
||||
/* sets xctx->hilight_nets=1 */
|
||||
if(!bus_hilight_lookup(xctx->inst[n].node[0], xctx->hilight_color, XINSERT)) {
|
||||
if(!bus_hilight_lookup(xctx->inst[n].node[0], xctx->hilight_color, XINSERT_NOREPLACE)) {
|
||||
if(to_waveform == GAW) send_net_to_gaw(sim_is_xyce, xctx->inst[n].node[0]);
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
}
|
||||
} else {
|
||||
dbg(1, "hilight_net(): setting hilight flag on inst %d\n",n);
|
||||
xctx->hilight_nets=1;
|
||||
xctx->inst[n].color = get_color(xctx->hilight_color);
|
||||
xctx->inst[n].color = xctx->hilight_color;
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
}
|
||||
if(type && (!strcmp(type, "current_probe") || !strcmp(type, "vsource")) ) {
|
||||
|
|
@ -891,11 +1008,7 @@ void hilight_net(int to_waveform)
|
|||
}
|
||||
}
|
||||
if(!incr_hilight) xctx->hilight_color++;
|
||||
if(enable_drill) {
|
||||
drill_hilight();
|
||||
/*traverse_schematic(); */
|
||||
}
|
||||
propagate_hilights(1);
|
||||
propagate_hilights(1, 0);
|
||||
tcleval("if { [info exists gaw_fd] } {close $gaw_fd; unset gaw_fd}\n");
|
||||
}
|
||||
|
||||
|
|
@ -903,34 +1016,39 @@ void unhilight_net(void)
|
|||
{
|
||||
int i,n;
|
||||
char *type;
|
||||
xRect boundbox;
|
||||
int big = xctx->wires> 2000 || xctx->instances > 2000 ;
|
||||
|
||||
prepare_netlist_structs(0);
|
||||
dbg(1, "unhilight_net(): entering\n");
|
||||
rebuild_selected_array();
|
||||
|
||||
|
||||
for(i=0;i<xctx->lastsel;i++)
|
||||
{
|
||||
prepare_netlist_structs(0);
|
||||
if(!big) calc_drawing_bbox(&boundbox, 2);
|
||||
dbg(1, "unhilight_net(): entering\n");
|
||||
for(i=0;i<xctx->lastsel;i++) {
|
||||
n = xctx->sel_array[i].n;
|
||||
switch(xctx->sel_array[i].type)
|
||||
{
|
||||
switch(xctx->sel_array[i].type) {
|
||||
case WIRE:
|
||||
bus_hilight_lookup(xctx->wire[n].node, xctx->hilight_color, XDELETE);
|
||||
break;
|
||||
case ELEMENT:
|
||||
type = (xctx->inst[n].ptr+ xctx->sym)->type;
|
||||
if( type &&
|
||||
xctx->inst[n].node && IS_LABEL_SH_OR_PIN(type) ) { /* instance must have a pin! */
|
||||
if( type && xctx->inst[n].node && IS_LABEL_SH_OR_PIN(type) ) { /* instance must have a pin! */
|
||||
bus_hilight_lookup(xctx->inst[n].node[0], xctx->hilight_color, XDELETE);
|
||||
} else {
|
||||
}
|
||||
xctx->inst[n].color = 0;
|
||||
xctx->inst[n].color = -1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
propagate_hilights(0);
|
||||
if(!big) {
|
||||
bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
bbox(ADD, boundbox.x1, boundbox.y1, boundbox.x2, boundbox.y2);
|
||||
bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
}
|
||||
propagate_hilights(0, 1);
|
||||
draw();
|
||||
if(!big) bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
|
||||
unselect_all();
|
||||
}
|
||||
|
||||
|
|
@ -970,7 +1088,7 @@ void select_hilight_net(void)
|
|||
|
||||
type = (xctx->inst[i].ptr+ xctx->sym)->type;
|
||||
hilight_connected_inst = (xctx->inst[i].flags & 4) || ((xctx->inst[i].ptr+ xctx->sym)->flags & 4);
|
||||
if( xctx->inst[i].color) {
|
||||
if( xctx->inst[i].color != -1) {
|
||||
dbg(1, "select_hilight_net(): instance %d flags &4 true\n", i);
|
||||
xctx->inst[i].sel = SELECTED;
|
||||
xctx->ui_state|=SELECTION;
|
||||
|
|
@ -1068,8 +1186,9 @@ void draw_hilight_net(int on_window)
|
|||
i++;
|
||||
if(i >= xctx->instances) break;
|
||||
}
|
||||
if(xctx->inst[i].color )
|
||||
if(xctx->inst[i].color != -1)
|
||||
{
|
||||
int col = get_color(xctx->inst[i].color);
|
||||
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] ||
|
||||
|
|
@ -1077,12 +1196,12 @@ void draw_hilight_net(int on_window)
|
|||
symptr->arcs[c] ||
|
||||
symptr->polygons[c] ||
|
||||
((c==TEXTWIRELAYER || c==TEXTLAYER) && symptr->texts)) {
|
||||
draw_symbol(ADD, xctx->inst[i].color, i,c,0,0,0.0,0.0);
|
||||
draw_symbol(ADD, col, i,c,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);
|
||||
filledrect(col, END, 0.0, 0.0, 0.0, 0.0);
|
||||
drawarc(col, END, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0);
|
||||
drawrect(col, END, 0.0, 0.0, 0.0, 0.0, 0);
|
||||
drawline(col, END, 0.0, 0.0, 0.0, 0.0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -902,7 +902,7 @@ void copy_objects(int what)
|
|||
my_strdup(312, &xctx->inst[xctx->instances].lab, xctx->inst[n].lab);
|
||||
xctx->inst[n].sel=0;
|
||||
xctx->inst[xctx->instances].flags = xctx->inst[n].flags;
|
||||
xctx->inst[xctx->instances].color = 0;
|
||||
xctx->inst[xctx->instances].color = -1;
|
||||
xctx->inst[xctx->instances].x0 = xctx->rx1+xctx->deltax;
|
||||
xctx->inst[xctx->instances].y0 = xctx->ry1+xctx->deltay;
|
||||
xctx->inst[xctx->instances].sel = SELECTED;
|
||||
|
|
|
|||
|
|
@ -303,8 +303,9 @@ void hash_wire(int what, int n, int incremental)
|
|||
struct wireentry *wptr;
|
||||
xWire * const wire = xctx->wire;
|
||||
|
||||
/* wire[n].node=NULL; */
|
||||
my_free(827, &wire[n].node);
|
||||
|
||||
/* >>>>> THIS IS NOT NEEDED !! delete_netlist_structs() does this... Why this HERE ?? <<<<< */
|
||||
/* my_free(827, &wire[n].node); */
|
||||
|
||||
wire[n].end1 = wire[n].end2=-1;
|
||||
x1=wire[n].x1;
|
||||
|
|
@ -1040,7 +1041,7 @@ void prepare_netlist_structs(int for_netlist)
|
|||
my_free(841, &global_node);
|
||||
dbg(2, "prepare_netlist_structs(): returning\n");
|
||||
|
||||
propagate_hilights(1);
|
||||
propagate_hilights(1, 0);
|
||||
}
|
||||
|
||||
int sym_vs_sch_pins()
|
||||
|
|
|
|||
|
|
@ -314,35 +314,35 @@ void traverse_node_hash()
|
|||
if(entry->d.out + entry->d.inout + entry->d.in == 1)
|
||||
{
|
||||
my_snprintf(str, S(str), "open net: %s", entry->token);
|
||||
if(!netlist_count) bus_hilight_lookup(entry->token, xctx->hilight_color, XINSERT);
|
||||
if(!netlist_count) bus_hilight_lookup(entry->token, xctx->hilight_color, XINSERT_NOREPLACE);
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
statusmsg(str,2);
|
||||
}
|
||||
else if(entry->d.out ==0 && entry->d.inout == 0)
|
||||
{
|
||||
my_snprintf(str, S(str), "undriven node: %s", entry->token);
|
||||
if(!netlist_count) bus_hilight_lookup(entry->token, xctx->hilight_color, XINSERT);
|
||||
if(!netlist_count) bus_hilight_lookup(entry->token, xctx->hilight_color, XINSERT_NOREPLACE);
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
statusmsg(str,2);
|
||||
}
|
||||
else if(entry->d.out >=2 && entry->d.port>=0) /* era d.port>=2 03102001 */
|
||||
{
|
||||
my_snprintf(str, S(str), "shorted output node: %s", entry->token);
|
||||
if(!netlist_count) bus_hilight_lookup(entry->token, xctx->hilight_color, XINSERT);
|
||||
if(!netlist_count) bus_hilight_lookup(entry->token, xctx->hilight_color, XINSERT_NOREPLACE);
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
statusmsg(str,2);
|
||||
}
|
||||
else if(entry->d.in ==0 && entry->d.inout == 0)
|
||||
{
|
||||
my_snprintf(str, S(str), "node: %s goes nowhere", entry->token);
|
||||
if(!netlist_count) bus_hilight_lookup(entry->token, xctx->hilight_color, XINSERT);
|
||||
if(!netlist_count) bus_hilight_lookup(entry->token, xctx->hilight_color, XINSERT_NOREPLACE);
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
statusmsg(str,2);
|
||||
}
|
||||
else if(entry->d.out >=2 && entry->d.inout == 0 && entry->d.port>=0) /* era d.port>=2 03102001 */
|
||||
{
|
||||
my_snprintf(str, S(str), "shorted output node: %s", entry->token);
|
||||
if(!netlist_count) bus_hilight_lookup(entry->token, xctx->hilight_color, XINSERT);
|
||||
if(!netlist_count) bus_hilight_lookup(entry->token, xctx->hilight_color, XINSERT_NOREPLACE);
|
||||
if(incr_hilight) xctx->hilight_color++;
|
||||
statusmsg(str,2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ void merge_inst(int k,FILE *fd)
|
|||
}
|
||||
ptr[i].sel=0;
|
||||
ptr[i].flags=0;
|
||||
ptr[i].color=0;
|
||||
ptr[i].color=-1;
|
||||
ptr[i].ptr=-1;
|
||||
ptr[i].prop_ptr=NULL;
|
||||
ptr[i].instname=NULL;
|
||||
|
|
|
|||
|
|
@ -551,7 +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].color=-1;
|
||||
xctx->inst[i].flags=0;
|
||||
xctx->inst[i].sel=0;
|
||||
xctx->inst[i].ptr=-1; /*04112003 was 0 */
|
||||
|
|
|
|||
|
|
@ -1370,7 +1370,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
if(argc==3) {
|
||||
if(!has_x || !xctx->modified || !save(1) ) { /* save(1)==1 --> user cancel */
|
||||
dbg(1, "scheduler(): load: filename=%s\n", argv[2]);
|
||||
delete_hilight_net();
|
||||
clear_all_hilights();
|
||||
xctx->currsch = 0;
|
||||
unselect_all();
|
||||
remove_symbols();
|
||||
|
|
@ -1407,7 +1407,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
cmd_found = 1;
|
||||
if(argc==3) {
|
||||
dbg(1, "scheduler(): load: filename=%s\n", argv[2]);
|
||||
delete_hilight_net();
|
||||
clear_all_hilights();
|
||||
xctx->currsch = 0;
|
||||
unselect_all();
|
||||
remove_symbols();
|
||||
|
|
@ -1427,6 +1427,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
else if(argc==2 && opened==1) { fclose(errfp); errfp=stderr;opened=0; }
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
else if(!strcmp(argv[1],"logic_set"))
|
||||
{
|
||||
cmd_found = 1;
|
||||
enable_drill = 1;
|
||||
toggle_net_logic_value();
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if(argv[1][0] == 'm') {
|
||||
|
|
@ -1758,10 +1766,13 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
|
||||
else if(!strcmp(argv[1],"propagate_hilights"))
|
||||
{
|
||||
int set = 1;
|
||||
int set = 1, clear = 0;
|
||||
cmd_found = 1;
|
||||
if(argc>=3) set = atoi(argv[2]);
|
||||
propagate_hilights(set);
|
||||
if(argc>=4) {
|
||||
set = atoi(argv[2]);
|
||||
clear = atoi(argv[3]);
|
||||
}
|
||||
propagate_hilights(set, clear);
|
||||
}
|
||||
|
||||
else if(!strcmp(argv[1],"push_undo"))
|
||||
|
|
@ -2455,14 +2466,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
else if(!strcmp(argv[1],"unhilight"))
|
||||
else if(!strcmp(argv[1],"unhilight_all"))
|
||||
{
|
||||
xRect boundbox;
|
||||
int big = xctx->wires> 2000 || xctx->instances > 2000 ;
|
||||
cmd_found = 1;
|
||||
enable_drill=0;
|
||||
if(!big) calc_drawing_bbox(&boundbox, 2);
|
||||
delete_hilight_net();
|
||||
clear_all_hilights();
|
||||
/* undraw_hilight_net(1); */
|
||||
if(!big) {
|
||||
bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
|
|
@ -2472,13 +2483,13 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
draw();
|
||||
if(!big) bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
|
||||
/*
|
||||
enable_drill = 0;
|
||||
unhilight_net();
|
||||
draw();
|
||||
*/
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
else if(!strcmp(argv[1],"unhilight"))
|
||||
{
|
||||
cmd_found = 1;
|
||||
unhilight_net();
|
||||
}
|
||||
|
||||
else if(!strcmp(argv[1],"unselect_all"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ void global_spice_netlist(int global) /* netlister driver */
|
|||
}
|
||||
/* restore hilight flags from errors found analyzing top level before descending hierarchy */
|
||||
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
|
||||
propagate_hilights(1);
|
||||
propagate_hilights(1, 0);
|
||||
draw_hilight_net(1);
|
||||
my_free(945, &stored_flags);
|
||||
|
||||
|
|
@ -535,12 +535,12 @@ void free_hash(struct hashentry **table)
|
|||
/* token value what ... what ...
|
||||
* --------------------------------------------------------------------------
|
||||
* "whatever" "whatever" XINSERT insert in hash table if not in.
|
||||
* if already present update value if not NULL,
|
||||
* return entry address.
|
||||
* if already present update value if not NULL,
|
||||
* return new entry address.
|
||||
* "whatever" "whatever" XINSERT_NOREPLACE same as XINSERT but do not replace existing value
|
||||
* return NULL if not found.
|
||||
* return NULL if not found.
|
||||
* "whatever" "whatever" XLOOKUP lookup in hash table,return entry addr.
|
||||
* return NULL if not found
|
||||
* return NULL if not found
|
||||
* "whatever" "whatever" XDELETE delete entry if found,return NULL
|
||||
*/
|
||||
struct int_hashentry *int_hash_lookup(struct int_hashentry **table, const char *token, const int value, int what)
|
||||
|
|
|
|||
|
|
@ -722,7 +722,7 @@ void svg_draw(void)
|
|||
}
|
||||
for(i=0;i<xctx->instances;i++) {
|
||||
color = c;
|
||||
if(xctx->inst[i].color) color = xctx->inst[i].color;
|
||||
if(xctx->inst[i].color != -1) color = get_color(xctx->inst[i].color);
|
||||
svg_draw_symbol(color,i,c,0,0,0.0,0.0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ void global_tedax_netlist(int global) /* netlister driver */
|
|||
}
|
||||
/* restore hilight flags from errors found analyzing top level before descending hierarchy */
|
||||
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
|
||||
propagate_hilights(1);
|
||||
propagate_hilights(1, 0);
|
||||
draw_hilight_net(1);
|
||||
my_free(965, &stored_flags);
|
||||
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ void check_unique_names(int rename)
|
|||
xRect boundbox;
|
||||
if(!big) calc_drawing_bbox(&boundbox, 2);
|
||||
enable_drill=0;
|
||||
delete_hilight_net();
|
||||
clear_all_hilights();
|
||||
/* undraw_hilight_net(1); */
|
||||
if(!big) {
|
||||
bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
|
|
@ -229,7 +229,7 @@ void check_unique_names(int rename)
|
|||
comma_pos++;
|
||||
}
|
||||
} /* for(j...) */
|
||||
if( xctx->inst[i].color && rename) {
|
||||
if( (xctx->inst[i].color != -1) && rename) {
|
||||
my_strdup(511, &tmp, xctx->inst[i].prop_ptr);
|
||||
new_prop_string(i, tmp, newpropcnt++, !rename);
|
||||
my_strdup2(512, &xctx->inst[i].instname, get_tok_value(xctx->inst[i].prop_ptr, "name", 0));
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ void global_verilog_netlist(int global) /* netlister driver */
|
|||
}
|
||||
/* restore hilight flags from errors found analyzing top level before descending hierarchy */
|
||||
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
|
||||
propagate_hilights(1);
|
||||
propagate_hilights(1, 0);
|
||||
draw_hilight_net(1);
|
||||
my_free(1074, &stored_flags);
|
||||
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
|||
}
|
||||
/* restore hilight flags from errors found analyzing top level before descending hierarchy */
|
||||
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
|
||||
propagate_hilights(1);
|
||||
propagate_hilights(1, 0);
|
||||
draw_hilight_net(1);
|
||||
my_free(1088, &stored_flags);
|
||||
dbg(1, "global_vhdl_netlist(): starting awk on netlist!\n");
|
||||
|
|
|
|||
|
|
@ -541,7 +541,7 @@ void xwin_exit(void)
|
|||
return;
|
||||
}
|
||||
delete_netlist_structs();
|
||||
delete_hilight_net();
|
||||
clear_all_hilights();
|
||||
get_unnamed_node(0, 0, 0);
|
||||
if(has_x) {
|
||||
resetwin(0, 1, 1, 0, 0); /* create_pixmap, clear_pixmap, force */
|
||||
|
|
@ -739,7 +739,7 @@ void delete_schematic_data(void)
|
|||
dbg(1, "delete_schematic_data()\n");
|
||||
unselect_all();
|
||||
delete_netlist_structs(); /* netlist - specific data and hash tables */
|
||||
delete_hilight_net(); /* data structs for hilighting nets/instances */
|
||||
clear_all_hilights(); /* data structs for hilighting nets/instances */
|
||||
get_unnamed_node(0, 0, 0); /* net### enumerator used for netlisting */
|
||||
remove_symbols();
|
||||
clear_drawing(); /* delete instances, wires, lines, rects, ... */
|
||||
|
|
|
|||
|
|
@ -814,7 +814,7 @@ extern int samefile(const char *fa, const char *fb);
|
|||
extern void saveas(const char *f, int type);
|
||||
extern const char *get_file_path(char *f);
|
||||
extern int save(int confirm);
|
||||
extern struct hilight_hashentry *bus_hilight_lookup(const char *token, int value, int remove) ;
|
||||
extern struct hilight_hashentry *bus_hilight_lookup(const char *token, int value, int what) ;
|
||||
extern int name_strcmp(char *s, char *d) ;
|
||||
extern int search(const char *tok, const char *val, int sub, int sel, int what);
|
||||
extern int process_options(int argc, char **argv);
|
||||
|
|
@ -1104,9 +1104,10 @@ extern void print_verilog_signals(FILE *fd);
|
|||
extern void print_generic(FILE *fd, char *ent_or_comp, int symbol);
|
||||
extern void print_verilog_param(FILE *fd, int symbol);
|
||||
extern void hilight_net(int to_waveform);
|
||||
extern void toggle_net_logic_value();
|
||||
extern int hilight_netname(const char *name);
|
||||
extern void unhilight_net();
|
||||
extern void propagate_hilights(int set);
|
||||
extern void propagate_hilights(int set, int clear);
|
||||
extern void draw_hilight_net(int on_window);
|
||||
extern void display_hilights(char **str);
|
||||
extern void redraw_hilights(void);
|
||||
|
|
@ -1114,7 +1115,7 @@ extern void override_netlist_type(int type);
|
|||
extern void prepare_netlist_structs(int for_netlist);
|
||||
extern void delete_netlist_structs(void);
|
||||
extern void delete_inst_node(int i);
|
||||
extern void delete_hilight_net(void);
|
||||
extern void clear_all_hilights(void);
|
||||
extern void hilight_child_pins(void);
|
||||
extern void hilight_parent_pins(void);
|
||||
extern void hilight_net_pin_mismatches(void);
|
||||
|
|
|
|||
|
|
@ -3709,6 +3709,8 @@ if { ( $::OS== "Windows" || [string length [lindex [array get env DISPLAY] 1] ]
|
|||
setup_recent_menu
|
||||
.menubar.file.menu add cascade -label "Open Recent" -menu .menubar.file.menu.recent
|
||||
|
||||
.menubar.file.menu add command -label "Open Most Recent" \
|
||||
-command "eval {xschem load [lindex "$recentfile" 0]}" -accelerator {Ctrl+Shift+O}
|
||||
.menubar.file.menu add command -label "Save" -command "xschem save" -accelerator {Ctrl+S}
|
||||
toolbar_create FileSave "xschem save" "Save File"
|
||||
.menubar.file.menu add command -label "Merge" -command "xschem merge" -accelerator {Shift+B}
|
||||
|
|
@ -4052,7 +4054,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 unhilight" -accelerator Shift+K
|
||||
-command "xschem unhilight_all" -accelerator Shift+K
|
||||
.menubar.hilight.menu add command -label {Un-highlight selected net/pins} \
|
||||
-command "xschem unhilight" -accelerator Ctrl+K
|
||||
# 20160413
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ N 260 -470 340 -470 {lab=E9}
|
|||
N 340 -500 340 -470 {lab=E9}
|
||||
N 1110 -700 1110 -670 {lab=SA}
|
||||
N 840 -1020 840 -980 {lab=E4}
|
||||
N 1110 -590 1110 -570 {lab=xxx}
|
||||
N 1110 -590 1110 -570 {lab=OUTI}
|
||||
N 1110 -510 1110 -470 {lab=#net1}
|
||||
N 180 -1020 180 -980 {lab=E1}
|
||||
N 390 -790 520 -790 {lab=C2}
|
||||
|
|
@ -49,9 +49,9 @@ N 260 -180 260 -130 {lab=E3}
|
|||
N 150 -150 150 -70 {lab=VSS}
|
||||
N 50 -150 50 -70 {lab=VSS}
|
||||
N 50 -70 150 -70 {lab=VSS}
|
||||
N 690 -600 1110 -600 {lab=xxx}
|
||||
N 690 -600 1110 -600 {lab=OUTI}
|
||||
N 180 -470 260 -470 {lab=E9}
|
||||
N 1110 -610 1110 -600 {lab=xxx}
|
||||
N 1110 -610 1110 -600 {lab=OUTI}
|
||||
N 860 -380 1110 -380 {lab=SB}
|
||||
N 860 -700 1110 -700 {lab=SA}
|
||||
N 1240 -1120 1240 -960 {lab=VBOOST}
|
||||
|
|
@ -64,8 +64,8 @@ N 220 -630 340 -630 {lab=C9}
|
|||
N 180 -600 180 -560 {lab=C5}
|
||||
N 1110 -320 1110 -280 {lab=VNN}
|
||||
N 1330 -590 1390 -590 {lab=OUT}
|
||||
N 1110 -590 1240 -590 {lab=xxx}
|
||||
N 1110 -600 1110 -590 {lab=xxx}
|
||||
N 1110 -590 1240 -590 {lab=OUTI}
|
||||
N 1110 -600 1110 -590 {lab=OUTI}
|
||||
N 340 -860 340 -820 {lab=#net4}
|
||||
N 560 -860 560 -820 {lab=#net5}
|
||||
N 560 -1020 560 -920 {lab=E6}
|
||||
|
|
@ -73,16 +73,16 @@ N 340 -1020 340 -920 {lab=E2}
|
|||
N 260 -280 260 -240 {lab=C3}
|
||||
N 730 -440 770 -440 {lab=#net6}
|
||||
N 560 -440 670 -440 {lab=C8}
|
||||
N 690 -650 690 -600 {lab=xxx}
|
||||
N 690 -650 690 -600 {lab=OUTI}
|
||||
N 690 -730 690 -710 {lab=#net7}
|
||||
N 180 -840 180 -660 {lab=C7}
|
||||
N 840 -860 840 -840 {lab=E11}
|
||||
N 1240 -810 1240 -590 {lab=xxx}
|
||||
N 1240 -810 1240 -590 {lab=OUTI}
|
||||
N 860 -760 860 -750 {lab=GA}
|
||||
N 860 -710 860 -700 {lab=SA}
|
||||
N 860 -440 860 -430 {lab=GB}
|
||||
N 860 -390 860 -380 {lab=SB}
|
||||
N 1240 -590 1270 -590 {lab=xxx}
|
||||
N 1240 -590 1270 -590 {lab=OUTI}
|
||||
N 830 -440 860 -440 {lab=GB}
|
||||
N 840 -760 860 -760 {lab=GA}
|
||||
N 340 -1180 340 -1080 { lab=VPP}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
v {xschem version=2.9.5_RC8 file_version=1.1}
|
||||
v {xschem version=2.9.9 file_version=1.2 }
|
||||
G {}
|
||||
K {}
|
||||
V {}
|
||||
S {}
|
||||
E {}
|
||||
|
|
@ -37,7 +38,9 @@ C {capa.sym} 590 -160 0 0 {name=C0 m=1 value=100u device="electrolitic capacitor
|
|||
C {74ls00.sym} 420 -460 0 0 {name=U1:4 risedel=100 falldel=200
|
||||
url="http://www.engrcs.com/components/74LS00.pdf"
|
||||
power=VCC5
|
||||
___net:14=VCC5}
|
||||
|
||||
___net:14=VCC5
|
||||
___pinnumber(B)=111:222:333:444}
|
||||
C {7805.sym} 730 -190 0 0 {name=U0
|
||||
spiceprefix=X
|
||||
url="https://www.sparkfun.com/datasheets/Components/LM7805.pdf"}
|
||||
|
|
|
|||
Loading…
Reference in New Issue