Skip to content

Commit 8ffca44

Browse files
authored
Merge branch 'YosysHQ:main' into master
2 parents dd68612 + 26b5114 commit 8ffca44

File tree

80 files changed

+2616
-1118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2616
-1118
lines changed

.github/actions/setup-build-env/action.yml

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,65 @@
11
name: Build environment setup
22
description: Configure build env for Yosys builds
3+
4+
inputs:
5+
runs-on:
6+
required: true
7+
type: string
8+
get-build-deps:
9+
description: 'Install Yosys build dependencies'
10+
default: false
11+
required: false
12+
type: boolean
13+
get-docs-deps:
14+
description: 'Install Yosys docs dependencies'
15+
default: false
16+
required: false
17+
type: boolean
18+
get-test-deps:
19+
description: 'Install Yosys test dependencies'
20+
default: false
21+
required: false
22+
type: boolean
23+
get-iverilog:
24+
description: 'Install iverilog'
25+
default: false
26+
required: false
27+
type: boolean
28+
329
runs:
430
using: composite
531
steps:
6-
- name: Install Linux Dependencies
32+
# if updating common/build/docs dependencies, make sure to update README.md
33+
# and docs/source/getting_started/installation.rst to match.
34+
- name: Linux common dependencies
735
if: runner.os == 'Linux'
8-
shell: bash
9-
run: |
10-
sudo apt-get update
11-
sudo apt-get install gperf build-essential bison flex libfl-dev libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev libbz2-dev libgtest-dev
36+
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
37+
with:
38+
packages: gawk git make python3
39+
version: ${{ inputs.runs-on }}-commonys
40+
41+
- name: Linux build dependencies
42+
if: runner.os == 'Linux' && inputs.get-build-deps == 'true'
43+
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
44+
with:
45+
packages: bison clang flex libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev
46+
version: ${{ inputs.runs-on }}-buildys
47+
48+
- name: Linux docs dependencies
49+
if: runner.os == 'Linux' && inputs.get-docs-deps == 'true'
50+
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
51+
with:
52+
packages: graphviz xdot
53+
version: ${{ inputs.runs-on }}-docsys
54+
55+
# if updating test dependencies, make sure to update
56+
# docs/source/yosys_internals/extending_yosys/test_suites.rst to match.
57+
- name: Linux test dependencies
58+
if: runner.os == 'Linux' && inputs.get-test-deps == 'true'
59+
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
60+
with:
61+
packages: libgtest-dev
62+
version: ${{ inputs.runs-on }}-testys
1263

1364
- name: Install macOS Dependencies
1465
if: runner.os == 'macOS'
@@ -32,3 +83,9 @@ runs:
3283
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
3384
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
3485
echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
86+
87+
- name: Setup iverilog
88+
if: inputs.get-iverilog == 'true'
89+
uses: ./.github/actions/setup-iverilog
90+
with:
91+
runs-on: ${{ inputs.runs-on }}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: iverilog setup
2+
description: Cached build and install of iverilog
3+
4+
inputs:
5+
runs-on:
6+
required: true
7+
type: string
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: iverilog Linux deps
13+
if: steps.restore-iverilog.outputs.cache-hit != 'true' && runner.os == 'Linux'
14+
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
15+
with:
16+
packages: autoconf gperf make gcc g++ bison flex libbz2-dev
17+
version: ${{ inputs.runs-on }}-iverilog
18+
19+
- name: iverilog macOS deps
20+
if: steps.restore-iverilog.outputs.cache-hit != 'true' && runner.os == 'macOS'
21+
shell: bash
22+
run: |
23+
brew install autoconf
24+
25+
- name: Get iverilog
26+
id: get-iverilog
27+
shell: bash
28+
run: |
29+
git clone https://github.com/steveicarus/iverilog.git
30+
cd iverilog
31+
echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
32+
33+
- name: Get vcd2fst
34+
shell: bash
35+
run: |
36+
git clone https://github.com/mmicko/libwave.git
37+
mkdir -p ${{ github.workspace }}/.local/
38+
cd libwave
39+
cmake . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.local
40+
make -j$procs
41+
make install
42+
43+
- uses: actions/cache/restore@v4
44+
id: restore-iverilog
45+
with:
46+
path: .local/
47+
key: ${{ inputs.runs-on }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }}
48+
49+
- name: Build iverilog
50+
if: steps.restore-iverilog.outputs.cache-hit != 'true'
51+
shell: bash
52+
run: |
53+
mkdir -p ${{ github.workspace }}/.local/
54+
cd iverilog
55+
autoconf
56+
CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local
57+
make -j$procs
58+
make install
59+
60+
- name: Check iverilog
61+
shell: bash
62+
run: |
63+
iverilog -V
64+
65+
- uses: actions/cache/save@v4
66+
id: save-iverilog
67+
if: steps.restore-iverilog.outputs.cache-hit != 'true'
68+
with:
69+
path: .local/
70+
key: ${{ steps.restore-iverilog.outputs.cache-primary-key }}

.github/workflows/codeql.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ jobs:
1010
name: Analyze
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Install deps
14-
run: sudo apt-get install bison flex libfl-dev libreadline-dev tcl-dev libffi-dev
15-
1613
- name: Checkout repository
1714
uses: actions/checkout@v4
1815
with:
1916
submodules: true
2017
persist-credentials: false
2118

19+
- name: Setup environment
20+
uses: ./.github/actions/setup-build-env
21+
with:
22+
runs-on: ubuntu-latest
23+
get-build-deps: true
24+
2225
- name: Initialize CodeQL
2326
uses: github/codeql-action/init@v3
2427
with:

.github/workflows/extra-builds.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ jobs:
7373
persist-credentials: false
7474
- name: Build
7575
run: |
76-
WASI_SDK=wasi-sdk-19.0
77-
WASI_SDK_URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz
76+
WASI_SDK=wasi-sdk-27.0-x86_64-linux
77+
WASI_SDK_URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-27/wasi-sdk-27.0-x86_64-linux.tar.gz
7878
if ! [ -d ${WASI_SDK} ]; then curl -L ${WASI_SDK_URL} | tar xzf -; fi
7979
8080
FLEX_VER=2.6.4

.github/workflows/test-build.yml

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ jobs:
6060

6161
- name: Setup environment
6262
uses: ./.github/actions/setup-build-env
63+
with:
64+
runs-on: ${{ matrix.os }}
65+
get-build-deps: true
6366

6467
- name: Build
6568
shell: bash
@@ -105,48 +108,10 @@ jobs:
105108

106109
- name: Setup environment
107110
uses: ./.github/actions/setup-build-env
108-
109-
- name: Get iverilog
110-
id: get-iverilog
111-
shell: bash
112-
run: |
113-
git clone https://github.com/steveicarus/iverilog.git
114-
cd iverilog
115-
echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
116-
117-
- name: Get vcd2fst
118-
shell: bash
119-
run: |
120-
git clone https://github.com/mmicko/libwave.git
121-
mkdir -p ${{ github.workspace }}/.local/
122-
cd libwave
123-
cmake . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.local
124-
make -j$procs
125-
make install
126-
127-
- name: Cache iverilog
128-
id: cache-iverilog
129-
uses: actions/cache@v4
130111
with:
131-
path: .local/
132-
key: ${{ matrix.os }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }}
133-
134-
- name: iverilog macOS deps
135-
if: steps.cache-iverilog.outputs.cache-hit != 'true' && runner.os == 'macOS'
136-
shell: bash
137-
run: |
138-
brew install autoconf
139-
140-
- name: Build iverilog
141-
if: steps.cache-iverilog.outputs.cache-hit != 'true'
142-
shell: bash
143-
run: |
144-
mkdir -p ${{ github.workspace }}/.local/
145-
cd iverilog
146-
autoconf
147-
CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local
148-
make -j$procs
149-
make install
112+
runs-on: ${{ matrix.os }}
113+
get-test-deps: true
114+
get-iverilog: true
150115

151116
- name: Download build artifact
152117
uses: actions/download-artifact@v4
@@ -191,6 +156,8 @@ jobs:
191156

192157
- name: Setup environment
193158
uses: ./.github/actions/setup-build-env
159+
with:
160+
runs-on: ${{ matrix.os }}
194161

195162
- name: Download build artifact
196163
uses: actions/download-artifact@v4
@@ -229,6 +196,10 @@ jobs:
229196

230197
- name: Setup environment
231198
uses: ./.github/actions/setup-build-env
199+
with:
200+
runs-on: ${{ matrix.os }}
201+
get-build-deps: true
202+
get-docs-deps: true
232203

233204
- name: Download build artifact
234205
uses: actions/download-artifact@v4

.github/workflows/test-compile.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- 'gcc-14'
4646
include:
4747
# macOS x86
48-
- os: macos-13
48+
- os: macos-15-intel
4949
compiler: 'clang-19'
5050
# macOS arm
5151
- os: macos-latest
@@ -60,6 +60,9 @@ jobs:
6060

6161
- name: Setup environment
6262
uses: ./.github/actions/setup-build-env
63+
with:
64+
runs-on: ${{ matrix.os }}
65+
get-build-deps: true
6366

6467
- name: Setup Cpp
6568
uses: aminya/setup-cpp@v1

.github/workflows/test-sanitizers.yml

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -44,53 +44,11 @@ jobs:
4444

4545
- name: Setup environment
4646
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
6947
with:
70-
path: .local/
71-
key: ${{ matrix.os }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }}
72-
73-
- name: iverilog macOS deps
74-
if: steps.cache-iverilog.outputs.cache-hit != 'true' && runner.os == 'macOS'
75-
shell: bash
76-
run: |
77-
brew install autoconf
78-
79-
- name: Build iverilog
80-
if: steps.cache-iverilog.outputs.cache-hit != 'true'
81-
shell: bash
82-
run: |
83-
mkdir -p ${{ github.workspace }}/.local/
84-
cd iverilog
85-
autoconf
86-
CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local
87-
make -j$procs
88-
make install
89-
90-
- name: Check iverilog
91-
shell: bash
92-
run: |
93-
iverilog -V
48+
runs-on: ${{ matrix.os }}
49+
get-build-deps: true
50+
get-test-deps: true
51+
get-iverilog: true
9452

9553
- name: Build
9654
shell: bash

.github/workflows/wheels.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ jobs:
2525
archs: "aarch64",
2626
},
2727
{
28-
name: "macOS 13",
28+
name: "macOS 15 x64",
2929
family: "macos",
30-
runner: "macos-13",
30+
runner: "macos-15-intel",
3131
archs: "x86_64",
3232
},
3333
{
34-
name: "macOS 14",
34+
name: "macOS 15 arm64",
3535
family: "macos",
36-
runner: "macos-14",
36+
runner: "macos-15",
3737
archs: "arm64",
3838
},
3939
## Windows is disabled because of an issue with compiling FFI as
@@ -59,7 +59,7 @@ jobs:
5959
shell: bash
6060
run: |
6161
mkdir -p ffi
62-
curl -L https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz | tar --strip-components=1 -xzC ffi
62+
curl -L https://github.com/libffi/libffi/releases/download/v3.4.8/libffi-3.4.8.tar.gz | tar --strip-components=1 -xzC ffi
6363
- if: ${{ matrix.os.family == 'linux' }}
6464
name: "[Linux] Bison 3.8.2"
6565
shell: bash
@@ -114,7 +114,7 @@ jobs:
114114
path: ./wheelhouse/*.whl
115115
upload_wheels:
116116
name: Upload Wheels
117-
if: github.repository == 'YosysHQ/Yosys'
117+
if: (github.repository == 'YosysHQ/Yosys') && (github.event_name == 'workflow_dispatch')
118118
runs-on: ubuntu-latest
119119
# Specifying a GitHub environment is optional, but strongly encouraged
120120
environment: pypi

.github/workflows/wheels/_run_cibw_linux.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424

2525
__yosys_root__ = Path(__file__).absolute().parents[3]
2626

27-
for source in ["boost", "ffi", "bison"]:
27+
for source in ["ffi", "bison"]:
2828
if not (__yosys_root__ / source).is_dir():
2929
print(
30-
"You need to download boost, ffi and bison in a similar manner to wheels.yml first."
30+
"You need to download ffi and bison in a similar manner to wheels.yml first."
3131
)
3232
exit(-1)
3333

0 commit comments

Comments
 (0)