Updating schematic sheet cross references

In a design where there are multiple schematic sheets in a flat hierarchy the global connection symbols with sheet cross references do not update automatically when deleting schematic sheets or re-arranging them in different order. How does one go about getting the cross references to update when changing the schematics?
-Jeff

ps: Noticed today that when editing my schematics the sheet cross references on newly instantiated global symbols are incorrect for sheets past the originally deleted schematic sheet. So somewhere there is a stale cache or table that is used to annotate the cross reference indexes on the global labels. How to update this so all the cross references are correct?

So after the long silence here I will share how I got things all fixed:

  1. Adjust the page number of each schematic sheet to the desired ordering.
  2. Exit KiCad and grab a text editor and reorder the “sheets”: [… tokens where they are listed at the end of the *.kicad_pro file to match the order of the numbered sheets.
  3. Restart KiCad and all the intersheet references should now be correct.
1 Like

First, thank you for reporting back.

Recently, there was another user with mixed up inter-sheet references:

Inter-sheet reference error

A bit of searching on gitlab also finds several open issues:

Because of this, I put some effort into it to experiment with this in a test project.
I have managed to reproduce this. Even compared it with the order sheets are listed in the project file, but I saw no correlation between this and the bug.

Purely by accident, I re-arranged the position of the sub sheets in the root sheet, and this changed the references.

In this screenshot Res_Sheet_AAA points to 33

And then, just by moving Sheet_XXX a bit to the right, Res_Sheet_AAA points to page 44

This is now clearly a bug, and easy to reproduce. So after finishing this post, I will continue on gitlab, to either create a new issue, or append it to one of the other issues. For now, I will also unmark your (own) post as the solution. This is not solved yet.

2024-08-12T15:22_asdf_sheet_reference.zip (14.4 KB)


Edit / Update: I suspect all are related, but created a new issue anyway (but added links to all I found). The new issue I created is:

Interesting… Moving things around on the root sheet did NOT work for me, that was the first thing I tried.

I created another, simpler test project, just created everything in order, no page renumbering or other things at all, and it shows the same behavior: Horizontal order of the sub sheets on the root sheet changes the inter-sheet references / page numbers.

2024-08-12_asdf_sheet_ref_2.zip (7.1 KB)

You write you did not see this behavior in your own project, can you verify this same problem shows with my test projects on your PC? I am Using KiCad V8.0.4 on Linux Mint.

Application: KiCad x86_64 on x86_64

Version: 8.0.4-8.0.4-0~ubuntu20.04.1, release build

Libraries:
	wxWidgets 3.2.2
	FreeType 2.10.1
	HarfBuzz 2.6.4
	FontConfig 2.13.1
	libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3

Platform: Linux Mint 20.3, 64 bit, Little endian, wxGTK, X11, xfce, x11
OpenGL: AMD, AMD RENOIR (DRM 3.42.0, 5.15.0-117-generic, LLVM 12.0.0), 4.6 (Compatibility Profile) Mesa 21.2.6

Build Info:
	Date: Jul 17 2024 01:37:21
	wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
	Boost: 1.71.0
	OCC: 7.6.3
	Curl: 7.68.0
	ngspice: 42
	Compiler: GCC 9.4.0 with C++ ABI 1013

Build settings:

Ah Hah, the sub sheets on my schematic root sheet are arranged VERTICALLY. I’m also on 8.0.4 on Ubuntu 24.04. Let me try your test app.

Hmm… And the intersheet references seem to respond when the names are reordered in the vertical direction as well. Things went south in my design of 19 sheets when I deleted a sheet. On newly added sheets numbered above the deleted sheet all their intersheet references would be wrong when creating new labels, and of course nothing would shuffle when I moved the root sheet names of the other sheets around. Maybe the real issue here is there needs to be a simple way to delete a sheet from a design, or else figure out what is getting leftover when a sheet is deleted.

To clarify this a bit one might wonder why I would need to delete a sheet or to shuffle page numbers around. In a large complicated design the circuit takes shape over time. If it’s a module baseboard for example I usually start with the symbol(s) for the cpu module in use, then work on the power supplies, then peripherals, maybe do power direction next, or battery charger, whatever. Point is the functions get worked on or developed in a more or less random fashion. But once it mostly all comes together I like to rearrange the sheets in a different order to improve the flow of the design and logically group functions, not the order in which they were created. And if a sheet gets completely emptied of components by moving bits and pieces to other sheets during the checking and editing process then why leave a blank sheet in the design? If we are going to have intersheet refs change depending on the placement of their respective sheet names on the root sheet then we’d better come up with a way to change the page numbers on the schemos automatically as well.

Because of this I created the second asdf_sheet_ref_2 project. I did not delete anything in that sheet. Just created sheets and labels, and all in order. I did not even delete a single label, and it still shows the inter-sheet references changing when changing the horizontal order of the sheet.

No, I see no useful information in your followup post. It is completely irrelevant why you would want to delete objects, re-orient sheets, etc. Those are all normal refactoring operations and should all “just work”. My second example still shows the renumbering bug while no refactoring at all has been done in that project, so refactoring is either a red herring, or it exposes another bug.