-
Notifications
You must be signed in to change notification settings - Fork 98
feat(ci): add workflow dispatch for STA timing analysis CI #817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xiaokamikami
wants to merge
2
commits into
master
Choose a base branch
from
sta_ci
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | ||
|
|
||
| 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 | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove it after test.