Nondeterministic reference designators when copying hierarchical sheets

Hello everyone!

I’m working on a project where I have 3 layers of hierarchical sheets:

  1. Main, has 8 of #2
  2. Group of 8 cells has 8 of #3
  3. Single cell

The “Single cell” sheet let’s just say has a single resistor in it.

After I make the first sheet for the single cell, in the “group of 8 cells” sheet I copy that sub-sheet for the single cell 8 times. If I go into each sub-sheet, they all have the correct reference designators, R1 through R8.

However, when I go to the main sheet, and I copy my “group 8 cells” sheet, the reference designators for the individual cells in that sheet sometimes go in order, and sometimes don’t.

As far as I can tell, I need these reference designators to proceed in the same order each time, so that when I use the “Place Footprints” tool to place them in a grid, the grid works as expected, as it proceeds in reference designator number order.

Also as far as I can tell, I need to use hierarchical sheets here because the “Replicate Layout” tool requires it.

Does anyone have any suggestions for how to make the automatic incrementing of the designators deterministic?

Thank you :slight_smile:

My KiCad version is:

Application: KiCad x86_64 on x86_64

Version: 8.0.1-rc2-202403121707~1b3cf70eef~ubuntu22.04.1, release build

wxWidgets 3.2.1
FreeType 2.11.1
HarfBuzz 2.7.4
FontConfig 2.13.1
libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.16

Platform: Ubuntu 22.04.4 LTS, 64 bit, Little endian, wxGTK, X11, KDE, x11

Build Info:
Date: Mar 12 2024 17:07:11
wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.74.0
OCC: 7.6.3
Curl: 7.81.0
ngspice: 42
Compiler: GCC 11.4.0 with C++ ABI 1016

The problem seems to be that the first 8_cell_row gets the sub pages in the right order, but all the ones after that seem to reorder the subpages with “cell 3” coming first.

Is that something I can manually edit at least for now?

  • Right-click in the hierarchy-navigator
  • get small context menu for the right-clicked sheet
  • edit page number

needs time and should be done at the end of the schematic drawing (to prevent drawing it xxx times).

If you are working more often with deeply nested hierarchical designs these open gitlab feature requests could be of interest:

I am a bit confused by your mention of: “Copying hierarchical sheets”.
You should not make copies of the sheets, but just create multiple links (hierarchical sheet boxes) that link to the same page (file). I guess you already know this, but I thought it’s worth mentioning just to be clear.

One option for annotation is to use *“First free after sheet number X 100” (or 1000)

This makes the numbers on each page unique and you can use sort orders also displayed in that dialog.

I have a heavily hierarchical design. I handle this in a totally different way.

I pretty much ignore the ref designators until i get the design placed and close to, if not fully routed. At that point I do a “Geographical Reannotate” followed by a “Update Schematic from PCB” followed by a “Update PCB from Schematic”.
Then rerun the Design Rule Checker with “Test for parity between PCB and Schematic” set to make sure that all went well.

That way my designators are all nicely organized and easy to find on the layout.
Moving around the hierarchical schematic shows the correct designators.

Just another option to consider…