Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
102 changes: 102 additions & 0 deletions .github/workflows/sta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: STA Nightly Regression

on:
schedule:
# 12:00 UTC == 20:00 UTC+8
- cron: '00 12 * * *'
workflow_dispatch:
pull_request:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove it after test.


jobs:
run-sta-xiangshan:
timeout-minutes: 2880
runs-on: [self-hosted, node]

steps:
- uses: actions/checkout@v4

- name: Prepare XiangShan
run: |
cd $GITHUB_WORKSPACE/..
rm -rf XiangShan
proxychains git clone --single-branch --branch main --depth 1 https://github.com/OpenXiangShan/XiangShan.git
cd XiangShan && make init && rm -rf difftest && cp -r $GITHUB_WORKSPACE .
echo "NOOP_HOME=$(pwd)" >> $GITHUB_ENV
echo "DIFF_RTL_HOME=$(pwd)/difftest/build" >> $GITHUB_ENV

- name: Build XiangShan
run: |
cd $NOOP_HOME
make verilog DEBUG_ARGS="--difftest-config ESBIFDU --difftest-exclude Vec" FPGA=1 WITH_CHISELDB=0 WITH_CONSTANTIN=0 CONFIG=XSNoCDiffTopConfig -j10

- name: Build DiffTest
run: |
cd $NOOP_HOME/difftest
export NOOP_HOME=$(pwd)
make difftest_verilog PROFILE=../build/generated-src/difftest_profile.json NUMCORES=1 CONFIG=ESBIFDU

- name: Run STA
run: |
export PATH=/nfs/home/share/tools/yosys:$PATH
export YOSYS_STA_DIR=/nfs/home/share/tools/yosys-sta
export ABC_THREADS=16
export YOSYS_TIMEOUT=12h
export ISTA_TIMEOUT=24h
export TIMEOUT_KILL_AFTER=10m
RUN_STA_TOTAL_TIMEOUT=40h
cd $NOOP_HOME/difftest
RUN_STA_LOG=./scripts/ieda/sta_results/run_sta.log
RUN_STA_STATUS=./scripts/ieda/sta_results/run_sta.status
# Keep STA output in file to avoid CI pipeline log-streaming side effects.
set +e
if ! command -v timeout >/dev/null 2>&1; then
echo "ERROR: timeout command not found on runner"
exit 2
fi
RUN_STA_LOG_TO_FILE=1 RUN_STA_LOG_CONSOLE=0 RUN_STA_LOG_FILE=$RUN_STA_LOG RUN_STA_STATUS_FILE=$RUN_STA_STATUS \
timeout --foreground --signal=TERM --kill-after=15m "$RUN_STA_TOTAL_TIMEOUT" \
bash ./scripts/ieda/run_sta.sh $DIFF_RTL_HOME GatewayEndpoint
EXIT_CODE=$?
set -e
echo "run_sta exit code: $EXIT_CODE"
# Print a compact summary to CI logs after completion.
if [ -f "$RUN_STA_STATUS" ]; then
echo "=== run_sta status markers (from $RUN_STA_STATUS) ==="
tail -n 100 "$RUN_STA_STATUS" || true
else
echo "WARNING: run_sta status file not found: $RUN_STA_STATUS"
fi
if [ -f "$RUN_STA_LOG" ]; then
echo "=== run_sta summary (from $RUN_STA_LOG) ==="
grep -E '(^Step|^===|^---|^Error:|^ERROR:|completed|saved|Results|ABC threads|yosys-sta|RTL directory|Clock|PDK|Netlist|Timing analysis|Critical path|Summary)' \
"$RUN_STA_LOG" | tail -n 200 || true
else
echo "WARNING: run_sta log not found: $RUN_STA_LOG"
fi
if [ "$EXIT_CODE" -ne 0 ] && [ -f "$RUN_STA_LOG" ]; then
echo "=== run_sta log tail (last 200 lines) ==="
tail -n 200 "$RUN_STA_LOG" || true
fi
if [ "$EXIT_CODE" -eq 124 ] || [ "$EXIT_CODE" -eq 137 ]; then
echo "ERROR: run_sta timeout reached (total=$RUN_STA_TOTAL_TIMEOUT, yosys=$YOSYS_TIMEOUT, ista=$ISTA_TIMEOUT)"
fi
# Keep original non-zero exit code from run_sta.sh (including timeout 124).
if [ "$EXIT_CODE" -ne 0 ]; then
exit $EXIT_CODE
fi
# Check output artifacts only when run_sta.sh completed successfully.
if [ ! -f "./scripts/ieda/sta_results/critical_paths.txt" ]; then
echo "ERROR: run_sta succeeded but critical_paths.txt not found"
exit 1
fi
exit $EXIT_CODE

- name: Print critical results
run: |
cd $NOOP_HOME/difftest
if [ -f "./scripts/ieda/sta_results/critical_paths.txt" ]; then
cat ./scripts/ieda/sta_results/critical_paths.txt
else
echo "ERROR: critical_paths.txt not found!"
exit 1
fi
Loading
Loading