Skip to content

Commit ebc4c8e

Browse files
committed
klayout: defer stream GDS validation
1 parent ec46523 commit ebc4c8e

1 file changed

Lines changed: 32 additions & 29 deletions

File tree

klayout/run_finishing.sh

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,6 @@ source "../env.sh"
2323
# Technology
2424
###############
2525

26-
lef_files="$(find "$PDK_DIR_LEF_TECH" -name "$PDK_TECH_LEF_FILE" -exec realpath {} \;) \
27-
$(find "$PDK_DIR_LEF_CELLS" -name "$PDK_STDCELL_LEF_FILE" -exec realpath {} \;) \
28-
$(find "$PDK_DIR_LEF_SRAMS" -name 'RM_IHPSG13*.lef' -exec realpath {} \;) \
29-
$(find "$PDK_DIR_LEF_IOS" -name "$PDK_IO_LEF_FILE" -exec realpath {} \;) \
30-
$(find "$PDK_DIR_LEF_BOND" -name "$PDK_BONDPAD_LEF" -exec realpath {} \;)"
31-
32-
gds_files="$(find "$PDK_DIR_GDS_CELLS" -name "$PDK_STDCELL_GDS_FILE" -exec realpath {} \;) \
33-
$(find "$PDK_DIR_GDS_SRAMS" -name 'RM_IHPSG13*.gds' -exec realpath {} \;) \
34-
$(find "$PDK_DIR_GDS_IOS" -name "$PDK_IO_GDS_FILE" -exec realpath {} \;) \
35-
$(find "$PDK_DIR_GDS_BOND" -name "$PDK_BONDPAD_GDS" -exec realpath {} \;)"
36-
37-
required_gds_files=(
38-
"$PDK_DIR_GDS_CELLS/$PDK_STDCELL_GDS_FILE"
39-
"$PDK_DIR_GDS_SRAMS/RM_IHPSG13_1P_512x32_c2_bm_bist.gds"
40-
"$PDK_DIR_GDS_IOS/$PDK_IO_GDS_FILE"
41-
"$PDK_DIR_GDS_BOND/$PDK_BONDPAD_GDS"
42-
)
43-
44-
for gds_file in "${required_gds_files[@]}"; do
45-
if [[ ! -f "$gds_file" ]]; then
46-
echo "[ERROR][KLayout] Missing required GDS: $gds_file" >&2
47-
if [[ "$CROC_TECHNOLOGY_VIEW" == "public mirror" ]]; then
48-
echo "[ERROR][KLayout] Download public GDS first: scripts/download_pdk_gds.sh" >&2
49-
fi
50-
exit 1
51-
fi
52-
done
53-
54-
5526
SEAL_RING_SPACE=42
5627

5728
##############################
@@ -100,7 +71,39 @@ supports_split_topmetal_fill() {
10071
}
10172

10273

74+
collect_def_to_gds_inputs() {
75+
lef_files="$(find "$PDK_DIR_LEF_TECH" -name "$PDK_TECH_LEF_FILE" -exec realpath {} \;) \
76+
$(find "$PDK_DIR_LEF_CELLS" -name "$PDK_STDCELL_LEF_FILE" -exec realpath {} \;) \
77+
$(find "$PDK_DIR_LEF_SRAMS" -name 'RM_IHPSG13*.lef' -exec realpath {} \;) \
78+
$(find "$PDK_DIR_LEF_IOS" -name "$PDK_IO_LEF_FILE" -exec realpath {} \;) \
79+
$(find "$PDK_DIR_LEF_BOND" -name "$PDK_BONDPAD_LEF" -exec realpath {} \;)"
80+
81+
gds_files="$(find "$PDK_DIR_GDS_CELLS" -name "$PDK_STDCELL_GDS_FILE" -exec realpath {} \;) \
82+
$(find "$PDK_DIR_GDS_SRAMS" -name 'RM_IHPSG13*.gds' -exec realpath {} \;) \
83+
$(find "$PDK_DIR_GDS_IOS" -name "$PDK_IO_GDS_FILE" -exec realpath {} \;) \
84+
$(find "$PDK_DIR_GDS_BOND" -name "$PDK_BONDPAD_GDS" -exec realpath {} \;)"
85+
86+
local required_gds_files=(
87+
"$PDK_DIR_GDS_CELLS/$PDK_STDCELL_GDS_FILE"
88+
"$PDK_DIR_GDS_SRAMS/RM_IHPSG13_1P_512x32_c2_bm_bist.gds"
89+
"$PDK_DIR_GDS_IOS/$PDK_IO_GDS_FILE"
90+
"$PDK_DIR_GDS_BOND/$PDK_BONDPAD_GDS"
91+
)
92+
93+
for gds_file in "${required_gds_files[@]}"; do
94+
if [[ ! -f "$gds_file" ]]; then
95+
echo "[ERROR][KLayout] Missing required GDS: $gds_file" >&2
96+
if [[ "$CROC_TECHNOLOGY_VIEW" == "public mirror" ]]; then
97+
echo "[ERROR][KLayout] Download public GDS first: scripts/download_pdk_gds.sh" >&2
98+
fi
99+
exit 1
100+
fi
101+
done
102+
}
103+
104+
103105
def_to_gds() {
106+
collect_def_to_gds_inputs
104107
run_cmd "mkdir -p out"
105108
run_cmd "echo [INFO][KLayout] Running LEF/DEF to stream"
106109
run_cmd "klayout -nc -rx -zz \

0 commit comments

Comments
 (0)