Can't start a multi-line SPICE directive with a commented-out line

Bug #1786119 reported by Evan Shultz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Medium
Maciej Suminski

Bug Description

If I have 3 different analysis types included in a multi-line comment, the first two work but KiCad doesn't see any simulation properties provided if I try to use the 3rd analysis type. I would not expect there to be any limitation here.

For clarity, here is the multi-line comment:
.tran 1u 10m
*.op
*.ac dec 10 1 1Meg
*.tran 1u 20m

This simulates fine. But if I add as asterisk in front of the first line and remove the asterisk in front of the second ".tran" statement, the simulation doesn't run. It is unclear why this doesn't work.

See the project I posted at https://bugs.launchpad.net/kicad/+bug/1786116 for an example KiCad project with the text above already in place for your testing pleasure.

Application: kicad
Version: (5.0.0), release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.60.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.54.1
    Compiler: GCC 7.1.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Tags: ngspice
Revision history for this message
NhatKhai (nhatkhai) wrote :

I think this is because the new rule of spice directive is the first letter on your text have to be a "." (dot). This should not be a problem with the old directive style with "+spice", "-spice", "+/-Anything"

Revision history for this message
NhatKhai (nhatkhai) wrote :

I'm sad that they remove the old style.

Jeff Young (jeyjey)
summary: - Only two analysis types are read?
+ Can't start a multi-line SPICE directive with a commented-out line
tags: added: ngspice
Changed in kicad:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Maciej Suminski (orsonmmz)
milestone: none → 5.0.1
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision d5ee3296b200a7ccd863209390fe66a71b192dae
https://git.launchpad.net/kicad/patch/?id=d5ee3296b200a7ccd863209390fe66a71b192dae

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Nhat Khai,

Is there any benefit in supporting the old style multiline Spice directives? I thought that all analysis and control directives start with a dot, but I might be missing some use cases.

Revision history for this message
Evan Shultz (evan-shultz) wrote :

I prefer to put all analysis type statements in one text block. This allows me to comment out one and uncomment another without having to open two text blocks. It's just faster to make both changes together. That's why I appreciate being able to put multiple SPICE directives within the same text block.

Putting each SPICE directive on it's own line adds clarity for me so perhaps it would be possible to detect a new line and then a period to separate directives? You can see the project I uploaded and mentioned above.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Evan,

The use case you describe in post #5 should be already fixed by commit d5ee3296. I consider restoring the old-style Spice directives that were surrounded with +pspice..-pspice lines, but I am not sure if there is a point in doing this.

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.