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 limitation #944

Open
tomhajjar opened this issue Sep 12, 2024 · 8 comments
Open

SPICE Library device limitation #944

tomhajjar opened this issue Sep 12, 2024 · 8 comments
Milestone

Comments

@tomhajjar
Copy link

tomhajjar commented Sep 12, 2024

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

@tomhajjar tomhajjar changed the title Lib device limitation SPICE Library device limitation Sep 12, 2024
@ra3xdh
Copy link
Owner

ra3xdh commented Sep 12, 2024

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
Copy link
Author

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
Copy link
Owner

ra3xdh commented Sep 12, 2024

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

@ra3xdh
Copy link
Owner

ra3xdh commented Sep 13, 2024

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

  • Add option like Embed subcircuit in netlist This option must be active when creating library. Otherwise the netlist will be referencing library via .INCLUDE directive. It is not clear how to extract complex subciruits containing subcircuits and .MODELS itself from the library file. The internal subcircuit definitions are placed before the closing .ENDS directive.
  • Maybe add possibility to paste subcircuit code in Spice Library Device properties window and combine with the previous proposed option. Make the Subcircuit editor editable. This will resolve the problem with extraction of the subcircuit from library.
  • The Spice File Device can be used with the user libraries placed in $HOME/QucsWorkspace/user_lib. The symbols are placed in a separate subdirectory and could be loaded automatically. Look how the XyceDigitalDevices library is made. This method is not implemented from GUI. It's need to provide a way to import SPICE libraries in a such way using GUI tools.

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
Copy link
Author

tomhajjar commented Sep 13, 2024

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
Copy link
Owner

ra3xdh commented Sep 14, 2024

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
Copy link
Author

tomhajjar commented Sep 14, 2024

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
Copy link
Author

tomhajjar commented Sep 14, 2024

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

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