-
Notifications
You must be signed in to change notification settings - Fork 23
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
[difftest] Add offline difftest and refactor libspike interfaces #603
Merged
+1,746
−561
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
fc18245
[difftest] add new spike interfaces to support offline difftest
Clo91eaf b9d912b
[difftest] add t1-simulator
Avimitin 2b36ca6
[emulator] write MMIO store to file
Avimitin 79822c5
[script] wrap programOutputPath for emulator
Avimitin a9f8448
[difftest] quit graceful
Clo91eaf 5fd5e7b
[difftest] add log level parameter to build script
Clo91eaf 8c3f9c3
[nix] abstract emu-result to a function
Avimitin 21a851a
[difftest] fix wrong rd record
Clo91eaf 724eb25
[difftest] add lane number config for spike init
Clo91eaf c913bd7
[difftest] add mcycle write
Clo91eaf ae5da5c
[difftest] skip mem write check to pass ci
Clo91eaf 56a85ca
[ci] add difftest ci
Clo91eaf 216c7cc
[difftest] remove tl check
Clo91eaf 7d05632
[difftest] remove mem read check
Clo91eaf 846bd30
[nix] store emulator log, journal, and other status to derivation output
Avimitin 6165ba7
[script] refactor runTests to use emu-result derivation as test runner
Avimitin 308a4d5
[script] migrate all post CI action to Scala script
Avimitin 7f20bf4
[difftest] add zstd for all event log
Avimitin 845d052
[ci] update test case cycle data
invalid-email-address 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 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -157,26 +157,13 @@ jobs: | |
fail-fast: false | ||
matrix: ${{ fromJSON(needs.gen-matrix.outputs.ci-tests) }} | ||
runs-on: [self-hosted, linux, nixos] | ||
outputs: | ||
result: ${{ steps.ci-run.outputs.result }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: "Run testcases" | ||
id: ci-run | ||
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: test-reports-${{ matrix.id }} | ||
path: | | ||
test-results-*/failed-tests.md | ||
test-results-*/cycle-updates.md | ||
test-results-*/*_cycle.json | ||
nix develop -c t1-helper runTests --jobs "${{ matrix.jobs }}" | ||
|
||
report: | ||
name: "Report CI result" | ||
|
@@ -191,21 +178,14 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.head_ref }} | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: test-reports-* | ||
merge-multiple: true | ||
- name: "Print step summary" | ||
run: | | ||
echo -e "\n## Failed tests\n" >> $GITHUB_STEP_SUMMARY | ||
shopt -s nullglob | ||
cat test-results-*/failed-tests.md >> $GITHUB_STEP_SUMMARY | ||
echo -e "\n## Cycle updates\n" >> $GITHUB_STEP_SUMMARY | ||
shopt -s nullglob | ||
cat test-results-*/cycle-updates.md >> $GITHUB_STEP_SUMMARY | ||
nix develop -c t1-helper postCI --failed-test-file-path ./failed-test.md --cycle-update-file-path ./cycle-update.md | ||
cat ./failed-test.md >> $GITHUB_STEP_SUMMARY | ||
echo >> $GITHUB_STEP_SUMMARY | ||
cat ./cycle-update.md >> $GITHUB_STEP_SUMMARY | ||
- name: "Commit cycle updates" | ||
run: | | ||
nix develop -c t1-helper mergeCycleData | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
changed_cases=$(git diff --name-only '.github/cases/**/default.json') | ||
|
@@ -218,17 +198,3 @@ jobs: | |
else | ||
echo "No cycle change detect" | ||
fi | ||
- uses: geekyeggo/delete-artifact@v5 | ||
with: | ||
# test-reports has been used, it can be deleted | ||
name: test-reports-* | ||
|
||
clean-after-cancelled: | ||
name: "Clean test reports [ON CANCELLED]" | ||
if: ${{ cancelled() }} | ||
runs-on: [self-hosted, linux, nixos] | ||
needs: [run-testcases] | ||
steps: | ||
- uses: geekyeggo/delete-artifact@v5 | ||
with: | ||
name: test-reports-* |
This file contains 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 |
---|---|---|
|
@@ -21,3 +21,4 @@ __pycache__ | |
.envrc | ||
test-results | ||
target | ||
.ccls-cache |
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,18 +1,26 @@ | ||
{ lib | ||
, libspike | ||
, rustPlatform | ||
, rust-analyzer | ||
, libspike_interfaces | ||
, rtl | ||
}: | ||
|
||
rustPlatform.buildRustPackage { | ||
name = "t1-simulator"; | ||
src = with lib.fileset; toSource { | ||
root = ./.; | ||
fileset = fileFilter (file: file.name != "default.nix") ./.; | ||
let | ||
self = rustPlatform.buildRustPackage { | ||
name = "t1-simulator"; | ||
src = with lib.fileset; toSource { | ||
root = ./.; | ||
fileset = fileFilter (file: file.name != "default.nix") ./.; | ||
}; | ||
passthru.devShell = self.overrideAttrs (old: { | ||
nativeBuildInputs = old.nativeBuildInputs ++ [ | ||
rust-analyzer | ||
]; | ||
}); | ||
buildInputs = [ libspike libspike_interfaces ]; | ||
cargoLock = { | ||
lockFile = ./Cargo.lock; | ||
}; | ||
}; | ||
buildInputs = [ libspike libspike_interfaces ]; | ||
cargoLock = { | ||
lockFile = ./Cargo.lock; | ||
}; | ||
} | ||
in | ||
self |
This file contains 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,11 @@ | ||
## Build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add more detail readme on the difftest, including the
|
||
|
||
```bash | ||
nix build ".#t1-simulator" | ||
``` | ||
|
||
## Develop | ||
|
||
```bash | ||
nix develop '.#t1-simulator.devShell' | ||
``` |
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.
Please add documentation to header files.
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.
And please think a question:
if we are going to use sail/qemu to replace spike in the future, how do we decouple this?
maybe
riscv_architecture_events.h