Is it possible to set a tcl variable when opening ...
# xschem
c
Is it possible to set a tcl variable when opening a schematic. And also can the variable be local to the currently opened page? I was trying something like lvs_ignore just with a special AC simulation testbench where i want to insert a component that otherwise has the spice_ignore property set to true through a variable.
s
There are no tcl variables local to a schematic. A schematic is not a tcl procedure or namespace. But you can use any variable (global or namespaced) for that. you can do something like:
spice_ignore="tcleval([info exists xxx])"
where xxx is a tcl variable. if
xxx
exists (
set xxx 1)
the block will be ignored if
xxx
does not exist (
unset xxx
) the block will be netlisted. whenever you change variables please run
xschem reset_caches
, so the expressions involving tcl variables on instances will be re-evaluated, so you immediately visually see the block turning to grey if ignored. The
xschem reset_caches
is done anyway before generating a netlist (so another way to update the visual appearance of ignored blocks is to do a netlist) you can use a reverse condition with:
spice_ignore="tcleval([expr ![info exists xxx]])"