Commit Graph

20306 Commits

Author SHA1 Message Date
Leo Redivo
83374bdf99 misc: changed name get_default_disk_device to get_disk_device
Change-Id: Ida9673445a4426ddedc8221010204bd2b71103a5
2023-09-20 15:28:49 -07:00
Leo Redivo
020bc05928 misc: moved logic of get_disk_device to workload.command_line
Change-Id: I5313bb381d5d8983b050047849fae61ea7dfc63b
2023-09-14 11:47:19 -07:00
Leo Redivo
576e8c1897 misc: Move inform to get_default_kernel_args() and fix formatting
Change-Id: I788b630d811f8268da0e87923741cf9afdef0a3e
2023-08-11 15:07:41 -07:00
Leo Redivo
cf1678f43f misc: Fix pre-commit formatting issues
Change-Id: I50e71cfc21d43c2c17da52cf2f40591599907548
2023-08-04 13:15:55 -07:00
leoredivo
052c870058 New function to kernel_disk_workload to allow new disk device location
Added a parameter to kernel_disk_workload which allows users to change the disk device location. Maintained the previous way of setting a disk device as the default, however added a function to allow users to override this default
2023-08-01 16:51:36 -07:00
Bobby R. Bruce
dceabe5fda dev-amdgpu: Support for ROCm 5.4+ and MI200 (#141) 2023-07-31 10:24:46 -07:00
Jason Lowe-Power
4ee6dbc330 mem: Minor typo fix in packet.hh (#143)
Change-Id: I07c31b7a62d83fe3250b48141951aec3c2f280df
2023-07-31 10:01:50 -07:00
Matthew Poremba
f8490e4681 configs: Only require MMIO trace for Vega10
The MMIO trace contains register values for parts of the GPU that are
not modeled in gem5, such as registers related to the graphics core.
Since MI100 and MI200 do not have anything that is not modeled, the
MMIO trace is not needed, therefore it does not need to be used or
checked and the command line option goes away entirely for MI100/200.

Change-Id: I23839db32b1b072bd44c8c977899a99347fc9687
2023-07-30 13:17:05 -05:00
Matthew Poremba
3589a4c11f arch-vega: Implement translate further
Starting with ROCm 5.4+, MI100 and MI200 make use of the translate
further bit in the page table. This bit enables mixing 4kiB and 2MiB
pages and is functionally equivalent to mixing page sizes using the
PDE.P bit for which gem5 currently has support.

With PDE.P bit set, we stop walking and the page size is equal to the
level in the page table we stopped at. For example, stopping at level
2 would be a 1GiB page, stopping at level 3 would be a 2MiB page.
This assumes most pages are 4kiB.

When the F bit is used, it is assumed most pages are 2MiB and we will
stop walking at the 3rd level of the page table unless the F bit is set.
When the F bit is set, the 2nd level PDE contains a block fragment size
representing the page size of the next PDE in the form of 2^(12+size).
If the next page has the F bit set we continue walking to the 4th level.
The block fragment size is hardcoded to 9 in the driver therefore we
assert that the block fragment size must be 0 or 9.

This enables MI200 with ROCm 5.4+ in gem5. This functionality was
determine by examining the driver source code in Linux and there is no
public documentation about this feature or why the change is made in or
around ROCm 5.4.

Change-Id: I603c0208cd9e821f7ad6eeb1d94ae15eaa146fb9
2023-07-30 13:17:05 -05:00
Matthew Poremba
3b35e73eb8 dev-amdgpu: Implement SDMA constant fill
This SDMA packet is much more common starting around ROCm 5.4.
Previously this was mostly used to clear page tables after an
application ended and was therefore left unimplemented. It is
now used for basic operation like device memsets.

This patch implements constant fill as it is now necessary.

Change-Id: I9b2cf076ec17f5ed07c20bb820e7db0c082bbfbc
2023-07-30 13:17:05 -05:00
Matthew Poremba
618b2a60de arch-vega, dev-amdgpu: Fix for memory leaks (#129)
When using the new operator, delete should be called
on any allocated memory after it's use is complete.

Change-Id: Id5fcfb264b6ddc252c0a9dcafc2d3b020f7b5019
2023-07-30 10:48:17 -07:00
Matthew Poremba
b35c2ba8c5 arch-vega: Fix vop2Helper scalar support (#142)
A previous change added a vop2Helper to remove 100s of lines of common
code from VOP2 instructions related to processing SDWA and DPP support.
That change inadvertently changed the type of operand source 0 from
const to non-const. The vector container operator[] does not allow
reading a scalar value such as a constant, a dword literal, etc. The
error shows up in the form of: assert(!scalar) in operand.hh.

Since the SDWA and DPP cases need to modify the source vector and
non-SDWA/DPP cases might require const, we make a non-const copy of the
const source 0 vector and place it in a temporary non-const vector. This
non-const vector is passed to the lambda function implementation of the
instruction. This prevents needing a const and non-const version of the
lambda and avoids needing to propagate the template parameters through
the various SDWA/DPP helper methods which seems like it will not work
anyways as they need to modify the vector.

As a result of this, as more VOP2 instructions are implemented using
this helper, they will need to specify the const and non-const template
parameters of the vector container needed for the instruction.

Change-Id: Ia0b3c550d7de32b830040007a110f4821e3385aa
2023-07-30 10:47:36 -07:00
Ranganath (Bujji) Selagamsetty
ede4d89a83 arch-vega, dev-amdgpu: Fix for memory leaks
When using the new operator, delete should be called
on any allocated memory after it's use is complete.

Change-Id: Id5fcfb264b6ddc252c0a9dcafc2d3b020f7b5019
2023-07-28 19:14:46 -05:00
Jason Lowe-Power
81cc57b828 gpu-compute: "<random>" -> "base/random.hh" in testers/gpu... (#140)
In "src/cpu/testers/gpu_ruby_test" a random number generator was used.
This was using the CPP "<random>" library. This patch changes it to the
gem5 random class (that declared in "base/random.hh").

In addition to this, undeterministic behavior has been removed. Via
"protocol_tester.cc" the RNG is either seeded with a seed specified by
the user, or goes with the gem5 default seed. This ensures reproducable
runs. Prior to this patch the RNG was seeded with `time(NULL)`. This
made finding faults difficult.

This, at least partially, addresses Issue #138

Change-Id: Ia8e9f7b87e91323f828e0b7f6c3906c0c5793b2c
2023-07-28 16:54:24 -07:00
Ranganath (Bujji) Selagamsetty
3f2899a7a8 mem: Minor typo fix in packet.hh
Change-Id: I07c31b7a62d83fe3250b48141951aec3c2f280df
2023-07-28 17:28:10 -05:00
Matthew Poremba
6b020ed033 arch-x86: Move CPUID values to python (#113)
arch-x86: Move CPUID values to python

CPUID values for X86 are currently hard-coded in the C++ source file.
This makes it difficult to configure the bits if needed. Move these to
python instead. This will provide a few benefits:

1. We can enable features for certain configurations, for example AVX
can be enabled when the KVM CPU is used, but otherwise should not be
enabled as gem5 does not have full AVX support.
2. We can more accurately communicate things like cache/TLB sizes based
on the actual gem5 configuration. The CPUID values are can be used by
some libraries, e.g., MPI, to query system topology.
3. Enabling some bits breaks things in certain configurations and this
can be prevented by configuring in python. For example, enabling AVX
seems to currently be breaking SMP, meaning gem5 can only boot one CPU
in that configuration.
2023-07-28 14:52:13 -07:00
Bobby R. Bruce
08a3762a14 gpu-compute: Add warn for random_seed == 0 case
Addresses:
https://github.com/gem5/gem5/pull/140#pullrequestreview-1552383650

Change-Id: Ia09a2bc74f35d3d6cb066efaf9d113db6caf4557
2023-07-28 12:55:18 -07:00
Bobby R. Bruce
48ac1ea38d gpu-compute: "<random>" -> "base/random.hh" in testers/gpu...
In "src/cpu/testers/gpu_ruby_test" a random number generator was used.
This was using the CPP "<random>" library. This patch changes it to the
gem5 random class (that declared in "base/random.hh").

In addition to this, undeterministic behavior has been removed. Via
"protocol_tester.cc" the RNG is either seeded with a seed specified by
the user, or goes with the gem5 default seed. This ensures reproducable
runs. Prior to this patch the RNG was seeded with `time(NULL)`. This
made finding faults difficult.

Change-Id: Ia8e9f7b87e91323f828e0b7f6c3906c0c5793b2c
2023-07-28 12:55:03 -07:00
Matthew Poremba
c722b0c73d arch-vega: Fix vop2Helper scalar support
A previous change added a vop2Helper to remove 100s of lines of common
code from VOP2 instructions related to processing SDWA and DPP support.
That change inadvertently changed the type of operand source 0 from
const to non-const. The vector container operator[] does not allow
reading a scalar value such as a constant, a dword literal, etc. The
error shows up in the form of: assert(!scalar) in operand.hh.

Since the SDWA and DPP cases need to modify the source vector and
non-SDWA/DPP cases might require const, we make a non-const copy of the
const source 0 vector and place it in a tempoary non-const vector. This
non-const vector is passed to the lambda function implementation of the
instruction. This prevents needing a const and non-const version of the
lambda and avoids needing to propagate the template parameters through
the various SDWA/DPP helper methods which seems like it will not work
anyways as they need to modify the vector.

As a result of this, as more VOP2 instructions are implemented using
this helper,they will need to specify the const and non-const template
parameters of the vector container needed for the instruction.

Change-Id: Ia0b3c550d7de32b830040007a110f4821e3385aa
2023-07-28 13:47:55 -05:00
Bobby R. Bruce
31230025e9 misc: Sync CONTRIBUTING.md with website (#130)
This change syncs the repo's contributing documentation with that of the
website's contributing documentation:
https://www.gem5.org/contributing

From now on we'll attempt to keep the repo's CONTRIBUTING.md
documentation in sync with that on the website.

Change-Id: I2c91e6dd5cd7a9b642377878b007d7da3f0ee2ad
2023-07-28 09:42:28 -07:00
Matthew Poremba
9acfc5a751 configs: Enable AVX2 for GPUFS+KVM
AVX is a requirement for some ROCm libraries, such as rocBLAS, which are
themselves requirements for libraries higher up the stack like PyTorch.
This patch sets the necessary CPUID bits in the GPUFS config to enable
AVX, AVX2, and various SSE features so that applications using these
libraries do not cause an illegal instruction trap.

Change-Id: Id22f543fb2a06b268271725a54075ee6a9a1f041
2023-07-28 11:34:04 -05:00
Matthew Poremba
7c3c2b05f3 arch-x86: Add extended state CPUID function
The extended state CPUID function is used to set the values of the XCR0
register as well as specify the size of storage for context switching
storage for x87 and AVX+. This function is iterative and therefore
requires (1) marking it as such in the hsaSignificantIndex function (2)
setting multiple sets of 4-tuples for the default CPUID values where the
last 4-tuple ends with all zeros.

Change-Id: Ib6a43925afb1cae75f61d8acff52a3cc26ce17c8
2023-07-28 11:34:04 -05:00
Matthew Poremba
3584c3126c arch-x86: Expose CR4.osxsave bit
Related to the recent changes with moving CPUID values to python, this
value is needed to enable AVX and needs a way to be exposed to python as
well in order to set the bit and the corresponding CPUID values at the
same time.

Change-Id: I3cadb0fe61ff4ebf6de903018a8d8a411bfdb4e0
2023-07-28 11:34:04 -05:00
Matthew Poremba
3946f7ba2c arch-x86: Support CPUID functions with indexes
Various CPUID functions will return different values depending on the
value of ECX when executing the CPUID instruction. Add support for this
in the X86 KVM CPU. A subsequent patch will add a CPUID function which
requires iterating through multiple ECX values.

Change-Id: Ib44a52be52ea632d5e2cee3fb2ca390b60a7202a
2023-07-28 11:34:04 -05:00
Matthew Poremba
63d98018ea arch-x86: Move CPUID values to python
CPUID values for X86 are currently hard-coded in the C++ source file.
This makes it difficult to configure the bits if needed. Move these to
python instead. This will provide a few benefits:

1. We can enable features for certain configurations, for example AVX
can be enabled when the KVM CPU is used, but otherwise should not be
enabled as gem5 does not have full AVX support.
2. We can more accurately communicate things like cache/TLB sizes based
on the actual gem5 configuration. The CPUID values are can be used by
some libraries, e.g., MPI, to query system topology.
3. Enabling some bits breaks things in certain configurations and this
can be prevented by configuring in python. For example, enabling AVX
seems to currently be breaking SMP, meaning gem5 can only boot one CPU
in that configuration.

Change-Id: Ib3866f39c86d61374b9451e60b119a3155575884
2023-07-28 11:34:04 -05:00
Bobby R. Bruce
dcf3c4ba98 misc: Sync CONTRIBUTING.md with website
This change syncs the repo's contributing documentation with that of the
website's contributing documentation:
https://www.gem5.org/contributing

From now on we'll attempt to keep the repo's CONTRIBUTING.md
documentation in sync with that on the website.

Change-Id: I2c91e6dd5cd7a9b642377878b007d7da3f0ee2ad
2023-07-27 10:11:46 -07:00
Bobby R. Bruce
65b99fffc9 util: Ignore line length check for #include pragma in C/C++ files (#134)
The length of the path of #include pragmas can be more than
79-character long. The length of the path of a #include pragma
can be outside of user's control.
2023-07-27 09:39:18 -07:00
Bobby R. Bruce
42b65cad68 misc: Add missing dependency to daily tests (#136)
The refactoring to the daily tests was missing the dependency on the
'name-artifacts' job, which is necessary for downloading all the gem5
artifacts. This adds it in so the tests run as expected.

Change-Id: I0d71ab147395f41c881f2b24597bc07006e1f9c0
2023-07-27 09:38:23 -07:00
Bobby R. Bruce
5aa955212f learning-gem5: Add a missing override (#135) 2023-07-27 09:37:52 -07:00
Jason Lowe-Power
ea18c2f417 cpu: Set SLC bit for GPU tester (#133)
This fixes issue #131 by reverting to the old behavior of performing all
atomics at the system level. To do this the SLC bit needs to be set for
all atomic requests.

Change-Id: I63f4e449be1b02c933832d09700237f8c8026f4c
2023-07-27 07:37:52 -07:00
Melissa Jost
415a6eb9d4 misc: Add missing dependency to daily tests
The refactoring to the daily tests was missing the dependency
on the 'name-artifacts' job, which is necessary for downloading
all the gem5 artifacts.  This adds it in so the tests run as
expected.

Change-Id: I0d71ab147395f41c881f2b24597bc07006e1f9c0
2023-07-26 23:49:39 -07:00
Hoa Nguyen
f19945e9cb ext: Remove the test
Change-Id: I5c174ad388f63e7846dab5d9497ab2faa73ca6f7
Signed-off-by: Hoa Nguyen <hn@hnpl.org>
2023-07-26 21:29:00 -07:00
Bobby R. Bruce
5888ea68a3 misc: Split up tests in daily-tests.yaml (#105)
This splits up the gem5 library example tests by Suite UID, as right now
running them together uses the runner for a long period of time. It is
important to note that doing this means additional tests from this
directory will need to be manually added, such as the kvm tests.

Change-Id: Ib2a0aca08f9b51b60e9dd0528324372cf2d98c05
2023-07-26 21:04:18 -07:00
Hoa Nguyen
bd82e6f1a7 learning-gem5: Add a missing override
Change-Id: I9acebe6f3096b499fa2c69b6d757373431f63c71
Signed-off-by: Hoa Nguyen <hn@hnpl.org>
2023-07-26 20:01:37 -07:00
Hoa Nguyen
9ec7a1c14a util: Ignore line length check for #include pragma in C/C++ files
The length of the path of the #include pragma can be more than
79-character long.

Change-Id: Id72250c166370c7f456bd1f7d05589a49c14c33d
Signed-off-by: Hoa Nguyen <hn@hnpl.org>
2023-07-26 19:41:04 -07:00
Matthew Poremba
ff7e67ee93 cpu: Set SLC bit for GPU tester
This fixes #131 by reverting to the old behavior of performing all
atomics at the system level. To do this the SLC bit needs to be set for
all atomic requests.

Change-Id: I63f4e449be1b02c933832d09700237f8c8026f4c
2023-07-26 21:18:26 -05:00
Jason Lowe-Power
21b4ad609f mem: Make functional request a response when satisfied by queue (#124)
In the memory controller, MemCtrl::MemoryPort::recvFunctional, when the
functional request is satisfied by the ctrl-response queue, correctly
make the packet a response.

This change mirrors AbstractMemory::functionalAccess, which uses
Packet::makeResponse() after satisfying the request.

Note:
bool trySatisfyFunctional(..) functions return true or false based on
whether the request was satisfied.
void recvFunctional(..) functions modify the packet to indicate
successful request satisfaction.
2023-07-26 17:03:16 -07:00
Bobby R. Bruce
6a503d52cd misc: Updating TESTING.md (#121)
This updates the TESTING.md to reflect the current state of the tests in
the gem5 repository and how they interact with the GitHub Actions
infrastructure.
2023-07-26 16:24:56 -07:00
Bobby R. Bruce
c056ef07a5 tests: Deprecate Gerrit/Jenkins testing scripts (#126)
These testing scripts are no longer used since moving to GitHub. The
Nightly (now refered to as "Daily" tests), the Weekly Tests, Compiler
Tests and the CI (Kokoro, pre-commit) tests are run via the GitHub
Actions infrastructure. Their setup is described via Workflow files in
".github/workflows". To run tests locally please consult the
"TESTING.md" file.

These scripts may still be useful to reference and are therefore being
moved into a deprecated state.

Change-Id: Ie75c2f4f1179eb73d0f45ba0b259e8d79aa02ace
2023-07-26 16:24:41 -07:00
Melissa Jost
7371dd51b9 misc: Move gem5 library example tests into a matrix
This moves the gem5 library example tests into a separate matrix,
so they can run on separate runners

Change-Id: Ie9f51b5bae9e7e424d1c98b545b4cf92b481a2fb
2023-07-26 16:19:12 -07:00
Melissa Jost
62df5ae35f misc: Refactor daily-tests.yaml
This changes the daily tests to use a matrix in order to run
tests.  It also includes forces the cleaning step to run
regardless of success or failure.  With this refactoring, now
all builds of gem5 must finish before any tests run, and all
tests download all artifacts from all the build runs.

Change-Id: I16e1bc9acaf619feb85fba53eb6129e7df3fe409
2023-07-26 16:19:11 -07:00
Bobby R. Bruce
ce8e1b6aaa tests: Deprecate Gerrit/Jenkins testing scripts
These testing scripts are no longer used since moving to GitHub. The
Nightly (now refered to as "Daily" tests), the Weekly Tests, Compiler
Tests and the CI (Kokoro, pre-commit) tests are run via the GitHub
Actions infrastructure. Their setup is described via Workflow files
in ".github/workflows". To run tests locally please consult the
"TESTING.md" file.

These scripts may still be useful to reference and are therefore being
moved into a deprecated state.

Change-Id: Ie75c2f4f1179eb73d0f45ba0b259e8d79aa02ace
2023-07-26 10:54:57 -07:00
Atri Bhattacharyya
256729a40c mem: Make functional request a response when satisfied by queue
In the memory controller, MemCtrl::MemoryPort::recvFunctional,
when the functional request is satisfied by the ctrl-response queue,
correctly make the packet a response.

This change mirrors AbstractMemory::functionalAccess, which uses
Packet::makeResponse() after satisfying the request.

Change-Id: I47917062d3270915a97eed2c9fade66ba17019eb
2023-07-26 17:34:24 +02:00
Bobby R. Bruce
949119b5bb misc: Add Pyunit Test info to TESTING.md
Change-Id: Ibff77963653600ac7c9d706edca882d95e5c47df
2023-07-25 20:42:02 -07:00
Bobby R. Bruce
56a9bec602 misc: Update GitHub Actions text in TESTING.md
This change simplifies the explanation of how GitHub actions works.

Change-Id: Ia1540008463b8584f172c40ca7b4826cbbf95eb7
2023-07-25 20:22:00 -07:00
Bobby R. Bruce
cb98715514 misc: Add 'testing resources' sec to TESTING.md
Change-Id: Ie8a9c9200461d4f9e272dea75de1755b1b18aceb
2023-07-25 20:04:43 -07:00
Bobby R. Bruce
2846df946a misc: Remove test binary sections from TESTING.md
These sections are very out-of-date and confusing.

Change-Id: I61aae0686f38671e46412e27ea516a5e06f4e6f2
2023-07-25 19:50:17 -07:00
Bobby R. Bruce
00b2846109 misc: Update TESTING.md for subset selection
This change:

1. Removes the 'Specifying a subset of tests to run' section. This
   section is no longer useful since tests are no longer divided up so
   neatly by tags as they once were.
2. Adds a section outlining the 'quick', 'long' and 'very-long' tests
   and how they may be selected and run.

Change-Id: I61370dd80cc925a15d1a22755faa7d62e810862f
2023-07-25 19:43:24 -07:00
Bobby R. Bruce
7601fcfba6 cpu-minor: Check pc valid before printing (#107)
In https://gem5-review.googlesource.com/c/public/gem5/+/52047 inst.pc
was changed from an object to a pointer. It is possible that this
pointer is null (e.g., if there is an interrupt and there is a bubble).
Make sure to check that it's not null before printing.

I believe that other places this pointer is dereferenced without an
explicit null check are safe, but I'm not certain.

Should fix #97 

Change-Id: Idbe246cfdb62d4d75416d41b451fb3c076233bbc
2023-07-25 17:14:38 -07:00
Melissa Jost
556c9154dd base: Add maybe_unused to findLsbSetFallback (#109)
When compiling with clang-14 I received the following error:

```
src/base/bitfield.hh:328:1: error: function 'findLsbSetFallback' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
```

This function was introduced in PR #76.
This fixes this compiler warning/error by using `[[maybe_unused]]`.

Change-Id: I0b99eab0a9e42ee1687e7a0594a5a7bf9588b422
2023-07-25 10:41:59 -07:00