Mail Archives: geda-user/2024/04/30/04:40:52
Hello Karl,
Thank you for your explanation. So there is no easy solution that I
overlooked. This hierarchical numbering seems rather complicated; I
think I'll follow upĀ on your suggestion and write a simple script that
maintains a list of all RefDes-attributes in all relevant page files,
and simply coughs up the next free RefDes for the most common categories
of components (R, C, L, U, Q).
It's a bit of a hassle with saving gschem files(*) and then invoking the
script when numbering a new component, but less so than having to
stumble upon duplicate numbers all the time when importing in PCB, and
going back and seek out the next free one by hand.
*: I guess there isn't an external command for saving the currently
opened files from the command line? Or is there? Then I could
incorporate it in my script, prior to updating the list.
Thanks again,
Regards,
Richard
Op 29-04-2024 om 15:04 schreef karl AT aspodata DOT se [via geda-user 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
>
>
Met vriendelijke groeten,
Richard Rasker
--
Linetec
Akkerstafhof 15
7544SP Enschede
053-4350834
http://www.linetec.nl/
- Raw text -