Skip to content
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

Bugfix/issue 1907 #1910

Merged
merged 10 commits into from
Nov 26, 2024
Merged

Bugfix/issue 1907 #1910

merged 10 commits into from
Nov 26, 2024

Conversation

klayoutmatthias
Copy link
Collaborator

The bug is fixed by locking a Layout for updates while a RecursiveShapeIterator is active. Also, RecursiveInstanceIterator behaves the same.

Layout updates are responsible for recomputing cell bounding boxes, annotating hierarchies (e.g. computing parent instances, top cells and hierarchy-ordering of cells) and quad tree building.

While a Layout is locked, Layout#under_construction will return true. Layouts in that state can be written, but reading the mentioned information may not render the actual state.

A RecursiveShapeIterator will lock the layout it is on once it delivered the first item. The lock is released when it reaches end.

This has one consequence when coding scripts in Ruby: as in Ruby, the lifetime of an object is extended until the garbage collector removes it, pending instances of RecursiveShapeIterator may lock the layout and updates will not happen.

To mitigate this, _destroy can be use to explicitly remove the iterator when it is not used any longer.

On Python, this situation arises, if the iterator is kept in a variable. The iterator releases the lock when it gets destroyed - this happens when such a variable goes out of scope or is reassigned.

@klayoutmatthias klayoutmatthias linked an issue Oct 26, 2024 that may be closed by this pull request
Matthias Koefferlein added 3 commits October 26, 2024 22:46
…s now is possible also with a locked layout. Before, the instances were correctly iterated only if the layout could be sorted.
@klayoutmatthias klayoutmatthias merged commit 926dac9 into master Nov 26, 2024
24 checks passed
@klayoutmatthias klayoutmatthias deleted the bugfix/issue-1907 branch November 26, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iHP DRC causes segfaults randomly
1 participant