try more upper/lower case combinations in get_raw_index() function, removed some debugging messages

This commit is contained in:
Stefan Frederik 2022-09-09 02:11:09 +02:00
parent 6baeb53a51
commit 3ef32a1eef
2 changed files with 28 additions and 10 deletions

View File

@ -518,21 +518,39 @@ int read_rawfile(const char *f)
return 0;
}
/* given a node XXyy try XXyy , xxyy, XXYY, v(XXyy), v(xxyy), V(XXYY) */
int get_raw_index(const char *node)
{
char vnode[300];
char lnode[300];
char vnode[512];
char lnode[512];
char unode[512];
Int_hashentry *entry;
dbg(1, "get_raw_index(): node=%s, node=%s\n", node, node);
if(xctx->graph_values) {
entry = int_hash_lookup(xctx->graph_raw_table, node, 0, XLOOKUP);
if(!entry) {
my_snprintf(vnode, S(vnode), "v(%s)", node);
entry = int_hash_lookup(xctx->graph_raw_table, vnode, 0, XLOOKUP);
my_strncpy(lnode, node, S(lnode));
strtolower(lnode);
entry = int_hash_lookup(xctx->graph_raw_table, lnode, 0, XLOOKUP);
if(!entry) {
my_strncpy(lnode, vnode, S(lnode));
strtolower(lnode);
my_strncpy(unode, node, S(lnode));
strtoupper(lnode);
entry = int_hash_lookup(xctx->graph_raw_table, lnode, 0, XLOOKUP);
if(!entry) {
my_snprintf(vnode, S(vnode), "v(%s)", node);
entry = int_hash_lookup(xctx->graph_raw_table, vnode, 0, XLOOKUP);
if(!entry) {
my_strncpy(lnode, vnode, S(lnode));
strtolower(lnode);
entry = int_hash_lookup(xctx->graph_raw_table, lnode, 0, XLOOKUP);
if(!entry) {
my_strncpy(unode, vnode, S(lnode));
strtoupper(lnode);
entry = int_hash_lookup(xctx->graph_raw_table, lnode, 0, XLOOKUP);
}
}
}
}
}
if(entry) return entry->value;

View File

@ -3092,7 +3092,7 @@ proc tclpropeval2 {s} {
global debug_var env path
set netlist_type [xschem get netlist_type]
puts "tclpropeval2: s=|$s|"
# puts "tclpropeval2: s=|$s|"
if {$debug_var <=-1} {puts "tclpropeval2: $s"}
set path [string range [xschem get sch_path] 1 end]
if { $netlist_type eq {spice} } {
@ -3106,13 +3106,13 @@ proc tclpropeval2 {s} {
if { $debug_var<=-1 } { puts "---> path=$path" }
regsub {^tcleval\(} $s {} s
regsub {\)([ \n\t]*)$} $s {\1} s
puts "tclpropeval2: s=|$s|"
puts "tclpropeval2: subst $s=|[subst $s]|"
# puts "tclpropeval2: s=|$s|"
# puts "tclpropeval2: subst $s=|[subst $s]|"
if { [catch {uplevel #0 "subst \{$s\}"} res] } {
if { $debug_var<=-1 } { puts "tclpropeval2 warning: $res"}
set res ?\n
}
puts "tclpropeval2: res=|$res|"
# puts "tclpropeval2: res=|$res|"
return $res
}