group buses incorrectly handle braces

Bug #1840834 reported by Brendan Haines
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Undecided
Jeff Young

Bug Description

When using {braces} notation of buses, the first name gets messed up by the open brace.

BUSNAME{A B C}
should mean a bus with 3 members: "A", "B", and "C"
it instead is interpreted as having members: "brace}A", "B", and "C"

This incorrect interpretation is applied as follows:
Labels and hierarchical ports add "brace}" invisibly as above.
Hierarchical sheet pins act differently. Using the "import hierarchical sheet pin" automatically inserts "brace}" which (unlike labels/ports) can be seen and removed by editing the pin but does not appear in the text in the schematic.

My current workaround is to add an extra bus member "A" to the beginning of every bus and add "brace}" to every hierarchical sheet pin.

To connect using a bus from within one hierarchical sheet to another requires the following names:
wire BUSNAME.B
bus BUSNAME{A B}
hierarchical label BUSNAME{A B}
hierarchical sheet pin BUSNAME{brace}A B} << Note this is different
bus BUSNAME{A B}
wire BUSNAME.B

I will follow up with some pictures.

Ubuntu 19.04

Application: Eeschema
Version: 6.0.0-unknown-0ba0c17~100~ubuntu19.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.8.6/openssl/zlib nghttp2/1.36.0 librtmp/2.3
Platform: Linux 5.0.0-25-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: GCC 8.3.0 with C++ ABI 1013
Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Tags: eeschema
Revision history for this message
Brendan Haines (brendanhaines) wrote :
Revision history for this message
Brendan Haines (brendanhaines) wrote :

Bus

Revision history for this message
Brendan Haines (brendanhaines) wrote :

Hierarchical label

tags: added: eeschema
Jon Evans (craftyjon)
Changed in kicad:
assignee: nobody → Jon Evans (craftyjon)
milestone: none → 6.0.0-rc1
Revision history for this message
Jeff Young (jeyjey) wrote :

@Jon, this is running into the string-escaping mechanism which allows you to insert characters like '/' into netnames. We use the brace as the control delimiter.

There are two ways around this: we could stop escaping braces (and hope no one ever tries to make a bus with a single "tab", "slash", etc. member, or we could change the bus delimiters to '[' and ']'.

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

@Jeff, wouldn't the correct solution be to unescape the text between the curly brackets before net parsing? This way "{forward-slash}" would be converted to "/" which would not confuse the net parser.

Revision history for this message
Jeff Young (jeyjey) wrote : Re: [Bug 1840834] Re: group buses incorrectly handle braces

If we’re going to keep ‘{‘ and ‘}’ as system characters in netnames, then those characters shouldn’t be escaped at all.

We can’t unescape ‘/‘ because it also means something to the net parser (a sheet path).

Revision history for this message
Jon Evans (craftyjon) wrote :

Jeff, the spec for the bus list was made using braces because square brackets are already used for vector buses and we didn't want to support infinite nesting.

In other words, you can do BUS{SUBBUS[7..0] NET1 NET2} but not BUS[SUBBUS[SUBBUS[7..0] NET1] NET2] or something like that.

(I have not had a chance to dig in to this much yet because I'm traveling this week, but I think Jeff's commit fb1d7811 introduced this problem while likely fixing a different problem -- Jeff can you elaborate on what problem you were fixing in fb1d7811 so I know what to look for?)

Revision history for this message
Jeff Young (jeyjey) wrote :

@Jon, ah, I see so we're using *both* brace styles.

Fair enough, I'll patch it up to not escape curly braces in netnames.

Jeff Young (jeyjey)
Changed in kicad:
assignee: Jon Evans (craftyjon) → Jeff Young (jeyjey)
status: New → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

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

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Jeff Young (jeyjey) wrote :

@Brendan & @Jon,

I don't use buses so I just did some basic testing; if you guys could give my fixes a run that would be great.

Cheers,
Jeff.

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.