handle NULL analysis type in debug messages (extra_rawfile()), recursive value substitution in symbol displayed strings: if translated text begins with @ search for recursive upper level definitions for text following @, example: @model symbol text, instance has model=@modeln, upper instance has modeln=nfet: resolve symbol text and display "@model" as "nfet", proc inutile: add optional wait argument to block xschem while dialog displayed

This commit is contained in:
stefan schippers 2024-10-03 13:08:32 +02:00
parent 19188ee99d
commit 4311ac424a
3 changed files with 16 additions and 6 deletions

View File

@ -1173,7 +1173,7 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d
xctx->extra_prev_idx = xctx->extra_idx;
xctx->extra_idx = i;
} else {
dbg(1, "extra_rawfile() switch: %s not found or no %s analysis\n", f, type);
dbg(1, "extra_rawfile() switch: %s not found or no %s analysis\n", f, type ? type : "<NULL>");
ret = 0;
}
} else if(file && isonlydigit(file) ) {
@ -1185,7 +1185,7 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d
xctx->extra_prev_idx = xctx->extra_idx;
xctx->extra_idx = i;
} else {
dbg(0, "extra_rawfile() switch: %s not found or no %s analysis\n", f, type);
dbg(0, "extra_rawfile() switch: %s not found or no %s analysis\n", f, type ? type : "<NULL>");
ret = 0;
}
} else { /* switch to next */

View File

@ -4215,14 +4215,17 @@ const char *translate(int inst, const char* s)
} else {
int i = level;
my_strdup2(_ALLOC_ID_, &value1, value);
/* recursive substitution of value using parent level prop_str attributes */
/* recursive substitution of value using parent level prop_ptr attributes */
while(i > 0) {
const char *tok = get_tok_value(lcc[i-1].prop_ptr, value1, 0);
char *v = value1;
const char *tok;
if(v && v[0] == '@') v++;
tok = get_tok_value(lcc[i-1].prop_ptr, v, 0);
if(xctx->tok_size && tok[0]) {
dbg(1, "tok=%s\n", tok);
my_strdup2(_ALLOC_ID_, &value1, tok);
} else {
tok = get_tok_value(lcc[i-1].templ, value1, 0);
tok = get_tok_value(lcc[i-1].templ, v, 0);
if(xctx->tok_size && tok[0]) {
dbg(1, "from parent template: tok=%s\n", tok);
my_strdup2(_ALLOC_ID_, &value1, tok);

View File

@ -140,9 +140,12 @@ proc inutile_translate {f} {
cd $savedir
}
proc inutile { {filename {}}} {
proc inutile { {filename {}} {wait {}} } {
global XSCHEM_SHAREDIR retval netlist_dir
if {$wait ne {}} {
xschem set semaphore [expr {[xschem get semaphore] +1}]
}
if { ![string compare $filename ""] } then {
tk_messageBox -type ok -message "Please give a file name as argument"
return
@ -195,6 +198,10 @@ proc inutile { {filename {}}} {
inutile_alias_window .inutile.tw$i [lindex $tmp 1]
}
}
if {$wait ne {}} {
tkwait window .inutile
xschem set semaphore [expr {[xschem get semaphore] -1}]
}
}
### End INUTILE integration