From 12af5ac96db9fab7d3496a8c096df01039548c36 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Fri, 8 Nov 2024 15:55:09 +0200 Subject: [PATCH] fix(sky130_density_fix): don't update project GDS if there are no cells to replace --- sky130_density_fix/replace_decap.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sky130_density_fix/replace_decap.py b/sky130_density_fix/replace_decap.py index 9dfc073b..3f6e67b4 100644 --- a/sky130_density_fix/replace_decap.py +++ b/sky130_density_fix/replace_decap.py @@ -80,8 +80,11 @@ def cell_dimensions_equal(cell1, cell2): inst.cell = replacement_cell replacements += 1 -print(f"Replaced {replacements} cells out of {matches} matches.") -print(f"Writing to {output_gds}...") +if replacements > 0: + print(f"Replaced {replacements} cells out of {matches} matches.") + print(f"Writing to {output_gds}...") + user_layout.write(output_gds) + print("Done.") +else: + print(f"No cells replaced.") -user_layout.write(output_gds) -print("Done.")