I am loading a raw file from a noise simulation th...
# xschem
b
I am loading a raw file from a noise simulation that has the following variables:
tcleval([xschem raw list])
Now when I do:
tcleval([xschem raw index inoise_spectrum])
I get 3 as expected. But
tcleval([ xschem raw index @m.xm1.msky130_fd_pr__nfet_01v8_lvt[gm] ])
does not evaluate. I must be missing a syntax detail or the proper way to access the
gm
variable. It's clearly a somewhat different animal than the
inoise_spectrum
variable, since the former is just one value that comes from the DC operating point computed as part of the noise analysis. But the waveform viewer grabs and displays this variable without any issues, so I am guessing there must be a way to do this with
tcleval
, too?
BTW, I know how to display the
gm
value after running a standalone
op
analysis (as shown in the documentation examples), so that's not what I am looking for. I want to specifically grab this
gm
value stored in a
noise
raw file.
s
@Boris Murmann the
@
character is used by xschem to substitute attributes with their values (like
@symname
->`inv`), the
[
and
]
characters are used by tcl for command blocks. You just need to correctly escape those characters (the "quoting hell"):
tcleval([xschem raw index \@m.xm1.msky130_fd_pr__nfet_01v8_lvt\\[gm\\]])
This string goes to a
@var
translation phase, and escapes are used to differentiate a literal
@
from a substitution
@
token. After this translation the result is:
tcleval([xschem raw index @m.xm1.msky130_fd_pr__nfet_01v8_lvt\[gm\]])
Note the double backslashes around
[
and
]
are reduced to a single backslash. This is what tcl gets when resolving tcleval(), the
\[gm\]
is interpreted as a literal
[gm]
string and not as a
[gm]
tcl command.
🤢 2
b
Great, thanks! Works...