Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spice Library device cannot process nested subcircuits #1120

Closed
tomhajjar opened this issue Dec 5, 2024 · 4 comments · Fixed by #1211
Closed

Spice Library device cannot process nested subcircuits #1120

tomhajjar opened this issue Dec 5, 2024 · 4 comments · Fixed by #1211
Labels
Milestone

Comments

@tomhajjar
Copy link

Spice library is "confused" trying to "process" VCO_MOS_sub.cir. It doesn't like the three subcircuits in the middle.

Subcircuit .subckt ro_vco
sub 1
sub 2
sub 3
.ends ro_vco

Spice netlist gets processed by ngspice which works.

2024-12-04_231023
2024-12-04_230902
2024-12-04_230832

PLL_XSPICE_prj.zip

@ra3xdh
Copy link
Owner

ra3xdh commented Dec 5, 2024

The netlist contains the nested subcircuits. This syntax was not allowed by Ngspice in the past and Ngspice showed a warning and even may fail the simulation with the convergence error. Has something changed in the recent versions?

@tomhajjar
Copy link
Author

tomhajjar commented Dec 5, 2024

Unsure when ngspice allowed nested sub-circuits. The vco subcircuit "vco_sub.cir" has been in the ngspice XSPICE examples folder for a VERY long time. It is so old it was replaced by "vco_sub_new.cir' and hasn't been used for many releases of ngspice. It's actually an "orphan" subcircuit that was left in the folder. "vco_sub_new.cir' uses the ngspice "exclusive" "d_osc" function. I would need to ask Holger when nested sub-circuits were allowed.

C:\Ngspice-43+_64\examples\xspice\pll

Turns out "d_osc" has a bug which explains why it's been driving me crazy... ;-)
https://sourceforge.net/p/ngspice/discussion/120973/thread/d7eb851b6c/

@tomhajjar
Copy link
Author

tomhajjar commented Dec 5, 2024

@ra3xdh

I downloaded ngspice 25 from 2013 and the "vco_sub.cir" dated 2012 is identical and still has nested subcircuits...

@ra3xdh ra3xdh changed the title Spice netlist works but Spice library doesn't Spice Library device cannot process nested subcircuits Dec 6, 2024
@ra3xdh ra3xdh added the bug label Jan 19, 2025
@ra3xdh ra3xdh added this to the 25.1.0 milestone Jan 19, 2025
@ra3xdh ra3xdh linked a pull request Jan 19, 2025 that will close this issue
@ra3xdh
Copy link
Owner

ra3xdh commented Jan 19, 2025

Fixed by #1211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants