Skip to content

Commit 452c89f

Browse files
committed
ci: uses caches for PDKs
1 parent 2101ab1 commit 452c89f

File tree

3 files changed

+46
-75
lines changed

3 files changed

+46
-75
lines changed

.github/test_sets/test_sets.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- ./designs/ci/PPU
2626
- ./designs/ci/y_huff
2727
- ./designs/ci/aes
28-
# - scl: gf180mcuC/gf180mcu_fd_sc_mcu7t5v0
28+
# - scl: gf180mcuD/gf180mcu_fd_sc_mcu7t5v0
2929
# name: fastest_test_set
3030
# designs:
3131
# - spm
@@ -34,7 +34,7 @@
3434
# # - usb_cdc_core
3535
# # - zipdiv
3636
# # - wbqspiflash
37-
# - scl: gf180mcuC/gf180mcu_fd_sc_mcu7t5v0
37+
# - scl: gf180mcuD/gf180mcu_fd_sc_mcu7t5v0
3838
# name: extended_test_set
3939
# designs:
4040
# - ./designs/ci/picorv32a

.github/workflows/openlane_ci.yml

Lines changed: 37 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,40 @@ jobs:
1717
runs-on: ubuntu-22.04
1818
strategy:
1919
matrix:
20-
pdk: [sky130A, gf180mcuC]
20+
pdk: [sky130A]
21+
outputs:
22+
opdks_rev: ${{ steps.set-rev.outputs.opdks_rev }}
2123
steps:
2224
- uses: actions/checkout@v4
2325

2426
- name: Set up environment variables
2527
uses: ./.github/actions/set_env_variables
2628

29+
- name: Get Open PDKs Revision
30+
id: set-rev
31+
run: |
32+
echo "opdks_rev=$(python3 ./dependencies/tool.py open_pdks -f commit)" >> $GITHUB_OUTPUT
33+
34+
- name: Cache sky130 PDK
35+
uses: actions/cache@v4
36+
with:
37+
path: ${{ env.PDK_ROOT }}
38+
key: cache-${{ matrix.pdk }}-pdk-${{ steps.set-rev.outputs.opdks_rev }}
39+
enableCrossOsArchive: true
40+
2741
- name: Build (or Get) PDK
2842
run: |
2943
export PATH=$PATH:$(go env GOPATH)/bin
30-
export OPDKS_VER="$(python3 ./dependencies/tool.py open_pdks -f commit)"
3144
PDK=${{ matrix.pdk }}
32-
PDK_FAMILY=${PDK%?}
3345
3446
sudo mkdir -p ${{ env.PDK_ROOT }}
3547
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }}
3648
3749
python3 -m pip install --upgrade --no-cache-dir 'ciel>=2.0.1,<3'
38-
export OPDKS_VER="$(python3 ./dependencies/tool.py open_pdks -f commit)"
3950
ciel enable\
40-
--pdk $PDK_FAMILY\
51+
--pdk-family $PDK\
4152
--github-token ${{ secrets.GITHUB_TOKEN }}\
42-
$OPDKS_VER
43-
44-
- name: Tarball PDK
45-
run: |
46-
tar -cf /tmp/${{ matrix.pdk }}.tar -C $PDK_ROOT/${{ matrix.pdk }} .
47-
48-
- name: Upload PDK Tarball
49-
uses: actions/upload-artifact@v4
50-
with:
51-
name: pdk-tarball-${{ matrix.pdk }}
52-
path: /tmp/${{ matrix.pdk }}.tar
53+
${{ steps.set-rev.outputs.opdks_rev }}
5354
prepare_test_matrices:
5455
name: Prepare Test Matrices
5556
runs-on: ubuntu-22.04
@@ -71,9 +72,9 @@ jobs:
7172
id: set-matrix
7273
run: |
7374
if [[ "$USE_ETS" = "1" ]]; then
74-
echo "design_matrix=$(python3 ./.github/test_sets/get_test_matrix.py --scl sky130A/sky130_fd_sc_hd --scl gf180mcuC/gf180mcu_fd_sc_mcu7t5v0 fastest_test_set extended_test_set)" >> $GITHUB_OUTPUT
75+
echo "design_matrix=$(python3 ./.github/test_sets/get_test_matrix.py --scl sky130A/sky130_fd_sc_hd --scl gf180mcuD/gf180mcu_fd_sc_mcu7t5v0 fastest_test_set extended_test_set)" >> $GITHUB_OUTPUT
7576
else
76-
echo "design_matrix=$(python3 ./.github/test_sets/get_test_matrix.py --scl sky130A/sky130_fd_sc_hd --scl gf180mcuC/gf180mcu_fd_sc_mcu7t5v0 fastest_test_set)" >> $GITHUB_OUTPUT
77+
echo "design_matrix=$(python3 ./.github/test_sets/get_test_matrix.py --scl sky130A/sky130_fd_sc_hd --scl gf180mcuD/gf180mcu_fd_sc_mcu7t5v0 fastest_test_set)" >> $GITHUB_OUTPUT
7778
fi
7879
echo "issue_regression_matrix=$(python3 -m tests get_matrix)" >> $GITHUB_OUTPUT
7980
@@ -129,17 +130,18 @@ jobs:
129130
- name: Import Docker Image
130131
run: docker load --input /tmp/image-amd64.tar
131132

132-
- name: Download PDK Tarball
133-
uses: actions/download-artifact@v4
133+
- name: Cache PDK
134+
id: cache-pdk
135+
uses: actions/cache@v4
134136
with:
135-
name: pdk-tarball-sky130A
136-
path: /tmp
137+
path: ${{ env.PDK_ROOT }}
138+
key: cache-${{ matrix.design.pdk }}-pdk-${{ needs.pdk_build.outputs.opdks_rev }}
139+
enableCrossOsArchive: true
137140

138-
- name: Unpack PDK Tarball
141+
- name: Enable PDKs
142+
if: steps.cache-pdk.outputs.cache-hit != 'true'
139143
run: |
140-
sudo mkdir -p ${{ env.PDK_ROOT }}/sky130A
141-
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }}
142-
tar -xf /tmp/sky130A.tar -C $PDK_ROOT/sky130A .
144+
PDK=${{ matrix.design.pdk }} make pdk
143145
144146
- name: Get Pyyaml
145147
run: python3 -m pip install pyyaml
@@ -179,17 +181,18 @@ jobs:
179181
- name: Import Docker Image
180182
run: docker load --input /tmp/image-amd64.tar
181183

182-
- name: Download PDK Tarball
183-
uses: actions/download-artifact@v4
184+
- name: Cache PDK
185+
id: cache-pdk
186+
uses: actions/cache@v4
184187
with:
185-
name: pdk-tarball-${{ matrix.design.pdk }}
186-
path: /tmp
188+
path: ${{ env.PDK_ROOT }}
189+
key: cache-${{ matrix.design.pdk }}-pdk-${{ needs.pdk_build.outputs.opdks_rev }}
190+
enableCrossOsArchive: true
187191

188-
- name: Unpack PDK Tarball
192+
- name: Enable PDKs
193+
if: steps.cache-pdk.outputs.cache-hit != 'true'
189194
run: |
190-
sudo mkdir -p ${{ env.PDK_ROOT }}/${{ matrix.design.pdk }}
191-
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }}
192-
tar -xf /tmp/${{ matrix.design.pdk }}.tar -C $PDK_ROOT/${{ matrix.design.pdk }} .
195+
PDK=${{ matrix.design.pdk }} make pdk
193196
194197
- name: Set PDK Variant
195198
run: |
@@ -256,21 +259,6 @@ jobs:
256259
name: docker-image-arm64v8
257260
path: /tmp
258261

259-
- name: Delete Docker Image (amd64)
260-
uses: geekyeggo/delete-artifact@v1
261-
with:
262-
name: docker-image-amd64
263-
264-
- name: Delete Docker Image (arm64v8)
265-
uses: geekyeggo/delete-artifact@v1
266-
with:
267-
name: docker-image-arm64v8
268-
269-
- name: Delete PDK
270-
uses: geekyeggo/delete-artifact@v1
271-
with:
272-
name: pdk-tarball
273-
274262
- name: Write Hash
275263
run: |
276264
echo "GIT_COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV

Makefile

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,6 @@ PDK_OPTS = -v $(PDK_ROOT):$(PDK_ROOT) -e PDK_ROOT=$(PDK_ROOT)
6363

6464
export PDK ?= sky130A
6565

66-
ifeq ($(PDK),sky130A)
67-
PDK_FAMILY = sky130
68-
endif
69-
ifeq ($(PDK),sky130B)
70-
PDK_FAMILY = sky130
71-
endif
72-
ifeq ($(PDK),gf180mcuA)
73-
PDK_FAMILY = gf180mcu
74-
endif
75-
ifeq ($(PDK),gf180mcuB)
76-
PDK_FAMILY = gf180mcu
77-
endif
78-
ifeq ($(PDK),gf180mcuC)
79-
PDK_FAMILY = gf180mcu
80-
endif
81-
8266
PDK_OPTS += -e PDK=$(PDK)
8367

8468
ifneq ($(STD_CELL_LIBRARY),)
@@ -123,31 +107,30 @@ mount:
123107
$(ENV_START) -ti $(OPENLANE_IMAGE_NAME)-$(DOCKER_ARCH)
124108

125109
.PHONY: pdk
126-
pdk: venv/created
127-
PYTHONPATH= ./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir ciel
128-
./venv/bin/ciel enable --pdk $(PDK_FAMILY)
110+
pdk: venv/manifest.txt
111+
./venv/bin/ciel enable --pdk $(PDK)
129112

130113
.PHONY: survey
131114
survey:
132115
$(PYTHON_BIN) ./env.py issue-survey
133116

134117

135118
.PHONY: lint
136-
lint: venv/created
119+
lint: venv/manifest.txt
137120
./venv/bin/black --check .
138121
./venv/bin/flake8 .
139122

140123
.PHONY: start-build-env
141-
start-build-env: venv/created
124+
start-build-env: venv/manifest.txt
142125
bash -c "bash --rcfile <(cat ~/.bashrc ./venv/bin/activate)"
143126

144-
venv: venv/created
145-
venv/created: ./requirements.txt ./requirements_dev.txt ./requirements_lint.txt ./dependencies/python/precompile_time.txt ./dependencies/python/run_time.txt
127+
venv: venv/manifest.txt
128+
venv/manifest.txt: ./requirements.txt ./requirements_dev.txt ./requirements_lint.txt ./dependencies/python/precompile_time.txt ./dependencies/python/run_time.txt
146129
rm -rf ./venv
147130
$(PYTHON_BIN) -m venv ./venv
148131
PYTHONPATH= ./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir pip
149132
PYTHONPATH= ./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir -r ./requirements_dev.txt
150-
touch $@
133+
PYTHONPATH= ./venv/bin/$(PYTHON_BIN) -m pip freeze > $@
151134

152135
DLTAG=custom_design_List
153136
.PHONY: test_design_list fastest_test_set extended_test_set

0 commit comments

Comments
 (0)