Hi, I'm trying to make fancy testbench template in...
# xschem
a
Hi, I'm trying to make fancy testbench template in xschem, using multiple control blocks that can be ignored (spice_ignore=1) and each one with at least one plot display that should be empty if the associated control block is ignored. I'm using
set curplotname
to give each simulation a unique name. The "store data" logic is working as expected. My problem happens in the moment of loading the data. - The
xschem raw_read
function used in the launcher.sym is not capable of load all plots in the .raw. So I have to create specific launchers for each .control block, and indicate which plot load. Is there a way to just load everything? - In the same track of multiple
launcher.sym
logic, It's possible to use a custom symbol property as value inside other symbol property? In the launcher I have
descr="tcleval(@@target)"
but it doesn't read the
target
property. - Each time that a
launcher
is run, it overwrites the other plots. Is there a way to avoid this? - I want each graph to show variables from a specific
.control
block. I've seen this
dataset
concept that is similar to the
plot
used in ngspice. Is there a way to use the plot name instead of the dataset index to indicate a graph which set of vectors use? I want to reduce to a minimum the manual configuration per simulation. Only setting curplotname and indicate which plotname use for each graph should be required.
This is the template
I'm reading the documentation, and it says that I should use xschem 3.4.5 to fix almost all the problems I'm having. It's not on sourceforge so It seems that I have to use multiple handlers to change the current dataset. Maybe I have to learn how to use subversion (svn) to have the latest version of the code?
s
@aquiles viza there is a more advanced command for loading raw file: see example below:
Copy code
xschem [~] xschem raw clear
free_rawfile(): clearing data
free_rawfile(): clearing data
1
xschem [~] xschem raw read $netlist_dir/cmos_example_ngspice.raw tran
Raw file data read: /home/schippes/.xschem/simulations/cmos_example_ngspice.raw
points=30114, vars=44, datasets=3 sim_type=tran
1
xschem [~] xschem raw read $netlist_dir/cmos_example_ngspice.raw dc
Raw file data read: /home/schippes/.xschem/simulations/cmos_example_ngspice.raw
points=1003, vars=44, datasets=3 sim_type=dc
1
xschem [~] xschem raw read $netlist_dir/cmos_example_ngspice.raw ac  
Raw file data read: /home/schippes/.xschem/simulations/cmos_example_ngspice.raw
points=273, vars=50, datasets=3 sim_type=ac
1
xschem [~] xschem raw info
2 current
0 /home/schippes/.xschem/simulations/cmos_example_ngspice.raw tran
1 /home/schippes/.xschem/simulations/cmos_example_ngspice.raw dc
2 /home/schippes/.xschem/simulations/cmos_example_ngspice.raw ac
You see 3 different analyses are loaded from
cmos_example_ngspice.raw
Xschem graph objects may each refer to a different raw file if needed: See in image attached the Raw file textbox and the listbox specifying the analysis, and another image showing a circuit with simultaneous
tran
,
dc
,
ac
graphs and
operating point
annotated in schematic.
a
Hi Steffan, my version of xschem is not recognizing the
xschem raw *
commands, it only allows
xschem raw_*
commands.
Copy code
% xschem raw_read
0
% xschem raw_clear
% xschem raw_info
xschem raw_info: invalid command.
% xschem raw
xschem raw: invalid command.
% xschem raw read
xschem raw: invalid command.
% xschem raw clear
xschem raw: invalid command.
I'm using xschem 3.4.4, and the interesting graphs features are documented after indicating support for them on 3.4.5+. Also, the graphs in the schematics don't have the bottom configuration tab, as shown on the shared image. I have not found the sources for that version of xschem. Where could I find them?
s
Yes the xschem raw addition is recent, The sources are here: https://github.com/StefanSchippers/xschem Install instructions are here: https://xschem.sourceforge.io/stefan/xschem_man/install_xschem.html Please before installing the latest xschem from sources remove any xschem installed on the system with its package manager; For Ubuntu / Debian /derivatives:
sudo apt purge xschem
a
I've compiled the latest repository code and it reports version 3.4.5 and the desired functionality exists. Thanks Stefan 🙂. Still, I find a bit odd that executable version and tag doesn't match. Please update the repository tag to 3.4.5.
I'm having an issue with simulation. It's giving me an error like this
Copy code
Mismatch: 1 formal but 0 actual params.
vss=$;
...
Formula() error.
   |vss=$;| : |vss|=|$|
Simulation works while on 3.4.4, so I think is something related with the latest version.
s
@aquiles viza Thank you for reporting, yes this was a very subtle regression introduced a few hours ago, now fixed. Your example now works. Thank you and apologies for the inconvenience. the 3.4.5 will be the next xschem revision. I will tag it when it is sufficiently tested and stable. For now 3.4.4 is the stable (tagged) release and 3.4.5 is the current development branch, When 3.4.5 will be tagged I will bump to 3.4.6 development.
a
Well that was quick, simulation works. The tag logic makes totally sense, thanks. Still, there's some stuff that I think is relevant to notice. • I can't use the xschem terminal interface. In 3.4.4 it appears in the same shell where I started xschem, but now I can't use it. • It seems that graph configuration in terms of x and y limits is not stored, because everytime I press the launcher, have to manually press
f
in every graph. • The
Unlock X axis
has to be stored with Ctrl-Enter, while the other parameters are stored immediately. • When using the
Raw File:
, it writes
$netlist_dirrawspice.raw
instead of
${$netlist_dir}rawspice.raw
. • Is there a way to change the name of a plot? I was using
set curplotname=sim1
to differenciate them, but they still are referenced with
dc
and
tran
. • An observation, I just needs to load one plot (xschem raw open ... dc) and every other plot in the file is accesible.
Besides that, the template is usable now. Thanks Stefan
s
@aquiles viza : • About the teminal interface this is surprising. Nothing has been done on that. So if you type
xschem
in a terminal you don't get the xschem tcl prompt? How do you start xschem? do not use
xschem -b
if using interactively. • If you resize / zoom graphs you can store the setting by force-saving the file (Save As, Ctrl-Shift-S). The reason is in many cases you zoom a graph but you don't want the schematic to be set in 'modified state' but because of looking at waveforms. • The "Unlock X axis" checkbutton is now fixed. In last commit the state is applied to graph immediately, not only after closing the dialog. thank you for pointing that out. • The "Raw file: text box should contain the path of a raw file to load in the specified graph. This allows to have multiple graphs loading different files instead of just one. Usually you should write
/path/to/rawfile.raw
but you can use
$netlist_dir
to avoid writing platform specific paths:
$netlist_dir/rawfile.raw
. That said I don't understand your question or what you want to do with
${$netlist_dir}rawspice.raw
, so please le t me know what you need to do. • tran, dc, ac, op are not plot names but rather plot types . Xschem uses this information stored in raw files to understand what kind of data is inside. For example AC plots store complex data, while other types store real numbers. OP raw files do not have a sweep variable while others do. The
set curplotname
has a meaning inside the ngspice control language. Once a raw file is stored on disk there is no such information. • Yes, loading one raw file triggers all other graphs. May be I will add an enable checkbutton to allow or disallow automatic loading in graphs that specify a per-graph raw file.
a
I'm not using -b. I've used the same command that allow me to verify that 3.4.4 doesn't have
xschem raw read
commands, and it shows me the terminal. Maybe is related to the installation. I'm just using
./configure && make && sudo make install
. Do I need another ./configure parameter? This is the actual command I'm using. The use of
|& tee
was not a problem before.
Copy code
xschem --rcfile /workspaces/DC23-LTC2-LDO/LDO/xschem/xschemrc --netlist --netlist_path /workspaces/DC23-LTC2-LDO/LDO/xschem/test/inv_sample/ --netlist_filename inv_sample.spice /workspaces/DC23-LTC2-LDO/LDO/xschem/test/inv_sample/inv_sample-test.sch |& tee /workspaces/DC23-LTC2-LDO/LDO/xschem/logs/2024-02-06/02-58-03_xschem_inv_sample.log
The storage of graphs x and y limits works with Ctrl-Shift-S. But it has a trick. Before pressing the launcher (Ctrl-Click), it will not show anything. One has to: 1. Press
f
for every graph, so everyone shows the respective data. 2. Press
esc
to make all plots update. This should be the default behavior after pressing the launcher. Maybe there's a
xschem command
that makes all graphs refresh. The X Axis problem is fixed. The observation with the
Raw file:
button happens when I use the file explorer GUI and selecting a file results on
$netlist_dirrawspice.raw
instead of
$netlist_dir/rawspice.raw
or
${netlist_dir}rawspice.raw
($netlist_dir already includes the /). I think it could be related with the way I'm setting --netlist_path, but it's very easy to fix, this problem is not so relevant in my opinion. I thought that with the plot name I could add more "semantic value" into the graphs while having only one .raw file, somehow avoiding the use of numerical indexes. This is more related with aestetics so I'm going to work on this later, using different .raw filenames only. Thanks a lot Stefan, Hopes this dicussion allows my team and others to have more easy to analyse testbenches. I'm sharing the latest
s
> The use of
|& tee
was not a problem before. Add
-r
to xschem command options. This prevents xschem from closing standard file descriptors:
xschem .... -r  |&  tee ...
This was added in 3.4.5 to handle all combinations of xschem run from a terminal, from a exec command, with redirection, without redirection, in background, with readine interface or without it etc. > The observation with the
Raw file:
button happens when I use the file explorer GUI and selecting a file results on
$netlist_dirrawspice.raw
instead of
$netlist_dir/rawspice.raw
or
${netlist_dir}rawspice.raw
> ($netlist_dir already includes the /). I think it could be related with > the way I'm setting --netlist_path, but it's very easy to fix, this > problem is not so relevant in my opinion. This is now fixed. The problem was the '`/`' at end of
netlist_dir
. I have added appropriate checks. Please verify. > Before pressing the launcher (Ctrl-Click), it will not show anything. One has to: > 1. Press
f
for every graph, so everyone shows the respective data. > 2. Press
esc
to make all plots update. This should be the default behavior after pressing the launcher. Maybe there's a
xschem command
that makes all graphs refresh. The first time you load a graph you need to set the view port with 'f'. If you save the schematic the next time you load the waveforms they are visible. I can not understand the
Esc
to make all plots update. Please record a short desktop video and send it. Some systems have a broken GPU and for that there is a specific xschem menu to handle this case:
View->Fix for GPUs with broken tiled fill
but I think it is already set. Thank you for pointing out the issues.
graphs.mp4
a
Hi Steffan, Sorry for the late reply. Some things about my environment: • I'm using docker as development environment • The X graphics are rendered with windows wsl x server support, Not Xming nor vcxsrv • Maybe there's a
xschem refresh graphics
command that could be put at the end of the launcher
s
add
xschem raw_read .... ; xschem redraw
at the end of the raw reading command. If that does not work do:
xschem raw_read .... ; update; xschem redraw
however it is strange the update does not happen on its own. There is some problem with the graphics.
a
In 3.4.4 the launcher works as expected, drawing everything inmediately.
s
Will be difficult to spot the problem, since I can not see it here. Will keep this in mind, may be I get some ideas or advices
one thing you can do is going back in commit history until you find the first commit that breaks things.
but it is quite tedious.
you can also try to uncheck in 3.4.5 the option:
Options->Fix for GPUs with broken tiled fill
👀 1
a
Adding
xschem redraw
at the end of the launcher makes xschem 3.4.5 works as expected. I think this is the solution I'm going to use. Unchecking the option doesn't fix the problem, also, that configuration is not stored between xschem startups. I'm not sure if that's the expected behaviour but I don't going to use it. The only problem I'm facing is the lack of terminal. I'm going to try manual installation of 3.4.4 to see if the problem is in this stage.
s
The terminal issue in 3.4.5 is solved by adding
-r
to the xschem command line
a
With
-r
the terminal is shown. Thanks Steffan.