[gem5-dev] [XS] Change in gem5/gem5[develop]: test: Check if Gerrit is read-only
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/72231?usp=email ) Change subject: test: Check if Gerrit is read-only .. test: Check if Gerrit is read-only Change-Id: I393d71d89ca008964c340648f72ac81caab600fd --- A text.txt 1 file changed, 1 insertion(+), 0 deletions(-) diff --git a/text.txt b/text.txt new file mode 100644 index 000..d887fd00 --- /dev/null +++ b/text.txt @@ -0,0 +1 @@ +testing read-only state -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/72231?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I393d71d89ca008964c340648f72ac81caab600fd Gerrit-Change-Number: 72231 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: misc: Include body in check for Change-Id
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/72229?usp=email ) Change subject: misc: Include body in check for Change-Id .. misc: Include body in check for Change-Id Updates ci-tests.yaml to check the entire commit message for the Change-Id, not just the subject. Change-Id: Ia76c77d096617a6fe76ffea7f2bd8a4295ca14f7 --- M .github/workflows/ci-tests.yaml 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 520767b..c184e48 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -29,7 +29,7 @@ # loop through all the commits in the pull request for commit in $(git rev-list ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}); do git checkout $commit - if (git log -1 --pretty=format:"%s" | grep -q "Change-Id: ") + if (git log -1 --pretty=format:"%B" | grep -q "Change-Id: ") then # passes as long as at least one change-id exists in the pull request exit 0 -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/72229?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ia76c77d096617a6fe76ffea7f2bd8a4295ca14f7 Gerrit-Change-Number: 72229 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: misc: Update CI tests to only require 1 Change-Id
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/72221?usp=email ) Change subject: misc: Update CI tests to only require 1 Change-Id .. misc: Update CI tests to only require 1 Change-Id Since commits will be squashed and merged in GitHub, we only require one of the commits to contain a Change-ID within a pull request Change-Id: I0fbb1c0e79009097456193fbe3c6fa20746e4805 --- M .github/workflows/ci-tests.yaml 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 85836a2..520767b 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -26,16 +26,20 @@ fetch-depth: 0 - name: Check for Change-Id run: | + # loop through all the commits in the pull request for commit in $(git rev-list ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}); do git checkout $commit - if !(git log -1 --pretty=format:"%s" | grep -q "Change-Id: ") + if (git log -1 --pretty=format:"%s" | grep -q "Change-Id: ") then -echo "One or more of the commits in this pull request is missing a Change-ID, which we require for any changes made to gem5. "\ -"To automatically insert one, run the following:\n f=`git rev-parse --git-dir`/hooks/commit-msg ; mkdir -p $(dirname $f) ; "\ -"curl -Lo $f https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x $f\n Then amend the commit with git commit --amend --no-edit, and update your pull request." -exit 1 +# passes as long as at least one change-id exists in the pull request +exit 0 fi done + # if we reach this part, none of the commits had a change-id + echo "None of the commits in this pull request contains a Change-ID, which we require for any changes made to gem5. "\ +"To automatically insert one, run the following:\n f=`git rev-parse --git-dir`/hooks/commit-msg ; mkdir -p $(dirname $f) ; "\ +"curl -Lo $f https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x $f\n Then amend the commit with git commit --amend --no-edit, and update your pull request." + exit 1 build-gem5: runs-on: [self-hosted, linux, x64, build] -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/72221?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I0fbb1c0e79009097456193fbe3c6fa20746e4805 Gerrit-Change-Number: 72221 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: misc: Add runs-on line to CI tests
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/72220?usp=email ) Change subject: misc: Add runs-on line to CI tests .. misc: Add runs-on line to CI tests Adds missing line to CI tests Change-Id: I34019d76648dc6025ac89cbec4605f17d2a5e3f7 --- M .github/workflows/ci-tests.yaml 1 file changed, 1 insertion(+), 0 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 83a1b87..85836a2 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -19,6 +19,7 @@ # 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 steps: - uses: actions/checkout@v3 with: -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/72220?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I34019d76648dc6025ac89cbec4605f17d2a5e3f7 Gerrit-Change-Number: 72220 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: misc: Update Change-Id Check
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/72219?usp=email ) Change subject: misc: Update Change-Id Check .. misc: Update Change-Id Check This updates the change-id code to refer to commit messages in pull requests instead of on pushes. Change-Id: I308f02b4616804b386140d5875a79878eccd721e --- M .github/workflows/ci-tests.yaml 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 61ba4b5..83a1b87 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -16,10 +16,30 @@ - uses: actions/setup-python@v3 - uses: pre-commit/action@v3.0.0 + # ensures we have a change-id in every commit, needed for gerrit + check-for-change-id: +# runs on github hosted runner +steps: + - uses: actions/checkout@v3 +with: + fetch-depth: 0 + - name: Check for Change-Id +run: | + for commit in $(git rev-list ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}); do + git checkout $commit + if !(git log -1 --pretty=format:"%s" | grep -q "Change-Id: ") + then +echo "One or more of the commits in this pull request is missing a Change-ID, which we require for any changes made to gem5. "\ +"To automatically insert one, run the following:\n f=`git rev-parse --git-dir`/hooks/commit-msg ; mkdir -p $(dirname $f) ; "\ +"curl -Lo $f https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x $f\n Then amend the commit with git commit --amend --no-edit, and update your pull request." +exit 1 + fi + done + build-gem5: runs-on: [self-hosted, linux, x64, build] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -needs: pre-commit # only runs if pre-commit passes +needs: [pre-commit, check-for-change-id] # only runs if pre-commit and change-id passes outputs: artifactname: ${{ steps.name.outputs.test }} steps: @@ -39,7 +59,7 @@ unittests-all-opt: runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -needs: pre-commit # only runs if pre-commit passes +needs: [pre-commit, check-for-change-id] # only runs if pre-commit and change-id passes timeout-minutes: 60 steps: - uses: actions/checkout@v3 @@ -51,7 +71,7 @@ testlib-quick: runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -needs: [pre-commit, build-gem5] +needs: [pre-commit, build-gem5, check-for-change-id] timeout-minutes: 360 # 6 hours steps: - uses: actions/checkout@v3 -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/72219?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I308f02b4616804b386140d5875a79878eccd721e Gerrit-Change-Number: 72219 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[stable]: misc: Check for Change-Id in GitHub Actions
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/72118?usp=email ) Change subject: misc: Check for Change-Id in GitHub Actions .. misc: Check for Change-Id in GitHub Actions This adds a check to our continous integration tests that ensures that every single commit in a pull request has a Change-Id, and instructs you to add one if that check fails. This ensures all commits on GitHub are still compatible with Gerrit. Change-Id: I3fd753da5ab3ca6d6334a8e0eb574433aa1ca589 --- M .github/workflows/ci-tests.yaml 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 61ba4b5..c3188b8 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -16,10 +16,33 @@ - uses: actions/setup-python@v3 - uses: pre-commit/action@v3.0.0 + # ensures we have a change-id in every commit, needed for gerrit + check-for-change-id: +# runs on github hosted runner +runs-on: ubuntu-latest +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +steps: + - uses: actions/github-script@v6 +env: + token: "Change-Id" + pattern: ".*" +with: + script: | +const commits = ${{ toJSON(github.event.commits) }} +for (const commit of commits) { + const id = "Change-Id: " + const message = commit.message; + if (!message.includes(id)) { +core.setFailed('One or more of the commits in this pull request is missing a Change-ID, which we require for any changes made to gem5. ' + +'To automatically insert one, run the following:\n f=`git rev-parse --git-dir`/hooks/commit-msg ; mkdir -p $(dirname $f) ; ' + +'curl -Lo $f https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x $f\n Then amend the commit with git commit --amend --no-edit, and update your pull request.') + } +} + build-gem5: runs-on: [self-hosted, linux, x64, build] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -needs: pre-commit # only runs if pre-commit passes +needs: [pre-commit, check-for-change-id] # only runs if pre-commit and change-id passes outputs: artifactname: ${{ steps.name.outputs.test }} steps: @@ -39,7 +62,7 @@ unittests-all-opt: runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -needs: pre-commit # only runs if pre-commit passes +needs: [pre-commit, check-for-change-id] # only runs if pre-commit and change-id passes timeout-minutes: 60 steps: - uses: actions/checkout@v3 @@ -51,7 +74,7 @@ testlib-quick: runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -needs: [pre-commit, build-gem5] +needs: [pre-commit, check-for-change-id, build-gem5] timeout-minutes: 360 # 6 hours steps: - uses: actions/checkout@v3 -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/72118?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: stable Gerrit-Change-Id: I3fd753da5ab3ca6d6334a8e0eb574433aa1ca589 Gerrit-Change-Number: 72118 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [M] Change in gem5/gem5[develop]: misc: Update documentation and links for GitHub
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71878?usp=email ) Change subject: misc: Update documentation and links for GitHub .. misc: Update documentation and links for GitHub This changes mentions of googlesource and Gerrit to instead link to the gem5 GitHub repository, and updates the documentation to reflect the GitHub review process. Change-Id: I5dc1d9fcf6b96f9e5116802f938b7e3bb5b09567 --- M CONTRIBUTING.md M TESTING.md M configs/example/gem5_library/arm-hello.py M configs/example/gem5_library/checkpoints/riscv-hello-save-checkpoint.py M configs/example/gem5_library/dramsys/arm-hello-dramsys.py M configs/example/gem5_library/riscv-fs.py M ext/sst/README.md M tests/weekly.sh 8 files changed, 54 insertions(+), 45 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c3c4d61..b41a73a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,12 +14,12 @@ * You will have the satisfaction of contributing back to the community. The main method for contributing code to gem5 is via our code review website: -https://gem5-review.googlesource.com/. This documents describes the details of +https://github.com/gem5/gem5/pulls/. This documents describes the details of how to create code changes, upload your changes, have your changes reviewed, and finally push your changes to gem5. More information can be found from the following sources: * http://gem5.org/contributing - * https://gerrit-review.googlesource.com/Documentation/index.html + * https://docs.github.com/en/pull-requests * https://git-scm.com/book @@ -277,9 +277,7 @@ a special named branch. For more information on git push see https://git-scm.com/docs/git-push. -There are three ways to push your changes to gerrit. - -Push change to gerrit review +Push changes to GitHub 1. Fork the gem5 repository on GitHub from https://github.com/gem5/gem5/. 2. Create a new branch in your forked repository for your feature or bug fix. @@ -296,35 +294,7 @@ stable branch is maintained as a stable release branch (i.e., it can be pulled to obtain the latest official release of gem5). Creation of additional branches is generally discouraged due to their tendency to bloat git repositories with -abandoned code. However, the creation of new branches is permitted for -development of a specific feature or improvement if one or more of the -following criteria are met: - -1. The feature/improvement is likely to be of a large size, consisting of many -commits, with little logic in these commits being contributed separately. -2. The feature/improvement will be developed over a long period of time. -3. There is sufficient reason that a feature/improvement should not be part -of the next gem5 release (e.g., the change should be held within a feature -branch until ready for the next release, at which point it will be merged -into the develop branch). - -If a branch is required it can only be created by a project maintainer. -Therefore, if a gem5 contributor desires a separate branch for their work, they -should request one from the maintainer of the component the work relates to -(see MAINTAINERS for the list of maintainers and the components they are -responsible for). **The maintainer shall use their discretion to determine -whether the creation of a branch is necessary**. If approved, the maintainer -shall create the branch which the contributor may then use. - -Development on a branch within Gerrit functions in exactly the same way as -contributing to the develop branch. When contributors to a branch are -satisfied, they should create a merge commit into the develop branch. The -maintainer should then be notified that the branch they created can now be -deleted. - -**Abandonment of changes within branches may result in these branches being -removed from the repository. All branches within a repo should be under active -development.** +abandoned code. Reviewing patches = @@ -332,7 +302,7 @@ Reviewing patches is done on our github instance at https://github.com/gem5/gem5/pulls/. -After logging in with your Google account, you will be able to comment, review, +After logging in with your GitHub account, you will be able to comment, review, and push your own patches as well as review others' patches. All gem5 users are encouraged to review patches. The only requirement to review patches is to be polite and respectful of others. diff --git a/TESTING.md b/TESTING.md index 146aeac..50cc9be 100644 --- a/TESTING.md +++ b/TESTING.md @@ -18,8 +18,8 @@ scons build/ALL/unittests.opt ``` -All unit tests should be run prior to posting a patch to -https://gem5-review.googlesource.com +All unit tests should be run prior to creating a pull request at +https://github.com/gem5/gem5/pulls/ To compile and run just one set of tests (e.g. thos
[gem5-dev] [S] Change in gem5/gem5[develop]: resources: Catch ConnectionResourceError in downloading resources
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71858?usp=email ) Change subject: resources: Catch ConnectionResourceError in downloading resources .. resources: Catch ConnectionResourceError in downloading resources This handles an error we see within GitHub Actions that occassionally occurs when downloading resources. We retry in the same way we do when handling HTTPErrors. Change-Id: I4dce5d607ccc41ad53b51e39082c486e644d815c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71858 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- M src/python/gem5/resources/downloader.py 1 file changed, 16 insertions(+), 0 deletions(-) Approvals: kokoro: Regressions pass Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved diff --git a/src/python/gem5/resources/downloader.py b/src/python/gem5/resources/downloader.py index bb5ca84..d606f34 100644 --- a/src/python/gem5/resources/downloader.py +++ b/src/python/gem5/resources/downloader.py @@ -139,6 +139,22 @@ time.sleep((2**attempt) + random.uniform(0, 1)) else: raise e +except ConnectionResetError as e: +# This catches the ConnectionResetError we see occassionally see +# when accessing resources on GitHub Actions. It retries using a +# Truncated Exponential backoff algorithm, truncating after +# "max_attempts". If any other is retrieved we raise the error. +if e.errno == 104: +attempt += 1 +if attempt >= max_attempts: +raise Exception( +f"After {attempt} attempts, the resource json could " +"not be retrieved. OS Error Code retrieved: " +f"{e.errno}" +) +time.sleep((2**attempt) + random.uniform(0, 1)) +else: +raise e except ValueError as e: raise Exception( "Environment variable GEM5_USE_PROXY is set to " -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71858?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I4dce5d607ccc41ad53b51e39082c486e644d815c Gerrit-Change-Number: 71858 Gerrit-PatchSet: 2 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro Gerrit-CC: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: resources: Output error message in downloader.py
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71859?usp=email ) Change subject: resources: Output error message in downloader.py .. resources: Output error message in downloader.py This allows for the actual error message to be output in addition to the output gem5 has on ValueErrors and ImportErrors. Change-Id: Ic52f5646aa41dbf7c217ab27d142c0a18fa24c55 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71859 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- M src/python/gem5/resources/downloader.py 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: kokoro: Regressions pass Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved diff --git a/src/python/gem5/resources/downloader.py b/src/python/gem5/resources/downloader.py index d606f34..1aeb487 100644 --- a/src/python/gem5/resources/downloader.py +++ b/src/python/gem5/resources/downloader.py @@ -157,12 +157,14 @@ raise e except ValueError as e: raise Exception( +f"ValueError: {e}\n" "Environment variable GEM5_USE_PROXY is set to " f"'{use_proxy}'. The expected form is " ":'." ) except ImportError as e: raise Exception( +f"ImportError: {e}\n" "An import error has occurred. This is likely due " "the Python SOCKS client module not being " "installed. It can be installed with " -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71859?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ic52f5646aa41dbf7c217ab27d142c0a18fa24c55 Gerrit-Change-Number: 71859 Gerrit-PatchSet: 2 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro Gerrit-CC: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: resources: Output error message in downloader.py
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71859?usp=email ) Change subject: resources: Output error message in downloader.py .. resources: Output error message in downloader.py This allows for the actual error message to be output in addition to the output gem5 has on ValueErrors and ImportErrors. Change-Id: Ic52f5646aa41dbf7c217ab27d142c0a18fa24c55 --- M src/python/gem5/resources/downloader.py 1 file changed, 2 insertions(+), 0 deletions(-) diff --git a/src/python/gem5/resources/downloader.py b/src/python/gem5/resources/downloader.py index d606f34..1aeb487 100644 --- a/src/python/gem5/resources/downloader.py +++ b/src/python/gem5/resources/downloader.py @@ -157,12 +157,14 @@ raise e except ValueError as e: raise Exception( +f"ValueError: {e}\n" "Environment variable GEM5_USE_PROXY is set to " f"'{use_proxy}'. The expected form is " ":'." ) except ImportError as e: raise Exception( +f"ImportError: {e}\n" "An import error has occurred. This is likely due " "the Python SOCKS client module not being " "installed. It can be installed with " -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71859?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ic52f5646aa41dbf7c217ab27d142c0a18fa24c55 Gerrit-Change-Number: 71859 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: resources: Catch ConnectionResourceError in downloading resources
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71858?usp=email ) Change subject: resources: Catch ConnectionResourceError in downloading resources .. resources: Catch ConnectionResourceError in downloading resources This handles an error we see within GitHub Actions that occassionally occurs when downloading resources. We retry in the same way we do when handling HTTPErrors. Change-Id: I4dce5d607ccc41ad53b51e39082c486e644d815c --- M src/python/gem5/resources/downloader.py 1 file changed, 16 insertions(+), 0 deletions(-) diff --git a/src/python/gem5/resources/downloader.py b/src/python/gem5/resources/downloader.py index bb5ca84..d606f34 100644 --- a/src/python/gem5/resources/downloader.py +++ b/src/python/gem5/resources/downloader.py @@ -139,6 +139,22 @@ time.sleep((2**attempt) + random.uniform(0, 1)) else: raise e +except ConnectionResetError as e: +# This catches the ConnectionResetError we see occassionally see +# when accessing resources on GitHub Actions. It retries using a +# Truncated Exponential backoff algorithm, truncating after +# "max_attempts". If any other is retrieved we raise the error. +if e.errno == 104: +attempt += 1 +if attempt >= max_attempts: +raise Exception( +f"After {attempt} attempts, the resource json could " +"not be retrieved. OS Error Code retrieved: " +f"{e.errno}" +) +time.sleep((2**attempt) + random.uniform(0, 1)) +else: +raise e except ValueError as e: raise Exception( "Environment variable GEM5_USE_PROXY is set to " -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71858?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I4dce5d607ccc41ad53b51e39082c486e644d815c Gerrit-Change-Number: 71858 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[stable]: misc: Adjust compiler tests and CI tests
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71725?usp=email ) Change subject: misc: Adjust compiler tests and CI tests .. misc: Adjust compiler tests and CI tests This adds a job level timeout for the compiler tests, allows them to run weekly instead of daily, and adds a workflow dispatch option. It also adds a ready for review option to the CI tests to run when someone converts a draft pull request. Change-Id: Id32b5f7da90745d18de2e550bd48d32ba45fb4d9 --- M .github/workflows/ci-tests.yaml M .github/workflows/compiler-tests.yaml 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index b1c5a1a..61ba4b5 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -4,7 +4,7 @@ on: pull_request: -types: [opened, edited, synchronize] +types: [opened, edited, synchronize, ready_for_review] jobs: diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index 013a710..ad8c8a5 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -5,9 +5,11 @@ on: - # Runs every day from 7AM UTC + # Runs every Friday from 7AM UTC schedule: -- cron: '0 7 * * *' +- cron: '00 7 * * 5' + # Allows us to manually start workflow for testing + workflow_dispatch: jobs: # replication of compiler-tests.sh @@ -17,6 +19,7 @@ image: [gcc-version-12, gcc-version-11, gcc-version-10, gcc-version-9, gcc-version-8, gcc-version-7, clang-version-14, clang-version-13, clang-version-12, clang-version-11, clang-version-10, clang-version-9, clang-version-8, clang-version-7, clang-version-6.0, ubuntu-18.04_all-dependencies, ubuntu-20.04_all-dependencies, ubuntu-22.04_all-dependencies, ubuntu-22.04_min-dependencies] opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] +timeout-minutes: 2880 # 48 hours container: gcr.io/gem5-test/${{ matrix.image }}:latest steps: - uses: actions/checkout@v3 @@ -36,6 +39,7 @@ image: [gcc-version-12, clang-version-14] opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] +timeout-minutes: 2880 # 48 hours container: gcr.io/gem5-test/${{ matrix.image }}:latest steps: - uses: actions/checkout@v3 -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71725?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: stable Gerrit-Change-Id: Id32b5f7da90745d18de2e550bd48d32ba45fb4d9 Gerrit-Change-Number: 71725 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[stable]: misc: Increase timeout for GitHub Actions
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71501?usp=email ) Change subject: misc: Increase timeout for GitHub Actions .. misc: Increase timeout for GitHub Actions This increases the timeout for our compiler tests, and for the very-long runs in our weekly tests. Change-Id: I027d2e98ce5596430ffcb20ef484e1cd7d4f644b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71501 Reviewed-by: Bobby Bruce Tested-by: kokoro Maintainer: Bobby Bruce --- M .github/workflows/compiler-tests.yaml M .github/workflows/weekly-tests.yaml 2 files changed, 6 insertions(+), 6 deletions(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index fe05748..8720e6d 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -26,7 +26,7 @@ ref: develop - name: Compile build/ALL/gem5${{ matrix.opts }} with ${{ matrix.image }} run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/ALL/gem5${{ matrix.opts }} - timeout-minutes: 300 # 6 hours + timeout-minutes: 600 # 10 hours # Tests the two latest gcc and clang supported compilers against all gem5 compilations. latest-compilers-all-gem5-builds: @@ -45,4 +45,4 @@ ref: develop - name: Compile build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} with ${{ matrix.image }} run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} - timeout-minutes: 300 # 6 hours + timeout-minutes: 600 # 10 hours diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index 48fb79f..64ab442 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -40,7 +40,7 @@ runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest needs: [build-gem5] -timeout-minutes: 1440 # 24 hours +timeout-minutes: 4320 # 3 days steps: - uses: actions/checkout@v3 with: @@ -76,7 +76,7 @@ runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest needs: [build-gem5] -timeout-minutes: 1440 # 24 hours +timeout-minutes: 4320 # 3 days steps: - uses: actions/checkout@v3 with: @@ -111,7 +111,7 @@ runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest needs: build-gem5 -timeout-minutes: 1440 # 24 hours +timeout-minutes: 4320 # 3 days steps: - uses: actions/checkout@v3 with: @@ -146,7 +146,7 @@ runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest needs: build-gem5 -timeout-minutes: 1440 # 24 hours +timeout-minutes: 4320 # 3 days steps: - uses: actions/checkout@v3 with: -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71501?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: stable Gerrit-Change-Id: I027d2e98ce5596430ffcb20ef484e1cd7d4f644b Gerrit-Change-Number: 71501 Gerrit-PatchSet: 3 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro Gerrit-CC: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[stable]: misc: Increase timeout for GitHub Actions
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71501?usp=email ) Change subject: misc: Increase timeout for GitHub Actions .. misc: Increase timeout for GitHub Actions This increases the timeout for our compiler tests, and for the very-long runs in our weekly tests. Change-Id: I027d2e98ce5596430ffcb20ef484e1cd7d4f644b --- M .github/workflows/compiler-tests.yaml M .github/workflows/weekly-tests.yaml 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index fe05748..8720e6d 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -26,7 +26,7 @@ ref: develop - name: Compile build/ALL/gem5${{ matrix.opts }} with ${{ matrix.image }} run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/ALL/gem5${{ matrix.opts }} - timeout-minutes: 300 # 6 hours + timeout-minutes: 600 # 10 hours # Tests the two latest gcc and clang supported compilers against all gem5 compilations. latest-compilers-all-gem5-builds: @@ -45,4 +45,4 @@ ref: develop - name: Compile build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} with ${{ matrix.image }} run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} - timeout-minutes: 300 # 6 hours + timeout-minutes: 600 # 10 hours diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index 48fb79f..64ab442 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -40,7 +40,7 @@ runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest needs: [build-gem5] -timeout-minutes: 1440 # 24 hours +timeout-minutes: 4320 # 3 days steps: - uses: actions/checkout@v3 with: @@ -76,7 +76,7 @@ runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest needs: [build-gem5] -timeout-minutes: 1440 # 24 hours +timeout-minutes: 4320 # 3 days steps: - uses: actions/checkout@v3 with: @@ -111,7 +111,7 @@ runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest needs: build-gem5 -timeout-minutes: 1440 # 24 hours +timeout-minutes: 4320 # 3 days steps: - uses: actions/checkout@v3 with: @@ -146,7 +146,7 @@ runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest needs: build-gem5 -timeout-minutes: 1440 # 24 hours +timeout-minutes: 4320 # 3 days steps: - uses: actions/checkout@v3 with: -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71501?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: stable Gerrit-Change-Id: I027d2e98ce5596430ffcb20ef484e1cd7d4f644b Gerrit-Change-Number: 71501 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[stable]: misc: Adjust timeout for compiler tests
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71458?usp=email ) Change subject: misc: Adjust timeout for compiler tests .. misc: Adjust timeout for compiler tests This updates the timeout for the compiler tests to run per step as opposed to by job, as well as increases this limit from 4 hours to 6 hours. Change-Id: I6b0fe5561f74e450cd79205a96084dd27ead Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71458 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M .github/workflows/compiler-tests.yaml 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index e7e9cd2..fe05748 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -18,7 +18,6 @@ opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/${{ matrix.image }}:latest -timeout-minutes: 240 # 4 hours steps: - uses: actions/checkout@v3 with: @@ -27,6 +26,7 @@ ref: develop - name: Compile build/ALL/gem5${{ matrix.opts }} with ${{ matrix.image }} run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/ALL/gem5${{ matrix.opts }} + timeout-minutes: 300 # 6 hours # Tests the two latest gcc and clang supported compilers against all gem5 compilations. latest-compilers-all-gem5-builds: @@ -37,7 +37,6 @@ opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/${{ matrix.image }}:latest -timeout-minutes: 240 # 4 hours steps: - uses: actions/checkout@v3 with: @@ -46,3 +45,4 @@ ref: develop - name: Compile build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} with ${{ matrix.image }} run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} + timeout-minutes: 300 # 6 hours -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71458?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: stable Gerrit-Change-Id: I6b0fe5561f74e450cd79205a96084dd27ead Gerrit-Change-Number: 71458 Gerrit-PatchSet: 2 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro Gerrit-CC: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[stable]: misc: Adjust timeout for compiler tests
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71458?usp=email ) Change subject: misc: Adjust timeout for compiler tests .. misc: Adjust timeout for compiler tests This updates the timeout for the compiler tests to run per step as opposed to by job, as well as increases this limit from 4 hours to 6 hours. Change-Id: I6b0fe5561f74e450cd79205a96084dd27ead --- M .github/workflows/compiler-tests.yaml 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index e7e9cd2..fe05748 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -18,7 +18,6 @@ opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/${{ matrix.image }}:latest -timeout-minutes: 240 # 4 hours steps: - uses: actions/checkout@v3 with: @@ -27,6 +26,7 @@ ref: develop - name: Compile build/ALL/gem5${{ matrix.opts }} with ${{ matrix.image }} run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/ALL/gem5${{ matrix.opts }} + timeout-minutes: 300 # 6 hours # Tests the two latest gcc and clang supported compilers against all gem5 compilations. latest-compilers-all-gem5-builds: @@ -37,7 +37,6 @@ opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/${{ matrix.image }}:latest -timeout-minutes: 240 # 4 hours steps: - uses: actions/checkout@v3 with: @@ -46,3 +45,4 @@ ref: develop - name: Compile build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} with ${{ matrix.image }} run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} + timeout-minutes: 300 # 6 hours -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71458?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: stable Gerrit-Change-Id: I6b0fe5561f74e450cd79205a96084dd27ead Gerrit-Change-Number: 71458 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [M] Change in gem5/gem5[stable]: misc: Add weekly tests to Github workflows
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71401?usp=email ) Change subject: misc: Add weekly tests to Github workflows .. misc: Add weekly tests to Github workflows This introduces the very-long tests from our weekly tests to be able to run within GitHub. Change-Id: I5f5b4c521b47272cb27640c572a869c26c04b95a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71401 Reviewed-by: Bobby Bruce Maintainer: Bobby Bruce Tested-by: kokoro --- A .github/workflows/weekly-tests.yaml 1 file changed, 178 insertions(+), 0 deletions(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml new file mode 100644 index 000..48fb79f --- /dev/null +++ b/.github/workflows/weekly-tests.yaml @@ -0,0 +1,178 @@ +# This workflow runs all of the very-long tests within main.py + +name: Running weekly main.py +run-name: ${{ github.actor }} is running the weekly tests + + +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, build] +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +outputs: + build-name: ${{ steps.artifact-name.outputs.name }} +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 + - id: artifact-name +run: echo "name=$(date +"%Y-%m-%d_%H.%M.%S")-ALL" >> $GITHUB_OUTPUT + - name: Build gem5 +run: | + scons build/ALL/gem5.opt -j $(nproc) + - uses: actions/upload-artifact@v3 +with: + name: ${{ steps.artifact-name.outputs.name }} + path: build/ALL/gem5.opt + retention-days: 5 + - run: echo "This job's status is ${{ job.status }}." + +# start running the very-long tests + testlib-very-long-gem5_library_example_tests: +runs-on: [self-hosted, linux, x64, run] +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +needs: [build-gem5] +timeout-minutes: 1440 # 24 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: ${{needs.build-gem5.outputs.build-name}} +path: build/ALL +- run: chmod u+x build/ALL/gem5.opt +- name: very-long gem5_library_example_tests + working-directory: ${{ github.workspace }}/tests + run: ./main.py run gem5/gem5_library_example_tests --length very-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 + if: success() || failure() + uses: actions/upload-artifact@v3 + env: +MY_STEP_VAR: ${{github.job}}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} + with: +name: ${{ env.MY_STEP_VAR }} +path: output.zip +retention-days: 7 +- run: echo "This job's status is ${{ job.status }}." + + + testlib-long-gem5-resources: +runs-on: [self-hosted, linux, x64, run] +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +needs: [build-gem5] +timeout-minutes: 1440 # 24 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: ${{needs.build-gem5.outputs.build-name}} +path: build/ALL +- run: chmod u+x build/ALL/gem5.opt +- name: very-long gem5-resources tests + working-directory: ${{ github.workspace }}/tests + run: ./main.py run gem5/gem5-resources --length very-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 + if: success() || failure() + uses: actions/upload-artifact@v3 + env: +MY_STEP_VAR: ${{github.job}}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} + with: +name: ${{ env.MY_STEP_VAR }} +path: output.zip +retention-days: 7 +- run: echo "This job's status is ${{ job.status }}." + + testlib
[gem5-dev] [S] Change in gem5/gem5[stable]: misc: Update GitHub yaml files
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71400?usp=email ) Change subject: misc: Update GitHub yaml files .. misc: Update GitHub yaml files This introduces a few fixes to the yaml files, such as fixing the failing SystemC tests by removing an extra Docker container, declaring the Python version for our compiler tests, fixing typos in the GPU daily tests, and adjusting the timeout values for our compiler tests and unittests. Change-Id: I3b4f2220750138783717b3678b0d8676155cb2a1 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71400 Reviewed-by: Bobby Bruce Maintainer: Bobby Bruce Tested-by: kokoro Maintainer: Matt Sinclair Reviewed-by: Matt Sinclair --- M .github/workflows/ci-tests.yaml M .github/workflows/compiler-tests.yaml M .github/workflows/daily-tests.yaml 3 files changed, 26 insertions(+), 23 deletions(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved Matt Sinclair: Looks good to me, but someone else must approve; Looks good to me, approved kokoro: Regressions pass diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 309fefc..16c096d 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -8,9 +8,18 @@ types: [opened, reopened, edited] jobs: + pre-commit: +# runs on github hosted runner +runs-on: ubuntu-22.04 +steps: +- uses: actions/checkout@v3 +- uses: actions/setup-python@v3 +- uses: pre-commit/action@v3.0.0 + build-gem5: runs-on: [self-hosted, linux, x64, build] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +needs: pre-commit # only runs if pre-commit passes outputs: artifactname: ${{ steps.name.outputs.test }} steps: @@ -29,8 +38,8 @@ unittests-all-opt: runs-on: [self-hosted, linux, x64, run] -container: - image: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +needs: pre-commit # only runs if pre-commit passes timeout-minutes: 60 steps: - uses: actions/checkout@v3 @@ -42,7 +51,7 @@ testlib-quick: runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -needs: build-gem5 +needs: [pre-commit, build-gem5] timeout-minutes: 360 # 6 hours steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index 300f9eb..e7e9cd2 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -18,7 +18,7 @@ opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/${{ matrix.image }}:latest -timeout-minutes: 2880 # 48 hours +timeout-minutes: 240 # 4 hours steps: - uses: actions/checkout@v3 with: @@ -26,7 +26,7 @@ # therefore need to explicitly checkout the develop branch. ref: develop - name: Compile build/ALL/gem5${{ matrix.opts }} with ${{ matrix.image }} - run: scons build/ALL/gem5${{ matrix.opts }} + run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/ALL/gem5${{ matrix.opts }} # Tests the two latest gcc and clang supported compilers against all gem5 compilations. latest-compilers-all-gem5-builds: @@ -37,7 +37,7 @@ opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/${{ matrix.image }}:latest -timeout-minutes: 2880 # 48 hours +timeout-minutes: 240 # 4 hours steps: - uses: actions/checkout@v3 with: @@ -45,4 +45,4 @@ # therefore need to explicitly checkout the develop branch. ref: develop - name: Compile build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} with ${{ matrix.image }} - run: scons build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} + run: /usr/bin/env python3 /usr/bin/scons --ignore-style build/${{ matrix.gem5-compilation }}/gem5${{ matrix.opts }} diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 91bb7d6..97b4164 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -223,7 +223,7 @@ unittests-all-debug: runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -timeout-minutes: 30 +timeout-minutes: 60 steps: - uses: actions/checkout@v3 @@ -240,7 +240,7 @@ unittests-all-fast: runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -timeout-minutes: 30 +timeout-minutes: 60 steps: - uses: actions/checkout@v3 @@ -837,22 +837,16 @@ # therefore ne
[gem5-dev] [S] Change in gem5/gem5[stable]: misc: Update GitHub yaml files
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71400?usp=email ) Change subject: misc: Update GitHub yaml files .. misc: Update GitHub yaml files This introduces a few fixes to the yaml files, such as fixing the failing SystemC tests by removing an extra Docker container, declaring the Python version for our compiler tests, fixing typos in the GPU daily tests, and adjusting the timeout values for our compiler tests and unittests. Change-Id: I3b4f2220750138783717b3678b0d8676155cb2a1 --- M .github/workflows/ci-tests.yaml M .github/workflows/compiler-tests.yaml M .github/workflows/daily-tests.yaml 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 309fefc..16c096d 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -8,9 +8,18 @@ types: [opened, reopened, edited] jobs: + pre-commit: +# runs on github hosted runner +runs-on: ubuntu-22.04 +steps: +- uses: actions/checkout@v3 +- uses: actions/setup-python@v3 +- uses: pre-commit/action@v3.0.0 + build-gem5: runs-on: [self-hosted, linux, x64, build] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +needs: pre-commit # only runs if pre-commit passes outputs: artifactname: ${{ steps.name.outputs.test }} steps: @@ -29,8 +38,8 @@ unittests-all-opt: runs-on: [self-hosted, linux, x64, run] -container: - image: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +needs: pre-commit # only runs if pre-commit passes timeout-minutes: 60 steps: - uses: actions/checkout@v3 @@ -42,7 +51,7 @@ testlib-quick: runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -needs: build-gem5 +needs: [pre-commit, build-gem5] timeout-minutes: 360 # 6 hours steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index 300f9eb..57401f4 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -18,7 +18,7 @@ opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/${{ matrix.image }}:latest -timeout-minutes: 2880 # 48 hours +timeout-minutes: 240 # 4 hours steps: - uses: actions/checkout@v3 with: @@ -37,7 +37,7 @@ opts: [.opt, .fast] runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/${{ matrix.image }}:latest -timeout-minutes: 2880 # 48 hours +timeout-minutes: 240 # 4 hours steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 91bb7d6..97b4164 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -223,7 +223,7 @@ unittests-all-debug: runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -timeout-minutes: 30 +timeout-minutes: 60 steps: - uses: actions/checkout@v3 @@ -240,7 +240,7 @@ unittests-all-fast: runs-on: [self-hosted, linux, x64, run] container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest -timeout-minutes: 30 +timeout-minutes: 60 steps: - uses: actions/checkout@v3 @@ -837,22 +837,16 @@ # therefore need to explicitly checkout the develop branch. ref: develop - name: Build ARM/gem5.opt - uses: docker://gcr.io/gem5-test/ubuntu-22.04_min-dependencies:latest - # This is a bit of a hack so we can run a different docker container. - with: -args: scons --ignore-style --duplicate-sources -j4 build/ARM/gem5.opt + run: scons build/ARM/gem5.opt --ignore-style --duplicate-sources -j$(nproc) - name: Build ARM/libgem5_opt.so - uses: docker://gcr.io/gem5-test/ubuntu-22.04_min-dependencies:latest - # This is a bit of a hack so we can run a different docker container. - with: -args: scons --with-cxx-config --without-python --without-tcmalloc USE_SYSTEMC=0 -j4 --duplicate-sources build/ARM/libgem5_opt.so + run: scons build/ARM/libgem5_opt.so --with-cxx-config --without-python --without-tcmalloc USE_SYSTEMC=0 -j$(nproc) --duplicate-sources - name: Compile gem5 withing SystemC working-directory: ${{ github.workspace }}/util/systemc/gem5_within_systemc run: make - name: Run gem5 within SystemC test run: ./build/ARM/gem5.opt configs/deprecated/example/se.py -c tests/test-progs/hello/bin/arm/linux/hello -- name: bla - run: LD_LIBRARY_PATH=build/ARM/:/op
[gem5-dev] [M] Change in gem5/gem5[stable]: misc: Add weekly tests to Github workflows
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71401?usp=email ) Change subject: misc: Add weekly tests to Github workflows .. misc: Add weekly tests to Github workflows This introduces the very-long tests from our weekly tests to be able to run within GitHub. Change-Id: I5f5b4c521b47272cb27640c572a869c26c04b95a --- A .github/workflows/weekly-tests.yaml 1 file changed, 178 insertions(+), 0 deletions(-) diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml new file mode 100644 index 000..48fb79f --- /dev/null +++ b/.github/workflows/weekly-tests.yaml @@ -0,0 +1,178 @@ +# This workflow runs all of the very-long tests within main.py + +name: Running weekly main.py +run-name: ${{ github.actor }} is running the weekly tests + + +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, build] +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +outputs: + build-name: ${{ steps.artifact-name.outputs.name }} +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 + - id: artifact-name +run: echo "name=$(date +"%Y-%m-%d_%H.%M.%S")-ALL" >> $GITHUB_OUTPUT + - name: Build gem5 +run: | + scons build/ALL/gem5.opt -j $(nproc) + - uses: actions/upload-artifact@v3 +with: + name: ${{ steps.artifact-name.outputs.name }} + path: build/ALL/gem5.opt + retention-days: 5 + - run: echo "This job's status is ${{ job.status }}." + +# start running the very-long tests + testlib-very-long-gem5_library_example_tests: +runs-on: [self-hosted, linux, x64, run] +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +needs: [build-gem5] +timeout-minutes: 1440 # 24 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: ${{needs.build-gem5.outputs.build-name}} +path: build/ALL +- run: chmod u+x build/ALL/gem5.opt +- name: very-long gem5_library_example_tests + working-directory: ${{ github.workspace }}/tests + run: ./main.py run gem5/gem5_library_example_tests --length very-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 + if: success() || failure() + uses: actions/upload-artifact@v3 + env: +MY_STEP_VAR: ${{github.job}}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} + with: +name: ${{ env.MY_STEP_VAR }} +path: output.zip +retention-days: 7 +- run: echo "This job's status is ${{ job.status }}." + + + testlib-long-gem5-resources: +runs-on: [self-hosted, linux, x64, run] +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +needs: [build-gem5] +timeout-minutes: 1440 # 24 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: ${{needs.build-gem5.outputs.build-name}} +path: build/ALL +- run: chmod u+x build/ALL/gem5.opt +- name: very-long gem5-resources tests + working-directory: ${{ github.workspace }}/tests + run: ./main.py run gem5/gem5-resources --length very-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 + if: success() || failure() + uses: actions/upload-artifact@v3 + env: +MY_STEP_VAR: ${{github.job}}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} + with: +name: ${{ env.MY_STEP_VAR }} +path: output.zip +retention-days: 7 +- run: echo "This job's status is ${{ job.status }}." + + testlib-very-long-parsec-benchmarks: +runs-on: [self-hosted, linux, x64, run] +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +needs: build-gem5 +timeout-minutes: 1440 # 24 hours +steps: +- uses: actions/ch
[gem5-dev] [XL] Change in gem5/gem5[stable]: misc: Adding GitHub workflow files
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71298?usp=email ) Change subject: misc: Adding GitHub workflow files .. misc: Adding GitHub workflow files This changes adds all of the workflows that will be run as we move to using GitHub. It includes our compiler tests, our nightly runs, and the continuous integration tests to be run on every pull request. Change-Id: I54c79aca7c0603337bd9fca443a0e2ffef603b0e --- A .github/workflows/ci-tests.yaml A .github/workflows/compiler-test.yaml A .github/workflows/daily.yaml 3 files changed, 1,017 insertions(+), 0 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml new file mode 100644 index 000..62a4730 --- /dev/null +++ b/.github/workflows/ci-tests.yaml @@ -0,0 +1,83 @@ +# This workflow runs after a pull-request has been approved by a reviewer. + +name: CI Tests +run-name: ${{ github.actor }} is running Pull Request pre-merge tests + +on: + pull_request: +types: [opened, reopened, edited] + +jobs: + build-gem5: +runs-on: [self-hosted, linux, x64, build] +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +outputs: + artifactname: ${{ steps.name.outputs.test }} +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 + - id: name +run: echo "test=$(date +"%Y-%m-%d_%H.%M.%S")-artifact" >> $GITHUB_OUTPUT + + - name: Build gem5 +run: | + scons build/ALL/gem5.opt -j $(nproc) + - uses: actions/upload-artifact@v3 +with: + name: ${{ steps.name.outputs.test }} + path: build/ALL/gem5.opt + - run: echo "This job's status is ${{ job.status }}." + + unittests-all-opt: +runs-on: [self-hosted, linux, x64, run] +container: + image: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +timeout-minutes: 60 +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: CI Unittests +working-directory: ${{ github.workspace }} +run: scons build/ALL/unittests.opt -j $(nproc) + - run: echo "This job's status is ${{ job.status }}." + + testlib-quick: +runs-on: [self-hosted, linux, x64, run] +container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest +needs: build-gem5 +timeout-minutes: 360 # 6 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: ${{needs.build-gem5.outputs.artifactname}} + path: build/ALL + - run: chmod u+x build/ALL/gem5.opt + - name: The TestLib CI Tests +working-directory: ${{ github.workspace }}/tests +run: ./main.py run --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 +if: success() || failure() +uses: actions/upload-artifact@v3 +env: + MY_STEP_VAR: ${{github.job}}_COMMIT.${{github.sha}}_RUN.${{github.run_id}}_ATTEMPT.${{github.run_attempt}} +with: + name: ${{ env.MY_STEP_VAR }} + path: output.zip + retention-days: 7 + - run: echo "This job's status is ${{ job.status }}." diff --git a/.github/workflows/compiler-test.yaml b/.github/workflows/compiler-test.yaml new file mode 100644 index 000..300f9eb --- /dev/null +++ b/.github/workflows/compiler-test.yaml @@ -0,0 +1,48 @@ +# This workflow runs all of the compiler tests + +name: Running main.py +run-name: ${{ github.actor }} is running compiler tests + + +on: + # Runs every day from 7AM UTC + schedule: +- cron: '0 7 * * *' + +jobs: + # replication of compiler-tests.sh + all-compilers: +strategy: + matrix: +image: [gcc-version-12, gcc-version-11, gcc-version-10, gcc-version-9, gcc-version-8, gcc-version-7, clang-version-14, clang-version-13, clang-version-12, clang-version-11, clang-version-10, clang-version-9, clang-version-8, clang-version-7, clang-version-6.0, ubuntu-18.04_all-dependencies, ubuntu-20.04_all-dependencies, ubuntu-22.04_all-dependencies, ubuntu-22.04_min-dependencies] +opts: [.opt, .fast] +runs-on: [self-hosted, linux, x64, run] +container: gcr.io/gem5-test/${{ matrix.image }}:latest +timeout-minutes: 2880 #
[gem5-dev] [M] Change in gem5/gem5[develop]: util: Add vagrant folder for GitHub runner configuration
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/71098?usp=email ) Change subject: util: Add vagrant folder for GitHub runner configuration .. util: Add vagrant folder for GitHub runner configuration This adds files that can be used to configure Vagrant machines that will be used to test running gem5 alongside Github Actions. Change-Id: I52b0f39b6e6044c22481f02163d5fc01eab76788 --- A util/vagrant/README.md A util/vagrant/Vagrantfile A util/vagrant/provision_nonroot.sh A util/vagrant/provision_root.sh 4 files changed, 218 insertions(+), 0 deletions(-) diff --git a/util/vagrant/README.md b/util/vagrant/README.md new file mode 100644 index 000..8a7cdd5 --- /dev/null +++ b/util/vagrant/README.md @@ -0,0 +1,29 @@ +# How to set up Vagrant VM for Github Actions + +First, generate a Personal Access Token, which you can create [here](https://github.com/settings/tokens) +Make sure to set admin permissions on this token, then paste it onto line 35 of the Vagrantfile. + +After this, install the relevant vagrant plugins: + +``` bash +vagrant plugin install dotenv +vagrant plugin install vagrant-libvirt +``` + +Lastly, make sure that the configuration for the Vagrantfile is set properly. +For a "runner" machine, we set the number of cpus to 1, the memory to 8GB, and the tag in the echo command to be run. +For a "builder" machine, we set the number of cpus to 4, the memory to 16GB, and the tag in the echo command to be build. +You can expect each machine to take up approximatley 60GB of disk space. + +Once everything is set properly, you can start up the vagrant machine with the command + +``` bash +export VAGRANT_HOME=/scr/vagrant +vagrant up --provider=libvirt +``` + +This should automatically create your machine, as well as configure and start up a Github Actions runner. You can check the status of the runner here: https://github.com///settings/actions/runners + +If the runner ever shows as offline, you can rerun the `vagrant up --provider=libvirt` command to make sure everything is working properly. + +This setup follow steps from [here](https://github.com/peaceiris/actions-self-hosted-runners) diff --git a/util/vagrant/Vagrantfile b/util/vagrant/Vagrantfile new file mode 100644 index 000..45056b6 --- /dev/null +++ b/util/vagrant/Vagrantfile @@ -0,0 +1,49 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.box = "generic/ubuntu2204" + config.vm.box_check_update = true + config.vm.define "githubrunnermachine" + config.vm.hostname = "githubrunnerhost" + # allows us to ssh into the machine, addressing the problem below + # https://www.reddit.com/r/vagrant/comments/sb7hfl/new_to_vagrant_getting_efault_warning/ + config.ssh.username = "vagrant" + config.ssh.password = "vagrant" + + config.vm.provider "libvirt" do |vb| +# Customize the amount of cpus and memory on the VM: +vb.cpus = "1".to_i +vb.memory = "8192".to_i + end + + # sets up vm + config.vm.provision :root_user, type: "shell", path: "provision_root.sh" + config.vm.provision :vagrant_user, type: "shell", privileged: false, path: "provision_nonroot.sh" + + config.vm.provision :vagrant_user_runner, type: "shell", privileged: false, inline: <<-SHELL +# Install actions/runner +mkdir ~/actions-runner && cd ~/actions-runner +curl -so actions-runner-linux-x64-2.304.0.tar.gz -L \ + https://github.com/actions/runner/releases/download/v2.304.0/actions-runner-linux-x64-2.304.0.tar.gz +tar xzf ./actions-runner-linux-x64-2.304.0.tar.gz + +# configure the runner +# echo automatically sets the name of the runner, and the tags +# create a personal access token with admin permission and copy it into the curl command +# TODO: currently automatically references mkjost0 repository +echo -ne '\n\nrun\n\n' | ./config.sh --url https://github.com/mkjost0/gem5-actions --token $(curl -L \ +-X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer " \ +-H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/mkjost0/gem5-actions/actions/runners/registration-token | jq -r '.token') +# start the runner +nohup ./run.sh & + SHELL + + # always runs, so we can start up the runner again on vagrant up if it dies at any point + # TODO: needs to be commented out on first vagrant up or else this runs before previous shell script + config.vm.provision :vagrant_user_runner, type: "shell", privileged: false, run: 'always', inline: <<-SHELL +cd actions-runner +nohup ./run.sh & + SHELL +end diff --git a/util/vagrant/provision_nonroot.sh b/util/vagrant/provision_nonroot.sh new file mode 100644 index 000..4465b5a --- /dev/null +++ b/util/vagrant/provision_nonroot.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# fail on
[gem5-dev] [XS] Change in gem5/gem5[develop]: base: Output link to common errors page
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/70978?usp=email ) Change subject: base: Output link to common errors page .. base: Output link to common errors page This change adds a link to the common errors page that outputs whenever a fatal signal is raised, showing when the program aborts or segfaults. Change-Id: I88420a594423570af670b460cfce7c03c4208120 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70978 Reviewed-by: Jason Lowe-Power Maintainer: Daniel Carvalho Tested-by: kokoro Reviewed-by: Daniel Carvalho --- M src/sim/init_signals.cc 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Daniel Carvalho: Looks good to me, but someone else must approve; Looks good to me, approved kokoro: Regressions pass Jason Lowe-Power: Looks good to me, approved diff --git a/src/sim/init_signals.cc b/src/sim/init_signals.cc index b6db621..b9aa6f6 100644 --- a/src/sim/init_signals.cc +++ b/src/sim/init_signals.cc @@ -103,6 +103,8 @@ // The signal handler should have been reset and unmasked (it was // registered with SA_RESETHAND | SA_NODEFER), just raise the // signal again to invoke the default handler. +STATIC_ERR("For more info on how to address this issue, please visit " +"https://www.gem5.org/documentation/general_docs/common-errors/ \n\n"); pthread_kill(pthread_self(), signo); // Something is really wrong if the process is alive at this -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/70978?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I88420a594423570af670b460cfce7c03c4208120 Gerrit-Change-Number: 70978 Gerrit-PatchSet: 2 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Daniel Carvalho Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: base: Output link to common errors page
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/70978?usp=email ) Change subject: base: Output link to common errors page .. base: Output link to common errors page This change adds a link to the common errors page that outputs whenever a fatal signal is raised, showing when the program aborts or segfaults. Change-Id: I88420a594423570af670b460cfce7c03c4208120 --- M src/sim/init_signals.cc 1 file changed, 2 insertions(+), 0 deletions(-) diff --git a/src/sim/init_signals.cc b/src/sim/init_signals.cc index b6db621..b9aa6f6 100644 --- a/src/sim/init_signals.cc +++ b/src/sim/init_signals.cc @@ -103,6 +103,8 @@ // The signal handler should have been reset and unmasked (it was // registered with SA_RESETHAND | SA_NODEFER), just raise the // signal again to invoke the default handler. +STATIC_ERR("For more info on how to address this issue, please visit " +"https://www.gem5.org/documentation/general_docs/common-errors/ \n\n"); pthread_kill(pthread_self(), signo); // Something is really wrong if the process is alive at this -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/70978?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I88420a594423570af670b460cfce7c03c4208120 Gerrit-Change-Number: 70978 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: dev-amdgpu: Remove unused psp_ring_retval integer
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/70217?usp=email ) Change subject: dev-amdgpu: Remove unused psp_ring_retval integer .. dev-amdgpu: Remove unused psp_ring_retval integer This change addresses the compiler failures that have been causing any GCN3_X86 build to fail. https://jenkins.gem5.org/job/compiler-checks/589/ Change-Id: Ifd8e2ef89549752ca4aedf0bc9fa47e831a822d3 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70217 Reviewed-by: Matthew Poremba Reviewed-by: Matt Sinclair Maintainer: Matthew Poremba Tested-by: kokoro --- M src/dev/amdgpu/amdgpu_nbio.hh 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Matt Sinclair: Looks good to me, approved Matthew Poremba: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/amdgpu/amdgpu_nbio.hh b/src/dev/amdgpu/amdgpu_nbio.hh index 68d174e..d1e5391 100644 --- a/src/dev/amdgpu/amdgpu_nbio.hh +++ b/src/dev/amdgpu/amdgpu_nbio.hh @@ -109,7 +109,6 @@ Addr psp_ring_dev_addr = 0; Addr psp_ring_listen_addr = 0; int psp_ring_size = 0; -int psp_ring_retval = 0; int psp_ring_value = 0; }; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/70217?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ifd8e2ef89549752ca4aedf0bc9fa47e831a822d3 Gerrit-Change-Number: 70217 Gerrit-PatchSet: 2 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Matt Sinclair Gerrit-Reviewer: Matthew Poremba Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: dev-amdgpu: Remove unused psp_ring_retval integer
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/70217?usp=email ) Change subject: dev-amdgpu: Remove unused psp_ring_retval integer .. dev-amdgpu: Remove unused psp_ring_retval integer This change addresses the compiler failures that have been causing any GCN3_X86 build to fail. https://jenkins.gem5.org/job/compiler-checks/589/ Change-Id: Ifd8e2ef89549752ca4aedf0bc9fa47e831a822d3 --- M src/dev/amdgpu/amdgpu_nbio.hh 1 file changed, 0 insertions(+), 1 deletion(-) diff --git a/src/dev/amdgpu/amdgpu_nbio.hh b/src/dev/amdgpu/amdgpu_nbio.hh index 68d174e..d1e5391 100644 --- a/src/dev/amdgpu/amdgpu_nbio.hh +++ b/src/dev/amdgpu/amdgpu_nbio.hh @@ -109,7 +109,6 @@ Addr psp_ring_dev_addr = 0; Addr psp_ring_listen_addr = 0; int psp_ring_size = 0; -int psp_ring_retval = 0; int psp_ring_value = 0; }; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/70217?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ifd8e2ef89549752ca4aedf0bc9fa47e831a822d3 Gerrit-Change-Number: 70217 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: base: Update include
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/69778?usp=email ) Change subject: base: Update include .. base: Update include This change addresses an error in the compiler tests: https://jenkins.gem5.org/job/compiler-checks/573/ For clang versions 6 through 10, as well as GCC 7, in order to use the "filesystem" module, you must include the experimental namespace. In all newer versions, you can use the "filesystem" module as is. Because of this, include guards to handle this. They include "" for the older clang versions and the "" for all other versions. As opposed to checking by version, we now check if the filesystem library has been defined before using it. Change-Id: I8fb8d4eaa33f3edc29b7626f44b82ee66ffe72be Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69778 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Bobby Bruce --- M src/base/socket.cc M src/mem/shared_memory_server.cc 2 files changed, 17 insertions(+), 10 deletions(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/base/socket.cc b/src/base/socket.cc index 62f2071..06fc286 100644 --- a/src/base/socket.cc +++ b/src/base/socket.cc @@ -40,13 +40,16 @@ #include -#if (defined(__GNUC__) && (__GNUC__ >= 8)) || defined(__clang__) +// check if filesystem library is available +#if defined(__cpp_lib_filesystem) || __has_include() #include #else -// This is only reachable if we're using GCC 7 (note: gem5 does not support -// GCC versions older than GCC 7 as they do not support the C++17 -// standard). -// If we're using GCC 7, we need to use . +// This is only reachable if we're using GCC 7 or clang versions 6 +// through 10 (note: gem5 does not support GCC versions older than +// GCC 7 or clang versions older than clang 6.0 as they do not +// support the C++17 standard). +// If we're using GCC 7 or clang versions 6 through 10, we need to use +// . #include namespace std { namespace filesystem = experimental::filesystem; diff --git a/src/mem/shared_memory_server.cc b/src/mem/shared_memory_server.cc index f99655c..a4305d0 100644 --- a/src/mem/shared_memory_server.cc +++ b/src/mem/shared_memory_server.cc @@ -39,13 +39,17 @@ #include #include #include -#if (defined(__GNUC__) && (__GNUC__ >= 8)) || defined(__clang__) + +// check if filesystem library is available +#if defined(__cpp_lib_filesystem) || __has_include() #include #else -// This is only reachable if we're using GCC 7 (note: gem5 does not support -// GCC versions older than GCC 7 as they do not support the C++17 -// standard). -// If we're using GCC 7, we need to use . +// This is only reachable if we're using GCC 7 or clang versions 6 +// through 10 (note: gem5 does not support GCC versions older than +// GCC 7 or clang versions older than clang 6.0 as they do not +// support the C++17 standard). +// If we're using GCC 7 or clang versions 6 through 10, we need to use +// . #include namespace std { namespace filesystem = experimental::filesystem; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69778?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I8fb8d4eaa33f3edc29b7626f44b82ee66ffe72be Gerrit-Change-Number: 69778 Gerrit-PatchSet: 4 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Daniel Carvalho Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: scons: Add stdc++fs and libc++experimental for clang LIBS env
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/69777?usp=email ) Change subject: scons: Add stdc++fs and libc++experimental for clang LIBS env .. scons: Add stdc++fs and libc++experimental for clang LIBS env This change fixes a failure in the compiler tests: https://jenkins.gem5.org/job/compiler-checks/573/ These tests were failing due to the use of `std::filesystem`, which requires 'stdc++fs' to be linked for clang versions 6 through 10. Change-Id: I4fa03923e8dc616046dead939c77d49b301de36b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69777 Reviewed-by: Bobby Bruce Maintainer: Bobby Bruce Tested-by: kokoro --- M SConstruct 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/SConstruct b/SConstruct index 7e8f177..b784a04 100755 --- a/SConstruct +++ b/SConstruct @@ -512,6 +512,18 @@ env.Append(TCMALLOC_CCFLAGS=['-fno-builtin']) +if compareVersions(env['CXXVERSION'], "11") < 0: +# `libstdc++fs`` must be explicitly linked for `std::filesystem`` +# in clang versions 6 through 10. +# +# In addition, for these versions, the +# `std::filesystem` is under the `experimental` +# namespace(`std::experimental::filesystem`). +# +# Note: gem5 does not support clang versions < 6. +env.Append(LIBS=['stdc++fs']) + + # On Mac OS X/Darwin we need to also use libc++ (part of XCode) as # opposed to libstdc++, as the later is dated. if sys.platform == "darwin": -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69777?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I4fa03923e8dc616046dead939c77d49b301de36b Gerrit-Change-Number: 69777 Gerrit-PatchSet: 3 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: base: Use include for GCC v7
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/69840?usp=email ) Change subject: base: Use include for GCC v7 .. base: Use include for GCC v7 This change adds include guards to the inclusion of the filesystem module to ensure GCC 7 can work properly, addressing an issue in the compiler tests. Change-Id: I642f79bd801baf4766572368b9339e34be46d1c3 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69840 Maintainer: Jason Lowe-Power Reviewed-by: Richard Cooper Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/mem/shared_memory_server.cc 1 file changed, 12 insertions(+), 1 deletion(-) Approvals: kokoro: Regressions pass Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved Richard Cooper: Looks good to me, approved diff --git a/src/mem/shared_memory_server.cc b/src/mem/shared_memory_server.cc index 3e49164..f99655c 100644 --- a/src/mem/shared_memory_server.cc +++ b/src/mem/shared_memory_server.cc @@ -39,7 +39,18 @@ #include #include #include -#include +#if (defined(__GNUC__) && (__GNUC__ >= 8)) || defined(__clang__) +#include +#else +// This is only reachable if we're using GCC 7 (note: gem5 does not support +// GCC versions older than GCC 7 as they do not support the C++17 +// standard). +// If we're using GCC 7, we need to use . +#include +namespace std { +namespace filesystem = experimental::filesystem; +} +#endif #include "base/logging.hh" #include "base/output.hh" -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69840?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I642f79bd801baf4766572368b9339e34be46d1c3 Gerrit-Change-Number: 69840 Gerrit-PatchSet: 2 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Daniel Carvalho Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: Richard Cooper Gerrit-Reviewer: kokoro Gerrit-CC: Giacomo Travaglini ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: base: Use include for GCC v7
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/69840?usp=email ) Change subject: base: Use include for GCC v7 .. base: Use include for GCC v7 This change adds include guards to the inclusion of the filesystem module to ensure GCC 7 can work properly, addressing an issue in the compiler tests. Change-Id: I642f79bd801baf4766572368b9339e34be46d1c3 --- M src/mem/shared_memory_server.cc 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mem/shared_memory_server.cc b/src/mem/shared_memory_server.cc index 3e49164..f99655c 100644 --- a/src/mem/shared_memory_server.cc +++ b/src/mem/shared_memory_server.cc @@ -39,7 +39,18 @@ #include #include #include -#include +#if (defined(__GNUC__) && (__GNUC__ >= 8)) || defined(__clang__) +#include +#else +// This is only reachable if we're using GCC 7 (note: gem5 does not support +// GCC versions older than GCC 7 as they do not support the C++17 +// standard). +// If we're using GCC 7, we need to use . +#include +namespace std { +namespace filesystem = experimental::filesystem; +} +#endif #include "base/logging.hh" #include "base/output.hh" -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69840?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I642f79bd801baf4766572368b9339e34be46d1c3 Gerrit-Change-Number: 69840 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: base: Use include for clang 6-9
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/69778?usp=email ) Change subject: base: Use include for clang 6-9 .. base: Use include for clang 6-9 This change addresses an error in the compiler tests: https://jenkins.gem5.org/job/compiler-checks/573/ For clang versions 6 through 9, in order to use the "filesystem" module, you must include the experimental namespace. In all newer versions, you can use the "filesystem" module as is. Because of this, include guards to handle this. They include "" for the older clang versions and the "" for all other versions. Change-Id: I8fb8d4eaa33f3edc29b7626f44b82ee66ffe72be --- M src/base/socket.cc M src/mem/shared_memory_server.cc 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/base/socket.cc b/src/base/socket.cc index 62f2071..8243bc0 100644 --- a/src/base/socket.cc +++ b/src/base/socket.cc @@ -40,13 +40,16 @@ #include -#if (defined(__GNUC__) && (__GNUC__ >= 8)) || defined(__clang__) +#if (defined(__GNUC__) && (__GNUC__ >= 8)) || \ +(defined(__clang__) && (__GNUC__ >= 9)) #include #else -// This is only reachable if we're using GCC 7 (note: gem5 does not support -// GCC versions older than GCC 7 as they do not support the C++17 -// standard). -// If we're using GCC 7, we need to use . +// This is only reachable if we're using GCC 7 or clang versions 6 +// through 9 (note: gem5 does not support GCC versions older than +// GCC 7 or clang versions older than clang 6.0 as they do not +// support the C++17 standard). +// If we're using GCC 7 or clang versions 6 through 9, we need to use +// . #include namespace std { namespace filesystem = experimental::filesystem; diff --git a/src/mem/shared_memory_server.cc b/src/mem/shared_memory_server.cc index 3e49164..8f66217 100644 --- a/src/mem/shared_memory_server.cc +++ b/src/mem/shared_memory_server.cc @@ -39,7 +39,21 @@ #include #include #include -#include +#if (defined(__GNUC__) && (__GNUC__ >= 8)) || \ +(defined(__clang__) && (__GNUC__ >= 9)) +#include +#else +// This is only reachable if we're using GCC 7 or clang versions 6 +// through 9 (note: gem5 does not support GCC versions older than +// GCC 7 or clang versions older than clang 6.0 as they do not +// support the C++17 standard). +// If we're using GCC 7 or clang versions 6 through 9, we need to use +// . +#include +namespace std { +namespace filesystem = experimental::filesystem; +} +#endif #include "base/logging.hh" #include "base/output.hh" -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69778?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I8fb8d4eaa33f3edc29b7626f44b82ee66ffe72be Gerrit-Change-Number: 69778 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: scons: Add stdc++fs and libc++experimental for clang LIBS env
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/69777?usp=email ) Change subject: scons: Add stdc++fs and libc++experimental for clang LIBS env .. scons: Add stdc++fs and libc++experimental for clang LIBS env This change fixes a failure in the compiler tests: https://jenkins.gem5.org/job/compiler-checks/573/ These tests were failing due to the use of `std::filesystem`, which requires 'libc++experimental' to be linked for versions of clang 6 and older, and 'stdc++fs' to be linked for clang versions 7 through 9. Change-Id: I4fa03923e8dc616046dead939c77d49b301de36b --- M SConstruct 1 file changed, 17 insertions(+), 0 deletions(-) diff --git a/SConstruct b/SConstruct index e91e700..55d36ec 100755 --- a/SConstruct +++ b/SConstruct @@ -511,6 +511,23 @@ env.Append(TCMALLOC_CCFLAGS=['-fno-builtin']) +if compareVersions(env['CXXVERSION'], "10") < 0: +# `libstdc++fs`` must be explicitly linked for `std::filesystem`` +# in clang versions 7 through 9. For clang version 6, +# `libc++experimental`` must be explicitly linked instead. +# As of clang version 10, this is not required. +# +# In addition, for clang versions 6 through 9, the +# `std::filesystem` is under the `experimental` +# namespace(`std::experimental::filesystem`). +# +# Note: gem5 does not support clang versions < 6. +if compareVersions(env['CXXVERSION'], "6") < 0: +env.Append(LIBS=['libc++experimental']) +else: +env.Append(LIBS=['stdc++fs']) + + # On Mac OS X/Darwin we need to also use libc++ (part of XCode) as # opposed to libstdc++, as the later is dated. if sys.platform == "darwin": -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69777?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I4fa03923e8dc616046dead939c77d49b301de36b Gerrit-Change-Number: 69777 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: configs: Fix RISCVMatched Test
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/69458?usp=email ) Change subject: configs: Fix RISCVMatched Test .. configs: Fix RISCVMatched Test Updated the import of the RISCVMatchedBoard so there would be no more errors calling it. Change-Id: I2dda4783edaa18851269860757d5b8ee58625838 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69458 Tested-by: kokoro Maintainer: Bobby Bruce Reviewed-by: Jason Lowe-Power --- M configs/example/gem5_library/riscvmatched-hello.py 1 file changed, 1 insertion(+), 3 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/configs/example/gem5_library/riscvmatched-hello.py b/configs/example/gem5_library/riscvmatched-hello.py index d8ae8e5..e7b4cf7 100644 --- a/configs/example/gem5_library/riscvmatched-hello.py +++ b/configs/example/gem5_library/riscvmatched-hello.py @@ -39,9 +39,7 @@ from gem5.resources.resource import Resource from gem5.simulate.simulator import Simulator -from python.gem5.prebuilt.riscvmatched.riscvmatched_board import ( -RISCVMatchedBoard, -) +from gem5.prebuilt.riscvmatched.riscvmatched_board import RISCVMatchedBoard from gem5.isas import ISA from gem5.utils.requires import requires -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69458?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I2dda4783edaa18851269860757d5b8ee58625838 Gerrit-Change-Number: 69458 Gerrit-PatchSet: 2 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: configs: Fix RISCVMatched Test
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/69458?usp=email ) Change subject: configs: Fix RISCVMatched Test .. configs: Fix RISCVMatched Test Updated the import of the RISCVMatchedBoard so there would be no more errors calling it. Change-Id: I2dda4783edaa18851269860757d5b8ee58625838 --- M configs/example/gem5_library/riscvmatched-hello.py 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configs/example/gem5_library/riscvmatched-hello.py b/configs/example/gem5_library/riscvmatched-hello.py index d8ae8e5..e7b4cf7 100644 --- a/configs/example/gem5_library/riscvmatched-hello.py +++ b/configs/example/gem5_library/riscvmatched-hello.py @@ -39,9 +39,7 @@ from gem5.resources.resource import Resource from gem5.simulate.simulator import Simulator -from python.gem5.prebuilt.riscvmatched.riscvmatched_board import ( -RISCVMatchedBoard, -) +from gem5.prebuilt.riscvmatched.riscvmatched_board import RISCVMatchedBoard from gem5.isas import ISA from gem5.utils.requires import requires -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69458?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I2dda4783edaa18851269860757d5b8ee58625838 Gerrit-Change-Number: 69458 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: tess: Update SystemC Nightly Test
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/69457?usp=email ) Change subject: tess: Update SystemC Nightly Test .. tess: Update SystemC Nightly Test This removes the usage of the deprecated se.py test, and replaces it with arm-hello.py Change-Id: Icefbf3d0395ea10fa35be60cc255d0165ee4dad2 --- M tests/nightly.sh 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nightly.sh b/tests/nightly.sh index 1360c44..15cc04b 100755 --- a/tests/nightly.sh +++ b/tests/nightly.sh @@ -183,8 +183,8 @@ gcr.io/gem5-test/systemc-env:${tag} bash -c "\ cd util/systemc/gem5_within_systemc; \ make -j${compile_threads}; \ -../../../build/ARM/gem5.opt ../../../configs/example/se.py -c \ -../../../tests/test-progs/hello/bin/arm/linux/hello; \ +../../../build/ARM/gem5.opt \ +../../../configs/example/gem5_library/arm-hello.py && \ LD_LIBRARY_PATH=../../../build/ARM/:/opt/systemc/lib-linux64/ \ ./gem5.opt.sc m5out/config.ini; \ cd -; \ -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69457?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Icefbf3d0395ea10fa35be60cc255d0165ee4dad2 Gerrit-Change-Number: 69457 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: tests: Fix failing SST and SystemC nightly tests
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/67817?usp=email ) Change subject: tests: Fix failing SST and SystemC nightly tests .. tests: Fix failing SST and SystemC nightly tests There was a bug with the SST and SystemC tests where they wouldn't compile due to a missing path for the gdbremote/signals.hh header, and this change includes that so they run properly. Change-Id: I9ff0404e327358fe2d1b77388bbcc1f807136ebe Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67817 Reviewed-by: Bobby Bruce Maintainer: Bobby Bruce Tested-by: kokoro --- M ext/sst/Makefile M util/systemc/gem5_within_systemc/Makefile 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/ext/sst/Makefile b/ext/sst/Makefile index 682af3d..9213d26 100644 --- a/ext/sst/Makefile +++ b/ext/sst/Makefile @@ -4,7 +4,7 @@ OFLAG=3 LDFLAGS=-shared -fno-common ${shell pkg-config ${SST_VERSION} --libs} -L../../build/${ARCH}/ -Wl,-rpath ../../build/${ARCH} -CXXFLAGS=-std=c++17 -g -O${OFLAG} -fPIC ${shell pkg-config ${SST_VERSION} --cflags} ${shell python3-config --includes} -I../../build/${ARCH}/ -I../../ext/pybind11/include/ -I../../build/softfloat/ +CXXFLAGS=-std=c++17 -g -O${OFLAG} -fPIC ${shell pkg-config ${SST_VERSION} --cflags} ${shell python3-config --includes} -I../../build/${ARCH}/ -I../../ext/pybind11/include/ -I../../build/softfloat/ -I../../ext CPPFLAGS+=-MMD -MP SRC=$(wildcard *.cc) diff --git a/util/systemc/gem5_within_systemc/Makefile b/util/systemc/gem5_within_systemc/Makefile index cc6a389..f2baf88 100644 --- a/util/systemc/gem5_within_systemc/Makefile +++ b/util/systemc/gem5_within_systemc/Makefile @@ -39,7 +39,7 @@ SYSTEMC_INC = /opt/systemc/include SYSTEMC_LIB = /opt/systemc/lib-linux64 -CXXFLAGS = -I../../../build/$(ARCH) -L../../../build/$(ARCH) +CXXFLAGS = -I../../../build/$(ARCH) -L../../../build/$(ARCH) -I../../../ext/ CXXFLAGS += -I$(SYSTEMC_INC) -L$(SYSTEMC_LIB) CXXFLAGS += -std=c++17 CXXFLAGS += -g -DTRACING_ON -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/67817?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I9ff0404e327358fe2d1b77388bbcc1f807136ebe Gerrit-Change-Number: 67817 Gerrit-PatchSet: 4 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Hoa Nguyen Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro Gerrit-CC: gem5 Bot Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: tests: Update nightly SystemC test
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/69337?usp=email ) Change subject: tests: Update nightly SystemC test .. tests: Update nightly SystemC test The SystemC test requires gem5 to be built with the minimum dependencies image, and it was also updated to properly use se.py since it has now been deprecated. Change-Id: I1223afd70f105073d2cd4a2a78135f1f935c06ec Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69337 Reviewed-by: Bobby Bruce Maintainer: Bobby Bruce Tested-by: kokoro --- M tests/nightly.sh 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/tests/nightly.sh b/tests/nightly.sh index aa69c44..f5f9295 100755 --- a/tests/nightly.sh +++ b/tests/nightly.sh @@ -172,7 +172,7 @@ rm -rf "${gem5_root}/build/ARM" docker run -u $UID:$GID --volume "${gem5_root}":"${gem5_root}" -w \ "${gem5_root}" --memory="${docker_mem_limit}" --rm \ -gcr.io/gem5-test/ubuntu-22.04_all-dependencies:${tag} bash -c "\ +gcr.io/gem5-test/ubuntu-22.04_min-dependencies:${tag} bash -c "\ scons -j${compile_threads} --ignore-style build/ARM/gem5.opt && \ scons --with-cxx-config --without-python --without-tcmalloc USE_SYSTEMC=0 \ -j${compile_threads} build/ARM/libgem5_opt.so \ @@ -183,7 +183,7 @@ gcr.io/gem5-test/systemc-env:${tag} bash -c "\ cd util/systemc/gem5_within_systemc && \ make -j${compile_threads} && \ -../../../build/ARM/gem5.opt ../../../configs/example/se.py -c \ +../../../build/ARM/gem5.opt ../../../configs/deprecated/example/se.py -c \ ../../../tests/test-progs/hello/bin/arm/linux/hello && \ LD_LIBRARY_PATH=../../../build/ARM/:/opt/systemc/lib-linux64/ \ ./gem5.opt.sc m5out/config.ini && \ -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69337?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I1223afd70f105073d2cd4a2a78135f1f935c06ec Gerrit-Change-Number: 69337 Gerrit-PatchSet: 2 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: tests: Fix the nightly SST and SystemC tests
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/68677?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: tests: Fix the nightly SST and SystemC tests .. tests: Fix the nightly SST and SystemC tests These tests were only returning the exit-code of the last command in the bash script, which would silence failures in commands prior to that. This patch fixes this. Now these tests will return a non-zero exit code for any failure when executing these bash scripts. Change-Id: I2195bbd0357f0b38c192ab5f9e8ad68101786247 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68677 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M tests/nightly.sh 1 file changed, 9 insertions(+), 9 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/tests/nightly.sh b/tests/nightly.sh index 1360c44..aa69c44 100755 --- a/tests/nightly.sh +++ b/tests/nightly.sh @@ -159,10 +159,10 @@ "${gem5_root}" --rm --memory="${docker_mem_limit}" \ gcr.io/gem5-test/sst-env:${tag} bash -c "\ scons build/${isa}/libgem5_${variant}.so -j${compile_threads} \ ---without-tcmalloc --ignore-style; \ -cd ext/sst; \ -make clean; make -j ${compile_threads}; \ -sst --add-lib-path=./ sst/example.py; \ +--without-tcmalloc --ignore-style && \ +cd ext/sst && \ +make clean; make -j ${compile_threads} && \ +sst --add-lib-path=./ sst/example.py && \ cd -; " } @@ -173,7 +173,7 @@ docker run -u $UID:$GID --volume "${gem5_root}":"${gem5_root}" -w \ "${gem5_root}" --memory="${docker_mem_limit}" --rm \ gcr.io/gem5-test/ubuntu-22.04_all-dependencies:${tag} bash -c "\ -scons -j${compile_threads} --ignore-style build/ARM/gem5.opt; \ +scons -j${compile_threads} --ignore-style build/ARM/gem5.opt && \ scons --with-cxx-config --without-python --without-tcmalloc USE_SYSTEMC=0 \ -j${compile_threads} build/ARM/libgem5_opt.so \ " @@ -181,12 +181,12 @@ docker run -u $UID:$GID --volume "${gem5_root}":"${gem5_root}" -w \ "${gem5_root}" --memory="${docker_mem_limit}" --rm \ gcr.io/gem5-test/systemc-env:${tag} bash -c "\ -cd util/systemc/gem5_within_systemc; \ -make -j${compile_threads}; \ +cd util/systemc/gem5_within_systemc && \ +make -j${compile_threads} && \ ../../../build/ARM/gem5.opt ../../../configs/example/se.py -c \ -../../../tests/test-progs/hello/bin/arm/linux/hello; \ +../../../tests/test-progs/hello/bin/arm/linux/hello && \ LD_LIBRARY_PATH=../../../build/ARM/:/opt/systemc/lib-linux64/ \ -./gem5.opt.sc m5out/config.ini; \ +./gem5.opt.sc m5out/config.ini && \ cd -; \ " } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/68677?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I2195bbd0357f0b38c192ab5f9e8ad68101786247 Gerrit-Change-Number: 68677 Gerrit-PatchSet: 3 Gerrit-Owner: Bobby Bruce Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: tests: Update nightly SystemC test
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/69337?usp=email ) Change subject: tests: Update nightly SystemC test .. tests: Update nightly SystemC test The SystemC test requires gem5 to be built with the minimum dependencies image, and it was also updated to properly use se.py since it has now been deprecated. Change-Id: I1223afd70f105073d2cd4a2a78135f1f935c06ec --- M tests/nightly.sh 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nightly.sh b/tests/nightly.sh index aa69c44..f5f9295 100755 --- a/tests/nightly.sh +++ b/tests/nightly.sh @@ -172,7 +172,7 @@ rm -rf "${gem5_root}/build/ARM" docker run -u $UID:$GID --volume "${gem5_root}":"${gem5_root}" -w \ "${gem5_root}" --memory="${docker_mem_limit}" --rm \ -gcr.io/gem5-test/ubuntu-22.04_all-dependencies:${tag} bash -c "\ +gcr.io/gem5-test/ubuntu-22.04_min-dependencies:${tag} bash -c "\ scons -j${compile_threads} --ignore-style build/ARM/gem5.opt && \ scons --with-cxx-config --without-python --without-tcmalloc USE_SYSTEMC=0 \ -j${compile_threads} build/ARM/libgem5_opt.so \ @@ -183,7 +183,7 @@ gcr.io/gem5-test/systemc-env:${tag} bash -c "\ cd util/systemc/gem5_within_systemc && \ make -j${compile_threads} && \ -../../../build/ARM/gem5.opt ../../../configs/example/se.py -c \ +../../../build/ARM/gem5.opt ../../../configs/deprecated/example/se.py -c \ ../../../tests/test-progs/hello/bin/arm/linux/hello && \ LD_LIBRARY_PATH=../../../build/ARM/:/opt/systemc/lib-linux64/ \ ./gem5.opt.sc m5out/config.ini && \ -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69337?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I1223afd70f105073d2cd4a2a78135f1f935c06ec Gerrit-Change-Number: 69337 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: arch-riscv: Revert CSR instruction fixes
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/68637?usp=email ) Change subject: arch-riscv: Revert CSR instruction fixes .. arch-riscv: Revert CSR instruction fixes This reverts commit 4b1c24542065380c6cff7ab2baa25e216a0ad38e and commit 89c49d1ab06ea5364ab1f80586f8b01c0297cb12 because they are causing the RISC-V Ubuntu boot test within the nightly tests to hang and time out. Change-Id: Ia4d8098ec940cb5900256c8cede0146256c851e5 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68637 Tested-by: kokoro Reviewed-by: Roger Chang Maintainer: Jason Lowe-Power Reviewed-by: Jason Lowe-Power --- M src/arch/riscv/insts/standard.hh M src/arch/riscv/isa/formats/standard.isa 2 files changed, 8 insertions(+), 26 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, but someone else must approve; Looks good to me, approved Roger Chang: Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/riscv/insts/standard.hh b/src/arch/riscv/insts/standard.hh index 2dfe73a..5b0e8c2 100644 --- a/src/arch/riscv/insts/standard.hh +++ b/src/arch/riscv/insts/standard.hh @@ -91,33 +91,18 @@ protected: uint64_t csr; uint64_t uimm; -bool read; -bool write; /// Constructor CSROp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) : RiscvStaticInst(mnem, _machInst, __opClass), -csr(FUNCT12), uimm(CSRIMM), read(true), write(true) +csr(FUNCT12), uimm(CSRIMM) { if (csr == CSR_SATP) { flags[IsSquashAfter] = true; } -if (strcmp(mnemonic, "csrrw") == 0 || -strcmp(mnemonic, "csrrwi") == 0) { - if (RD == 0){ -read = false; - } -} else if (strcmp(mnemonic, "csrrs") == 0 || - strcmp(mnemonic, "csrrc") == 0 || - strcmp(mnemonic, "csrrsi") == 0 || - strcmp(mnemonic, "csrrci") == 0 ){ - if (RS1 == 0 || uimm == 0) { -write = false; - } -} } - std::string generateDisassembly( +std::string generateDisassembly( Addr pc, const loader::SymbolTable *symtab) const override; }; diff --git a/src/arch/riscv/isa/formats/standard.isa b/src/arch/riscv/isa/formats/standard.isa index c94a0bc..bb500f5 100644 --- a/src/arch/riscv/isa/formats/standard.isa +++ b/src/arch/riscv/isa/formats/standard.isa @@ -358,7 +358,7 @@ %(op_decl)s; %(op_rd)s; -RegVal data = 0, olddata = 0, nonmaskdata = 0; +RegVal data, olddata; auto lowestAllowedMode = (PrivilegeMode)bits(csr, 9, 8); auto pm = (PrivilegeMode)xc->readMiscReg(MISCREG_PRV); if (pm < lowestAllowedMode) { @@ -380,13 +380,11 @@ break; } -if (read) { - if (csr == CSR_FCSR) { +if (csr == CSR_FCSR) { olddata = xc->readMiscReg(MISCREG_FFLAGS) | - (xc->readMiscReg(MISCREG_FRM) << FRM_OFFSET); - } else { + (xc->readMiscReg(MISCREG_FRM) << FRM_OFFSET); +} else { olddata = xc->readMiscReg(midx); - } } olddata = rvZext(olddata); auto olddata_all = olddata; @@ -397,9 +395,8 @@ %(code)s; -nonmaskdata = data & ~maskVal; data &= maskVal; -if (write) { +if (data != olddata) { if (bits(csr, 11, 10) == 0x3) { return std::make_shared( csprintf("CSR %s is read-only\n", csrName), machInst); @@ -420,7 +417,7 @@ case CSR_SIP: case CSR_SIE: case CSR_UIP: case CSR_UIE: case CSR_MSTATUS: case CSR_SSTATUS: case CSR_USTATUS: -if (nonmaskdata == 0) { +if (newdata_all != olddata_all) { xc->setMiscReg(midx, newdata_all); } else { return std::make_shared( -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/68637?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ia4d8098ec940cb5900256c8cede0146256c851e5 Gerrit-Change-Number: 68637 Gerrit-PatchSet: 2 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: Roger Chang Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: base: Fix gcc-13 build error
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/68497?usp=email ) Change subject: base: Fix gcc-13 build error .. base: Fix gcc-13 build error This change adds relevant errors that allow building with gcc-13. Change-Id: Ib97a90ef647a9cd9ec1bf1f2bde61daca85de427 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68497 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Bobby Bruce --- M src/arch/arm/insts/crypto.hh M src/base/cprintf_formats.hh M src/mem/ruby/common/Histogram.hh 3 files changed, 4 insertions(+), 0 deletions(-) Approvals: kokoro: Regressions pass Bobby Bruce: Looks good to me, approved; Looks good to me, approved diff --git a/src/arch/arm/insts/crypto.hh b/src/arch/arm/insts/crypto.hh index 23eda5b..089cbe5 100644 --- a/src/arch/arm/insts/crypto.hh +++ b/src/arch/arm/insts/crypto.hh @@ -38,6 +38,8 @@ #ifndef __ARCH_ARM_INSTS_CRYPTO_HH__ #define __ARCH_ARM_INSTS_CRYPTO_HH__ +#include + namespace gem5 { diff --git a/src/base/cprintf_formats.hh b/src/base/cprintf_formats.hh index 02ba496..4a64780 100644 --- a/src/base/cprintf_formats.hh +++ b/src/base/cprintf_formats.hh @@ -29,6 +29,7 @@ #ifndef __BASE_CPRINTF_FORMATS_HH__ #define __BASE_CPRINTF_FORMATS_HH__ +#include #include #include #include diff --git a/src/mem/ruby/common/Histogram.hh b/src/mem/ruby/common/Histogram.hh index bfd3ae0..cdc27af 100644 --- a/src/mem/ruby/common/Histogram.hh +++ b/src/mem/ruby/common/Histogram.hh @@ -29,6 +29,7 @@ #ifndef __MEM_RUBY_COMMON_HISTOGRAM_HH__ #define __MEM_RUBY_COMMON_HISTOGRAM_HH__ +#include #include #include -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/68497?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ib97a90ef647a9cd9ec1bf1f2bde61daca85de427 Gerrit-Change-Number: 68497 Gerrit-PatchSet: 4 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Daniel Carvalho Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: arch-riscv: Revert CSR instruction fixes
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/68637?usp=email ) Change subject: arch-riscv: Revert CSR instruction fixes .. arch-riscv: Revert CSR instruction fixes This reverts commit 4b1c24542065380c6cff7ab2baa25e216a0ad38e and commit 89c49d1ab06ea5364ab1f80586f8b01c0297cb12 because they are causing the RISC-V Ubuntu boot test within the nightly tests to hang and time out. Change-Id: Ia4d8098ec940cb5900256c8cede0146256c851e5 --- M src/arch/riscv/insts/standard.hh M src/arch/riscv/isa/formats/standard.isa 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/src/arch/riscv/insts/standard.hh b/src/arch/riscv/insts/standard.hh index 2dfe73a..5b0e8c2 100644 --- a/src/arch/riscv/insts/standard.hh +++ b/src/arch/riscv/insts/standard.hh @@ -91,33 +91,18 @@ protected: uint64_t csr; uint64_t uimm; -bool read; -bool write; /// Constructor CSROp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) : RiscvStaticInst(mnem, _machInst, __opClass), -csr(FUNCT12), uimm(CSRIMM), read(true), write(true) +csr(FUNCT12), uimm(CSRIMM) { if (csr == CSR_SATP) { flags[IsSquashAfter] = true; } -if (strcmp(mnemonic, "csrrw") == 0 || -strcmp(mnemonic, "csrrwi") == 0) { - if (RD == 0){ -read = false; - } -} else if (strcmp(mnemonic, "csrrs") == 0 || - strcmp(mnemonic, "csrrc") == 0 || - strcmp(mnemonic, "csrrsi") == 0 || - strcmp(mnemonic, "csrrci") == 0 ){ - if (RS1 == 0 || uimm == 0) { -write = false; - } -} } - std::string generateDisassembly( +std::string generateDisassembly( Addr pc, const loader::SymbolTable *symtab) const override; }; diff --git a/src/arch/riscv/isa/formats/standard.isa b/src/arch/riscv/isa/formats/standard.isa index c94a0bc..bb500f5 100644 --- a/src/arch/riscv/isa/formats/standard.isa +++ b/src/arch/riscv/isa/formats/standard.isa @@ -358,7 +358,7 @@ %(op_decl)s; %(op_rd)s; -RegVal data = 0, olddata = 0, nonmaskdata = 0; +RegVal data, olddata; auto lowestAllowedMode = (PrivilegeMode)bits(csr, 9, 8); auto pm = (PrivilegeMode)xc->readMiscReg(MISCREG_PRV); if (pm < lowestAllowedMode) { @@ -380,13 +380,11 @@ break; } -if (read) { - if (csr == CSR_FCSR) { +if (csr == CSR_FCSR) { olddata = xc->readMiscReg(MISCREG_FFLAGS) | - (xc->readMiscReg(MISCREG_FRM) << FRM_OFFSET); - } else { + (xc->readMiscReg(MISCREG_FRM) << FRM_OFFSET); +} else { olddata = xc->readMiscReg(midx); - } } olddata = rvZext(olddata); auto olddata_all = olddata; @@ -397,9 +395,8 @@ %(code)s; -nonmaskdata = data & ~maskVal; data &= maskVal; -if (write) { +if (data != olddata) { if (bits(csr, 11, 10) == 0x3) { return std::make_shared( csprintf("CSR %s is read-only\n", csrName), machInst); @@ -420,7 +417,7 @@ case CSR_SIP: case CSR_SIE: case CSR_UIP: case CSR_UIE: case CSR_MSTATUS: case CSR_SSTATUS: case CSR_USTATUS: -if (nonmaskdata == 0) { +if (newdata_all != olddata_all) { xc->setMiscReg(midx, newdata_all); } else { return std::make_shared( -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/68637?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ia4d8098ec940cb5900256c8cede0146256c851e5 Gerrit-Change-Number: 68637 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: cpu: Allow PcCountTracker to compile in NULL ISA
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/68597?usp=email ) Change subject: cpu: Allow PcCountTracker to compile in NULL ISA .. cpu: Allow PcCountTracker to compile in NULL ISA While the PcCountTracker isn't necessary in the NULL ISA, the structure of the standard library requires us to have it built when running the replacement policy tests, which should fix these tests failing within the nightlies at the moment. Change-Id: I225b7923f2a11d351c24bdceba3ded4ed2b3bc87 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68597 Maintainer: Jason Lowe-Power Reviewed-by: Jason Lowe-Power Tested-by: kokoro --- M src/cpu/probes/SConscript 1 file changed, 7 insertions(+), 8 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/cpu/probes/SConscript b/src/cpu/probes/SConscript index c96ca78..9f43317 100644 --- a/src/cpu/probes/SConscript +++ b/src/cpu/probes/SConscript @@ -26,12 +26,11 @@ Import("*") -if not env["CONF"]["USE_NULL_ISA"]: -SimObject( -"PcCountTracker.py", -sim_objects=["PcCountTracker", "PcCountTrackerManager"], -) -Source("pc_count_tracker.cc") -Source("pc_count_tracker_manager.cc") +SimObject( +"PcCountTracker.py", +sim_objects=["PcCountTracker", "PcCountTrackerManager"], +) +Source("pc_count_tracker.cc") +Source("pc_count_tracker_manager.cc") -DebugFlag("PcCountTracker") +DebugFlag("PcCountTracker") -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/68597?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I225b7923f2a11d351c24bdceba3ded4ed2b3bc87 Gerrit-Change-Number: 68597 Gerrit-PatchSet: 2 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: cpu: Allow PcCountTracker to compile in NULL ISA
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/68597?usp=email ) Change subject: cpu: Allow PcCountTracker to compile in NULL ISA .. cpu: Allow PcCountTracker to compile in NULL ISA While the PcCountTracker isn't necessary in the NULL ISA, the structure of the standard library requires us to have it built when running the replacement policy tests, which should fix these tests failing within the nightlies at the moment. Change-Id: I225b7923f2a11d351c24bdceba3ded4ed2b3bc87 --- M src/cpu/probes/SConscript 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/cpu/probes/SConscript b/src/cpu/probes/SConscript index c96ca78..9f43317 100644 --- a/src/cpu/probes/SConscript +++ b/src/cpu/probes/SConscript @@ -26,12 +26,11 @@ Import("*") -if not env["CONF"]["USE_NULL_ISA"]: -SimObject( -"PcCountTracker.py", -sim_objects=["PcCountTracker", "PcCountTrackerManager"], -) -Source("pc_count_tracker.cc") -Source("pc_count_tracker_manager.cc") +SimObject( +"PcCountTracker.py", +sim_objects=["PcCountTracker", "PcCountTrackerManager"], +) +Source("pc_count_tracker.cc") +Source("pc_count_tracker_manager.cc") -DebugFlag("PcCountTracker") +DebugFlag("PcCountTracker") -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/68597?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I225b7923f2a11d351c24bdceba3ded4ed2b3bc87 Gerrit-Change-Number: 68597 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [XS] Change in gem5/gem5[develop]: base: Fix LLVM build error
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/68497?usp=email ) Change subject: base: Fix LLVM build error .. base: Fix LLVM build error This change adds relevant errors that allow building with gcc-13. Change-Id: Ib97a90ef647a9cd9ec1bf1f2bde61daca85de427 --- M src/arch/arm/insts/crypto.hh M src/base/cprintf_formats.hh M src/mem/ruby/common/Histogram.hh 3 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/arch/arm/insts/crypto.hh b/src/arch/arm/insts/crypto.hh index 23eda5b..c9cbb8f 100644 --- a/src/arch/arm/insts/crypto.hh +++ b/src/arch/arm/insts/crypto.hh @@ -37,6 +37,7 @@ #ifndef __ARCH_ARM_INSTS_CRYPTO_HH__ #define __ARCH_ARM_INSTS_CRYPTO_HH__ +#include namespace gem5 { diff --git a/src/base/cprintf_formats.hh b/src/base/cprintf_formats.hh index 02ba496..148ab17 100644 --- a/src/base/cprintf_formats.hh +++ b/src/base/cprintf_formats.hh @@ -32,6 +32,8 @@ #include #include #include +#include + namespace gem5 { diff --git a/src/mem/ruby/common/Histogram.hh b/src/mem/ruby/common/Histogram.hh index bfd3ae0..e8679ad 100644 --- a/src/mem/ruby/common/Histogram.hh +++ b/src/mem/ruby/common/Histogram.hh @@ -31,6 +31,7 @@ #include #include +#include #include "mem/ruby/common/TypeDefines.hh" -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/68497?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ib97a90ef647a9cd9ec1bf1f2bde61daca85de427 Gerrit-Change-Number: 68497 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: tests: Fix failing SST and SystemC nightly tests
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/67817?usp=email ) Change subject: tests: Fix failing SST and SystemC nightly tests .. tests: Fix failing SST and SystemC nightly tests There was a bug with the SST and SystemC tests where they wouldn't compile due to a missing path for the gdbremote/signals.hh header, and this change includes that so they run properly. Change-Id: I9ff0404e327358fe2d1b77388bbcc1f807136ebe --- M ext/sst/Makefile M util/systemc/gem5_within_systemc/Makefile 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ext/sst/Makefile b/ext/sst/Makefile index 682af3d..a7467bf 100644 --- a/ext/sst/Makefile +++ b/ext/sst/Makefile @@ -4,7 +4,7 @@ OFLAG=3 LDFLAGS=-shared -fno-common ${shell pkg-config ${SST_VERSION} --libs} -L../../build/${ARCH}/ -Wl,-rpath ../../build/${ARCH} -CXXFLAGS=-std=c++17 -g -O${OFLAG} -fPIC ${shell pkg-config ${SST_VERSION} --cflags} ${shell python3-config --includes} -I../../build/${ARCH}/ -I../../ext/pybind11/include/ -I../../build/softfloat/ +CXXFLAGS=-std=c++17 -g -O${OFLAG} -fPIC ${shell pkg-config ${SST_VERSION} --cflags} ${shell python3-config --includes} -I../../build/${ARCH}/ -I../../ext/pybind11/include/ -I../../build/softfloat/ -I../..// CPPFLAGS+=-MMD -MP SRC=$(wildcard *.cc) diff --git a/util/systemc/gem5_within_systemc/Makefile b/util/systemc/gem5_within_systemc/Makefile index cc6a389..f2baf88 100644 --- a/util/systemc/gem5_within_systemc/Makefile +++ b/util/systemc/gem5_within_systemc/Makefile @@ -39,7 +39,7 @@ SYSTEMC_INC = /opt/systemc/include SYSTEMC_LIB = /opt/systemc/lib-linux64 -CXXFLAGS = -I../../../build/$(ARCH) -L../../../build/$(ARCH) +CXXFLAGS = -I../../../build/$(ARCH) -L../../../build/$(ARCH) -I../../../ext/ CXXFLAGS += -I$(SYSTEMC_INC) -L$(SYSTEMC_LIB) CXXFLAGS += -std=c++17 CXXFLAGS += -g -DTRACING_ON -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/67817?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I9ff0404e327358fe2d1b77388bbcc1f807136ebe Gerrit-Change-Number: 67817 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: tests: Update testing documentation
Melissa Jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/65651?usp=email ) Change subject: tests: Update testing documentation .. tests: Update testing documentation This edits the documentation regarding the usage of the --isa tag, as this has fallen out of date in regards to the new 'ALL' isa. Change-Id: I3b672ac2c03dd109bba458db688af05ed4135a91 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65651 Tested-by: kokoro Reviewed-by: Bobby Bruce Maintainer: Bobby Bruce --- M TESTING.md M tests/gem5/fixture.py 2 files changed, 30 insertions(+), 6 deletions(-) Approvals: kokoro: Regressions pass Bobby Bruce: Looks good to me, approved; Looks good to me, approved diff --git a/TESTING.md b/TESTING.md index 2273e31..146aeac 100644 --- a/TESTING.md +++ b/TESTING.md @@ -86,10 +86,10 @@ ./main.py run --variant opt ``` -Or, if you want to just run X86 tests with the `gem5.opt` binary: +Or, if you want to just run quick tests with the `gem5.opt` binary: ```shell -./main.py run --length quick --variant opt --isa X86 +./main.py run --length quick --variant opt ``` @@ -102,6 +102,14 @@ The output is split into tag *types* (e.g., isa, variant, length) and the tags for each type are listed after the type name. +Note that when using the isa tag type, tests were traditionally sorted based +on what compilation it required. However, as tests have switched to all be +compiled under the ALL compilation, which includes all ISAs so one doesn't +need to compile each one individually, using the isa tag for ISAs other than +ALL has become a less optimal way of searching for tests. It would instead +be better to run subsets of tests based on their directories, as described +above. + You can specify "or" between tags within the same type by using the tag flag multiple times. For instance, to run everything that is tagged "opt" or "fast" use @@ -112,10 +120,10 @@ You can also specify "and" between different types of tags by specifying more than one type on the command line. For instance, this will only run tests with -both the "X86" and "opt" tags. +both the "ALL" and "opt" tags. ```shell -./main.py run --isa X86 --variant opt +./main.py run --isa All --variant opt ``` ## Running tests in batch diff --git a/tests/gem5/fixture.py b/tests/gem5/fixture.py index c8bc79f..6f5dd61 100644 --- a/tests/gem5/fixture.py +++ b/tests/gem5/fixture.py @@ -174,8 +174,7 @@ ) log.test_log.message("%s" % (", ".join(self.targets))) log.test_log.message( -"You may want to run with only a single ISA" -"(--isa=), use --skip-build, or use 'rerun'." +"You may want to use --skip-build, or use 'rerun'." ) command.extend(self.targets) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/65651?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I3b672ac2c03dd109bba458db688af05ed4135a91 Gerrit-Change-Number: 65651 Gerrit-PatchSet: 3 Gerrit-Owner: Melissa Jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Boris Shingarov Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Melissa Jost Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [M] Change in gem5/gem5[develop]: cpu-o3: Move O3 IEW stats to BaseCPU::ExecuteCPUStats
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/67395?usp=email ) Change subject: cpu-o3: Move O3 IEW stats to BaseCPU::ExecuteCPUStats .. cpu-o3: Move O3 IEW stats to BaseCPU::ExecuteCPUStats Moved numInsts, numBranches, numNop, numRefs, numLoadInsts, numRate to Base. Merged numRefs into numMemRefs of ExecuteCPUStats. Renamed numRate to instRate. Updated formatting in ExecuteCPUStats group. Change-Id: I1fd3a989d917eb2ffaa865b067b80e266d6f55bc --- M src/cpu/base.cc M src/cpu/base.hh M src/cpu/o3/iew.cc M src/cpu/o3/iew.hh 4 files changed, 68 insertions(+), 75 deletions(-) diff --git a/src/cpu/base.cc b/src/cpu/base.cc index 84a2ced..0b115f9 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -190,7 +190,11 @@ baseStats.numCycles; fetchStats.emplace_back(fetchStatptr); -executeStats.emplace_back(new ExecuteCPUStats(this, i)); +// create executeStat object for thread i and set rate formulas +ExecuteCPUStats* executeStatptr = new ExecuteCPUStats(this, i); +executeStatptr->instRate = executeStatptr->numInsts / +baseStats.numCycles; +executeStats.emplace_back(executeStatptr); // create commitStat object for thread i and set ipc, cpi formulas CommitCPUStats* commitStatptr = new CommitCPUStats(this, i); @@ -853,6 +857,19 @@ BaseCPU:: ExecuteCPUStats::ExecuteCPUStats(statistics::Group *parent, int thread_id) : statistics::Group(parent, csprintf("executeStats%i", thread_id).c_str()), +ADD_STAT(numInsts, statistics::units::Count::get(), + "Number of executed instructions"), +ADD_STAT(numNop, statistics::units::Count::get(), + "Number of nop insts executed"), +ADD_STAT(numBranches, statistics::units::Count::get(), + "Number of branches executed"), +ADD_STAT(numLoadInsts, statistics::units::Count::get(), + "Number of load instructions executed"), +ADD_STAT(numStoreInsts, statistics::units::Count::get(), + "Number of stores executed"), +ADD_STAT(instRate, statistics::units::Rate< +statistics::units::Count, statistics::units::Cycle>::get(), + "Inst execution rate"), ADD_STAT(dcacheStallCycles, statistics::units::Cycle::get(), "DCache total stall cycles"), ADD_STAT(numCCRegReads, statistics::units::Count::get(), @@ -891,36 +908,38 @@ "Number of ops (including micro ops) which were discarded before " "commit") { +numStoreInsts = numMemRefs - numLoadInsts; + dcacheStallCycles -.prereq(dcacheStallCycles); +.prereq(dcacheStallCycles); numCCRegReads -.prereq(numCCRegReads) -.flags(statistics::nozero); +.prereq(numCCRegReads) +.flags(statistics::nozero); numCCRegWrites -.prereq(numCCRegWrites) -.flags(statistics::nozero); +.prereq(numCCRegWrites) +.flags(statistics::nozero); numFpAluAccesses -.prereq(numFpAluAccesses); +.prereq(numFpAluAccesses); numFpRegReads -.prereq(numFpRegReads); +.prereq(numFpRegReads); numIntAluAccesses -.prereq(numIntAluAccesses); +.prereq(numIntAluAccesses); numIntRegReads -.prereq(numIntRegReads); +.prereq(numIntRegReads); numIntRegWrites -.prereq(numIntRegWrites); +.prereq(numIntRegWrites); numMiscRegReads -.prereq(numMiscRegReads); +.prereq(numMiscRegReads); numMiscRegWrites -.prereq(numMiscRegWrites); +.prereq(numMiscRegWrites); numVecPredRegReads -.prereq(numVecPredRegReads); +.prereq(numVecPredRegReads); numVecPredRegWrites -.prereq(numVecPredRegWrites); +.prereq(numVecPredRegWrites); numVecRegReads -.prereq(numVecRegReads); +.prereq(numVecRegReads); numVecRegWrites -.prereq(numVecRegWrites); +.prereq(numVecRegWrites); } BaseCPU:: diff --git a/src/cpu/base.hh b/src/cpu/base.hh index 2aa4e63..12c3bc5 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -699,6 +699,19 @@ { ExecuteCPUStats(statistics::Group *parent, int thread_id); +/* Stat for total number of executed instructions */ +statistics::Scalar numInsts; +/* Number of executed nops */ +statistics::Scalar numNop; +/* Number of executed branches */ +statistics::Scalar numBranches; +/* Stat for total number of executed load instructions */ +statistics::Scalar numLoadInsts; +/* Number of executed store instructions */ +statistics::Formula numStoreInsts; +/* Number of instructions execut
[gem5-dev] [L] Change in gem5/gem5[develop]: cpu: Move execute stats from simple and minor to base
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/67390?usp=email ) Change subject: cpu: Move execute stats from simple and minor to base .. cpu: Move execute stats from simple and minor to base Created stat group ExecuteCPUStats in BaseCPU and moved stats from the simple and minor cpu models. The stats moved from SimpleCPU are dcacheStallCycles, icacheStallCycles, numCCRegReads, numCCRegWrites, numFpAluAccesses, numFpRegReads, numFpRegWrites, numIntAluAccesses, numIntRegReads, numIntRegWrites, numMemRefs, numMiscRegReads, numMiscRegWrites, numVecAluAccesses, numVecPredRegReads, numVecPredRegWrites, numVecRegReads, numVecRegWrites. The stat moved from MinorCPU is numDiscardedOps. Also, ccRegfileReads, ccRegfileWrites, fpRegfileReads, fpRegfileWrites, intRegfileReads, intRegfileWrites, miscRegfileReads, miscRegfileWrites, vecPredRegfileReads, vecPredRegfileWrites, vecRegfileReads, and vecRegfileWrites are removed from cpu.hh and cpu.cc in O3CPU. The corresponding stats in BaseCPU::ExecuteCPUStats are used instead. Changed the getReg, getWritableReg, and setReg functions in the O3 CPU object to take the thread ID as a parameter. This is because the stats in base are stored in vectors that are indexed by thread ID. Change-Id: I801c5ceb4c70b7b281127569f11c6ee98f614b27 --- M src/cpu/base.cc M src/cpu/base.hh M src/cpu/minor/execute.cc M src/cpu/minor/stats.cc M src/cpu/minor/stats.hh M src/cpu/o3/cpu.cc M src/cpu/o3/cpu.hh M src/cpu/o3/dyn_inst.hh M src/cpu/simple/base.cc M src/cpu/simple/exec_context.hh 10 files changed, 220 insertions(+), 239 deletions(-) diff --git a/src/cpu/base.cc b/src/cpu/base.cc index 98453d7..7bdbfda 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -180,8 +180,10 @@ } // create a stat group object for each thread on this core fetchStats.reserve(numThreads); +executeStats.reserve(numThreads); for (int i = 0; i < numThreads; i++) { fetchStats.emplace_back(new FetchCPUStats(this, i)); +executeStats.emplace_back(new ExecuteCPUStats(this, i)); } } @@ -799,4 +801,78 @@ } +// means it is incremented in a vector indexing and not directly +BaseCPU:: +ExecuteCPUStats::ExecuteCPUStats(statistics::Group *parent, int thread_id) +: statistics::Group(parent, csprintf("executeStats%i", thread_id).c_str()), +ADD_STAT(dcacheStallCycles, statistics::units::Cycle::get(), + "DCache total stall cycles"), +ADD_STAT(numCCRegReads, statistics::units::Count::get(), + "Number of times the CC registers were read"), +ADD_STAT(numCCRegWrites, statistics::units::Count::get(), + "Number of times the CC registers were written"), +ADD_STAT(numFpAluAccesses, statistics::units::Count::get(), + "Number of float alu accesses"), +ADD_STAT(numFpRegReads, statistics::units::Count::get(), + "Number of times the floating registers were read"), +ADD_STAT(numFpRegWrites, statistics::units::Count::get(), + "Number of times the floating registers were written"), +ADD_STAT(numIntAluAccesses, statistics::units::Count::get(), + "Number of integer alu accesses"), +ADD_STAT(numIntRegReads, statistics::units::Count::get(), + "Number of times the integer registers were read"), +ADD_STAT(numIntRegWrites, statistics::units::Count::get(), + "Number of times the integer registers were written"), +ADD_STAT(numMemRefs, statistics::units::Count::get(), + "Number of memory refs"), +ADD_STAT(numMiscRegReads, statistics::units::Count::get(), + "Number of times the Misc registers were read"), +ADD_STAT(numMiscRegWrites, statistics::units::Count::get(), + "Number of times the Misc registers were written"), +ADD_STAT(numVecAluAccesses, statistics::units::Count::get(), + "Number of vector alu accesses"), +ADD_STAT(numVecPredRegReads, statistics::units::Count::get(), + "Number of times the predicate registers were read"), +ADD_STAT(numVecPredRegWrites, statistics::units::Count::get(), + "Number of times the predicate registers were written"), +ADD_STAT(numVecRegReads, statistics::units::Count::get(), + "Number of times the vector registers were read"), +ADD_STAT(numVecRegWrites, statistics::units::Count::get(), + "Number of times the vector registers were written"), +ADD_STAT(numDiscardedOps, statistics::units::Count::get(), + "Number of ops (including micro ops) which were discarded before " + "commit") +{ +dcacheStallCycles +.prereq(dcacheStallCycles); +numCCRegReads +.prereq(numCCRegReads) +.flags(statistics::nozero); +numCCRegWrites +.prereq(numCCRegWrites) +.flags(
[gem5-dev] [M] Change in gem5/gem5[develop]: cpu-o3: Move general fetch stats to BaseCPU::FetchCPUStats
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/67394?usp=email ) Change subject: cpu-o3: Move general fetch stats to BaseCPU::FetchCPUStats .. cpu-o3: Move general fetch stats to BaseCPU::FetchCPUStats The stats moved are from fetch.hh and fetch.cc of O3. Stat branches is now tracked by numBranches. Stat branchRate is now tracked by branchRate in FetchCPUStats. Stat rate is tracked by fetchRate. Stat insts is tracked by numInsts. Stat icacheStallCycles is tracked by icacheStallCycles in FetchCPUStats. Change-Id: I48313614edd078631df4ef6b00982c335798fcb1 --- M src/cpu/base.cc M src/cpu/base.hh M src/cpu/o3/fetch.cc M src/cpu/o3/fetch.hh 4 files changed, 56 insertions(+), 39 deletions(-) diff --git a/src/cpu/base.cc b/src/cpu/base.cc index fea720a..84a2ced 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -183,8 +183,15 @@ executeStats.reserve(numThreads); commitStats.reserve(numThreads); for (int i = 0; i < numThreads; i++) { -fetchStats.emplace_back(new FetchCPUStats(this, i)); +// create fetchStat object for thread i and set rate formulas +FetchCPUStats* fetchStatptr = new FetchCPUStats(this, i); +fetchStatptr->fetchRate = fetchStatptr->numInsts / baseStats.numCycles; +fetchStatptr->branchRate = fetchStatptr->numBranches / +baseStats.numCycles; +fetchStats.emplace_back(fetchStatptr); + executeStats.emplace_back(new ExecuteCPUStats(this, i)); + // create commitStat object for thread i and set ipc, cpi formulas CommitCPUStats* commitStatptr = new CommitCPUStats(this, i); commitStatptr->ipc = commitStatptr->numInsts / baseStats.numCycles; @@ -815,14 +822,30 @@ "Number of instructions fetched (thread level)"), ADD_STAT(numOps, statistics::units::Count::get(), "Number of ops (including micro ops) fetched (thread level)"), +ADD_STAT(fetchRate, statistics::units::Rate< + statistics::units::Count, statistics::units::Cycle>::get(), + "Number of inst fetches per cycle"), ADD_STAT(numBranches, statistics::units::Count::get(), "Number of branches fetched"), +ADD_STAT(branchRate, statistics::units::Ratio::get(), + "Number of branch fetches per cycle"), +ADD_STAT(icacheStallCycles, statistics::units::Cycle::get(), + "ICache total stall cycles"), ADD_STAT(numFetchSuspends, statistics::units::Count::get(), "Number of times Execute suspended instruction fetching") { +fetchRate +.flags(statistics::total); + numBranches .prereq(numBranches); + +branchRate +.flags(statistics::total); + +icacheStallCycles +.prereq(icacheStallCycles); } @@ -934,6 +957,9 @@ ADD_STAT(committedControl, statistics::units::Count::get(), "Class of control type instructions committed") { +numInsts +.prereq(numInsts); + cpi.precision(6); ipc.precision(6); diff --git a/src/cpu/base.hh b/src/cpu/base.hh index ac8f13c..2aa4e63 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -678,9 +678,18 @@ /* Total number of operations fetched */ statistics::Scalar numOps; +/* Number of instruction fetched per cycle. */ +statistics::Formula fetchRate; + /* Total number of branches fetched */ statistics::Scalar numBranches; +/* Number of branch fetches per cycle. */ +statistics::Formula branchRate; + +/* Number of cycles stalled due to an icache miss */ +statistics::Scalar icacheStallCycles; + /* Number of times fetch was asked to suspend by Execute */ statistics::Scalar numFetchSuspends; diff --git a/src/cpu/o3/fetch.cc b/src/cpu/o3/fetch.cc index 49416bf..e148082 100644 --- a/src/cpu/o3/fetch.cc +++ b/src/cpu/o3/fetch.cc @@ -158,12 +158,6 @@ Fetch::FetchStatGroup::FetchStatGroup(CPU *cpu, Fetch *fetch) : statistics::Group(cpu, "fetch"), -ADD_STAT(icacheStallCycles, statistics::units::Cycle::get(), - "Number of cycles fetch is stalled on an Icache miss"), -ADD_STAT(insts, statistics::units::Count::get(), - "Number of instructions fetch has processed"), -ADD_STAT(branches, statistics::units::Count::get(), - "Number of branches that fetch encountered"), ADD_STAT(predictedBranches, statistics::units::Count::get(), "Number of branches that fetch has predicted taken"), ADD_STAT(cycles, statistics::units::Cycle::get(), @@ -200,21 +194,8 @@ "Number of instructions fetched each cycle (Total)"), ADD_STAT(idleRate, statistics::units::Ratio::get(), "Ratio of cycles fetch was idle", - idleCycles / cpu->baseStats.numCycles), -ADD_STAT(branchRate, statistics::units::Ratio::
[gem5-dev] [L] Change in gem5/gem5[develop]: cpu: Move commit stats from simple to base cpu
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/67391?usp=email ) Change subject: cpu: Move commit stats from simple to base cpu .. cpu: Move commit stats from simple to base cpu Created stat group CommitCPUStats in BaseCPU and moved stats from the simple cpu model. The stats moved from SImpleCPU are numCondCtrlInsts, numFpInsts, numIntInsts, numLoadInsts, numStoreInsts, numVecInsts. Moved committedControl of MinorCPU to BaseCPU::CommittedCPUStats. In MinorCPU, this stat was a 2D vector, where the first dimension is the thread ID. In base it is now a 1D vector that is tied to a thread ID via the commitStats vector. The committedControl stat vector in CommitCPUStats is updated in the same way in all CPU models. The function updateComCtrlStats will update committedControl and the CPU models will call this function instead of updating committedControl directly. This function takes a StaticInstPtr as input, which Simple, Minor, and O3 CPU models are able to provide. Removed stat "branches" from O3 commit stage. This stat duplicates BaseCPU::CommittedCPUStats::committedControl::IsControl. O3 commit stats floating, integer, loads, memRefs, vectorInstructions are replaced by numFpInsts, numIntInsts, numLoadInsts, numMemRefs, numVecInsts from BaseCPU::CommitCPUStats respectively. Implemented numStoreInsts from BaseCPU::commitCPUStats for O3 commit stage. Change-Id: I362cec51513a404de56a02b450d7663327be20f5 --- M src/cpu/base.cc M src/cpu/base.hh M src/cpu/minor/execute.cc M src/cpu/minor/stats.cc M src/cpu/minor/stats.hh M src/cpu/o3/commit.cc M src/cpu/o3/commit.hh M src/cpu/simple/base.cc M src/cpu/simple/exec_context.hh 9 files changed, 156 insertions(+), 162 deletions(-) diff --git a/src/cpu/base.cc b/src/cpu/base.cc index 7bdbfda..0c43248 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -181,9 +181,11 @@ // create a stat group object for each thread on this core fetchStats.reserve(numThreads); executeStats.reserve(numThreads); +commitStats.reserve(numThreads); for (int i = 0; i < numThreads; i++) { fetchStats.emplace_back(new FetchCPUStats(this, i)); executeStats.emplace_back(new ExecuteCPUStats(this, i)); +commitStats.emplace_back(new CommitCPUStats(this, i)); } } @@ -875,4 +877,72 @@ .prereq(numVecRegWrites); } +BaseCPU:: +CommitCPUStats::CommitCPUStats(statistics::Group *parent, int thread_id) +: statistics::Group(parent, csprintf("commitStats%i", thread_id).c_str()), +ADD_STAT(numMemRefs, statistics::units::Count::get(), +"Number of memory references committed"), +ADD_STAT(numFpInsts, statistics::units::Count::get(), +"Number of float instructions"), +ADD_STAT(numIntInsts, statistics::units::Count::get(), +"Number of integer instructions"), +ADD_STAT(numLoadInsts, statistics::units::Count::get(), +"Number of load instructions"), +ADD_STAT(numStoreInsts, statistics::units::Count::get(), +"Number of store instructions"), +ADD_STAT(numVecInsts, statistics::units::Count::get(), +"Number of vector instructions"), +ADD_STAT(committedInstType, statistics::units::Count::get(), +"Class of committed instruction."), +ADD_STAT(committedControl, statistics::units::Count::get(), + "Class of control type instructions committed") +{ +committedInstType +.init(enums::Num_OpClass) +.flags(statistics::total | statistics::pdf | statistics::dist); + +for (unsigned i = 0; i < Num_OpClasses; ++i) { +committedInstType.subname(i, enums::OpClassStrings[i]); +} + +committedControl +.init(StaticInstFlags::Flags::Num_Flags) +.flags(statistics::nozero); + +for (unsigned i = 0; i < StaticInstFlags::Flags::Num_Flags; i++) { +committedControl.subname(i, StaticInstFlags::FlagsStrings[i]); +} +} + + +void +BaseCPU:: +CommitCPUStats::updateComCtrlStats(const StaticInstPtr staticInst) +{ +/* Add a count for every control instruction type */ +if (staticInst->isControl()) { +if (staticInst->isReturn()) { +committedControl[gem5::StaticInstFlags::Flags::IsReturn]++; +} +if (staticInst->isCall()) { +committedControl[gem5::StaticInstFlags::Flags::IsCall]++; +} +if (staticInst->isDirectCtrl()) { + committedControl[gem5::StaticInstFlags::Flags::IsDirectControl]++; +} +if (staticInst->isIndirectCtrl()) { +committedControl +[gem5::StaticInstFlags::Flags::IsIndirectControl]++; +} +if (staticInst->isCondCtrl()) { + committedControl[gem5::StaticInstFlags::Flags::IsCondControl]++; +} +if (staticInst->isUncondCtrl()) { + committedControl[gem5::Static
[gem5-dev] [S] Change in gem5/gem5[develop]: cpu-kvm: Implement IPC and CPI base stats for KVM CPU
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/67396?usp=email ) Change subject: cpu-kvm: Implement IPC and CPI base stats for KVM CPU .. cpu-kvm: Implement IPC and CPI base stats for KVM CPU Replaced committedInsts stats of KVM CPU with commitStats.numInsts of BaseCPU. This results in IPC and CPI printing in stats.txt for KVM simulations. Change-Id: I02395630fc50a69adebf11f4ed39d9cefb852e1f --- M src/cpu/kvm/base.cc M src/cpu/kvm/base.hh 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc index b76bddc..e22e162 100644 --- a/src/cpu/kvm/base.cc +++ b/src/cpu/kvm/base.cc @@ -261,8 +261,6 @@ BaseKvmCPU::StatGroup::StatGroup(statistics::Group *parent) : statistics::Group(parent), -ADD_STAT(committedInsts, statistics::units::Count::get(), - "Number of instructions committed"), ADD_STAT(numVMExits, statistics::units::Count::get(), "total number of KVM exits"), ADD_STAT(numVMHalfEntries, statistics::units::Count::get(), @@ -778,7 +776,8 @@ /* Update statistics */ baseStats.numCycles += simCyclesExecuted;; -stats.committedInsts += instsExecuted; +commitStats[thread->threadId()]->numInsts += instsExecuted; +baseStats.numInsts += instsExecuted; ctrInsts += instsExecuted; DPRINTF(KvmRun, diff --git a/src/cpu/kvm/base.hh b/src/cpu/kvm/base.hh index 6b4b88a..958b86c 100644 --- a/src/cpu/kvm/base.hh +++ b/src/cpu/kvm/base.hh @@ -804,7 +804,6 @@ struct StatGroup : public statistics::Group { StatGroup(statistics::Group *parent); -statistics::Scalar committedInsts; statistics::Scalar numVMExits; statistics::Scalar numVMHalfEntries; statistics::Scalar numExitSignal; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/67396?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I02395630fc50a69adebf11f4ed39d9cefb852e1f Gerrit-Change-Number: 67396 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [M] Change in gem5/gem5[develop]: cpu-o3: Use base instructions committed counters in O3CPU
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/67393?usp=email ) Change subject: cpu-o3: Use base instructions committed counters in O3CPU .. cpu-o3: Use base instructions committed counters in O3CPU Moved committedInsts from O3 cpu.* to BaseCPU as numInstsNotNOP because it tracks the instructions committed that are not NOPs or prefetches. This change also does the same for commitedOps. InstsCommitted from O3 commit.*, which tracks all instructions committed, has been removed. CommitCPUStats::numInsts replaces it in O3. The same has been done for opsCommitted. Because IPC and CPI calculations are handled in BaseCPU, removed IPC and CPI stats from O3 cpu.*. Change-Id: I9f122c9a9dafccd5342f18056f282f3dad8b1b1e --- M src/cpu/base.cc M src/cpu/base.hh M src/cpu/o3/commit.cc M src/cpu/o3/commit.hh M src/cpu/o3/cpu.cc M src/cpu/o3/cpu.hh 6 files changed, 34 insertions(+), 78 deletions(-) diff --git a/src/cpu/base.cc b/src/cpu/base.cc index 77ecfa9..fea720a 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -907,6 +907,10 @@ "Number of instructions committed (thread level)"), ADD_STAT(numOps, statistics::units::Count::get(), "Number of ops (including micro ops) committed (thread level)"), +ADD_STAT(numInstsNotNOP, statistics::units::Count::get(), + "Number of instructions committed excluding NOPs or prefetches"), +ADD_STAT(numOpsNotNOP, statistics::units::Count::get(), + "Number of Ops (including micro ops) Simulated"), ADD_STAT(cpi, statistics::units::Rate< statistics::units::Cycle, statistics::units::Count>::get(), "CPI: cycles per instruction (thread level)"), diff --git a/src/cpu/base.hh b/src/cpu/base.hh index 15ae0de..ac8f13c 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -741,6 +741,10 @@ statistics::Scalar numInsts; statistics::Scalar numOps; +/* Number of instructions committed that are not NOP or prefetches */ +statistics::Scalar numInstsNotNOP; +statistics::Scalar numOpsNotNOP; + /* CPI/IPC for total cycle counts and macro insts */ statistics::Formula cpi; statistics::Formula ipc; diff --git a/src/cpu/o3/commit.cc b/src/cpu/o3/commit.cc index 7419b2a..e1f0168 100644 --- a/src/cpu/o3/commit.cc +++ b/src/cpu/o3/commit.cc @@ -156,10 +156,6 @@ "The number of times a branch was mispredicted"), ADD_STAT(numCommittedDist, statistics::units::Count::get(), "Number of insts commited each cycle"), - ADD_STAT(instsCommitted, statistics::units::Count::get(), - "Number of instructions committed"), - ADD_STAT(opsCommitted, statistics::units::Count::get(), - "Number of ops (including micro ops) committed"), ADD_STAT(amos, statistics::units::Count::get(), "Number of atomic instructions committed"), ADD_STAT(membars, statistics::units::Count::get(), @@ -181,14 +177,6 @@ .init(0,commit->commitWidth,1) .flags(statistics::pdf); -instsCommitted -.init(cpu->numThreads) -.flags(total); - -opsCommitted -.init(cpu->numThreads) -.flags(total); - amos .init(cpu->numThreads) .flags(total); @@ -1348,9 +1336,12 @@ { ThreadID tid = inst->threadNumber; -if (!inst->isMicroop() || inst->isLastMicroop()) -stats.instsCommitted[tid]++; -stats.opsCommitted[tid]++; +if (!inst->isMicroop() || inst->isLastMicroop()) { +cpu->commitStats[tid]->numInsts++; +cpu->baseStats.numInsts++; +} +cpu->commitStats[tid]->numOps++; +cpu->baseStats.numOps++; // To match the old model, don't count nops and instruction // prefetches towards the total commit count. diff --git a/src/cpu/o3/commit.hh b/src/cpu/o3/commit.hh index 6591360..eccd023 100644 --- a/src/cpu/o3/commit.hh +++ b/src/cpu/o3/commit.hh @@ -479,10 +479,6 @@ /** Distribution of the number of committed instructions each cycle. */ statistics::Distribution numCommittedDist; -/** Total number of instructions committed. */ -statistics::Vector instsCommitted; -/** Total number of ops (including micro ops) committed. */ -statistics::Vector opsCommitted; /** Stat for the total number of committed atomics. */ statistics::Vector amos; /** Total number of committed memory barriers. */ diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 90df3b3..93c58fe 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -328,23 +328,7 @@ "to idling"), ADD_STAT(quiesceCycles, statistics::units::Cycle::get(), "Total number of cycles that CPU has spent quiesced or waiting " - "for an interrupt"), - ADD_STA
[gem5-dev] [M] Change in gem5/gem5[develop]: cpu: Move numInsts, numOps, ipc, cpi to BaseCPU
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/67392?usp=email ) Change subject: cpu: Move numInsts, numOps, ipc, cpi to BaseCPU .. cpu: Move numInsts, numOps, ipc, cpi to BaseCPU In BaseCPU::BaseCPUStats, numInsts and numOps track per CPU core committed instructions and operations. In BaseCPU::FetchCPUStats, numInsts and numOps track per thread fetched instructions and operations. In BaseCPU::CommitCPUStats, numInsts and numOps track per thread committed instructions and operations. In BaseSimpleCPU, the countInst() function has been split into countInst(), countFetchInst(), and countCommitInst(). The stat count incrementation of countInst() has been removed and delegated to the other two functions. countFetchInst() increments numInsts and numOps of the FetchCPUStats group for a thread. countCommitInst() increments the numInsts and numOps of the CommitCPUStats group for a thread and of the BaseCPUStats group for a CPU core. These functions are called in the appropriate stage within timing.cc and atomic.cc. The call to countInst() is left unchanged. countFetchInst() is called in preExecute(). countCommitInst() is called in postExecute(). For MinorCPU, only the commit level numInsts and numOps stats have been implemented. IPC and CPI stats have been added to BaseCPUStats (core level) and CommitCPUStats (thread level). The formulas for the IPC and CPI stats in CommitCPUStats are set in the BaseCPU constructor, after the CommitCPUStats stat group object has been created. Change-Id: If893b331fe4a6908e4b4caf4a30f1b0aeb4c4266 --- M src/cpu/base.cc M src/cpu/base.hh M src/cpu/minor/execute.cc M src/cpu/minor/stats.cc M src/cpu/minor/stats.hh M src/cpu/simple/base.cc M src/cpu/simple/base.hh M src/cpu/simple/exec_context.hh 8 files changed, 135 insertions(+), 40 deletions(-) diff --git a/src/cpu/base.cc b/src/cpu/base.cc index 0c43248..77ecfa9 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -185,7 +185,11 @@ for (int i = 0; i < numThreads; i++) { fetchStats.emplace_back(new FetchCPUStats(this, i)); executeStats.emplace_back(new ExecuteCPUStats(this, i)); -commitStats.emplace_back(new CommitCPUStats(this, i)); +// create commitStat object for thread i and set ipc, cpi formulas +CommitCPUStats* commitStatptr = new CommitCPUStats(this, i); +commitStatptr->ipc = commitStatptr->numInsts / baseStats.numCycles; +commitStatptr->cpi = baseStats.numCycles / commitStatptr->numInsts; +commitStats.emplace_back(commitStatptr); } } @@ -379,13 +383,28 @@ BaseCPU:: BaseCPUStats::BaseCPUStats(statistics::Group *parent) : statistics::Group(parent), + ADD_STAT(numInsts, statistics::units::Count::get(), + "Number of instructions committed (core level)"), + ADD_STAT(numOps, statistics::units::Count::get(), + "Number of ops (including micro ops) committed (core level)"), ADD_STAT(numCycles, statistics::units::Cycle::get(), "Number of cpu cycles simulated"), + ADD_STAT(cpi, statistics::units::Rate< +statistics::units::Cycle, statistics::units::Count>::get(), + "CPI: cycles per instruction (core level)"), + ADD_STAT(ipc, statistics::units::Rate< +statistics::units::Count, statistics::units::Cycle>::get(), + "IPC: instructions per cycle (core level)"), ADD_STAT(numWorkItemsStarted, statistics::units::Count::get(), "Number of work items this cpu started"), ADD_STAT(numWorkItemsCompleted, statistics::units::Count::get(), "Number of work items this cpu completed") { +cpi.precision(6); +cpi = numCycles / numInsts; + +ipc.precision(6); +ipc = numInsts / numCycles; } void @@ -792,6 +811,10 @@ BaseCPU:: FetchCPUStats::FetchCPUStats(statistics::Group *parent, int thread_id) : statistics::Group(parent, csprintf("fetchStats%i", thread_id).c_str()), +ADD_STAT(numInsts, statistics::units::Count::get(), + "Number of instructions fetched (thread level)"), +ADD_STAT(numOps, statistics::units::Count::get(), + "Number of ops (including micro ops) fetched (thread level)"), ADD_STAT(numBranches, statistics::units::Count::get(), "Number of branches fetched"), ADD_STAT(numFetchSuspends, statistics::units::Count::get(), @@ -880,6 +903,16 @@ BaseCPU:: CommitCPUStats::CommitCPUStats(statistics::Group *parent, int thread_id) : statistics::Group(parent, csprintf("commitStats%i", thread_id).c_str()), +ADD_STAT(numInsts, statistics::units::Count::get(), + "Number of instructions committed (thread level)"), +ADD_STAT(numOps, statistics::units::Count::get(), + "Number of ops (including micro ops) committed (thread level)"), +ADD_ST
[gem5-dev] [S] Change in gem5/gem5[release-staging-v22-1]: tests: Removed get_runtime_isa() from parsec_disk_run.py
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/66611?usp=email ) Change subject: tests: Removed get_runtime_isa() from parsec_disk_run.py .. tests: Removed get_runtime_isa() from parsec_disk_run.py This change removes the call to get_runtime_isa(), as it has been deprecated. Change-Id: Ie1b0b5fb456fd8ed504a531841fe4ea8e211502c --- M tests/gem5/configs/parsec_disk_run.py 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/gem5/configs/parsec_disk_run.py b/tests/gem5/configs/parsec_disk_run.py index 4275ffb..fbe1cd3 100644 --- a/tests/gem5/configs/parsec_disk_run.py +++ b/tests/gem5/configs/parsec_disk_run.py @@ -214,11 +214,6 @@ readfile_contents=command, ) -print("Running with ISA: " + get_runtime_isa().name) -print("Running with protocol: " + get_runtime_coherence_protocol().name) -print() - - # Here we define some custom workbegin/workend exit event generators. Here we # want to switch to detailed CPUs at the beginning of the ROI, then continue to # the end of of the ROI. Then we exit the simulation. -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/66611?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: release-staging-v22-1 Gerrit-Change-Id: Ie1b0b5fb456fd8ed504a531841fe4ea8e211502c Gerrit-Change-Number: 66611 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [S] Change in gem5/gem5[develop]: tests: Updating testing documentation
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/65651?usp=email ) Change subject: tests: Updating testing documentation .. tests: Updating testing documentation This edits the documentation regarding the usage of the --isa tag, as this has fallen out of date in regards to the new 'ALL' isa. Change-Id: I3b672ac2c03dd109bba458db688af05ed4135a91 --- M TESTING.md M tests/gem5/fixture.py 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/TESTING.md b/TESTING.md index 2273e31..146aeac 100644 --- a/TESTING.md +++ b/TESTING.md @@ -86,10 +86,10 @@ ./main.py run --variant opt ``` -Or, if you want to just run X86 tests with the `gem5.opt` binary: +Or, if you want to just run quick tests with the `gem5.opt` binary: ```shell -./main.py run --length quick --variant opt --isa X86 +./main.py run --length quick --variant opt ``` @@ -102,6 +102,14 @@ The output is split into tag *types* (e.g., isa, variant, length) and the tags for each type are listed after the type name. +Note that when using the isa tag type, tests were traditionally sorted based +on what compilation it required. However, as tests have switched to all be +compiled under the ALL compilation, which includes all ISAs so one doesn't +need to compile each one individually, using the isa tag for ISAs other than +ALL has become a less optimal way of searching for tests. It would instead +be better to run subsets of tests based on their directories, as described +above. + You can specify "or" between tags within the same type by using the tag flag multiple times. For instance, to run everything that is tagged "opt" or "fast" use @@ -112,10 +120,10 @@ You can also specify "and" between different types of tags by specifying more than one type on the command line. For instance, this will only run tests with -both the "X86" and "opt" tags. +both the "ALL" and "opt" tags. ```shell -./main.py run --isa X86 --variant opt +./main.py run --isa All --variant opt ``` ## Running tests in batch diff --git a/tests/gem5/fixture.py b/tests/gem5/fixture.py index 65b5454..f795e1a 100644 --- a/tests/gem5/fixture.py +++ b/tests/gem5/fixture.py @@ -174,8 +174,7 @@ ) log.test_log.message("%s" % (", ".join(self.targets))) log.test_log.message( -"You may want to run with only a single ISA" -"(--isa=), use --skip-build, or use 'rerun'." +"You may want to use --skip-build, or use 'rerun'." ) command.extend(self.targets) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/65651?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I3b672ac2c03dd109bba458db688af05ed4135a91 Gerrit-Change-Number: 65651 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] [M] Change in gem5/gem5[develop]: tests, resources: CVE-2007-4559 Patch
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/65271?usp=email ) Change subject: tests, resources: CVE-2007-4559 Patch .. tests, resources: CVE-2007-4559 Patch Hi, we are security researchers from the Advanced Research Center at Trellix. We have began a campaign to patch a widespread bug named CVE-2007-4559. CVE-2007-4559 is a 15 year old bug in the Python tarfile package. By using extract() or extractall() on a tarfile object without sanitizing input, a maliciously crafted .tar file could perform a directory path traversal attack. We found at least one unsantized extractall() in your codebase and are providing a patch for you via pull request. The patch essentially checks to see if all tarfile members will be extracted safely and throws an exception otherwise. We encourage you to use this patch or your own solution to secure against CVE-2007-4559. If you have further questions you may contact us through this projects lead researcher Kasimir Schulz. Change-Id: I891ac6652cfbd479aed51d64ef6d4e0fe740e06d --- M src/python/gem5/resources/downloader.py M tests/gem5/fixture.py 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/src/python/gem5/resources/downloader.py b/src/python/gem5/resources/downloader.py index bc277ee..1fda8d8 100644 --- a/src/python/gem5/resources/downloader.py +++ b/src/python/gem5/resources/downloader.py @@ -501,5 +501,28 @@ ) unpack_to = download_dest[: -len(tar_extension)] with tarfile.open(download_dest) as f: -f.extractall(unpack_to) + +def is_within_directory(directory, target): + +abs_directory = os.path.abspath(directory) +abs_target = os.path.abspath(target) + +prefix = os.path.commonprefix([abs_directory, abs_target]) + +return prefix == abs_directory + +def safe_extract( +tar, path=".", members=None, *, numeric_owner=False +): + +for member in tar.getmembers(): +member_path = os.path.join(path, member.name) +if not is_within_directory(path, member_path): +raise Exception( +"Attempted Path Traversal in Tar File" +) + +tar.extractall(path, members, numeric_owner=numeric_owner) + +safe_extract(f, unpack_to) os.remove(download_dest) diff --git a/tests/gem5/fixture.py b/tests/gem5/fixture.py index 5d6ae0c..65b5454 100644 --- a/tests/gem5/fixture.py +++ b/tests/gem5/fixture.py @@ -357,7 +357,28 @@ import tarfile with tarfile.open(self.filename) as tf: -tf.extractall(self.path) + +def is_within_directory(directory, target): + +abs_directory = os.path.abspath(directory) +abs_target = os.path.abspath(target) + +prefix = os.path.commonprefix([abs_directory, abs_target]) + +return prefix == abs_directory + +def safe_extract( +tar, path=".", members=None, *, numeric_owner=False +): + +for member in tar.getmembers(): +member_path = os.path.join(path, member.name) +if not is_within_directory(path, member_path): +raise Exception("Attempted Path Traversal in Tar File") + +tar.extractall(path, members, numeric_owner=numeric_owner) + +safe_extract(tf, self.path) def _setup(self, testitem): # Check to see if there is a file downloaded -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/65271?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I891ac6652cfbd479aed51d64ef6d4e0fe740e06d Gerrit-Change-Number: 65271 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org
[gem5-dev] Change in gem5/gem5[develop]: configs: Added LupV script to configs
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53046 ) Change subject: configs: Added LupV script to configs .. configs: Added LupV script to configs This commit adds run_lupv.py, the script to run the LupVBoard, as well as a README that details how to set up your system in order to run the LupIO devices. Change-Id: Ibea098f0409819b4c79063ab0be01518c7c6a61f Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53046 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- A configs/example/lupv/run_lupv.py A configs/example/lupv/README.md 2 files changed, 173 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/configs/example/lupv/README.md b/configs/example/lupv/README.md new file mode 100644 index 000..d5895db --- /dev/null +++ b/configs/example/lupv/README.md @@ -0,0 +1,44 @@ +# README + +This README details how to build a RISCV full system that utilizes the +lupIO devices. The LupIO devices were created by Professor Joël Porquet-Lupine, +and more information about the device can be found [here]( +https://luplab.cs.ucdavis.edu/assets/lupio/wcae21-porquet-lupio-paper.pdf). The +specs for each individual device can be found [here]( +https://gitlab.com/luplab/lupio/lupio-specs), and the Linux drivers for each of +these devices can be found [here](https://gitlab.com/luplab/lupio/linux). + +To build the RISCV gem5 binary execute: + +```sh +scons build/RISCV/gem5.opt +``` + +Then, to run the LupIO example execute: + + +``` bash +.build/RISCV/gem5.opt configs/example/lupv/run_lupv.py [cpu type] [num cpus] +``` + +Note: valid cpu types are `atomic` and `timing` for now. + +For example: + +```bash +gem5/build/RISCV/gem5.opt configs/example/lupv/run_lupv.py atomic 1 +``` + +You can observe the stdout of the simulated system in `m5out/system.terminal`. +Then, you can open up a separate terminal and use m5term to connect to the +simulated console. The port number will be specified in the gem5 simulation +as `0: system.remote_gdb: listening for remote gdb on port ` + +example: + +```bash +m5term localhost 3456 +``` + +This should allow you to run busybox, in which you can see the LupIO device at +work! \ No newline at end of file diff --git a/configs/example/lupv/run_lupv.py b/configs/example/lupv/run_lupv.py new file mode 100644 index 000..721adcd --- /dev/null +++ b/configs/example/lupv/run_lupv.py @@ -0,0 +1,112 @@ +# Copyright (c) 2021 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. + +""" +This example runs a simple linux boot. +Characteristics +--- +* Runs exclusively on the RISC-V ISA with the classic caches +* Assumes that the kernel is compiled into the bootloader +* Automatically generates the DTB file +""" + +import m5 +from m5.objects import Root + +from gem5.runtime import get_runtime_isa +from gem5.components.boards.experimental.lupv_board import LupvBoard +from gem5.components.memory.single_channel import SingleChannelDDR3_1600 +from gem5.components.processors.simple_processor import SimpleProcessor +from gem5.components.processors.cpu_types import CPUTypes +from gem5.isas import ISA +from gem5.utils.requires import requires +from gem5.resources.resource import Resource, CustomResource + +import argparse + +# R
[gem5-dev] Change in gem5/gem5[develop]: stdlib: Update the LupvBoard to use KernelDiskWorkload
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53085 ) Change subject: stdlib: Update the LupvBoard to use KernelDiskWorkload .. stdlib: Update the LupvBoard to use KernelDiskWorkload Change-Id: I5857f70e6ca61b8916792e634d20cdf827b21bd0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53085 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/python/gem5/components/boards/experimental/lupv_board.py 1 file changed, 53 insertions(+), 52 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/gem5/components/boards/experimental/lupv_board.py b/src/python/gem5/components/boards/experimental/lupv_board.py index d14326c..d6b1dc5 100644 --- a/src/python/gem5/components/boards/experimental/lupv_board.py +++ b/src/python/gem5/components/boards/experimental/lupv_board.py @@ -25,13 +25,15 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os -from typing import Optional, List +from typing import List from utils.override import overrides from ..abstract_board import AbstractBoard from ...processors.abstract_processor import AbstractProcessor from ...memory.abstract_memory_system import AbstractMemorySystem from ...cachehierarchies.abstract_cache_hierarchy import AbstractCacheHierarchy +from ..kernel_disk_workload import KernelDiskWorkload +from resources.resource import AbstractResource from isas import ISA from utils.requires import requires @@ -71,7 +73,7 @@ FdtState, ) -class LupvBoard(AbstractBoard): +class LupvBoard(AbstractBoard, KernelDiskWorkload): """ A board capable of full system simulation for RISC-V. This board uses a set of LupIO education-friendly devices. @@ -272,56 +274,7 @@ self.mem_ranges = [AddrRange(start=0x8000, size=mem_size)] memory.set_memory_range(self.mem_ranges) -def set_workload( -self, bootloader: str, disk_image: str, command: Optional[str] = None -): -"""Setup the full system files -See https://github.com/darchr/lupio-gem5/blob/lupio/README.md -for running the full system, and downloading the right files to do so. -The command passes in a boot loader and disk image, as well as the -script to start the simulaiton. -After the workload is set up, this function will generate the device -tree file and output it to the output directory. - -**Limitations** -* Only supports a Linux kernel -* Must use the provided bootloader and disk image as denoted in the -README above. -""" -self.workload.object_file = bootloader -# Set the disk image for the block device to use -image = CowDiskImage( -child=RawDiskImage(read_only=True), -read_only=False -) -image.child.image_file = disk_image -self.lupio_blk.image = image - -# Linux boot command flags -kernel_cmd = [ -"earlycon console=ttyLIO0", -"root=/dev/lda1", -"ro" -] -self.workload.command_line = " ".join(kernel_cmd) - -# Note: This must be called after set_workload because it looks for an -# attribute named "disk" and connects -self._setup_io_devices() -self._setup_pma() - -# Default DTB address if bbl is built with --with-dts option -self.workload.dtb_addr = 0x87E0 - -# We need to wait to generate the device tree until after the disk is -# set up. Now that the disk and workload are set, we can generate the -# device tree file. -self.generate_device_tree(m5.options.outdir) -self.workload.dtb_filename = os.path.join( -m5.options.outdir, "device.dtb" -) - -def generate_device_tree(self, outdir: str) -> None: +def _generate_device_tree(self, outdir: str) -> None: """Creates the dtb and dts files. Creates two files in the outdir: 'device.dtb' and 'device.dts' :param outdir: Directory to output the files @@ -564,3 +517,38 @@ fdt.add_rootnode(root) fdt.writeDtsFile(os.path.join(outdir, "device.dts")) fdt.writeDtbFile(os.path.join(outdir, "device.dtb")) + +@overrides(KernelDiskWorkload) +def get_default_kernel_args(self) -> List[str]: +return ["earlycon console=ttyLIO0", "root={root_value}", "ro"] + +@overrides(KernelDiskWorkload) +def get_disk_device(self) -> str: +return "/dev/lda" + +@overrides(KernelDiskWorkload) +def _add_disk_to_board(self, disk_image: AbstractResource) -> None: +# Note: This must be called after set_workload because it looks for an +# attribute named "disk"
[gem5-dev] Change in gem5/gem5[develop]: stdlib: Update the LupvBoard to use 'requires'
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53084 ) Change subject: stdlib: Update the LupvBoard to use 'requires' .. stdlib: Update the LupvBoard to use 'requires' Usage of this function was previously avoided due to a bug which has since been fixed: https://gem5-review.googlesource.com/c/public/gem5/+/53003 Change-Id: Idc76ca26d02dcfbb290cebcca297e50e905d8e6d Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53084 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/python/gem5/components/boards/experimental/lupv_board.py 1 file changed, 21 insertions(+), 7 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/gem5/components/boards/experimental/lupv_board.py b/src/python/gem5/components/boards/experimental/lupv_board.py index e2787d5..d14326c 100644 --- a/src/python/gem5/components/boards/experimental/lupv_board.py +++ b/src/python/gem5/components/boards/experimental/lupv_board.py @@ -33,7 +33,7 @@ from ...memory.abstract_memory_system import AbstractMemorySystem from ...cachehierarchies.abstract_cache_hierarchy import AbstractCacheHierarchy from isas import ISA -from runtime import get_runtime_isa +from utils.requires import requires import m5 from m5.objects import ( @@ -89,15 +89,12 @@ cache_hierarchy: AbstractCacheHierarchy, ) -> None: -super().__init__(clk_freq, processor, memory, cache_hierarchy) -if get_runtime_isa() != ISA.RISCV: -raise EnvironmentError( -"RiscvBoard will only work with the RISC-V ISA. Please" -" recompile gem5 with ISA=RISCV." -) +requires(isa_required=ISA.RISCV) if cache_hierarchy.is_ruby(): raise EnvironmentError("RiscvBoard is not compatible with Ruby") +super().__init__(clk_freq, processor, memory, cache_hierarchy) + @overrides(AbstractBoard) def _setup_board(self) -> None: -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53084 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Idc76ca26d02dcfbb290cebcca297e50e905d8e6d Gerrit-Change-Number: 53084 Gerrit-PatchSet: 11 Gerrit-Owner: Bobby Bruce Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-Reviewer: melissa jost Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new Lupio-IPI device
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53041 ) Change subject: dev: Added new Lupio-IPI device .. dev: Added new Lupio-IPI device Added the LupIO inter-processor interrupt controller device which will allow for us to use an SMP system with the LupIO devices. Change-Id: Iceab7446b36fb4d9b7605f3ba28665fca509d55d Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53041 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- A src/dev/lupio/LupioIPI.py A src/dev/lupio/lupio_ipi.cc A src/dev/lupio/lupio_ipi.hh M src/dev/lupio/SConscript 4 files changed, 261 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/lupio/LupioIPI.py b/src/dev/lupio/LupioIPI.py new file mode 100644 index 000..f74c5c6 --- /dev/null +++ b/src/dev/lupio/LupioIPI.py @@ -0,0 +1,36 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param + +class LupioIPI(BasicPioDevice): +type = 'LupioIPI' +cxx_class='gem5::LupioIPI' +cxx_header = 'dev/lupio/lupio_ipi.hh' +pio_size = Param.Addr(0x1000, "PIO Size") +int_type = Param.Int("Type of interrupt") +num_threads = Param.Int("Number of threads") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index 93600236..47087f0 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -27,6 +27,7 @@ Import('*') SimObject('LupioBLK.py', tags='riscv isa') +SimObject('LupioIPI.py', tags='riscv isa') SimObject('LupioPIC.py', tags='riscv isa') SimObject('LupioRNG.py', tags='riscv isa') SimObject('LupioRTC.py', tags='riscv isa') @@ -34,6 +35,7 @@ SimObject('LupioTTY.py', tags='riscv isa') DebugFlag('LupioBLK') +DebugFlag('LupioIPI') DebugFlag('LupioPIC') DebugFlag('LupioRNG') DebugFlag('LupioRTC') @@ -41,6 +43,7 @@ DebugFlag('LupioTTY') Source('lupio_blk.cc', tags='riscv isa') +Source('lupio_ipi.cc', tags='riscv isa') Source('lupio_pic.cc', tags='riscv isa') Source('lupio_rng.cc', tags='riscv isa') Source('lupio_rtc.cc', tags='riscv isa') diff --git a/src/dev/lupio/lupio_ipi.cc b/src/dev/lupio/lupio_ipi.cc new file mode 100644 index 000..1504275 --- /dev/null +++ b/src/dev/lupio/lupio_ipi.cc @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021 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 M
[gem5-dev] Change in gem5/gem5[develop]: stdlib: Modified LupV Platform + Board to use LupioPIC + TMR
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53037 ) Change subject: stdlib: Modified LupV Platform + Board to use LupioPIC + TMR .. stdlib: Modified LupV Platform + Board to use LupioPIC + TMR This added both the LupioPIC and LupioTMR to the LupVBoard. While both the PLIC and CLINT are left in the board for the bootloader to recognize, they aren't used within the system. In addition, the LupV Platform was changed in order to use the LupioPIC to handle interrupts instead of the PLIC. Change-Id: I57005903a7ec1136b42433ef5022ccb995abb9d6 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53037 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/dev/riscv/lupv.cc M src/dev/riscv/lupv.hh M src/dev/riscv/LupV.py M src/python/gem5/components/boards/lupv_board.py 4 files changed, 104 insertions(+), 13 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/riscv/LupV.py b/src/dev/riscv/LupV.py index d14595e..12273a6 100644 --- a/src/dev/riscv/LupV.py +++ b/src/dev/riscv/LupV.py @@ -31,5 +31,5 @@ type = 'LupV' cxx_header = "dev/riscv/lupv.hh" cxx_class = 'gem5::LupV' -pic = Param.Plic("PIC") +pic = Param.LupioPIC("PIC") uart_int_id = Param.Int("Interrupt ID to be used if the PLIC is used here") diff --git a/src/dev/riscv/lupv.cc b/src/dev/riscv/lupv.cc index 7658b2a..35b8f79 100644 --- a/src/dev/riscv/lupv.cc +++ b/src/dev/riscv/lupv.cc @@ -28,7 +28,7 @@ #include "dev/riscv/lupv.hh" -#include "dev/riscv/plic.hh" +#include "dev/lupio/lupio_pic.hh" #include "params/LupV.hh" namespace gem5 diff --git a/src/dev/riscv/lupv.hh b/src/dev/riscv/lupv.hh index 0f5fc96..129e9d5 100644 --- a/src/dev/riscv/lupv.hh +++ b/src/dev/riscv/lupv.hh @@ -29,8 +29,8 @@ #ifndef __DEV_RISCV_LUPV_HH__ #define __DEV_RISCV_LUPV_HH__ +#include "dev/lupio/lupio_pic.hh" #include "dev/platform.hh" -#include "dev/riscv/plic.hh" #include "params/LupV.hh" namespace gem5 @@ -49,7 +49,7 @@ class LupV : public Platform { public: -Plic *pic; +LupioPIC *pic; int uartIntID; public: diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py index 5fb2b13..00ca934 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/lupv_board.py @@ -48,16 +48,16 @@ Plic, Terminal, LupioBLK, +LupioPIC, LupioRNG, LupioRTC, +LupioTMR, LupioTTY, LupV, AddrRange, CowDiskImage, RawDiskImage, Frequency, -RiscvMmioVirtIO, -VirtIOBlock, Port, ) @@ -99,6 +99,9 @@ # Initialize all the devices that we want to use on this board # Interrupt IDS for PIC Device +self._excep_code = { 'INT_SOFT_SUPER': 1, 'INT_TIMER_SUPER': 5, + 'INT_TIMER_MACHINE': 7, 'INT_EXT_SUPER': 9, + 'INT_EXT_MACHINE': 10 } self._int_ids = { 'TTY': 1, 'BLK': 2, 'RNG': 3} # CLINT @@ -107,9 +110,15 @@ # PLIC self.pic = Plic(pio_addr=0xc00) +# LUPIO PIC +self.lupio_pic = LupioPIC( +pio_addr=0x20002000, +int_type = self._excep_code['INT_EXT_SUPER'] +) + #LupV Platform self.lupv = LupV( -pic = self.pic, +pic = self.lupio_pic, uart_int_id = self._int_ids['TTY'] ) @@ -130,6 +139,12 @@ # LUPIO RTC self.lupio_rtc = LupioRTC(pio_addr=0x20004000) +# LUPIO TMR +self.lupio_tmr = LupioTMR( +pio_addr=0x20006000, +int_type = self._excep_code['INT_TIMER_SUPER'] +) + # LUPIO TTY self.lupio_tty = LupioTTY( pio_addr=0x20007000, @@ -143,9 +158,18 @@ self._int_ids['BLK'], self._int_ids['RNG'] ] -self.pic.n_contexts = self.processor.get_num_cores() * 2 -self.pic.n_src = max(pic_srcs) + 1 +# Set the number of sources to the PIC as 0 because we've removed the +# connections from all the external devices to the PIC, and moved them +# to the LupioPIC. The PIC and CLINT only remain on the board at this +# point for our bbl to use upon startup, and will +# remain unused during the simulation +self.pic.n_src = 0 +self.pic.n_contexts = 0 +self.lupio_pic.n_src = max(pic_srcs) + 1 +self.lupio_pic.num_threads = self.processor.get_num_cores() + +self.lupio_tmr.num_threads = self.processor.get_num_cores() self.clint.num_threads = self.processor.get_num_cores() # Add the RTC @@ -159,6 +183,8 @@ self._on_chip_devices = [ sel
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new LupIO-PIC device
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53036 ) Change subject: dev: Added new LupIO-PIC device .. dev: Added new LupIO-PIC device This device is a virtual programmable interrupt controller, and it manages interrupt requests from up to 32 sources. It is implemented as a BasicPioDevice. The following are the specifications regarding the LupIO-PIC: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-pic.md Change-Id: I9ccdb607789f62cc89bdd7392d8e59c8e5c24797 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53036 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- A src/dev/lupio/lupio_pic.cc A src/dev/lupio/lupio_pic.hh A src/dev/lupio/LupioPIC.py M src/dev/lupio/SConscript 4 files changed, 328 insertions(+), 1 deletion(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/lupio/LupioPIC.py b/src/dev/lupio/LupioPIC.py new file mode 100644 index 000..992501b --- /dev/null +++ b/src/dev/lupio/LupioPIC.py @@ -0,0 +1,38 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param + +class LupioPIC(BasicPioDevice): + +type = 'LupioPIC' +cxx_class='gem5::LupioPIC' +cxx_header = 'dev/lupio/lupio_pic.hh' +pio_size = Param.Addr(0x1000, "PIO Size") +n_src = Param.Int("Number of interrupt sources") +num_threads = Param.Int("Number of threads") +int_type = Param.Int("Type of interrupt") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index 1eb0187..93600236 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -27,19 +27,22 @@ Import('*') SimObject('LupioBLK.py', tags='riscv isa') +SimObject('LupioPIC.py', tags='riscv isa') SimObject('LupioRNG.py', tags='riscv isa') SimObject('LupioRTC.py', tags='riscv isa') SimObject('LupioTMR.py', tags='riscv isa') SimObject('LupioTTY.py', tags='riscv isa') DebugFlag('LupioBLK') +DebugFlag('LupioPIC') DebugFlag('LupioRNG') DebugFlag('LupioRTC') DebugFlag('LupioTMR') DebugFlag('LupioTTY') Source('lupio_blk.cc', tags='riscv isa') +Source('lupio_pic.cc', tags='riscv isa') Source('lupio_rng.cc', tags='riscv isa') Source('lupio_rtc.cc', tags='riscv isa') Source('lupio_tmr.cc', tags='riscv isa') -Source('lupio_tty.cc', tags='riscv isa') \ No newline at end of file +Source('lupio_tty.cc', tags='riscv isa') diff --git a/src/dev/lupio/lupio_pic.cc b/src/dev/lupio/lupio_pic.cc new file mode 100644 index 000..010a5d8 --- /dev/null +++ b/src/dev/lupio/lupio_pic.cc @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2021 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
[gem5-dev] Change in gem5/gem5[develop]: dev: Modify LupIO-TMR for SMP support
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53039 ) Change subject: dev: Modify LupIO-TMR for SMP support .. dev: Modify LupIO-TMR for SMP support Added a new LupioTimer struct, as well as a timer event function for SMP support. Change-Id: Idbcc549dfa3c5f8d5342d7e2250337a7482a1ac0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53039 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/dev/lupio/lupio_tmr.cc M src/dev/lupio/lupio_tmr.hh M src/dev/lupio/lupio_pic.cc M src/dev/lupio/lupio_pic.hh 4 files changed, 136 insertions(+), 72 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/lupio/lupio_pic.cc b/src/dev/lupio/lupio_pic.cc index 010a5d8..d83ffcf 100644 --- a/src/dev/lupio/lupio_pic.cc +++ b/src/dev/lupio/lupio_pic.cc @@ -34,8 +34,6 @@ #include "params/LupioPIC.hh" #include "sim/system.hh" -#define LUPIO_PIC_NSRC 32 - namespace gem5 { @@ -44,23 +42,26 @@ system(params.system), nSrc(params.n_src), nThread(params.num_threads), -intType(params.int_type) +intType(params.int_type), +mask{0}, +enable{0} { +// CPU0 receives all IRQ sources by default +enable[0] = 0x; DPRINTF(LupioPIC, "LupioPIC initalized\n"); } void LupioPIC::lupioPicUpdateIRQ() { -if (nThread > 1 ) { -panic("This device currently does not have SMP support\n"); -} +for (int cpu = 0; cpu < nThread; cpu++) { +auto tc = system->threads[cpu]; -auto tc = system->threads[0]; -if (pending & mask) { -tc->getCpuPtr()->postInterrupt(tc->threadId(), intType, 0); -} else { -tc->getCpuPtr()->clearInterrupt(tc->threadId(), intType, 0); +if (enable[cpu] & mask[cpu] & pending) { +tc->getCpuPtr()->postInterrupt(tc->threadId(), intType, 0); +} else { +tc->getCpuPtr()->clearInterrupt(tc->threadId(), intType, 0); +} } } @@ -89,20 +90,26 @@ { uint32_t r = 0; -switch (addr >> 2) { +int cpu = addr >> LUPIO_PIC_MAX; +int reg = (addr >> 2) & (LUPIO_PIC_MAX - 1); + +switch (reg) { case LUPIO_PIC_PRIO: // Value will be 32 if there is no unmasked pending IRQ -r = ctz32(pending & mask); +r = ctz32(pending & mask[cpu] & enable[cpu]); DPRINTF(LupioPIC, "Read PIC_PRIO: %d\n", r); break; case LUPIO_PIC_MASK: -r = mask; +r = mask[cpu]; DPRINTF(LupioPIC, "Read PIC_MASK: %d\n", r); break; case LUPIO_PIC_PEND: - r = pending; +r = (enable[cpu] & pending); DPRINTF(LupioPIC, "Read PIC_PEND: %d\n", r); break; + case LUPIO_PIC_ENAB: +r = enable[cpu]; +break; default: panic("Unexpected read to the LupioPIC device at address %#llx!", @@ -117,10 +124,18 @@ { uint32_t val = val64; -switch (addr >> 2) { +int cpu = addr >> LUPIO_PIC_MAX; +int reg = (addr >> 2) & (LUPIO_PIC_MAX - 1); + +switch (reg) { case LUPIO_PIC_MASK: -mask = val; -DPRINTF(LupioPIC, "Write PIC_MASK: %d\n", mask); +mask[cpu] = val; +DPRINTF(LupioPIC, "Write PIC_MASK: %d\n", mask[cpu]); +lupioPicUpdateIRQ(); +break; +case LUPIO_PIC_ENAB: +enable[cpu] = val; +DPRINTF(LupioPIC, "Write PIC_ENAB: %d\n", enable[cpu]); lupioPicUpdateIRQ(); break; diff --git a/src/dev/lupio/lupio_pic.hh b/src/dev/lupio/lupio_pic.hh index 2ed1d17..ce4815c 100644 --- a/src/dev/lupio/lupio_pic.hh +++ b/src/dev/lupio/lupio_pic.hh @@ -35,6 +35,8 @@ #include "params/LupioPIC.hh" #include "sim/system.hh" +#define LUPIO_PIC_NSRC 32 + namespace gem5 { @@ -62,13 +64,18 @@ LUPIO_PIC_PRIO, LUPIO_PIC_MASK, LUPIO_PIC_PEND, +LUPIO_PIC_ENAB, // Max offset LUPIO_PIC_MAX, }; uint32_t pending = 0; -uint32_t mask = 0; +// Register for masking or unmasking up to 32 sources +uint32_t mask[LUPIO_PIC_NSRC]; +// Regitser to determine which input IRQ is routed to the +// corresponding processor +uint32_t enable[LUPIO_PIC_NSRC]; protected: /** diff --git a/src/dev/lupio/lupio_tmr.cc b/src/dev/lupio/lupio_tmr.cc index b440015..63c0021 100644 --- a/src/dev/lupio/lupio_tmr.cc +++ b/src/dev/lupio/lupio_tmr.cc @@ -34,11 +34,11 @@ #include "params/LupioTMR.hh" // Specific fields for CTRL -#define LUPIO_TMR_IE0x1 -#define LUPIO_TMR_PD0x2 +#define LUPIO_TMR_IRQE0x1 +#define LUPIO_TMR_PRDC0x2 // Specific fields for STAT -#define LUPIO_TMR_EX0x1 +#define
[gem5-dev] Change in gem5/gem5[develop]: stdlib: Moved LupV Board to an experimental folder
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53045 ) Change subject: stdlib: Moved LupV Board to an experimental folder .. stdlib: Moved LupV Board to an experimental folder Change-Id: I9cd67177fe8f0cb34bebb4fd3f9d3af0a518c7b6 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53045 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/python/SConscript R src/python/gem5/components/boards/experimental/lupv_board.py A src/python/gem5/components/boards/experimental/__init__.py 3 files changed, 27 insertions(+), 11 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/SConscript b/src/python/SConscript index 90ac7cd..dd02dd3 100644 --- a/src/python/SConscript +++ b/src/python/SConscript @@ -37,7 +37,10 @@ PySource('gem5.components.boards', 'gem5/components/boards/abstract_board.py') PySource('gem5.components.boards', 'gem5/components/boards/mem_mode.py') PySource('gem5.components.boards', 'gem5/components/boards/riscv_board.py') -PySource('gem5.components.boards', 'gem5/components/boards/lupv_board.py') +PySource('gem5.components.boards.experimental', +'gem5/components/boards/experimental/__init__.py') +PySource('gem5.components.boards.experimental', +'gem5/components/boards/experimental/lupv_board.py') PySource('gem5.components.boards', 'gem5/components/boards/simple_board.py') PySource('gem5.components.boards', 'gem5/components/boards/test_board.py') PySource('gem5.components.boards', 'gem5/components/boards/x86_board.py') diff --git a/src/python/gem5/components/boards/experimental/__init__.py b/src/python/gem5/components/boards/experimental/__init__.py new file mode 100644 index 000..e69de29 --- /dev/null +++ b/src/python/gem5/components/boards/experimental/__init__.py diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/experimental/lupv_board.py similarity index 97% rename from src/python/gem5/components/boards/lupv_board.py rename to src/python/gem5/components/boards/experimental/lupv_board.py index c6073a8..28aa209 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/experimental/lupv_board.py @@ -27,14 +27,14 @@ import os from typing import Optional -from ...utils.override import overrides -from .simple_board import SimpleBoard -from .abstract_board import AbstractBoard -from ..processors.abstract_processor import AbstractProcessor -from ..memory.abstract_memory_system import AbstractMemorySystem -from ..cachehierarchies.abstract_cache_hierarchy import AbstractCacheHierarchy -from ...isas import ISA -from ...runtime import get_runtime_isa +from utils.override import overrides +from ..simple_board import SimpleBoard +from ..abstract_board import AbstractBoard +from ...processors.abstract_processor import AbstractProcessor +from ...memory.abstract_memory_system import AbstractMemorySystem +from ...cachehierarchies.abstract_cache_hierarchy import AbstractCacheHierarchy +from isas import ISA +from runtime import get_runtime_isa import m5 from m5.objects import ( @@ -173,10 +173,10 @@ self._int_ids['RNG'] ] -# Set the number of sources to the PIC as 0 because we've removed the +# Set the number of sources to the PIC as 0 because we've removed the # connections from all the external devices to the PIC, and moved them # to the LupioPIC. The PIC and CLINT only remain on the board at this -# point for our bbl to use upon startup, and will +# point for our bbl to use upon startup, and will # remain unused during the simulation self.pic.n_src = 0 self.pic.n_contexts = 0 -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53045 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I9cd67177fe8f0cb34bebb4fd3f9d3af0a518c7b6 Gerrit-Change-Number: 53045 Gerrit-PatchSet: 11 Gerrit-Owner: melissa jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-Reviewer: melissa jost Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new Lupio-SYS device
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53043 ) Change subject: dev: Added new Lupio-SYS device .. dev: Added new Lupio-SYS device This adds the LupIO system controller, in which we provide a way to halt or reboot the system. It is implemented as a BasicPIODevice. Change-Id: I0031ac65d2aaca3460dcd4c59543a75230b0b52a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53043 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- A src/dev/lupio/lupio_sys.cc A src/dev/lupio/lupio_sys.hh A src/dev/lupio/LupioSYS.py M src/dev/lupio/SConscript 4 files changed, 234 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/lupio/LupioSYS.py b/src/dev/lupio/LupioSYS.py new file mode 100644 index 000..d300e91 --- /dev/null +++ b/src/dev/lupio/LupioSYS.py @@ -0,0 +1,34 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param + +class LupioSYS(BasicPioDevice): +type = 'LupioSYS' +cxx_class='gem5::LupioSYS' +cxx_header = 'dev/lupio/lupio_sys.hh' +pio_size = Param.Addr(0x1000, "PIO Size") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index 47087f0..82fb81e 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -33,6 +33,7 @@ SimObject('LupioRTC.py', tags='riscv isa') SimObject('LupioTMR.py', tags='riscv isa') SimObject('LupioTTY.py', tags='riscv isa') +SimObject('LupioSYS.py', tags='riscv isa') DebugFlag('LupioBLK') DebugFlag('LupioIPI') @@ -41,6 +42,7 @@ DebugFlag('LupioRTC') DebugFlag('LupioTMR') DebugFlag('LupioTTY') +DebugFlag('LupioSYS') Source('lupio_blk.cc', tags='riscv isa') Source('lupio_ipi.cc', tags='riscv isa') @@ -49,3 +51,4 @@ Source('lupio_rtc.cc', tags='riscv isa') Source('lupio_tmr.cc', tags='riscv isa') Source('lupio_tty.cc', tags='riscv isa') +Source('lupio_sys.cc', tags='riscv isa') diff --git a/src/dev/lupio/lupio_sys.cc b/src/dev/lupio/lupio_sys.cc new file mode 100644 index 000..0596b0e --- /dev/null +++ b/src/dev/lupio/lupio_sys.cc @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2021 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 DIRE
[gem5-dev] Change in gem5/gem5[develop]: stdlib: Update the LupvBoard to account for stdlib changes
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53083 ) Change subject: stdlib: Update the LupvBoard to account for stdlib changes .. stdlib: Update the LupvBoard to account for stdlib changes This patch updates the board to account for the following changes: * https://gem5-review.googlesource.com/c/public/gem5/+/51790 * https://gem5-review.googlesource.com/c/public/gem5/+/52184 * https://gem5-review.googlesource.com/c/public/gem5/+/52183 These changes, broadly speaking, remove the SimpeBoard as a superclass and instead have all the boards inherit directly from the AbstractBoard. It also fixes the order of operations (the order in which components are incorporated and the board it setup). Change-Id: I829ed515da28163cafbd292a9c141be4d350636e Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53083 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/python/gem5/components/boards/experimental/lupv_board.py 1 file changed, 43 insertions(+), 4 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/gem5/components/boards/experimental/lupv_board.py b/src/python/gem5/components/boards/experimental/lupv_board.py index 28aa209..e2787d5 100644 --- a/src/python/gem5/components/boards/experimental/lupv_board.py +++ b/src/python/gem5/components/boards/experimental/lupv_board.py @@ -25,10 +25,9 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os -from typing import Optional +from typing import Optional, List from utils.override import overrides -from ..simple_board import SimpleBoard from ..abstract_board import AbstractBoard from ...processors.abstract_processor import AbstractProcessor from ...memory.abstract_memory_system import AbstractMemorySystem @@ -72,7 +71,7 @@ FdtState, ) -class LupvBoard(SimpleBoard): +class LupvBoard(AbstractBoard): """ A board capable of full system simulation for RISC-V. This board uses a set of LupIO education-friendly devices. @@ -89,6 +88,7 @@ memory: AbstractMemorySystem, cache_hierarchy: AbstractCacheHierarchy, ) -> None: + super().__init__(clk_freq, processor, memory, cache_hierarchy) if get_runtime_isa() != ISA.RISCV: raise EnvironmentError( @@ -97,6 +97,10 @@ ) if cache_hierarchy.is_ruby(): raise EnvironmentError("RiscvBoard is not compatible with Ruby") + +@overrides(AbstractBoard) +def _setup_board(self) -> None: + self.workload = RiscvLinux() # Initialize all the devices that we want to use on this board @@ -240,6 +244,17 @@ ) @overrides(AbstractBoard) +def has_dma_ports(self) -> bool: +return False + +@overrides(AbstractBoard) +def get_dma_ports(self) -> List[Port]: +raise NotImplementedError( +"The LupvBoard does not have DMA Ports. " +"Use `has_dma_ports()` to check this." +) + +@overrides(AbstractBoard) def has_io_bus(self) -> bool: return True @@ -254,7 +269,7 @@ return self.iobus.mem_side_ports @overrides(AbstractBoard) -def setup_memory_ranges(self): +def _setup_memory_ranges(self): memory = self.get_memory() mem_size = memory.get_size() self.mem_ranges = [AddrRange(start=0x8000, size=mem_size)] -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53083 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I829ed515da28163cafbd292a9c141be4d350636e Gerrit-Change-Number: 53083 Gerrit-PatchSet: 11 Gerrit-Owner: Bobby Bruce Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-Reviewer: melissa jost Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: stdlib: Added LupIO-IPI to the LupV Board
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53042 ) Change subject: stdlib: Added LupIO-IPI to the LupV Board .. stdlib: Added LupIO-IPI to the LupV Board This adds the LupioIPI device to our LupV Board, which finalizes the changes needed for the LupIO devices to run with SMP support. Change-Id: I3e51dae6d8d589d3b38c57c33322e740c832a03d Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53042 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/python/gem5/components/boards/lupv_board.py 1 file changed, 46 insertions(+), 2 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py index 00ca934..11a9ebc 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/lupv_board.py @@ -48,6 +48,7 @@ Plic, Terminal, LupioBLK, +LupioIPI, LupioPIC, LupioRNG, LupioRTC, @@ -110,10 +111,18 @@ # PLIC self.pic = Plic(pio_addr=0xc00) +# LUPIO IPI +self.lupio_ipi = LupioIPI( +pio_addr=0x20001000, +int_type=self._excep_code['INT_SOFT_SUPER'], +num_threads = self.processor.get_num_cores() +) + # LUPIO PIC self.lupio_pic = LupioPIC( pio_addr=0x20002000, -int_type = self._excep_code['INT_EXT_SUPER'] +int_type = self._excep_code['INT_EXT_SUPER'], +num_threads = self.processor.get_num_cores() ) #LupV Platform @@ -142,7 +151,8 @@ # LUPIO TMR self.lupio_tmr = LupioTMR( pio_addr=0x20006000, -int_type = self._excep_code['INT_TIMER_SUPER'] +int_type = self._excep_code['INT_TIMER_SUPER'], +num_threads = self.processor.get_num_cores() ) # LUPIO TTY @@ -183,6 +193,7 @@ self._on_chip_devices = [ self.clint, self.pic, +self.lupio_ipi, self.lupio_pic, self.lupio_tmr ] @@ -423,6 +434,22 @@ soc_node.append(plic_node) +# LupioIPI Device +lupio_ipi = self.lupio_ipi +lupio_ipi_node = lupio_ipi.generateBasicPioDeviceNode(soc_state, +"lupio-ipi", lupio_ipi.pio_addr, +lupio_ipi.pio_size) +int_extended = list() +for i, core in enumerate(self.get_processor().get_cores()): +phandle = state.phandle(f"cpu@{i}.int_state") +int_extended.append(phandle) +int_extended.append(self._excep_code['INT_SOFT_SUPER']) +lupio_ipi_node.append( +FdtPropertyWords("interrupts-extended", int_extended)) +lupio_ipi_node.append(FdtProperty("interrupt-controller")) +lupio_ipi_node.appendCompatible(["lupio,ipi"]) +soc_node.append(lupio_ipi_node) + # LupioPIC Device lupio_pic = self.lupio_pic lupio_pic_node = lupio_pic.generateBasicPioDeviceNode(soc_state, -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53042 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I3e51dae6d8d589d3b38c57c33322e740c832a03d Gerrit-Change-Number: 53042 Gerrit-PatchSet: 11 Gerrit-Owner: melissa jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-Reviewer: melissa jost Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: stdlib: Added Lupio-SYS device to LupV Board
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53044 ) Change subject: stdlib: Added Lupio-SYS device to LupV Board .. stdlib: Added Lupio-SYS device to LupV Board This adds the Lupio-SYS device to the LupV Board, which finalizes all of the devices needed to complete the LupIO device collection within gem5. Change-Id: I5af34d8c2735d74f4240d3077ed162dd25f2bcb2 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53044 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/python/gem5/components/boards/lupv_board.py 1 file changed, 46 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py index 11a9ebc..c6073a8 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/lupv_board.py @@ -54,6 +54,7 @@ LupioRTC, LupioTMR, LupioTTY, +LupioSYS, LupV, AddrRange, CowDiskImage, @@ -148,6 +149,9 @@ # LUPIO RTC self.lupio_rtc = LupioRTC(pio_addr=0x20004000) +#LUPIO SYS +self.lupio_sys = LupioSYS(pio_addr= 0x20003000) + # LUPIO TMR self.lupio_tmr = LupioTMR( pio_addr=0x20006000, @@ -200,6 +204,7 @@ self._off_chip_devices = [ self.lupio_blk, self.lupio_tty, +self.lupio_sys, self.lupio_rng, self.lupio_rtc ] @@ -265,6 +270,7 @@ script to start the simulaiton. After the workload is set up, this function will generate the device tree file and output it to the output directory. + **Limitations** * Only supports a Linux kernel * Must use the provided bootloader and disk image as denoted in the @@ -497,6 +503,29 @@ state.phandle(self.lupio_pic))) soc_node.append(lupio_rng_node) +#LupioSYS Device +lupio_sys = self.lupio_sys +lupio_sys_node = lupio_sys.generateBasicPioDeviceNode(soc_state, +"lupio-sys", lupio_sys.pio_addr, lupio_sys.pio_size) +lupio_sys_node.appendCompatible(["syscon"]) +sys_phandle = state.phandle(self.lupio_sys) +lupio_sys_node.append(FdtPropertyWords("phandle", [sys_phandle])) +soc_node.append(lupio_sys_node) + +poweroff_node = FdtNode("poweroff") +poweroff_node.appendCompatible(["syscon-poweroff"]) +poweroff_node.append(FdtPropertyWords("regmap", [sys_phandle])) +poweroff_node.append(FdtPropertyWords("offset", [0x0])) +poweroff_node.append(FdtPropertyWords("value", [1])) +soc_node.append(poweroff_node) + +reboot_node = FdtNode("reboot") +reboot_node.appendCompatible(["syscon-reboot"]) +reboot_node.append(FdtPropertyWords("regmap", [sys_phandle])) +reboot_node.append(FdtPropertyWords("offset", [0x4])) +reboot_node.append(FdtPropertyWords("value", [1])) +soc_node.append(reboot_node) + # LupioRTC Device lupio_rtc = self.lupio_rtc lupio_rtc_node = lupio_rtc.generateBasicPioDeviceNode( -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53044 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I5af34d8c2735d74f4240d3077ed162dd25f2bcb2 Gerrit-Change-Number: 53044 Gerrit-PatchSet: 11 Gerrit-Owner: melissa jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-Reviewer: melissa jost Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: dev: Modified LupioBLK and LupioTTY to use LupioPIC
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53038 ) Change subject: dev: Modified LupioBLK and LupioTTY to use LupioPIC .. dev: Modified LupioBLK and LupioTTY to use LupioPIC This replaced the PLIC device within the LupioBLK and LupioTTY with the LupioPIC, so that interrupts now go through the LupioPIC, and the PLIC isn't used anymore. Change-Id: I0eb5d5c5df9cb43cfb5e8e3a5bf4176f48320696 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53038 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/dev/lupio/lupio_tty.hh M src/dev/lupio/lupio_blk.hh 2 files changed, 19 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/lupio/lupio_blk.hh b/src/dev/lupio/lupio_blk.hh index c767ad1..4e56164 100644 --- a/src/dev/lupio/lupio_blk.hh +++ b/src/dev/lupio/lupio_blk.hh @@ -32,6 +32,7 @@ #include "debug/LupioBLK.hh" #include "dev/dma_device.hh" #include "dev/io_device.hh" +#include "dev/lupio/lupio_pic.hh" #include "dev/platform.hh" #include "dev/storage/disk_image.hh" #include "params/LupioBLK.hh" diff --git a/src/dev/lupio/lupio_tty.hh b/src/dev/lupio/lupio_tty.hh index 1124193..e971a9f 100644 --- a/src/dev/lupio/lupio_tty.hh +++ b/src/dev/lupio/lupio_tty.hh @@ -30,6 +30,7 @@ #define __LUPIO_TTY_HH__ #include "dev/io_device.hh" +#include "dev/lupio/lupio_pic.hh" #include "dev/platform.hh" #include "dev/serial/serial.hh" #include "params/LupioTTY.hh" -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53038 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I0eb5d5c5df9cb43cfb5e8e3a5bf4176f48320696 Gerrit-Change-Number: 53038 Gerrit-PatchSet: 11 Gerrit-Owner: melissa jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-Reviewer: melissa jost Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new Lupio-BLK Device
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53033 ) Change subject: dev: Added new Lupio-BLK Device .. dev: Added new Lupio-BLK Device This is a virtual block device that provides a disk-like interface for second level storage. It is implemented as a DMADevice, and allows for the transfer of blocks from the block device to main memory, and vice versa. The following are the specifications regarding the LupIO-BLK: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-blk.md Change-Id: Ifabc9b715fadb218e84952694d666b803e46e1f7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53033 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- A src/dev/lupio/LupioBLK.py A src/dev/lupio/lupio_blk.cc A src/dev/lupio/lupio_blk.hh M src/dev/lupio/SConscript 4 files changed, 421 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/lupio/LupioBLK.py b/src/dev/lupio/LupioBLK.py new file mode 100644 index 000..fc3479f --- /dev/null +++ b/src/dev/lupio/LupioBLK.py @@ -0,0 +1,43 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import DmaDevice + +from m5.params import Param +from m5.proxy import Parent + +class LupioBLK(DmaDevice): + +type = 'LupioBLK' +cxx_class='gem5::LupioBLK' +cxx_header = 'dev/lupio/lupio_blk.hh' +pio_size = Param.Addr(0x1000, "PIO Size") +image = Param.DiskImage("Disk image") +pio_addr = Param.Addr("Device Address") +latency = Param.Latency('0ns', "DMA Device Latency") +platform = Param.Platform(Parent.any, + "Platform this device is part of.") +int_id = Param.Int("Interrupt ID for the PIC to use") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index c5d6b8f..1ea8a82 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -26,14 +26,17 @@ Import('*') +SimObject('LupioBLK.py', tags='riscv isa') SimObject('LupioRNG.py', tags='riscv isa') SimObject('LupioRTC.py', tags='riscv isa') SimObject('LupioTTY.py', tags='riscv isa') +DebugFlag('LupioBLK') DebugFlag('LupioRNG') DebugFlag('LupioRTC') DebugFlag('LupioTTY') +Source('lupio_blk.cc', tags='riscv isa') Source('lupio_rng.cc', tags='riscv isa') Source('lupio_rtc.cc', tags='riscv isa') Source('lupio_tty.cc', tags='riscv isa') diff --git a/src/dev/lupio/lupio_blk.cc b/src/dev/lupio/lupio_blk.cc new file mode 100644 index 000..796c71c --- /dev/null +++ b/src/dev/lupio/lupio_blk.cc @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2021 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 f
[gem5-dev] Change in gem5/gem5[develop]: stdlib: Added LupioBLK Device to LupVBoard
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53034 ) Change subject: stdlib: Added LupioBLK Device to LupVBoard .. stdlib: Added LupioBLK Device to LupVBoard This adds the LupioBLK device to the growing LupVBoard, as well as removes the VirtIOMMIO Device from the board. Change-Id: Ibb45ecff07c7ce5d5d7be8cd8e20e9f62b591b02 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53034 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/python/gem5/components/boards/lupv_board.py 1 file changed, 43 insertions(+), 24 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py index 932fcd7..5fb2b13 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/lupv_board.py @@ -47,6 +47,7 @@ Clint, Plic, Terminal, +LupioBLK, LupioRNG, LupioRTC, LupioTTY, @@ -98,7 +99,7 @@ # Initialize all the devices that we want to use on this board # Interrupt IDS for PIC Device -self._int_ids = { 'TTY': 1, 'DISK': 2, 'RNG': 3} +self._int_ids = { 'TTY': 1, 'BLK': 2, 'RNG': 3} # CLINT self.clint = Clint(pio_addr=0x200) @@ -112,6 +113,13 @@ uart_int_id = self._int_ids['TTY'] ) +# LUPIO BLK +self.lupio_blk = LupioBLK( +pio_addr=0x2000, +platform = self.lupv, +int_id = self._int_ids['BLK'] +) + # LUPIO RNG self.lupio_rng = LupioRNG( pio_addr=0x20005000, @@ -122,14 +130,6 @@ # LUPIO RTC self.lupio_rtc = LupioRTC(pio_addr=0x20004000) -# VirtIO Disk -self.disk = RiscvMmioVirtIO( -vio=VirtIOBlock(), -interrupt_id=self._int_ids['DISK'], -pio_size=4096, -pio_addr=0x10008000, -) - # LUPIO TTY self.lupio_tty = LupioTTY( pio_addr=0x20007000, @@ -140,7 +140,7 @@ pic_srcs = [ self._int_ids['TTY'], -self._int_ids['DISK'], +self._int_ids['BLK'], self._int_ids['RNG'] ] self.pic.n_contexts = self.processor.get_num_cores() * 2 @@ -161,8 +161,8 @@ self.pic, ] self._off_chip_devices = [ +self.lupio_blk, self.lupio_tty, -self.disk, self.lupio_rng, self.lupio_rtc ] @@ -171,6 +171,7 @@ """Connect the I/O devices to the I/O bus""" for device in self._off_chip_devices: device.pio = self.iobus.mem_side_ports +self.lupio_blk.dma = self.iobus.cpu_side_ports for device in self._on_chip_devices: device.pio = self.get_cache_hierarchy().get_mem_side_port() @@ -239,12 +240,12 @@ read_only=False ) image.child.image_file = disk_image -self.disk.vio.image = image +self.lupio_blk.image = image # Linux boot command flags kernel_cmd = [ "earlycon console=ttyLIO0", -"root=/dev/vda1", +"root=/dev/lda1", "ro" ] self.workload.command_line = " ".join(kernel_cmd) @@ -370,17 +371,19 @@ soc_node.append(plic_node) -# VirtIO MMIO disk node -disk = self.disk -disk_node = disk.generateBasicPioDeviceNode( -soc_state, "virtio_mmio", disk.pio_addr, disk.pio_size -) -disk_node.append(FdtPropertyWords("interrupts", [disk.interrupt_id])) -disk_node.append( -FdtPropertyWords("interrupt-parent", soc_state.phandle(plic)) -) -disk_node.appendCompatible(["virtio,mmio"]) -soc_node.append(disk_node) +# LupioBLK Device +lupio_blk = self.lupio_blk +lupio_blk_node = lupio_blk.generateBasicPioDeviceNode(soc_state, +"lupio-blk", lupio_blk.pio_addr, +lupio_blk.pio_size) +lupio_blk_node.appendCompatible(["lupio,blk"]) +lupio_blk_node.append( +FdtPropertyWords("interrupts", +[self.lupio_blk.int_id])) +lupio_blk_node.append( +FdtPropertyWords("interrupt-parent", +state.phandle(self.pic))) +soc_node.append(lupio_blk_node) # LupioRNG Device lupio_rng = self.lupio_rng -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53034 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Chan
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new LupIO-RTC device
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53026 ) Change subject: dev: Added new LupIO-RTC device .. dev: Added new LupIO-RTC device This device supplies the computer system with the simulated time by retrieving the current tick number and converting to seconds, then returning that time in ISO 8601 format. It is implemented as a BasicPioDevice and is read-only. The following are the specifications regarding the LupIO-RTC: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-rtc.md Change-Id: Ic99291e5c862e728dac90b15ca818d42f25cbbee Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53026 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- A src/dev/lupio/lupio_rtc.cc A src/dev/lupio/lupio_rtc.hh A src/dev/lupio/SConscript A src/dev/lupio/LupioRTC.py 4 files changed, 302 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/lupio/LupioRTC.py b/src/dev/lupio/LupioRTC.py new file mode 100644 index 000..8392e65 --- /dev/null +++ b/src/dev/lupio/LupioRTC.py @@ -0,0 +1,35 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param + +class LupioRTC(BasicPioDevice): +type = 'LupioRTC' +cxx_class='gem5::LupioRTC' +cxx_header = 'dev/lupio/lupio_rtc.hh' +time = Param.Time('01/01/2020', "Initial system time to use") +pio_size = Param.Addr(0x1000, "PIO Size") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript new file mode 100644 index 000..30fbbe0 --- /dev/null +++ b/src/dev/lupio/SConscript @@ -0,0 +1,33 @@ +# Copyright (c) 2021 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. + +Import('*') + +SimObject('LupioRTC.py', tags='riscv isa
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new LupIO-RNG device
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53029 ) Change subject: dev: Added new LupIO-RNG device .. dev: Added new LupIO-RNG device This device is a random number generator that uses the Mersenne Twister in order to provide the system with a set of random numbers. It is implemented as a BasicPioDevice, and has both read and write capabilities. The following are the specifications regarding the LupIO-RNG: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-rng.md Change-Id: Ia6aeb610ebe5589ed1f1548b823c5165236b03e6 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53029 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- A src/dev/lupio/LupioRNG.py A src/dev/lupio/lupio_rng.cc A src/dev/lupio/lupio_rng.hh M src/dev/lupio/SConscript 4 files changed, 291 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/lupio/LupioRNG.py b/src/dev/lupio/LupioRNG.py new file mode 100644 index 000..c6d2c17 --- /dev/null +++ b/src/dev/lupio/LupioRNG.py @@ -0,0 +1,40 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param +from m5.proxy import Parent + +class LupioRNG(BasicPioDevice): + +type = 'LupioRNG' +cxx_class='gem5::LupioRNG' +cxx_header = 'dev/lupio/lupio_rng.hh' +pio_size = Param.Addr(0x1000, "PIO Size") +seed = Param.Int(0, "Initial seed for the random number generator") +platform = Param.Platform(Parent.any, + "Platform this device is part of.") +int_id = Param.Int("Interrupt ID to be used by the PIC") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index 30fbbe0..775412c 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -27,7 +27,10 @@ Import('*') SimObject('LupioRTC.py', tags='riscv isa') +SimObject('LupioRNG.py', tags='riscv isa') +DebugFlag('LupioRNG') DebugFlag('LupioRTC') Source('lupio_rtc.cc', tags='riscv isa') +Source('lupio_rng.cc', tags='riscv isa') diff --git a/src/dev/lupio/lupio_rng.cc b/src/dev/lupio/lupio_rng.cc new file mode 100644 index 000..f3036de --- /dev/null +++ b/src/dev/lupio/lupio_rng.cc @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2021 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 +
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new LupIO-TTY device
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53031 ) Change subject: dev: Added new LupIO-TTY device .. dev: Added new LupIO-TTY device This device is notfied when data is available from the terminal (e.g. from keyboard input) in order to receive characters. It also transmits characters to the terminal to be displayed. The following are the specifications regarding the LupIO-TTY: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-tty.md Change-Id: Icc8294984989cfa422d8ed227da39debfa49ab36 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53031 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- A src/dev/lupio/lupio_tty.cc A src/dev/lupio/lupio_tty.hh A src/dev/lupio/LupioTTY.py M src/dev/lupio/SConscript 4 files changed, 358 insertions(+), 2 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/lupio/LupioTTY.py b/src/dev/lupio/LupioTTY.py new file mode 100644 index 000..972311f --- /dev/null +++ b/src/dev/lupio/LupioTTY.py @@ -0,0 +1,40 @@ +# Copyright (c) 2021 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. + +from m5.params import Param +from m5.proxy import Parent + +from m5.objects.Device import BasicPioDevice + +class LupioTTY(BasicPioDevice): +type = 'LupioTTY' +cxx_class = 'gem5::LupioTTY' +cxx_header = "dev/lupio/lupio_tty.hh" +terminal = Param.SerialDevice(Parent.any, "The terminal") +pio_size = Param.Addr(0x1000, "PIO size") +platform = Param.Platform(Parent.any, + "Platform this device is part of.") +int_id = Param.Int("Interrupt ID for the PIC to use") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index 775412c..c5d6b8f 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -26,11 +26,14 @@ Import('*') -SimObject('LupioRTC.py', tags='riscv isa') SimObject('LupioRNG.py', tags='riscv isa') +SimObject('LupioRTC.py', tags='riscv isa') +SimObject('LupioTTY.py', tags='riscv isa') DebugFlag('LupioRNG') DebugFlag('LupioRTC') +DebugFlag('LupioTTY') -Source('lupio_rtc.cc', tags='riscv isa') Source('lupio_rng.cc', tags='riscv isa') +Source('lupio_rtc.cc', tags='riscv isa') +Source('lupio_tty.cc', tags='riscv isa') diff --git a/src/dev/lupio/lupio_tty.cc b/src/dev/lupio/lupio_tty.cc new file mode 100644 index 000..0989947 --- /dev/null +++ b/src/dev/lupio/lupio_tty.cc @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2021 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 CON
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new LupIO-TMR device
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53035 ) Change subject: dev: Added new LupIO-TMR device .. dev: Added new LupIO-TMR device This device is a virtual timer that provides both a real-time counter, as well as a configurable timer with periodic and one-shot modes. It uses Ticks to measure time, and is implemented as a BasicPioDevice. The following are the specifications regarding the LupIO-TMR: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-tmr.md Change-Id: I6fd6f4926494a44d20e1e0289f502535e84d7a69 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53035 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- A src/dev/lupio/lupio_tmr.cc A src/dev/lupio/lupio_tmr.hh A src/dev/lupio/LupioTMR.py M src/dev/lupio/SConscript 4 files changed, 384 insertions(+), 1 deletion(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/lupio/LupioTMR.py b/src/dev/lupio/LupioTMR.py new file mode 100644 index 000..93340da --- /dev/null +++ b/src/dev/lupio/LupioTMR.py @@ -0,0 +1,36 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param + +class LupioTMR(BasicPioDevice): +type = 'LupioTMR' +cxx_class='gem5::LupioTMR' +cxx_header = 'dev/lupio/lupio_tmr.hh' +pio_size = Param.Addr(0x1000, "PIO Size") +num_threads = Param.Int("Number of threads in the system.") +int_type = Param.Int("Type of interrupt.") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index 1ea8a82..1eb0187 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -29,14 +29,17 @@ SimObject('LupioBLK.py', tags='riscv isa') SimObject('LupioRNG.py', tags='riscv isa') SimObject('LupioRTC.py', tags='riscv isa') +SimObject('LupioTMR.py', tags='riscv isa') SimObject('LupioTTY.py', tags='riscv isa') DebugFlag('LupioBLK') DebugFlag('LupioRNG') DebugFlag('LupioRTC') +DebugFlag('LupioTMR') DebugFlag('LupioTTY') Source('lupio_blk.cc', tags='riscv isa') Source('lupio_rng.cc', tags='riscv isa') Source('lupio_rtc.cc', tags='riscv isa') -Source('lupio_tty.cc', tags='riscv isa') +Source('lupio_tmr.cc', tags='riscv isa') +Source('lupio_tty.cc', tags='riscv isa') \ No newline at end of file diff --git a/src/dev/lupio/lupio_tmr.cc b/src/dev/lupio/lupio_tmr.cc new file mode 100644 index 000..b440015 --- /dev/null +++ b/src/dev/lupio/lupio_tmr.cc @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 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. + * + *
[gem5-dev] Change in gem5/gem5[develop]: stdlib: Introduced new LupV Board
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53028 ) ( 5 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: stdlib: Introduced new LupV Board .. stdlib: Introduced new LupV Board This LupV Board was created in order to connect all of the LupIO devices, and allow us to run a full RISC-V system with them. As the LupIO devices continue to be added, they will be integrated into this board, and replace the current IO components. The LupIO devices are a collection of processor agnostic and easily implemented virtual devices. Details about the specifications of all eight LupIO devices can be found here: https://gitlab.com/luplab/lupio/lupio-specs Information about how to build a RISCV full system with the LupIO-RTC can be found here: https://github.com/darchr/lupio-gem5/blob/lupio/README.md Change-Id: I7d3186d3778d40b38027f245290432dbf4279dea Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53028 Maintainer: Bobby Bruce Reviewed-by: Jason Lowe-Power Tested-by: kokoro --- M src/python/SConscript A src/python/gem5/components/boards/lupv_board.py 2 files changed, 426 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/SConscript b/src/python/SConscript index 3d91ccb..90ac7cd 100644 --- a/src/python/SConscript +++ b/src/python/SConscript @@ -37,6 +37,7 @@ PySource('gem5.components.boards', 'gem5/components/boards/abstract_board.py') PySource('gem5.components.boards', 'gem5/components/boards/mem_mode.py') PySource('gem5.components.boards', 'gem5/components/boards/riscv_board.py') +PySource('gem5.components.boards', 'gem5/components/boards/lupv_board.py') PySource('gem5.components.boards', 'gem5/components/boards/simple_board.py') PySource('gem5.components.boards', 'gem5/components/boards/test_board.py') PySource('gem5.components.boards', 'gem5/components/boards/x86_board.py') diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py new file mode 100644 index 000..18f0337 --- /dev/null +++ b/src/python/gem5/components/boards/lupv_board.py @@ -0,0 +1,398 @@ +# Copyright (c) 2021 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. + +import os +from typing import Optional + +from ...utils.override import overrides +from .simple_board import SimpleBoard +from .abstract_board import AbstractBoard +from ..processors.abstract_processor import AbstractProcessor +from ..memory.abstract_memory_system import AbstractMemorySystem +from ..cachehierarchies.abstract_cache_hierarchy import AbstractCacheHierarchy +from ...isas import ISA +from ...runtime import get_runtime_isa + +import m5 +from m5.objects import ( +Bridge, +PMAChecker, +RiscvLinux, +RiscvRTC, +AddrRange, +IOXBar, +Clint, +Plic, +Uart8250, +Terminal, +LupioRTC, +LupV, +AddrRange, +CowDiskImage, +RawDiskImage, +Frequency, +RiscvMmioVirtIO, +VirtIOBlock, +Port, +) + +from m5.util.fdthelper import ( +Fdt, +FdtNode, +FdtProperty, +FdtPropertyStrings, +FdtPropertyWords, +FdtState, +) + +class LupvBoard(SimpleBoard): +""" +A board capable of full system simul
[gem5-dev] Change in gem5/gem5[develop]: stdlib: Added LupioTTY to LupVBoard
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53032 ) Change subject: stdlib: Added LupioTTY to LupVBoard .. stdlib: Added LupioTTY to LupVBoard This added the new LupioTTY device to the growing LupVBoard, and replaced the Uart8250 device in this system. Change-Id: Ib9a09565e8522178fd9c9f900db9d3b87e8b48fb Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53032 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/python/gem5/components/boards/lupv_board.py 1 file changed, 42 insertions(+), 23 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py index 0316def..932fcd7 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/lupv_board.py @@ -46,10 +46,10 @@ IOXBar, Clint, Plic, -Uart8250, Terminal, LupioRNG, LupioRTC, +LupioTTY, LupV, AddrRange, CowDiskImage, @@ -98,7 +98,7 @@ # Initialize all the devices that we want to use on this board # Interrupt IDS for PIC Device -self._int_ids = { 'UART': 1, 'DISK': 2, 'RNG': 3} +self._int_ids = { 'TTY': 1, 'DISK': 2, 'RNG': 3} # CLINT self.clint = Clint(pio_addr=0x200) @@ -109,7 +109,7 @@ #LupV Platform self.lupv = LupV( pic = self.pic, -uart_int_id = self._int_ids['UART'] +uart_int_id = self._int_ids['TTY'] ) # LUPIO RNG @@ -130,12 +130,16 @@ pio_addr=0x10008000, ) -# UART -self.uart = Uart8250(pio_addr=0x1000) +# LUPIO TTY +self.lupio_tty = LupioTTY( +pio_addr=0x20007000, +platform = self.lupv, +int_id = self._int_ids['TTY'] +) self.terminal = Terminal() pic_srcs = [ -self._int_ids['UART'], +self._int_ids['TTY'], self._int_ids['DISK'], self._int_ids['RNG'] ] @@ -157,7 +161,7 @@ self.pic, ] self._off_chip_devices = [ -self.uart, +self.lupio_tty, self.disk, self.lupio_rng, self.lupio_rtc @@ -239,7 +243,7 @@ # Linux boot command flags kernel_cmd = [ -"earlycon console=ttyS0", +"earlycon console=ttyLIO0", "root=/dev/vda1", "ro" ] @@ -366,21 +370,6 @@ soc_node.append(plic_node) -# UART node -uart = self.uart -uart_node = uart.generateBasicPioDeviceNode( -soc_state, "uart", uart.pio_addr, uart.pio_size -) -uart_node.append( -FdtPropertyWords("interrupts", [self._int_ids['UART']]) -) -uart_node.append(FdtPropertyWords("clock-frequency", [0x384000])) -uart_node.append( -FdtPropertyWords("interrupt-parent", soc_state.phandle(plic)) -) -uart_node.appendCompatible(["ns8250"]) -soc_node.append(uart_node) - # VirtIO MMIO disk node disk = self.disk disk_node = disk.generateBasicPioDeviceNode( @@ -414,6 +403,19 @@ lupio_rtc_node.appendCompatible(["lupio,rtc"]) soc_node.append(lupio_rtc_node) +# LupioTTY Device +lupio_tty = self.lupio_tty +lupio_tty_node = lupio_tty.generateBasicPioDeviceNode(soc_state, +"lupio-tty", lupio_tty.pio_addr, lupio_tty.pio_size) +lupio_tty_node.appendCompatible(["lupio,tty"]) +lupio_tty_node.append( +FdtPropertyWords("interrupts", +[self.lupio_tty.int_id])) +lupio_tty_node.append( +FdtPropertyWords("interrupt-parent", +state.phandle(self.pic))) +soc_node.append(lupio_tty_node) + root.append(soc_node) fdt = Fdt() fdt.add_rootnode(root) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53032 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ib9a09565e8522178fd9c9f900db9d3b87e8b48fb Gerrit-Change-Number: 53032 Gerrit-PatchSet: 9 Gerrit-Owner: melissa jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-Reviewer: melissa jost Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_n
[gem5-dev] Change in gem5/gem5[develop]: dev: Introduced new LupV Platform
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53027 ) Change subject: dev: Introduced new LupV Platform .. dev: Introduced new LupV Platform This is a platform with a RISC-V processor and the LupIO devices that will allow users to decide which programmable interrupt controller to use in their system. It currently uses the PLIC device. Change-Id: Ife6cf5c14845be725e66178693e9ba0ee5fda511 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53027 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- A src/dev/riscv/lupv.cc A src/dev/riscv/lupv.hh A src/dev/riscv/LupV.py M src/dev/riscv/SConscript 4 files changed, 217 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/dev/riscv/LupV.py b/src/dev/riscv/LupV.py new file mode 100644 index 000..d14595e --- /dev/null +++ b/src/dev/riscv/LupV.py @@ -0,0 +1,35 @@ +# Copyright (c) 2021 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. + +from m5.objects.Platform import Platform +from m5.params import Param + +class LupV(Platform): +type = 'LupV' +cxx_header = "dev/riscv/lupv.hh" +cxx_class = 'gem5::LupV' +pic = Param.Plic("PIC") +uart_int_id = Param.Int("Interrupt ID to be used if the PLIC is used here") diff --git a/src/dev/riscv/SConscript b/src/dev/riscv/SConscript index 23f1074..5124b55 100755 --- a/src/dev/riscv/SConscript +++ b/src/dev/riscv/SConscript @@ -29,6 +29,7 @@ Import('*') SimObject('HiFive.py', tags='riscv isa') +SimObject('LupV.py', tags='riscv isa') SimObject('Clint.py', tags='riscv isa') SimObject('PlicDevice.py', tags='riscv isa') SimObject('Plic.py', tags='riscv isa') @@ -40,6 +41,7 @@ DebugFlag('VirtIOMMIO', tags='riscv isa') Source('hifive.cc', tags='riscv isa') +Source('lupv.cc', tags='riscv isa') Source('clint.cc', tags='riscv isa') Source('plic_device.cc', tags='riscv isa') Source('plic.cc', tags='riscv isa') diff --git a/src/dev/riscv/lupv.cc b/src/dev/riscv/lupv.cc new file mode 100644 index 000..7658b2a --- /dev/null +++ b/src/dev/riscv/lupv.cc @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2021 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 CONSEQU
[gem5-dev] Change in gem5/gem5[develop]: stdlib: Added LupioRNG to LupVBoard
melissa jost has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/53030 ) Change subject: stdlib: Added LupioRNG to LupVBoard .. stdlib: Added LupioRNG to LupVBoard This adds the LupioRNG device to our LupVBoard, adding random number generation capability to this RISC-V based system. Change-Id: I89c78c119a46cc7b056005d8abef16b1816ee4c4 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53030 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/python/gem5/components/boards/lupv_board.py 1 file changed, 42 insertions(+), 2 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Bobby Bruce: Looks good to me, approved kokoro: Regressions pass diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py index 18f0337..0316def 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/lupv_board.py @@ -48,6 +48,7 @@ Plic, Uart8250, Terminal, +LupioRNG, LupioRTC, LupV, AddrRange, @@ -97,7 +98,7 @@ # Initialize all the devices that we want to use on this board # Interrupt IDS for PIC Device -self._int_ids = { 'UART': 1, 'DISK': 2} +self._int_ids = { 'UART': 1, 'DISK': 2, 'RNG': 3} # CLINT self.clint = Clint(pio_addr=0x200) @@ -111,6 +112,13 @@ uart_int_id = self._int_ids['UART'] ) +# LUPIO RNG +self.lupio_rng = LupioRNG( +pio_addr=0x20005000, +platform = self.lupv, +int_id = self._int_ids['RNG'] +) + # LUPIO RTC self.lupio_rtc = LupioRTC(pio_addr=0x20004000) @@ -128,7 +136,8 @@ pic_srcs = [ self._int_ids['UART'], -self._int_ids['DISK'] +self._int_ids['DISK'], +self._int_ids['RNG'] ] self.pic.n_contexts = self.processor.get_num_cores() * 2 self.pic.n_src = max(pic_srcs) + 1 @@ -150,6 +159,7 @@ self._off_chip_devices = [ self.uart, self.disk, +self.lupio_rng, self.lupio_rtc ] @@ -383,6 +393,19 @@ disk_node.appendCompatible(["virtio,mmio"]) soc_node.append(disk_node) +# LupioRNG Device +lupio_rng = self.lupio_rng +lupio_rng_node = lupio_rng.generateBasicPioDeviceNode(soc_state, +"lupio-rng", lupio_rng.pio_addr,lupio_rng.pio_size) +lupio_rng_node.appendCompatible(["lupio,rng"]) +lupio_rng_node.append( +FdtPropertyWords("interrupts", +[self.lupio_rng.int_id])) +lupio_rng_node.append( +FdtPropertyWords("interrupt-parent", +state.phandle(self.pic))) +soc_node.append(lupio_rng_node) + # LupioRTC Device lupio_rtc = self.lupio_rtc lupio_rtc_node = lupio_rtc.generateBasicPioDeviceNode( -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53030 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I89c78c119a46cc7b056005d8abef16b1816ee4c4 Gerrit-Change-Number: 53030 Gerrit-PatchSet: 8 Gerrit-Owner: melissa jost Gerrit-Reviewer: Bobby Bruce Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-Reviewer: melissa jost Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: dev: Added LupV script to configs
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53046 ) Change subject: dev: Added LupV script to configs .. dev: Added LupV script to configs This commit adds run_lupv.py, the script to run the LupVBoard, as well as a README that details how to set up your system in order to run the LupIO devices. Change-Id: Ibea098f0409819b4c79063ab0be01518c7c6a61f --- A configs/example/lupv/run_lupv.py A configs/example/lupv/README.md 2 files changed, 186 insertions(+), 0 deletions(-) diff --git a/configs/example/lupv/README.md b/configs/example/lupv/README.md new file mode 100644 index 000..c3192da --- /dev/null +++ b/configs/example/lupv/README.md @@ -0,0 +1,48 @@ +# README + +This README details how to build a RISCV full system that utilizes the +lupIO devices. The LupIO devices were created by Professor Joël Porquet-Lupine, +and more information about the device can be found here (https://luplab.cs.ucdavis.edu/assets/lupio/wcae21-porquet-lupio-paper.pdf). The specs for each individual device can +be found here (https://gitlab.com/luplab/lupio/lupio-specs), and the Linux drivers +for each of these devices can be found here (https://gitlab.com/luplab/lupio/linux). + +In order to run this system, you need the following: + +* `run_lupv.py` +* a built version of the lupIO gem5 repo +* bbl +* disk image + +Both the bbl and a working disk image can be found on the LupIO+gem5 Google +Drive. In addition, instructions to build a version of Linux with the lupIO +drivers are there, but should not be needed. + +In order for `run_lupv.py` to work in its current state, move it within the +gem5 directory. + +Once you have everything set up, you can run the RISCV full system by using +the following command line prompt. Note that for the cpu type, you can choose +between `atomic` and `simple` modes. + +``` bash +[gem5 binary] gem5/run_lupv.py [path to bbl] [path to the disk image] [cpu type] [num cpus] +``` + +example: + +```bash +gem5/build/RISCV/gem5.opt gem5/run_lupv.py bbl rootfs.img atomic 1 +``` + +Once you've started the gem5 simulation, you can open up a separate terminal +and use m5term to connect to the simulated console. The port number will be +specified in the gem5 simulation. + +example: + +```bash +m5term localhost 3456 +``` + +This should allow you to run busybox, in which you can see the LupIO device at +work! diff --git a/configs/example/lupv/run_lupv.py b/configs/example/lupv/run_lupv.py new file mode 100644 index 000..a5d3cbb --- /dev/null +++ b/configs/example/lupv/run_lupv.py @@ -0,0 +1,125 @@ +# Copyright (c) 2021 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. +""" +This example runs a simple linux boot. +Characteristics +--- +* Runs exclusively on the RISC-V ISA with the classic caches +* Assumes that the kernel is compiled into the bootloader +* Automatically generates the DTB file +""" +import m5 +from m5.objects import Root +import sys +import os +# This is a lame hack to get the imports working correctly. +# TODO: This needs fixed. +sys.path.append( +os.path.join( +os.path.dirname(os.path.abspath(__file__)), +os.pardir, +os.pardir, +os.pardir, +) +) +from src.python.gem5.runtime import get_runtime_isa +from src.python.gem5.components.boards.experimental.lupv_board import LupvBoard +from src.python.gem5.compon
[gem5-dev] Change in gem5/gem5[develop]: dev,arch: Added LupIO-IPI to the LupV Board
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53042 ) Change subject: dev,arch: Added LupIO-IPI to the LupV Board .. dev,arch: Added LupIO-IPI to the LupV Board This adds the LupioIPI device to our LupV Board, which finalizes the changes needed for the LupIO devices to run with SMP support. Change-Id: I3e51dae6d8d589d3b38c57c33322e740c832a03d --- M src/python/gem5/components/boards/lupv_board.py 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py index 8dcf4ba..61e1ebe 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/lupv_board.py @@ -48,6 +48,7 @@ Plic, Terminal, LupioBLK, +LupioIPI, LupioPIC, LupioRNG, LupioRTC, @@ -110,10 +111,18 @@ # PLIC self.pic = Plic(pio_addr=0xc00) +# LUPIO IPI +self.lupio_ipi = LupioIPI( +pio_addr=0x20001000, +int_type=self._excep_code['INT_SOFT_SUPER'], +num_threads = self.processor.get_num_cores() +) + # LUPIO PIC self.lupio_pic = LupioPIC( pio_addr=0x20002000, -int_type = self._excep_code['INT_EXT_SUPER'] +int_type = self._excep_code['INT_EXT_SUPER'], +num_threads = self.processor.get_num_cores() ) #LupV Platform @@ -142,7 +151,8 @@ # LUPIO TMR self.lupio_tmr = LupioTMR( pio_addr=0x20006000, -int_type = self._excep_code['INT_TIMER_SUPER'] +int_type = self._excep_code['INT_TIMER_SUPER'], +num_threads = self.processor.get_num_cores() ) # LUPIO TTY @@ -183,6 +193,7 @@ self._on_chip_devices = [ self.clint, self.pic, +self.lupio_ipi, self.lupio_pic, self.lupio_tmr ] @@ -423,6 +434,22 @@ soc_node.append(plic_node) +# LupioIPI Device +lupio_ipi = self.lupio_ipi +lupio_ipi_node = lupio_ipi.generateBasicPioDeviceNode(soc_state, +"lupio-ipi", lupio_ipi.pio_addr, +lupio_ipi.pio_size) +int_extended = list() +for i, core in enumerate(self.get_processor().get_cores()): +phandle = state.phandle(f"cpu@{i}.int_state") +int_extended.append(phandle) +int_extended.append(self._excep_code['INT_SOFT_SUPER']) +lupio_ipi_node.append( +FdtPropertyWords("interrupts-extended", int_extended)) +lupio_ipi_node.append(FdtProperty("interrupt-controller")) +lupio_ipi_node.appendCompatible(["lupio,ipi"]) +soc_node.append(lupio_ipi_node) + # LupioPIC Device lupio_pic = self.lupio_pic lupio_pic_node = lupio_pic.generateBasicPioDeviceNode(soc_state, -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53042 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I3e51dae6d8d589d3b38c57c33322e740c832a03d Gerrit-Change-Number: 53042 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new LupIO-PIC device
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53036 ) Change subject: dev: Added new LupIO-PIC device .. dev: Added new LupIO-PIC device This device is a virtual programmable interrupt controller, and it manages interrupt requests from up to 32 sources. It is implemented as a BasicPioDevice. The following are the specifications regarding the LupIO-PIC: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-pic.md Change-Id: I9ccdb607789f62cc89bdd7392d8e59c8e5c24797 --- A src/dev/lupio/lupio_pic.cc A src/dev/lupio/lupio_pic.hh A src/dev/lupio/LupioPIC.py M src/dev/lupio/SConscript 4 files changed, 326 insertions(+), 0 deletions(-) diff --git a/src/dev/lupio/LupioPIC.py b/src/dev/lupio/LupioPIC.py new file mode 100644 index 000..a8eb127 --- /dev/null +++ b/src/dev/lupio/LupioPIC.py @@ -0,0 +1,39 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param + +class LupioPIC(BasicPioDevice): + +type = 'LupioPIC' +cxx_class='gem5::LupioPIC' +cxx_header = 'dev/lupio/lupio_pic.hh' +pio_size = Param.Addr(0x1000, "PIO Size") +n_src = Param.Int("Number of interrupt sources") +num_threads = Param.Int("Number of threads") +int_type = Param.Int("Type of interrupt") + diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index fd25d65..599edf0 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -27,18 +27,21 @@ Import('*') SimObject('LupioBLK.py') +SimObject('LupioPIC.py') SimObject('LupioRNG.py') SimObject('LupioRTC.py') SimObject('LupioTMR.py') SimObject('LupioTTY.py') DebugFlag('LupioBLK') +DebugFlag('LupioPIC') DebugFlag('LupioRNG') DebugFlag('LupioRTC') DebugFlag('LupioTMR') DebugFlag('LupioTTY') Source('lupio_blk.cc') +Source('lupio_pic.cc') Source('lupio_rng.cc') Source('lupio_rtc.cc') Source('lupio_tmr.cc') diff --git a/src/dev/lupio/lupio_pic.cc b/src/dev/lupio/lupio_pic.cc new file mode 100644 index 000..3fe8a49 --- /dev/null +++ b/src/dev/lupio/lupio_pic.cc @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2021 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 SUB
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new Lupio-IPI device
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53041 ) Change subject: dev: Added new Lupio-IPI device .. dev: Added new Lupio-IPI device Added the LupIO inter-processor interrupt controller device which will allow for us to use an SMP system with the LupIO devices. Change-Id: Iceab7446b36fb4d9b7605f3ba28665fca509d55d --- A src/dev/lupio/LupioIPI.py A src/dev/lupio/lupio_ipi.cc A src/dev/lupio/lupio_ipi.hh M src/dev/lupio/SConscript 4 files changed, 258 insertions(+), 1 deletion(-) diff --git a/src/dev/lupio/LupioIPI.py b/src/dev/lupio/LupioIPI.py new file mode 100644 index 000..3bffb5c --- /dev/null +++ b/src/dev/lupio/LupioIPI.py @@ -0,0 +1,37 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param + +class LupioIPI(BasicPioDevice): +type = 'LupioIPI' +cxx_class='gem5::LupioIPI' +cxx_header = 'dev/lupio/lupio_ipi.hh' +pio_size = Param.Addr(0x1000, "PIO Size") +int_type = Param.Int("Type of interrupt") +num_threads = Param.Int("Number of threads") + diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index 599edf0..71488b0 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -27,6 +27,7 @@ Import('*') SimObject('LupioBLK.py') +SimObject('LupioIPI.py') SimObject('LupioPIC.py') SimObject('LupioRNG.py') SimObject('LupioRTC.py') @@ -34,6 +35,7 @@ SimObject('LupioTTY.py') DebugFlag('LupioBLK') +DebugFlag('LupioIPI') DebugFlag('LupioPIC') DebugFlag('LupioRNG') DebugFlag('LupioRTC') @@ -41,9 +43,9 @@ DebugFlag('LupioTTY') Source('lupio_blk.cc') +Source('lupio_ipi.cc') Source('lupio_pic.cc') Source('lupio_rng.cc') Source('lupio_rtc.cc') Source('lupio_tmr.cc') Source('lupio_tty.cc') - diff --git a/src/dev/lupio/lupio_ipi.cc b/src/dev/lupio/lupio_ipi.cc new file mode 100644 index 000..1504275 --- /dev/null +++ b/src/dev/lupio/lupio_ipi.cc @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021 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 LIAB
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new Lupio-SYS device
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53043 ) Change subject: dev: Added new Lupio-SYS device .. dev: Added new Lupio-SYS device This adds the LupIO system controller, in which we provide a way to halt or reboot the system. It is implemented as a BasicPIODevice. Change-Id: I0031ac65d2aaca3460dcd4c59543a75230b0b52a --- A src/dev/lupio/lupio_sys.cc A src/dev/lupio/lupio_sys.hh A src/dev/lupio/LupioSYS.py M src/dev/lupio/SConscript 4 files changed, 232 insertions(+), 0 deletions(-) diff --git a/src/dev/lupio/LupioSYS.py b/src/dev/lupio/LupioSYS.py new file mode 100644 index 000..d300e91 --- /dev/null +++ b/src/dev/lupio/LupioSYS.py @@ -0,0 +1,34 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param + +class LupioSYS(BasicPioDevice): +type = 'LupioSYS' +cxx_class='gem5::LupioSYS' +cxx_header = 'dev/lupio/lupio_sys.hh' +pio_size = Param.Addr(0x1000, "PIO Size") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index 71488b0..2fac3b9 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -33,6 +33,7 @@ SimObject('LupioRTC.py') SimObject('LupioTMR.py') SimObject('LupioTTY.py') +SimObject('LupioSYS.py') DebugFlag('LupioBLK') DebugFlag('LupioIPI') @@ -41,6 +42,7 @@ DebugFlag('LupioRTC') DebugFlag('LupioTMR') DebugFlag('LupioTTY') +DebugFlag('LupioSYS') Source('lupio_blk.cc') Source('lupio_ipi.cc') @@ -49,3 +51,4 @@ Source('lupio_rtc.cc') Source('lupio_tmr.cc') Source('lupio_tty.cc') +Source('lupio_sys.cc') diff --git a/src/dev/lupio/lupio_sys.cc b/src/dev/lupio/lupio_sys.cc new file mode 100644 index 000..0596b0e --- /dev/null +++ b/src/dev/lupio/lupio_sys.cc @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2021 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
[gem5-dev] Change in gem5/gem5[develop]: dev,arch: Added Lupio-SYS device to LupV Board
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53044 ) Change subject: dev,arch: Added Lupio-SYS device to LupV Board .. dev,arch: Added Lupio-SYS device to LupV Board This adds the Lupio-SYS device to the LupV Board, which finalizes all of the devices needed to complete the LupIO device collection within gem5. Change-Id: I5af34d8c2735d74f4240d3077ed162dd25f2bcb2 --- M src/python/gem5/components/boards/lupv_board.py 1 file changed, 42 insertions(+), 0 deletions(-) diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py index 61e1ebe..ba0ca4b 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/lupv_board.py @@ -54,6 +54,7 @@ LupioRTC, LupioTMR, LupioTTY, +LupioSYS, LupV, AddrRange, CowDiskImage, @@ -148,6 +149,9 @@ # LUPIO RTC self.lupio_rtc = LupioRTC(pio_addr=0x20004000) +#LUPIO SYS +self.lupio_sys = LupioSYS(pio_addr= 0x20003000) + # LUPIO TMR self.lupio_tmr = LupioTMR( pio_addr=0x20006000, @@ -200,6 +204,7 @@ self._off_chip_devices = [ self.lupio_blk, self.lupio_tty, +self.lupio_sys, self.lupio_rng, self.lupio_rtc ] @@ -265,6 +270,7 @@ script to start the simulaiton. After the workload is set up, this function will generate the device tree file and output it to the output directory. + **Limitations** * Only supports a Linux kernel * Must use the provided bootloader and disk image as denoted in the @@ -497,6 +503,29 @@ state.phandle(self.lupio_pic))) soc_node.append(lupio_rng_node) +#LupioSYS Device +lupio_sys = self.lupio_sys +lupio_sys_node = lupio_sys.generateBasicPioDeviceNode(soc_state, +"lupio-sys", lupio_sys.pio_addr, lupio_sys.pio_size) +lupio_sys_node.appendCompatible(["syscon"]) +sys_phandle = state.phandle(self.lupio_sys) +lupio_sys_node.append(FdtPropertyWords("phandle", [sys_phandle])) +soc_node.append(lupio_sys_node) + +poweroff_node = FdtNode("poweroff") +poweroff_node.appendCompatible(["syscon-poweroff"]) +poweroff_node.append(FdtPropertyWords("regmap", [sys_phandle])) +poweroff_node.append(FdtPropertyWords("offset", [0x0])) +poweroff_node.append(FdtPropertyWords("value", [1])) +soc_node.append(poweroff_node) + +reboot_node = FdtNode("reboot") +reboot_node.appendCompatible(["syscon-reboot"]) +reboot_node.append(FdtPropertyWords("regmap", [sys_phandle])) +reboot_node.append(FdtPropertyWords("offset", [0x4])) +reboot_node.append(FdtPropertyWords("value", [1])) +soc_node.append(reboot_node) + # LupioRTC Device lupio_rtc = self.lupio_rtc lupio_rtc_node = lupio_rtc.generateBasicPioDeviceNode( -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53044 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I5af34d8c2735d74f4240d3077ed162dd25f2bcb2 Gerrit-Change-Number: 53044 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: dev: Modify LupIO-PIC for SMP support
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53040 ) Change subject: dev: Modify LupIO-PIC for SMP support .. dev: Modify LupIO-PIC for SMP support Added mask and enable arrays to the LupIO-PIC in order to handle SMP support. Change-Id: Id120206f33374ce337e389ef5a10fd64e62bcab3 --- M src/dev/lupio/lupio_pic.cc M src/dev/lupio/lupio_pic.hh 2 files changed, 54 insertions(+), 20 deletions(-) diff --git a/src/dev/lupio/lupio_pic.cc b/src/dev/lupio/lupio_pic.cc index 3fe8a49..4f30f31 100644 --- a/src/dev/lupio/lupio_pic.cc +++ b/src/dev/lupio/lupio_pic.cc @@ -34,8 +34,6 @@ #include "params/LupioPIC.hh" #include "sim/system.hh" -#define LUPIO_PIC_NSRC 32 - namespace gem5 { @@ -46,23 +44,26 @@ system(params.system), nSrc(params.n_src), nThread(params.num_threads), -intType(params.int_type) +intType(params.int_type), +mask{0}, +enable{0} { +// CPU0 receives all IRQ sources by default +enable[0] = 0x; DPRINTF(LupioPIC, "LupioPIC initalized\n"); } void LupioPIC::lupioPicUpdateIRQ() { -if (nThread > 1 ) { -panic("This device currently does not have SMP support\n"); -} +for (int cpu = 0; cpu < nThread; cpu++) { +auto tc = system->threads[cpu]; -auto tc = system->threads[0]; -if (pending & mask) { -tc->getCpuPtr()->postInterrupt(tc->threadId(), intType, 0); -} else { -tc->getCpuPtr()->clearInterrupt(tc->threadId(), intType, 0); +if (enable[cpu] & mask[cpu] & pending) { +tc->getCpuPtr()->postInterrupt(tc->threadId(), intType, 0); +} else { +tc->getCpuPtr()->clearInterrupt(tc->threadId(), intType, 0); +} } } @@ -90,21 +91,27 @@ LupioPIC::lupioPicRead(uint8_t addr) { uint32_t r = 0; - -switch (addr >> 2) { + +int cpu = addr >> LUPIO_PIC_MAX; +int reg = (addr >> 2) & (LUPIO_PIC_MAX - 1); + +switch (reg) { case LUPIO_PIC_PRIO: // Value will be 32 if there is no unmasked pending IRQ -r = ctz32(pending & mask); +r = ctz32(pending & mask[cpu] & enable[cpu]); DPRINTF(LupioPIC, "Read PIC_PRIO: %d\n", r); break; case LUPIO_PIC_MASK: -r = mask; +r = mask[cpu]; DPRINTF(LupioPIC, "Read PIC_MASK: %d\n", r); break; case LUPIO_PIC_PEND: - r = pending; +r = (enable[cpu] & pending); DPRINTF(LupioPIC, "Read PIC_PEND: %d\n", r); break; + case LUPIO_PIC_ENAB: +r = enable[cpu]; +break; default: panic("Unexpected read to the LupioPIC device at address %#llx!", @@ -119,10 +126,18 @@ { uint32_t val = val64; -switch (addr >> 2) { +int cpu = addr >> LUPIO_PIC_MAX; +int reg = (addr >> 2) & (LUPIO_PIC_MAX - 1); + +switch (reg) { case LUPIO_PIC_MASK: -mask = val; -DPRINTF(LupioPIC, "Write PIC_MASK: %d\n", mask); +mask[cpu] = val; +DPRINTF(LupioPIC, "Write PIC_MASK: %d\n", mask[cpu]); +lupioPicUpdateIRQ(); +break; +case LUPIO_PIC_ENAB: +enable[cpu] = val; +DPRINTF(LupioPIC, "Write PIC_ENAB: %d\n", enable[cpu]); lupioPicUpdateIRQ(); break; diff --git a/src/dev/lupio/lupio_pic.hh b/src/dev/lupio/lupio_pic.hh index 623f032..a5d6582 100644 --- a/src/dev/lupio/lupio_pic.hh +++ b/src/dev/lupio/lupio_pic.hh @@ -35,6 +35,8 @@ #include "params/LupioPIC.hh" #include "sim/system.hh" +#define LUPIO_PIC_NSRC 32 + namespace gem5 { @@ -62,13 +64,18 @@ LUPIO_PIC_PRIO, LUPIO_PIC_MASK, LUPIO_PIC_PEND, +LUPIO_PIC_ENAB, // Max offset LUPIO_PIC_MAX, }; uint32_t pending = 0; -uint32_t mask = 0; +// Register for masking or unmasking up to 32 sources +uint32_t mask[LUPIO_PIC_NSRC]; +// Regitser to determine which input IRQ is routed to the +// corresponding processor +uint32_t enable[LUPIO_PIC_NSRC]; protected: /** -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53040 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Id120206f33374ce337e389ef5a10fd64e62bcab3 Gerrit-Change-Number: 53040 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: dev,arch: Moved LupV Board to an experimental folder
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53045 ) Change subject: dev,arch: Moved LupV Board to an experimental folder .. dev,arch: Moved LupV Board to an experimental folder Change-Id: I9cd67177fe8f0cb34bebb4fd3f9d3af0a518c7b6 --- R src/python/gem5/components/boards/experimental/lupv_board.py 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/experimental/lupv_board.py similarity index 97% rename from src/python/gem5/components/boards/lupv_board.py rename to src/python/gem5/components/boards/experimental/lupv_board.py index ba0ca4b..28aa209 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/experimental/lupv_board.py @@ -27,14 +27,14 @@ import os from typing import Optional -from ...utils.override import overrides -from .simple_board import SimpleBoard -from .abstract_board import AbstractBoard -from ..processors.abstract_processor import AbstractProcessor -from ..memory.abstract_memory_system import AbstractMemorySystem -from ..cachehierarchies.abstract_cache_hierarchy import AbstractCacheHierarchy -from ...isas import ISA -from ...runtime import get_runtime_isa +from utils.override import overrides +from ..simple_board import SimpleBoard +from ..abstract_board import AbstractBoard +from ...processors.abstract_processor import AbstractProcessor +from ...memory.abstract_memory_system import AbstractMemorySystem +from ...cachehierarchies.abstract_cache_hierarchy import AbstractCacheHierarchy +from isas import ISA +from runtime import get_runtime_isa import m5 from m5.objects import ( @@ -173,10 +173,10 @@ self._int_ids['RNG'] ] -# Set the number of sources to the PIC as 0 because we've removed the +# Set the number of sources to the PIC as 0 because we've removed the # connections from all the external devices to the PIC, and moved them # to the LupioPIC. The PIC and CLINT only remain on the board at this -# point for our bbl to use upon startup, and will +# point for our bbl to use upon startup, and will # remain unused during the simulation self.pic.n_src = 0 self.pic.n_contexts = 0 @@ -300,7 +300,7 @@ # Default DTB address if bbl is built with --with-dts option self.workload.dtb_addr = 0x87E0 - + # We need to wait to generate the device tree until after the disk is # set up. Now that the disk and workload are set, we can generate the # device tree file. -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53045 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I9cd67177fe8f0cb34bebb4fd3f9d3af0a518c7b6 Gerrit-Change-Number: 53045 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: dev,arch: Modified LupV Platform + Board to use LupioPIC + TMR
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53037 ) Change subject: dev,arch: Modified LupV Platform + Board to use LupioPIC + TMR .. dev,arch: Modified LupV Platform + Board to use LupioPIC + TMR This added both the LupioPIC and LupioTMR to the LupVBoard. While both the PLIC and CLINT are left in the board for the bootloader to recognize, they aren't used within the system. In addition, the LupV Platform was changed in order to use the LupioPIC to handle interrupts instead of the PLIC. Change-Id: I57005903a7ec1136b42433ef5022ccb995abb9d6 --- M src/dev/riscv/lupv.cc M src/dev/riscv/lupv.hh M src/dev/riscv/LupV.py M src/python/gem5/components/boards/lupv_board.py 4 files changed, 100 insertions(+), 13 deletions(-) diff --git a/src/dev/riscv/LupV.py b/src/dev/riscv/LupV.py index d14595e..12273a6 100644 --- a/src/dev/riscv/LupV.py +++ b/src/dev/riscv/LupV.py @@ -31,5 +31,5 @@ type = 'LupV' cxx_header = "dev/riscv/lupv.hh" cxx_class = 'gem5::LupV' -pic = Param.Plic("PIC") +pic = Param.LupioPIC("PIC") uart_int_id = Param.Int("Interrupt ID to be used if the PLIC is used here") diff --git a/src/dev/riscv/lupv.cc b/src/dev/riscv/lupv.cc index a466ec7..6ae993c 100644 --- a/src/dev/riscv/lupv.cc +++ b/src/dev/riscv/lupv.cc @@ -28,7 +28,7 @@ #include "dev/riscv/lupv.hh" -#include "dev/riscv/plic.hh" +#include "dev/lupio/lupio_pic.hh" #include "params/LupV.hh" namespace gem5 diff --git a/src/dev/riscv/lupv.hh b/src/dev/riscv/lupv.hh index c2ba179..48649f3 100644 --- a/src/dev/riscv/lupv.hh +++ b/src/dev/riscv/lupv.hh @@ -29,8 +29,8 @@ #ifndef __DEV_RISCV_LUPV_HH__ #define __DEV_RISCV_LUPV_HH__ +#include "dev/lupio/lupio_pic.hh" #include "dev/platform.hh" -#include "dev/riscv/plic.hh" #include "params/LupV.hh" namespace gem5 @@ -49,7 +49,7 @@ class LupV : public Platform { public: -Plic *pic; +LupioPIC *pic; int UartIntID; public: diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py index 5152dfe..8dcf4ba 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/lupv_board.py @@ -48,16 +48,16 @@ Plic, Terminal, LupioBLK, +LupioPIC, LupioRNG, LupioRTC, +LupioTMR, LupioTTY, LupV, AddrRange, CowDiskImage, RawDiskImage, Frequency, -RiscvMmioVirtIO, -VirtIOBlock, Port, ) @@ -99,6 +99,9 @@ # Initialize all the devices that we want to use on this board # Interrupt IDS for PIC Device +self._excep_code = { 'INT_SOFT_SUPER': 1, 'INT_TIMER_SUPER': 5, + 'INT_TIMER_MACHINE': 7, 'INT_EXT_SUPER': 9, + 'INT_EXT_MACHINE': 10 } self._int_ids = { 'TTY': 1, 'BLK': 2, 'RNG': 3} # CLINT @@ -107,9 +110,15 @@ # PLIC self.pic = Plic(pio_addr=0xc00) +# LUPIO PIC +self.lupio_pic = LupioPIC( +pio_addr=0x20002000, +int_type = self._excep_code['INT_EXT_SUPER'] +) + #LupV Platform self.lupv = LupV( -pic = self.pic, +pic = self.lupio_pic, uart_int_id = self._int_ids['TTY'] ) @@ -130,6 +139,12 @@ # LUPIO RTC self.lupio_rtc = LupioRTC(pio_addr=0x20004000) +# LUPIO TMR +self.lupio_tmr = LupioTMR( +pio_addr=0x20006000, +int_type = self._excep_code['INT_TIMER_SUPER'] +) + # LUPIO TTY self.lupio_tty = LupioTTY( pio_addr=0x20007000, @@ -143,9 +158,18 @@ self._int_ids['BLK'], self._int_ids['RNG'] ] -self.pic.n_contexts = self.processor.get_num_cores() * 2 -self.pic.n_src = max(pic_srcs) + 1 +# Set the number of sources to the PIC as 0 because we've removed the +# connections from all the external devices to the PIC, and moved them +# to the LupioPIC. The PIC and CLINT only remain on the board at this +# point for our bbl to use upon startup, and will +# remain unused during the simulation +self.pic.n_src = 0 +self.pic.n_contexts = 0 +self.lupio_pic.n_src = max(pic_srcs) + 1 +self.lupio_pic.num_threads = self.processor.get_num_cores() + +self.lupio_tmr.num_threads = self.processor.get_num_cores() self.clint.num_threads = self.processor.get_num_cores() # Add the RTC @@ -159,6 +183,8 @@ self._on_chip_devices = [ self.clint, self.pic, +self.lupio_pic, +self.lupio_tmr ] self._off_chip_devices = [ self.lupio_blk, @@ -343,6 +369,32 @@ clint_node.appendCompatible(["riscv,clint0"]) soc_node
[gem5-dev] Change in gem5/gem5[develop]: dev: Modify LupIO-TMR for SMP support
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53039 ) Change subject: dev: Modify LupIO-TMR for SMP support .. dev: Modify LupIO-TMR for SMP support Added a new LupioTimer struct, as well as a timer event function for SMP support. Change-Id: Idbcc549dfa3c5f8d5342d7e2250337a7482a1ac0 --- M src/dev/lupio/lupio_tmr.cc M src/dev/lupio/lupio_tmr.hh 2 files changed, 94 insertions(+), 56 deletions(-) diff --git a/src/dev/lupio/lupio_tmr.cc b/src/dev/lupio/lupio_tmr.cc index 731db18..6a69af0 100644 --- a/src/dev/lupio/lupio_tmr.cc +++ b/src/dev/lupio/lupio_tmr.cc @@ -34,11 +34,11 @@ #include "params/LupioTMR.hh" // Specific fields for CTRL -#define LUPIO_TMR_IE0x1 -#define LUPIO_TMR_PD0x2 +#define LUPIO_TMR_IRQE0x1 +#define LUPIO_TMR_PRDC0x2 // Specific fields for STAT -#define LUPIO_TMR_EX0x1 +#define LUPIO_TMR_EXPD 0x1 namespace gem5 { @@ -49,26 +49,37 @@ BasicPioDevice(params, params.pio_size), system(params.system), nThread(params.num_threads), -tmrEvent([this]{ lupioTMRCallback(); }, name()), intType(params.int_type) { +timers.resize(nThread); + +for (int cpu = 0; cpu < nThread; cpu++) { +timers[cpu].tmrEvent = new EventFunctionWrapper( +[=]{ +lupioTMRCallback(cpu); +}, name()+"done" +); +} + DPRINTF(LupioTMR, "LupioTMR initalized\n"); } -void -LupioTMR::updateIRQ(int level) +LupioTMR::~LupioTMR() { -if (nThread > 1) { -panic("This device currently does not offer SMP support\n"); +for (int cpu = 0; cpu < nThread; cpu++) { +delete timers[cpu].tmrEvent; } +} -auto tc = system->threads[0]; +void +LupioTMR::updateIRQ(int level, int cpu) +{ +auto tc = system->threads[cpu]; // post an interrupt if (level) { tc->getCpuPtr()->postInterrupt(tc->threadId(), intType, 0); -} -// clear the interrupt -else { +} else { +// clear the interrupt tc->getCpuPtr()->clearInterrupt(tc->threadId(), intType, 0); } } @@ -80,52 +91,61 @@ } void -LupioTMR::lupioTMRSet() +LupioTMR::lupioTMRSet(int cpu) { -startTime = curTick(); -if (!tmrEvent.scheduled()) { -schedule(tmrEvent, (reload * sim_clock::as_int::ns) + curTick()); +// Start the timer +timers[cpu].startTime = curTick(); + +// Schedule the timer to fire at the number of ticks stored +// in the reload register from the current tick +if (!timers[cpu].tmrEvent->scheduled()) { +// Convert the reload value to ticks from nanoseconds +schedule(*(timers[cpu].tmrEvent), +(timers[cpu].reload * sim_clock::as_int::ns) + curTick()); } } void -LupioTMR::lupioTMRCallback() +LupioTMR::lupioTMRCallback(int cpu) { // Signal expiration -expired = true; -if (ie) { -updateIRQ(1); +timers[cpu].expired = true; +if (timers[cpu].ie) { +updateIRQ(1, cpu); } // If periodic timer, reload -if (pd && reload) { -lupioTMRSet(); +if (timers[cpu].pd && timers[cpu].reload) { +lupioTMRSet(cpu); } } uint64_t LupioTMR::lupioTMRRead(uint8_t addr, int size) { -uint64_t r = 0; - -switch (addr >> 2) { +uint32_t r = 0; + +size_t cpu = addr >> LUPIO_TMR_MAX; +size_t reg = (addr >> 2) & (LUPIO_TMR_MAX - 1); + +switch (reg) { case LUPIO_TMR_TIME: r = lupioTMRCurrentTime(); DPRINTF(LupioTMR, "Read LUPIO_TMR_TME: %d\n", r); break; case LUPIO_TMR_LOAD: -r = reload; +r = timers[cpu].reload; DPRINTF(LupioTMR, "Read LUPIO_TMR_LOAD: %d\n", r); break; case LUPIO_TMR_STAT: -if (expired) { -r |= LUPIO_TMR_EX; +if (timers[cpu].expired) { +r |= LUPIO_TMR_EXPD; } // Acknowledge expiration -expired = false; +timers[cpu].expired = false; DPRINTF(LupioTMR, "Read LUPIO_TMR_STAT: %d\n", r); -updateIRQ(0); +updateIRQ(0, cpu); break; default: @@ -141,26 +161,31 @@ { uint32_t val = val64; -switch (addr >> 2) { +size_t cpu = addr >> LUPIO_TMR_MAX; +size_t reg = (addr >> 2) & (LUPIO_TMR_MAX - 1); + +switch (reg) { case LUPIO_TMR_LOAD: -reload = val; -DPRINTF(LupioTMR, "Write LUPIO_TMR_LOAD: %d\n", reload); +timers[cpu].reload = val; +DPRINTF(LupioTMR, "Write LUPIO_TMR_LOAD: %d\n", +timers[cpu].reload); break; case LUPIO_TMR_CTRL: -ie = val & LUPIO_TMR_IE; -pd = val & LUPIO_TMR_PD; +timers[cpu].ie = val & LUPIO_TMR_IRQE; +timers[cpu].pd = val & LUPI
[gem5-dev] Change in gem5/gem5[develop]: dev: Modified LupioBLK and LupioTTY to use LupioPIC
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53038 ) Change subject: dev: Modified LupioBLK and LupioTTY to use LupioPIC .. dev: Modified LupioBLK and LupioTTY to use LupioPIC This replaced the PLIC device within the LupioBLK and LupioTTY with the LupioPIC, so that interrupts now go through the LupioPIC, and the PLIC isn't used anymore. Change-Id: I0eb5d5c5df9cb43cfb5e8e3a5bf4176f48320696 --- M src/dev/lupio/lupio_tty.hh M src/dev/lupio/lupio_blk.hh 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/src/dev/lupio/lupio_blk.hh b/src/dev/lupio/lupio_blk.hh index c767ad1..4e56164 100644 --- a/src/dev/lupio/lupio_blk.hh +++ b/src/dev/lupio/lupio_blk.hh @@ -32,6 +32,7 @@ #include "debug/LupioBLK.hh" #include "dev/dma_device.hh" #include "dev/io_device.hh" +#include "dev/lupio/lupio_pic.hh" #include "dev/platform.hh" #include "dev/storage/disk_image.hh" #include "params/LupioBLK.hh" diff --git a/src/dev/lupio/lupio_tty.hh b/src/dev/lupio/lupio_tty.hh index 1124193..e971a9f 100644 --- a/src/dev/lupio/lupio_tty.hh +++ b/src/dev/lupio/lupio_tty.hh @@ -30,6 +30,7 @@ #define __LUPIO_TTY_HH__ #include "dev/io_device.hh" +#include "dev/lupio/lupio_pic.hh" #include "dev/platform.hh" #include "dev/serial/serial.hh" #include "params/LupioTTY.hh" -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53038 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I0eb5d5c5df9cb43cfb5e8e3a5bf4176f48320696 Gerrit-Change-Number: 53038 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new LupIO-TMR device
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53035 ) Change subject: dev: Added new LupIO-TMR device .. dev: Added new LupIO-TMR device This device is a virtual timer that provides both a real-time counter, as well as a configurable timer with periodic and one-shot modes. It uses Ticks to measure time, and is implemented as a BasicPioDevice. The following are the specifications regarding the LupIO-TMR: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-tmr.md Change-Id: I6fd6f4926494a44d20e1e0289f502535e84d7a69 --- A src/dev/lupio/lupio_tmr.cc A src/dev/lupio/lupio_tmr.hh A src/dev/lupio/LupioTMR.py M src/dev/lupio/SConscript 4 files changed, 382 insertions(+), 0 deletions(-) diff --git a/src/dev/lupio/LupioTMR.py b/src/dev/lupio/LupioTMR.py new file mode 100644 index 000..93340da --- /dev/null +++ b/src/dev/lupio/LupioTMR.py @@ -0,0 +1,36 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param + +class LupioTMR(BasicPioDevice): +type = 'LupioTMR' +cxx_class='gem5::LupioTMR' +cxx_header = 'dev/lupio/lupio_tmr.hh' +pio_size = Param.Addr(0x1000, "PIO Size") +num_threads = Param.Int("Number of threads in the system.") +int_type = Param.Int("Type of interrupt.") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index db50b51..fd25d65 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -29,14 +29,18 @@ SimObject('LupioBLK.py') SimObject('LupioRNG.py') SimObject('LupioRTC.py') +SimObject('LupioTMR.py') SimObject('LupioTTY.py') DebugFlag('LupioBLK') DebugFlag('LupioRNG') DebugFlag('LupioRTC') +DebugFlag('LupioTMR') DebugFlag('LupioTTY') Source('lupio_blk.cc') Source('lupio_rng.cc') Source('lupio_rtc.cc') +Source('lupio_tmr.cc') Source('lupio_tty.cc') + diff --git a/src/dev/lupio/lupio_tmr.cc b/src/dev/lupio/lupio_tmr.cc new file mode 100644 index 000..731db18 --- /dev/null +++ b/src/dev/lupio/lupio_tmr.cc @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2021 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,
[gem5-dev] Change in gem5/gem5[develop]: dev,arch: Introduced new LupV Platform
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53027 ) Change subject: dev,arch: Introduced new LupV Platform .. dev,arch: Introduced new LupV Platform This is a platform with a RISC-V processor and the LupIO devices that will allow users to decide which programmable interrupt controller to use in their system. It currently uses the PLIC device. Change-Id: Ife6cf5c14845be725e66178693e9ba0ee5fda511 --- A src/dev/riscv/lupv.cc A src/dev/riscv/lupv.hh A src/dev/riscv/LupV.py M src/dev/riscv/SConscript 4 files changed, 213 insertions(+), 0 deletions(-) diff --git a/src/dev/riscv/LupV.py b/src/dev/riscv/LupV.py new file mode 100644 index 000..d14595e --- /dev/null +++ b/src/dev/riscv/LupV.py @@ -0,0 +1,35 @@ +# Copyright (c) 2021 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. + +from m5.objects.Platform import Platform +from m5.params import Param + +class LupV(Platform): +type = 'LupV' +cxx_header = "dev/riscv/lupv.hh" +cxx_class = 'gem5::LupV' +pic = Param.Plic("PIC") +uart_int_id = Param.Int("Interrupt ID to be used if the PLIC is used here") diff --git a/src/dev/riscv/SConscript b/src/dev/riscv/SConscript index 23f1074..5124b55 100755 --- a/src/dev/riscv/SConscript +++ b/src/dev/riscv/SConscript @@ -29,6 +29,7 @@ Import('*') SimObject('HiFive.py', tags='riscv isa') +SimObject('LupV.py', tags='riscv isa') SimObject('Clint.py', tags='riscv isa') SimObject('PlicDevice.py', tags='riscv isa') SimObject('Plic.py', tags='riscv isa') @@ -40,6 +41,7 @@ DebugFlag('VirtIOMMIO', tags='riscv isa') Source('hifive.cc', tags='riscv isa') +Source('lupv.cc', tags='riscv isa') Source('clint.cc', tags='riscv isa') Source('plic_device.cc', tags='riscv isa') Source('plic.cc', tags='riscv isa') diff --git a/src/dev/riscv/lupv.cc b/src/dev/riscv/lupv.cc new file mode 100644 index 000..a466ec7 --- /dev/null +++ b/src/dev/riscv/lupv.cc @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2021 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 TO
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new Lupio-BLK Device
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53033 ) Change subject: dev: Added new Lupio-BLK Device .. dev: Added new Lupio-BLK Device This is a virtual block device that provides a disk-like interface for second level storage. It is implemented as a DMADevice, and allows for the transfer of blocks from the block device to main memory, and vice versa. The following are the specifications regarding the LupIO-BLK: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-blk.md Change-Id: Ifabc9b715fadb218e84952694d666b803e46e1f7 --- A src/dev/lupio/LupioBLK.py A src/dev/lupio/lupio_blk.cc A src/dev/lupio/lupio_blk.hh M src/dev/lupio/SConscript 4 files changed, 417 insertions(+), 0 deletions(-) diff --git a/src/dev/lupio/LupioBLK.py b/src/dev/lupio/LupioBLK.py new file mode 100644 index 000..fc3479f --- /dev/null +++ b/src/dev/lupio/LupioBLK.py @@ -0,0 +1,43 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import DmaDevice + +from m5.params import Param +from m5.proxy import Parent + +class LupioBLK(DmaDevice): + +type = 'LupioBLK' +cxx_class='gem5::LupioBLK' +cxx_header = 'dev/lupio/lupio_blk.hh' +pio_size = Param.Addr(0x1000, "PIO Size") +image = Param.DiskImage("Disk image") +pio_addr = Param.Addr("Device Address") +latency = Param.Latency('0ns', "DMA Device Latency") +platform = Param.Platform(Parent.any, + "Platform this device is part of.") +int_id = Param.Int("Interrupt ID for the PIC to use") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index 94ede45..db50b51 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -26,14 +26,17 @@ Import('*') +SimObject('LupioBLK.py') SimObject('LupioRNG.py') SimObject('LupioRTC.py') SimObject('LupioTTY.py') +DebugFlag('LupioBLK') DebugFlag('LupioRNG') DebugFlag('LupioRTC') DebugFlag('LupioTTY') +Source('lupio_blk.cc') Source('lupio_rng.cc') Source('lupio_rtc.cc') Source('lupio_tty.cc') diff --git a/src/dev/lupio/lupio_blk.cc b/src/dev/lupio/lupio_blk.cc new file mode 100644 index 000..643c52c --- /dev/null +++ b/src/dev/lupio/lupio_blk.cc @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2021 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,
[gem5-dev] Change in gem5/gem5[develop]: dev,arch: Added LupioBLK Device to LupVBoard
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53034 ) Change subject: dev,arch: Added LupioBLK Device to LupVBoard .. dev,arch: Added LupioBLK Device to LupVBoard This adds the LupioBLK device to the growing LupVBoard, as well as removes the VirtIOMMIO Device from the board. Change-Id: Ibb45ecff07c7ce5d5d7be8cd8e20e9f62b591b02 --- M src/python/gem5/components/boards/lupv_board.py 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py index d10cdcf..5152dfe 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/lupv_board.py @@ -47,6 +47,7 @@ Clint, Plic, Terminal, +LupioBLK, LupioRNG, LupioRTC, LupioTTY, @@ -98,7 +99,7 @@ # Initialize all the devices that we want to use on this board # Interrupt IDS for PIC Device -self._int_ids = { 'TTY': 1, 'DISK': 2, 'RNG': 3} +self._int_ids = { 'TTY': 1, 'BLK': 2, 'RNG': 3} # CLINT self.clint = Clint(pio_addr=0x200) @@ -112,6 +113,13 @@ uart_int_id = self._int_ids['TTY'] ) +# LUPIO BLK +self.lupio_blk = LupioBLK( +pio_addr=0x2000, +platform = self.lupv, +int_id = self._int_ids['BLK'] +) + # LUPIO RNG self.lupio_rng = LupioRNG( pio_addr=0x20005000, @@ -122,14 +130,6 @@ # LUPIO RTC self.lupio_rtc = LupioRTC(pio_addr=0x20004000) -# VirtIO Disk -self.disk = RiscvMmioVirtIO( -vio=VirtIOBlock(), -interrupt_id=self._int_ids['DISK'], -pio_size=4096, -pio_addr=0x10008000, -) - # LUPIO TTY self.lupio_tty = LupioTTY( pio_addr=0x20007000, @@ -140,7 +140,7 @@ pic_srcs = [ self._int_ids['TTY'], -self._int_ids['DISK'], +self._int_ids['BLK'], self._int_ids['RNG'] ] self.pic.n_contexts = self.processor.get_num_cores() * 2 @@ -161,8 +161,8 @@ self.pic, ] self._off_chip_devices = [ +self.lupio_blk, self.lupio_tty, -self.disk, self.lupio_rng, self.lupio_rtc ] @@ -171,6 +171,7 @@ """Connect the I/O devices to the I/O bus""" for device in self._off_chip_devices: device.pio = self.iobus.mem_side_ports +self.lupio_blk.dma = self.iobus.cpu_side_ports for device in self._on_chip_devices: device.pio = self.get_cache_hierarchy().get_mem_side_port() @@ -239,12 +240,12 @@ read_only=False ) image.child.image_file = disk_image -self.disk.vio.image = image +self.lupio_blk.image = image # Linux boot command flags kernel_cmd = [ "earlycon console=ttyLIO0", -"root=/dev/vda1", +"root=/dev/lda1", "ro" ] self.workload.command_line = " ".join(kernel_cmd) @@ -370,17 +371,19 @@ soc_node.append(plic_node) -# VirtIO MMIO disk node -disk = self.disk -disk_node = disk.generateBasicPioDeviceNode( -soc_state, "virtio_mmio", disk.pio_addr, disk.pio_size -) -disk_node.append(FdtPropertyWords("interrupts", [disk.interrupt_id])) -disk_node.append( -FdtPropertyWords("interrupt-parent", soc_state.phandle(plic)) -) -disk_node.appendCompatible(["virtio,mmio"]) -soc_node.append(disk_node) +# LupioBLK Device +lupio_blk = self.lupio_blk +lupio_blk_node = lupio_blk.generateBasicPioDeviceNode(soc_state, +"lupio-blk", lupio_blk.pio_addr, +lupio_blk.pio_size) +lupio_blk_node.appendCompatible(["lupio,blk"]) +lupio_blk_node.append( +FdtPropertyWords("interrupts", +[self.lupio_blk.int_id])) +lupio_blk_node.append( +FdtPropertyWords("interrupt-parent", +state.phandle(self.pic))) +soc_node.append(lupio_blk_node) # LupioRNG Device lupio_rng = self.lupio_rng -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53034 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ibb45ecff07c7ce5d5d7be8cd8e20e9f62b591b02 Gerrit-Change-Number: 53034 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe s
[gem5-dev] Change in gem5/gem5[develop]: dev,arch: Introduced new LupV Board
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53028 ) Change subject: dev,arch: Introduced new LupV Board .. dev,arch: Introduced new LupV Board This LupV Board was created in order to connect all of the LupIO devices, and allow us to run a full RISC-V system with them. As the LupIO devices continue to be added, they will be integrated into this board, and replace the current IO components. The LupIO devices are a collection of processor agnostic and easily implemented virtual devices. Details about the specifications of all eight LupIO devices can be found here: https://gitlab.com/luplab/lupio/lupio-specs Information about how to build a RISCV full system with the LupIO-RTC can be found here: https://github.com/darchr/lupio-gem5/blob/lupio/README.md Change-Id: I7d3186d3778d40b38027f245290432dbf4279dea --- M src/python/SConscript A src/python/gem5/components/boards/lupv_board.py 2 files changed, 422 insertions(+), 0 deletions(-) diff --git a/src/python/SConscript b/src/python/SConscript index d210960..407d30b 100644 --- a/src/python/SConscript +++ b/src/python/SConscript @@ -37,6 +37,7 @@ PySource('gem5.components.boards', 'gem5/components/boards/abstract_board.py') PySource('gem5.components.boards', 'gem5/components/boards/mem_mode.py') PySource('gem5.components.boards', 'gem5/components/boards/riscv_board.py') +PySource('gem5.components.boards', 'gem5/components/boards/lupv_board.py') PySource('gem5.components.boards', 'gem5/components/boards/simple_board.py') PySource('gem5.components.boards', 'gem5/components/boards/test_board.py') PySource('gem5.components.boards', 'gem5/components/boards/x86_board.py') diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py new file mode 100644 index 000..f205b98 --- /dev/null +++ b/src/python/gem5/components/boards/lupv_board.py @@ -0,0 +1,398 @@ +# Copyright (c) 2021 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. + +import os +from typing import Optional + +from ...utils.override import overrides +from .simple_board import SimpleBoard +from .abstract_board import AbstractBoard +from ..processors.abstract_processor import AbstractProcessor +from ..memory.abstract_memory_system import AbstractMemorySystem +from ..cachehierarchies.abstract_cache_hierarchy import AbstractCacheHierarchy +from ...isas import ISA +from ...runtime import get_runtime_isa + +import m5 +from m5.objects import ( +Bridge, +PMAChecker, +RiscvLinux, +RiscvRTC, +AddrRange, +IOXBar, +Clint, +Plic, +Uart8250, +Terminal, +LupioRTC, +LupV, +AddrRange, +CowDiskImage, +RawDiskImage, +Frequency, +RiscvMmioVirtIO, +VirtIOBlock, +Port, +) + +from m5.util.fdthelper import ( +Fdt, +FdtNode, +FdtProperty, +FdtPropertyStrings, +FdtPropertyWords, +FdtState, +) + +class LupvBoard(SimpleBoard): +""" +A board capable of full system simulation for RISC-V. +This board uses a set of LupIO education-friendly devices. +This board assumes that you will be booting Linux. + +**Limitations** +* Only works with classic caches +""" + +def __init__( +self, +clk_freq: str, +processor: AbstractProcessor, +memory: AbstractMemorySystem, +cache_hierarchy: AbstractCacheHier
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new LupIO-RTC device
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53026 ) Change subject: dev: Added new LupIO-RTC device .. dev: Added new LupIO-RTC device This device supplies the computer system with the simulated time by retrieving the current tick number and converting to seconds, then returning that time in ISO 8601 format. It is implemented as a BasicPioDevice and is read-only. The following are the specifications regarding the LupIO-RTC: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-rtc.md Change-Id: Ic99291e5c862e728dac90b15ca818d42f25cbbee --- A src/dev/lupio/lupio_rtc.cc A src/dev/lupio/lupio_rtc.hh A src/dev/lupio/SConscript A src/dev/lupio/LupioRTC.py 4 files changed, 302 insertions(+), 0 deletions(-) diff --git a/src/dev/lupio/LupioRTC.py b/src/dev/lupio/LupioRTC.py new file mode 100644 index 000..8392e65 --- /dev/null +++ b/src/dev/lupio/LupioRTC.py @@ -0,0 +1,35 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param + +class LupioRTC(BasicPioDevice): +type = 'LupioRTC' +cxx_class='gem5::LupioRTC' +cxx_header = 'dev/lupio/lupio_rtc.hh' +time = Param.Time('01/01/2020', "Initial system time to use") +pio_size = Param.Addr(0x1000, "PIO Size") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript new file mode 100644 index 000..443828e --- /dev/null +++ b/src/dev/lupio/SConscript @@ -0,0 +1,33 @@ +# Copyright (c) 2021 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. + +Import('*') + +SimObject('LupioRTC.py') + +DebugFlag('LupioRTC') + +Source('lupio_rtc.cc') diff --git a/src/dev/lupio/lupio_rtc.cc b/src/dev/lupio/lupio_rtc.cc new file mode 100644 index 000..16a3ae8 --- /dev/null +++ b/src/dev/lupio/lupio_rtc.cc @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2021 The Regents of the Unive
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new LupIO-TTY device
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53031 ) Change subject: dev: Added new LupIO-TTY device .. dev: Added new LupIO-TTY device This device is notfied when data is available from the terminal (e.g. from keyboard input) in order to receive characters. It also transmits characters to the terminal to be displayed. The following are the specifications regarding the LupIO-TTY: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-tty.md Change-Id: Icc8294984989cfa422d8ed227da39debfa49ab36 --- A src/dev/lupio/lupio_tty.cc A src/dev/lupio/lupio_tty.hh A src/dev/lupio/LupioTTY.py M src/dev/lupio/SConscript 4 files changed, 352 insertions(+), 0 deletions(-) diff --git a/src/dev/lupio/LupioTTY.py b/src/dev/lupio/LupioTTY.py new file mode 100644 index 000..972311f --- /dev/null +++ b/src/dev/lupio/LupioTTY.py @@ -0,0 +1,40 @@ +# Copyright (c) 2021 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. + +from m5.params import Param +from m5.proxy import Parent + +from m5.objects.Device import BasicPioDevice + +class LupioTTY(BasicPioDevice): +type = 'LupioTTY' +cxx_class = 'gem5::LupioTTY' +cxx_header = "dev/lupio/lupio_tty.hh" +terminal = Param.SerialDevice(Parent.any, "The terminal") +pio_size = Param.Addr(0x1000, "PIO size") +platform = Param.Platform(Parent.any, + "Platform this device is part of.") +int_id = Param.Int("Interrupt ID for the PIC to use") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index 485a324..94ede45 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -28,9 +28,12 @@ SimObject('LupioRNG.py') SimObject('LupioRTC.py') +SimObject('LupioTTY.py') DebugFlag('LupioRNG') DebugFlag('LupioRTC') +DebugFlag('LupioTTY') Source('lupio_rng.cc') Source('lupio_rtc.cc') +Source('lupio_tty.cc') diff --git a/src/dev/lupio/lupio_tty.cc b/src/dev/lupio/lupio_tty.cc new file mode 100644 index 000..725fd23 --- /dev/null +++ b/src/dev/lupio/lupio_tty.cc @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2021 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 BUSIN
[gem5-dev] Change in gem5/gem5[develop]: dev: Added new LupIO-RNG device
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53029 ) Change subject: dev: Added new LupIO-RNG device .. dev: Added new LupIO-RNG device This device is a random number generator that uses the Mersenne Twister in order to provide the system with a set of random numbers. It is implemented as a BasicPioDevice, and has both read and write capabilities. The following are the specifications regarding the LupIO-RNG: https://gitlab.com/luplab/lupio/lupio-specs/-/blob/main/lupio-rng.md Change-Id: Ia6aeb610ebe5589ed1f1548b823c5165236b03e6 --- A src/dev/lupio/LupioRNG.py A src/dev/lupio/lupio_rng.cc A src/dev/lupio/lupio_rng.hh M src/dev/lupio/SConscript 4 files changed, 287 insertions(+), 0 deletions(-) diff --git a/src/dev/lupio/LupioRNG.py b/src/dev/lupio/LupioRNG.py new file mode 100644 index 000..c6d2c17 --- /dev/null +++ b/src/dev/lupio/LupioRNG.py @@ -0,0 +1,40 @@ +# Copyright (c) 2021 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. + +from m5.objects.Device import BasicPioDevice +from m5.params import Param +from m5.proxy import Parent + +class LupioRNG(BasicPioDevice): + +type = 'LupioRNG' +cxx_class='gem5::LupioRNG' +cxx_header = 'dev/lupio/lupio_rng.hh' +pio_size = Param.Addr(0x1000, "PIO Size") +seed = Param.Int(0, "Initial seed for the random number generator") +platform = Param.Platform(Parent.any, + "Platform this device is part of.") +int_id = Param.Int("Interrupt ID to be used by the PIC") diff --git a/src/dev/lupio/SConscript b/src/dev/lupio/SConscript index 443828e..485a324 100644 --- a/src/dev/lupio/SConscript +++ b/src/dev/lupio/SConscript @@ -26,8 +26,11 @@ Import('*') +SimObject('LupioRNG.py') SimObject('LupioRTC.py') +DebugFlag('LupioRNG') DebugFlag('LupioRTC') +Source('lupio_rng.cc') Source('lupio_rtc.cc') diff --git a/src/dev/lupio/lupio_rng.cc b/src/dev/lupio/lupio_rng.cc new file mode 100644 index 000..f3036de --- /dev/null +++ b/src/dev/lupio/lupio_rng.cc @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2021 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)
[gem5-dev] Change in gem5/gem5[develop]: dev,arch: Added LupioTTY to LupVBoard
Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53032 ) Change subject: dev,arch: Added LupioTTY to LupVBoard .. dev,arch: Added LupioTTY to LupVBoard This added the new LupioTTY device to the growing LupVBoard, and replaced the Uart8250 device in this system. Change-Id: Ib9a09565e8522178fd9c9f900db9d3b87e8b48fb --- M src/python/gem5/components/boards/lupv_board.py 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py index 8e35538..d10cdcf 100644 --- a/src/python/gem5/components/boards/lupv_board.py +++ b/src/python/gem5/components/boards/lupv_board.py @@ -46,10 +46,10 @@ IOXBar, Clint, Plic, -Uart8250, Terminal, LupioRNG, LupioRTC, +LupioTTY, LupV, AddrRange, CowDiskImage, @@ -98,7 +98,7 @@ # Initialize all the devices that we want to use on this board # Interrupt IDS for PIC Device -self._int_ids = { 'UART': 1, 'DISK': 2, 'RNG': 3} +self._int_ids = { 'TTY': 1, 'DISK': 2, 'RNG': 3} # CLINT self.clint = Clint(pio_addr=0x200) @@ -109,7 +109,7 @@ #LupV Platform self.lupv = LupV( pic = self.pic, -uart_int_id = self._int_ids['UART'] +uart_int_id = self._int_ids['TTY'] ) # LUPIO RNG @@ -130,12 +130,16 @@ pio_addr=0x10008000, ) -# UART -self.uart = Uart8250(pio_addr=0x1000) +# LUPIO TTY +self.lupio_tty = LupioTTY( +pio_addr=0x20007000, +platform = self.lupv, +int_id = self._int_ids['TTY'] +) self.terminal = Terminal() pic_srcs = [ -self._int_ids['UART'], +self._int_ids['TTY'], self._int_ids['DISK'], self._int_ids['RNG'] ] @@ -157,7 +161,7 @@ self.pic, ] self._off_chip_devices = [ -self.uart, +self.lupio_tty, self.disk, self.lupio_rng, self.lupio_rtc @@ -239,7 +243,7 @@ # Linux boot command flags kernel_cmd = [ -"earlycon console=ttyS0", +"earlycon console=ttyLIO0", "root=/dev/vda1", "ro" ] @@ -366,21 +370,6 @@ soc_node.append(plic_node) -# UART node -uart = self.uart -uart_node = uart.generateBasicPioDeviceNode( -soc_state, "uart", uart.pio_addr, uart.pio_size -) -uart_node.append( -FdtPropertyWords("interrupts", [self._int_ids['UART']]) -) -uart_node.append(FdtPropertyWords("clock-frequency", [0x384000])) -uart_node.append( -FdtPropertyWords("interrupt-parent", soc_state.phandle(plic)) -) -uart_node.appendCompatible(["ns8250"]) -soc_node.append(uart_node) - # VirtIO MMIO disk node disk = self.disk disk_node = disk.generateBasicPioDeviceNode( @@ -414,6 +403,19 @@ lupio_rtc_node.appendCompatible(["lupio,rtc"]) soc_node.append(lupio_rtc_node) +# LupioTTY Device +lupio_tty = self.lupio_tty +lupio_tty_node = lupio_tty.generateBasicPioDeviceNode(soc_state, +"lupio-tty", lupio_tty.pio_addr, lupio_tty.pio_size) +lupio_tty_node.appendCompatible(["lupio,tty"]) +lupio_tty_node.append( +FdtPropertyWords("interrupts", +[self.lupio_tty.int_id])) +lupio_tty_node.append( +FdtPropertyWords("interrupt-parent", +state.phandle(self.pic))) +soc_node.append(lupio_tty_node) + root.append(soc_node) fdt = Fdt() fdt.add_rootnode(root) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53032 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ib9a09565e8522178fd9c9f900db9d3b87e8b48fb Gerrit-Change-Number: 53032 Gerrit-PatchSet: 1 Gerrit-Owner: Melissa Jost Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s