-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (154 loc) · 6.51 KB
/
gds.yaml
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
name: gds
on:
workflow_dispatch:
push:
# Don't run on project submissions:
branches-ignore:
- projects/tt_um_*
pull_request:
# Don't run on project submissions:
paths-ignore:
- projects/tt_um_*/**
jobs:
gds:
env:
PYTHONIOENCODING: utf-8
PDK_ROOT: ${{ github.workspace }}/pdk
TT_CONFIG: sky130.yaml
# Uncomment the following line to build only the specified projects:
#TT_ONLY_PROJECTS: tt_um_chip_rom,tt_um_factory_test
runs-on: ubuntu-24.04
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- run: pip install -r tt-multiplexer/py/requirements.txt -r tt/requirements.txt
- name: Load OpenLane environment variables
run: cat .github/config/openlane.txt | tee -a $GITHUB_ENV
- name: Checkout OpenLane 2 repo
uses: actions/checkout@v4
with:
repository: efabless/openlane2
path: openlane2
ref: ${{ env.OPENLANE_TAG }}
- name: Patch OpenLane 2 repo
working-directory: openlane2
run:
git apply --allow-empty ../patches/openlane2.patch
- name: Update caravel configuration
run: python ./tt/configure.py --update-shuttle
- uses: cachix/install-nix-action@v26
- uses: cachix/cachix-action@v14
with:
name: ${{ vars.CACHIX_CACHE || 'tinytapeout' }}
extraPullNames: ${{ vars.CACHIX_CACHE_EXTRA || 'openlane' }}
authToken: ${{ secrets.CACHIX_TOKEN }}
- name: Install Sky130 PDK
uses: TinyTapeout/volare-action@v2
with:
pdk_name: sky130
pdk_version: ${{ env.SKY130_PDK_VERSION }}
pdk_root: ${{ env.PDK_ROOT }}
# Patch all digital projects to work around the poly density issue
- name: Patch projects for poly density issue
working-directory: projects
run: |
for project in tt_um_*; do
if [ "$project" = "tt_um_chip_rom" ]; then
continue
fi
# Skip projects that were not built with OpenLane2 (e.g. analog and mixed-signal projects)
if [[ "$(jq -r '.openlane_version' $project/commit_id.json)" != "OpenLane2 2"* ]]; then
continue
fi
if [ -f $project/$project.gds.br ]; then
brotli -jd $project/$project.gds.br
fi
python ../sky130_density_fix/replace_decap.py --design $project --user-gds $project/$project.gds --replacement-gds ../sky130_density_fix/sky130_ef_sc_hd__newfill_12.gds | tee -a ../tt-multiplexer/ol2/tt_top/gds/replace_decap.log
done
# Workaround for DRC errors in the SRAM macro of tt_um_kmakise_sram:
- name: Patch tt_um_kmakise_sram for SRAM DRC errors
run: python sky130_sram_workaround/extract_sram_macro.py -n tt_um_kmakise_sram -p projects/tt_um_kmakise_sram/tt_um_kmakise_sram.gds -m myconfig_sky_dual -x projects/tt_um_kmakise_sram/myconfig_sky_dual.gds
# run OpenLane to build the GDS
- name: Harden Chip ROM
run: nix-shell $GITHUB_WORKSPACE/openlane2/shell.nix --run "python -m openlane tt/rom/config.json"
- name: Harden tt_ctrl
working-directory: tt-multiplexer/ol2/tt_ctrl
run: nix-shell $GITHUB_WORKSPACE/openlane2/shell.nix --run "python build.py"
- name: Harden tt_mux
working-directory: tt-multiplexer/ol2/tt_mux
run: nix-shell $GITHUB_WORKSPACE/openlane2/shell.nix --run "python build.py"
- name: Copy macros
run: python ./tt/configure.py --copy-macros
- name: Harden tt_top
working-directory: tt-multiplexer/ol2/tt_top
run: nix-shell $GITHUB_WORKSPACE/openlane2/shell.nix --run "python build.py --skip-xor-checks"
- name: Copy sram macro back into tt_um_kmakise_sram
run: |
# Find the latest run directory:
RUN_DIR=$(ls -d tt-multiplexer/ol2/tt_top/runs/RUN_* | sort -n | tail -n 1)
cp $RUN_DIR/final/gds/openframe_project_wrapper.gds $RUN_DIR/final/gds/openframe_project_wrapper.orig.gds
python sky130_sram_workaround/inject_sram_macro.py -i $RUN_DIR/final/gds/openframe_project_wrapper.gds -o $RUN_DIR/final/gds/openframe_project_wrapper.gds -p tt_um_kmakise_sram -m myconfig_sky_dual --inject-gds projects/tt_um_kmakise_sram/myconfig_sky_dual.gds
- name: Copy final results
run: python ./tt/configure.py --copy-final-results
- name: Create eFabless submission
run: python ./tt/configure.py --create-efabless-submission
- name: upload GDS artifact
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: GDS
path: tt-multiplexer/ol2/tt_top/runs/RUN_*/*
- name: upload macros artifact
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: macros
path: |
tt-multiplexer/cfg/*.yaml
tt-multiplexer/ol2/tt_top/gds/*
tt-multiplexer/ol2/tt_top/lef/*
tt-multiplexer/ol2/tt_top/spef/*
tt-multiplexer/ol2/tt_top/verilog/*
tt-multiplexer/ol2/tt_mux/runs/RUN_*/*
tt-multiplexer/ol2/tt_ctrl/runs/RUN_*/*
- name: upload shuttle_index.json
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: shuttle_index
path: shuttle_index.json
- name: upload Efabless submission directory
uses: actions/upload-artifact@v4
with:
name: efabless_submission
path: efabless
# Install iverilog, cocotb (required for GL test)
- name: install oss-cad-suite
uses: YosysHQ/setup-oss-cad-suite@v3
with:
version: '2023-05-27'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: GL simulation
working-directory: verilog/dv/mux
env:
EXPECTED_REPO: ${{ github.repository }}
run: |
make clean test_mux_gl
# make will return success even if the test fails, so check for failure in the results.xml
! grep failure results.xml
- name: upload GL test results
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: gl_test_vcd
path: |
verilog/dv/mux/results.xml
verilog/dv/mux/test_mux.vcd
verilog/dv/mux/test_mux.gtkw