It looks like you're new here. If you want to get involved, click one of these buttons!
I have a script that iterates through certain layout cells and clears them (so that they can be replaced with different shapes):
for i in main_layout.each_cell(): if not i.is_top(): if not i.name.startswith("VIA"): i.clear()
But this loop takes a significant amount of time: more than a second per cell (my design has hundreds of cells).
I tried a different approach considering that my designs always have one top cell:
top_cell_index = main_layout.top_cell().cell_index() for i in main_layout.each_cell(): if i.cell_index() != top_cell_index: if not i.name.startswith("VIA"): i.clear()
This approach completes the whole loop in less than a second. Is
is_top() really that performance intensive? Is there a better way to execute this loop?