dlmiles
05/01/2024, 10:20 AMnet123
in ngspice that has the data and you can not use the device pin reference as an alias to the net.
at the the moment the only solution I can see is:
* intercept the export netlist function of xschem (to construct netlist as nodes, then enumerate each transistor, and find the arbitrary net name connected to each pin S G D B), save this as a mapping as alias (because maybe 2 transistors share the net, so a mapping is like net123 m20.d m19.s <http://more.path.to|more.path.to>.device.and.pin.would.go.here
)
* mutate the exported ngspice config, adding the resulting nets, such as net123
(which in effect deduplicates, which is another banal issue ngspice seems to have)
* rename/replace spice simulation config
Then (for simulation):
* intercept the 'run simulation' function, to run as normal
* but post-process the resulting RAW file, doing the reverse, using the saved alias m20.d aka net123
mapping
* mutate the RAW file possible removing the net123
and inserting back as m20.d
, duplicating the data if necessary, for example m19.s
might be connected to net123
as well, so this will show as 2 datapoints in the RAW file, one for m20.d
pin view and one for m19.s
pin view
Then load into xschem. Now TCL can access the same voltage data, that related to the connected net123
but in terms of the device and pin m20.d
Alternatively you could have xschem have a TCL procedure that can resolve m20.d
as an alias, for net123
and substitute 🙂 but it is unclear if possible or side effect to that idea