New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reload existing PCells without closing GUI #14
Comments
Prerequisites
Use case exampleOpen KLayout (in edit mode) and drag-and-drop, lets say, a Swissmon qubit into the layout. You will find the Swissmon qubit entry from bottom left Seemingly, there is no difference on the Swissmon already placed in the layout. However, by double-clicking the Swissmon you will notice that the PCell parameters can no longer be changed. Now drag-and-drop another instance of Swissmon. Now you will see that the Swissmon placed after pressing This should be changed so that after pressing How to get startedWhen Right now 0reload.lym only calls Implementation tipsFollowing are some of the methods from KLayout and KQCircuits API to help you implement this feature. We do not guarantee that the feature gets implemented using only these methods. You will need to reconstruct every PCell placed on every open layout of a KLayout window where the To iterate over each LayoutView use To retrieve the location of an instance use trans method to get a Trans object. This object contains the full transformation of the instance, including position, rotation, scale and mirroring. The instance can be converted into a PCellDeclaration object using the pcell_declaration method. If the method returns After reloading the library, iterate over each LayoutView again and retrieve their "Top Cell", suppose it's under the variable
Definition of done
More featuresAs outlined in above comment, it would be nice to have a mechanism that notices the change in the source files which would prompt KLayout to automatically perform library reload. We will leave this as a future task. You are welcome to submit an additional PR if you are interested in implementing this. |
It is a bit undefined what should happen if a default parameter value also changes in the code. We could either use the instance's parameter value or the new default value. In this case it is probably better to stick with the instance's value. Unless the instance was using the default parameter value then after reload it could use the new default value. |
The "KQCircuits -> Reload libraries" command apart from reloading the libraries also saves and re-creates all PCells in every view using the updated code but retaining all the parameter changes of the user. Fix #14
The "KQCircuits -> Reload libraries" command apart from reloading the libraries also saves and re-creates all PCells in every view using the updated code but retaining all the parameter changes of the user. Fix #14
If I edit a PCell source code and want to see the changes within KLayout application, I need to:
Would be nice if there was one less manual step and I would not need to make a new PCell. Instead:
Maybe after this issue we should have the follow up features:
The text was updated successfully, but these errors were encountered: