Commit Graph

18923 Commits

Author SHA1 Message Date
Richard Cooper
a9bf1a2d08 util-m5: Fix Scons exports when building the m5 utility
The name of the imported environment in ext/googletest/SConscript was
changed from `main` to `env` in [1].

Updated the `exports` when building the `m5` utility to export the
correct name.

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

Change-Id: I195b760e9092fbe63e5de1316403e090c1fa4e1f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57909
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-24 11:06:26 +00:00
Gabe Black
c11dc40f06 arch-arm,base: Use SourceLib() in a few simple spots.
There are a couple places where SourceLib(), an interface to SCons's
LIB variable that respects tags, can be used simply in existing
SConscripts. Do that so that SourceLib is used, and as an example if
someone wants to see it in action.

Change-Id: Idb27da17724990093252b710f5f9fde8351a4bc5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58070
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-23 20:39:28 +00:00
Matt Sinclair
9f6800e530 tests,configs,mem-ruby: Handle num DMAs in GPU Ruby tester
Currently the GPU Ruby tester does not support requests returned
as aliased.  To get around this, the GPU Ruby tester needs
numDMAs to be 0.  To enable this, change the default value to allow
us to identify when a user wants more DMAs.

Change-Id: I0a31f66c831f0379544c15bd7364f185e1edb1b2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57535
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
2022-03-23 20:34:04 +00:00
Richard Cooper
48ed8407c9 cpu: Fix build for MacOS.
* The value of build environment variable KVM_ISA is serialized into
  the generated file `kvm_isa.hh'. This value should be a string, but on
  hosts where the KVM headers are not available, the default `None` is
  inserted. Changed the default value to the string `""` in this case.

* Added missing include for `std::array`.

Change-Id: I651122cc46fc9c0757f592b05f4b4cab285cb91f
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57889
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-23 13:58:28 +00:00
Yu-hsin Wang
2ced661aed base: change bitunion default constructor to default
Current implementation prevents customers from performing zero
initialize on BitUnion class. Customers would get unexpected results
when writing `BitUnion{}`. Changing the default constructor to default
can solve this issue.

After changing the default constructor, the test failed with unused
variable. I also change one with zero initializer and make the other
with maybe_unused label.
```
tests/build/ARM/base/bitunion.test.cc:133:14: error: 'emptySixteen' defined but not used [-Werror=unused-variable]
  133 | EmptySixteen emptySixteen;
      |              ^~~~~~~~~~~~
tests/build/ARM/base/bitunion.test.cc:132:16: error: 'emptyThirtyTwo' defined but not used [-Werror=unused-variable]
  132 | EmptyThirtyTwo emptyThirtyTwo;
      |                ^~~~~~~~~~~~~~
```

Change-Id: Icbed36b3fa6751cbda63e84443eaab6d865d9bd6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57730
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-23 02:21:02 +00:00
Bobby R. Bruce
e1714d7833 stdlib: Add file lock to the resources.json download
There have been failures on the weekly tests during the decoding of the
downloaded resources.json base64 file. These errors suggested an
incomplete download or some form of file corruption. These errors only
ever seem to occur when multiple threads of gem5 are running. It has
therefore been proposed that perhaps, in some cases, the cached
downloaded file was bring re-downloaded while also being read by
another thread. For this reason this patch adds a filelock so only one
instance of gem5, at any one time, can download and read the
resources.json file. Even if this is not the cause of the weekly test
errors, it still adds some additional safeguards.

Change-Id: I7c6e1c1786c1919e8519587e53b6a77f4aafa932
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57789
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-22 23:41:48 +00:00
Matthew Poremba
2390cd1143 dev-amdgpu: Add SystemHub for GPU load/store to host
In a dGPU configuration, vector and scalar loads/stores can either be
requests to device memory or host memory depending on if the system bit
is set in the PTE when the request's virtual address is translated. This
object is used to send/receive those requests to the host via DMA.

This object will be used in a later changeset by the compute unit and
fetch units to issue data and instruction loads from the GPU which
translate to physical addresses on the host/cpu memory.

Change-Id: I4537059f90ebc03f3b2e6b8b631b4c452841f83f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51851
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-22 17:35:59 +00:00
Matthew Poremba
42b56ceb7b dev-amdgpu: Add memory manager for GPU VRAM
The memory manager is responsible for reading and writes to VRAM memory
for direct requests that bypass GPU caches.

Change-Id: I4aa1e77737ce52f2f2c01929b58984126bdcb925
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51850
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-22 17:35:59 +00:00
Matthew Poremba
b7826f1329 dev-amdgpu: Add GPU interrupt handler object
Add device interrupt handler for amdgpu device. The interrupt handler is
primarily used to signal that fences in the kernel driver can be passed.

Change-Id: I574fbfdef6e3bae310ec7f86058811e1e4886df6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51849
Maintainer: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-22 17:35:59 +00:00
Matthew Poremba
8da24ea088 dev-amdgpu: Add aperture base definitions file
These are used in subsequent patches. Adding all of them at once.

Change-Id: Idbb43b7daba1732a32d8033adcb1178a1c581b43
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57769
Maintainer: Matthew Poremba <matthew.poremba@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-03-22 17:35:59 +00:00
Gabe Black
b9f4b9e130 scons: Add a SourceLib method for adding libs to gem5.
Sometimes a library is needed to support particular functionality in
gem5, and that functionality is only used (or even desirable) in
certain binaries SCons can build. We can currently filter sources to
include in a particular executable using tags, but libraries have been
added to the environment globally using the LIBS variable which applies
to all Executables.

This change adds a SourceLib() mechanism which is a new category of
source which represents libraries. This is independent from classes
which inherit from SourceFile which represent actual files, as opposed
to more abstract libraries.

When gem5 builds an executable, the filters it provides are used to
select both Source()-es, aka c/c++ files, and libraries. If something
like a unit test does not need all the libraries gem5 proper does,
then those won't be picked up by its filter, and it won't include them.

Change-Id: I003e029eb82f7800a7ecff698c260e2d18ea2900
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58069
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-22 07:08:59 +00:00
Luming Wang
b3f1e5f9d7 sim-se: add getrandom() syscall support
getrandom() was introduced in version 3.17 of the Linux kernel.
This commit implements getrandom() for Gem5 SE mode.

Change-Id: I86bfeee52048184dbf72330284933b70daab5850
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57809
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-03-22 02:05:32 +00:00
Giacomo Travaglini
d1ba94ac41 util: Remove python3-six package from dockerfiles
python six package is not used in gem5 as we don't support
python2 anymore

Change-Id: I25a682842ad00c0b5e09c9cb4ea6efac5114da6d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57969
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-21 09:38:14 +00:00
Gabe Black
36618ad057 arch-x86: Add some missing checks to STI and CLI.
Also make sure those instructions won't truncate the flags register.

Change-Id: Id55a4454480cd20ca462c08b93043254a9962dfe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55892
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-19 13:38:12 +00:00
Gabe Black
4d970c59b5 arch:arch-x86: Fix style of some classes in the ucode assembler.
Change-Id: I13091707f4e44980ad9a3df022fbbfbafb1d0969
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56332
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-19 13:37:33 +00:00
Gabe Black
02cfdcfcc9 arch,arch-x86: Consolidate the add_microop method.
This was defined in the Micro_Container base class, and then again in
each subclass. The base definition was different and less complete than
the others, but the others were identical. Replace the base class
definition with the definition in the subclasses, and delete the ones in
the subclasses.

Change-Id: Ib2d1ce72958ec299115efb6efced2bd14c08467c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56330
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-19 13:36:57 +00:00
Gabe Black
e13d482f3f arch-x86: Remove __init__ from the X86MicrocodeRom class.
This is just setting up an empty dict the base class already sets up.

Change-Id: I22b00799f3424f9ced784c3d25771b979865e53d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56329
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-19 13:36:36 +00:00
Gabe Black
2eb3ac3880 arch: Switch to a new state to process macrocoop headers.
The "header" of a macroop definition is the part after "def rom" but
before the "{". This is pretty minimal now, but will be more complex
once macros are introduced.

Change-Id: I002d6501a015f46be6ae28b8d2a5e6064438da32
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56328
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-19 13:36:20 +00:00
Gabe Black
8beab79f19 arch-x86: Use push_state in the microcode assembler.
Use push_state and pop_state in the microcode assembler to enter/exit
the params state. That will make that state usable in other contexts,
rather than forcing the lexer into the asm state afterwards.

Change-Id: Id80747db6e52a6f6f15ebe36ec54524fa3405581
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56327
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-19 13:36:20 +00:00
Gabe Black
9f0cb266cd arch-x86: Implement IntCSCheck for legacy mode.
Change-Id: Ic011b796cbccec030ffcb52ee4033ceaee6bf8fa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56324
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-19 13:36:00 +00:00
Matt Sinclair
a8aa175c7f configs, gpu-compute: change default GPU reg allocator to dynamic
The current default GPU register allocator is the "simple" policy,
which only allows 1 wavefront to run at a time on each CU.  This is
not very realistic and also means the tester (when not specifically
choosing the dynamic policy) is less rigorous in terms of validating
correctness.

To resolve this, this commit changes the default to the "dynamic"
register allocator, which runs as many waves per CU as there are
space in terms of registers and other resources -- thus it is more
realistic and does a better job of ensuring test coverage.

Change-Id: Ifca915130bb4f44da6a9ef896336138542b4e93e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57537
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-03-19 05:25:05 +00:00
Matthew Poremba
f64f05eff6 arch-vega: Mark global instructions executed as global
The executed_as field is currently not set for global memory
instructions. This results in the default of SC_NONE, causing the status
vector to be all zeros. The GM pipe sees this and completes the
instruction immediately rather than issuing memory requests. This is
fixed by marking the instruction as executed as SC_GLOBAL always. Flat
instructions use resolvedFlatSegment for this, however since global
instructions are known to be global we can set this field directly. This
results in the expected issuing of memory requests to GPU memory.

Change-Id: Ic23102853ccd49a41e2f083b7bb24f033dfed18a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57829
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 22:44:28 +00:00
Gabe Black
72d67e6426 arch-vega: Replace deprecated Stats namespace recently reintroduced.
The deprecated "Stats" namespace was recently reintroduced to the vega
TLB code. Replace it with the new statistics namespace.

Change-Id: Ie5daf288176ce7e8aadd27b84a70baf4cbc72dff
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57949
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matthew Poremba <matthew.poremba@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 20:19:37 +00:00
Bobby R. Bruce
cfcb63d768 tests: Add KVM Tests to the nightly run
Unfortunately due to restrictions with Docker, we cannot run KVM tests
within a Docker container. As such we have elected to run them on the
host system in this instance.

Change-Id: I751903512eaba9d0e51732228a0706725e82295e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56831
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-03-18 18:16:09 +00:00
Bobby R. Bruce
78a9e772ca tests,ext: Fix so ex/include regex are applied after defaults
The seldom used '--include-tags' and '--exclude-tags' flags allows a
testing user to remove and include tags from the search used by TestLib
to select tests. For example, by default the 'quick' tag is included as
part of the search of tests to run. The '--exclude-tags' flag could then
be used to remove the 'quick' tags from the search.

The TestLib framework was applying the regex these flags input before
the default flags. This meant if the user wished to remove a flag, it
was impossible. This is now applied after.

Change-Id: I569e0f8d6093ff5e5cdc76faff89c15e75ff297a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56830
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 18:16:09 +00:00
Bobby R. Bruce
2f48aa9e5c tests: Add 'kvm' tag to tests
Some of our tests require KVM. Tagging these tests as such allow us to
filter them in or out during testing.

Change-Id: I3f188d3e268409535043cc32b64d99e4657638cd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56829
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 18:16:09 +00:00
Giacomo Travaglini
d7854cce3b arch-arm: Implement DSB Shareable as a DVM op
JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: I52c965817dd9d70feca31d1ec2981ad3a090e6a3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56607
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 12:01:23 +00:00
Giacomo Travaglini
d2910d68c1 arch-arm: Implement TLBI Shareable as a DVM op
JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: Ie0a374abce41997af600773cc270a47cdf2c1338
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56606
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 12:01:00 +00:00
Giacomo Travaglini
dbc91308c7 arch-arm: Add warning when DVM is enabled in the decoder
DVM Ops instructions are micro-architecturally modelled as loads. This
will tamper the effective number of loads stat, so a user should
be careful when interpreting stat results

JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: I526cd542ef804111cf6919359c1ce02df6d4710d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56605
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 12:00:08 +00:00
Giacomo Travaglini
8a505bb615 arch-arm: Add DVM ISA templates
These will be used by DVM instructions:

* TLBI Shareable
* DSB Shareable

JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: I32f83e08360ceb7ba324d07c72fe6addeb4bbbca
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56604
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 11:59:18 +00:00
Yu-hsin Wang
cf52f99d9c fastmodel: Upgrade to FastModel 11.17
The first big change is gcc-6.4 is no longer supported in FastModel
11.17. We switch to gcc-7.3. Next, TARGET_MAXVIEW is
replaced by TARGET_SYSTEMC_MAXVIEW. The default value of
TARGET_SYSTEMC_MAXVIEW is zero. So we can simply remove TARGET_MAXVIEW.
Finally, I fixed an undefined exception in the build script.

Change-Id: I5ec70112056513c253e6127ed5f8abacf191431f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57549
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 02:22:29 +00:00
Yu-hsin Wang
6730d60fd1 fastmodel: CortexA76 fix missing registers for FastModel 11.17
Change-Id: I1f6e2e92b91d0fe361a5ea88542a1e095a9f357b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57629
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 02:22:29 +00:00
Earl Ou
75f7bbe904 fastmodel: CortexA76 fix missing registers for FastModel 11.16
Change-Id: Id6bfa1c374e9c9e65f2c234654f87567d2b29c09
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52543
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 02:22:29 +00:00
Gabe Black
218d6b239d arch: Add some indirection for Operand RegId generation.
That introduces a place to hook in to override what actual register
index is passed to the rest of gem5.

Change-Id: I77d778849410ee5d32bab669bba411e80603a002
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49739
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-17 20:50:19 +00:00
Gabe Black
93b7c8c321 arch: Consolidate "op_idx" generating code.
Change-Id: I6c715d8931b7943c798674c19a1e7307d0e182be
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49738
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-17 20:49:47 +00:00
Matthew Poremba
7337b7611d dev-hsa: Update HSA queue tracking for FS mode
In FS mode offsets for HSA queues are determined by the driver and
cannot be linearly assigned as they are in SE mode. Add plumbing to pass
the offset of a queue to the HSA packet processor and then to HW
scheduler.

A mapping to/from queue ID <-> doorbell offset are also needed to be
able to unmap queues. ROCm 4.2 is fairly aggressive about context
switching queues, which results in queues being constantly mapped and
unmapped.

Another result of remapping queues is the read index is not preserved in
gem5. The PM4 packet processor will write the currenty read index value
to the MQD before the queue is unmapped. The MQD is written back to
memory on unmap and re-read on mapping to obtain the previous value.
Some helper functions are added to be able to restore the read index
from a non-zero value.

Change-Id: I0153ff53765daccc1de23ea3f4b69fd2fa5a275f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53076
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-17 14:35:35 +00:00
Jui-min Lee
667308ae7f mem: Add option to remove shared memory at the end
Add a new option `auto_unlink_shared_backstore` to System so it will
remove the shared backstore used in physical memories when the System is
getting destructed. This will prevent unintended memory leak.

If the shared memory is designed to live through multiple round of
simulations, you may set the option to false to prevent the removal.

Test: Run a simulation with shared_backstore set, and see whether there
    is anything left in /dev/shm/ after simulation ends.
Change-Id: I0267b643bd24e62cb7571674fe98f831c13a586d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57469
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-17 01:29:54 +00:00
Matthew Poremba
539a2e2bcd arch-vega: Add VEGA page tables and TLB
Add the page table walker, page table format, TLB, TLB coalescer, and
associated support in the AMDGPUDevice. This page table format used the
hardware format for dGPU and is very different from APU/GCN3 which use
the X86 page table format.

In order to support either format for the GPU model, a common
TranslationState called GpuTranslation state is created which holds the
combined fields of both the APU and Vega translation state. Similarly
the TlbEntry is cast at runtime by the corresponding arch files as they
are the only files which touch the internals of the TlbEntry. The GPU
model only checks if a TlbEntry is non-null and thus does not need to
cast to peek inside the data structure.

Change-Id: I4484c66239b48df5224d61caa6e968e56eea38a5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51848
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-17 00:11:14 +00:00
Matthew Poremba
7cfe88df74 mem: Add system request flag for dGPUs
dGPUs can translate a virtual address and will not know if the address
resides in system/host memory or device/dGPU memory until the
translation is complete. In order to mark requests as going to either
system memory or device memory we add a field to the Request class.

Change-Id: Ib1e80e8d03ecdfeb11c24d979ccc4b912ce07f91
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51852
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-03-17 00:11:14 +00:00
Giacomo Travaglini
5cca0bbe8a arch-arm: Fix setup of ESR.IL field
The ESR.IL field (Instruction Lenght) is set to 0 if the exception
has been triggered by a 16-bit instruction (Thumb) and 1 otherwise.

Current implementation has been implemented more or less correctly
for AArch32 but not for AArch64; by doing:

if (to64) {
    esr.il = 1;
} ... [AArch32]

We are directly setting ESR.IL to 1 in case the exception is taken in
AArch64 mode. This is not covering the case of a thumb instruction
faulting to AArch64.

We are fixing this by defining a virtual method returning the ESR.IL
bitfield depending on the exception cause/type. This is following
the Arm Architectural Reference Manual, which states ESR.IL bit should
be set to 1 for 32-bit instructions and for cases where the fault
doesn't really depend on the instruction:

* SError interrupt
* Instruction Abort exception
* PC alignment exception
* SP alignment exception
* Data Abort exception for which the value of the ISV bit is 0.
* Illegal Execution state exception.
* Debug exception except for Breakpoint instruction exceptions
* Exception reported using EC value 0b000000.

Change-Id: I79c9ba8397248c526490e2ed83088fe968029b0e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57570
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 22:47:25 +00:00
Giacomo Travaglini
6a6045b7f5 arch-arm: Fix coding tyle of faults.{cc,hh}
Change-Id: Iaf7858ab08fc858b7c2f932240e24657dc48bbe4
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57569
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 22:47:25 +00:00
Giacomo Travaglini
01eebd2aad arch-arm: Define ESR.ISS field as a SubBitUnion
This will make it easier for an ArmFault to setup the ISS
field of the syndrome register

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I970dfea474f2de0a696bef27712bc42daed9f1a0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57489
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 22:47:25 +00:00
Gabe Black
8618dd8ae7 scons: Turn all global sticky variables into variant ones.
Saved option files are processed twice, once to load the value of the
EXTRAS variable, and then again once variables have been set up by
SConsopts.

Change-Id: Id8d49051c8fe684142a68259c470ed7c86bdab53
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56753
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 21:11:48 +00:00
Gabe Black
274042a362 arch: Add an "as" template to dummy vec regs.
Keep the unit tests compiling until the generic dummy vec and vec pred
regs are unnecessary and are eliminated.

Change-Id: I65d99cd3f4c41e89834b71a8af90872d8d5a4590
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57749
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 15:02:44 +00:00
Gabe Black
1dad34a403 arch: Eliminate the "func" parameter to build(Read|Write)Code.
The correct accessor is well known by the code providing a template for
buildReadCode/buildWriteCode, and so can be simply inserted without the
indirection. This makes the code a little easier to read, and those
templating functions simpler and easier to understand.

Change-Id: I403c6e4c291708f8b58cce08bfa32ee2a930c296
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49737
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 08:58:38 +00:00
Gabe Black
543035e90d arch: Disable unused read/write code overrides in the ISA parser.
Some operand types had read/write code overrides, I think largely by
pattern matching other operand types, and not because that code was
actually expected to be used or to work. Instead, we should just assert
that that code isn't used and remove the implementation. This method of
affecting reading and writing code is going away anyway, and if this is
needed in the future it can be replaced in the new system.

Change-Id: Idae886153aa343570109069cbe54e2c1699a34e5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49736
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 08:58:22 +00:00
Hoa Nguyen
2bd99f141e util-docker: Add docker container for building riscv target
This container comes with LLVM/Clang riscv cross-compiler
with linker, libraries, and libc headers from
riscv-gnu-toolchain[1].

Adapted from [2].

[1] https://github.com/lowRISC/riscv-llvm
[2] https://github.com/sifive/riscv-llvm/blob/dev/README.md

Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Change-Id: I0bc310e1ae3ca9257fbde95a864c2b48009cd897
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57609
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 02:12:05 +00:00
Samuel Stark
e41323fb93 mem: Add TlbiExtSync packet type
JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: I45435326daca599ac973c747777ecac52bf7fd33
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57290
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-15 16:20:49 +00:00
Samuel Stark
d64a2ba541 mem: Add external TLBI flags to the Request object
* TLBI_EXT_SYNC: This flag tells the CPU model that a
remote TLBI Sync has been requested

* TLBI_EXT_SYNC_COMP: This flag tells the interconnect that a
remote TLBI Sync request has completed

JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: I459d22f112038cc1427e24999904ba74c1c08cfb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57289
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-15 16:20:26 +00:00
Giacomo Travaglini
ee8279b719 arch-arm: Add DVM enabled flag in the Decoder class
This is needed as the decoder needs to choose whether to
instantiate a DVM (treated as IsLoad) instruction when
decoding a TLBI/DSB Shareable, or to issue a simple system
instruction in case DVM messages are not modelled in the
simulated system.

JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: I9f46304dee63851caec809a5c6b8e796d684cc05
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56603
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-15 16:19:10 +00:00