Skip to content
This repository was archived by the owner on Jun 7, 2024. It is now read-only.

Commit 2d101f7

Browse files
authored
Merge pull request #7 from ChipFlow/gatecat/ci
ci: Install deps & build SoC in CI
2 parents 733f0dc + fa7b55e commit 2d101f7

File tree

3 files changed

+177
-0
lines changed

3 files changed

+177
-0
lines changed

.github/ci/build_deps.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Install latest Yosys
2+
function build_yosys {
3+
DESTDIR=`pwd`/.yosys
4+
pushd yosys
5+
make -j`nproc`
6+
sudo make install DESTDIR=$DESTDIR
7+
popd
8+
}
9+
10+
# Install latest Coriolis
11+
function build_coriolis {
12+
pushd ${HOME}/coriolis-2.x/src/coriolis
13+
./bootstrap/ccb.py --project=coriolis --qt5 --make="-j`nproc` install"
14+
popd
15+
}

.github/ci/build_soc.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function install_pydeps {
2+
pip install git+https://github.com/amaranth-lang/amaranth
3+
pip install git+https://github.com/amaranth-lang/amaranth-stdio
4+
pip install klayout
5+
}
6+
7+
function do_build {
8+
export CORIOLIS_TOP=/home/runner/coriolis-2.x/Linux.x86_64/Release.Shared/install
9+
export LD_LIBRARY_PATH=$CORIOLIS_TOP/lib64
10+
export PYTHONPATH=$PYTHONPATH:$CORIOLIS_TOP/lib64/python3/dist-packages:$CORIOLIS_TOP/lib64/python3/dist-packages/crlcore:$CORIOLIS_TOP/lib64/python3/dist-packages/cumulus/
11+
export PATH="$GITHUB_WORKSPACE/.yosys/usr/local/bin:$PATH"
12+
python3 -m soc.sky130 --synth --pnr
13+
}
14+

.github/workflows/flow_ci.yml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: Flow CI test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
Build-yosys:
7+
runs-on: ubuntu-latest
8+
steps:
9+
10+
- uses: actions/checkout@v2
11+
with:
12+
submodules: recursive
13+
14+
- name: Install
15+
run: |
16+
sudo apt-get update
17+
sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev clang bison flex swig
18+
19+
- name: ccache
20+
uses: hendrikmuhs/ccache-action@v1
21+
22+
- name: Get yosys
23+
run: |
24+
git clone https://github.com/YosysHQ/yosys.git
25+
cd yosys
26+
echo "YOSYS_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
27+
28+
- name: Cache yosys installation
29+
uses: actions/cache@v2
30+
id: cache-yosys
31+
with:
32+
path: .yosys
33+
key: cache-yosys-${{ env.YOSYS_SHA }}
34+
35+
- name: Build yosys
36+
run: |
37+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
38+
source ./.github/ci/build_deps.sh
39+
build_yosys
40+
if: steps.cache-yosys.outputs.cache-hit != 'true'
41+
42+
Build-coriolis:
43+
runs-on: ubuntu-latest
44+
steps:
45+
46+
- uses: actions/checkout@v2
47+
with:
48+
submodules: recursive
49+
50+
- name: Install
51+
run: |
52+
sudo apt-get update
53+
sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev clang bison flex swig qt5-default python3-pyqt5 libqt5svg5-dev qttools5-dev rapidjson-dev libqwt-qt5-dev
54+
55+
- name: ccache
56+
uses: hendrikmuhs/ccache-action@v1
57+
58+
- name: Get coriolis
59+
run: |
60+
cd $HOME
61+
mkdir -p ./coriolis-2.x/src/support
62+
cd ./coriolis-2.x/src/support
63+
git clone https://github.com/miloyip/rapidjson
64+
cd ..
65+
git clone https://gitlab.lip6.fr/vlsi-eda/coriolis
66+
cd coriolis
67+
echo "CORIOLIS_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
68+
69+
- name: Cache coriolis installation
70+
uses: actions/cache@v2
71+
id: cache-coriolis
72+
with:
73+
path: /home/runner/coriolis-2.x/Linux.x86_64/Release.Shared/install
74+
key: cache-coriolis-v2-${{ env.CORIOLIS_SHA }}
75+
76+
- name: Build coriolis
77+
run: |
78+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
79+
source ./.github/ci/build_deps.sh
80+
build_coriolis
81+
if: steps.cache-coriolis.outputs.cache-hit != 'true'
82+
83+
Build-soc:
84+
runs-on: ubuntu-latest
85+
needs: [Build-yosys, Build-coriolis]
86+
steps:
87+
88+
- uses: actions/checkout@v2
89+
with:
90+
submodules: recursive
91+
92+
- name: Install
93+
run: |
94+
sudo apt-get update
95+
sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev clang bison flex swig qt5-default python3-pyqt5 pyqt5-dev-tools libqt5svg5-dev qttools5-dev rapidjson-dev libqwt-qt5-dev tree
96+
97+
- name: ccache
98+
uses: hendrikmuhs/ccache-action@v1
99+
100+
- name: Get yosys
101+
run: |
102+
git clone https://github.com/YosysHQ/yosys.git
103+
cd yosys
104+
echo "YOSYS_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
105+
106+
- name: Cache yosys installation
107+
uses: actions/cache@v2
108+
id: cache-yosys
109+
with:
110+
path: .yosys
111+
key: cache-yosys-${{ env.YOSYS_SHA }}
112+
113+
- name: Build yosys
114+
run: |
115+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
116+
source ./.github/ci/build_deps.sh
117+
build_yosys
118+
if: steps.cache-yosys.outputs.cache-hit != 'true'
119+
120+
- name: Get coriolis
121+
run: |
122+
cd $HOME
123+
mkdir -p ./coriolis-2.x/src/support
124+
cd ./coriolis-2.x/src/support
125+
git clone https://github.com/miloyip/rapidjson
126+
cd ..
127+
git clone https://gitlab.lip6.fr/vlsi-eda/coriolis
128+
cd coriolis
129+
echo "CORIOLIS_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
130+
131+
- name: Cache coriolis installation
132+
uses: actions/cache@v2
133+
id: cache-coriolis
134+
with:
135+
path: /home/runner/coriolis-2.x/Linux.x86_64/Release.Shared/install
136+
key: cache-coriolis-v2-${{ env.CORIOLIS_SHA }}
137+
138+
- name: Build coriolis
139+
run: |
140+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
141+
source ./.github/ci/build_deps.sh
142+
build_coriolis
143+
if: steps.cache-coriolis.outputs.cache-hit != 'true'
144+
145+
- name: Build SoC
146+
run: |
147+
source ./.github/ci/build_soc.sh
148+
install_pydeps && do_build

0 commit comments

Comments
 (0)