"+" for SPICE line continuation in Eeschema text entry not working in 5.0.1

Bug #1797937 reported by Steve Wood
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
Maciej Suminski

Bug Description

For example:

.param Cout=5p Rout=10k
+ Lout=1u Rin={5*Rout}

no longer works. Only the 1st line will show up in the SPICE netlist. This did work before, so now I have some broken schematics. I can't say for certain if it was the switch to 5.1 that broke this feature, but I don't see what else it could have been.

Application: kicad
Version: 5.0.1-33cea8e~66~ubuntu18.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-36-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.65.1
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.58.0
    Compiler: GCC 7.3.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=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

summary: "+" for SPICE line continuation in Eeschema text entry not working in
- 5.1
+ 5.0.1
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Orson, I thought this was fixed at least in the dev branch. Did the fix not cherry picked back to the 5.0 branch?

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

Wayne, as far as I remember it has never been implemented in the new Spice netlist importer. It should not be difficult, I can fix it for 5.0.2.

Changed in kicad:
assignee: nobody → Maciej Suminski (orsonmmz)
Revision history for this message
Steve Wood (steve+ubuntu) wrote :

Perhaps this is related. The following lines in Eeschema text no longer work:

 .control
 write ~/KiCAD/Projects/MySch.raw all
 .endc

I get the error "No such file or directory".

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Orson, maybe I'm thinking of .control/.endc bug report.

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

Wayne, then it is a part of 5.0.1 release (commit 27b88be6).

Steve, does it work if you use a full path? Does the directory exist? Did it use to work in previous versions?

Revision history for this message
Steve Wood (steve+ubuntu) wrote :

Maciej,

I have tried using a full path as well as with "~" for "home", but it still does not work. Yes, it did work in the previous version.

I've isolated the problem to case-sensitivity. If I use a path with all lower case, then everything works, even when using "~" for "home". The clue was that the error message was showing the correct path, but converting upper-case characters to lower-case.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Steve, if this worked in the past, it was a bug. File and path names on posix systems are case sensitive so changing the case internally is (was) a really bad idea. I don't know what spice expects but it cannot dictate file name case semantics to the underlying OS. If you need you spice simulations to be portable across platforms, the file and path name case must be correct.

Revision history for this message
Steve Wood (steve+ubuntu) wrote :

@Wayne

I think you may have misunderstood my comment. I will try to clarify. In the past, this did work with paths properly written (verbatim, including proper case). When I said "If I use a path with all lower case, then everything works..." I meant a verbatim path that truly was all lower case. I did not mean a path with case stripped. As you point out, this is of course a nonstarter in Posix. Examples:

~/temp/filename.raw **This works
~/KiCAD/filename.raw **This fails

Using
~/kicad/filename.raw
when I want the raw file to be placed in
~/KiCAD/filename.raw
will of course fail.

The KiCAD GUI for NGspice is reporting back an error "No such file or directory", and when it does so, the error message displays the path converted to all lower case. This was just a clue for me to investigate. I suspect that somewhere in the code, case for the path is being stripped.

Revision history for this message
jean-pierre charras (jp-charras) wrote :

I confirm directive strings (comments starting by ".") are wrongly converted to lower case.
It can breaks any filename (for instance library names in .include).

Changed in kicad:
status: New → Confirmed
Revision history for this message
jean-pierre charras (jp-charras) wrote :

Hi Orson,

Are you working on it (I see this bug is assigned to you)?

I have a small fix ready for this bug.

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

Jean-Pierre,

I have not started yet, please push your changes and I will continue from there if necessary. Thank you!

Revision history for this message
jean-pierre charras (jp-charras) wrote :

I committed a fix for lowercase conversion issue in rev 8f9b0f0235351d487b56a31d97d544ef164cc937

There are 2 different issues in this report, so marking it as "fixed" is not easy.

I do not remember continuation line notation like + Lout=1u Rin={5*Rout} was existing in spice netlist generation.
lines like +spice Lout=1u Rin={5*Rout} were used in 4.0 version.

What is the version that worked?

Changed in kicad:
status: Confirmed → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

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

Changed in kicad:
status: In Progress → Fix Committed
Changed in kicad:
milestone: none → 5.0.2
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.