PyQSPICE with Hierarchical Elements

I have a Qspice simulation with .dll and other hierarchical blocks which runs perfectly without even a warning. However, when I try to run the file using the PyQSPICE, I see the warning of

Didn’t find a model for “HIERARCHICAL” – defaults assumed.
Warning: Ignoring unknown instance parameter “ELEMENT” of device COULD.

Warning: Unexpected number, “hierarchical model name”, in device COULD.

Fatal error:
This circuit does not say which node is ground.

In my code, I have

from PyQSPICE import clsQSPICE as pqs

run = pqs(“hierarchical model 1”)
run = pqs(“hierarchical model 2”)
run = pqs(“hierarchical model 3”)

run = pqs(“main simulation file”)

What to do with the symbol files?? I need some help regarding this issue. Thanks in advance!


I’m trying my best from your statements, if this is not enough, hope you can share a little bit more info.

For example, let’s assume your simulation files are this way:

With this hierarchy simulation setup, please invoke your Python from the folder contains “mainfile.qsch” which is “/folder/subfolder” in this example.
(And we assume your mainfile.qsch has a proper path specification to the subfiles and DLL files as you wrote QSPICE runs without problems.)

Inside PyQSPICE, it just run a command of

QSPICE64.exe mainfile.qsch

That means it’s the same you do this in cmd.exe:

cd c:\folder\subfolder
\path-to-QSPICE-installation\QSPICE64.exe main.qsch

If this doesn’t work, PyQSPICE won’t work neither and I believe you will get the same error messages you wrote.

Hope this helps…if not, please share a little bit more info.

In my latest example, I do use a DLL and it works with this flat placement.


I didn’t check, by myself, for non-flat hierarchy so please kindly share your experience if that’s the case.