It looks like you're new here. If you want to get involved, click one of these buttons!
Noticed unexpected behavior when copying cells containing PCells. In the worst case, some layout content (structures and layers) is missing after the copy operation.
The test file is a GDS containing a top cell and several sub-cells, including both standard cells and PCells. The maximum hierarchy depth is 3.
1) Using Cell Copy into a New Layout
=> PCell content is not copied.
2) Using Cell Copy within the Current Layout
=> Newly added standard cells receive a "$1" suffix.
=> Newly added PCells are not copied. They do not receive the "$1" suffix and remain referenced to the source cells.
3) Selecting All Shapes
=> PCell content is not copied.
Newer KLayout versions provide the option:
File -> Setup -> Application -> Selection -> "PCell content is selectable"
(disabled by default).
When this option is enabled, it becomes possible to select and copy PCell geometry as described in Test Case 3.
Has anyone observed the same behavior?
Is this a known bug?
Comments
Hello,
I'm not sure what you mean by PCell content... When I copy a cell, I want all internal references to PCells to be kept with same the parameter settings... That's exactly what happens in cases 1-3 above (0.30.9)... You can convert PCells to static cells before doing the copy, then the copies of these cells are indeed real copies/duplicates but you loose the PCell format...
Cheers,
Tomas
Hi Tomas,
thanks for the reply.
I may have used the term "PCell content" ambiguously.
What I mean is the following:
My expectation for Deep Copy is that the complete hierarchy below the selected cell is copied. Whether the destination is a new layout (Case 1) or the same layout (Case 2), the result should be a fully self-contained copy of the hierarchy. The only difference should be that, in Case 2, the copied cells need a "$1" suffix to avoid name conflicts.
This is also why I suspect a regression. With KLayout 0.26.x, all three scenarios produced the expected result. The copied hierarchy was complete, including the geometry generated by the PCells.
Am I misunderstanding the intended behavior of "Deep Copy", or has the handling of PCells changed in newer KLayout versions?
Regards,
M.
Hello,
I don't see any empty PCells in version 0.30.9, all 3 cases work as intended with respect to PCell references...
PCells are generated by code so you cannot just get copies/duplicates of them during a deep copy. Therefore, PCells will never get a "$1" suffix, unless you convert them to regular/static cells first before doing the deep copy (Edit > Selection > Convert To Static Cell)...
Cheers,
Tomas
Hi @Signal23,
there is no known bug here.
I'd really appreciate if you could provide a working test case that allows reproducing the problem. It's very hard to guess what you are really doing. Specifically, as a PCell's behavior heavily depends in it's implementation which may be flawed. There are hundreds of possible ways how this could go wrong. For example, your library may be tied to a technology and it is not available in the new layout you create, because that uses a different technology.
You're also not saying which is the version you're using. 0.26.x is very old.
Regarding 2.): copies of library references don't receive the "$x" disambiguator even in deep copy mode, because they are essentially the same cell. You cannot go into that cell and change it, so a deep copy is not required. Yet you can change the PCell parameters of one cell which will make a PCell reference a new cell.
Regarding 3.): Have you enabled "Select top level objects" in the "View" menu? If not you will get a mix of shapes and instances, including
And finally regarding "PCell content is selectable": you can use that option to copy out PCell content to a different place. But only the shapes. And that of course does not preserve the PCell itself.
I have attached a sample file that uses PCells from the Basic library. I am not able to reproduce the problems you describe with that file. For example, I can copy the "TOP" or "C" cells into a new layout in "deep" mode without loosing the PCells.
Matthias