allow Shift-T command (toggle spice_ignore attribute) to cycle through ignore-shorted-unset on selected elements
This commit is contained in:
parent
0e53359ee0
commit
724c264c9d
|
|
@ -1909,8 +1909,10 @@ void copy_symbol(xSymbol *dest_sym, xSymbol *src_sym)
|
||||||
|
|
||||||
void toggle_ignore(void)
|
void toggle_ignore(void)
|
||||||
{
|
{
|
||||||
int i, n, first = 1, remove = 0;
|
int i, n, first = 1;
|
||||||
char *attr;
|
char *attr;
|
||||||
|
int flag = 0; /* 1: spice_ignore=true, 2: spice_ignore=short */
|
||||||
|
const char *spice_ignore_str;
|
||||||
if(xctx->netlist_type == CAD_VERILOG_NETLIST) attr="verilog_ignore";
|
if(xctx->netlist_type == CAD_VERILOG_NETLIST) attr="verilog_ignore";
|
||||||
else if(xctx->netlist_type == CAD_VHDL_NETLIST) attr="vhdl_ignore";
|
else if(xctx->netlist_type == CAD_VHDL_NETLIST) attr="vhdl_ignore";
|
||||||
else if(xctx->netlist_type == CAD_TEDAX_NETLIST) attr="tedax_ignore";
|
else if(xctx->netlist_type == CAD_TEDAX_NETLIST) attr="tedax_ignore";
|
||||||
|
|
@ -1925,12 +1927,22 @@ void toggle_ignore(void)
|
||||||
xctx->push_undo();
|
xctx->push_undo();
|
||||||
first = 0;
|
first = 0;
|
||||||
}
|
}
|
||||||
remove = 0;
|
flag = 0;
|
||||||
if(!strboolcmp(get_tok_value(xctx->inst[i].prop_ptr, attr, 0), "true")) remove = 1;
|
spice_ignore_str = get_tok_value(xctx->inst[i].prop_ptr, attr, 0);
|
||||||
if(remove) {
|
if(!strcmp(spice_ignore_str, "short")) flag = 2;
|
||||||
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, subst_token(xctx->inst[i].prop_ptr, attr, NULL));
|
else if(!strboolcmp(spice_ignore_str, "true")) flag = 1;
|
||||||
} else {
|
|
||||||
|
if(flag == 0) flag = 1;
|
||||||
|
else if(flag == 1) flag = 2;
|
||||||
|
else flag = 0;
|
||||||
|
|
||||||
|
|
||||||
|
if(flag == 1) {
|
||||||
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, subst_token(xctx->inst[i].prop_ptr, attr, "true"));
|
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, subst_token(xctx->inst[i].prop_ptr, attr, "true"));
|
||||||
|
} else if(flag == 2) {
|
||||||
|
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, subst_token(xctx->inst[i].prop_ptr, attr, "short"));
|
||||||
|
} else {
|
||||||
|
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, subst_token(xctx->inst[i].prop_ptr, attr, NULL));
|
||||||
}
|
}
|
||||||
set_inst_flags(&xctx->inst[i]);
|
set_inst_flags(&xctx->inst[i]);
|
||||||
set_modify(1);
|
set_modify(1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue