fix bitrots in proc cellview (Update function)

This commit is contained in:
stefan schippers 2025-02-09 15:27:55 +01:00
parent b5a25e5925
commit 8bd9c3d939
1 changed files with 9 additions and 3 deletions

View File

@ -1799,6 +1799,8 @@ proc cellview_setlabels {w symbol derived_symbol} {
if { $sym_spice_sym_def eq {}} {
if { ![file exists [abs_sym_path [$w get]]] } {
$w configure -bg $missingbg
} elseif {$new_sch ne $default_sch } {
$w configure -bg $symbg
}
}
puts ===============
@ -1814,7 +1816,7 @@ proc cellview_setlabels {w symbol derived_symbol} {
xschem set schsymbolprop $newprop
xschem set_modify 3 ;# set only modified flag to force a save, do not update window/tab titles
xschem save fast
xschem remove_symbols ;# purge all symbols to force a reload from disk
# xschem remove_symbols ;# purge all symbols to force a reload from disk
xschem load -keep_symbols -nodraw -noundoreset $current
xschem netlist -keep_symbols -noalert;# traverse the hierarchy and retain all encountered symbols
puts "get netlist"
@ -1834,7 +1836,6 @@ proc cellview_edit_item {symbol w} {
} elseif { $sym_spice_sym_def eq {}} {
xschem load_new_window [$w get]
} else {
puts $symbol
set current [xschem get current_name]
set old_sym_def [xschem getprop symbol $symbol spice_sym_def 2]
set new_sym_def [editdata $sym_spice_sym_def {Symbol spice_sym_def attribute}]
@ -1906,15 +1907,17 @@ proc cellview { {derived_symbols {}} {upd 0} } {
}
set syms [join [lsort -index 1 [xschem symbols $derived_symbols]]]
# puts "syms=$syms"
foreach {i symbol} $syms {
if { [catch {set base_name [xschem symbol_base_name $symbol]}] } {
set base_name $symbol
}
# puts "i=$i, symbol=$symbol"
set derived_symbol 0
if {$base_name ne {}} {
set derived_symbol 1
}
if { [catch {set abs_sch [xschem get_sch_from_sym -1 $symbol]} ]} {
if { [catch {xschem get_sch_from_sym -1 $symbol} abs_sch ]} {
set abs_sch [abs_sym_path [add_ext $symbol .sch]]
}
if {$derived_symbol} {
@ -1931,6 +1934,9 @@ proc cellview { {derived_symbols {}} {upd 0} } {
}
if {$skip} { continue }
set sym_sch [rel_sym_path $abs_sch]
if {[catch {xschem getprop symbol $symbol type} type]} {
puts "error: $symbol not found: $type"
}
set type [xschem getprop symbol $symbol type]
set sym_spice_sym_def [xschem getprop symbol $symbol spice_sym_def 2]
if {$type eq {subcircuit}} {