Skip to content
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

Support VCS in Nix #680

Merged
merged 22 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
bff6a36
[difftest] revert add rtl unexcepted quit check in difftest"
sequencer Jul 31, 2024
c827f9b
[ipemu] Fix Testbench for X
sequencer Jul 31, 2024
01a995f
[rtl] don't use RRArbiter for XProp
qinjun-li Jul 31, 2024
319be56
[nix] remove old ipemu
sequencer Jul 28, 2024
1016183
[ipemu] rename dpi_pre_link to verilator_shim
sequencer Jul 20, 2024
fba5320
[ipemu] move DPI logic to online_dpi crate
FanShupei Jul 21, 2024
f174038
[ipemu] add svdpi.h raw bindings
FanShupei Jul 21, 2024
7d1dbfa
[ipemu] use svdpi to get time and dump waveform
FanShupei Jul 21, 2024
52e16e5
[ipemu] add sv_vpi_user.h raw bindings
FanShupei Jul 21, 2024
2bbfbe4
[ipemu] support get simulation time through vpi
FanShupei Jul 21, 2024
14a9395
[ipemu] rename cosim_init -> t1_cosim_init
FanShupei Jul 21, 2024
bdc232c
[ipemu] mark cosim_init as context
FanShupei Jul 26, 2024
a08e8e1
[ipemu] remember cosim_init scope
FanShupei Jul 25, 2024
2fc7ee8
[ipemu] remove default vlen/dlen value
Avimitin Jul 28, 2024
a5c19ca
[ipemu] add fsdbdump support in TestBench
sequencer Jul 21, 2024
ddf18fa
[ipemu] add VCS DPI library build target
FanShupei Jul 28, 2024
6507ca6
[nix] refactor nix for vcs+verilator emulator
sequencer Jul 28, 2024
3594eb4
[nix] add derivation for vcs artifacts
Avimitin Jul 29, 2024
59a0544
[ci] add VCS CI
sequencer Jul 30, 2024
22a4ac9
[ci] refactor workflows into multiple runs
sequencer Jul 30, 2024
1840074
[ci] update test case cycle data
invalid-email-address Jul 31, 2024
b41af67
[ci] Verilog won't block PR CI anymore
sequencer Jul 31, 2024
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
514 changes: 257 additions & 257 deletions .github/cases/blastoise/default.json

Large diffs are not rendered by default.

462 changes: 231 additions & 231 deletions .github/cases/machamp/default.json

Large diffs are not rendered by default.

474 changes: 237 additions & 237 deletions .github/cases/sandslash/default.json

Large diffs are not rendered by default.

147 changes: 4 additions & 143 deletions .github/workflows/daily-regression.yml
Original file line number Diff line number Diff line change
@@ -1,151 +1,12 @@
name: Daily Regression
name: Chisel and CIRCT Bump
on:
schedule:
# Run this job everyday at 6:30 AM UTC+8
- cron: '30 22 * * *'
# Run this job everyday at 5:30 AM UTC+8
- cron: '30 21 * * *'

jobs:
gen-matrix:
name: "Generate test matrix"
runs-on: [self-hosted, linux, nixos, BIGRAM]
env:
RUNNERS: 70
outputs:
test-plan: ${{ steps.gen-matrix.outputs.matrix }}
steps:
# actions/checkout will use the "event" commit to checkout repository,
# which will lead to an unexpected issue that the "event" commit doesn't belongs to the repository,
# and causing the derivation build output cannot be cache correctly.
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- id: gen-matrix
name: "Generate test matrix"
run: |
echo -n matrix= >> "$GITHUB_OUTPUT"
nix develop -c t1-helper generateRegressionTestPlan --runnersAmount "$RUNNERS" >> "$GITHUB_OUTPUT"

run-testcases:
name: "Run testcases"
needs: [gen-matrix]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.gen-matrix.outputs.test-plan) }}
runs-on: [self-hosted, linux, nixos]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: "Run testcases"
run: |
nix develop -c t1-helper runTests --jobs "${{ matrix.jobs }}" \
--resultDir test-results-$(head -c 10 /dev/urandom | base32) \
--dontBail

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-reports-${{ matrix.id }}
path: |
test-results-*/failed-tests.md
test-results-*/cycle-updates.md

gen-perf-matrix:
name: "Generate test matrix for perf cases"
runs-on: [self-hosted, linux, nixos, BIGRAM]
env:
RUNNERS: 70
outputs:
perf-plan: ${{ steps.gen-matrix.outputs.matrix }}
steps:
# actions/checkout will use the "event" commit to checkout repository,
# which will lead to an unexpected issue that the "event" commit doesn't belongs to the repository,
# and causing the derivation build output cannot be cache correctly.
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- id: gen-matrix
name: "Generate test matrix"
run: |
echo -n matrix= >> "$GITHUB_OUTPUT"
nix develop -c t1-helper generateCiMatrix --testPlanFile "perf.json" --runnersAmount "$RUNNERS" >> "$GITHUB_OUTPUT"

run-perfcases:
name: "Run perf cases"
needs: [gen-perf-matrix]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.gen-perf-matrix.outputs.perf-plan) }}
runs-on: [self-hosted, linux, nixos]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: "Run testcases"
run: |
nix develop -c t1-helper runTests --jobs "${{ matrix.jobs }}" \
--resultDir test-results-$(head -c 10 /dev/urandom | base32)

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: perf-reports-${{ matrix.id }}
path: |
test-results-*/failed-tests.md
test-results-*/cycle-updates.md
test-results-*/*_cycle.json

report:
name: "Report CI result"
if: ${{ !cancelled() }}
needs: [run-testcases]
runs-on: [self-hosted, linux, nixos]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
- uses: actions/download-artifact@v4
with:
pattern: '*-reports-*'
merge-multiple: true
- run: |
echo -e "\n## Newly passed tests\n" >> "$GITHUB_STEP_SUMMARY"
shopt -s nullglob
cat test-results-*/cycle-updates.md >> "$GITHUB_STEP_SUMMARY"
- run: |
echo -e "\n## Still failing tests\n" >> "$GITHUB_STEP_SUMMARY"
shopt -s nullglob
cat test-results-*/failed-tests.md >> "$GITHUB_STEP_SUMMARY"
- name: "Commit cycle updates"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
nix develop -c t1-helper mergeCycleData --filePat perf.json
git config user.name github-actions
git config user.email [email protected]
changed_cases=$(git diff --name-only '.github/cases/**/perf.json')

if [ -n "$changed_cases" ]; then
echo "changed cases: $changed_cases"
currentDate=$(date +%F)
branch="cycle-update-$currentDate"
git checkout -b "$branch"
git add '.github/cases/**/perf.json'
git commit -m "[ci] update test case cycle data at $currentDate"
git push origin "$branch" --force-with-lease
nix run '.#gh' -- \
pr create --title "Update perf cycle" --body "Update test cycles."
else
echo "No cycle change detect"
fi
- uses: geekyeggo/delete-artifact@v4
with:
# test-reports has been used, it can be deleted
name: test-reports-*

bump-deps:
name: "Bump Chisel"
name: "Bump Chisel and CIRCT"
if: ${{ !cancelled() }}
runs-on: [self-hosted, linux, nixos]
steps:
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/pd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Trigger Physical Design Workflow
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- labeled
env:
USER: runner

# Cancel the current workflow when new commit pushed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
test-emit:
if: '! github.event.pull_request.draft'
name: "Test elaborate"
runs-on: [self-hosted, linux, nixos]
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: "Test elaborate"
run: |
configArray=( $(ls configgen/generated | sed 's/\.json$//') )
for cfg in "${configArray[@]}"; do
echo "Building .#t1.${cfg}.ip.rtl"
if ! nix build ".#t1.${cfg}.ip.rtl" -L; then
failed_rtl_configs+=("${cfg}.ip")
fi
if ! nix run ".#ci-helper" -- runOMTests --config ${cfg}; then
failed_om+=("${cfg}")
fi
done
if [ -n "${failed_rtl_configs[*]}" ]; then
echo -e "## Failed RTL\n" >> "$GITHUB_STEP_SUMMARY"
for cfg in "${failed_rtl_configs[@]}"; do
echo "* ${cfg}" >> $GITHUB_STEP_SUMMARY
done
echo -e "## Failed RTL\n" >> "$GITHUB_STEP_SUMMARY"
for cfg in "${failed_om[@]}"; do
echo "* ${cfg}" >> $GITHUB_STEP_SUMMARY
done
printf "\n" >> $GITHUB_STEP_SUMMARY
fi

physical-design-report:
name: "Request physical design report"
if: ${{ success() && (contains(github.event.pull_request.labels.*.name, 'PD-Lane') || contains(github.event.pull_request.labels.*.name, 'PD-Lane-DBG'))}}
runs-on: ubuntu-latest
needs: [test-emit]
steps:
- name: "Request report"
env:
# Use env key can help us inspect the data
JSON_CTX: ${{ toJson(github.event.pull_request.labels.*.name) }}
run: |
# GitHub `toJson` will pretty print JSON and causing multiple line escape issue
# So we have to redirect it to file here
printf "$JSON_CTX" > _ctx.json
pdType=$(jq -r 'map(select(. | test("^PD-Lane.*"))) | .[0]' _ctx.json)
if [[ -z "$pdType" ]] || [[ "$pdType" == "null" ]]; then
echo "Unable to filter Physical Design type"
exit 1
fi

commitSha="${{ github.event.pull_request.head.sha }}"
prId="${{ github.event.pull_request.number }}"
jq -n \
--arg commit_sha "$commitSha" \
--arg pr_id "$prId" \
--arg pd_type "$pdType" \
'{"event_type":"ci_success","client_payload":{"commit_sha": $commit_sha,"pr_id": $pr_id, "pd_type": $pd_type }}' \
> payload.json
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.T1_INHOUSE_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"${{ secrets.T1_INHOUSE_URL }}" \
-d '@payload.json'
Loading