From 5b2766829b8cb8294afed67a366e43850c2d4c0b Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 1 Feb 2024 09:18:15 -0800 Subject: [PATCH 01/30] misc: Merge develop .github dir into stable (#831) --- .github/dependabot.yml | 17 +++++ .github/workflows/compiler-tests.yaml | 5 +- .github/workflows/daily-tests.yaml | 20 ++--- .github/workflows/gpu-tests.yaml | 95 ------------------------ .github/workflows/weekly-tests.yaml | 101 +++++++++++++++++++++++--- 5 files changed, 120 insertions(+), 118 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/gpu-tests.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..196c33c0be --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,17 @@ +--- +version: 2 +updates: + - package-ecosystem: pip + directory: / + schedule: + interval: monthly + assignees: + - Harshil2107 + commit-message: + prefix: 'misc: ' + # Raise pull requests for version updates + # to pip against the `develop` branch + target-branch: develop + # Labels on pull requests for version updates only + labels: + - misc diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index 4656563357..5e903732ce 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -38,9 +38,8 @@ jobs: strategy: fail-fast: false matrix: - gem5-compilation: [ARM, ARM_MESI_Three_Level, ARM_MESI_Three_Level_HTM, ARM_MOESI_hammer, Garnet_standalone, GCN3_X86, MIPS, 'NULL', NULL_MESI_Two_Level, - NULL_MOESI_CMP_directory, NULL_MOESI_CMP_token, NULL_MOESI_hammer, POWER, RISCV, SPARC, X86, X86_MI_example, X86_MOESI_AMD_Base, VEGA_X86, - GCN3_X86] + gem5-compilation: [ARM, ARM_MESI_Three_Level, ARM_MESI_Three_Level_HTM, ARM_MOESI_hammer, Garnet_standalone, MIPS, 'NULL', NULL_MESI_Two_Level, + NULL_MOESI_CMP_directory, NULL_MOESI_CMP_token, NULL_MOESI_hammer, POWER, RISCV, SPARC, X86, X86_MI_example, X86_MOESI_AMD_Base, VEGA_X86] image: [gcc-version-12, clang-version-16] opts: [.opt] runs-on: [self-hosted, linux, x64] diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 987f5c1ad2..6aeb195b1f 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -280,25 +280,25 @@ jobs: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. ref: develop - - name: Compile build/GCN3_X86/gem5.opt - run: scons build/GCN3_X86/gem5.opt -j $(nproc) + - name: Compile build/VEGA_X86/gem5.opt + run: scons build/VEGA_X86/gem5.opt -j $(nproc) - name: Get Square test-prog from gem5-resources uses: wei/wget@v1 with: - args: -q http://dist.gem5.org/dist/develop/test-progs/square/square # Removed -N bc it wasn't available within actions, should be okay bc workspace is clean every time: https://github.com/coder/sshcode/issues/102 - - name: Run Square test with GCN3_X86/gem5.opt (SE mode) + args: -q https://dist.gem5.org/dist/v24-0/test-progs/square/square # Removed -N bc it wasn't available within actions, should be okay bc workspace is clean every time: https://github.com/coder/sshcode/issues/102 + - name: Run Square test with VEGA_X86/gem5.opt (SE mode) run: | mkdir -p tests/testing-results - ./build/GCN3_X86/gem5.opt configs/example/apu_se.py --reg-alloc-policy=dynamic -n3 -c square + ./build/VEGA_X86/gem5.opt configs/example/apu_se.py --reg-alloc-policy=dynamic -n3 -c square - name: Get allSyncPrims-1kernel from gem5-resources uses: wei/wget@v1 with: - args: -q http://dist.gem5.org/dist/develop/test-progs/heterosync/gcn3/allSyncPrims-1kernel # Removed -N bc it wasn't available within actions, should be okay bc workspace is clean every time - - name: Run allSyncPrims-1kernel sleepMutex test with GCN3_X86/gem5.opt (SE mode) - run: ./build/GCN3_X86/gem5.opt configs/example/apu_se.py --reg-alloc-policy=dynamic -n3 -c allSyncPrims-1kernel --options="sleepMutex 10 16 + args: -q https://dist.gem5.org/dist/v24-0/test-progs/heterosync/allSyncPrims-1kernel # Removed -N bc it wasn't available within actions, should be okay bc workspace is clean every time + - name: Run allSyncPrims-1kernel sleepMutex test with VEGA_X86/gem5.opt (SE mode) + run: ./build/VEGA_X86/gem5.opt configs/example/apu_se.py --reg-alloc-policy=dynamic -n3 -c allSyncPrims-1kernel --options="sleepMutex 10 16 4" - - name: Run allSyncPrims-1kernel lfTreeBarrUsing test with GCN3_X86/gem5.opt (SE mode) - run: ./build/GCN3_X86/gem5.opt configs/example/apu_se.py --reg-alloc-policy=dynamic -n3 -c allSyncPrims-1kernel --options="lfTreeBarrUniq + - name: Run allSyncPrims-1kernel lfTreeBarrUsing test with VEGA_X86/gem5.opt (SE mode) + run: ./build/VEGA_X86/gem5.opt configs/example/apu_se.py --reg-alloc-policy=dynamic -n3 -c allSyncPrims-1kernel --options="lfTreeBarrUniq 10 16 4" daily-tests: # The dummy job is used to indicate whether the daily tests have diff --git a/.github/workflows/gpu-tests.yaml b/.github/workflows/gpu-tests.yaml deleted file mode 100644 index a60218e6e7..0000000000 --- a/.github/workflows/gpu-tests.yaml +++ /dev/null @@ -1,95 +0,0 @@ ---- -# This workflow runs all the Weekly GPU Tests. -# For now this file is kept separate as we are still developing and testing -# this workflow. It will eventually be merged with "weekly-tests.yaml" - -name: Weekly Tests (GPU) - -on: - # Runs every Sunday from 7AM UTC - schedule: - - cron: 00 7 * * 6 - # Allows us to manually start workflow for testing - workflow_dispatch: - -jobs: - build-gem5: - runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/gcn-gpu:latest - steps: - - uses: actions/checkout@v3 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - - name: Build gem5 - run: scons build/VEGA_X86/gem5.opt -j $(nproc) --ignore-style - - uses: actions/upload-artifact@v3 - with: - name: weekly-test-${{ github.run_number }}-attempt-${{ github.run_attempt }}-gem5-build-vega - path: build/VEGA_X86/gem5.opt - retention-days: 5 - - run: echo "This job's status is ${{ job.status }}." - - LULESH-tests: - runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/gcn-gpu:latest - needs: build-gem5 - timeout-minutes: 480 # 8 hours - steps: - - uses: actions/checkout@v3 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - - - name: Download build/VEGA_X86/gem5.opt - uses: actions/download-artifact@v3 - with: - name: weekly-test-${{ github.run_number }}-attempt-${{ github.run_attempt }}-gem5-build-vega - path: build/VEGA_X86 - # `download-artifact` does not preserve permissions so we need to set - # them again. - - run: chmod u+x build/VEGA_X86/gem5.opt - - - name: Obtain LULESH - # Obtains the latest LULESH compatible with this version of gem5 via - # gem5 Resources. - run: build/VEGA_X86/gem5.opt util/obtain-resource.py lulesh -p lulesh - - - name: Run LULUESH tests - working-directory: ${{ github.workspace }} - run: | - build/VEGA_X86/gem5.opt configs/example/apu_se.py -n3 --mem-size=8GB --reg-alloc-policy=dynamic --dgpu --gfx-version=gfx900 -c \ - lulesh --options="0.01 2" - - HACC-tests: - runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/gcn-gpu:latest - needs: build-gem5 - timeout-minutes: 120 # 2 hours - steps: - - uses: actions/checkout@v3 - with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. - ref: develop - - uses: actions/download-artifact@v3 - with: - name: weekly-test-${{ github.run_number }}-attempt-${{ github.run_attempt }}-gem5-build-vega - path: build/VEGA_X86 - - run: chmod u+x build/VEGA_X86/gem5.opt - - name: make hip directory - run: mkdir hip - - name: Compile m5ops and x86 - working-directory: ${{ github.workspace }}/util/m5 - run: | - export TERM=xterm-256color - scons build/x86/out/m5 - - name: Download tests - working-directory: ${{ github.workspace }}/hip - run: wget http://dist.gem5.org/dist/v22-1/test-progs/halo-finder/ForceTreeTest - - name: Run HACC tests - working-directory: ${{ github.workspace }} - run: | - build/VEGA_X86/gem5.opt configs/example/apu_se.py -n3 --reg-alloc-policy=dynamic --benchmark-root=hip -c ForceTreeTest --options="0.5 0.1 64 0.1 1 N 12 rcb" diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index 6c211435c2..62d047709f 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -4,13 +4,94 @@ name: Weekly Tests on: - # Runs every Sunday from 7AM UTC + # Runs every Sunday from 7AM UTC schedule: - cron: 00 7 * * 6 - # Allows us to manually start workflow for testing + # Allows us to manually start workflow for testing workflow_dispatch: jobs: + build-gcn-gpu-gem5: + runs-on: [self-hosted, linux, x64] + container: ghcr.io/gem5/gcn-gpu:latest + steps: + - uses: actions/checkout@v3 + with: + # Scheduled workflows run on the default branch by default. We + # therefore need to explicitly checkout the develop branch. + ref: develop + - name: Build gem5 + run: scons build/VEGA_X86/gem5.opt -j $(nproc) --ignore-style + - uses: actions/upload-artifact@v3 + with: + name: weekly-test-${{ github.run_number }}-attempt-${{ github.run_attempt }}-gem5-build-vega + path: build/VEGA_X86/gem5.opt + retention-days: 5 + - run: echo "This job's status is ${{ job.status }}." + + LULESH-tests: + runs-on: [self-hosted, linux, x64] + container: ghcr.io/gem5/gcn-gpu:latest + needs: build-gcn-gpu-gem5 + timeout-minutes: 480 # 8 hours + steps: + - uses: actions/checkout@v3 + with: + # Scheduled workflows run on the default branch by default. We + # therefore need to explicitly checkout the develop branch. + ref: develop + + - name: Download build/VEGA_X86/gem5.opt + uses: actions/download-artifact@v3 + with: + name: weekly-test-${{ github.run_number }}-attempt-${{ github.run_attempt }}-gem5-build-vega + path: build/VEGA_X86 + # `download-artifact` does not preserve permissions so we need to set + # them again. + - run: chmod u+x build/VEGA_X86/gem5.opt + + - name: Obtain LULESH + # Obtains the latest LULESH compatible with this version of gem5 via + # gem5 Resources. + run: build/VEGA_X86/gem5.opt util/obtain-resource.py lulesh -p lulesh + + - name: Run LULUESH tests + working-directory: ${{ github.workspace }} + run: | + build/VEGA_X86/gem5.opt configs/example/apu_se.py -n3 --mem-size=8GB --reg-alloc-policy=dynamic --dgpu --gfx-version=gfx900 -c \ + lulesh --options="0.01 2" + + HACC-tests: + runs-on: [self-hosted, linux, x64] + container: ghcr.io/gem5/gcn-gpu:latest + needs: build-gcn-gpu-gem5 + timeout-minutes: 120 # 2 hours + steps: + - uses: actions/checkout@v3 + with: + # Scheduled workflows run on the default branch by default. We + # therefore need to explicitly checkout the develop branch. + ref: develop + - uses: actions/download-artifact@v3 + with: + name: weekly-test-${{ github.run_number }}-attempt-${{ github.run_attempt }}-gem5-build-vega + path: build/VEGA_X86 + - run: chmod u+x build/VEGA_X86/gem5.opt + - name: make hip directory + run: mkdir hip + - name: Compile m5ops and x86 + working-directory: ${{ github.workspace }}/util/m5 + run: | + export TERM=xterm-256color + scons build/x86/out/m5 + - name: Download tests + working-directory: ${{ github.workspace }}/hip + run: wget http://dist.gem5.org/dist/v22-1/test-progs/halo-finder/ForceTreeTest + - name: Run HACC tests + working-directory: ${{ github.workspace }} + run: | + build/VEGA_X86/gem5.opt configs/example/apu_se.py -n3 --reg-alloc-policy=dynamic --benchmark-root=hip -c ForceTreeTest --options="0.5 0.1 64 0.1 1 N 12 rcb" + build-gem5: runs-on: [self-hosted, linux, x64] container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest @@ -19,8 +100,8 @@ jobs: steps: - uses: actions/checkout@v3 with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. + # Scheduled workflows run on the default branch by default. We + # therefore need to explicitly checkout the develop branch. ref: develop - id: artifact-name run: echo "name=$(date +"%Y-%m-%d_%H.%M.%S")-ALL" >> $GITHUB_OUTPUT @@ -34,7 +115,7 @@ jobs: retention-days: 5 - run: echo "This job's status is ${{ job.status }}." - # start running the very-long tests + # start running the very-long tests testlib-very-long-tests: strategy: fail-fast: false @@ -49,8 +130,8 @@ jobs: run: rm -rf ./* || true rm -rf ./.??* || true rm -rf ~/.cache || true - uses: actions/checkout@v3 with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. + # Scheduled workflows run on the default branch by default. We + # therefore need to explicitly checkout the develop branch. ref: develop - uses: actions/download-artifact@v3 with: @@ -83,15 +164,15 @@ jobs: steps: - uses: actions/checkout@v3 with: - # Scheduled workflows run on the default branch by default. We - # therefore need to explicitly checkout the develop branch. + # Scheduled workflows run on the default branch by default. We + # therefore need to explicitly checkout the develop branch. ref: develop - name: Checkout DRAMSys working-directory: ${{ github.workspace }}/ext/dramsys run: git clone https://github.com/tukl-msd/DRAMSys --branch v5.0 --depth 1 DRAMSys - # gem5 is built separately because it depends on the DRAMSys library + # gem5 is built separately because it depends on the DRAMSys library - name: Build gem5 working-directory: ${{ github.workspace }} run: scons build/ALL/gem5.opt -j $(nproc) From c890e6b113a59caeec3eea9bafea4a03a471f89d Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Fri, 2 Feb 2024 10:38:47 -0800 Subject: [PATCH 02/30] misc: Merge .github dir from develop to stable (#841) This is to incorporate Daily Test fix #840. --- .github/workflows/daily-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 6aeb195b1f..92041c32b3 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -285,7 +285,7 @@ jobs: - name: Get Square test-prog from gem5-resources uses: wei/wget@v1 with: - args: -q https://dist.gem5.org/dist/v24-0/test-progs/square/square # Removed -N bc it wasn't available within actions, should be okay bc workspace is clean every time: https://github.com/coder/sshcode/issues/102 + args: -q http://dist.gem5.org/dist/v24-0/test-progs/square/square # Removed -N bc it wasn't available within actions, should be okay bc workspace is clean every time: https://github.com/coder/sshcode/issues/102 - name: Run Square test with VEGA_X86/gem5.opt (SE mode) run: | mkdir -p tests/testing-results @@ -293,7 +293,7 @@ jobs: - name: Get allSyncPrims-1kernel from gem5-resources uses: wei/wget@v1 with: - args: -q https://dist.gem5.org/dist/v24-0/test-progs/heterosync/allSyncPrims-1kernel # Removed -N bc it wasn't available within actions, should be okay bc workspace is clean every time + args: -q http://dist.gem5.org/dist/v24-0/test-progs/heterosync/allSyncPrims-1kernel # Removed -N bc it wasn't available within actions, should be okay bc workspace is clean every time - name: Run allSyncPrims-1kernel sleepMutex test with VEGA_X86/gem5.opt (SE mode) run: ./build/VEGA_X86/gem5.opt configs/example/apu_se.py --reg-alloc-policy=dynamic -n3 -c allSyncPrims-1kernel --options="sleepMutex 10 16 4" From 650b92124bd8ed4d4716a5112d2f004fd2a5dbc0 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 5 Mar 2024 08:35:11 +0000 Subject: [PATCH 03/30] misc: Copy the develop .github dir to stable (#912) --- .github/workflows/ci-tests.yaml | 14 +++++++------- .github/workflows/compiler-tests.yaml | 10 +++++----- .github/workflows/daily-tests.yaml | 24 +++++++++++------------- .github/workflows/docker-build.yaml | 2 +- .github/workflows/weekly-tests.yaml | 16 ++++++++-------- 5 files changed, 32 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 49928faf20..828eab6fb0 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-22.04 if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v3 - uses: pre-commit/action@v3.0.0 @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-22.04 if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Check for Change-Id @@ -54,7 +54,7 @@ jobs: needs: [pre-commit, check-for-change-id] # only runs if pre-commit and change-id passes timeout-minutes: 60 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: CI Unittests working-directory: ${{ github.workspace }} run: scons build/ALL/unittests.opt -j $(nproc) @@ -68,7 +68,7 @@ jobs: container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest needs: [pre-commit, check-for-change-id] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Unfortunately the 'ubunutu-latest' image doesn't have jq installed. # We therefore need to install it as a step here. @@ -100,7 +100,7 @@ jobs: needs: [pre-commit, check-for-change-id] timeout-minutes: 90 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Clang Compilation working-directory: ${{ github.workspace }} run: scons build/ALL/gem5.fast -j $(nproc) @@ -114,7 +114,7 @@ jobs: matrix: build-target: ${{ fromJson(needs.testlib-quick-matrix.outputs.build-matrix) }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build gem5 run: scons ${{ matrix.build-target }} -j $(nproc) @@ -150,7 +150,7 @@ jobs: run: rm -rf ./* || true rm -rf ./.??* || true rm -rf ~/.cache || true # Checkout the repository then download the gem5.opt artifact. - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/download-artifact@v3 with: name: ci-tests-${{ github.run_number }}-testlib-quick-all-gem5-builds diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index 5e903732ce..fde8f3cd44 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -16,15 +16,15 @@ jobs: strategy: fail-fast: false matrix: - image: [gcc-version-12, gcc-version-11, gcc-version-10, gcc-version-8, clang-version-16, clang-version-15, clang-version-14, clang-version-13, - clang-version-12, clang-version-11, clang-version-10, clang-version-9, clang-version-8, clang-version-7, ubuntu-20.04_all-dependencies, + image: [gcc-version-13, gcc-version-12, gcc-version-11, gcc-version-10, gcc-version-8, clang-version-16, clang-version-15, clang-version-14, + clang-version-13, clang-version-12, clang-version-11, clang-version-10, clang-version-9, clang-version-8, clang-version-7, ubuntu-20.04_all-dependencies, ubuntu-22.04_all-dependencies, ubuntu-22.04_min-dependencies] opts: [.opt, .fast] runs-on: [self-hosted, linux, x64] timeout-minutes: 2880 # 48 hours container: ghcr.io/gem5/${{ matrix.image }}:latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -40,13 +40,13 @@ jobs: matrix: gem5-compilation: [ARM, ARM_MESI_Three_Level, ARM_MESI_Three_Level_HTM, ARM_MOESI_hammer, Garnet_standalone, MIPS, 'NULL', NULL_MESI_Two_Level, NULL_MOESI_CMP_directory, NULL_MOESI_CMP_token, NULL_MOESI_hammer, POWER, RISCV, SPARC, X86, X86_MI_example, X86_MOESI_AMD_Base, VEGA_X86] - image: [gcc-version-12, clang-version-16] + image: [gcc-version-13, clang-version-16] opts: [.opt] runs-on: [self-hosted, linux, x64] timeout-minutes: 2880 # 48 hours container: ghcr.io/gem5/${{ matrix.image }}:latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 92041c32b3..81de5c4746 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -7,6 +7,8 @@ on: # Runs every day from 7AM UTC schedule: - cron: 0 7 * * * + # Allows us to manually start workflow for testing + workflow_dispatch: jobs: name-artifacts: @@ -46,7 +48,7 @@ jobs: needs: name-artifacts container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -75,7 +77,7 @@ jobs: container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest timeout-minutes: 60 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -97,7 +99,7 @@ jobs: steps: - name: Clean runner run: rm -rf ./* || true rm -rf ./.??* || true rm -rf ~/.cache || true - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -186,7 +188,7 @@ jobs: steps: - name: Clean runner run: rm -rf ./* || true rm -rf ./.??* || true rm -rf ~/.cache || true - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -224,7 +226,7 @@ jobs: timeout-minutes: 180 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -249,7 +251,7 @@ jobs: timeout-minutes: 180 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -275,7 +277,7 @@ jobs: timeout-minutes: 720 # 12 hours steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -283,17 +285,13 @@ jobs: - name: Compile build/VEGA_X86/gem5.opt run: scons build/VEGA_X86/gem5.opt -j $(nproc) - name: Get Square test-prog from gem5-resources - uses: wei/wget@v1 - with: - args: -q http://dist.gem5.org/dist/v24-0/test-progs/square/square # Removed -N bc it wasn't available within actions, should be okay bc workspace is clean every time: https://github.com/coder/sshcode/issues/102 + run: build/VEGA_X86/gem5.opt util/obtain-resource.py square-gpu-test -p square - name: Run Square test with VEGA_X86/gem5.opt (SE mode) run: | mkdir -p tests/testing-results ./build/VEGA_X86/gem5.opt configs/example/apu_se.py --reg-alloc-policy=dynamic -n3 -c square - name: Get allSyncPrims-1kernel from gem5-resources - uses: wei/wget@v1 - with: - args: -q http://dist.gem5.org/dist/v24-0/test-progs/heterosync/allSyncPrims-1kernel # Removed -N bc it wasn't available within actions, should be okay bc workspace is clean every time + run: build/VEGA_X86/gem5.opt util/obtain-resource.py allSyncPrims-1kernel -p allSyncPrims-1kernel - name: Run allSyncPrims-1kernel sleepMutex test with VEGA_X86/gem5.opt (SE mode) run: ./build/VEGA_X86/gem5.opt configs/example/apu_se.py --reg-alloc-policy=dynamic -n3 -c allSyncPrims-1kernel --options="sleepMutex 10 16 4" diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index 68b0905e83..1677a231ab 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -9,7 +9,7 @@ jobs: container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index 62d047709f..fd2527c094 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -15,7 +15,7 @@ jobs: runs-on: [self-hosted, linux, x64] container: ghcr.io/gem5/gcn-gpu:latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -35,7 +35,7 @@ jobs: needs: build-gcn-gpu-gem5 timeout-minutes: 480 # 8 hours steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -67,7 +67,7 @@ jobs: needs: build-gcn-gpu-gem5 timeout-minutes: 120 # 2 hours steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -86,7 +86,7 @@ jobs: scons build/x86/out/m5 - name: Download tests working-directory: ${{ github.workspace }}/hip - run: wget http://dist.gem5.org/dist/v22-1/test-progs/halo-finder/ForceTreeTest + run: build/VEGA_X86/gem5.opt util/obtain-resource.py hacc-force-tree -p ForceTreeTest - name: Run HACC tests working-directory: ${{ github.workspace }} run: | @@ -98,7 +98,7 @@ jobs: outputs: build-name: ${{ steps.artifact-name.outputs.name }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. @@ -128,12 +128,12 @@ jobs: steps: - name: Clean runner run: rm -rf ./* || true rm -rf ./.??* || true rm -rf ~/.cache || true - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. ref: develop - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.build-gem5.outputs.build-name}} path: build/ALL @@ -162,7 +162,7 @@ jobs: container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest timeout-minutes: 4320 # 3 days steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. From e8bc4fc137a5a7e82b601432271a027b652ae69b Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 11 Mar 2024 12:35:35 -0700 Subject: [PATCH 04/30] misc: Sync stable .github dir with develop (#928) --- .github/workflows/weekly-tests.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index fd2527c094..109001c651 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -85,10 +85,8 @@ jobs: export TERM=xterm-256color scons build/x86/out/m5 - name: Download tests - working-directory: ${{ github.workspace }}/hip - run: build/VEGA_X86/gem5.opt util/obtain-resource.py hacc-force-tree -p ForceTreeTest + run: build/VEGA_X86/gem5.opt util/obtain-resource.py hacc-force-tree -p hip/ForceTreeTest - name: Run HACC tests - working-directory: ${{ github.workspace }} run: | build/VEGA_X86/gem5.opt configs/example/apu_se.py -n3 --reg-alloc-policy=dynamic --benchmark-root=hip -c ForceTreeTest --options="0.5 0.1 64 0.1 1 N 12 rcb" @@ -133,7 +131,7 @@ jobs: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. ref: develop - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: ${{needs.build-gem5.outputs.build-name}} path: build/ALL From ee6f1377d7c54422137dfa47cd4d73407814867d Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 2 Apr 2024 10:20:25 -0700 Subject: [PATCH 05/30] misc: Sync develop .github to stable (#987) --- .github/workflows/ci-tests.yaml | 6 +++--- .github/workflows/daily-tests.yaml | 28 ++++++++++++++-------------- .github/workflows/docker-build.yaml | 4 ++-- .github/workflows/weekly-tests.yaml | 12 ++++++------ 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 828eab6fb0..bc35583c17 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -127,7 +127,7 @@ jobs: # stripping the "build" directory. By adding the "anchor.txt" file, we # ensure the "build" directory is preserved. - run: echo "anchor" > anchor.txt - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ci-tests-${{ github.run_number }}-testlib-quick-all-gem5-builds path: | @@ -151,7 +151,7 @@ jobs: # Checkout the repository then download the gem5.opt artifact. - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ci-tests-${{ github.run_number }}-testlib-quick-all-gem5-builds @@ -177,7 +177,7 @@ jobs: # Upload the tests/testing-results directory as an artifact. - name: Upload test results if: success() || failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ci-tests-run-${{ github.run_number }}-attempt-${{ github.run_attempt }}-testlib-quick-${{ steps.sanitize-test-dir.outputs.sanatized-test-dir }}-status-${{ steps.run-tests.outcome }}-output diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 81de5c4746..d74d0788fd 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -16,7 +16,7 @@ jobs: outputs: build-name: ${{ steps.artifact-name.outputs.name }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - id: artifact-name run: echo "name=$(date +"%Y-%m-%d_%H.%M.%S-")" >> $GITHUB_OUTPUT @@ -61,7 +61,7 @@ jobs: run: scons setconfig build/${{ matrix.image }} ${{ matrix.setconfig-option }} - name: Build gem5 run: scons build/${{ matrix.image }}/gem5.opt -j $(nproc) - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ${{ needs.name-artifacts.outputs.build-name }}${{ matrix.image }} path: build/${{ matrix.image }}/gem5.opt @@ -108,47 +108,47 @@ jobs: # since long tests can't start until the build matrix completes, # we download all artifacts from the build for each test # in this matrix - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}ALL path: build/ALL - run: chmod u+x build/ALL/gem5.opt - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}ALL_CHI path: build/ALL_CHI - run: chmod u+x build/ALL_CHI/gem5.opt - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}ARM path: build/ARM - run: chmod u+x build/ARM/gem5.opt - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}ALL_MSI path: build/ALL_MSI - run: chmod u+x build/ALL_MSI/gem5.opt - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}ALL_MESI_Two_Level path: build/ALL_MESI_Two_Level - run: chmod u+x build/ALL_MESI_Two_Level/gem5.opt - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}NULL path: build/NULL - run: chmod u+x build/NULL/gem5.opt - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}NULL_MI_example path: build/NULL_MI_example - run: chmod u+x build/NULL_MI_example/gem5.opt - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}RISCV path: build/RISCV - run: chmod u+x build/RISCV/gem5.opt - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}VEGA_X86 path: build/VEGA_X86 @@ -164,7 +164,7 @@ jobs: zip -r output.zip tests/testing-results - name: upload zip if: success() || failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 env: MY_STEP_VAR: ${{ matrix.test-type }}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} with: @@ -193,7 +193,7 @@ jobs: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. ref: develop - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}ALL path: build/ALL @@ -209,7 +209,7 @@ jobs: zip -r output.zip tests/testing-results - name: upload zip if: success() || failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 env: MY_STEP_VAR: ${{ matrix.test-type }}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} with: diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index 1677a231ab..c9e259d7f4 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -14,7 +14,7 @@ jobs: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. ref: develop - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: dockerfiles path: util/dockerfiles @@ -28,7 +28,7 @@ jobs: contents: read steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: dockerfiles path: dockerfiles-docker-build diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index 109001c651..a7a4ffbbad 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -22,7 +22,7 @@ jobs: ref: develop - name: Build gem5 run: scons build/VEGA_X86/gem5.opt -j $(nproc) --ignore-style - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: weekly-test-${{ github.run_number }}-attempt-${{ github.run_attempt }}-gem5-build-vega path: build/VEGA_X86/gem5.opt @@ -42,7 +42,7 @@ jobs: ref: develop - name: Download build/VEGA_X86/gem5.opt - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: weekly-test-${{ github.run_number }}-attempt-${{ github.run_attempt }}-gem5-build-vega path: build/VEGA_X86 @@ -72,7 +72,7 @@ jobs: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. ref: develop - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: weekly-test-${{ github.run_number }}-attempt-${{ github.run_attempt }}-gem5-build-vega path: build/VEGA_X86 @@ -106,7 +106,7 @@ jobs: - name: Build gem5 run: | scons build/ALL/gem5.opt -j $(nproc) - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ${{ steps.artifact-name.outputs.name }} path: build/ALL/gem5.opt @@ -131,7 +131,7 @@ jobs: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. ref: develop - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.build-gem5.outputs.build-name}} path: build/ALL @@ -146,7 +146,7 @@ jobs: zip -r output.zip tests/testing-results - name: upload zip if: success() || failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 env: MY_STEP_VAR: ${{ matrix.test-type }}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} with: From 0b2fa9900b3754787b4fd564937b8c145bcfbd5d Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Fri, 19 Apr 2024 19:41:30 -0700 Subject: [PATCH 06/30] misc: Merge .github develop dir to stable (#1043) --- .github/workflows/ci-tests.yaml | 63 +++++++++++++++++++++------ .github/workflows/compiler-tests.yaml | 4 +- .github/workflows/daily-tests.yaml | 10 ++--- .github/workflows/docker-build.yaml | 2 +- .github/workflows/weekly-tests.yaml | 8 ++-- 5 files changed, 62 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index bc35583c17..a1aebe82ac 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -14,17 +14,17 @@ concurrency: jobs: pre-commit: # runs on github hosted runner - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@v3.0.0 + - uses: actions/setup-python@v5 + - uses: pre-commit/action@v3.0.1 # ensures we have a change-id in every commit, needed for gerrit check-for-change-id: # runs on github hosted runner - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v4 @@ -50,7 +50,7 @@ jobs: unittests-all-opt: runs-on: [self-hosted, linux, x64] if: github.event.pull_request.draft == false - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest needs: [pre-commit, check-for-change-id] # only runs if pre-commit and change-id passes timeout-minutes: 60 steps: @@ -65,15 +65,15 @@ jobs: if: github.event.pull_request.draft == false # In order to make sure the environment is exactly the same, we run in # the same container we use to build gem5 and run the testlib tests. This - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest needs: [pre-commit, check-for-change-id] steps: - uses: actions/checkout@v4 - # Unfortunately the 'ubunutu-latest' image doesn't have jq installed. - # We therefore need to install it as a step here. + # Unfortunately the image doesn't have jq installed. + # We therefore need to install it as a step here. - name: Install jq - run: apt install -y jq + run: apt update && apt install -y jq - name: Get directories for testlib-quick working-directory: ${{ github.workspace }}/tests @@ -108,7 +108,7 @@ jobs: testlib-quick-gem5-builds: runs-on: [self-hosted, linux, x64] if: github.event.pull_request.draft == false - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest needs: [pre-commit, check-for-change-id, testlib-quick-matrix] strategy: matrix: @@ -138,7 +138,7 @@ jobs: testlib-quick-execution: runs-on: [self-hosted, linux, x64] if: github.event.pull_request.draft == false - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest needs: [pre-commit, check-for-change-id, testlib-quick-matrix, testlib-quick-gem5-builds] timeout-minutes: 360 # 6 hours strategy: @@ -184,12 +184,49 @@ jobs: path: tests/testing-results retention-days: 30 + pyunit: + runs-on: [self-hosted, linux, x64] + if: github.event.pull_request.draft == false + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest + needs: [pre-commit, check-for-change-id, testlib-quick-gem5-builds] + timeout-minutes: 30 + steps: + + # Checkout the repository then download the builds. + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: ci-tests-${{ github.run_number }}-testlib-quick-all-gem5-builds + + # Check that the gem5 binaries exist and are executable. + - name: Chmod gem5.{opt,debug,fast} to be executable + run: | + find . -name "gem5.opt" -exec chmod u+x {} \; + find . -name "gem5.debug" -exec chmod u+x {} \; + find . -name "gem5.fast" -exec chmod u+x {} \; + + # Run the pyunit tests. + # Note: these are all quick tests. + - name: Run The pyunit tests + id: run-tests + working-directory: ${{ github.workspace }}/tests + run: ./main.py run --skip-build -vv -j$(nproc) pyunit + + # Upload the tests/testing-results directory as an artifact. + - name: Upload pyunit test results + if: success() || failure() + uses: actions/upload-artifact@v4 + with: + name: ci-tests-run-${{ github.run_number }}-attempt-${{ github.run_attempt }}-pyunit-status-${{ steps.run-tests.outcome }}-output + path: tests/testing-results + retention-days: 30 + testlib-quick: # It is 'testlib-quick' which needs to pass for the pull request to be # merged. The 'testlib-quick-execution' is a matrix job which runs all the # the testlib quick tests. This job is therefore a stub which will pass if # all the testlib-quick-execution jobs pass. - runs-on: ubuntu-22.04 - needs: testlib-quick-execution + runs-on: ubuntu-latest + needs: [testlib-quick-execution, pyunit] steps: - run: echo "This job's status is ${{ job.status }}." diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index fde8f3cd44..1c1ef88fd4 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -18,7 +18,7 @@ jobs: matrix: image: [gcc-version-13, gcc-version-12, gcc-version-11, gcc-version-10, gcc-version-8, clang-version-16, clang-version-15, clang-version-14, clang-version-13, clang-version-12, clang-version-11, clang-version-10, clang-version-9, clang-version-8, clang-version-7, ubuntu-20.04_all-dependencies, - ubuntu-22.04_all-dependencies, ubuntu-22.04_min-dependencies] + ubuntu-22.04_all-dependencies, ubuntu-24.04_all-dependencies, ubuntu-24.04_min-dependencies] opts: [.opt, .fast] runs-on: [self-hosted, linux, x64] timeout-minutes: 2880 # 48 hours @@ -61,7 +61,7 @@ jobs: # I.e., if we want to stop pull requests from being merged if the # compiler tests are failing, we can add this job as a required status # check. - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest needs: - latest-compilers-all-gem5-builds - all-compilers diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index d74d0788fd..73788d3c9c 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -46,7 +46,7 @@ jobs: isa-option: 'NULL' runs-on: [self-hosted, linux, x64] needs: name-artifacts - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest steps: - uses: actions/checkout@v4 with: @@ -74,7 +74,7 @@ jobs: matrix: type: [fast, debug] runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest timeout-minutes: 60 steps: - uses: actions/checkout@v4 @@ -93,7 +93,7 @@ jobs: test-type: [arm_boot_tests, fs, gpu, insttest_se, learning_gem5, m5threads_test_atomic, memory, multi_isa, replacement_policies, riscv_boot_tests, stdlib, x86_boot_tests] runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest needs: [name-artifacts, build-gem5] timeout-minutes: 1440 # 24 hours for entire matrix to run steps: @@ -182,7 +182,7 @@ jobs: matrix: test-type: [gem5-library-example-x86-ubuntu-run-ALL-x86_64-opt, gem5-library-example-riscv-ubuntu-run-ALL-x86_64-opt, lupv-example-ALL-x86_64-opt, gem5-library-example-arm-ubuntu-run-test-ALL-x86_64-opt, gem5-library-example-riscvmatched-hello-ALL-x86_64-opt] - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest needs: [name-artifacts, build-gem5] timeout-minutes: 1440 # 24 hours steps: @@ -304,7 +304,7 @@ jobs: # I.e., if we want to stop pull requests from being merged if the # daily tests are failing we can add this job as a required status # check. - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest needs: - unittests-fast-debug - testlib-long-tests diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index c9e259d7f4..2afa907d0d 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -6,7 +6,7 @@ on: jobs: obtain-dockerfiles: runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index a7a4ffbbad..3773557504 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -92,7 +92,7 @@ jobs: build-gem5: runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest outputs: build-name: ${{ steps.artifact-name.outputs.name }} steps: @@ -120,7 +120,7 @@ jobs: matrix: test-type: [gem5_library_example_tests, gem5_resources, parsec_benchmarks, x86_boot_tests] runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest needs: [build-gem5] timeout-minutes: 4320 # 3 days steps: @@ -157,7 +157,7 @@ jobs: dramsys-tests: runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest timeout-minutes: 4320 # 3 days steps: - uses: actions/checkout@v4 @@ -187,7 +187,7 @@ jobs: # I.e., if we want to stop pull requests from being merged if the # weekly tests are failing we can add this job as a required status # check. - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest needs: - testlib-very-long-tests - dramsys-tests From 115322319c709a6e2a12e8b5c5299aa813d94633 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Sun, 21 Apr 2024 09:27:59 -0700 Subject: [PATCH 07/30] misc: Sync stable .github with develop (#1051) --- .github/workflows/ci-tests.yaml | 2 +- .github/workflows/daily-tests.yaml | 18 ++++-------------- .github/workflows/weekly-tests.yaml | 9 ++------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index a1aebe82ac..663e7219ac 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -175,7 +175,7 @@ jobs: run: echo "sanatized-test-dir=$(echo '${{ matrix.test-dir }}' | sed 's/\//-/g')" >> $GITHUB_OUTPUT # Upload the tests/testing-results directory as an artifact. - - name: Upload test results + - name: upload results if: success() || failure() uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 73788d3c9c..efa5943186 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -157,19 +157,14 @@ jobs: - name: long ${{ matrix.test-type }} tests working-directory: ${{ github.workspace }}/tests run: ./main.py run gem5/${{ matrix.test-type }} --length=long --skip-build -vv -t $(nproc) - - name: create zip of results - if: success() || failure() - run: | - apt-get -y install zip - zip -r output.zip tests/testing-results - - name: upload zip + - name: upload results if: success() || failure() uses: actions/upload-artifact@v4 env: MY_STEP_VAR: ${{ matrix.test-type }}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} with: name: ${{ env.MY_STEP_VAR }} - path: output.zip + path: tests/testing-results retention-days: 7 - run: echo "This job's status is ${{ job.status }}." @@ -202,19 +197,14 @@ jobs: working-directory: ${{ github.workspace }}/tests run: ./main.py run --uid SuiteUID:tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py:test-${{ matrix.test-type }} --length=long --skip-build -vv - - name: create zip of results - if: success() || failure() - run: | - apt-get -y install zip - zip -r output.zip tests/testing-results - - name: upload zip + - name: upload results if: success() || failure() uses: actions/upload-artifact@v4 env: MY_STEP_VAR: ${{ matrix.test-type }}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} with: name: ${{ env.MY_STEP_VAR }} - path: output.zip + path: tests/testing-results retention-days: 7 - run: echo "This job's status is ${{ job.status }}." diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index 3773557504..41f935bf22 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -139,19 +139,14 @@ jobs: - name: very-long ${{ matrix.test-type }} working-directory: ${{ github.workspace }}/tests run: ./main.py run gem5/${{ matrix.test-type }} --length very-long --skip-build -vv - - name: create zip of results - if: success() || failure() - run: | - apt-get -y install zip - zip -r output.zip tests/testing-results - - name: upload zip + - name: upload results if: success() || failure() uses: actions/upload-artifact@v4 env: MY_STEP_VAR: ${{ matrix.test-type }}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} with: name: ${{ env.MY_STEP_VAR }} - path: output.zip + path: tests/testing-results retention-days: 7 - run: echo "This job's status is ${{ job.status }}." From 0b2243bb0a262bf97f45948b579ccf8b1a8ee35d Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 21 May 2024 11:56:17 -0700 Subject: [PATCH 08/30] misc: Sync stable .github dir with develop (#1155) --- .github/workflows/compiler-tests.yaml | 4 ++-- .github/workflows/weekly-tests.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index 1c1ef88fd4..9db1af6417 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false matrix: - image: [gcc-version-13, gcc-version-12, gcc-version-11, gcc-version-10, gcc-version-8, clang-version-16, clang-version-15, clang-version-14, - clang-version-13, clang-version-12, clang-version-11, clang-version-10, clang-version-9, clang-version-8, clang-version-7, ubuntu-20.04_all-dependencies, + image: [gcc-version-13, gcc-version-12, gcc-version-11, gcc-version-10, clang-version-16, clang-version-15, clang-version-14, clang-version-13, + clang-version-12, clang-version-11, clang-version-10, clang-version-9, clang-version-8, clang-version-7, ubuntu-20.04_all-dependencies, ubuntu-22.04_all-dependencies, ubuntu-24.04_all-dependencies, ubuntu-24.04_min-dependencies] opts: [.opt, .fast] runs-on: [self-hosted, linux, x64] diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index 41f935bf22..7d06d94ad8 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -152,7 +152,7 @@ jobs: dramsys-tests: runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest + container: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest timeout-minutes: 4320 # 3 days steps: - uses: actions/checkout@v4 From 8404ae276bf3eed701aeeaec3cef0ed3b4f5de5b Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 29 May 2024 07:48:13 -0700 Subject: [PATCH 09/30] misc: Sync .github develop -> stable (#1181) --- .github/workflows/daily-tests.yaml | 73 ++++++++++-------------------- 1 file changed, 25 insertions(+), 48 deletions(-) diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index efa5943186..8f2773aca3 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -67,6 +67,22 @@ jobs: path: build/${{ matrix.image }}/gem5.opt retention-days: 5 - run: echo "This job's status is ${{ job.status }}." + # The actions/upload-artifact@v4 action has a special "merge" sub action + # which allows for the merging of multiple artifacts into a single one. + # This is otherwise not possible as artifacts are immutable after creation + # in v4. We createa a merged artifact here as we want to download all the + # gem5 build artifacts when running the long tests. + merge-gem5-build-artifacts: + runs-on: ubuntu-latest + needs: build-gem5 + steps: + - name: Merge gem5 build artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: ${{needs.name-artifacts.outputs.build-name}} + path: ${{needs.name-artifacts.outputs.build-name}}* + retention-days: 5 + # this builds both unittests.fast and unittests.debug unittests-fast-debug: @@ -94,7 +110,7 @@ jobs: stdlib, x86_boot_tests] runs-on: [self-hosted, linux, x64] container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest - needs: [name-artifacts, build-gem5] + needs: [name-artifacts, merge-gem5-build-artifacts] timeout-minutes: 1440 # 24 hours for entire matrix to run steps: - name: Clean runner @@ -104,55 +120,16 @@ jobs: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. ref: develop - # download all artifacts for each test - # since long tests can't start until the build matrix completes, - # we download all artifacts from the build for each test - # in this matrix + # download all artifacts for each test. Thoguh this is inelegant, + # it's simpler than figuring otu which long tests requires which + # binary. - uses: actions/download-artifact@v4 with: - name: ${{needs.name-artifacts.outputs.build-name}}ALL - path: build/ALL - - run: chmod u+x build/ALL/gem5.opt - - uses: actions/download-artifact@v4 - with: - name: ${{needs.name-artifacts.outputs.build-name}}ALL_CHI - path: build/ALL_CHI - - run: chmod u+x build/ALL_CHI/gem5.opt - - uses: actions/download-artifact@v4 - with: - name: ${{needs.name-artifacts.outputs.build-name}}ARM - path: build/ARM - - run: chmod u+x build/ARM/gem5.opt - - uses: actions/download-artifact@v4 - with: - name: ${{needs.name-artifacts.outputs.build-name}}ALL_MSI - path: build/ALL_MSI - - run: chmod u+x build/ALL_MSI/gem5.opt - - uses: actions/download-artifact@v4 - with: - name: ${{needs.name-artifacts.outputs.build-name}}ALL_MESI_Two_Level - path: build/ALL_MESI_Two_Level - - run: chmod u+x build/ALL_MESI_Two_Level/gem5.opt - - uses: actions/download-artifact@v4 - with: - name: ${{needs.name-artifacts.outputs.build-name}}NULL - path: build/NULL - - run: chmod u+x build/NULL/gem5.opt - - uses: actions/download-artifact@v4 - with: - name: ${{needs.name-artifacts.outputs.build-name}}NULL_MI_example - path: build/NULL_MI_example - - run: chmod u+x build/NULL_MI_example/gem5.opt - - uses: actions/download-artifact@v4 - with: - name: ${{needs.name-artifacts.outputs.build-name}}RISCV - path: build/RISCV - - run: chmod u+x build/RISCV/gem5.opt - - uses: actions/download-artifact@v4 - with: - name: ${{needs.name-artifacts.outputs.build-name}}VEGA_X86 - path: build/VEGA_X86 - - run: chmod u+x build/VEGA_X86/gem5.opt + name: ${{needs.name-artifacts.outputs.build-name}} + # The upload/download GitHub actions do not preserve the executable + # bit of the files. We need to set the executable bit for the + # gem5.opt binaries we've just downloaded. + - run: find build -name "gem5.opt" | xargs chmod u+x # run test - name: long ${{ matrix.test-type }} tests working-directory: ${{ github.workspace }}/tests From bbdaae540c3745d1bc0833059ac15e0dfa388f14 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 30 May 2024 04:29:55 -0700 Subject: [PATCH 10/30] misc: Sync .github dir to stable (#1185) --- .github/workflows/daily-tests.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 8f2773aca3..465d70ab37 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -64,7 +64,7 @@ jobs: - uses: actions/upload-artifact@v4 with: name: ${{ needs.name-artifacts.outputs.build-name }}${{ matrix.image }} - path: build/${{ matrix.image }}/gem5.opt + path: '*build/${{ matrix.image }}/gem5.opt' retention-days: 5 - run: echo "This job's status is ${{ job.status }}." # The actions/upload-artifact@v4 action has a special "merge" sub action @@ -74,13 +74,13 @@ jobs: # gem5 build artifacts when running the long tests. merge-gem5-build-artifacts: runs-on: ubuntu-latest - needs: build-gem5 + needs: [build-gem5, name-artifacts] steps: - name: Merge gem5 build artifacts uses: actions/upload-artifact/merge@v4 with: name: ${{needs.name-artifacts.outputs.build-name}} - path: ${{needs.name-artifacts.outputs.build-name}}* + pattern: ${{needs.name-artifacts.outputs.build-name}}* retention-days: 5 From ef2a9110b7412cd526867dadd686e65fb3e4a5ac Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 30 May 2024 07:48:47 -0700 Subject: [PATCH 11/30] misc: Merge .github dir develop -> stable (#1189) --- .github/workflows/daily-tests.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 465d70ab37..5cd580694f 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -65,7 +65,7 @@ jobs: with: name: ${{ needs.name-artifacts.outputs.build-name }}${{ matrix.image }} path: '*build/${{ matrix.image }}/gem5.opt' - retention-days: 5 + retention-days: 1 - run: echo "This job's status is ${{ job.status }}." # The actions/upload-artifact@v4 action has a special "merge" sub action # which allows for the merging of multiple artifacts into a single one. @@ -73,7 +73,8 @@ jobs: # in v4. We createa a merged artifact here as we want to download all the # gem5 build artifacts when running the long tests. merge-gem5-build-artifacts: - runs-on: ubuntu-latest + runs-on: [self-hosted, linux, x64] + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latestt needs: [build-gem5, name-artifacts] steps: - name: Merge gem5 build artifacts @@ -81,7 +82,7 @@ jobs: with: name: ${{needs.name-artifacts.outputs.build-name}} pattern: ${{needs.name-artifacts.outputs.build-name}}* - retention-days: 5 + retention-days: 1 # this builds both unittests.fast and unittests.debug @@ -168,7 +169,6 @@ jobs: - uses: actions/download-artifact@v4 with: name: ${{needs.name-artifacts.outputs.build-name}}ALL - path: build/ALL - run: chmod u+x build/ALL/gem5.opt - name: long ${{ matrix.test-type }} gem5_library_example_tests working-directory: ${{ github.workspace }}/tests From fd0e6acc94885aa1ef868363eebd32504c96693e Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 30 May 2024 10:15:35 -0700 Subject: [PATCH 12/30] misc: Fix daily-tests 1. Typo in container. 2. Add compression level to minimize size of generated artifact. Change-Id: I854e814162fb434ad50a64e3070b943905e4134b --- .github/workflows/daily-tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 5cd580694f..cf39474401 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -74,7 +74,7 @@ jobs: # gem5 build artifacts when running the long tests. merge-gem5-build-artifacts: runs-on: [self-hosted, linux, x64] - container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latestt + container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest needs: [build-gem5, name-artifacts] steps: - name: Merge gem5 build artifacts @@ -83,6 +83,7 @@ jobs: name: ${{needs.name-artifacts.outputs.build-name}} pattern: ${{needs.name-artifacts.outputs.build-name}}* retention-days: 1 + compression-level: 9 # this builds both unittests.fast and unittests.debug From 26a1d2ff0b6d49cf44ad1863ad17ae63f32f22da Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 11 Jun 2024 15:42:53 -0700 Subject: [PATCH 13/30] misc,tests: Update daily test artifact actions to v4.0.0 Change-Id: I711fa36639e925ce958e0484a31ee6a4dde87dbe --- .github/workflows/daily-tests.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index cf39474401..102ef0ca71 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -61,7 +61,7 @@ jobs: run: scons setconfig build/${{ matrix.image }} ${{ matrix.setconfig-option }} - name: Build gem5 run: scons build/${{ matrix.image }}/gem5.opt -j $(nproc) - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v4.0.0 with: name: ${{ needs.name-artifacts.outputs.build-name }}${{ matrix.image }} path: '*build/${{ matrix.image }}/gem5.opt' @@ -78,7 +78,7 @@ jobs: needs: [build-gem5, name-artifacts] steps: - name: Merge gem5 build artifacts - uses: actions/upload-artifact/merge@v4 + uses: actions/upload-artifact/merge@v4.0.0 with: name: ${{needs.name-artifacts.outputs.build-name}} pattern: ${{needs.name-artifacts.outputs.build-name}}* @@ -125,7 +125,7 @@ jobs: # download all artifacts for each test. Thoguh this is inelegant, # it's simpler than figuring otu which long tests requires which # binary. - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4.0.0 with: name: ${{needs.name-artifacts.outputs.build-name}} # The upload/download GitHub actions do not preserve the executable @@ -138,7 +138,7 @@ jobs: run: ./main.py run gem5/${{ matrix.test-type }} --length=long --skip-build -vv -t $(nproc) - name: upload results if: success() || failure() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.0.0 env: MY_STEP_VAR: ${{ matrix.test-type }}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} with: @@ -167,7 +167,7 @@ jobs: # Scheduled workflows run on the default branch by default. We # therefore need to explicitly checkout the develop branch. ref: develop - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4.0.0 with: name: ${{needs.name-artifacts.outputs.build-name}}ALL - run: chmod u+x build/ALL/gem5.opt @@ -177,7 +177,7 @@ jobs: --skip-build -vv - name: upload results if: success() || failure() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.0.0 env: MY_STEP_VAR: ${{ matrix.test-type }}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} with: From e03a5f78d1bd3cc900f4f2d8791e112f8cf397d1 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 12 Jun 2024 00:14:27 -0700 Subject: [PATCH 14/30] misc,tests: Revert merge version to 'v4' from 'v4.0.0' 'v4.0.0' wasn't working. The following error was occurred: ``` Can't find 'action.yml', 'action.yaml' or 'Dockerfile' for action 'actions/upload-artifact/merge@v4.0.0'. ``` Change-Id: I658b0fe292df029501fbc1286acb06f4014ae4e1 --- .github/workflows/daily-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 102ef0ca71..a45c39a183 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -78,7 +78,7 @@ jobs: needs: [build-gem5, name-artifacts] steps: - name: Merge gem5 build artifacts - uses: actions/upload-artifact/merge@v4.0.0 + uses: actions/upload-artifact/merge@v4 with: name: ${{needs.name-artifacts.outputs.build-name}} pattern: ${{needs.name-artifacts.outputs.build-name}}* From 888bf0d69391a16e1638a015f59cfd4ac4ed63fc Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 18 Jun 2024 16:14:49 -0700 Subject: [PATCH 15/30] base: Update src/base/version.cc for v24.0 Change-Id: Iac980772a42853f9bfbdadb65d5efc3c5fdb6aed --- src/base/version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/version.cc b/src/base/version.cc index f652415669..dedbb425d3 100644 --- a/src/base/version.cc +++ b/src/base/version.cc @@ -32,6 +32,6 @@ namespace gem5 /** * @ingroup api_base_utils */ -const char *gem5Version = "DEVELOP-FOR-24.0"; +const char *gem5Version = "24.0.0.0"; } // namespace gem5 From d9d7d7646a0a9f8cd0c140d8b6a913445a449765 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 18 Jun 2024 16:17:38 -0700 Subject: [PATCH 16/30] misc: Update Doxygen version to v24.0.0.0 Change-Id: Ibaa04b09813a1d497727ed9d2a903ee2b3049ffd --- src/Doxyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Doxyfile b/src/Doxyfile index 2bc7557e20..2206f17669 100644 --- a/src/Doxyfile +++ b/src/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = gem5 # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = [DEVELOP-FOR-24.0] +PROJECT_NUMBER = v24.0.0.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. From ec120e0c588775676eaf43751809872a5b390160 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 20 Jun 2024 14:31:12 -0700 Subject: [PATCH 17/30] util-docker: Update devontainer Dockerfile for v24.0 Change-Id: Id21fb1b12d8ad58338233d4f32be5b57e025f18b --- util/dockerfiles/devcontainer/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/dockerfiles/devcontainer/Dockerfile b/util/dockerfiles/devcontainer/Dockerfile index 6747c57def..4c9ae7861b 100644 --- a/util/dockerfiles/devcontainer/Dockerfile +++ b/util/dockerfiles/devcontainer/Dockerfile @@ -39,15 +39,15 @@ # In the final stage this this is copied into /usr/local/bin/gem5. This ensures # there is a pre-built gem5 binary in each devcontainer. This can save time # if the container is used for education or demonstration purposes. -FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies as builder -RUN git clone --branch stable https://github.com/gem5/gem5 +FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:v24-0 as builder +RUN git clone --branch v24.0 https://github.com/gem5/gem5 WORKDIR /gem5 RUN scons build/ALL/gem5.opt -j`nproc` # Stage 2: The final stage where we create the devcontainer image. # This includes all dependencies for building and running gem5, the # dependencies for developing gem5, and a pre-built gem5 binary. -FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies +FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:v24-0 RUN apt -y update && \ apt -y install vim COPY --from=builder /gem5/build/ALL/gem5.opt /usr/local/bin/gem5 From 6e4c1c5db7d58ef8ea1aa878a24bd5119fc80203 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 20 Jun 2024 14:47:09 -0700 Subject: [PATCH 18/30] scons: Remove -Werror for the gem5 v24.0 release Removing -Werror flag on the stable branch ensures that as new compilers are releases (likely withs stricter warnings) gem5 remains compilable. Change-Id: I0267c895414b630c1d7cd9b28236249790b3006f --- SConstruct | 5 ----- 1 file changed, 5 deletions(-) diff --git a/SConstruct b/SConstruct index bfdca815ed..fa6e05177a 100755 --- a/SConstruct +++ b/SConstruct @@ -552,11 +552,6 @@ for variant_path in variant_paths: env.Append(CCFLAGS=['-pipe']) env.Append(CCFLAGS=['-fno-strict-aliasing']) - # Enable -Wall and -Wextra and then disable the few warnings that - # we consistently violate - env.Append(CCFLAGS=['-Wall', '-Wundef', '-Wextra', - '-Wno-sign-compare', '-Wno-unused-parameter']) - # We always compile using C++17 env.Append(CXXFLAGS=['-std=c++17']) From 6f95d4f3c36aeee3d8a166896e84bd06bd9fc48f Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 20 Jun 2024 15:37:13 -0700 Subject: [PATCH 19/30] misc: Add content for v24.0 RELEASE_NOTES.md First draft. Not yet complete. Change-Id: I80fa4fa4e82e0367cb347df53e9cc9cb52670bfc --- RELEASE-NOTES.md | 103 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index d99e7226f3..27dd7fe00e 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,106 @@ +# Version 24.0 + +gem5 Version 24.0 is the first major release of 2024. +During this time there have been 298 pull requests merged, comprising of over 600 commits, from 56 unique contributors. + +## API and user-facing changes + + +* The GCN3 GPU model has been removed in favor of the newer VEGA_X85 GPU model. +* gem5 now supports building, running, and simulating Ubuntu 24.04. + +### Compiler and OS support + +As of this release gem5 support Clang version 6 to 16 and GCC version 10 to 13. +While other compilers and versions may work, they are not regularly tested. + +gem5 now supports building, running, and simulating on Ubuntu 24.04. +We continue to support 22.04 with 20.04 being deprecated in the coming year. +The majority of our testing is done on Ubuntu LTS systems though Apple Silicon machines and other Linux distributions have also been used regularly during development. +Improvements have been made to ensure a wider support of operating systems. + +## New features + +### gem5 MultiSim: Multiprocessing for gem5 + +The gem5 "MultiSim" module allows for multiple simulations to be run from a single gem5 execution via a single gem5 configuration script. +This allows for multiple simulations to be run in parallel in a structured manner. + +To use MultiSim first create multiple simulators and add them to the MultiSim with the `add_simulator` function. +If needed, limit the maximum number of parallel processes with the `set_num_processes` function. +Then run the simulations in parallel with the `gem5` binary using `-m gem5.utils.multisim`. + +Here is an example of how to use MultiSim: + +```python +import gem5.util.multisim as multisim + +# Set the maximum number of processes to run in parallel +multisim.set_num_processes(4) + +# Create multiple simulators. +# In this case, one for each workload in the benchmark suite. +for workload in benchmark_suite: + board = X86Board( + # ... + ) + board.set_workload(workload) + + # Useful to set the ID here. This is used to create unique output + # directorires for each gem5 process and can be used to idenfify and + # run gem5 processes individually. + simulator = Simulator(board, id=f"{workload.get_id()}") + multisim.add_simulator(simulator) +``` + +Then to run the simulations in parallel: + +```sh + -m gem5.utils.multisim +``` + +The output directory ("m5out" by default) will contain sub-directories for each simulation run. +The sub-directory will be named after the simulator ID set in the configuration script. +We therefore recommend setting the simulator ID to something meaningful to help identify the output directories (i.e., the workload run or something identifying the meaningful characteristics of the simulated system in comparison to others). + +If only one simulation specified in the config needs run, you can do so with: + +```sh + --list # Lists the simulations by ID + + # Run the simulation with the specified ID. +``` + +Example scripts of using MultiSim can be found in "configs/example/gem5_library/multisim". + + +### RISC-V Vector Extension Support + +## Improvements + +* KVM is now supported in the gem5 Standard Library ARM Board. +* Generic Cache template added to the Standard Library: https://github.com/gem5/gem5/pull/745 +* Support added for partitioning caches. +* The Standard Library `obtain_resources` function can request multiple resources at once thus reducing delay associated with multiple requests. +* An official gem5 DevContainer has been added to the gem5 repository. +This can be used to build and run gem5 in consistent environment and enables GitHub Codespaces support. + +### gem5 Python Statistics + + + + +### GPU Model + +* Supporty for the MI200 GPU model. + +## Bug Fixes + +* An integer overflow error known to affect the `AddrRange` class has been fixed. +* Fix fflags behavior of floating point instruction in RISC-V for Out-of-Order CPUs. + + + # Version 23.1 gem5 Version 23.1 is our first release where the development has been on GitHub. From 30bfdc8e525a7106f66c200b57e5a1d16f573844 Mon Sep 17 00:00:00 2001 From: Mahyar Samani Date: Fri, 21 Jun 2024 02:23:58 -0700 Subject: [PATCH 20/30] stdlib: Getter method to get monolith range. (#1273) This change extend the AbstractMemory class to add a getter method that allows other components to get the memory's range without interleaving. This method will be useful if other components in the system need to interleave the memory range different to the way the memory has interleaved them. --- .../gem5/components/memory/abstract_memory_system.py | 8 ++++++++ src/python/gem5/components/memory/memory.py | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/python/gem5/components/memory/abstract_memory_system.py b/src/python/gem5/components/memory/abstract_memory_system.py index e214602732..06fa60cad8 100644 --- a/src/python/gem5/components/memory/abstract_memory_system.py +++ b/src/python/gem5/components/memory/abstract_memory_system.py @@ -83,6 +83,14 @@ class AbstractMemorySystem(SubSystem): """ raise NotImplementedError + @abstractmethod + def get_uninterleaved_range(self) -> List[AddrRange]: + """Returns the range of the memory system without interleaving. + This is useful when other components in the system want to interleave + the memory range different to how the memory has interleaved them. + """ + raise NotImplementedError + def _post_instantiate(self) -> None: """Called to set up anything needed after ``m5.instantiate``.""" pass diff --git a/src/python/gem5/components/memory/memory.py b/src/python/gem5/components/memory/memory.py index ca47ad6a16..2d922c8e83 100644 --- a/src/python/gem5/components/memory/memory.py +++ b/src/python/gem5/components/memory/memory.py @@ -203,3 +203,7 @@ class ChanneledMemory(AbstractMemorySystem): ) self._mem_range = ranges[0] self._interleave_addresses() + + @overrides(AbstractMemorySystem) + def get_uninterleaved_range(self) -> List[AddrRange]: + return [self._mem_range] From 21bd1c28abf4684e8ac3bad1e550cc431e0a42a9 Mon Sep 17 00:00:00 2001 From: Mahyar Samani Date: Fri, 21 Jun 2024 02:23:41 -0700 Subject: [PATCH 21/30] Adding an example for Spatter (#1272) This change adds a new utility function for processing Spatter traces into SpatterKernels under parse_kernels. Additionally, it adds documentation for all the utility functions in spatter_kernel.py. Lastly, it adds an example script for running one spatter trace using SpatterGenerator to the examples. --- .../spatter_gen/spatter-gen-test.py | 97 +++++++ .../gem5_library/spatter_gen/traces/amg.json | 1 + .../processors/spatter_gen/__init__.py | 2 + .../processors/spatter_gen/spatter_kernel.py | 263 +++++++++++++++--- 4 files changed, 319 insertions(+), 44 deletions(-) create mode 100644 configs/example/gem5_library/spatter_gen/spatter-gen-test.py create mode 100644 configs/example/gem5_library/spatter_gen/traces/amg.json diff --git a/configs/example/gem5_library/spatter_gen/spatter-gen-test.py b/configs/example/gem5_library/spatter_gen/spatter-gen-test.py new file mode 100644 index 0000000000..ef0cc04aa5 --- /dev/null +++ b/configs/example/gem5_library/spatter_gen/spatter-gen-test.py @@ -0,0 +1,97 @@ +# Copyright (c) 2024 The Regents of the University of California +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +""" +Script that runs a SpatterGen test with a specific trace file. +This script can be used as an example on how to use SpatterGenerator, +SpatterKernel, and its utilities to run a Spatter trace in gem5. + +The script uses a spatter trace taken from the hpcgarage github repository. +Link to the original trace file: + +https://github.com/hpcgarage/spatter/blob/main/standard-suite/app-traces/amg.json + +It will create a system with `num_cores` SpatterGenerators and interleave the +trace by `intlv_size` elements in the `pattern` field from the trace. +Interleaving is done for assigning part of the access to each core. + +Usage: +------ + +``` +scons build/NULL/gem5.opt +./build/NULL/gem5.opt configs/example/gem5_library/spatter_gen/spatter-gen-test.py +``` +""" +import argparse +import json +from pathlib import Path + +import m5 +from m5.objects import Root + +from gem5.components.boards.test_board import TestBoard +from gem5.components.cachehierarchies.classic.private_l1_cache_hierarchy import ( + PrivateL1CacheHierarchy, +) +from gem5.components.memory import DualChannelDDR4_2400 +from gem5.components.processors.spatter_gen import ( + SpatterGenerator, + prepare_kernels, +) +from gem5.simulate.simulator import Simulator + +num_cores = 8 +intlv_size = 128 + +memory = DualChannelDDR4_2400(size="8GiB") + +generator = SpatterGenerator( + processing_mode="synchronous", num_cores=num_cores +) + +kernels = prepare_kernels( + Path(__file__).parent / "traces/amg.json", + num_cores, + intlv_size, + 0, + memory.get_size() // 2, +) +for kernel in kernels: + generator.add_kernel(kernel) + +board = TestBoard( + clk_freq="4GHz", + generator=generator, + cache_hierarchy=PrivateL1CacheHierarchy( + l1d_size="32KiB", l1i_size="32KiB" + ), + memory=memory, +) + +simulator = Simulator(board=board, full_system=False) + +simulator.run() diff --git a/configs/example/gem5_library/spatter_gen/traces/amg.json b/configs/example/gem5_library/spatter_gen/traces/amg.json new file mode 100644 index 0000000000..64da33a2e1 --- /dev/null +++ b/configs/example/gem5_library/spatter_gen/traces/amg.json @@ -0,0 +1 @@ +[{"delta": 1, "kernel": "Gather", "pattern": [1333, 0, 1, 2, 36, 37, 38, 72, 73, 74, 1296, 1297, 1298, 1332, 1334, 1368], "count": 1454647}, {"delta": 1, "kernel": "Gather", "pattern": [1333, 0, 1, 36, 37, 72, 73, 1296, 1297, 1332, 1368, 1369, 2592, 2593, 2628, 2629], "count": 1454647}] diff --git a/src/python/gem5/components/processors/spatter_gen/__init__.py b/src/python/gem5/components/processors/spatter_gen/__init__.py index 3c1847b914..25c603781f 100644 --- a/src/python/gem5/components/processors/spatter_gen/__init__.py +++ b/src/python/gem5/components/processors/spatter_gen/__init__.py @@ -30,4 +30,6 @@ from .spatter_kernel import ( SpatterKernel, parse_kernel, partition_trace, + prepare_kernels, + unroll_trace, ) diff --git a/src/python/gem5/components/processors/spatter_gen/spatter_kernel.py b/src/python/gem5/components/processors/spatter_gen/spatter_kernel.py index 8b79b685c5..d48b620cc1 100644 --- a/src/python/gem5/components/processors/spatter_gen/spatter_kernel.py +++ b/src/python/gem5/components/processors/spatter_gen/spatter_kernel.py @@ -24,7 +24,9 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import json from math import ceil +from pathlib import Path from typing import ( List, Tuple, @@ -35,36 +37,6 @@ from m5.params import Addr from m5.util import inform -def parse_kernel(kernel: dict, default_delta=8) -> Tuple[int, int, str, List]: - delta = kernel.get("delta", default_delta) - if delta < 0: - inform( - f"Negative delta found: {delta}. Setting it to {default_delta}." - ) - delta = default_delta - count = kernel.get("count", 1) - type = kernel.get("kernel", None) - if type is None: - raise ValueError(f"Keyword 'kernel' not found.") - type = SpatterKernelType(type.lower()) - trace = kernel.get("pattern", []) - if len(trace) == 0: - raise ValueError(f"Empty 'pattern' found.") - return (delta, count, type, trace) - - -def partition_trace(original_trace, num_partitions, interleave_size): - partitions = [[] for _ in range(num_partitions)] - num_leaves = ceil(len(original_trace) / interleave_size) - for i in range(num_leaves): - lower_bound = i * interleave_size - upper_bound = min(lower_bound + interleave_size, len(original_trace)) - partitions[i % num_partitions] += original_trace[ - lower_bound:upper_bound - ] - return partitions - - class SpatterKernel: """This class encapsulates one kernel in a spatter trace. A spatter trace is represented with a json file. @@ -85,15 +57,30 @@ class SpatterKernel: are loads or stores. The field `pattern` stores the index array. - This file provides two utility function to parse spatter traces: + This file provides four utility function to parse spatter traces: parse_kernel: takes a dictionary and returns a tuple of delta, count, type, and trace. - partition_trace: takes the original trace, number of partitions, + partition_trace: takes an original trace, number of partitions, and interleave_size. - It returns a list of `num_partitions` partitions where each partition - is an list including interleaved elements from `original_trace`. + It returns a list of `num_partitions` partitions where each + partition includes interleaved elements from `original_trace`. The elements in the `original_trace` are interleaved with a granularity of `interleave_size`. + unroll_trace: takes an original trace, delta, count, and minimum + number of elements. + It will unroll `original_trace` by adding `delta` to the last + `og_len` (len(`original_trace`)) elements of the trace in steps. + In each step it will decrement `count` by 1. + If the logical length of `original_trace` (`og_len` * `count`) is + smaller than `min_elements`, it allows for filling the trace with + zeros or elements from the pattern. + By filling elements from the pattern, the unrolling process goes + beyond the `count` limit. + However, it will not decrements `count`. + prepare_kernels: takes a trace_path, number of cores, + interleave_size, base_index_addr, and base_value_addr. + It will return a list of lists of kernels where each list of + kernels represents a kernel with a length of `num_cores`. The code snippet below shows how to use these functions to create kernels. generator = SpatterGenerator(num_cores) @@ -128,6 +115,15 @@ class SpatterKernel: `count` from spatter trace. kernel_type (SpatterKernelType): The type of the kernel. `kernel` from spatter trace. + base_index (int): The index from the index array to start from. + It's most meaningful when used in multi-generator simulations. + User defined, i.e. spatter traces don't have this field. + indices_per_stride (int): The number of indices from the index + array to read from before making a jump of size `stride_size`. + User defined, i.e. spatter traces don't have this field. + stride_size (int): The size of the jump to make after reading + `indices_per_stride` indices from the index array. + User defined, i.e. spatter traces don't have this field. kernel_trace (List[int]): The elements of the `index` array. `pattern` from spatter trace. index_size (int): The size of elements in `index`. @@ -158,7 +154,6 @@ class SpatterKernel: value_size: int, base_value_addr: Addr, kernel_trace: List[int], - fix_empty_trace: bool = False, ): self._id = kernel_id self._delta = kernel_delta @@ -173,15 +168,6 @@ class SpatterKernel: self._base_value_addr = base_value_addr self._trace = kernel_trace - if fix_empty_trace and len(kernel_trace) == 0: - inform( - "Empty trace found. Fixing it by adding a dummy element. " - "Also setting delta to 0 and count to 1.", - ) - self._trace = [0] - self._delta = 0 - self._count = 1 - def empty(self): return len(self._trace) == 0 @@ -207,3 +193,192 @@ class SpatterKernel: f"count={self._count}, type={self._type}, " f"trace[:8]={self._trace[:8]}" ) + + +def parse_kernel(kernel: dict, default_delta=8) -> Tuple[int, int, str, List]: + """ + Function to parse a kernel from a dictionary. Each Spatter trace is + represented as a list of dictionaries in JSON. Each dictionary in the list + represents a kernel. This function will one kernel and return a tuple of + delta, count, type, and trace. + Args: + kernel (dict): A dictionary representing a kernel. + default_delta (int): The default delta value to use when the delta + value is not found in the kernel dictionary. + Returns: + Tuple[int, int, str, List]: A tuple of delta, count, type, + and trace extracted from the kernel. + """ + delta = kernel.get("delta", default_delta) + if delta < 0: + inform( + f"Negative delta found: {delta}. Setting it to {default_delta}. " + "You can change the default delta value by passing " + "`default_detla` argument to this function." + ) + delta = default_delta + count = kernel.get("count", 1) + type = kernel.get("kernel", None) + if type is None: + raise ValueError(f"Keyword 'kernel' not found.") + type = SpatterKernelType(type.lower()) + trace = kernel.get("pattern", []) + if len(trace) == 0: + raise ValueError(f"Empty 'pattern' found.") + return (delta, count, type, trace) + + +def unroll_trace( + original_trace: List, + delta: int, + count: int, + min_elements: int, + fill_zero=False, + fill_pattern=False, +): + """ + Function to unroll a trace by creating replicated elements in the trace. + This function will add `delta` to the last `og_len` (len(`original_trace`)) + elements of the trace in steps. In each step it will decrement `count`. + If the logical length of `original_trace` (`og_len` * `count`) is smaller + than `min_elements`, it allows for filling the trace with zeros or elements + from the pattern. By filling elements from the pattern, the unrolling + process goes beyond the `count` limit. However, it will not decrement + `count`. + + Args: + original_trace (List): The original trace to unroll. + delta (int): The delta value as provided from the kernel in JSON. + count (int): The count value as provided from the kernel in JSON. + min_elements (int): The minimum number of elements the trace should + have after unrolling. + fill_zero (bool): If True, the trace will be filled with zeros when + the unrolling process runs out of elements from the original trace. + fill_pattern (bool): If True, the trace will be filled with the pattern + allowing to go over the `count` limit (from the kernel in JSON) when + unrolling. + """ + if fill_zero and fill_pattern: + raise ValueError( + f"Only one of fill_zero or fill_pattern can be True. " + "However, both can be False at the same time." + ) + + if (len(original_trace) * count) < min_elements and ( + not fill_zero and not fill_pattern + ): + raise ValueError( + f"Trace is too small (len(`pattern`) * `count`) < {min_elements}. " + f"It will not have {min_elements} elements after unrolling. " + "You can set fill_zero or fill_pattern to True to fill pattern. " + "fill_zero will fill with zeros when the unrolling process runs " + "out of elements from the original trace. " + "fill_pattern will fill with the pattern allowing to go over the " + "`count` limit (from the kernel in JSON) when unrolling." + ) + + og_len = len(original_trace) + ret_count = count + ret_trace = original_trace + while (len(ret_trace) < min_elements) and ret_count > 1: + ret_trace += [element + delta for element in ret_trace[-og_len:]] + ret_count -= 1 + if (len(ret_trace) < min_elements) and fill_zero: + inform( + "You have chosen to fill the trace with zero " + f"until it reaches at least {min_elements} elements." + ) + ret_trace += [0] * (min_elements - len(ret_trace)) + if (len(ret_trace) < min_elements) and fill_pattern: + inform( + "You have chosen to fill the trace with the pattern " + "(without dectementing count) until it " + f"reaches at least {min_elements} elements." + ) + while len(ret_trace) < min_elements: + ret_trace += [element + delta for element in ret_trace[-og_len:]] + return ret_count, ret_trace + + +def partition_trace(original_trace, num_partitions, interleave_size): + if len(original_trace) < (num_partitions * interleave_size): + raise ValueError( + "Trace (`original_trace`) is too small for the " + "given number of partitions and interleave size. " + "The trace (`original_trace`) should have at least " + "`num_partitions` * `interleave_size` elements." + "It might be due to either the trace being too small " + "or it being folded too many times. You can solve " + "this issue by using the `unroll_trace` function. " + ) + partitions = [[] for _ in range(num_partitions)] + num_leaves = ceil(len(original_trace) / interleave_size) + for i in range(num_leaves): + lower_bound = i * interleave_size + upper_bound = min(lower_bound + interleave_size, len(original_trace)) + partitions[i % num_partitions] += original_trace[ + lower_bound:upper_bound + ] + return partitions + + +def prepare_kernels( + trace_path: Path, + num_cores: int, + interleave_size: int, + base_index_addr: Addr, + base_value_addr: Addr, +) -> List[List[SpatterKernel]]: + """ + Function to prepare kernels from a spatter trace. It will read the trace + from the given path and prepare kernels for the given number of cores and + interleave size. It will partition the trace into `num_cores` partitions + with `interleave_size` elements in each partition. It will also unroll the + trace to have at least `num_cores` * `interleave_size` elements in the + trace using the `unroll_trace` function. In case the trace is too small, + it will ask `unroll_trace` to fill the trace with elements from the + pattern. It will return a list of list of kernels where each list of + kernels represents a kernel with a length of `num_cores`. + Args: + trace_path (Path): Path to the spatter trace. + num_cores (int): Number of cores to partition the trace. + interleave_size (int): Number of elements to interleave the trace by. + base_index_addr (Addr): The base address of the index array. + base_value_addr (Addr): The base address of the value array. + Returns: + List[List[SpatterKernel]]: A list of list of kernels where each list + of kernels represents a kernel with a length of `num_cores`. + """ + trace_file = trace_path.open("r") + kernels = json.load(trace_file) + ret = [] + for i, kernel in enumerate(kernels): + delta, count, type, og_trace = parse_kernel(kernel) + new_count, unrolled_trace = unroll_trace( + og_trace, + delta, + count, + num_cores * interleave_size, + fill_pattern=True, + ) + traces = partition_trace(unrolled_trace, num_cores, interleave_size) + temp = [] + for j, trace in enumerate(traces): + temp.append( + SpatterKernel( + kernel_id=i, + kernel_delta=delta, + kernel_count=new_count, + kernel_type=type, + base_index=j * interleave_size, + indices_per_stride=interleave_size, + stride_size=interleave_size * num_cores, + index_size=4, + base_index_addr=base_index_addr, + value_size=8, + base_value_addr=base_value_addr, + kernel_trace=trace, + ) + ) + ret.append(temp) + return ret From 7f3afc211cbfcd0cfcf530554f0d4126a14160f0 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 21 Jun 2024 11:05:22 +0100 Subject: [PATCH 22/30] misc: Add MPAM entry in the v24 release notes Change-Id: If11d470003e21e51dd5a3b1831d50ed8a54e1919 Signed-off-by: Giacomo Travaglini --- RELEASE-NOTES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 27dd7fe00e..85d03b238a 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -99,6 +99,10 @@ This can be used to build and run gem5 in consistent environment and enables Git * An integer overflow error known to affect the `AddrRange` class has been fixed. * Fix fflags behavior of floating point instruction in RISC-V for Out-of-Order CPUs. +### Arm FEAT_MPAM Support + +An initial implementation of FEAT_MPAM has been introduced in gem5 with the capability to statically partition +classic caches. Guidance on how to use this is available on a Arm community [blog post](https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/gem5-cache-partitioning) # Version 23.1 From 84c3b0c111d4a4fcc32dc8439c47b36f0c720106 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Sat, 22 Jun 2024 12:58:35 -0700 Subject: [PATCH 23/30] misc: Update dummy jobs for workflows These give us clear indications if a workflow has passed or failed. Change-Id: If61b9ac5dc4d2da54b4ad68e427b149bbcb4a30b --- .github/workflows/ci-tests.yaml | 14 +++++++++----- .github/workflows/weekly-tests.yaml | 2 ++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 663e7219ac..a1adfdb8ef 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -221,12 +221,16 @@ jobs: path: tests/testing-results retention-days: 30 - testlib-quick: + ci-tests: # It is 'testlib-quick' which needs to pass for the pull request to be - # merged. The 'testlib-quick-execution' is a matrix job which runs all the - # the testlib quick tests. This job is therefore a stub which will pass if - # all the testlib-quick-execution jobs pass. + # merged. This job is a dummy job that depends on all the other jobs. runs-on: ubuntu-latest - needs: [testlib-quick-execution, pyunit] + needs: + - testlib-quick-execution + - pyunit + - clang-fast-compilation + - unittests-all-opt + - pre-commit + - check-for-change-id steps: - run: echo "This job's status is ${{ job.status }}." diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index 7d06d94ad8..f30c283f78 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -186,5 +186,7 @@ jobs: needs: - testlib-very-long-tests - dramsys-tests + - LULESH-test + - HACC-test steps: - run: echo "This weekly tests have passed." From 241b8a09df1e09e4686c25079c04465e212e0091 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Tue, 25 Jun 2024 09:01:36 -0700 Subject: [PATCH 24/30] resources: Update client_query to trim gem5 version (#1284) - gem5 was querying the full version of gem5 that is `24.0.0.0` while searching for resources. This was causing an error to find resources on staging branch. This change trims the gem5 version to be just the major.minor version. Change-Id: I30c3a1b38c631981f797ef0fd2b616e6a66ca18e --- src/python/gem5/resources/client_api/client_query.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/python/gem5/resources/client_api/client_query.py b/src/python/gem5/resources/client_api/client_query.py index b41ef6b2f8..88fb149d9f 100644 --- a/src/python/gem5/resources/client_api/client_query.py +++ b/src/python/gem5/resources/client_api/client_query.py @@ -45,7 +45,10 @@ class ClientQuery: ): self.resource_id = resource_id self.resource_version = resource_version - self.gem5_version = gem5_version + # We only need the major and minor version numbers. + # As on database side, we only store the major and minor + # version numbers. + self.gem5_version = ".".join(gem5_version.split(".")[:2]) def get_resource_id(self) -> str: return self.resource_id From faa18576f26d9474f3e4d68005638ca30741ffeb Mon Sep 17 00:00:00 2001 From: Matthew Poremba Date: Tue, 25 Jun 2024 11:21:20 -0700 Subject: [PATCH 25/30] misc: Add high level GPU model release notes Change-Id: I73dfba5eeeffe1b812bc41a80b9d0901822e8062 --- RELEASE-NOTES.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 85d03b238a..dcbcce85cd 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -92,7 +92,9 @@ This can be used to build and run gem5 in consistent environment and enables Git ### GPU Model -* Supporty for the MI200 GPU model. +* Support for MI300X and MI200 GPU models including their features and most instructions. +* ROCm 6.1 disk image and compile docker files have been added. ROCm 5.4.2 and 4.2 resources are removed. +* The deprecated GCN3 ISA has been removed. Use VEGA instead. ## Bug Fixes From e0d03fbc2f2f7bbdc0bd031a09409ae9b397eac2 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Tue, 25 Jun 2024 16:30:07 -0700 Subject: [PATCH 26/30] resources: fix check for additional_params for workloads Change-Id: I0a4b5f0eef6e2f9faf35cea8130572a066aab6cd --- src/python/gem5/resources/resource.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/python/gem5/resources/resource.py b/src/python/gem5/resources/resource.py index b3432ffe07..bccf0a1b87 100644 --- a/src/python/gem5/resources/resource.py +++ b/src/python/gem5/resources/resource.py @@ -1164,7 +1164,10 @@ def _get_workload( ) # Adding the additional parameters to the workload parameters - if workload["additional_params"]: + if ( + "additional_params" in workload.keys() + and workload["additional_params"] + ): for key in workload["additional_params"].keys(): assert isinstance(key, str) value = workload["additional_params"][key] From 9d05b3588414e91dc9e9b5d54745bd93b1850853 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 26 Jun 2024 13:42:42 -0700 Subject: [PATCH 27/30] misc: Improve gem5 Release notes for v24.0 Change-Id: I5d59f41a84919a9eba1cc00b116e2477ad0beb6e --- RELEASE-NOTES.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index dcbcce85cd..5666b8b6b3 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -5,7 +5,6 @@ During this time there have been 298 pull requests merged, comprising of over 60 ## API and user-facing changes - * The GCN3 GPU model has been removed in favor of the newer VEGA_X85 GPU model. * gem5 now supports building, running, and simulating Ubuntu 24.04. @@ -76,6 +75,12 @@ Example scripts of using MultiSim can be found in "configs/example/gem5_library/ ### RISC-V Vector Extension Support +**@powerjg : Can you add some details here?** + +### Scatter + +**@powerjg : Can you add some details here?** + ## Improvements * KVM is now supported in the gem5 Standard Library ARM Board. @@ -87,8 +92,28 @@ This can be used to build and run gem5 in consistent environment and enables Git ### gem5 Python Statistics +The gem5 Python statistics API has been improved. +The gem5 Project's general intent with this improvement is make it easier and more desirable to obtain and interact with gem5 simulation statistics via Python. +For example, the following code snippet demonstrates how to obtain statistics from a gem5 simulation: +```python +from m5.stats.gem5stats import get_simstat + +## Setup and run the configuation ... +simstat = get_simstat(board) + +# Print the number of cycles the CPU at index 0 has executed. +print(simstat.cpu[0].numCycles) + +# Strings can also be used to access statistics. +print(simstat['cpu'][0]['numCycles']) + +# Print the total number of cycles executed by all CPUs. +print(sum(simstat.cpu[i].numCycles for i in range(len(simstat.cpu)))) +``` + +We hope the usage of the gem5 Python statistics API will be more intuitive and easier to use while allowing better processing of statistical data. ### GPU Model From c1825a9c0a571c60298784465b8eff6046f0d04b Mon Sep 17 00:00:00 2001 From: Jason Lowe-Power Date: Wed, 26 Jun 2024 15:09:27 -0700 Subject: [PATCH 28/30] misc: Update release notes Change-Id: Ia8bd55ab46dca7f0eef533c0c3b7da1fe4c84cc9 Signed-off-by: Jason Lowe-Power --- RELEASE-NOTES.md | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 5666b8b6b3..c2c6b382e0 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -67,7 +67,7 @@ If only one simulation specified in the config needs run, you can do so with: ```sh --list # Lists the simulations by ID - # Run the simulation with the specified ID. + # Run the simulation with the specified ID. ``` Example scripts of using MultiSim can be found in "configs/example/gem5_library/multisim". @@ -75,14 +75,38 @@ Example scripts of using MultiSim can be found in "configs/example/gem5_library/ ### RISC-V Vector Extension Support -**@powerjg : Can you add some details here?** +There have been significant improvements to the RVV support in gem5 including -### Scatter +* Fixed viota (#1137) +* Fixed vrgather (#1134) +* Added RVV FP16 support (#1123) +* Fixed widening and narrowing instructions (#1079) +* Fixed bug in vfmv.f.s (#863) +* Add unit stride segment loads and stores (#851) (#913) +* Fix vl in masked load/store (#830) +* Add unit-stride loads (#794) +* Fix many RVV instructions (#814) (#805) (#715) -**@powerjg : Can you add some details here?** +### General RISC-V bugfixes + +* Fixed problem in TLB lookup (#1264) +* Fixed sign-extended branch target (#1173) +* Fixed compressed jump instructions (#1163) +* Fixed GDB connection (#1152) +* Fixed CSR behavior (#1099) +* Add Integer conditional operations Zicond (#1078) +* Add RISC-V Semihosting support (#681) +* Added more detailed instruction types (#589) +* Fixed 32-bit m5op arguments (#900) +* Fixed c.fswsp and c.fsw (#998) (#1005) +* Update PLIC implementation (#886) +* Fix fflags behavior in O3 (#868) +* Add support for local interrupts (#813) +* Removebit 63 of physical address (#756) ## Improvements +* Added an new generator which can generate requests based on [spatter](https://github.com/hpcgarage/spatter) patterns. * KVM is now supported in the gem5 Standard Library ARM Board. * Generic Cache template added to the Standard Library: https://github.com/gem5/gem5/pull/745 * Support added for partitioning caches. From b471d5f3826505c05904b7694fbd61ccd2beea2f Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 27 Jun 2024 05:48:48 -0700 Subject: [PATCH 29/30] stdlib,tests: Update resources to v24.0 in Pyunit test (#1290) This needs a better fix. I don't like having to update these files for every release. Though for now, this will mean the tests passing in v24.0 --- .../stdlib/resources/refs/mongo-mock.json | 6 ++-- .../resources/refs/obtain-resource.json | 12 ++++--- .../refs/resource-specialization.json | 3 +- .../stdlib/resources/refs/resources.json | 33 ++++++++++++------- .../stdlib/resources/refs/suite-checks.json | 17 ++++++---- .../resources/refs/workload-checks.json | 12 ++++--- 6 files changed, 55 insertions(+), 28 deletions(-) diff --git a/tests/pyunit/stdlib/resources/refs/mongo-mock.json b/tests/pyunit/stdlib/resources/refs/mongo-mock.json index e2fb058ff7..f351907074 100644 --- a/tests/pyunit/stdlib/resources/refs/mongo-mock.json +++ b/tests/pyunit/stdlib/resources/refs/mongo-mock.json @@ -22,7 +22,8 @@ "source_url": "https://github.com/gem5/gem5-resources/tree/develop/src/x86-ubuntu", "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "example_usage": "get_resource(resource_name=\"x86-ubuntu-18.04-img\")" }, @@ -49,7 +50,8 @@ "source_url": "https://github.com/gem5/gem5-resources/tree/develop/src/x86-ubuntu", "resource_version": "1.1.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "example_usage": "get_resource(resource_name=\"x86-ubuntu-18.04-img\")" } diff --git a/tests/pyunit/stdlib/resources/refs/obtain-resource.json b/tests/pyunit/stdlib/resources/refs/obtain-resource.json index 9125bf4ae6..08aa448bb4 100644 --- a/tests/pyunit/stdlib/resources/refs/obtain-resource.json +++ b/tests/pyunit/stdlib/resources/refs/obtain-resource.json @@ -10,7 +10,8 @@ "source": "src/test-source", "resource_version": "2.5.0", "gem5_versions": [ - "25.0" + "25.0", + "24.0" ] }, { @@ -24,7 +25,8 @@ "source": "src/test-source", "resource_version": "2.0.0", "gem5_versions": [ - "23.0" + "23.0", + "24.0" ] }, { @@ -39,7 +41,8 @@ "resource_version": "1.7.0", "gem5_versions": [ "develop", - "develop-2" + "develop-2", + "24.0" ] }, { @@ -53,7 +56,8 @@ "source": "src/test-source", "resource_version": "1.5.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ] } ] diff --git a/tests/pyunit/stdlib/resources/refs/resource-specialization.json b/tests/pyunit/stdlib/resources/refs/resource-specialization.json index 9a92204765..aa6bac16f1 100644 --- a/tests/pyunit/stdlib/resources/refs/resource-specialization.json +++ b/tests/pyunit/stdlib/resources/refs/resource-specialization.json @@ -114,7 +114,8 @@ "resource_version": "1.0.0", "gem5_versions": [ "develop", - "23.0" + "23.0", + "24.0" ] }, { diff --git a/tests/pyunit/stdlib/resources/refs/resources.json b/tests/pyunit/stdlib/resources/refs/resources.json index 56930f37d5..40d484c9a8 100644 --- a/tests/pyunit/stdlib/resources/refs/resources.json +++ b/tests/pyunit/stdlib/resources/refs/resources.json @@ -21,7 +21,8 @@ "source_url": "https://github.com/gem5/gem5-resources/tree/develop/src/asmtest", "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "example_usage": "get_resource(resource_name=\"rv64mi-p-sbreak\")" }, @@ -48,7 +49,8 @@ "source_url": "https://github.com/gem5/gem5-resources/tree/develop/src/asmtest", "resource_version": "1.1.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "example_usage": "get_resource(resource_name=\"rv64mi-p-sbreak\")" }, @@ -94,7 +96,8 @@ "source_url": "", "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "workload_name": "x86-print-this-15000-with-simpoints", "example_usage": "get_resource(resource_name=\"x86-print-this-1500-simpoints\")", @@ -122,7 +125,8 @@ "source_url": "", "resource_version": "0.2.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "workload_name": "x86-print-this-15000-with-simpoints", "example_usage": "get_resource(resource_name=\"x86-print-this-1500-simpoints\")", @@ -150,7 +154,8 @@ "source_url": "", "resource_version": "0.2.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "workload_name": "x86-print-this-15000-with-simpoints", "example_usage": "get_resource(resource_name=\"x86-print-this-1500-simpoints\")", @@ -178,7 +183,8 @@ "source_url": "", "resource_version": "0.2.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "workload_name": "x86-print-this-15000-with-simpoints", "example_usage": "get_resource(resource_name=\"x86-print-this-1500-simpoints\")", @@ -206,7 +212,8 @@ "source_url": "", "resource_version": "0.2.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "workload_name": "x86-print-this-15000-with-simpoints", "example_usage": "get_resource(resource_name=\"x86-print-this-1500-simpoints\")", @@ -234,7 +241,8 @@ "source_url": "", "resource_version": "0.2.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "workload_name": "x86-print-this-15000-with-simpoints", "example_usage": "get_resource(resource_name=\"x86-print-this-1500-simpoints\")", @@ -262,7 +270,8 @@ "source_url": "", "resource_version": "0.2.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "workload_name": "x86-print-this-15000-with-simpoints", "example_usage": "get_resource(resource_name=\"x86-print-this-1500-simpoints\")", @@ -290,7 +299,8 @@ "source_url": "", "resource_version": "0.2.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "workload_name": "x86-print-this-15000-with-simpoints", "example_usage": "get_resource(resource_name=\"x86-print-this-1500-simpoints\")", @@ -322,7 +332,8 @@ "source_url": "https://github.com/gem5/gem5-resources/tree/develop/src/x86-ubuntu", "resource_version": "2.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ], "example_usage": "get_resource(resource_name=\"x86-ubuntu-18.04-img\")" } diff --git a/tests/pyunit/stdlib/resources/refs/suite-checks.json b/tests/pyunit/stdlib/resources/refs/suite-checks.json index aa06835a93..0e4a413c59 100644 --- a/tests/pyunit/stdlib/resources/refs/suite-checks.json +++ b/tests/pyunit/stdlib/resources/refs/suite-checks.json @@ -3,7 +3,7 @@ "id": "suite-example", "category": "suite", "resource_version": "1.0.0", - "gem5_versions": ["develop","23.1"], + "gem5_versions": ["develop","23.1", "24.0"], "workloads": [ { "id": "simple-workload-1", @@ -37,7 +37,8 @@ }, "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ] }, { @@ -60,7 +61,8 @@ }, "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ] }, { @@ -74,7 +76,8 @@ "source": "src/linux-kernel", "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ] }, { @@ -89,7 +92,8 @@ "root_partition": "1", "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ] }, { @@ -103,7 +107,8 @@ "source": "src/simple", "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ] } ] diff --git a/tests/pyunit/stdlib/resources/refs/workload-checks.json b/tests/pyunit/stdlib/resources/refs/workload-checks.json index 0daa52269b..099005bdf5 100644 --- a/tests/pyunit/stdlib/resources/refs/workload-checks.json +++ b/tests/pyunit/stdlib/resources/refs/workload-checks.json @@ -10,7 +10,8 @@ "source": "src/linux-kernel", "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ] }, { @@ -25,7 +26,8 @@ "root_partition": "1", "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ] }, { @@ -48,7 +50,8 @@ }, "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ] }, { @@ -62,7 +65,8 @@ "source": "src/simple", "resource_version": "1.0.0", "gem5_versions": [ - "develop" + "develop", + "24.0" ] } ] From 3acb6e59cf8325be3e2bd9f6a70a922f2399e9fa Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Thu, 27 Jun 2024 20:02:57 -0700 Subject: [PATCH 30/30] resources: Update elfie.py to work with obtain_resources (#1289) Change-Id: I08c5e50a150c8434c6c2ca36af81fb6ec3915af8 --- src/python/gem5/resources/elfie.py | 29 +++++++++++++++++++++++++-- src/python/gem5/resources/resource.py | 2 ++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/python/gem5/resources/elfie.py b/src/python/gem5/resources/elfie.py index d90930d3f0..840a664a97 100644 --- a/src/python/gem5/resources/elfie.py +++ b/src/python/gem5/resources/elfie.py @@ -24,7 +24,10 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from typing import List +from typing import ( + List, + Optional, +) from m5.objects import PcCountTrackerManager from m5.params import PcCountPair @@ -36,9 +39,31 @@ class ELFieInfo: See https://github.com/intel/pinball2elf for more information. """ - def __init__(self, start: PcCountPair, end: PcCountPair): + def __init__( + self, + start_pc: Optional[str] = None, + end_pc: Optional[str] = None, + start_pc_count: Optional[str] = None, + end_pc_count: Optional[str] = None, + start: Optional["PcCountPair"] = None, + end: Optional["PcCountPair"] = None, + **kwargs + ): self._start = start self._end = end + + if self._start is None: + if start_pc is None or start_pc_count is None: + raise ValueError( + "start_pc and start_pc_count must be provided" + ) + self._start = PcCountPair(int(start_pc, 16), int(start_pc_count)) + + if self._end is None: + if end_pc is None or end_pc_count is None: + raise ValueError("end_pc and end_pc_count must be provided") + self._end = PcCountPair(int(end_pc, 16), int(end_pc_count)) + self._manager = PcCountTrackerManager() self._manager.targets = self.get_targets() diff --git a/src/python/gem5/resources/resource.py b/src/python/gem5/resources/resource.py index bccf0a1b87..eb3ca78fe9 100644 --- a/src/python/gem5/resources/resource.py +++ b/src/python/gem5/resources/resource.py @@ -57,6 +57,7 @@ from .client import ( ) from .client_api.client_query import ClientQuery from .downloader import get_resource +from .elfie import ELFieInfo from .looppoint import ( LooppointCsvLoader, LooppointJsonLoader, @@ -1411,4 +1412,5 @@ _get_resource_json_type_map = { "looppoint-json": LooppointJsonResource, "suite": SuiteResource, "workload": WorkloadResource, + "elfie-info": ELFieInfo, }