Skip to content

Make check-klayout an order-only prereq of merged GDS#4296

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:fix-gds-rebuild-check-klayout
Jun 17, 2026
Merged

Make check-klayout an order-only prereq of merged GDS#4296
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:fix-gds-rebuild-check-klayout

Conversation

@maliberty

Copy link
Copy Markdown
Member

Problem

Running make finish (or make metadata, which depends on finish) repeatedly re-runs the KLayout def2stream GDS merge every single time, even when nothing upstream changed.

Root cause

The phony check-klayout target was a normal prerequisite of $(GDS_MERGED_FILE):

$(GDS_MERGED_FILE): check-klayout $(RESULTS_DIR)/6_final.def ...

A phony prerequisite has no file on disk, so Make treats it as always newer than the target — forcing the merge recipe to run on every invocation regardless of timestamps. The re-merge then cascades into the $(GDS_FINAL_FILE) copy and downstream finish/metadata work.

Fix

Move check-klayout behind | so it's an order-only prerequisite. The KLayout availability check still runs when the GDS actually needs building, but its phony status no longer marks the GDS perpetually out-of-date.

The klayout_% viewer shortcuts at the other check-klayout use-site are intentionally left unchanged — those targets are themselves .PHONY (interactive viewers meant to run on demand).

Verification

make finish -n on an already-built nangate45/gcd/base no longer schedules do-gds-merged/def2stream, whereas before the fix it did on every run.

The phony check-klayout target was a normal prerequisite of
$(GDS_MERGED_FILE), which forced the KLayout def2stream merge to re-run
on every `make finish`/`make metadata` invocation regardless of whether
the GDS inputs had changed. Moving it behind `|` keeps the KLayout
availability check when the GDS needs building, without marking the GDS
perpetually out-of-date.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty maliberty self-assigned this Jun 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the flow/Makefile to make check-klayout an order-only prerequisite for the $(GDS_MERGED_FILE) target. This prevents unnecessary rebuilds of the merged GDS file when the check-klayout target is executed. There are no review comments, and I have no additional feedback to provide.

@maliberty maliberty merged commit 46c636c into The-OpenROAD-Project:master Jun 17, 2026
8 checks passed
@maliberty maliberty deleted the fix-gds-rebuild-check-klayout branch June 17, 2026 05:08
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.

1 participant