Commit Graph

19275 Commits

Author SHA1 Message Date
Gabe Black
3d7d426fa5 cpu: Generalize how register files are serialized.
Instead of explicitly serializing each type of register explicitly, and
using custom types, etc, store them as generic blocks of data. This lets
us get rid of the final use of TheISA::VecRegContainer and
TheISA::VecPredRegContainer.

Change-Id: I61dbd7825ffe35c41e1b7c8317590d06c21b4513
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50252
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-08-04 20:22:32 +00:00
32a206a2d0 systemc: fix hierarchical binding
Fix hierarchical bindings for multi_passthrough_target_socket. This bug
also was also present in the Accellera implementation in version 2.3.2
but was fixed in 2.3.3. This fix is analogous to the patch applied to
the Accellera implementation.

It allows to complete the binding also for hierarchical bindings.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-1255

Change-Id: I95497ad4b432b23412f2c0c8a3ef216af3372338
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62031
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-04 12:17:22 +00:00
Andreas Sandberg
d49c8f78fe tests: Use pre-commit to run some tests in Jenkins
The pre-commit tool is able to run style tests in a reproducible
manner. Run pre-commit from Jenkins.

Change-Id: Ia142a6f3b610410b5767515483b90bc3a09f2407
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61113
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-08-03 15:48:29 +00:00
Bobby R. Bruce
787204c92d python: Apply Black formatter to Python files
The command executed was `black src configs tests util`.

Change-Id: I8dfaa6ab04658fea37618127d6ac19270028d771
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47024
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-03 09:10:41 +00:00
Giacomo Travaglini
1cfaa8da83 arch-arm: Remove unimplemented miscreg handling in MSR imm
The checkFaultAccessAArch64SysReg function is now in charge
of returning the Undefined Instruction fault for unimplemented
registers

Change-Id: I75c00c6fbce33d1729a4923eae585260a8461db3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61971
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-02 20:45:51 +00:00
Bobby R. Bruce
e0d74f4b66 misc: Add .vscode to .gitignore
Change-Id: I5d9f14a298bdf57b0c369c20dac3b03c67cc94bb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61931
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-08-02 18:05:39 +00:00
Gabe Black
e425bcabd2 arch,cpu,sim: Store registers in InstRecord with InstResult.
The InstResult knows how to print registers without having to know about
their actual types.

Change-Id: Ib858e32a7b2fabbde4857165b9e88e87294942c8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50254
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-08-02 12:44:25 +00:00
Gabe Black
81e07670b9 cpu: Simplify and revamp the InstResult class.
The InstResult class is always used to store a register value, and also
only used to store a RegVal and not any more complex type like a
VecRegContainer. This is partially because the methods that *would*
store a complex result only have a pointer to work with, and don't have
a type to cast to to store the result in the InstResult.

This change reworks the InstResult class to hold the RegClass the
register goes with, and also either a standard RegVal, or a pointer to a
blob of memory holding the actual value if RegVal isn't appropriate. If
the InstResult has no RegClass, it is considered invalid.

To make working with InstResult easier, it also now has an "asString"
method which will just call into the RegClass's valString method with
the appropriate pointer.

By removing the ultimately unnecessary generality of the original class,
this change also simplifies InstResult significantly.

Change-Id: I71ace4da6c99b5dd82757e5365c493d795496fe5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50253
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-08-02 12:44:16 +00:00
Zhantong Qiu
f698ca9c27 tests: extend the test_hello_se to test on print-this binary
test_hello_se.py:
Added "take_params_progs" to store avaliable isa and the binary names.
Added two new parameters in function "verify_config" to take verifier
and input arguments for the binary.

simple_binary_run.py:
Added a new unrequired args called "arguments" to take input arguments
for the binary. Its default value is [ ] so the
"arguments = args.arguments" in the "set_se_workload" can run without
inputting any args.arguments.

Change-Id: Ib99dc92aa97060de5e1d34d9cac5800b82dab9e6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61771
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-08-02 03:41:02 +00:00
Wei-Han Chen
71e3ff0b7c configs: move cpu a2t, t2g from gic_hub to cpu_hub
Connections between cpu and gem5 lies in gic_hub now, but these are not
related to gic. So I create a subsystem in fastmodel cluster named
cpu_hub, and put those connections (a2t, t2g) there.

Change-Id: I18d9f80ce6f7f7f4a8290d1db5e48962294f43e5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61851
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-08-02 01:52:14 +00:00
Giacomo Travaglini
174adc2993 arch-arm: Revamp TLB invalidation by introducing TLBIOp::match
Most of the invalidation methods in the TLB class are
doing the same thing: looping over all entries, checking if
the entry matches a certain criteria, and invalidating it
in case it does.

The only specific bit is the matching function, therefore
we add a virtual TLBIOp::match method which allows us
to specialize different TLBIs and to provide a single
flush method in the TLB class

Change-Id: I0672ff958742ac7ebff8d30218f75127343f1a58
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61753
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
2022-07-30 08:59:49 +00:00
Giacomo Travaglini
1290d15973 arch-arm: Simplify TLB invalidation with flushMva
The method is no longer calling the lookup method which
had been complicated by the introduction of partial translations.
(which is now called during address translation only)

The lookup method is iterating over all TLB Entries until a non
partial translation is found. Using lookup in flushMva makes it
O(n^2). With this patch we iterate over the TLB entries only once
(making flushMva O(n))

Change-Id: I8f2ae56192812cee231baf6943068abea4d7ef91
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61752
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-30 08:59:49 +00:00
Giacomo Travaglini
bad3e14bd7 arch-arm: Fix IPAS2 invalidation
Fixing invalidation behaviour for the following stage 2 TLB maintainance
instructions

MISCREG_TLBI_IPAS2E1_Xt
MISCREG_TLBI_IPAS2LE1_X
MISCREG_TLBI_IPAS2E1_Xt
MISCREG_TLBI_IPAS2LE1_Xt

1) Do nothing if EL2 is not enabled in the current security state
2) If we are in secure state, the 63 bit of the Xt register selects
the security domain (s/ns) of the invalidated entries

Change-Id: I4573ed60ce619bcefd9cb05f00c5d3fcfa8d3199
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61751
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-30 08:59:49 +00:00
Gabe Black
cc4380b0d6 cpu,arch: Put the name of the RegClass into the RegClass.
Move the name of the RegClass out of constants which belong to the
RegId, and instead store them in the RegClass instances.

Change-Id: I1ddd4bc8467d5e3f178db7a11c8f8052f43fd7ec
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50251
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-07-29 19:30:51 +00:00
Gabe Black
7b1f05a34c arch-arm,cpu: Simplify the RegClass constructor(s).
Replace the two constructors with one that takes the truly mandantory
parameters, and then a function to derive a new RegClass with some sort
of adjustment, currently by adding custom ops, or setting a non-standard
register size.

Because the constructor and the modifier function are constexpr, they
should fold away and not actually create extra temporary copies of the
RegClass in the modifier functions.

Change-Id: I8acb755eb28fc8474ec453c51ad205a52eed9a8e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50249
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-07-29 19:30:27 +00:00
Giacomo Travaglini
e3ff57e477 arch-arm: Further clean up the AArch64 MSR/MRS decode
This is just rearranging special cases bringing them together within
read/write switch statements

Change-Id: I170aea2a251167d41070e35bef13b41353de2342
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61690
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
5a65aae091 arch-arm: Simplify AArch64 decode of unimplemented registers
Those registers are now handled through the fault callbacks

Change-Id: Id07c4d113260b749c24a895ed6e05f52c9f0eb9d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61689
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
d18b915008 arch-arm: Remove unimplemented flag from release dependant regs
We are instead just disabling read write permissions at every EL
if a specific release is not implemented

Change-Id: I677649c270a442dcd519339e2f64fb7927bf69cd
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61688
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
b7720a0995 arch-arm: MISCREG_IMPDEF_UNIMPL does not need unimplemented flag
The decode tree is checking for MISCREG_IMPDEF_UNIMPL before the
MISCREG_UNIMPLEMENTED flag

Faulting is handled anyway by the new fault callbacks

Change-Id: I600ac02913c2fd947c3a6b7f1f81111f21bff3f6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61687
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
7c52b0d9af arch-arm: Replace unimplemented+warnNotFail with callback
We are trying to deprecate the use of the MISCREG_IMPLEMENTED
flag.

Rather than using warnNotFail in conjunction with it, we
use the new faulting callback infostructure to deliver
either an Undefined Instruction or a warning with NoFault

Change-Id: Iee80171a6d28c55c9af069653306d6f8085faf78
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61686
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
c7b7314d8b arch-arm: Clear unused WARN_NOT_FAIL flag for AArch64 CMOs
The following AArch64 CMOs were flagged as warnNotFail even
if they are actually implemented and there is no reason
for them to fail:

MISCREG_DC_IVAC_Xt
MISCREG_DC_ZVA_Xt
MISCREG_DC_CVAC_Xt
MISCREG_DC_CVAU_Xt
MISCREG_DC_CIVAC_Xt

This is likely coming from AArch32 (those CMOs are unimplemented in
AArch32).

Please note: this patch is not changing anything behaviorally; the
warnOnFail flag is not considered in AArch64 unless the unimplemented
flag is also set (and this was not the case for those CMOs)

Change-Id: I40396016703b9eb48f69b0eb710d077f8c2b146b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61685
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
ce7448b53e arch-arm: Remove unimplemented flag from AArch64 registers
We don't need to explicitly set the unimplemented flag, we
can just avoid setting any read/write permission and that
will make the register implicitly unimplemented

Change-Id: I10add9f5744a027f893c56c7030cdfb69d79679c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61684
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
ef2573bc95 arch-arm: Convert to the new faulting logic
This patch is moving trapping behaviour modelled in
MiscRegOp64::trap to the MiscRegLUTEntry fault callbacks.

Change-Id: Idfca428e9e6669b747de0255888fc8a85a1f5d07
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61683
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
34f9e3525a arch-arm: Add generateTrap method to MiscRegOp64
Change-Id: I176cdb63284e146ce376344d895fdbf6c42b883d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61682
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
5afff98ee9 arch-arm: Add new trapping bitfields to the HCR register
Change-Id: Ie798594831790ae4ff551f68602b7505f0d4b237
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61681
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
01a0685d75 arch-arm: Use new faulting logic to handle SP_EL0
Change-Id: I518964b3e4d1abe153d2d175c765a6b46157cc3b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61680
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
936f1e8603 arch-arm: Merge checkFaultRead/Write into single checkFaultAccess
Change-Id: I6b4b8a2ced53c3957a9f1d9b3ea51851a9ec7343
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61679
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Bobby R. Bruce
1666e6620a ext: Fix SST Documentation links
This documentation links to v21-2 resources. This is incorrect, they
should point towards v22-0 resources. This patch fixes this.

Change-Id: I0e4868327e0b216619e524c2329f57bbe40d3eae
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61691
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 20:20:36 +00:00
Srikant Bharadwaj
942b71bf3a gpu-compute: Move GPU caches to GPU clock domain
GPU caches TCP/TCC need to be in the GPU clock domain instead
of ruby clock domain. This patch moves them to GPU clock domain
by creating a clock domain for each cache separately.

Change-Id: Iab6382233b75862e21b028186691a35d92d9a0f9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61589
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 14:41:35 +00:00
Matthew Poremba
68115460d8 gpu-compute: Set LDS and Scratch apertures in FS
The LDS and scratch aperture base and limits are hardcoded to some
values that are useful for SE mode. In reality, these are chosen by the
driver so we need to honor whatever values the driver passes so that
when addresses are calculated they fall into the correct aperture to
route flat instructions to those apertures.

This overwrites the default hardcoded values for LDS and scratch base
and limit using the values providing by the driver in a MAP_PROCESS
packet.

Change-Id: I0e194a26631f697819d8aaecf1bf346a7b7c7026
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61656
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2022-07-28 14:10:33 +00:00
Matthew Poremba
f65f5a8981 gpu-compute,arch-vega: Overhaul HWRegs, setreg, getreg
These instructions are supposed to be read/writing special shader
hardware registers. Currently they are getting/setting to an SGPR. This
results in getting incorrect registers at best and clobbering an SGPR
being used by an application at worst. Furthermore, some registers need
to be set in the shader and the application will never (can never) set
them.

This patch overhauls the getreg/setreg instructions to use different
storage in the shader. The values will be updated either via setreg from
an application (e.g., mode register) or set by a PM4 MAP_PROCESS.

Change-Id: Ie5e5d552bd04dc47f5b35b5ee40a569ae345abac
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61655
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-07-28 14:10:33 +00:00
Matthew Poremba
5c7514c81c arch-vega: Fix S_GETREG_B32 masking/shifting
Here the mask should not be inverted. We also need to shift by the
offset to remove the padding as the consumer of the value expects the
offset to be removed.

This can be easily tested by running a GPU kernel with __shared__
variables. This will generate the following assembly:

s_getreg_b32 s6, hwreg(HW_REG_SH_MEM_BASES, 16, 16)

The current implementation returns the lower 16 bits (private memory
aperture) while the correct behavior is the uppter 16 bits (shared/LDS
memory aperture).

Change-Id: Iea8f0adceeadb24cdcf46ef4183fcaa8262ab9e7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61654
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-07-28 14:10:33 +00:00
Matthew Poremba
f2949f3d03 dev-amdgpu: Set PASID in interrupt cookie
The driver uses the pasid to look up events that need to be set in
kfd_signal_event_interrupt (amdkfd/kfd_events.c). Currently this is
uninitialized which causes the function in the driver to return without
doing anything useful.

This changeset initializes the cookie PASID to 0x8000. 0x8000 is always
the first PASID assigned by the driver. This works since gem5 only
supports one GPU process in FS mode. This would have to be changed for
multi-process support, so a comment is added as a reminder.

Change-Id: I7074b581f2f2f346bd910eef15d5f9253ce17e2c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61653
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 14:10:33 +00:00
Matthew Poremba
923d6c4081 configs: Always use busy wait for GPUFS
The environment variable HSA_ENABLE_INTERRUPT controls if Interrupt or
busy wait signals are used in the ROCm runtime. Interrupts are not being
sent in gem5 causing simulations to hang indefinitely in certain
situations. To fix this, always disable interrupts to fall back to busy
wait signals. Using interrupts is an old and simple optimization to not
waste CPU cycles, but from the perspective of simulation this is not
important. Disabling interrupt-based HSA signals therefore increases the
number of applications working within gem5.

Change-Id: I1ae21d7ee01548a4d00a8972642079b90278f9a2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61652
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-07-28 14:10:33 +00:00
Matthew Poremba
ee75e19b8b gpu-compute: Fix dynamic scratch allocation on GPUFS
When GPU needs more scratch it requests from the runtime. In the
method to wait for response, a dmaReadVirt is called with the same
method as the callback with zero delay. This means that effectively
there is an infinite loop in the event queue if the scratch setup is not
successful on the first attempt. In the case of GPUFS, it is never
successfully instantly so a delay must be added. Without added delay,
the host CPU is never scheduled to make progress setting up more scratch
space.

The value 1e9 is choosen to match the KVM quantum and hopefully give KVM
a chance to schedule an event. For reference, the driver timeout is
200ms so this is still fairly aggressive checking of the signal response.
This value is also balanced around the GPUCommandProc DPRINTF to
prevent the print in this method from overwhelming debug output.

Change-Id: I0e0e1d75cd66f7c47815b13a4bfc3c0188e16220
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61651
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-07-28 14:10:33 +00:00
Matthew Poremba
23fadb7260 dev-hsa: Don't set _aqlComplete in setRdIdx method
This code is unnecessary as the read index is already correct.
Furthermore, it can cause hangs in some situations where the packet
SHOULD be marked as not complete. This causes a bug where the read index
is incremented by 1 multiple times, causing the packet processor to read
an invalid packet, followed by a hang after it does nothing.

Change-Id: Iceda3c9606e018f60f8902770a2d9762c1c14304
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61650
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-07-28 14:10:33 +00:00
Matthew Poremba
618d16d6fc arch-vega: Fix V_READFIRSTLANE_B32
This instruction appears to be the only VOP1 instruction that has a
scalar destination using VDST as the destination register number.
However, since VDST is only 8 bits it cannot encode all possible
registers. Therefore, use the opcode to determine if the destination is
a scalar or vector destination.

This issue manifests as a VGPR dest being out of range for a kernel
where the number of SGPRs is more than the number of VGPRs and the
intended SGPR dest is larger than the count of VGPRs

Change-Id: I95a7de1ddb97f7171f48331fed36aef776fa0cb4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61649
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 14:10:33 +00:00
Giacomo Travaglini
1c423ad7e6 arch-arm: Remove MISCREG_INFO E2H flag
These VHE flags are not needed anymore.

They were used to trap EL2 access to VHE only registers (like CPACR_EL12)
when VHE was disabled (hcr.e2h = 0)

With the new faulting logic, we can just introduce VHE specific
callbacks checking for the hcr.e2h bitfield and returning an undefined
instruction if VHE is disabled.

In this way we don't have to add VHE only bits to every system register

Change-Id: I07bf9a9adc7a089bd45e718fb06d88488a2b7ed5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61678
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
9bd4520b13 arch-arm: Use new fault callbacks in canRead/WriteAArch64SysReg
This should be equivalent of checking the lookUpMiscReg[reg].info
bitset. The functions have been renamed to
checkFaultRead/WriteAArch64SysReg as they now return a fault and
not a boolean

Change-Id: I2d7465c368428a7d55eb48b32396315e23bcf0f9
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61677
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
79cbb0a668 arch-arm: Streamline RVBAR_EL1/EL2 access permissions
We don't need to handle RVBAR_EL1 and RVBAR_EL2 separately
every time we read or write a system register.
Instead we can just setup access permissions once at bringup,
based on the highest implemented Exception Level

Change-Id: I19a2cbd783829051766ea45d76a964acc29fe73a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61676
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
5f67c7e54d arch-arm: Add FaultCB callbacks to the MiscRegLUTEntry class
This patch is adding per-EL read/write callbacks to the MiscRegLUTEntry
class.  The goal is to merge access permission and trapping logic into
these unified callbacks

As of now the default callbacks are simply reimplementing the access
permission code, checking for MiscRegLUTEntry flags. This is the default
behaviour for all registers.
Trapping code (from MiscRegOp64::trap) will be moved with a later patch

Change-Id: Ib4bb1b5d95319548de5e77e00258fd65c11d88d7
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61675
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
167cf86375 arch-arm: Move access permission bitset within MiscRegLUTEntry
Rather than having two separate MiscReg metadata vectors, we are
storing the access permission bitset within the MiscRegLUTEntry

Change-Id: I2f5d175617c888f0eb6954d29a4c607e0cbc3611
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61674
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
f118b5755a arch-arm: Move lookUpMiscReg vector out of the ISA class
Our plan is to consolidate the lookUpMiscReg vector with the
miscRegInfo one into a single metadata vector

Change-Id: I07b5a63a8da6d9b48593a904f6912b84a2afdd2c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61673
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
e4ab0bb5cf arch-arm: Add a getter for miscRead member variable
In this way our ISA code can check if a MiscRegOp64 is a MSR or a MRS
and act accordingly

Change-Id: I9ddb9df432b28ce7d20235fc51f3637c41f3256a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61672
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
07b6f4261c arch-arm: Add undefined helper to ArmStaticInst
In this way we can generate an Undefined Instruction fault
from the instruction object without requiring to access its
menmonic or opcode

This is generalizing the existing disabledFault helper

Change-Id: Ib7dec9399f142c35d75057f37ab53cce102fa01e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61671
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
25bdb73b9f arch-arm: Generate MSR/MRS iss within trapping logic
The iss field is only used when the MSR/MRS instruction
gets trapped. Rather than generating it at decode time,
we generate the value within the trap method instead

This avoids the confusion of having a MSR/MRS register
instruction storing an immediate field

Later patches will change this even further by generating the
iss field on the fly ONLY if the instruction gets trapped

Change-Id: I97fdcf54d9643ea79a1f9d052073320ee68109fd
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61670
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
6217ac737b arch-arm: Overload decodeAArch64SysReg to accept a MiscRegNum64
Overload decodeAArch64SysReg to directly accept a MiscRegNum64

Change-Id: I43c1dae6c0e382c03612f4ce4fc89aadddf30fd5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61669
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 13:24:02 +00:00
Gabe Black
ba5a017d9a cpu-o3: Remove TheISA:: types from forwardOldRegs.
Use information from the registers' RegClass-es and the generic getReg
and setReg API to forward the registers value without having to refer to
the register class constant/index, or the type of complex registers.

Change-Id: I0426a606185edc0aabbf4b77c825b618b4640590
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50248
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-07-27 21:55:47 +00:00
Gabe Black
87acb97762 cpu-minor: Use the << operator in minorTraceInst.
Use that to print the RegIds of an inst directly, without having to pass
around the register class vector.

Change-Id: I6e5b06518f4826a1e4e8589c5ed095609d3d02b0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49809
Reviewed-by: ZHENGRONG WANG <seanyukigeek@gmail.com>
Maintainer: ZHENGRONG WANG <seanyukigeek@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-27 20:28:48 +00:00
Gabe Black
a46b7c99c8 cpu: Revamp the RegId << operator.
Now that we have a pointer to the actual RegClass the RegId is
associated with, we can use it's regName method to pretty print the
RegId for us. This gets rid of the redundant print method for RegId.

Also, replace the default register printing method with the
implementation in the << operator, which is more descriptive.

Change-Id: I00e93032ddea77e167ca13e54b370de7210f1a2b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49808
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-27 20:28:37 +00:00