Repository navigation
Commit 1fcd565
Make KLayout an optional dependency
KLayout is a heavy end-user GUI tool that was previously required to
complete the ORFS flow. The `finish` target depended on GDS_FINAL_FILE
and `do-finish` called `do-gds`, meaning the flow could not complete
without KLayout installed — even though most use cases never need GDS.
This change decouples KLayout so it is only pulled in when explicitly
requested via `make gds` / `make do-gds`, following the existing
target naming pattern (place/do-place, finish/do-finish, gds/do-gds).
Makefile changes:
- Remove $(GDS_FINAL_FILE) from `finish` dependencies
- Remove do-gds from `do-finish` recipe
- Add explicit `gds` phony target
- Add `check-klayout` guard on all KLayout-dependent targets
(GDS merge, DRC, LVS, gallery, klayout viewer shortcuts)
The interface is backwards compatible: `make finish gds` produces GDS
as before, `do-gds` is unchanged, and bazel-orfs can invoke `do-gds`
from a new `orfs_gds()` rule while `do-final` no longer requires
KLayout in the toolchain.
Extract .lyt tech file generation from sed to Python:
- The do-klayout and do-klayout_wrap targets previously used fragile
sed-based XML manipulation with shell variable expansion and
ifeq/else branching. New util/generate_klayout_tech.py replaces
this with stdlib xml/regex processing (no KLayout dependency).
Refactor def2stream.py for testability:
- Extract logic into merge_gds() function with pya as a parameter
- Guard `import pya` so the module can be imported without KLayout
- When run via `klayout -r`, the script behaves identically using
klayout's -rd global variables
Add mock-based unit tests (34 tests, no KLayout needed):
- test_generate_klayout_tech.py: .lyt generation including validation
against real platform templates (nangate45, asap7, sky130hd)
- test_def2stream.py: cell clearing, VIA_ preservation, orphan
detection, GDS_ALLOW_EMPTY regex, seal file merging, error counting
- test_convertDrc.py: DRC report conversion (box/edge/text violations,
waived items, comment assembly)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 294e641 commit 1fcd565
8 files changed
Lines changed: 1318 additions & 102 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
206 | 205 | | |
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
210 | 209 | | |
211 | 210 | | |
212 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
213 | 217 | | |
214 | 218 | | |
215 | 219 | | |
| |||
594 | 598 | | |
595 | 599 | | |
596 | 600 | | |
597 | | - | |
598 | | - | |
| 601 | + | |
599 | 602 | | |
600 | 603 | | |
601 | 604 | | |
| |||
627 | 630 | | |
628 | 631 | | |
629 | 632 | | |
630 | | - | |
| 633 | + | |
631 | 634 | | |
632 | 635 | | |
633 | 636 | | |
| |||
643 | 646 | | |
644 | 647 | | |
645 | 648 | | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
646 | 660 | | |
647 | 661 | | |
648 | 662 | | |
| |||
658 | 672 | | |
659 | 673 | | |
660 | 674 | | |
661 | | - | |
| 675 | + | |
662 | 676 | | |
663 | 677 | | |
664 | 678 | | |
| |||
768 | 782 | | |
769 | 783 | | |
770 | 784 | | |
771 | | - | |
| 785 | + | |
772 | 786 | | |
773 | 787 | | |
774 | 788 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
0 commit comments