-
Notifications
You must be signed in to change notification settings - Fork 33
167 lines (163 loc) · 5.76 KB
/
main.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
on:
workflow_dispatch:
push:
pull_request:
name: CI
jobs:
lint_models:
name: Lint All Models
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get IcarusVerilog
run: |
sudo apt-get install -y iverilog
- name: Verify
run: |
cd verification
for SIZE in $(cat ./.github/workflows/sizes.txt); do
export PATTERN=tb_RAM$SIZE
/bin/bash -c "make lint"
done
lint_python:
name: Lint Python Code
runs-on: ubuntu-22.04
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Lint
run: make lint
verify_models:
name: Verify (${{ matrix.count }}x${{ matrix.width }}_${{ matrix.variant }})
runs-on: ubuntu-22.04
needs: [lint_models]
strategy:
matrix:
include:
- { count: "8", width: "32", variant: "DEFAULT" }
- { count: "32", width: "32", variant: "DEFAULT" }
- { count: "128", width: "32", variant: "DEFAULT" }
- { count: "256", width: "32", variant: "DEFAULT" }
- { count: "512", width: "32", variant: "DEFAULT" }
- { count: "1024", width: "32", variant: "DEFAULT" }
- { count: "2048", width: "32", variant: "DEFAULT" }
- { count: "8", width: "32", variant: "1RW1R" }
- { count: "32", width: "32", variant: "1RW1R" }
- { count: "128", width: "32", variant: "1RW1R" }
- { count: "256", width: "32", variant: "1RW1R" }
- { count: "512", width: "32", variant: "1RW1R" }
- { count: "1024", width: "32", variant: "1RW1R" }
- { count: "2048", width: "32", variant: "1RW1R" }
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get IcarusVerilog
run: |
sudo apt-get install -y iverilog
- name: Run Verification
run: |
variant_postfix=
if [ "${{ matrix.variant }}" != "DEFAULT" ]; then
variant_postfix="_${{ matrix.variant }}"
fi
export PATTERN=tb_RAM${{ matrix.count }}x${{ matrix.width }}$variant_postfix
cd verification/
/bin/bash -c "! make | grep -c FATAL"
harden:
name: Harden (${{ matrix.count }}x${{ matrix.width }}_${{ matrix.variant }})
runs-on: ubuntu-22.04
needs: [lint_models, lint_python]
strategy:
fail-fast: false
matrix:
include:
- { count: "32", width: "8", variant: "DEFAULT" }
# - { count: "32", width: "8", variant: "1RW1R" }
- { count: "32", width: "16", variant: "DEFAULT" }
# - { count: "32", width: "16", variant: "1RW1R" }
- { count: "32", width: "32", variant: "DEFAULT" }
# - { count: "32", width: "32", variant: "1RW1R" } # Timeout
- { count: "32", width: "32", variant: "2R1W" }
- { count: "128", width: "32", variant: "DEFAULT" }
- { count: "256", width: "8", variant: "DEFAULT" }
# - { count: "256", width: "8", variant: "1RW1R" }
- { count: "256", width: "16", variant: "DEFAULT" }
# - { count: "256", width: "16", variant: "1RW1R" } # Timeout
- { count: "256", width: "32", variant: "DEFAULT" }
#- { count: "256", width: "32", variant: "1RW1R" } # Timeout
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-22.11
- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: openlane
- name: Run
run: |
building_blocks=ram
if [ "${{ matrix.variant }}" == "2R1W" ]; then
building_blocks=rf
fi
nix-shell --run "\
./dffram.py ${{ matrix.count }}x${{ matrix.width }}\
-p sky130A\
-s sky130_fd_sc_hd\
-v ${{ matrix.variant }}\
-b $building_blocks\
"
echo "PRODUCTS_PATH=$(echo products/*)" >> $GITHUB_ENV
- name: Upload Final Views
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.count }}x${{ matrix.width }}_${{ matrix.variant }}
path: ${{ env.PRODUCTS_PATH }}
publish:
name: Publish Release
if: always()
needs: [harden, verify_models]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Export Repo URL
shell: bash
run: echo "REPO_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
- name: Export Branch Name
shell: bash
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Generate Tag
run: |
echo "NEW_TAG=NO_NEW_TAG" >> $GITHUB_ENV
if [ "${{ github.event_name }}" != "pull_request" ] && [ "${{ env.BRANCH_NAME }}" = "main" ]; then
python3 ./.github/scripts/generate_tag.py
fi
- name: Download All Artifacts
uses: actions/download-artifact@v3
with:
path: ./artifacts
- name: Create Release
if: env.NEW_TAG != 'NO_NEW_TAG'
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go install github.com/tcnksm/ghr@latest
shopt -s nullglob
for artifact in ./artifacts/*; do
echo "Uploading $artifact to release…"
gzipped=./$(basename $artifact).tgz
tar -czvf $gzipped $artifact
ghr\
-owner AUCOHL\
-repository DFFRAM\
-commitish main\
-token ${{ secrets.GITHUB_TOKEN }}\
-replace\
$NEW_TAG\
$gzipped
echo "Done with $artifact."
done