-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from xinyangli/ci-test
ci: build and test all on native and riscv32-nemu
- Loading branch information
Showing
243 changed files
with
60,580 additions
and
62,477 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Test openperf | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
env: | ||
AM_HOME: "${{ github.workspace }}/abstract-machine" | ||
NEMU_HOME: "${{ github.workspace }}/nemu" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
continue-on-error: true | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
test_size: ["test", "ref"] | ||
arch: ["native", "riscv32-nemu"] | ||
steps: | ||
|
||
- uses: nixbuild/nix-quick-install-action@v27 | ||
|
||
- uses: cachix/cachix-action@v14 | ||
with: | ||
name: ysyx | ||
authToken: '${{ secrets.CACHIX_SIGNING_KEY }}' | ||
|
||
- name: Checkout Main Repo (openperf) | ||
id: checkout-openperf | ||
uses: actions/checkout@v4 | ||
with: | ||
path: openperf | ||
|
||
- name: Checkout Nemu Repo | ||
id: checkout-nemu | ||
if: ${{ contains(matrix.arch, 'nemu') }} | ||
uses: actions/checkout@v4 | ||
with: | ||
token: '${{ secrets.DEPLOY_KEY }}' | ||
repository: xinyangli/openperf-nemu | ||
path: nemu | ||
|
||
- name: Checkout Abstract Machine Repo | ||
id: checkout-am | ||
uses: actions/checkout@v4 | ||
with: | ||
token: '${{ secrets.DEPLOY_KEY }}' | ||
repository: xinyangli/openperf-abstract-machine | ||
path: abstract-machine | ||
|
||
- name: Prepare devshell | ||
run: | | ||
mkdir -p /tmp/env | ||
nix develop --no-use-registries --profile /tmp/env/openperf-env-${{ matrix.arch }} ./openperf#${{ matrix.arch }} | ||
- name: Cache common libraries | ||
uses: actions/cache@v4 | ||
with: | ||
key: openperf-common-${{ matrix.arch }}-${{ hashFiles('**/*.nix') }}-${{ steps.checkout-openperf.outputs.commit }}-${{ steps.checkout-am.outputs.commit }} | ||
path: openperf/src/common | ||
|
||
- name: Generate config if target platform is nemu | ||
if: ${{ contains(matrix.arch, 'nemu') }} | ||
run: | | ||
nix develop --no-use-registries /tmp/env/openperf-env-${{ matrix.arch }} --impure --command make -C $NEMU_HOME ARCH=riscv32-nemu openperf_${{ matrix.arch }}_defconfig | ||
- name: Build common libraries | ||
run: | | ||
nix develop --no-use-registries /tmp/env/openperf-env-${{ matrix.arch }} --impure --command make -C openperf ARCH=${{ matrix.arch }} ALL=dummy run | ||
- name: Run openperf benchmark | ||
working-directory: openperf | ||
run: | | ||
nix develop --no-use-registries /tmp/env/openperf-env-${{ matrix.arch }} --impure --command make ARCH=${{ matrix.arch }} mainargs=${{ matrix.test_size }} run | ||
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 |
---|---|---|
|
@@ -17,4 +17,6 @@ _* | |
build/ | ||
!.gitignore | ||
.vscode | ||
!mersenne-riscv32e.bin | ||
abstract-machine/ | ||
!.gitea | ||
!.github |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- gcc-13.3.0/gcc/gimple-ssa-store-merging.cc 2024-05-21 15:47:38.000000000 +0800 | ||
+++ gimple-ssa-store-merging.cc 2024-11-11 11:54:49.366712830 +0800 | ||
@@ -3157,6 +3157,10 @@ | ||
unsigned int min_order = first_order; | ||
unsigned first_nonmergeable_int_order = ~0U; | ||
unsigned HOST_WIDE_INT this_end = end; | ||
+ unsigned HOST_WIDE_INT this_bitregion_start | ||
+ = new_bitregion_start; | ||
+ unsigned HOST_WIDE_INT this_bitregion_end | ||
+ = new_bitregion_end; | ||
k = i; | ||
first_nonmergeable_order = ~0U; | ||
for (unsigned int j = i + 1; j < len; ++j) | ||
@@ -3180,6 +3184,19 @@ | ||
k = 0; | ||
break; | ||
} | ||
+ if (info2->bitregion_start | ||
+ < this_bitregion_start) | ||
+ this_bitregion_start = info2->bitregion_start; | ||
+ if (info2->bitregion_end | ||
+ > this_bitregion_end) | ||
+ this_bitregion_end = info2->bitregion_end; | ||
+ if (((this_bitregion_end - this_bitregion_start | ||
+ + 1) / BITS_PER_UNIT) | ||
+ > (unsigned) param_store_merging_max_size) | ||
+ { | ||
+ k = 0; | ||
+ break; | ||
+ } | ||
k = j; | ||
min_order = MIN (min_order, info2->order); | ||
this_end = MAX (this_end, | ||
@@ -5247,7 +5264,9 @@ | ||
|| !bitsize.is_constant (&const_bitsize) | ||
|| !bitpos.is_constant (&const_bitpos) | ||
|| !bitregion_start.is_constant (&const_bitregion_start) | ||
- || !bitregion_end.is_constant (&const_bitregion_end)) | ||
+ || !bitregion_end.is_constant (&const_bitregion_end) | ||
+ || ((const_bitregion_end - const_bitregion_start + 1) / BITS_PER_UNIT | ||
+ > (unsigned) param_store_merging_max_size)) | ||
return terminate_all_aliasing_chains (NULL, stmt); | ||
|
||
if (!ins_stmt) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,82 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
}; | ||
|
||
outputs = | ||
{ self, nixpkgs, ... }: | ||
{ | ||
devShells.x86_64-linux = | ||
let | ||
pkgs = import nixpkgs { system = "x86_64-linux"; }; | ||
patchGccStdenv = | ||
pkgs: stdenv: | ||
pkgs.overrideCC stdenv ( | ||
pkgs.wrapCC ( | ||
stdenv.cc.cc.overrideAttrs (final: prev: { patches = prev.patches ++ [ ./fix-gcc-ice.patch ]; }) | ||
) | ||
); | ||
crossSystem = { | ||
config = "riscv32-none-none-elf"; | ||
gcc = { | ||
abi = "ilp32"; | ||
arch = "rv32i"; | ||
}; | ||
}; | ||
localSystem = "x86_64-linux"; | ||
rv32CrossPkgs = import nixpkgs { | ||
inherit localSystem crossSystem; | ||
}; | ||
rv32LLVMCrossPkgs = import nixpkgs { | ||
inherit localSystem; | ||
crossSystem = crossSystem // { | ||
useLLVM = true; | ||
}; | ||
}; | ||
bareClangStdenv = | ||
with rv32LLVMCrossPkgs; | ||
overrideCC clangStdenv buildPackages.llvmPackages.clangNoLibc; | ||
|
||
nemuDepsBuildBuild = with pkgs; [ | ||
gnumake | ||
SDL2 | ||
pkg-config | ||
bison | ||
flex | ||
ncurses | ||
readline | ||
libllvm | ||
gcc | ||
clang | ||
]; | ||
in | ||
rec { | ||
nemu = rv32CrossPkgs.mkShell { | ||
name = "openperf"; | ||
depsBuildBuild = nemuDepsBuildBuild; | ||
|
||
CROSS_COMPILE = "riscv32-none-none-elf-"; | ||
}; | ||
|
||
nemu-clang = bareClangStdenv.mkDerivation { | ||
name = "openperf"; | ||
depsBuildBuild = nemuDepsBuildBuild; | ||
}; | ||
|
||
native = | ||
pkgs.mkShell.override | ||
{ | ||
stdenv = patchGccStdenv pkgs pkgs.stdenv; | ||
} | ||
{ | ||
name = "openperf"; | ||
buildInputs = with pkgs; [ | ||
gnumake | ||
SDL2 | ||
]; | ||
}; | ||
|
||
riscv32-nemu = nemu; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.