-
Notifications
You must be signed in to change notification settings - Fork 653
206 lines (189 loc) · 7.88 KB
/
chipyard-full-flow.yml
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: chipyard-ci-full-flow
on:
# run ci on pull requests targeting following branches (runs on the merge commit)
pull_request:
branches:
- main
- '1.[0-9]*.x'
schedule:
# run at 00:00 on sunday
- cron: "0 0 * * 0"
defaults:
run:
shell: bash -leo pipefail {0}
env:
# temporary directories should be located in /scratch (since it's larger)
REMOTE_WORK_DIR: /scratch/buildbot/cy-ci-shared/cy-workdir-${{ github.sha }}
JAVA_TMP_DIR: /scratch/buildbot/cy-ci-shared/cy-javatmpdir-${{ github.sha }}
jobs:
cancel-prior-workflows:
name: cancel-prior-workflows
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
start-workflow:
name: start-workflow
# unable to access env context in job.if thus have to put gh-a context expression directly here.
# note that the check is using a boolean true instead of string 'true' since it's directly using
# the expression not a variable like if checking against the env context string.
if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:disable') != true }}
runs-on: ubuntu-22.04
steps:
- run: true
# Set up a set of boolean conditions to control which branches of the CI
# workflow will execute This is based off the conditional job execution
# example here: https://github.com/dorny/paths-filter#examples
change-filters:
name: filter-jobs-on-changes
runs-on: ubuntu-latest
needs: start-workflow
# Queried by downstream jobs to determine if they should run.
outputs:
needs-rtl: ${{ steps.filter.outputs.all_count != steps.filter.outputs.skip-rtl_count }}
steps:
- uses: actions/checkout@v4
- name: Git workaround
uses: ./.github/actions/git-workaround
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
all:
- '**'
# If any of the files changed match, do a doc build
docs: &docs-filter
- 'docs/**'
- '.readthedocs.yml'
# If all files match to this filter, skip the main ci pipeline
skip-rtl:
- *docs-filter
- '**/*.md'
- '**/.gitignore'
- '.github/ISSUE_TEMPLATE/**'
- '.github/PULL_REQUEST_TEMPLATE.md'
- '.github/dependabot.yml'
- '.mergify.yml'
full-flow:
name: full-flow
needs: [change-filters, cancel-prior-workflows]
if: needs.change-filters.outputs.needs-rtl == 'true'
runs-on: as4
steps:
- name: Delete old checkout
run: |
ls -alh .
rm -rf ${{ github.workspace }}/* || true
rm -rf ${{ github.workspace }}/.* || true
ls -alh .
- uses: actions/checkout@v4
- name: Setup repo copy
run: |
git clone $GITHUB_WORKSPACE ${{ env.REMOTE_WORK_DIR }}
- name: Setup repo
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
mkdir ${{ env.JAVA_TMP_DIR }}
export MAKEFLAGS="-j32"
git submodule sync
./build-setup.sh -v
- name: Run config finder
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
source env.sh
cd sims/verilator
make find-config-fragments
- name: Run smoke test
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
source env.sh
cd sims/verilator
make verilog
- name: VLSI test
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
source env.sh
cd vlsi
# remove extra channels if put in by default (avoid clashing deps)
conda config --remove channels litex-hub || true
conda config --remove channels defaults || true
# NOTE: most conda installs are in separate conda envs because they mess up
# each other's versions (for no apparent reason) and we need the latest versions
# installs for example-sky130.yml
conda create -y --prefix ./.conda-sky130 -c defaults -c litex-hub open_pdks.sky130a=1.0.457_0_g32e8f23
git clone https://github.com/rahulk29/sram22_sky130_macros.git
git -C sram22_sky130_macros checkout 1f20d16
# installs for example-openroad.yml
conda create -y --prefix ./.conda-yosys -c defaults -c litex-hub yosys=0.27_4_gb58664d44
conda create -y --prefix ./.conda-openroad -c defaults -c litex-hub openroad=2.0_7070_g0264023b6
conda create -y --prefix ./.conda-klayout -c defaults -c litex-hub klayout=0.28.5_98_g87e2def28
conda create -y --prefix ./.conda-signoff -c defaults -c litex-hub magic=8.3.376_0_g5e5879c netgen=1.5.250_0_g178b172
echo "# Tutorial configs" > tutorial.yml
echo "# pdk" > tutorial.yml
echo "technology.sky130.sky130A: $PWD/.conda-sky130/share/pdk/sky130A" >> tutorial.yml
echo "technology.sky130.sram22_sky130_macros: $PWD/sram22_sky130_macros" >> tutorial.yml
echo "" >> tutorial.yml
echo "# tools" >> tutorial.yml
echo "synthesis.yosys.yosys_bin: $PWD/.conda-yosys/bin/yosys" >> tutorial.yml
echo "par.openroad.openroad_bin: $PWD/.conda-openroad/bin/openroad" >> tutorial.yml
echo "par.openroad.klayout_bin: $PWD/.conda-klayout/bin/klayout" >> tutorial.yml
echo "drc.magic.magic_bin: $PWD/.conda-signoff/bin/magic" >> tutorial.yml
echo "drc.klayout.klayout_bin: $PWD/.conda-klayout/bin/klayout" >> tutorial.yml
echo "lvs.netgen.netgen_bin: $PWD/.conda-signoff/bin/netgen" >> tutorial.yml
echo "" >> tutorial.yml
echo "# speed up tutorial runs & declutter log output" >> tutorial.yml
echo "par.openroad.timing_driven: false" >> tutorial.yml
echo "par.openroad.write_reports: false" >> tutorial.yml
export tutorial=sky130-openroad
export EXTRA_CONFS=tutorial.yml
export VLSI_TOP=RocketTile
make buildfile
make syn
# NOTE: commenting out for now bc this times out - need to debug why
# openroad freezes during some write commands after detailed route
# so need to stop the flow & run last step separately
# make par HAMMER_EXTRA_ARGS="--stop_after_step extraction"
# make redo-par HAMMER_EXTRA_ARGS="--start_before_step extraction"
# make drc
# make lvs
- name: Run FireChip bridge tests
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
source env.sh
pushd sims/firesim
source sourceme-manager.sh --skip-ssh-setup
popd
cd sims/firesim-staging
export TEST_DISABLE_VERILATOR=1
export TEST_DISABLE_VIVADO=1
make launch-sbt SBT_COMMAND=";project firechip_bridgestubs; testOnly firechip.bridgestubs.BridgeTests"
- name: Run FireChip FireSim target tests
run: |
cd ${{ env.REMOTE_WORK_DIR }}
eval "$(conda shell.bash hook)"
source env.sh
pushd sims/firesim
source sourceme-manager.sh --skip-ssh-setup
popd
cd sims/firesim-staging
export TEST_MINIMAL_BENCHMARKS=1 # seems like dhrystone is the longest so this doesn't affect runtime much
export TEST_DISABLE_VERILATOR=1
export TEST_DISABLE_VIVADO=1
make launch-sbt SBT_COMMAND=";project firechip; testOnly firechip.chip.CITests"
cleanup:
name: cleanup
needs: [full-flow]
runs-on: as4
if: ${{ always() }}
steps:
- name: Delete repo copy and conda env
run: |
rm -rf ${{ env.REMOTE_WORK_DIR }}
rm -rf ${{ env.JAVA_TMP_DIR }}