Easy way to refactor part of schematic into a hierarchy page?

I made a schematic and it ended up having a subcircuit duplicated 8 times. Is there an easy way to select one sub circuit and “extract” it into a sub page?

Or do I need to make the sub page, cut and paste, etc…?

In general you will still have eight small boxes of some kind.
The only difference is that they all point to the same source.

  • Cut one of those identical sections in your referencing sheet
  • Create a new hierarchical sheet, enter it and paste previous cut
  • Assign hierarchical pins as required.
  • With that you then create another 7 hierarchical sheet entries on your referencing sheet
    pointing to the same source (file name).
  • After that you will need to re-annotate component designators in all hierarchical sheets.
  • On your referencing sheet right click in each hierarchical sheet box to import the sheet pins, which then can be wired accordingly.

Perfect, thanks! Much appreciated!

Or do it for only one and then block copy the instantiated sheet -> no need to import it 7 times.

1 Like

That’s exactly what I meant to convey. Didn’t seem work too well.
Irregardless I need multiple blue boxes pointing to the same source, right?
Perhaps I miss some nitty gritty details here. Please help me out if I do.

The full details are described in Hierarchical or flat schematic design, what is best for me? (How to deal with multi page schematics?) (videos towards the end)

Hi folks - good news bad news here - updating my schematic to use hierarchy was really pretty easy and worked well. I re-annotated on all sheets and everything seems great.

But then just to be certain I went to pcbnew and reloaded a rebuilt ratsnest and a bunch of parts came in again and the ratsnest was a cluster (where it had been completely connected before introducing the hierarchy). I also tried just running update pcb from schematic but that did the same thing.

I did validate that before I made the changes the board and schematic were in sync even if I reloaded the ratsnest - so it’s definitely introducing the hierarchy that’s throwing things off…

Is this to be expected? Do I really need to re build the whole board layout in order to finish this? (because then I might just choose to live with what I had…)

Thanks again in advance.

Kind of. By moving things into subsheets you destroy both the internal unique identifiers (timestamp) and the references that where used to tell kicad which symbol represents which footprint.

To keep a pcb in sync with such a massive change you will need to manually ensure that at least the references stay the same. (And then you need to tell the update dialog that you want to use the references instead of the timestamp.)

Ok thanks…how do I manually keep the references the same? Apologies if is obvious I didn’t see anything about how mappings would work…

Instead of using the automatic annotation you would need to manually enter the same reference for every used symbol as before the change. (By directly editing the refernces inside the schematic -> use hotkey e while hovering over the reference field)

It would however be really nice to have a cut -> paste feature that can preserve references (both the internal identifier and the visible one.) This is already requested https://bugs.launchpad.net/kicad/+bug/1837002 (The answer for current versions is you can’t easily do it)

Yuck. OK. Thanks. But how does manual assignment work within duplicated hierarchies? When I go into the subsheet won’t that set it for all instances of the subsheet?

Also, once set, if I ever add new parts, can I still annotate those automatically?

Every instance has its own set of references. (This is a must have for any software that supports multiple instantiation.)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.