Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ee42095
Fix order-dependency in small-signal analysis from IndexSet::remove d…
robtaylor Nov 23, 2025
4386844
CI: Enable integration tests
robtaylor Nov 23, 2025
888b7b8
Fix non-deterministic compilation causing random CI test failures
robtaylor Nov 24, 2025
fc1c918
Update snapshots
robtaylor Nov 25, 2025
964c166
CI: Cache cargo build
robtaylor Nov 23, 2025
10a8c97
Fix LLVM 18 compatibility on macOS ARM64
robtaylor Nov 23, 2025
75641cd
CI: Update for LLVM 18 and enable integration tests
robtaylor Nov 23, 2025
263bab3
Remove architecture-specific values from OSDI integration test snapshots
robtaylor Nov 23, 2025
9323978
Fix ld64.lld linking on macOS for LLVM 18
robtaylor Nov 23, 2025
aeabad0
Fix ARM64 SIGSEGV: correct snprintf varargs calling convention
robtaylor Nov 23, 2025
f6e37a5
Fix linking of built objects on macos
robtaylor Nov 28, 2025
7c39e38
Fix order-dependency in small-signal analysis from IndexSet::remove d…
robtaylor Nov 23, 2025
4ae7dc0
cargo fmt
arpadbuermen Dec 4, 2025
4f9652b
Updated README, enabled CI for macos-patches-v3.
arpadbuermen Dec 4, 2025
436a8fe
Fixed snprintf bug where i32 was passed but size_t was expected.
arpadbuermen Dec 9, 2025
b28efdf
CI: Explictly install rust toolchain
robtaylor Dec 9, 2025
b50e12d
CI: Add arch to cache keys
robtaylor Dec 9, 2025
c8ddfca
CI: Fix actionlint warnings
robtaylor Dec 9, 2025
3136381
Instance parameter defaulting fixed.
arpadbuermen Dec 15, 2025
082ab0d
Reverting 15f11cb because it breaks smsig analysis.
arpadbuermen Dec 15, 2025
696ee99
Fix macOS linking without LLVM_SYS_181_PREFIX
robtaylor Dec 12, 2025
3a27a00
Fix small-signal analysis bug from speculative node addition (issue #30)
robtaylor Dec 16, 2025
c5bcea0
Fix ARM64 dominator violation in Pow derivative handling (issue #27)
robtaylor Dec 16, 2025
df44f4b
Minor changes in issue #27 fix.
arpadbuermen Dec 17, 2025
2c6c108
Migrate from LLVM 18 to LLVM 21
robtaylor Nov 23, 2025
30468ba
Add multi-LLVM version support (18, 19, 20, 21)
robtaylor Dec 2, 2025
8390b20
Simplify macOS CI to use default Homebrew LLVM
robtaylor Dec 2, 2025
253c650
Fix test compilation with multi-LLVM support
robtaylor Dec 2, 2025
f08a2d5
Simplify Ubuntu CI to test only LLVM 18 and 21
robtaylor Dec 2, 2025
afadf76
Fix LLVM detection on Ubuntu by creating llvm-config symlink
robtaylor Dec 2, 2025
43d7da5
Fix symlink creation when file already exists
robtaylor Dec 2, 2025
ea3f5e4
Build specific packages to avoid workspace feature unification
robtaylor Dec 2, 2025
ddb4814
CI: Run integration tests against openvaf rather than openvaf-driver
robtaylor Dec 18, 2025
5eca2a7
Auto-detect Homebrew LLVM on macOS for simpler builds
robtaylor Dec 24, 2025
a6ed07c
Minor changes.
arpadbuermen Dec 26, 2025
ddfe966
Remove default LLVM version, add auto-detection scripts
robtaylor Dec 27, 2025
af1ce82
Minor changes in README.
arpadbuermen Dec 28, 2025
f2e562b
Fixed JFET2 bug (mising phi nodes).
arpadbuermen Jan 7, 2026
75df7b3
Add VACASK device models as integration tests
robtaylor Dec 17, 2025
4cdfa51
Add --allow-analog-in-cond flag for non-standard Verilog-A models
robtaylor Nov 23, 2025
f8505dd
Add missing expected output for analog_in_cond test
robtaylor Dec 25, 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
211 changes: 172 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,11 +46,69 @@ 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:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -65,40 +123,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: Install LLVM 18 and Windows cross-compilation tools
- 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 ${{ 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 +199,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 All @@ -120,6 +218,8 @@ jobs:
needs: [format, machete]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
Expand Down Expand Up @@ -149,67 +249,100 @@ 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]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- 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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "external/vacask"]
path = external/vacask
url = https://codeberg.org/arpadbuermen/VACASK.git
9 changes: 6 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@
"args": [
"build",
"--bin=openvaf-r",
"--package=openvaf-driver"
"--package=openvaf-driver",
"--features", "llvm18"
],
"filter": {
"name": "openvaf-r",
"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" ],
"args": [ "--dump-unopt-mir", /*"--dump-unopt-mir", "--dump-ir", */ "/home/arpadb/OpenVAF/jfet2.va" ],
"cwd": "${workspaceFolder}/..",
"env": {
"RAYON_NUM_THREADS": "1"
Expand Down
Loading
Loading