Hi there,
after some time elapsed, I am still/again busy using KiCAD as schematic entry tool for ngspice.
When using hierarchy sheets everything works fine within eeschema.
The spice netlister converts the hierarchy back into a flat-scheet.
The local labels are prefixed with the name of the subsheet and separated by a / character.
E.g. the label “op_out” in the subsheet “Amplifier” is represented by “/Amplifier/op_out”.
This is, where ngspice get stuck, when it tries to access such a label: it just doesn’t recognize it properly.
When I replace the /-character by an underline _-character, ngspice simulation works fine.
Replacing it with :-character fails either.
So my question is:
how/where can I change the delimiter-character / into something, that goes along with ngspice?
What is your recommendation for a better choice of a delimiting character?
Hi Holger,
thanks for responding.
My issue is not about file and directory handling, but handling of hierarchical net-labels.
Access in this respect means, that a statement in a control-section,
e.g. "let op_out = /Amplifier/op_out
will fail. In some cases, the ngspice even crashes.
I am using ngspice version 3.2.
I am not using the ngspice-integration within KiCad, instead I operate ngspice using skripts due to higher flexibility.
@Holger:
sorry, I disagree in this respect.
The KiCad netlister generates “/subsheet/local-label” for spice-netlists.
In some cases I was more successful with “_subsheet_local-label” expressions with ngspice.
My question is about, where to handle these delimiters within the Kicad netlister configuration.
Another question to the experts:
Is the utilisation of “/” as delimiter common sense between Kidac ans nagspice?
Can you post a ZIP of an example project which has hierarchical sheets and labels to help convey the problem better? I believe I understand your issue, but I don’t know how to address it. Maybe an example will help others, who are able to address it, understand it better.
All,
the example project, that I attached for Ste also contains a strange flew when spice-netlisting of dependent sources F and H; the controls source of F/H is not exported into the netlist. So there is one parameter missing in the spice-netlist. As a consequence ngspice crashes (without error message).
@Holger:
thx for the link to https://gitlab.com/kicad/code/kicad/-/issues/159.
As that thread is already closed, here is my proposal:
I understand the analogy of /subsheet/label with /directory/file.
(I hate me to say that, but) couldn’t you use backslash “\” instead?
It wouldn’t interfere with the division-operator.
OK…I got the root-cause now.
It is neither “/” nor “\”; both work.
It is, what Holger indicated in the very beginning:
the netlist-handling of dependent sources F and H.
After I fixed it manually in the .cir-file, it of cause returned whenever I created another spice-netlist.
It almost drove me crazy.
The solution within KiCad looks like this:
I have to apply both “control source” and “gain” in the value-field separated by a blanc-char.
I am using dependent sources from pyopus, as there where no respective symbols in the KiCad-libs (at least I didn’t find them). Obviously the netlister doesn’t operate properly on pyopus-controlled sources (or I am using them improperly…).
Perhaps it is just me, but I find the use of “/” and “” in node names to be very problematic. These are well known as directory delimiters, and to use them in a netlist where they could be node names or file names depending on context just seems to be begging for confusion.