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

Refactor SpiceLibComp dialog #1084

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Refactor SpiceLibComp dialog #1084

merged 1 commit into from
Dec 16, 2024

Conversation

ThomasZecha
Copy link

Reviewed changes from #1049

SpiceLibCompDialog has been reworked to achieve the code quality improvements introduced by #1049.

Tested the following dialogs under extsimkernel/:
-ExternSimDialog
-CustomSimDialog
-SimSettingsDialog
-SpiceLibCompDialog

@ThomasZecha
Copy link
Author

@ra3xdh: qucs-s crashes (with/without this PR) if

  • 'Symbol from template' is clicked in the 'Edit SPICE library device' dialog
  • Double-click any 'lib'-symbol in loaded ./examples/xyce/Xyce_Examples/09-Lorenz/lorenz.sch

Are these known issues?

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 22, 2024

SpiceLibCompDialog has been reworked

The issue title is a bit misleading. This dialog is not related to netlister. Please rename as something like Refactor SpiceLibComp dialog

qucs-s crashes (with/without this PR) if 'Symbol from template' is clicked in the 'Edit SPICE library device' dialog

I cannot reproduce the crash with my test schematics. Does it crash with every SPICE file or only with specific File/Symbol combination?

Double-click any 'lib'-symbol in loaded ./examples/xyce/Xyce_Examples/09-Lorenz/lorenz.sch

Again cannot reproduce the crash. The schematic opens with square placeholders, because it cannot find the LIB file. After I specifiy the Symbol from template, there is no crash. It doesn't allow to assign pins and press OK, because there is no symbol having 8 pins. The LT1057 device also opens dialog on double click and allows to reassign the symbol after fixing the LIB file path.

@ThomasZecha ThomasZecha changed the title Prepare for CDL netlist export Refactor SpiceLibComp dialog Nov 22, 2024
@ThomasZecha
Copy link
Author

The issue title is a bit misleading. This dialog is not related to netlister. Please rename as something like Refactor SpiceLibComp dialog

Renamed.

I cannot reproduce the crash with my test schematics. Does it crash with every SPICE file or only with specific File/Symbol combination?

Crashes with every schematic including a spice-lib via <SpLib ..., see callstack:

qucs-s_crash_I_gdb

Again cannot reproduce the crash. The schematic opens with square placeholders, because it cannot find the LIB file. After I specifiy the Symbol from template, there is no crash. It doesn't allow to assign pins and press OK, because there is no symbol having 8 pins. The LT1057 device also opens dialog on double click and allows to reassign the symbol after fixing the LIB file path.

Just open ./examples/xyce/Xyce_Examples/09-Lorenz/lorenz.sch and than double-click any lib-symbol, see callstack:

qucs-s_crash_II_gdb

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 22, 2024

Just open ./examples/xyce/Xyce_Examples/09-Lorenz/lorenz.sch and than double-click any lib-symbol, see callstack:

No crash using this file on my machine. Are you building the application with Qt5? I am using Qt6 for build and test. The Qt5 support will be deprecated since the next release #938 The build of DEB/RPM packages has been switched to Qt6.

@ThomasZecha
Copy link
Author

No crash using this file on my machine. Are you building the application with Qt5? I am using Qt6 for build and test. The Qt5 support will be deprecated since the next release #938 The build of DEB/RPM packages has been switched to Qt6.

I'm using 5.15.8, wonder that this shall be the cause.

@ThomasZecha
Copy link
Author

But anyway, I will try it under 6.

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 22, 2024

Try if the application still be crashing using Qt6. Rebuild using -DWITH_QT6=ON flag.

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 22, 2024

Yes, it crashes only with Qt5. I can reproduce it.

@ThomasZecha
Copy link
Author

I can reproduce both crashes under Qt6.

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 22, 2024

What is your Qt6 version? I am using 6.7.2

@ThomasZecha
Copy link
Author

I am using 6.4.2

@ThomasZecha
Copy link
Author

Root cause for both cases is line 357 in spicelibcompdialog.cpp:

QString file = dir_name + listSymPattern->currentItem()->text() + ".sym";

Depending on your local configuration listSymPattern could be empty. In that case currentItem() delivers nullptr.

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 23, 2024

The key difference was that the application was not installed when I tested Qt5 build. The Qucs-S must be installed while debugging. Otherwise it doesn't find the libraries etc. I would advise you to add install step in your test procedure. The QtCreator IDE allows to perform it. But nevertheless the crash should be fixed. I will prepare a PR containing the fix.

Reviewed changes from ra3xdh#1049

SpiceLibCompDialog has been reworked to achieve the code quality
improvements introduced by ra3xdh#1049.

Tested the following dialogs under extsimkernel/:
-ExternSimDialog
-CustomSimDialog
-SimSettingsDialog
-SpiceLibCompDialog

Rebased.
@ThomasZecha
Copy link
Author

Rebased.

@ThomasZecha
Copy link
Author

@ra3xdh: Any reason why not merge this improvement?

@ra3xdh
Copy link
Owner

ra3xdh commented Dec 3, 2024

Any reason why not merge this improvement?

I would like to make some corner cases testing of the modified dialogs before merging. I missed this point while accepting #1049 I am short in time this week, because maintaining the project is not my primary occupation. So, expect some delay.

All dialogs modified in this PR and in the #1049 are not involved in the netlisting procedure. So, you can proceed with implementing CDL netlister without waiting to merged this. Furthermore the ´externsimdialog.cpp´ is a candidate for remove (See #235). I would not advise you to modify the dialogs in order to implement the CDL netlister. You have to inherit the AbstractSpiceKernel and implement netlister.

@ThomasZecha
Copy link
Author

ThomasZecha commented Dec 9, 2024

@ra3xdh: Is it possible to get a cdl-netlist feature branch where direct push would be possible?

@ra3xdh ra3xdh merged commit 10e1e6f into ra3xdh:current Dec 16, 2024
8 checks passed
@ra3xdh
Copy link
Owner

ra3xdh commented Dec 16, 2024

Merged. No issues found with this version. Please avoid modifying the dialogs when implementing the CDL netlister. You need only to add a menu entry or maybe a custom dialog to set the CDL parameters. See how the Verilog-A export is implementing. It is very similar to the planned CDL extension (netlister without simulator).

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

Successfully merging this pull request may close these issues.

2 participants