www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2021/09/26/09:58:15

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7+dev
X-Exmh-Isig-CompType: repl
X-Exmh-Isig-Folder: inbox
From: "karl AT aspodata DOT se [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] empty attributes
In-reply-to: <20210925194712.152EA8587FD0@turkos.aspodata.se>
References: <20210925133011 DOT D0B918587B70 AT turkos DOT aspodata DOT se> <alpine DOT DEB DOT 2 DOT 21 DOT 2109251919580 DOT 1189 AT nimbus> <20210925194712 DOT 152EA8587FD0 AT turkos DOT aspodata DOT se>
Comments: In-reply-to "karl AT aspodata DOT se [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
message dated "Sat, 25 Sep 2021 21:47:12 +0200."
Mime-Version: 1.0
Message-Id: <20210926135647.144558587FD6@turkos.aspodata.se>
Date: Sun, 26 Sep 2021 15:56:47 +0200 (CEST)
X-Virus-Scanned: ClamAV using ClamSMTP
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Karl:
...
> Is there any rationale to not to allow empty attributes
> (except that it isn't implemented) ?

http://wiki.geda-project.org/geda:file_format_spec#attributes
http://wiki.geda-project.org/geda:gschem_ug:attributes
 says attributes have the form "name=value",
http://wiki.geda-project.org/geda:master_attributes_list
  says
 Value can also be anything just as long as it is something
 (vs nothing). name= (without a value part) is not a valid
 attribute. Also, there cannot be any spaces immediately before
 or after the equals sign.

http://wiki.geda-project.org/geda:symbols
 says about the same, but also that you can use "unknown" to specify
 a empty value.

 So there already is support for empty attributes, beats me why you
 have to say "unknown" instead of just "". Also, it doesn't work.
  With files in http://aspodata.se/tmp/Test/attrib_unknown/
 both lepton-sch2pcb top.sch or gsch2pcb top.sch gives me:
$ cat top.net 
unnamed_net1    R3-2 unknownR1-1
unnamed_net2    R3-1 unknownR2-1
unnamed_net3    unknownR1-2 unknownR2-2
 (my uref separator is "")

 That information shouldn't be hidden in the symbols or
 master attributes page, instead it should move to the
 file format spec, but frankly, since it isn't in the spec,
 it shouldn't matter. The spec just says "name=value"
 without any more qualifications, so any value, even empty,
 should be legal and will comply with the "spec".

///

$ lepton-schematic --version
Lepton EDA/lepton-schematic 1.9.16.20210731 (git: 13cbc49)
$ gschem --version
gEDA 1.9.2 (g7b0ee03)
 Sorry, I cannot make newer gschem's to work, perhaps theese
 things are already fixed.

///

 With same files as above, adding a space to the refdes:
$ grep unknown top.sch | od -a
0000000   r   e   f   d   e   s   =   u   n   k   n   o   w   n  sp  nl
0000020

$ lepton-sch2pcb top.sch
...
$ cat top.net 
unnamed_net1    R3-2 unknown R1-1
unnamed_net2    R3-1 unknown R2-1
unnamed_net3    unknown R1-2 unknown R2-2
$ gsch2pcb top.sch
...
$ cat top.net 
unknown /unnamed_net4   unknown-R2 unknown-R1 unknown-Vdd 
unnamed_net2    unknown-R2 unknown-Vss R3-1 unknown-1 
unnamed_net1    unknown-R1 unknown-signal R3-2 unknown-3 

 works in lepton, but gives strange values in geda.
 I cannot find anything in the wiki that says a
 final space isn't permitted.
 ====

 Prepending a space:
$ grep unknown top.sch
refdes= unknown
$ lepton-sch2pcb top.sch
...
ERROR: In procedure %attrib-name:
ERROR: Throw to key `attribute-format' with args `("%parse-attrib" "~A is not a valid attribute: invalid string '~A'." (#<geda-object 0xdba698cac0> "refdes= unknown") ())'.
Failed to run netlister
$ gsch2pcb top.sch
...
$ cat top.net 
U?/unnamed_net4 U?R2-2 U?R1-2 
unnamed_net2    U?R2-1 R3-1 
unnamed_net1    U?R1-1 R3-2 

 makes lepton puke, geda just applies the default refdes.

 Honestly lepton folks, just saying that "refdes= unknown"
 is invalid with file name and line number of offending
 place should suffice, you provide to much info to help
 the user, and the file name and line number is missing.

 And geda folks, just stuffing in the default refdes,
 just makes the user scratching its head, just what in
 the **** went wrong.
 ====

 With a space in the middle:
$ grep known top.sch
refdes=un known
$ lepton-sch2pcb top.sch
...
$ cat top.net 
unnamed_net1    R3-2 un knownR1-1
unnamed_net2    R3-1 un knownR2-1
unnamed_net3    un knownR1-2 un knownR2-2
$ gsch2pcb top.sch
...
$ cat top.net 
un known/unnamed_net4   un-knownR2 un-knownR1 un-knownVdd 
unnamed_net2    un-knownR2 un-knownVss R3-1 un-known 
unnamed_net1    un-knownR1 un-knownsignal R3-2 un-known 

 works in lepton, but fails in geda.
 I cannot find anything in the wiki that says a space
 isn't permitted midstring.
 ====

 Now, thoose spaces will probably confuse any netlist reader
 downstream, so I don't know why they are allowed, required
 to be within citation marks or quoted.

 tEDAx is better in this regards,
$ lepton-netlist -g tEDAx -o top.tdx top.sch
...
$ cat top.tdx 
tEDAx v1
begin netlist v1 netlist
...
        footprint un\ knownR2 ipc7351b_1608Ar.fp
        device un\ knownR2 Resistor
        value un\ knownR2 1k

        conn unnamed_net1 R3 2
        conn unnamed_net1 un\ knownR1 1
...
end netlist
 so it would probably be best to drop the old netlist format
 and replace it with tEDAx.

Regards,
/Karl Hammar


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019