Skip to content

test(no_internal_clock): verify negedge wait semantics #582

test(no_internal_clock): verify negedge wait semantics

test(no_internal_clock): verify negedge wait semantics #582

Workflow file for this run

name: Regression
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
changes:
name: Changes Detection
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
has_changes: ${{ steps.filter.outputs.has_changes }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
predicate-quantifier: 'every'
filters: .github/filters.yml
test:
runs-on: ${{ matrix.os }}
needs: changes
if: ${{ needs.changes.outputs.has_changes == 'true' && !contains(github.event.head_commit.message, '[skip-ci]') }}
strategy:
matrix:
os: [ 'ubuntu-22.04' ]
# os: [ 'ubuntu-22.04', 'ubuntu-24.04' ]
verilator-version: [ 'v5.036', 'v5.040', 'v5.044', 'v5.046' ]
iverilog-tag: [ 's20250103', 'v13_0' ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup verilua
uses: ./.github/actions/setup-verilua
with:
runner-os: ${{ matrix.os }}
verilator-version: ${{ matrix.verilator-version }}
iverilog-tag: ${{ matrix.iverilog-tag }}
- name: Test verilua (Basic test)
run: |
STOP_ON_FAIL=1 VERBOSE=1 xmake run test
- name: Before upload artifact(package)
if: ${{ matrix.verilator-version == 'v5.038' && matrix.iverilog-tag == 's20250103' }}
run: |
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then ARCH="x64"; fi
PACKAGE_NAME=verilua-${ARCH}-${{ matrix.os }}-${GITHUB_SHA:0:7}
echo "PACKAGE_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV
xmake run clean_all
bash ./ci/package.sh ./artifact/${PACKAGE_NAME}.zip
unzip ./artifact/${PACKAGE_NAME}.zip -d ./artifact/${PACKAGE_NAME}_unzipped
- name: Upload artifact
if: ${{ matrix.verilator-version == 'v5.038' && matrix.iverilog-tag == 's20250103' }}
uses: actions/upload-artifact@v4
with:
name: "${{ env.PACKAGE_NAME }}"
path: "./artifact/${{ env.PACKAGE_NAME }}_unzipped/"
include-hidden-files: true
retention-days: 30
- name: Install mill
run: |
curl -L https://github.com/com-lihaoyi/mill/releases/download/0.11.2/0.11.2 > mill
chmod +x mill
sudo mv mill /usr/local/bin
which mill
mill --version
- name: Clone NHL2
id: nhl2-meta
run: |
git clone https://github.com/OpenXiangShan-Nanhu/NHL2.git NHL2
echo "sha=$(git -C NHL2 rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Cache NHL2 generated Verilog
id: cache-nhl2-verilog
uses: actions/cache@v4
with:
path: NHL2/build/Slice
key: ${{ runner.os }}-nhl2-slice-verilog-${{ steps.nhl2-meta.outputs.sha }}
- name: Test verilua (NHL2)
run: |
cd NHL2
echo "Current dir is: $(pwd)"
ls -l
export SIM=iverilog
xmake run -P . init
if [ "${{ steps.cache-nhl2-verilog.outputs.cache-hit }}" != "true" ] || ! compgen -G "build/Slice/*.sv" > /dev/null; then
echo "NHL2 Slice Verilog cache miss, rebuilding..."
xmake build -P . Slice
else
echo "Using cached NHL2 Slice Verilog from build/Slice"
fi
xmake build -P . TestSlice
xmake run -P . TestSlice
test-centos7:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.has_changes == 'true' && !contains(github.event.head_commit.message, '[skip-ci]') }}
strategy:
matrix:
iverilog-tag: [ 's20250103', 's20251012' ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-25.11
- name: Install dependencies via Nix
run: |
nix profile install nixpkgs#verilator --accept-flake-config
nix profile install nixpkgs#cmake --accept-flake-config
nix profile install nixpkgs#xmake --accept-flake-config
nix profile install nixpkgs#git --accept-flake-config
nix profile install nixpkgs#gperf --accept-flake-config
nix profile install nixpkgs#pixi --accept-flake-config
nix profile install nixpkgs#patchelf --accept-flake-config
nix profile install nixpkgs#python3 --accept-flake-config
pip install conan
- name: Cache Icarus Verilog installation
id: cache-iverilog
uses: actions/cache@v4
with:
path: /tmp/iverilog_installed
key: centos7-iverilog-${{ matrix.iverilog-tag }}
- name: Setup iverilog cache folder
if: steps.cache-iverilog.outputs.cache-hit != 'true'
run: |
mkdir -p /tmp/iverilog_installed
- name: Cache conan libs
id: cache-conan-libs
uses: actions/cache@v4
with:
path: /tmp/conan_installed
key: centos7-conan-libs-${{ hashFiles('**/conanfile*')}}
- name: Check conan libs
if: steps.cache-conan-libs.outputs.cache-hit == 'true'
run: |
ls -l /tmp/conan_installed
cp -r /tmp/conan_installed .
echo "CI_USE_CONAN_CACHE=1" >> $GITHUB_ENV
shell: bash
- name: Install conan libs
if : steps.cache-conan-libs.outputs.cache-hit != 'true'
run: |
xmake r install_other_libs
- name: Build verilua tools outside container
run: |
xmake run install_luajit
xmake build -y -v libsignal_db_gen
xmake run build_all_tools
- name: Setup glibc using pixi
run: |
bash ./ci/setup_pixi_glibc.sh
- name: Make wrapper for some tools
run: |
bash ./ci/make_tools_wrapper.sh
# - name: Setup upterm session
# uses: owenthereal/action-upterm@v1
- name: Setup and test in CentOS 7 container
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-v /nix:/nix \
-v "$HOME/.nix-profile:/nix-profile" \
-v /tmp/iverilog_installed:/tmp/iverilog_installed \
-w /workspace \
centos:7 \
bash -c '
set -e
# Setup build environment
bash ./ci/setup_centos_env.sh
source /opt/rh/devtoolset-11/enable
source $HOME/.cargo/env
export PATH=/nix-profile/bin:$PATH
export PATH=/tmp/iverilog_installed/bin:$PATH
export IVERILOG_HOME=/tmp/iverilog_installed
export XMAKE_ROOT=y
export NO_CPPTRACE=1
export CC=/opt/rh/devtoolset-11/root/usr/bin/gcc
export CXX=/opt/rh/devtoolset-11/root/usr/bin/g++
git config --global --add safe.directory /workspace
git config --global --add safe.directory /workspace/luajit-pro
git config --global --add safe.directory /workspace/extern/luajit_tcc
git config --global http.sslVerify false
if [ "${{ steps.cache-iverilog.outputs.cache-hit }}" != "true" ]; then
git clone https://github.com/steveicarus/iverilog.git
cd iverilog
git reset --hard ${{ matrix.iverilog-tag }}
bash ./autoconf.sh
bash ./configure --prefix=/tmp/iverilog_installed
make -j $(nproc)
make install
cd -
fi
xmake run install_libgmp
xmake run reinstall_luajit
xmake run install_luarocks
xmake run install_lua_modules
xmake run install_tinycc
xmake run -y -v build_libverilua
xmake build -y -v iverilog_vpi_module
xmake clean wave_vpi_main
xmake f --clean
xmake build wave_vpi_main
source ./verilua.sh
STOP_ON_FAIL=1 VERBOSE=1 xmake run test
xmake run clean_all
'
- name: Update conan libs cache files
if: steps.cache-conan-libs.outputs.cache-hit != 'true'
run: |
cp -r ./conan_installed /tmp/conan_installed
shell: bash
- name: Package
if: ${{ matrix.iverilog-tag == 's20250103' }}
run: |
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then ARCH="x64"; fi
PACKAGE_NAME="verilua-${ARCH}-centos-7-${GITHUB_SHA:0:7}"
echo "PACKAGE_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV
xmake run clean_all
bash ./ci/package.sh ./artifact/${PACKAGE_NAME}.zip
unzip ./artifact/${PACKAGE_NAME}.zip -d ./artifact/${PACKAGE_NAME}_unzipped
- name: Upload artifact
if: ${{ matrix.iverilog-tag == 's20250103' }}
uses: actions/upload-artifact@v4
with:
name: "${{ env.PACKAGE_NAME }}"
path: "./artifact/${{ env.PACKAGE_NAME }}_unzipped/"
include-hidden-files: true
retention-days: 30