Skip to content

Commit 87c6063

Browse files
authored
Port to Python 3.10, add Ubuntu 22.04 CI jobs (#7)
1 parent 7109dff commit 87c6063

27 files changed

+85
-66
lines changed

.github/workflows/build.yaml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ concurrency:
3030
jobs:
3131
check:
3232
name: "Check RTLMeter"
33-
runs-on: ubuntu-24.04
33+
strategy:
34+
matrix:
35+
os:
36+
- ubuntu-22.04
37+
- ubuntu-24.04
38+
runs-on: ${{ matrix.os }}
3439
outputs:
3540
cases: ${{ steps.gatherCases.outputs.cases }}
3641
steps:
@@ -57,6 +62,7 @@ jobs:
5762
run: make spellcheck
5863
- name: Gather cases for run
5964
id: gatherCases
65+
if: ${{ matrix.os == 'ubuntu-24.04' }}
6066
run: |
6167
# Gather all configurations into a JSON list
6268
echo "cases=[" >> cases.json
@@ -72,17 +78,22 @@ jobs:
7278
build-verilator:
7379
name: "Build Verilator"
7480
needs: check # Not really a dependency, but don't bother if 'check' fails
75-
runs-on: ubuntu-24.04
7681
strategy:
7782
matrix:
7883
cxx:
7984
- g++
8085
- clang++
86+
os:
87+
- ubuntu-22.04
88+
- ubuntu-24.04
89+
runs-on: ${{ matrix.os }}
8190
steps:
8291
- name: Install dependencies
8392
run: |
8493
sudo apt update
85-
sudo apt install ccache mold help2man libfl-dev libgoogle-perftools-dev libsystemc-dev
94+
sudo apt install ccache mold help2man libfl-dev libsystemc-dev
95+
# Some conflict of libunwind verison on 22.04, can live without it
96+
[[ "${{ matrix.os }}" == "ubuntu-22.04" ]] || sudo apt install libgoogle-perftools-dev
8697
- name: Checkout Verilator
8798
uses: actions/checkout@v4
8899
with:
@@ -101,26 +112,31 @@ jobs:
101112
run: make install
102113
- name: Tar up installation
103114
working-directory: verilator
104-
run: tar --posix -c -z -f verilator-${{ matrix.cxx }}.tar.gz install
115+
run: tar --posix -c -z -f verilator-${{ matrix.cxx }}-${{ matrix.os }}.tar.gz install
105116
- name: Upload Verilator installation archive
106117
uses: actions/upload-artifact@v4
107118
with:
108-
path: verilator/verilator-${{ matrix.cxx }}.tar.gz
109-
name: verilator-${{ matrix.cxx }}
119+
path: verilator/verilator-${{ matrix.cxx }}-${{ matrix.os }}.tar.gz
120+
name: verilator-${{ matrix.cxx }}-${{ matrix.os }}
110121

111122
run-with-verilator:
112123
name: Run
113124
needs:
114125
- check
115126
- build-verilator
116-
runs-on: ubuntu-24.04
117127
strategy:
118128
max-parallel: 8
119129
matrix:
120130
cxx:
121131
- g++
122132
- clang++
133+
os:
134+
- ubuntu-22.04
135+
- ubuntu-24.04
123136
case: ${{ fromJson(needs.check.outputs.cases) }}
137+
exclude:
138+
- { os: ubuntu-22.04, cxx: clang++ } # Seems to fill up disk space
139+
runs-on: ${{ matrix.os }}
124140
steps:
125141
- name: Checkout
126142
uses: actions/checkout@v4
@@ -136,10 +152,10 @@ jobs:
136152
- name: Download Verilator installation archive
137153
uses: actions/download-artifact@v4
138154
with:
139-
name: verilator-${{ matrix.cxx }}
155+
name: verilator-${{ matrix.cxx }}-${{ matrix.os }}
140156
- name: Unpack Verilator installation archive
141157
run: |
142-
tar -x -z -f verilator-${{ matrix.cxx }}.tar.gz
158+
tar -x -z -f verilator-${{ matrix.cxx }}-${{ matrix.os }}.tar.gz
143159
ls -la
144160
- name: Run
145161
working-directory: rtlmeter

.github/workflows/docs.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ name: Docs
1818

1919
on:
2020
push:
21-
branches: ["main"]
21+
branches:
22+
- main
23+
pull_request:
2224
workflow_dispatch:
2325

2426
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
@@ -52,6 +54,7 @@ jobs:
5254

5355
# Deployment job
5456
deploy:
57+
if: ${{ github.repository == 'verilator/rtlmeter' && github.event_name == 'push' && github.ref_name == 'main' }}
5558
environment:
5659
name: github-pages
5760
url: ${{ steps.deployment.outputs.page_url }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ venv:
2929

3030
.PHONY: typecheck
3131
typecheck:
32-
env MYPYPATH=$(PYTHONPATH) $(PYTHON) -m mypy --disable-error-code=import-untyped src/main.py
32+
env MYPYPATH=$(PYTHONPATH) $(PYTHON) -m mypy --disable-error-code=import-untyped src/rtlmeter/main.py
3333

3434
.PHONY: lint
3535
lint:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Dependencies
3434
We try to keep external dependencies to a minimum. You will need the following
3535
available through your shell ``$PATH``:
3636

37-
- Python 3.12 or newer as ``python3``
37+
- Python 3.10 or newer as ``python3``
3838
- An installation of Verilator as ``verilator``
3939

4040
All other dependencies are managed via a Python virtual environment, please see

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
# -- General configuration ---------------------------------------------------
3535

36-
needs_sphinx = "8.2"
36+
needs_sphinx = "8.1"
3737

3838
extensions = ["sphinx_copybutton"]
3939

docs/source/descriptor.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ For examples, please refer to the existing descriptors in the repository (
1010
``designs/*/descriptor.yaml``).
1111

1212
The formal schema of the descriptor used for run-time validation can
13-
be found in `src/schema.yaml
14-
<https://github.com/verilator/rtlmeter/blob/main/src/schema.yaml>`_.
13+
be found in `src/rtlmeter/schema.yaml
14+
<https://github.com/verilator/rtlmeter/blob/main/src/rtlmeter/schema.yaml>`_.
1515

1616
Types of entries
1717
----------------

docs/source/gettingstarted.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Start by cloning the repository, then ``cd`` to the root of the project:
1919
Setting up dependencies
2020
-----------------------
2121

22-
We assume you have Python 3.12 or newer available through your shell ``$PATH``
22+
We assume you have Python 3.10 or newer available through your shell ``$PATH``
2323
as ``python3``. To confirm, you can run ``python3 --version``.
2424

2525
Python dependencies are manged through a virtual environment that you can

docs/source/spelling_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
benchmarking
2+
boolean
23
Ccache
34
cocotb
45
Dhrystone

python-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pyyaml==6.0.2
88
ruff==0.9.3
99
scikit-learn==1.6.1
1010
scipy==1.15.1
11-
sphinx==8.2.3
11+
sphinx==8.1.3
1212
sphinxcontrib-spelling==8.0.1
1313
sphinx-copybutton==0.5.2
1414
sphinx-rtd-theme==3.0.2

rtlmeter

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717

1818
export RTLMETER_ROOT=$(dirname $(readlink -f $0))
1919
export PYTHONPATH="${RTLMETER_ROOT}/src:$PYTHONPATH"
20-
exec ${RTLMETER_ROOT}/venv/bin/python3 -m src.main "$@"
20+
exec ${RTLMETER_ROOT}/venv/bin/python3 -m src.rtlmeter.main "$@"

0 commit comments

Comments
 (0)