I found I made an mistake on my post on July 11, 2024.
I can’t modify my previous post, so I deleted it.
Please find the contents of my post on July 11, 2024, below with my correction.
Hi @weifan.enteligent ,
I’m so sorry, it’s totally my bad in my previous post…I made a bad mistake.
Please try this as our first step.
> QSPICE64.exe mainfile.cir
^^^
As you already run the “qsch2cir()”, I believe you have your “.cir” netlist in the same folder.
I think this post is not addressing your hierarchy challenge yet…, please share your update by running QSPICE64.exe on the netlist “.cir” file manually.
My July 11, 2024 post, corrected.
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:
/folder/subfolder/mainfile.qsch
/folder/subfolder/subfile1.qsch
/folder/subfolder/subfile2.qsch
/folder/subfolder/usermodule.dll
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.)
After converting “.qsch” into “.cir” file with the qsch2cir() function, inside PyQSPICE, it just run a command of
QSPICE64.exe mainfile.cir
That means it’s the same you do this in cmd.exe:
cd c:\folder\subfolder
\path-to-QSPICE-installation\QSPICE64.exe main.cir
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.