-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwatch_build.sh
More file actions
executable file
·51 lines (40 loc) · 1.13 KB
/
watch_build.sh
File metadata and controls
executable file
·51 lines (40 loc) · 1.13 KB
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
#!/bin/bash
# Example usage (from bfg root dir):
# sudo inotifywait -r -e modify -m src | while read dir action file; do ./watch_build.sh; done
BUILD_DIR=watch_build
PID_FILE=klayout.pid
PROTO2GDS_BIN="${HOME}/src/Layout21/target/debug/proto2gds"
#TECH='sky130.technology.pb'
TECH='gf180mcu.technology.pb'
#IN_GDS='library'
IN_GDS='gf180_mux'
TOP=
mkdir -p "${BUILD_DIR}" || exit 1
cat << EOF > ${BUILD_DIR}/view_script.py
import gdspy
lib = gdspy.GdsLibrary(infile='${IN_GDS}.gds')
tops = lib.top_level()
for cell in tops:
filename = f'library.{cell.name}.svg'
cell.write_svg(filename)
print(f'wrote {filename}')
EOF
cmake -S . -B "${BUILD_DIR}" || exit 2
cmake --build "${BUILD_DIR}" -j $(nproc) || exit 3
"${BUILD_DIR}"/bfg \
--technology sky130.technology.pb \
--external_circuits sky130hd.pb \
--logtostderr --v 2 || exit 4
#--technology "${TECH}" \
"${PROTO2GDS_BIN}" \
-i "${IN_GDS}".pb \
-t "${TECH}" \
-o "${IN_GDS}".gds || exit 5
python3 "${BUILD_DIR}/view_script.py"
#if [ $? -eq 0 ]; then
# if [ -f "${PID_FILE}" ]; then
# pkill -F "${PID_FILE}"
# fi
# klayout library.gds &
# echo $! > "${PID_FILE}"
#fi