Commit Graph

20498 Commits

Author SHA1 Message Date
Giacomo Travaglini
f032eeae93 mem-ruby: Provide a fromSequencer helper function
Based on the CHIRequestType, it automatically tells if the
request has been originated from the sequencer
(CPU load/fetch/store)

Change-Id: I50fd116c8b1a995b1c37e948cd96db60c027fe66
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2023-09-08 08:38:13 +01:00
Giacomo Travaglini
5dbc48432f mem-ruby: Allow Addr as a controller member type
Change-Id: I63127ed06b4f871b74faad6c2c6436aebd118334
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2023-09-08 08:38:13 +01:00
Giacomo Travaglini
f7d6dadc10 mem-ruby: Allow trivial integer operations with Addr type
At the moment an address value can only be used in the slicc code
to do TBE lookups but there is no way to add/subtract/divide/multiply
two addresses nor an address and an integer value.

This hinders the development of protocol specific code and
forces developers to place such code in shared
C++ structures

Change-Id: Ia184e793b6cd38f951f475a7cdf284f529972ccb
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2023-09-08 08:38:13 +01:00
Giacomo Travaglini
ddb6749b62 mem-ruby: Add static_cast by value in SLICC
At the moment it is possible to static_cast by pointer/reference only:

static_cast(type, "pointer", val) -> static_cast<type*>(val);
static_cast(type, "reference", val) -> static_cast<type&>(val);

With this patch it will also be possible to do something like

static_cast(type, "value", val) -> static_cast<type>(val);

Which is important when wishing to convert integer types into
custom onces and viceversa.

This patch is also deferring static_cast type check to C++

At the moment it is difficult to use the static_cast utility in slicc as
it tries to handle type checking in the language itself. This would
force us to explicitly define compatible types (like an Addr and an int
as an example). Rather than pushing the burden on us, we should always
allow a developer to use a static_cast in slicc and let the C++ compiler
complain if the generated code is not compatible

Change-Id: I0586b9224b1e41751a07d15e2d48a435061c2582
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2023-09-08 08:38:13 +01:00
Bobby R. Bruce
aca67fe3a3 misc: Add test status badges to README.md (#233)
These allow visitors to the repository to quickly see the status of our
tests run on the develop branch.
2023-09-07 12:47:00 -07:00
Bobby R. Bruce
eb5ae35341 resources,stdlib: Add workload to resource specialization and deprecate workload.py (#212) 2023-09-07 12:45:45 -07:00
Bobby R. Bruce
9cdd6093bd util: Add docker prune cron to GitHub runners (#271)
Issue-on: https://github.com/gem5/gem5/issues/254

This has been implemented in the runners. The regular pruning of the
docker images should fix the issue.
2023-09-07 12:06:41 -07:00
Bobby R. Bruce
84e0224e85 util-docker: Proof-of-concept using Docker buildx (#273)
Introduced in https://github.com/gem5/gem5/pull/236 the
"docker-build.yaml" file will allow us to build and push docker images
to the GitHub Container Registry. This allows for both automation of
docker image building and allows us to utilize Github's zero-cost
pulling policy for downloads to GitHub Actions runners.

In this PR https://github.com/gem5/gem5/pull/236 has been altered to use
Docker `buildx` which allows for multi-platform Docker Image builds. A
multi-platform Docker image pull automatically pull the correct image
for your platform from a single URL. In this prototype the images are
build to both `linux/arm64` and `linux/amd64` have been set.

Docker `buildx` has it's own file format for specifying image builds
called `bake`. "util/dockerfiles/docker-bake.hcl" has been added with
the goal of replacing "util/dockerfiles/docker-compose.yaml".

In this proof-of-concept doesn't build all our docker images, just
enough to ensure it works inside our actions as intended.
2023-09-07 11:37:24 -07:00
Giacomo Travaglini
1fa1575f58 sim: add bypass_on_change to the set() of a signal (#279)
When reset a port, we don't want to trigger a onChange(). Offer an
option to bypass it and update state only.

Change-Id: Ia53b7a76d2a320ea67101096cdbfe2eafaf440d2
2023-09-07 18:42:08 +02:00
Johnny
105839ae2b sim: add bypass_on_change to the set() of a signal
When reset a port, we don't want to trigger a onChange().
Offer an option to bypass it and update state only.

Change-Id: Ia53b7a76d2a320ea67101096cdbfe2eafaf440d2
2023-09-07 11:54:56 +08:00
Bobby R. Bruce
0249d47acc util: Add docker prune cron to GitHub runners
Change-Id: Ic90ebc650b6a89606eaf9e8feafddfe15c44e578
Issue-on: https://github.com/gem5/gem5/issues/254
2023-09-06 15:09:32 -07:00
Bobby R. Bruce
e80cde0713 ext: Stop excluding 'ext/testlib' from pre-commit and format (#267)
Though in "ext" this directory is regularly modified. `pre-commit`
should run on these files.

This PR includes running `pre-commit run --files ext/testlib` to
reformat the files in "ext/testlib" using Python Black.
2023-09-06 11:18:19 -07:00
Bobby R. Bruce
cc757cfe7a misc: Fix buggy special path comparisons (#270)
This patch fixes the buggy special path comparisons in
src/kern/linux/linux.cc Linux::openSpecialFile(), which only checked for
equality of path prefixes, but not equality of the paths themselves.
This patch replaces those buggy comparisons with regular
std::string::operator== string equality comparisons.

GitHub issue: https://github.com/gem5/gem5/issues/269
2023-09-06 11:10:19 -07:00
Bobby R. Bruce
5d98d18fb6 misc: Fix CI GitHub Action to stop if Workflow re-triggered (#275)
This ensures that if the CI tests are running for a PR, and a new
workflow is triggered (typically by pushing/rebasing the PR) then the
older workflow is cancelled.
2023-09-06 11:09:52 -07:00
Harshil Patel
bbe96d6485 stdlib: Changed use of Workload to obtain_resource
- Changed files calling Workload class to call obtain_resoucre instead.

Change-Id: I41f5f0c3ccc7c08b39e7049eabef9609d6d68788
2023-09-06 10:06:16 -07:00
Bobby R. Bruce
12c6742607 misc: Fix CI GitHub Action to stop if Workflow re-triggered
This ensures that if the CI tests are running for a PR, and a new
workflow is triggered (typically by pushing/rebasing the PR) then the
older workflow is cancelled.

Change-Id: Ifa172bdbdac09c5a91abb41a0162c597445e4e2e
2023-09-05 20:49:28 -07:00
Bobby R. Bruce
d10d752d7e misc: Improve ".github/ISSUE_TEMPLATE/bug_report.md" (#268)
The bug report template used escape characters. This is not necessary as
the bug report is not rendered when creating a bug report. It is
displayed to the user in plain text for them to edit.

In addition languages have been added to the code-blocks and newlines
have been added and removed where appropriate to cleanup the document.
2023-09-05 18:00:28 -07:00
Bobby R. Bruce
1b0bb678ab util-docker: Proof-of-concept using Docker buildx
Introduced in https://github.com/gem5/gem5/pull/236 the
"docker-build.yaml" file will allow us to build and push docker images
to the GitHub Container Registry. This allows for both automation of
docker image building and allows us to utilize Github's zero-cost
pulling policy for downloads to GitHub Actions runners.

In this PR https://github.com/gem5/gem5/pull/236 has been altered to
use Docker `buildx` which allows for multi-platform Docker Image builds.
A multi-platform Docker image pull automatically pull the correct image
for your platform from a single URL. In this prototype the images are
build to both `linux/arm64` and `linux/amd64` have been set.

Docker `buildx` has it's own file format for specifying image builds
called `bake`. "util/dockerfiles/docker-bake.hcl" has been added with
the goal of replacing "util/dockerfiles/docker-compose.yaml".

In this proof-of-concept doesn't build all our docker images, just
enough to ensure it works inside our actions as intended.

Change-Id: Id0debed216c91ec514aa4fce3bc2ff4fc2ea669b
2023-09-05 17:59:06 -07:00
Nicholas Mosier
3dfdd48211 misc: Fix buggy special path comparisons
This patch fixes the buggy special path comparisons in
src/kern/linux/linux.cc Linux::openSpecialFile(), which only checked
for equality of path prefixes, but not equality of the paths
themselves. This patch replaces those buggy comparisons with
regular std::string::operator== string equality comparisons.

GitHub issue: https://github.com/gem5/gem5/issues/269

Change-Id: I216ff8019b9a6a3e87e364c2e197d9b991959ec1
2023-09-05 13:44:10 -07:00
Harshil Patel
bf06d61c35 stdlib, tests, resources: Updated tests
- Updated workload tests to use WrokloadResource and obtain_resource

Change-Id: I39194e7fe764566a528e5141c29f30efa14e0cde
2023-09-05 12:39:38 -07:00
Bobby R. Bruce
96144f90ed misc: Add pre-commit run to .git-blame-ignore-revs
Change-Id: Iaae9d735e2972e41f1f9225ea5bed9acf22ff991
2023-09-05 00:01:35 -07:00
Bobby R. Bruce
9e1afdecef ext: Run pre-commit run --files ext/testlib
Change-Id: Ic581132f6136dddb127e2a1c5a1ecc19876488c3
2023-09-05 00:00:25 -07:00
Bobby R. Bruce
ff75e5b30e misc,ext: Update pre-commit hook to run on ext/testlib
Though in ext, we regularly modify these files to add features and
extend our testlib testing infrastructure. Ergo, the pre-commit checks
should be run.

Change-Id: I921a263f25f850b03e5535a8a1f509921c124763
2023-09-05 00:00:25 -07:00
Bobby R. Bruce
2eeecc532a mem-ruby: Reorder SLC atomic and response actions (#255)
Currently the MOESI_AMD_Base-directory transition for system level
atomics sends the response message before the atomic is performed. This
was likely done because atomics are supposed to return the value of the
data *before* the atomic is performed and by simply ordering the actions
this way that was taken care of.

With the new atomic log feature, the atomic values are pulled from the
log by the coalescer on the return path. Therefore, these actions can be
reordered. In fact, it is now necessary that the atomics be performed
before sending the response so that the log is populated and copied by
the response action. This should fix #253 .
2023-09-02 04:48:45 -07:00
Bobby R. Bruce
1ec58d589a misc: Fix broken code example in bug_report.md
Change-Id: I9bc1b42d488a415d2ea165385d83fea3d4ac288d
2023-09-02 04:46:04 -07:00
Bobby R. Bruce
188d29fe05 misc: Add language specification to code-blocks
Change-Id: I875aeee7eb0f9970711a97448d3bcb7acddbe7b1
2023-09-02 04:44:07 -07:00
Bobby R. Bruce
fcb586cfed misc: Add/Remove new lines from bug_report.md
There were some weird newline characters in this file, or lack of lines.
This patch adds/removes them.

Change-Id: I6cc918788c07bbc4be5c68401ad3987be00fffc4
2023-09-02 04:42:53 -07:00
Bobby R. Bruce
0ac2f67437 misc: Remove escape characters from bug_report.md
The bug_report.md is rendered as plain text, not markdown, when creating
a bug report. As such the escape characters are removed in this commit.

Change-Id: I524c66ae61d00b7ed59153ba9f4b2297ff50ee18
2023-09-02 04:41:08 -07:00
Matthew Poremba
2da54d5a4f mem-ruby: Reorder SLC atomic and response actions
Currently the MOESI_AMD_Base-directory transition for system level
atomics sends the response message before the atomic is performed. This
was likely done because atomics are supposed to return the value of the
data *before* the atomic is performed and by simply ordering the actions
this way that was taken care of.

With the new atomic log feature, the atomic values are pulled from the
log by the coalescer on the return path. Therefore, these actions can be
reordered. However, it is now necessary that the atomics be performed
before sending the response so that the log is populated and copied by
the response action. This should fix #253 .

Change-Id: Ie7e178f93990975367de2cc3e89e5ef9c9069241
2023-09-01 10:36:54 -05:00
Bobby R. Bruce
c0db065c26 util: Add gdb to gcn-gpu Dockerfile (#248)
gdb was originally part of the ROCm 1.6 Dockerfile a few years ago. It
got removed when updating to ROCm 4.0. This adds it back as being able
to debug things is quite useful.
2023-09-01 00:29:44 -07:00
Bobby R. Bruce
8d47cda8b6 arch-x86: Fix wrong x86 assembly (#251)
The RM field of ModRM was printed as Reg field for several instructions.

For reference, this change fixes typos introduced by [1].

[1] https://gem5-review.googlesource.com/c/public/gem5/+/40339
2023-09-01 00:26:00 -07:00
Bobby R. Bruce
4de4e22553 misc: Remove 'run-name' from compiler-tests.yaml (#245)
This isn't necessary. Without 'run-name' the action's default name is
'run-name'. Displaying the actor who launched the action is pointless
for scheduled tests.
2023-08-31 17:38:38 -07:00
Bobby R. Bruce
ddd1bc1e48 gpu-compute: Set LDS/scratch aperture base register (#247)
Starting with gfx900 (Vega) the LDS and scratch apertures can be queried
using a new s_getreg_b32 instruction. If the instruction is called with
the SH_MEM_BASES argument it returns the upper 16 bits of a 64 bit
address for the LDS and scratch apertures. The current addresses cannot
be encoded in this register, so that addresses are changed to have the
lower 48 bits be all zeros in addition to writing the bases register.
2023-08-31 17:38:08 -07:00
Hoa Nguyen
4ff1f160ec arch-x86: Fix wrong x86 assembly
The RM field of ModRM was printed as Reg field for several instructions.

For reference, this change fixes typos introduced by [1].

[1] https://gem5-review.googlesource.com/c/public/gem5/+/40339

Change-Id: I41eb58e6a70845c4ddd6774ccba81b8069888be5
Signed-off-by: Hoa Nguyen <hn@hnpl.org>
2023-09-01 00:26:51 +00:00
Harshil Patel
7042d74ac2 stdlib, resources: Moved parsing params.
- moved parsing from WorkloadResource __init__ to obtain_resource

Change-Id: I9ed2aebb23af7f359bc1e5fff8ebe616a0da1374
2023-08-31 09:19:24 -07:00
Matthew Poremba
3520c83673 util: Add gdb to gcn-gpu Dockerfile
gdb was originally part of the ROCm 1.6 Dockerfile a few years ago. It
got removed when updating to ROCm 4.0. This adds it back as being able
to debug things is quite useful.

Change-Id: I3f8148cde79e6cc5233fa3c8c830b64817f01d3a
2023-08-31 11:08:30 -05:00
Matthew Poremba
cfa833a97d gpu-compute: Set LDS/scratch aperture base register
Starting with gfx900 (Vega) the LDS and scratch apertures can be queried
using a new s_getreg_b32 instruction. If the instruction is called with
the SH_MEM_BASES argument it returns the upper 16 bits of a 64 bit
address for the LDS and scratch apertures. The current addresses cannot
be encoded in this register, so that addresses are changed to have the
lower 48 bits be all zeros in addition to writing the bases register.

Change-Id: If20f262b2685d248afe31aa3ebb274e4f0fc0772
2023-08-31 11:01:32 -05:00
Bobby R. Bruce
7db2aac943 misc: Remove 'run-name' from compiler-tests.yaml
This isn't necessary. Without 'run-name' the action's default name is
'run-name'. Displaying the actor who launched the action is pointless
for scheduled tests.

Change-Id: I15d52959389881381ef7685efb57152c5162c89d
2023-08-31 02:12:20 -07:00
Bobby R. Bruce
0e323bc409 mem: Atomic ops to same address (#200)
Augmenting the DataBlock class with a change log structure to record the
effects of atomic operations on a data block and service these changes
if the atomic operations require return values.

Although the operations are atomic, the coalescer need not send unique
memory requests for each operation. Atomic operations within a wavefront
to the same address are now coalesced into a single memory request. The
response of this request carries all the necessary information to
provide the requesting lanes unique values as a result of their
individual atomic operations. This helps reduce contention for request
and response queues in simulation.

Previously, only the final value of the datablock after all atomic ops
to the same address was visible to the requesting waves. This change
corrects this behavior by allowing each wave to see the effect of this
individual atomic op is a return value is necessary.
2023-08-30 23:53:35 -07:00
Bobby R. Bruce
fceb7e05a3 util-docker: Add GitHub Action to create Docker Images (#236)
This is built to test the following assumptions:

1. We can trigger a GitHub action event on the changing of a
file/directory.
2. We can use GitHub actions to build a docker image.
3. We can use GitHub actions to push a docker image to a container
registry.
4. We can use GitHub's container registry.

Right now this will only build and push ubuntu-20.04_all-depenencies, as
a test.
2023-08-30 12:15:33 -07:00
Bobby R. Bruce
c156df620d resources, stdlib: Add support for local files in obtain_resource (#204)
This patch allows a local JSON file to specify a local path in the JSON
object of a Resource, through the "url" field.

Local paths can be entered with the prefix "file:" in the "url" field.

If the local path exists, then the Resource from there is copied into
the resource directory defined in the
function earlier.

This behavior is the same as using specific Resource classes (ex.
BinaryResource) and passing a local_path into the function.

But, the above class does not allow simultaneous creation of local
Resources and Workloads of those local Resources.

With this patch, someone can use a local JSON, specify the location of
local Resources and create a Workload from those Resources and test both
together.
2023-08-29 20:35:40 -07:00
KUNAL PAI
d52c7ce87f resources, stdlib: Add support for local files in obtain_resource
This patch allows a local JSON file to specify a local path
in the JSON object of a Resource, through the "url" field.

Local paths can be entered with the prefix "file:" in "url".
All File URI scheme formats are supported.

This behavior is the same as using specific Resource classes
(ex. BinaryResource) and passing a local_path into the function.

But, the above infrastructure does not allow simultaneous
creation of Resources and Workloads of those Resources.

With this patch, someone can use a local JSON, specify the location
of local Resources and create a Workload from those Resources and
test both together.

Also, this patch adds pyunit tests to check the functionality
of the function used to convert the "url" field into a path.

Change-Id: I1fa3ce33a9870528efd7751d7ca24c27baf36ad4
2023-08-29 09:47:03 -07:00
Harshil Patel
7da0aeee7d stdlib, resources: Updated warn messages
- Updated warn messages to be more clear.

Change-Id: I2a8922e96b5b544f2f229b01b3c51fc5e79995b4
2023-08-29 09:08:44 -07:00
Giacomo Travaglini
815d5b1cba util: Update & fix bug in m5stats2streamline.py (#211)
There is conversion error in ./util/streamline/m5stats2streamline.py
script to convert gem5 stats.txt,sys, system.tasks.txt to the apc folder
required by DS-5 streamline. The fix to the bug can convert to apc
folder without error. The zipped apc folder can then be imported in
older DS-5 v5.24 for visualization (didn't work with DS-5 v5.29).

Changes:
1) writeBinary function binary_list can have either string or ints and
it needs to be properly converted to bytes
2) packed32(x) function can have x as int or float. Incase of float it
needs to be converted to int

The bug was reported and solved primarily in the issue
https://github.com/gem5/gem5/issues/145

Change-Id: I6a52aa59e1582dd6bb06b2d1c49ddaf8fe61c997
2023-08-29 11:05:51 +02:00
Bobby R. Bruce
7cdce3a975 util-docker: Add GitHub Action to create Docker Images
This is built to test the following assumptions:

1. We can trigger a GitHub action event on the changing of a
   file/directory.
2. We can use GitHub actions to build a docker image.
3. We can use GitHub actions to push a docker image to a container
   registry.
4. We can use GitHub's container registry.

Right now this will only build and push ubuntu-20.04_all-depenencies, as
a test.

Change-Id: Ie1a55c97c6eef26281456c908e1200b27da4d961
2023-08-29 00:30:51 -07:00
Bobby R. Bruce
fee465c97c misc: Add test status badges to README.md
These allow visitors to the repository to quickly see the status of our
tests run on the develop branch.

Change-Id: I3658c0e0d9dea66feebd69588c8a29d369a0b43d
2023-08-28 23:01:56 -07:00
Bobby R. Bruce
68a48a2dfa mem-ruby: fix CHI sending the wrong snoop response (#219)
Do not respond with SnpRespData_I when the line is still present
upstream.
2023-08-28 16:21:25 -07:00
Bobby R. Bruce
737c611e72 mem-ruby: fix assert on CHI ReadUnique (#218)
DCT must be disabled when handling a ReadUnique where the copy need to
be upgraded.

Previously we were just asserting as it was assumed DCT is only enabled
for HNFs (which can "auto-upgrade"). However DCT may also be enabled for
intermediated levels of distributed shared caches above the HNFs.
2023-08-28 16:06:09 -07:00
Bobby R. Bruce
9d2e860d74 misc: Update CI tests to not run on draft PRs (#229)
This updates all the jobs for our CI tests to make sure they don't run
tests on draft pull request, and only trigger when ready for review
2023-08-28 15:19:49 -07:00
Bobby R. Bruce
4bd3d2f864 mem-ruby: Improve Ruby/CHI stats for in/out trans (#220)
Currently we generate these stats for all defined Events in the
protocol, which may generate too many stats that are never used. Though
these don't appear in the stats.txt file, they unnecessarily increases
simulation startup time and memory footprint.

This patch limits those stats to events with the "in_trans" and/or
"out_trans" properties. SLICC compiler then checks which combinations of
event+state are possible when generating the stats.

Also the possible level of detail for inTransLatHist was reduced.
Only the number of transactions for each event+initial+final state
combinations is now accounted. Latency histograms are only defined per
event type (similarly to outTransLatHist). This significantly reduces
the final file size for generated stats.
2023-08-28 15:06:39 -07:00