ra3xdh / qucs_s

Qucs-S is a circuit simulation program with Qt-based GUI
https://ra3xdh.github.io/
GNU General Public License v2.0
840 stars 108 forks source link

SPICE Library device limitation #944

Open tomhajjar opened 1 week ago

tomhajjar commented 1 week ago

Why can't the "new" Spice library device be used to create a Library? Whey I try to make a Library from sub-circuits made using the Spice library device, the Library was missing all the Spice model information. I had to redo all my sub-circuits using the Spice netlist device. It was a quick swap and all PINs, labels and the symbol were unaffected.

This brings up the point why put this limitation on the Spice library device? Will the Spice netlist device be "updated" to have the same "new" features as the Spice library device?

2024-09-11_182451 2024-09-11_185117 2024-09-11_185509 2024-09-11_185204

ra3xdh commented 1 week ago

The adding of subcircuit extraction while creating libraries from SpiceLibComp devices is not a straightforward task. This device is only referencing library in the netlist. Don't expect this to be added in the near future. Use old Spice File device for creating libraries.

On the other hand the generic laser diode device need to be converted into the unified subcircuit. The device contains only standard diode devices and controlled sources. This will make this device available for both Qucsator and SPICE.

tomhajjar commented 1 week ago

Will the Spice netlist device be "updated" to have the same "new" features as the Spice library device? The new window has features like choosing Symbol files and a subcircuit viewer that would be useful in making large Libraries.

2024-09-12_092700

ra3xdh commented 1 week ago

I don't consider updating of the SpiceFile device. It has different internal design and works differently.

ra3xdh commented 1 week ago

I can implement the following things to improve the new Spice Library Device

The old Spice File device could be kept only for backward compatibility after the proposed improvements will be done. It will be needed only for legacy Qucsator simulations.

tomhajjar commented 1 week ago

The Digital examples in the XYCE example folder all have the wrong path for XyceDigitalDevices.lib. They point to "C:/Program Files (x86)/Qucs-S/share/qucs-s/library/XyceDigital.lib". How does one make this Library "portable" when the PATH info is wrong for everyone else?

This is a different type of Library that I didn't know Qucs-S supported. How are the symbols for XyceDigitalDevices.lib stored in the path below pointed to by the library? The stored symbol format doesn't have the line "<Qucs Schematic 24.2.1>" like the new format so Qucs-S cannot open them.

C:\QUCS-S 24.3.0\share\qucs-s\library\XyceDigital

2024-09-13_185218 2024-09-13_190341 2024-09-13_190404 2024-09-13_190501 2024-09-13_204603

ra3xdh commented 1 week ago

The Digital examples in the XYCE example folder all have the wrong path for XyceDigitalDevices.lib.

To be honestly I have never tested these examples. This was made by Mike Brinson for Xyce v6 and may not work anymore with the latest Xyce version.

This is a different type of Library that I didn't know Qucs-S supported.

Qucs-S supports such libraries. The Spice Library Device has undocumented feature of attaching symbol to SPICE library. The SPICE SUBCKT and symbol file should have the same name. Library manager looks in a special directory and loads an appropriate symbol. This feature is not available from GUI. Also read more here: https://qucs-s-help.readthedocs.io/en/latest/SubLib.html#usage-of-the-whole-spice-library

Something may become broken after the recent redesign of SpiceLibComp, but this feature requires redesign itself. This is another development task. I don't recommend to use this feature for libraries design until I will provide an improved version. Again don't expect a quick solution here.

How are the symbols for XyceDigitalDevices.lib stored in the path below pointed to by the library?

The XyceDigital library was made manually with the text editor by Mike Brinson around 2016. The symbols were probably copied from some schematic. I don't posses the source schematic for the symbols.

tomhajjar commented 1 week ago

The XYCE digital examples all work when you correct the Library path. I used a text editor and search-replace to fix them.

The PATH however assumes you used a 32bit version of Windows and used the Qucs-S Installer that placed the files in the "C:/Program Files (x86)/Qucs-S/" folder.

The symbols can be opened in Qucs if you add the line "<Qucs Schematic 24.2.1>". I added the line to AND2 and ANDOR4X2 and the symbols looked the same when placed on a schematic.

What's unclear is how the symbols PATH is known since it's not in XyceDigitalDevices.lib

2024-09-14_092816 2024-09-14_093317 2024-09-14_093058 2024-09-14_093649

tomhajjar commented 1 week ago

I converted all the XyceDigitalDevices.lib symbols to be readable as Symbols by adding <Qucs Schematic 1.0.0> to the first line. Unfortunately if I use CUT/PASTE when editing the symbols, Qucs-S deletes all the Ports.

There is no consistency to symbol colors, body size or PIN position. Not a big deal unless you try to use NAND2 vs AND2...etc

Symbols for XOR/XNOR are wrong. I will clean up the symbols when I get a chance.

XyceDigital.zip