Hello, When trying to get the back annotation feat...
# xschem
d
Hello, When trying to get the back annotation feature working. I have in place:
Copy code
* Is this option needed, this option causes the ngspice error:
* "Warning from checkvalid: vector @m.xm1.msky130_fd_pr__pfet_01v8[ib] is not available or has zero length."
* .option savecurrents
.save all
When the
.option savecurrents
is specified, this causes no new RAW file to be created, but an error to occur, is this usage error or a bug ? When I attempt to "load waves" with code.sym "xschem raw_read $netlist_dir/testbench.raw tran" no error is shown, no indication an action was performed occurs and no update to visual seen. When I use the menu "Graphs -> Annotate Operating Point ... -> pick RAW file -> OK" the visual updates with question marks "? ?" the only data that is updated are the ammeter.sym and spice_probe.sym I added to the design. None of the transistors show values. I think I need to inject a wave graph into the schematic view, to provide an X axis time reference to show sample for, can''t see an obvious design/*.sym to insert for this, so hunting for a project with that configured. Also what is the best symbol to be using to inject test points for data collection (I and V for example), ideally with a quick toggle button list to disable/enable (without need to rework the schematic, to remove the injected symbol when you want to disable it). This would then modify the netlist creation and ngspice config accordingly to the disable/enable state of the individual test point. Also after some time in usage of xschem the application refuses to take any more mouse click input to select items in the main design area. Menu items work ok, a restart always fixes it. Is this is known matter maybe with Tk/X11, using Linux/Xwayland ? Thanks
s
To avoid the zero length error put a
remzerovec
instruction before the
write
command. All simulation variables like gm, vth, gds and so on need to be saved explicitly:
Copy code
save @m.x1.xm5.msky130_fd_pr__nfet_01v8[gm]
save @m.x1.xm5.msky130_fd_pr__nfet_01v8[gds]
save @m.x1.xm5.msky130_fd_pr__nfet_01v8[gmbs]
save @m.x1.xm5.msky130_fd_pr__nfet_01v8[vth]
πŸ’‘ 1
For the application refusing to take mouse input if you can replicate the error and find what triggers the behavior let me know. --> Please check if you don't have an open dialog box accidentally minimized or hidden / obscured. The "annotate Operating point into schematic" works if there is a "OP" section in the raw file to be loaded. This means in the testbench there is a
op
line followed by a
write circuit.raw
instruction. An OP analysis contains just one single value per circuit node representing the operating point. You don't need to place a graph for this (there are no graphs to show, OP is just a single point). You don't need to inject objects to get voltages. Just assign a net name to the voltage you are interested in. You can use the
spice_probe.sym
symbol attached to a net, it will automatically generate the .save v(...) line in the netlist. Alternatively you can use
save all
and get all voltages. You can insert an ammeter,
ammeter.sym
in series to a branch where you want to measure the current. Adding attribute
spice_ignore=short
to the ammeter will transform the ammeter into a short, so it is removed from the netlist. Changing to
spice_ignore=0
will enable the ammeter again. This spice_ignore attribute can be used on any instance in the schematic:
Copy code
spice_ignore=0: use the element normally
spice_ignore=1: remove the element from the netlist
spice_ignore=short: short circuit all pins of the element
Ammeter currents are automatically saved in the simulation raw file.
d
Thanks for the responses. It would be good to have
spice_ignore=0
an implicit default when inserting ammeter (then everyone can see it there), like the
savecurrent=true
is, then at least someone reading can lookup docs for it (or guess) at what it does. Success with
.option savecurrents
and then
.remzerovec
there is no error now in ngspice wiring out raw file, and see I(current) values next to all transistors. Just trying things out with your suggestion re voltages, am already using
spice_probe
for specific things, but when debugging showing voltage for all nets. Assigning a net name, means removing the default hash from in front of the default auto-generated name, or specifying your own
lab=
value that does not start with a hash.
s
inserting a net name means attaching a
lab_pin.sym
or
lab_wire.sym
(they only differ in text positioning) to a net:
Usually the best way to insert write and op/dc/tran instructions is inside a .control block:
Copy code
.option savecurrents

.control
  save all
  save @m.x1.xm1.msky130_fd_pr__nfet_01v8_lvt[gm]
  ...
  op
  remzerovec
  write circuit.raw
  set appendwrite
  tran 1n 100n
  remzerovec
  write circuit.raw
.endc
I will add the spice_ignore=0 default to the ammeter. πŸ‘
πŸ‘ 1
d
Thanks for replies, one final quality of life query, the
devices/launcher.sym
how do you activate the launch function. When I click, double-click it is into 'edit properties', right click menu does not have 'launch' option. I try with modifiers as well Shift/Ctrl etc... I can not observe launch action occuring. Is that Xwayland inter-op issue?
The only feature request, is a launcher.sym that allows to configure an action, "Run After Simulation Completed Successfully" which runs of exit_status==0 and can be one or more tcl commands. Or it could run a shell command, for example to make a beeping sound. etc... the user can decide
For anyone following, the example re ngspice snippet above. I found you have to run the "op" AFTER the "tran" it seems it needs to be the last thing in the RAW file, for the backannotation to work (display correctly on diagram).
devices/launcher.sym:
Copy code
name=h1
descr="reload anno"
tclcommand="xschem annotate_op $netlist_dir/testbench.raw"
In case it helps anyone else. Ctrl-Click is working on the launcher icons (after a bit of debugging πŸ™‚ there is no error feedback for an invalid tclcommand, or a successful one if it did nothing, leaving the user with the impression nothing happens.
s
Thank you for the reports. I have made a small commit such that if a tclcommand in a launcher does not run successfully an alert dialog box is shown.
d
Thanks very much for the improvements
s
Also a warning is displayed if a launcher does not have any action defined (url=... or tclcommand=...)
πŸ‘ 1
d
Hello, When I am trying to annotate operating points id, gm,cgg and vth into the schematic. While id, gm, and cgg have been updated and displayed in the schematic, vth is not appearing correctly and is instead showing a question mark. Am I missing something? Regards
s
the vth must saved with v(...): .save v(@m.xm5.msky130_fd_pr__pfet_01v8_lvt[vth])