Discover and catalog PDK files, writing a reusable pdk.md summary to the PDK directory
Scan a PDK directory, identify all files required by the backend flow, confirm selections with the user, and write a pdk.md summary file to the PDK directory for use by /new-project.
Argument: $ARGUMENTS = path to PDK root directory.
If not provided, ask the user for the PDK path.
If $PDK_PATH/pdk.md already exists:
Run the following searches. Collect all candidate paths for each file type.
NDM libraries are directories, not files. A library such as is a directory containing internal files (e.g. ). Always search with to find the library root — never descend into it and pick an internal file.
.ndmstdcell.ndmreflib.ndm-type dPDK_PATH="$ARGUMENTS"
# Standard cell NDM — directories ending in .ndm (exclude phy_only and antenna variants)
find $PDK_PATH -type d -name "*.ndm" -not -path "*phy_only*" -not -path "*antenna*" | sort
# Physical-only NDM — directories ending in .ndm with phy_only in the path
find $PDK_PATH -type d -name "*.ndm" -path "*phy_only*" | sort
# Tech file
find $PDK_PATH -name "*.tf" | sort
# TLU+ parasitic files
find $PDK_PATH \( -name "*.TLUplus" -o -name "*.tluplus" \) | sort
# TLU+ layer map file
find $PDK_PATH \( -name "*.itf" -o -name "*.map" \) | grep -i "tlu\|itf\|layer" | sort
# Timing DB files (look for tt, ss, ff corners)
find $PDK_PATH -name "*.db" | sort
# Symbol DB files
find $PDK_PATH -name "*.sdb" | sort
# StarRC TCAD grid files (worst and best corners)
find $PDK_PATH -name "*.nxtgrd" | sort
# Antenna rules TCL
find $PDK_PATH -name "*.tcl" | xargs grep -l "define_antenna_rule\|define_antenna_layer_rule" 2>/dev/null | sort
Present a table of the best candidate for each required variable. If multiple candidates exist for a slot, list all options and ask the user to choose.
=== PDK Discovery: $PDK_PATH ===
| Variable | Selected Path |
|-----------------------|----------------------------------------|
| NDM_REFERENCE_LIB | ... |
| NDM_REFERENCE_LIB_PHY_ONLY | ... |
| TECH_FILE | ... |
| MAX_TLUPLUS_FILE | ... (worst-case corner) |
| TYP_TLUPLUS_FILE | ... (typical corner) |
| MIN_TLUPLUS_FILE | ... (best-case corner) |
| TLUPLUS_MAP_FILE | ... |
| DB_TT_FULL_PATH | ... (TT corner timing DB) |
| DB_SS_FULL_PATH | ... (SS corner timing DB) |
| TARGET_LIBRARY | ... (basename of TT .db) |
| DB_DIR | ... (directory of .db files) |
| SYMBOL_LIBRARY | ... (basename of .sdb) |
| SDB_DIR | ... (directory of .sdb files) |
| TCAD_GRD_WST | ... (worst nxtgrd) |
| TCAD_GRD_BST | ... (best nxtgrd) |
| ANTENNA_RULES_TCL | ... |
Heuristics for corner identification:
tt (case-insensitive)ssmax, worst, or rcworsttyp, typical, or rctypicalmin, best, or rcbestwst, worst, or maxbst, best, or minAsk the user to confirm or correct the selection before writing.
If any required file is not found, flag it clearly:
Missing: ANTENNA_RULES_TCL — no TCL file with antenna rule definitions found in $PDK_PATH. You must provide this path manually before using
pdk.mdwith/new-project.
All paths in pdk.md are written relative to $PDK_PATH (i.e., relative to the directory containing pdk.md). This keeps the file portable if the PDK is remounted at a different absolute location.
Convert each confirmed absolute path to a relative path before writing:
realpath --relative-to="$PDK_PATH" /absolute/path/to/file
TARGET_LIBRARY and SYMBOL_LIBRARY are basenames only (no path component) — write them as-is.
Write $PDK_PATH/pdk.md using this exact format so /new-project can parse it reliably:
# PDK Summary: <basename of PDK path>
<!-- Generated by /discover-pdk on <date>. Paths are relative to this file's directory. Edit manually to correct. -->
## Library Configuration
| Variable | Value |
|----------|-------|
| DB_DIR | rel/path/to/db/dir |
| SDB_DIR | rel/path/to/sdb/dir |
| TARGET_LIBRARY | tt_corner.db |
| SYMBOL_LIBRARY | stdcell.sdb |
## Physical Libraries
| Variable | Value |
|----------|-------|
| NDM_REFERENCE_LIB | rel/path/to/stdcell.ndm |
| NDM_REFERENCE_LIB_PHY_ONLY | rel/path/to/stdcell_phy_only.ndm |
| TECH_FILE | rel/path/to/tech.tf |
## TLU+ Parasitics
| Variable | Value |
|----------|-------|
| MAX_TLUPLUS_FILE | rel/path/to/max.TLUplus |
| TYP_TLUPLUS_FILE | rel/path/to/typ.TLUplus |
| MIN_TLUPLUS_FILE | rel/path/to/min.TLUplus |
| TLUPLUS_MAP_FILE | rel/path/to/map.itf |
## StarRC
| Variable | Value |
|----------|-------|
| TCAD_GRD_WST | rel/path/to/worst.nxtgrd |
| TCAD_GRD_BST | rel/path/to/best.nxtgrd |
## Timing Corners
| Variable | Value |
|----------|-------|
| DB_TT_FULL_PATH | rel/path/to/tt_corner.db |
| DB_SS_FULL_PATH | rel/path/to/ss_corner.db |
## Constraints
| Variable | Value |
|----------|-------|
| ANTENNA_RULES_TCL | rel/path/to/antenna_rules.tcl |
If a variable has no value (file not found and not provided by user), write MISSING as the value. /new-project will warn on any MISSING entries.
Report the path to the written file and next steps:
PDK summary written to: $PDK_PATH/pdk.md
Next step: run /new-project <pdk-path> <project-path> <design-name>