-
Notifications
You must be signed in to change notification settings - Fork 1
148 lines (130 loc) · 5.03 KB
/
Copy pathprecheck_test.yml
File metadata and controls
148 lines (130 loc) · 5.03 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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Precheck CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
precheck:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- repo: 'caravel_user_project'
skip_checks: 'gpio_defines'
- repo: 'caravel_user_sram'
skip_checks: 'gpio_defines lvs'
- repo: 'caravel_user_project_analog'
skip_checks: 'gpio_defines lvs'
- repo: 'openframe_user_project'
skip_checks: ''
fail-fast: false
steps:
- name: Checkout current repo
uses: actions/checkout@v4
- name: Checkout mpw_precheck
uses: actions/checkout@v4
with:
repository: chipfoundry/mpw_precheck
path: mpw_precheck
- name: Checkout ${{ matrix.repo }}
if: matrix.repo != 'openframe_user_project'
uses: actions/checkout@v4
with:
repository: chipfoundry/${{ matrix.repo }}
path: ${{ matrix.repo }}
- name: Checkout ${{ matrix.repo }} using development branch to pass OEB check
if: matrix.repo == 'openframe_user_project'
uses: actions/checkout@v4
with:
repository: d-m-bailey/openframe_user_project-cf
path: ${{ matrix.repo }}
ref: CF_gpio_config
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('mpw_precheck/dependencies/Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Docker image
run: |
docker buildx create --use
docker buildx build \
--cache-from=type=local,src=/tmp/.buildx-cache \
--cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max \
--output type=docker \
--tag mpw_precheck:latest \
${{ github.workspace }}/dependencies
timeout-minutes: 45
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Cache PDK
id: cache-pdk
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/pdk
key: ${{ runner.os }}-pdk-${{ hashFiles('**/ciel.toml') }}
- name: Temporarily update caravan gpio definitions to pass OEB check
if: matrix.repo == 'caravel_user_project_analog'
run: |
gawk -i inplace '\
/USER_CONFIG_GPIO_11_/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
/USER_CONFIG_GPIO_12_/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
/USER_CONFIG_GPIO_26_/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
/USER_CONFIG_GPIO_27_/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
{sub(/INVALID/, "MGMT_STD_ANALOG"); print}' caravel_user_project_analog/verilog/rtl/user_defines.v
cat caravel_user_project_analog/verilog/rtl/user_defines.v
- name: Temporarily update caravel gpio definitions to pass OEB check
if: matrix.repo == 'caravel_user_project'
run: |
gawk -i inplace '\
/USER_CONFIG_GPIO_[567]_/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
/USER_CONFIG_GPIO_3._/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
{sub(/INVALID/, "MGMT_STD_ANALOG"); print}' caravel_user_project/verilog/rtl/user_defines.v
cat caravel_user_project/verilog/rtl/user_defines.v
- name: Install ciel and PDK
if: steps.cache-pdk.outputs.cache-hit != 'true'
run: |
python3 -m pip install --upgrade --no-cache-dir ciel
export CIEL_DATA_SOURCE=static-web:https://chipfoundry.github.io/ciel-releases
ciel enable 3e0e31dcce8519a7dbb82590346db16d91b7244f --pdk-root ${{ github.workspace }}/pdk --pdk sky130A
env:
PDK_ROOT: ${{ github.workspace }}/pdk
- name: Run Precheck
run: |
INPUT_DIR=${{ github.workspace }}/${{ matrix.repo }}
OUTPUT_DIR=$INPUT_DIR/precheck_results
PDK_ROOT=${{ github.workspace }}/pdk
PDK_PATH=$PDK_ROOT/sky130A
SKIP_ARGS=""
if [ -n "${{ matrix.skip_checks }}" ]; then
SKIP_ARGS="--skip-checks ${{ matrix.skip_checks }}"
fi
docker run --rm \
-v "$INPUT_DIR":"$INPUT_DIR" \
-v "$PDK_ROOT":"$PDK_ROOT" \
-v ${{ github.workspace }}:/work/cf-precheck \
-e PDK_ROOT="$PDK_ROOT" \
-e PDK_PATH="$PDK_PATH" \
-e PDKPATH="$PDK_PATH" \
-e PYTHONPATH=/work/cf-precheck/src \
mpw_precheck:latest \
bash -lc "
python3 -c \"import cf_precheck; print(cf_precheck.__file__)\"
python3 -m cf_precheck \
-i \"$INPUT_DIR\" \
-p \"$PDK_PATH\" \
-c /opt/caravel \
-o \"$OUTPUT_DIR\" \
$SKIP_ARGS
"
- name: Upload Precheck results
uses: actions/upload-artifact@v4
if: failure()
with:
name: precheck-results-${{ matrix.repo }}
path: ${{ github.workspace }}/${{ matrix.repo }}/precheck_results