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

Some models from qucs-s library not getting "normalized" parameters, either generate unparsable netlist line, or lose scale value #13

Closed
tvrusso opened this issue Feb 19, 2018 · 3 comments

Comments

@tvrusso
Copy link
Collaborator

tvrusso commented Feb 19, 2018

I just attempted to use some of the LED models in the Qucs library in a Qucs-s schematic with Xyce. These models all have spaces in the diode parameters between value and units, and a 50 MOhm leakage resistor. The specific LED model I tried to use was the green one.

Qucs-s is generating a netlist that doesn't squeeze out the space between parameter and units of the diode parameters, resulting in a parse error from Xyce (which uses space as a field separator, like the original SPICE does). Further, the "50 MOhm" is not converted to "50 Meg" as it seems it should be by the use of "spicecompat::normalize_value" in the resistor.cpp code.

The attached schematic and the netlist it produces are in this tar file:
led_prob.tar.gz

A quick glance at code makes it appear that when the parameter list for the diode is generated, nothing is calling "normalize_value". If I modify (by hand) the diode model in LEDs.lib to take out the spaces, that fixes the netlist so it runs. But the "50 MOhm" resistor becomes a 50 ohm resistor.

If I remove the space from the leakage resistor specifier in LEDs.lib, qucs-s emits "50MOhm" and not "50Meg".

But qucs/components/resistor.cpp does call spicecompat::normalize_value in its spice_netlist function, and still doesn't convert "50 MOhm" into "50Meg" as I would expect it to. I don't quite understand what's going wrong there.

@ra3xdh
Copy link
Owner

ra3xdh commented Feb 19, 2018

If the model contains subcircuit in original Qucs libraries, it is represented as Qucs netlist, but not as XML subcircuit. The spicecompat::normalize_value is invoked only for "normal" components. If Qucs-S finds Qucs netlist, it redirects it to qucs2spice processor (located at extsimkernels/qucs2spice.cpp) that will convert it to SPICE netlist. It is a simple Regexp-based netlist converter and some functions could be missing here. Probably qucs2spice would be benefit from redesign. So the Resistor::spice_netlist is not invoked for such library component.

@ra3xdh ra3xdh added the bug label Feb 19, 2018
@tvrusso
Copy link
Collaborator Author

tvrusso commented Feb 19, 2018

Ah. Thanks for clarifying where I should look. I'll look at qucs2spice.cpp soon.

@ra3xdh
Copy link
Owner

ra3xdh commented Jun 2, 2023

LEDs library has been fixed by #134. I have also provided some other new libraries that have better compatibility with SPICE. Qucsator netlist syntax should be removed from libraries and SPICE entries provided instead. I am considering the update of ideal devices libraries #258 This issue could be closed.

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

No branches or pull requests

2 participants