-
Notifications
You must be signed in to change notification settings - Fork 5
120 lines (105 loc) · 3.48 KB
/
Copy pathci.yml
File metadata and controls
120 lines (105 loc) · 3.48 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
name: ci
on:
push:
pull_request:
defaults:
run:
# for conda
shell: bash -leo pipefail {0}
env:
CHIPYARD_RELPATH: chipyard-work
# need to be persistent cross-action
CHIPYARD_DIR: "/scratch/buildbot/radiance-ci-shared/chipyard-${{ github.run_id }}-${{ github.run_attempt }}"
# flip to force-reset cache
CACHE_NUMBER: 0
jobs:
build:
name: build
runs-on: as4
steps:
- name: Setup system
run: |
set -x
cat /proc/cpuinfo | tail -n20
vmstat -SM
df -h
[ -d "${{ github.workspace }}" ] && rm -rf "${{ github.workspace }}"/*
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout Chipyard
run: |
[ -d "${CHIPYARD_DIR}" ] && echo "${CHIPYARD_DIR} already exists, aborting" && exit 1
mkdir -p "${CHIPYARD_DIR}"
git clone --depth 1 --branch graphics "https://github.com/ucb-bar/chipyard.git" "${CHIPYARD_DIR}"
cd "${CHIPYARD_DIR}"
echo "CHIPYARD_HASH=$(git rev-parse HEAD)" >> "${GITHUB_ENV}"
# for caching
ln -sf "${CHIPYARD_DIR}" "${GITHUB_WORKSPACE}/${CHIPYARD_RELPATH}"
- name: Install conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
auto-activate-base: true
activate-environment: ""
- name: Install cargo
uses: dtolnay/rust-toolchain@stable
- name: Cache Scala deps
uses: actions/cache@v5
with:
path: |
~/.ivy2/cache
~/.sbt
${{ env.CHIPYARD_RELPATH }}/.ivy2/cache
${{ env.CHIPYARD_RELPATH }}/.sbt
~/.cache/coursier
key: scala-${{ hashFiles('**/*.sbt', '**/project/**') }}-${{ runner.os }}-${{ runner.arch }}-${{ env.CACHE_NUMBER }}
- name: Cache conda-env
id: cache-conda-env
uses: actions/cache@v5
with:
path: |
${{ env.CHIPYARD_RELPATH }}/.conda-env
${{ env.CHIPYARD_RELPATH }}/env.sh
key: chipyard-${{ env.CHIPYARD_HASH }}-${{ runner.os }}-${{ runner.arch }}-${{ env.CACHE_NUMBER }}
- name: Setup Chipyard
run: |
.github/scripts/setup-chipyard.sh "${{ steps.cache-conda-env.outputs.cache-hit }}"
- name: Setup Radiance
# move radiance to under chipyard/generators
run: |
set -eux
rm -rf "${CHIPYARD_DIR}/generators/radiance"
rsync -a --exclude "/${CHIPYARD_RELPATH}/" \
"${GITHUB_WORKSPACE}/" "${CHIPYARD_DIR}/generators/radiance/"
ls -al "${CHIPYARD_DIR}/generators/radiance"
- name: Build Radiance sim binary
run: |
cd "${CHIPYARD_DIR}"
source env.sh
source /ecad/tools/vlsi.bashrc
cd sims/vcs
make debug SUB_PROJECT=muon CONFIG=MuonBackendTestConfig
make debug CONFIG=RadianceTapeoutSimConfig
run:
name: run
runs-on: as4
needs: build
steps:
- name: Run Muon ISA tests
run: |
cd "${CHIPYARD_DIR}"
source env.sh
source /ecad/tools/vlsi.bashrc
cd generators/radiance
python3 test/run_isa_tests.py -j "$(nproc)"
clean:
runs-on: as4
needs: run
if: always()
steps:
- name: Cleanup workspace and chipyard
run: |
[ -d "${{ github.workspace }}" ] && rm -rf "${{ github.workspace }}"
[ -d "${CHIPYARD_DIR}" ] && rm -rf "${CHIPYARD_DIR}"