delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2024/04/29/09:07:06

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] Gschem refdes autonumber over multiple pages?
In-reply-to: <37de350c-1e5f-422f-b13a-c5a9a1e132ac@linetec.nl>
References: <37de350c-1e5f-422f-b13a-c5a9a1e132ac AT linetec DOT nl>
Comments: In-reply-to "Richard Rasker (rasker AT linetec DOT nl) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
message dated "Mon, 29 Apr 2024 13:19:10 +0200."
Mime-Version: 1.0
Message-Id: <20240429130455.F01EF81AB8C5@turkos.aspodata.se>
Date: Mon, 29 Apr 2024 15:04: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

Richard:
> I'm working on a project with several gschem-pages, based on an older, 
> existing schematic from someone else. I'm asked to add extra components 
> to these schematic pages, however while preserving the RefDes-numbering 
> of the older parts.
> 
> This presents the problem that autonumbering in one page is not aware of 
> the numbering in other pages, so new components tend to get numbers that 
> are already in use in other pages, which is only signalled when I import 
> them into PCB.

Well, lepton/geda doesn't really support a global numbering of 
components. It only supports hierarchical numbering, i.e. instead of
using R1 to R9999, it uses a/R1, a/R2 etc for subpage a, b/R1 etc for
subpage b, and so on. This also works for subsubpages e.g. c/x/R1.

You can get a global numbering (in lepton) if you don't use the same 
subpage twice or more, uses an empty refdes-attribute-separator, an
empty refdes in the source symbol, and handle the numbering yourself.
Well, it is a little painful.

> Is there a way to make gschem aware of all existing pages in a project?

You could perhaps write a plugin or some external program.

> Obviously, merely having those pages opened in the Page Manager doesn't 
> do the trick. I saw some references to defining a hierarchy and 
> sub-schematics, but I'm not sure if that is what I need (also, the wiki 
> page seems broken: wiki.geda-project.org/geda:hierarchy).

 I have a simple example in:
https://aspodata.se/git/openhw/test_files/hier_design/01_simple/

 With hierarchical (isn't there a easier word for this?) design, you
use a symbol which has an attribute "source=<file>" where <file> is 
the name of the sub page. The connections from the top.sch and the 
sub.sch is using pins in top.sch and net symbols in sub.sch.
Each pin in top.sch with label "A" is connected to the net-symbol with
refdes "A" in sub.sch (I think gschem prefer the use of portname 
instead) and so on.

In the net file, the final refdes will be a combination of the source 
symbols' refdes and the sub.sch's component refdes.

Since I prefer short refdes' and am using lepton, I tell lepton to not
insert any character between top and sub strings for refdeses:

$ cat lepton.conf 
[netlist.hierarchy]
refdes-attribute-separator=

> I'd say it should be as simple as enumerating all project .sch files in 
> one place, but I can't find anything like this.

It woldn't be that difficult to list all refdeses, generating a bom 
would be one way.

Regards,
/Karl Hammar


- Raw text -


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