Skip to content

Commit 5af4148

Browse files
authored
Merge branch 'MikePopoloski:master' into master
2 parents 5b55ee1 + b8deb66 commit 5af4148

443 files changed

Lines changed: 65201 additions & 24293 deletions

File tree

Some content is hidden

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

.clang-tidy

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Checks: >
1414
-modernize-use-emplace,
1515
-modernize-return-braced-init-list,
1616
-modernize-loop-convert,
17+
-modernize-use-designated-initializers,
18+
-modernize-use-ranges,
19+
-modernize-use-integer-sign-comparison,
1720
-bugprone-suspicious-semicolon,
1821
-bugprone-branch-clone,
1922
-bugprone-sizeof-expression,
@@ -23,6 +26,8 @@ Checks: >
2326
-bugprone-unchecked-optional-access,
2427
-bugprone-assignment-in-if-condition,
2528
-bugprone-switch-missing-default-case,
29+
-bugprone-suspicious-stringview-data-usage,
30+
-bugprone-return-const-ref-from-parameter,
2631
-clang-analyzer-cplusplus.NewDelete*,
2732
-clang-analyzer-cplusplus.InnerPointer,
2833
-clang-analyzer-core.NullDereference,
@@ -36,6 +41,9 @@ Checks: >
3641
-misc-use-anonymous-namespace,
3742
-misc-include-cleaner,
3843
-misc-header-include-cycle,
44+
-misc-use-internal-linkage,
3945
-performance-no-int-to-ptr,
4046
-performance-enum-size,
41-
-portability-simd-intrinsics
47+
-portability-simd-intrinsics,
48+
-portability-template-virtual-member-function,
49+
-performance-unnecessary-value-param

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ assignees: ''
77

88
---
99

10+
**Is your bug report related to the C++ slang project or the pyslang Python bindings?**
11+
C++ slang / Pyslang Python bindings
12+
1013
**Describe the bug**
1114
A clear and concise description of what the bug is.
1215

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ assignees: ''
77

88
---
99

10+
**Is your feature request related to the C++ slang project or the pyslang Python bindings?**
11+
C++ slang / Pyslang Python bindings
12+
1013
**Is your feature request related to a problem? Please describe.**
1114
A clear and concise description of what the problem is.
1215

.github/copilot-instructions.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
This project is a SystemVerilog compiler and set of related tools, developed in C++.
2+
Code in the repository is expected to be extremely high quality, with a focus on performance and correctness.
3+
Please follow the instructions below to ensure that your contributions meet these standards.
4+
5+
## Development Flow
6+
cmake is used to build the project. The following commands are used to build and run the tests:
7+
```bash
8+
cmake -B build
9+
cmake --build build -j8
10+
ctest --test-dir build --output-on-failure
11+
```
12+
13+
## Code Style
14+
Please follow the style of the existing code. Modern C++ features, up to C++ 20, are preferred, and the code should
15+
be written in a way that is easy to read and understand.
16+
17+
`pre-commit` is used to enforce formatting prior to committing. It should be installed and configured to run
18+
automatically on commit.
19+
20+
## Guidelines
21+
1. Follow C++ best practices and idiomatic patterns
22+
2. Maintain existing code structure and organization
23+
3. Write unit tests for new functionality.
24+
4. Document public APIs and complex logic.
25+
- API reference documentation is added via Doxygen comments.
26+
- More in-depth documentation is added via Markdown files in the `docs` directory.
27+
28+
## Python Bindings
29+
This project includes Python bindings fsor the main library. These bindings are generated using pybind11.
30+
When adding to or changing the public API, consider updating the Python bindings as well.
31+
The bindings are located in the `bindings/python` directory. The tests and documentation for the Python bindings
32+
are in the 'pyslang' folder. The bindings are built using CMake, and the following commands
33+
are used to build and run the tests:
34+
```bash
35+
pip install . --no-build-isolation --config-settings build-dir=build/python_build
36+
pytest
37+
```

.github/workflows/build.yml

Lines changed: 5 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: CI Build
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches: [ master ]
67
pull_request:
@@ -15,7 +16,7 @@ jobs:
1516
- preset: clang-sanitize
1617
os: ubuntu-latest
1718
- preset: gcc-release
18-
os: ubuntu-latest
19+
os: ubuntu-24.04-arm
1920
- preset: gcc-11-release
2021
os: ubuntu-latest
2122
- preset: gcc-debug-shared
@@ -40,78 +41,19 @@ jobs:
4041
if: matrix.os == 'ubuntu-latest'
4142
run: |
4243
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
43-
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main"
44+
sudo add-apt-repository "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main"
4445
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
4546
sudo apt-get update
46-
sudo apt-get install -y g++-13 g++-11 clang-18 clang-tidy-18
47+
sudo apt-get install -y g++-14 g++-11 clang-20 clang-tidy-20
4748
- uses: ilammy/msvc-dev-cmd@v1
4849
if: matrix.os == 'windows-latest'
4950
- uses: maxim-lobanov/setup-xcode@v1
5051
if: matrix.os == 'macos-latest'
5152
with:
5253
xcode-version: 'latest'
5354
- name: Configure
54-
run: cmake --preset ${{ matrix.preset }} -DSLANG_CI_BUILD=ON
55+
run: cmake --preset ${{ matrix.preset }} -DSLANG_CI_BUILD=ON -DSLANG_INCLUDE_UVM_TEST=ON
5556
- name: Build
5657
run: cmake --build build/${{ matrix.preset }} -j8
5758
- name: Run tests
5859
run: ctest --test-dir build/${{ matrix.preset }} --output-on-failure --no-tests=error -j8
59-
60-
linux-coverage:
61-
runs-on: ubuntu-latest
62-
steps:
63-
- uses: actions/checkout@v4
64-
with:
65-
fetch-depth: 0
66-
- name: Install dependencies
67-
run: |
68-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
69-
sudo apt-get update
70-
sudo apt-get install -y g++-13 lcov
71-
- name: Configure
72-
run: cmake --preset=ci-coverage
73-
- name: Build
74-
run: cmake --build build/ci-coverage -j8
75-
- name: Run tests
76-
run: ctest --test-dir build/ci-coverage --output-on-failure --no-tests=error -j8
77-
- name: Process coverage info
78-
run: cmake --build build/ci-coverage -t coverage
79-
- name: Submit to codecov.io
80-
uses: codecov/codecov-action@v4
81-
with:
82-
files: build/ci-coverage/coverage.info
83-
token: ${{ secrets.CODECOV_TOKEN }}
84-
verbose: true
85-
86-
bindings:
87-
runs-on: windows-latest
88-
steps:
89-
- uses: actions/checkout@v4
90-
with:
91-
fetch-depth: 0
92-
- uses: ilammy/msvc-dev-cmd@v1
93-
- name: Configure
94-
run: cmake -B build -DSLANG_INCLUDE_PYLIB=ON
95-
- name: Build
96-
run: cmake --build build --config Release -j8
97-
- name: Run tests
98-
run: ctest --test-dir build --output-on-failure -C Release --no-tests=error -j8
99-
100-
conan:
101-
runs-on: ubuntu-latest
102-
steps:
103-
- uses: actions/checkout@v4
104-
with:
105-
fetch-depth: 0
106-
- name: Install dependencies
107-
run: |
108-
pip3 install conan
109-
conan profile detect
110-
- name: Configure
111-
run: |
112-
conan install . -b missing
113-
cmake --preset conan-gcc-x86_64-release
114-
- name: Build
115-
run: cmake --build --preset conan-gcc-x86_64-release -j8
116-
- name: Run tests
117-
run: ctest --preset conan-gcc-x86_64-release --output-on-failure --no-tests=error -j8
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Allow testing of the setup steps from your repository's "Actions" tab.
4+
on: workflow_dispatch
5+
6+
jobs:
7+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
8+
copilot-setup-steps:
9+
runs-on: ubuntu-latest
10+
11+
# Set the permissions to the lowest permissions possible needed for your steps.
12+
# Copilot will be given its own token for its operations.
13+
permissions:
14+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
15+
contents: read
16+
17+
# You can define any steps you want, and they will run before the agent starts.
18+
# If you do not check out your code, Copilot will do this for you.
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Install Dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install pytest pre-commit pybind11 scikit-build-core
29+
pre-commit install
30+
pre-commit run
31+
32+
- name: Configure and Build
33+
run: |
34+
cmake -B build
35+
cmake --build build -j8

.github/workflows/coverage.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Coverage
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
linux-coverage:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Install dependencies
18+
run: |
19+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
20+
sudo apt-get update
21+
sudo apt-get install -y g++-14
22+
wget --quiet https://github.com/linux-test-project/lcov/releases/download/v2.3/lcov-2.3.tar.gz
23+
tar -xf lcov-2.3.tar.gz
24+
cd lcov-2.3
25+
sudo make install
26+
sudo cpan App::cpanminus
27+
sudo cpanm --notest Capture::Tiny DateTime
28+
- name: Configure
29+
run: cmake --preset=ci-coverage
30+
- name: Build
31+
run: cmake --build build/ci-coverage -j8
32+
- name: Run tests
33+
run: ctest --test-dir build/ci-coverage --output-on-failure --no-tests=error -j8
34+
- name: Process coverage info
35+
run: cmake --build build/ci-coverage -t coverage
36+
- name: Submit to codecov.io
37+
uses: codecov/codecov-action@v5
38+
with:
39+
files: build/ci-coverage/coverage.info
40+
plugins: noop
41+
disable_search: true
42+
token: ${{ secrets.CODECOV_TOKEN }}
43+
verbose: true

.github/workflows/docs.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: docs
2+
description: Build and deploy documentation (both C++/slang and Python/pyslang)
23

34
on:
45
push:
@@ -14,19 +15,31 @@ jobs:
1415
- uses: actions/checkout@v4
1516
with:
1617
fetch-depth: 0
18+
- name: Install Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.12'
1722
- name: Install dependencies
1823
run: |
19-
pip install jinja2 pygments
20-
wget https://sourceforge.net/projects/doxygen/files/rel-1.9.5/doxygen-1.9.5.linux.bin.tar.gz
21-
tar -xvf doxygen-1.9.5.linux.bin.tar.gz
22-
cp doxygen-1.9.5/bin/doxygen /usr/local/bin
23-
- name: Build
24+
pip install jinja2 pygments docutils
25+
wget --quiet https://sourceforge.net/projects/doxygen/files/rel-1.13.2/doxygen-1.13.2.linux.bin.tar.gz
26+
tar -xf doxygen-1.13.2.linux.bin.tar.gz
27+
cp doxygen-1.13.2/bin/doxygen /usr/local/bin
28+
- name: Build slang and pyslang docs via CMake
2429
run: |
2530
cmake -B build -DSLANG_INCLUDE_DOCS=ON -DSLANG_INCLUDE_TESTS=OFF
2631
cmake --build build --target docs -j8
32+
- name: Compress docs artifacts
33+
run: |
2734
tar -czvf slang.tar.gz build/docs build/bin/slang
35+
- name: Upload artifact for preview
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: slang-docs
39+
path: slang.tar.gz
40+
retention-days: 4
2841
- name: Upload
29-
if: github.event_name != 'pull_request'
42+
if: github.event_name != 'pull_request' && github.repository == 'MikePopoloski/slang'
3043
uses: appleboy/scp-action@master
3144
with:
3245
host: ${{ secrets.SSH_DEPLOY_HOST }}
@@ -37,7 +50,7 @@ jobs:
3750
source: slang.tar.gz
3851
target: upload/
3952
- name: Deploy
40-
if: github.event_name != 'pull_request'
53+
if: github.event_name != 'pull_request' && github.repository == 'MikePopoloski/slang'
4154
uses: appleboy/ssh-action@master
4255
with:
4356
host: ${{ secrets.SSH_DEPLOY_HOST }}

.github/workflows/python-build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Python Build"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
build:
12+
name: Build with Pip
13+
runs-on: ${{ matrix.platform }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
platform: [windows-latest, macos-latest, ubuntu-latest]
18+
python-version: ["3.11", "pypy-3.9"]
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- uses: maxim-lobanov/setup-xcode@v1
24+
if: matrix.platform == 'macos-latest'
25+
with:
26+
xcode-version: 'latest'
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install pytest
34+
- name: Build and install
35+
run: pip install --verbose .
36+
- name: Test
37+
run: pytest

0 commit comments

Comments
 (0)