Skip to content

Commit f102b25

Browse files
KrystalDelusionjix
authored andcommitted
Reapply "Merge pull request #5301 from KrystalDelusion/krys/re_5280"
This reverts commit 88eb83a.
1 parent 727998f commit f102b25

File tree

7 files changed

+171
-34
lines changed

7 files changed

+171
-34
lines changed

.github/workflows/extra-builds.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Test extra build flows
22

3-
on: [push, pull_request]
3+
on:
4+
# always test main
5+
push:
6+
branches:
7+
- main
8+
# test PRs
9+
pull_request:
10+
# allow triggering tests, ignores skip check
11+
workflow_dispatch:
412

513
jobs:
614
pre_job:
@@ -11,11 +19,11 @@ jobs:
1119
- id: skip_check
1220
uses: fkirc/skip-duplicate-actions@v5
1321
with:
22+
# don't run on documentation changes
1423
paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]'
1524
# cancel previous builds if a new commit is pushed
16-
cancel_others: 'true'
17-
# only run on push *or* pull_request, not both
18-
concurrent_skipping: 'same_content_newer'
25+
# but never cancel main
26+
cancel_others: ${{ github.ref != 'refs/heads/main' }}
1927

2028
vs-prep:
2129
name: Prepare Visual Studio build

.github/workflows/test-build.yml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Build and run tests
22

3-
on: [push, pull_request]
3+
on:
4+
# always test main
5+
push:
6+
branches:
7+
- main
8+
# test PRs
9+
pull_request:
10+
# allow triggering tests, ignores skip check
11+
workflow_dispatch:
412

513
jobs:
614
pre_job:
@@ -11,11 +19,12 @@ jobs:
1119
- id: skip_check
1220
uses: fkirc/skip-duplicate-actions@v5
1321
with:
22+
# don't run on documentation changes
1423
paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]'
1524
# cancel previous builds if a new commit is pushed
16-
cancel_others: 'true'
17-
# only run on push *or* pull_request, not both
18-
concurrent_skipping: 'same_content_newer'
25+
# but never cancel main
26+
cancel_others: ${{ github.ref != 'refs/heads/main' }}
27+
1928
pre_docs_job:
2029
runs-on: ubuntu-latest
2130
outputs:
@@ -24,23 +33,23 @@ jobs:
2433
- id: skip_check
2534
uses: fkirc/skip-duplicate-actions@v5
2635
with:
36+
# don't run on readme changes
2737
paths_ignore: '["**/README.md"]'
2838
# cancel previous builds if a new commit is pushed
29-
cancel_others: 'true'
30-
# only run on push *or* pull_request, not both
31-
concurrent_skipping: 'same_content_newer'
39+
# but never cancel main
40+
cancel_others: ${{ github.ref != 'refs/heads/main' }}
3241

3342
build-yosys:
3443
name: Reusable build
3544
runs-on: ${{ matrix.os }}
45+
# pre_job is a subset of pre_docs_job, so we can always build for pre_docs_job
3646
needs: pre_docs_job
3747
if: needs.pre_docs_job.outputs.should_skip != 'true'
3848
env:
3949
CC: clang
4050
strategy:
4151
matrix:
4252
os: [ubuntu-latest, macos-latest]
43-
sanitizer: [undefined, address]
4453
fail-fast: false
4554
steps:
4655
- name: Checkout Yosys
@@ -58,7 +67,6 @@ jobs:
5867
mkdir build
5968
cd build
6069
make -f ../Makefile config-$CC
61-
echo 'SANITIZER = ${{ matrix.sanitizer }}' >> Makefile.conf
6270
make -f ../Makefile -j$procs ENABLE_LTO=1
6371
6472
- name: Log yosys-config output
@@ -74,7 +82,7 @@ jobs:
7482
- name: Store build artifact
7583
uses: actions/upload-artifact@v4
7684
with:
77-
name: build-${{ matrix.os }}-${{ matrix.sanitizer }}
85+
name: build-${{ matrix.os }}
7886
path: build.tar
7987
retention-days: 1
8088

@@ -85,12 +93,9 @@ jobs:
8593
if: needs.pre_job.outputs.should_skip != 'true'
8694
env:
8795
CC: clang
88-
ASAN_OPTIONS: halt_on_error=1
89-
UBSAN_OPTIONS: halt_on_error=1
9096
strategy:
9197
matrix:
9298
os: [ubuntu-latest, macos-latest]
93-
sanitizer: [undefined, address]
9499
fail-fast: false
95100
steps:
96101
- name: Checkout Yosys
@@ -102,11 +107,12 @@ jobs:
102107
uses: ./.github/actions/setup-build-env
103108

104109
- name: Get iverilog
110+
id: get-iverilog
105111
shell: bash
106112
run: |
107113
git clone https://github.com/steveicarus/iverilog.git
108114
cd iverilog
109-
echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
115+
echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
110116
111117
- name: Get vcd2fst
112118
shell: bash
@@ -123,7 +129,7 @@ jobs:
123129
uses: actions/cache@v4
124130
with:
125131
path: .local/
126-
key: ${{ matrix.os }}-${IVERILOG_GIT}
132+
key: ${{ matrix.os }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }}
127133

128134
- name: Build iverilog
129135
if: steps.cache-iverilog.outputs.cache-hit != 'true'
@@ -139,7 +145,7 @@ jobs:
139145
- name: Download build artifact
140146
uses: actions/download-artifact@v4
141147
with:
142-
name: build-${{ matrix.os }}-${{ matrix.sanitizer }}
148+
name: build-${{ matrix.os }}
143149

144150
- name: Uncompress build
145151
shell: bash
@@ -171,7 +177,6 @@ jobs:
171177
strategy:
172178
matrix:
173179
os: [ubuntu-latest]
174-
sanitizer: [undefined]
175180
steps:
176181
- name: Checkout Yosys
177182
uses: actions/checkout@v4
@@ -184,7 +189,7 @@ jobs:
184189
- name: Download build artifact
185190
uses: actions/download-artifact@v4
186191
with:
187-
name: build-${{ matrix.os }}-${{ matrix.sanitizer }}
192+
name: build-${{ matrix.os }}
188193

189194
- name: Uncompress build
190195
shell: bash
@@ -209,7 +214,6 @@ jobs:
209214
strategy:
210215
matrix:
211216
os: [ubuntu-latest]
212-
sanitizer: [undefined, address]
213217
fail-fast: false
214218
steps:
215219
- name: Checkout Yosys
@@ -223,7 +227,7 @@ jobs:
223227
- name: Download build artifact
224228
uses: actions/download-artifact@v4
225229
with:
226-
name: build-${{ matrix.os }}-${{ matrix.sanitizer }}
230+
name: build-${{ matrix.os }}
227231

228232
- name: Uncompress build
229233
shell: bash

.github/workflows/test-compile.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Compiler testing
22

3-
on: [push, pull_request]
3+
on:
4+
# always test main
5+
push:
6+
branches:
7+
- main
8+
# test PRs
9+
pull_request:
10+
# allow triggering tests, ignores skip check
11+
workflow_dispatch:
412

513
jobs:
614
pre_job:
@@ -11,11 +19,11 @@ jobs:
1119
- id: skip_check
1220
uses: fkirc/skip-duplicate-actions@v5
1321
with:
22+
# don't run on documentation changes
1423
paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]'
1524
# cancel previous builds if a new commit is pushed
16-
cancel_others: 'true'
17-
# only run on push *or* pull_request, not both
18-
concurrent_skipping: 'same_content_newer'
25+
# but never cancel main
26+
cancel_others: ${{ github.ref != 'refs/heads/main' }}
1927

2028
test-compile:
2129
runs-on: ${{ matrix.os }}
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Check clang sanitizers
2+
3+
on:
4+
# always test main
5+
push:
6+
branches:
7+
- main
8+
# ignore PRs due to time needed
9+
# allow triggering tests, ignores skip check
10+
workflow_dispatch:
11+
12+
jobs:
13+
pre_job:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
17+
steps:
18+
- id: skip_check
19+
uses: fkirc/skip-duplicate-actions@v5
20+
with:
21+
# don't run on documentation changes
22+
paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]'
23+
24+
run_san:
25+
name: Build and run tests
26+
runs-on: ${{ matrix.os }}
27+
needs: pre_job
28+
if: needs.pre_job.outputs.should_skip != 'true'
29+
env:
30+
CC: clang
31+
ASAN_OPTIONS: halt_on_error=1
32+
UBSAN_OPTIONS: halt_on_error=1
33+
strategy:
34+
matrix:
35+
os: [ubuntu-latest, macos-latest]
36+
sanitizer: ['undefined,address']
37+
fail-fast: false
38+
steps:
39+
- name: Checkout Yosys
40+
uses: actions/checkout@v4
41+
with:
42+
submodules: true
43+
persist-credentials: false
44+
45+
- name: Setup environment
46+
uses: ./.github/actions/setup-build-env
47+
48+
- name: Get iverilog
49+
id: get-iverilog
50+
shell: bash
51+
run: |
52+
git clone https://github.com/steveicarus/iverilog.git
53+
cd iverilog
54+
echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
55+
56+
- name: Get vcd2fst
57+
shell: bash
58+
run: |
59+
git clone https://github.com/mmicko/libwave.git
60+
mkdir -p ${{ github.workspace }}/.local/
61+
cd libwave
62+
cmake . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.local
63+
make -j$procs
64+
make install
65+
66+
- name: Cache iverilog
67+
id: cache-iverilog
68+
uses: actions/cache@v4
69+
with:
70+
path: .local/
71+
key: ${{ matrix.os }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }}
72+
73+
- name: Build iverilog
74+
if: steps.cache-iverilog.outputs.cache-hit != 'true'
75+
shell: bash
76+
run: |
77+
mkdir -p ${{ github.workspace }}/.local/
78+
cd iverilog
79+
autoconf
80+
CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local
81+
make -j$procs
82+
make install
83+
84+
- name: Check iverilog
85+
shell: bash
86+
run: |
87+
iverilog -V
88+
89+
- name: Build
90+
shell: bash
91+
run: |
92+
make config-$CC
93+
echo 'SANITIZER = ${{ matrix.sanitizer }}' >> Makefile.conf
94+
make -j$procs ENABLE_LTO=1
95+
96+
- name: Log yosys-config output
97+
run: |
98+
./yosys-config || true
99+
100+
- name: Run tests
101+
shell: bash
102+
run: |
103+
make -j$procs test TARGETS= EXTRA_TARGETS= CONFIG=$CC
104+
105+
- name: Report errors
106+
if: ${{ failure() }}
107+
shell: bash
108+
run: |
109+
find tests/**/*.err -print -exec cat {} \;

.github/workflows/test-verific.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Build and run tests with Verific (Linux)
22

3-
on: [push, pull_request]
3+
on:
4+
# always test main
5+
push:
6+
branches:
7+
- main
8+
# test PRs
9+
pull_request:
10+
# allow triggering tests, ignores skip check
11+
workflow_dispatch:
412

513
jobs:
614
pre-job:
@@ -11,11 +19,11 @@ jobs:
1119
- id: skip_check
1220
uses: fkirc/skip-duplicate-actions@v5
1321
with:
22+
# don't run on documentation changes
1423
paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]'
1524
# cancel previous builds if a new commit is pushed
16-
cancel_others: 'true'
17-
# only run on push *or* pull_request, not both
18-
concurrent_skipping: 'same_content_newer'
25+
# but never cancel main
26+
cancel_others: ${{ github.ref != 'refs/heads/main' }}
1927

2028
test-verific:
2129
needs: pre-job

passes/memory/memlib.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ struct Parser {
880880
}
881881
}
882882
}
883-
var.clk_en = find_single_cap(pdef.clken, cram.options, portopts, "clken");
883+
var.clk_en = find_single_cap(pdef.clken, cram.options, portopts, "clken") != nullptr;
884884
}
885885
const PortWidthDef *wdef = find_single_cap(pdef.width, cram.options, portopts, "width");
886886
if (wdef) {

passes/memory/memlib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ struct PortVariant {
109109
PortKind kind;
110110
int clk_shared;
111111
ClkPolKind clk_pol;
112-
bool clk_en;
112+
bool clk_en = false;
113113
bool width_tied;
114114
int min_wr_wide_log2;
115115
int max_wr_wide_log2;

0 commit comments

Comments
 (0)