Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
89dccd0
Fix order-dependency in small-signal analysis from IndexSet::remove d…
robtaylor Nov 23, 2025
d873d56
CI: Enable integration tests
robtaylor Nov 23, 2025
f1af54e
Fix non-deterministic compilation causing random CI test failures
robtaylor Nov 24, 2025
c7373fa
Update snapshots
robtaylor Nov 25, 2025
91fbc20
CI: Cache cargo build
robtaylor Nov 23, 2025
8f286f8
Fix LLVM 18 compatibility on macOS ARM64
robtaylor Nov 23, 2025
5e78320
CI: Update for LLVM 18 and enable integration tests
robtaylor Nov 23, 2025
2ca51bf
Remove architecture-specific values from OSDI integration test snapshots
robtaylor Nov 23, 2025
ee55b8f
Fix ld64.lld linking on macOS for LLVM 18
robtaylor Nov 23, 2025
d05eeb6
Fix ARM64 SIGSEGV: correct snprintf varargs calling convention
robtaylor Nov 23, 2025
a59434d
Fix linking of built objects on macos
robtaylor Nov 28, 2025
cf62143
Fix order-dependency in small-signal analysis from IndexSet::remove d…
robtaylor Nov 23, 2025
1e59226
cargo fmt
arpadbuermen Dec 4, 2025
803d556
Updated README, enabled CI for macos-patches-v3.
arpadbuermen Dec 4, 2025
fcec645
Fixed snprintf bug where i32 was passed but size_t was expected.
arpadbuermen Dec 9, 2025
679428a
CI: Explictly install rust toolchain
robtaylor Dec 9, 2025
ffba6c0
CI: Add arch to cache keys
robtaylor Dec 9, 2025
a3e2476
CI: Fix actionlint warnings
robtaylor Dec 9, 2025
b896fd1
Instance parameter defaulting fixed.
arpadbuermen Dec 15, 2025
26e6094
Reverting 15f11cb because it breaks smsig analysis.
arpadbuermen Dec 15, 2025
2c8e5bc
Fix macOS linking without LLVM_SYS_181_PREFIX
robtaylor Dec 12, 2025
763d3ed
Fix small-signal analysis bug from speculative node addition (issue #30)
robtaylor Dec 16, 2025
23143d5
Fix ARM64 dominator violation in Pow derivative handling (issue #27)
robtaylor Dec 16, 2025
309676b
Minor changes in issue #27 fix.
arpadbuermen Dec 17, 2025
fb7e316
Migrate from LLVM 18 to LLVM 21
robtaylor Nov 23, 2025
bd0447a
Add multi-LLVM version support (18, 19, 20, 21)
robtaylor Dec 2, 2025
c373c95
Simplify macOS CI to use default Homebrew LLVM
robtaylor Dec 2, 2025
6c5f69b
Fix test compilation with multi-LLVM support
robtaylor Dec 2, 2025
5b38995
Simplify Ubuntu CI to test only LLVM 18 and 21
robtaylor Dec 2, 2025
082d9cf
Fix LLVM detection on Ubuntu by creating llvm-config symlink
robtaylor Dec 2, 2025
b7552ee
Fix symlink creation when file already exists
robtaylor Dec 2, 2025
e44c942
Build specific packages to avoid workspace feature unification
robtaylor Dec 2, 2025
338ba3b
CI: Run integration tests against openvaf rather than openvaf-driver
robtaylor Dec 18, 2025
aec36c2
Auto-detect Homebrew LLVM on macOS for simpler builds
robtaylor Dec 24, 2025
8135c31
Remove default LLVM version, add auto-detection scripts
robtaylor Dec 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 166 additions & 39 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
- name: Configure sccache
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"

- uses: actions/checkout@v4

Expand All @@ -46,7 +46,63 @@ jobs:
- name: Run cargo machete
run: cargo machete

# Detect available LLVM versions from GitHub releases
detect-llvm-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Query LLVM releases and generate matrix
id: set-matrix
run: |
# Query LLVM GitHub releases for available major versions
# We support LLVM 18, 19, 20, 21
SUPPORTED_VERSIONS="18 19 20 21"

# Check which versions are available via apt.llvm.org
AVAILABLE_VERSIONS=""
for ver in $SUPPORTED_VERSIONS; do
# Check if the version is available (apt.llvm.org hosts versions 11+)
if curl -s --head "https://apt.llvm.org/llvm.sh" | head -1 | grep -q "200"; then
AVAILABLE_VERSIONS="$AVAILABLE_VERSIONS $ver"
fi
done

# For now, use a static list of versions we know work
# apt.llvm.org supports versions 11-21
# Generate JSON matrix
MATRIX='{"include":['

# LLVM 18.1 - Ubuntu Noble system package
MATRIX="${MATRIX}{\"llvm_version\":\"18\",\"llvm_env_var\":\"LLVM_SYS_181_PREFIX\",\"cargo_features\":\"--no-default-features --features llvm18\"}"

# LLVM 19.1
MATRIX="${MATRIX},{\"llvm_version\":\"19\",\"llvm_env_var\":\"LLVM_SYS_191_PREFIX\",\"cargo_features\":\"--no-default-features --features llvm19\"}"

# LLVM 20.1
MATRIX="${MATRIX},{\"llvm_version\":\"20\",\"llvm_env_var\":\"LLVM_SYS_201_PREFIX\",\"cargo_features\":\"--no-default-features --features llvm20\"}"

# LLVM 21.1
MATRIX="${MATRIX},{\"llvm_version\":\"21\",\"llvm_env_var\":\"LLVM_SYS_211_PREFIX\",\"cargo_features\":\"--no-default-features --features llvm21\"}"

MATRIX="${MATRIX}]}"

echo "Generated matrix: $MATRIX"
echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT"

ubuntu-build-test:
strategy:
fail-fast: false
matrix:
include:
# LLVM 18 - Ubuntu Noble system package
- llvm_version: "18"
llvm_env_var: "LLVM_SYS_181_PREFIX"
cargo_features: "--no-default-features --features llvm18"
# LLVM 21 - Latest from apt.llvm.org
- llvm_version: "21"
llvm_env_var: "LLVM_SYS_211_PREFIX"
cargo_features: "--no-default-features --features llvm21"
runs-on: ubuntu-latest
needs: [format, machete]
steps:
Expand All @@ -65,40 +121,72 @@ jobs:
- name: Configure sccache
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"

- name: "Cache cargo"
id: cache-cargo
uses: "actions/cache@v4"
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
save-always: true
key: ${{ runner.os }}-${{runner.arch}}-llvm${{ matrix.llvm_version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{runner.arch}}-llvm${{ matrix.llvm_version }}-cargo-

- name: Install LLVM 18 and Windows cross-compilation tools
- name: Install LLVM ${{ matrix.llvm_version }} and Windows cross-compilation tools
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt-get install -y llvm-18 llvm-18-dev libclang-18-dev
sudo ./llvm.sh ${{ matrix.llvm_version }}
sudo apt-get install -y llvm-${{ matrix.llvm_version }} llvm-${{ matrix.llvm_version }}-dev libclang-${{ matrix.llvm_version }}-dev

# Install llvm-lib for Windows cross-compilation
sudo apt-get install -y mingw-w64

# Create symlink for llvm-lib
sudo ln -s /usr/bin/llvm-ar-18 /usr/local/bin/llvm-lib
sudo ln -sf /usr/bin/llvm-ar-${{ matrix.llvm_version }} /usr/local/bin/llvm-lib

# Verify installation
which llvm-lib
llvm-lib --version

- name: Set LLVM environment variables
run: |
echo "LLVM_SYS_181_PREFIX=/usr/lib/llvm-18" >> $GITHUB_ENV
echo "CLANG_PATH=/usr/lib/llvm-18/bin/clang" >> $GITHUB_ENV
echo "PATH=/usr/lib/llvm-18/bin:$PATH" >> $GITHUB_ENV
echo "RUST_BACKTRACE=1" >> $GITHUB_ENV
# See https://gitlab.com/taricorp/llvm-sys.rs/#llvm-compatibility for details
# Set LLVM prefix for llvm-sys crate
echo "${{ matrix.llvm_env_var }}=/usr/lib/llvm-${{ matrix.llvm_version }}" >> "$GITHUB_ENV"

# llvm-sys needs llvm-config to be findable - create symlink in the LLVM bin dir if not already present
sudo mkdir -p /usr/lib/llvm-${{ matrix.llvm_version }}/bin
sudo ln -sf /usr/bin/llvm-config-${{ matrix.llvm_version }} /usr/lib/llvm-${{ matrix.llvm_version }}/bin/llvm-config || true

{
echo "CLANG_PATH=/usr/lib/llvm-${{ matrix.llvm_version }}/bin/clang"
echo "PATH=/usr/lib/llvm-${{ matrix.llvm_version }}/bin:$PATH"
echo "RUST_BACKTRACE=1"
} >> "$GITHUB_ENV"

# Verify llvm-config is accessible
/usr/lib/llvm-${{ matrix.llvm_version }}/bin/llvm-config --version

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential

- name: Build
run: cargo build --release
run: |
# Build specific packages to avoid workspace feature unification issues
# that cause multiple llvm-sys versions to be compiled
cargo build --release --package openvaf-driver ${{ matrix.cargo_features }}
cargo build --release --package openvaf ${{ matrix.cargo_features }}
cargo build --release --package osdi ${{ matrix.cargo_features }}
cargo build --release --package mir_llvm ${{ matrix.cargo_features }}

- name: Show sccache stats
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
Expand All @@ -109,7 +197,15 @@ jobs:
# run: cargo clippy -- -D warnings

- name: Run tests
run: cargo test --release
run: |
# Run tests for specific packages to avoid workspace feature unification issues
cargo test --release --package openvaf-driver ${{ matrix.cargo_features }}
cargo test --release --package openvaf ${{ matrix.cargo_features }}
cargo test --release --package osdi ${{ matrix.cargo_features }}
cargo test --release --package mir_llvm ${{ matrix.cargo_features }}

- name: Run integration tests
run: cargo test --release --package openvaf --test integration ${{ matrix.cargo_features }}

msys2-build-test:
strategy:
Expand Down Expand Up @@ -149,39 +245,49 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/sccache
key: ${{ runner.os }}-sccache-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-${{ runner.arch }}}-sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-sccache-
${{ runner.os }}-${{ runner.arch }}-sccache-

- name: Locate and configure sccache
shell: msys2 {0}
run: |
# export SCCACHE_PATH=$(which sccache)
# echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=${SCCACHE_PATH}" >> $GITHUB_ENV
# echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "RUSTC_WRAPPER=${SCCACHE_PATH}" >> "$GITHUB_ENV"

- name: "Cache cargo"
id: cache-cargo
uses: "actions/cache@v4"
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
save-always: true
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ runner.arch }}-cargo-

- name: Run cargo
shell: msys2 {0}
run: cargo build --release
run: cargo build --release --features llvm21
#- name: Show sccache stats
# if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
# shell: msys2 {0}
# run: $SCCACHE_PATH --show-stats

- name: Run tests
shell: msys2 {0}
run: cargo test --release
run: cargo test --release --features llvm21

macos-build-test:
strategy:
fail-fast: false
matrix:
include:
# Intel
- image: macos-15-intel
# ARM64
- image: macos-15
- image: macos-14
# Use default Homebrew LLVM (latest) on all macOS runners
image: [macos-15-intel, macos-15, macos-14]

runs-on: ${{ matrix.image }}
needs: [format, machete]
Expand All @@ -192,24 +298,45 @@ jobs:
- name: Install dependencies with Homebrew
uses: tecolicom/actions-use-homebrew-tools@v1
with:
tools: pkg-config sccache llvm@18
tools: pkg-config sccache llvm
cache: yes

- name: Set LLVM environment variables
run: |
echo "$(brew --prefix llvm@18)/bin" >> $GITHUB_PATH
echo "LLVM_SYS_181_PREFIX=$(brew --prefix llvm@18)" >> $GITHUB_ENV
echo "RUST_BACKTRACE=1" >> $GITHUB_ENV
echo "RUN_DEV_TESTS=1" >> $GITHUB_ENV
echo "$(brew --prefix llvm)/bin" >> "$GITHUB_PATH"
{
echo "LLVM_SYS_211_PREFIX=$(brew --prefix llvm)"
echo "RUST_BACKTRACE=1"
echo "RUN_DEV_TESTS=1"
} >> "$GITHUB_ENV"

- name: sccache setup
run: |
# echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=$(which sccache)" >> $GITHUB_ENV

# echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "RUSTC_WRAPPER=$(which sccache)" >> "$GITHUB_ENV"

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: "Cache cargo"
id: cache-cargo
uses: "actions/cache@v4"
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
save-always: true
key: ${{ runner.os }}-${{runner.arch}}-llvm-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{runner.arch}}-llvm-cargo-

- name: Build
run: cargo build --release
run: cargo build --release --features llvm21

- name: Run tests
run: cargo test --release
run: cargo test --release --features llvm21

- name: Run integration tests
run: cargo test --release --features llvm21 --test integration
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ markus_notes
.env
**.swp
**.swo
.llvm-version
5 changes: 3 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
"kind": "bin"
}
},
// "args": [ "--dump-mir", "--dump-unopt-mir", /* "--dump-ir", */ "simp1.va" ],
"args": [ "--dump-mir", "--dump-unopt-mir", /* "--dump-ir", */ "${workspaceFolder}/integration_tests/HiSIMHV/hisimhv.va" ],
"args": [ "--dump-mir", /*"--dump-unopt-mir", "--dump-ir", */ "simp1.va" ],
// "args": [ "--dump-mir", "--dump-unopt-mir", /* "--dump-ir", */ "${workspaceFolder}/integration_tests/HiSIMHV/hisimhv.va" ],
// "args": [ "--dump-mir", "--dump-unopt-mir", /* "--dump-ir", */ "/home/arpadb/rram/hisim/hisimhv.va" ],
// "args": [ "--dump-mir", "--dump-unopt-mir", /* "--dump-ir", */ "resistor.va" ],
// "args": [ "--dump-mir", /*"--dump-unopt-mir", "--dump-ir", */ "/home/arpadb/sim/VACASK/devices/opamp.va" ],
"cwd": "${workspaceFolder}/..",
"env": {
"RAYON_NUM_THREADS": "1"
Expand Down
Loading
Loading