It looks like you're new here. If you want to get involved, click one of these buttons!
What is the criteria which cell will be on top?
It does not look like an alphabetical order, I try to avoid having scripts and .lym session files to keep the top cell setting.
Comments
Isn't it the cell that was visible at the time of saving the file? Can you check? (I didn't).
There can be multiple 'top' cells. Top just means that a cell has no parent cell. Which is usually the case when you write/export a gds file.
Some documentation: (ctrl-f top and you'll find it)
https://www.klayout.de/doc-qt5/programming/database_api.html
And here's a good article about gdsII format:
https://www.artwork.com/gdsii/gdsii/
Sadly I don't know how kLayout picks a top cell if there are multiple of them...
I can tell
When there are multiple top cells, KLayout picks the one with the largest bounding box for initial display. GDS does not have a way of saying which is the primary top cell. Also, GDS files with multiple top cells are common only in certain contexts (e.g. as a collection of library cells). A design ready for tapeout should never have multiple top cells.
Matthias
Many orgs seem to have a habit of calling the
top cell "TopCell". When you do part after part
after part, you can stand to lose a few repetitive
questions. If you get to name the baby, then you
might develop a habit that saves thought. I will
often designate "real important stuff" with a
"00_blahblah" type name so that alpha ascending
sort will bubble them to the top. That's personal,
not common practice, but works for me. Also
tagging stale versions with date suffix (rename
and copy-back) gives me a "trail" that is poor boy
"versioning".
Or make a "TopCell" or "00_Top" layout that has
placed, the "real" one and just push in. Change
your mind? 00_Top2.