Commit Graph

17576 Commits

Author SHA1 Message Date
Bobby R. Bruce
512564fd73 util-docker: Add Python test dependencies to Docker
These are needed to run our Python tests

Change-Id: Ifd6904a59ad3b6217a337bd5e912c3e7e2e10c17
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47219
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 17:17:24 +00:00
Bobby R. Bruce
684ba89390 docker-util: Remove building of GCC 5 and 6 Docker images
Building of these images is no longer required as GCC 5 and 6 have been
dropped.

Change-Id: Ife0331843214fe545c5620a2f77ede3adb436700
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47462
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-07-07 15:48:25 +00:00
Bobby R. Bruce
263be6a994 misc,tests: Remove support for GCC 6
Supporting GCC 7 onwards will allow us to move to the C++17 standard.

Change-Id: I805945230d77dacdc6b0a863153b28276025ecdc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47460
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 15:48:25 +00:00
Giacomo Travaglini
3472fdadc3 arch-arm: Forward declare kvm_vcpu_init
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I6fa5be48498d1a8f9c070e9ded11e8cadd4b89a1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47679
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 08:44:24 +00:00
Giacomo Travaglini
d1cdcb311b misc: Move Mode and Translation from BaseTLB to BaseMMU
This is a step towards moving most of the TLB logic to the
MMU class.

Change-Id: Id6b1fb30aa89960705f165f9738f5b50aa1e6bdb
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46779
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 08:44:13 +00:00
Gabe Black
d58b4f004e misc: Remove typedef (struct|enum) Foo in cpp files.
In C, to refer to a type without a struct or enum tag on the type, you
need to typedef it like this:

typedef struct
{
} Foo;

Foo foo;

In C++, this is unnecessary:

struct Foo
{
};

Foo foo;

Remove all of the first form in C++ files and replace them with the
second form.

Change-Id: I37cc0d63b2777466dc6cc51eb5a3201de2e2cf43
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46199
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 08:35:12 +00:00
Hoa Nguyen
9b1ff519aa scons: Not compiling with systemc when host is RISCV
Compiling gem5 with systemc enabled results in the errors
described in https://gem5.atlassian.net/browse/GEM5-1027.

This change tells scons not to compile gem5 with systemc
when the host ISA is RISC-V.

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

Change-Id: I04e1bc722c9d702472152c9116d89938e8408047
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47660
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 06:09:26 +00:00
Gabe Black
ff3ffc7461 scons: Switch to c++17.
Change-Id: I90d121ab4dbf53f3bd30bcdb5f5101d9c7cdc437
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45902
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 05:43:39 +00:00
Giacomo Travaglini
3a72e669dc arch-arm: No need to copy haveLPAE when switching TLBs
When calling the TLB::takeOverFrom, there is no need to
copy the fixed haveLPAE variable as it is a system level
parameter (from ArmSystem) and it is assumed to be the same
for all TLBs (even the switched out)

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I0b010d18ae71e43290f7f76f229c1a231ff42ac0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46899
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-06 12:56:52 +00:00
Giacomo Travaglini
065c9ec3f9 arch-arm: Forward declare kvm_reg_list
The adoption of the gem5 namespace [1] broke aarch64 builds with
the following error:

build/ARM/arch/arm/kvm/base_cpu.cc:198:22: error: aggregate
'gem5::kvm_reg_list regs_probe' has incomplete type and cannot be
defined

In file included from build/ARM/arch/arm/kvm/base_cpu.cc:38:0:
build/ARM/arch/arm/kvm/base_cpu.hh:115:28: note: forward declaration of
'struct gem5::kvm_reg_list'
     std::unique_ptr<struct kvm_reg_list> tryGetRegList(uint64_t nelem)
const;

Forward declaring the struct defined in linux/kvm.hh (included in source
file) in the global namespace, rather than the gem5 one fixes the
problem

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

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I96c7d31aa4810edcf98e23cefeaf4895620b6444
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47619
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-06 12:41:18 +00:00
Daniel R. Carvalho
b8c42ff193 base: Avoid dereferencing end() in findNearest
When used with next_addr, findNearest will return the
next (even larger) address than the nearest larger
address. The problem is that when there is no valid
next, the function was dereferencing addrMap.end().

Fix this by marking next address as 0, since 0 is
not larger than any other address.

Places that use this function should be revisited
to make sure they account for this behavior, as
reported in the following Jira issue:
https://gem5.atlassian.net/browse/GEM5-936

Change-Id: I29ed80ff921b205209aeb5db05ffd3019d8595ce
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43591
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
2021-07-06 09:59:11 +00:00
Daniel R. Carvalho
c89971b0f8 base: Add error messages to BloomFilter::Perfect
Warn the user when they use BloomFilter::Perfect's
parameters incorrectly.

Change-Id: Ib493c5f508e47a5f18e43c023755ef960954f5cc
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44112
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-06 09:59:11 +00:00
Daniel R. Carvalho
4b2118ed4b misc: Remove sim/cur_tick dependency from sim/core.hh
Remove this unnecessary dependency. Fixed all incorrect
includes of sim/core.hh.

Change-Id: I3ae282dbaeb45fbf4630237a3ab9b1a593ffbe0c
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43592
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-06 09:59:11 +00:00
Laura Hinman
5b0596935d learning-gem5: Updated deprecated terms in simple.py
Updated terms include:
-`slave` is now `cpu_side_ports`
-`master` is now `mem_side_ports`
-`int_master` is now `int_requestor`
-`int_slave` is now `int_responder`

Change-Id: Ic5a0d722f3c3c529ecbdc33413b17b4f72180ef3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47639
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-05 23:31:33 +00:00
Sandipan Das
711f7a3009 arch-power: Add clone support
This adds support for the clone() system call using
which multiple cpus can be utilized in SE mode. For
this change, it should be noted that Linux on Power
uses the CLONE_BACKWARDS argument order.

Change-Id: Iac91a7d110d9f7a133b8e102ac113f48a431a0d6
Signed-off-by: Kevin Joe <0keik0de@gmail.com>
Signed-off-by: Chetan Agarwal <chetanag35@gmail.com>
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47579
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-05 18:41:35 +00:00
Sandipan Das
80becc6684 arch-power: Update copyrights
Change-Id: Ifabd1e7178b5250767a2b560b57570512b732278
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40948
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:20:26 +00:00
Sandipan Das
bef21a9f1c arch-power: Fix load-store timing sequence
To properly implement load-store instructions for use with
the TimingSimpleCPU model, the initiateAcc() part of the
instruction should only be responsible for performing the
effective address computation and then initiating memory
access.

The completeAcc() part of the instruction should then be
responsible for setting the condition register flags or
updating the base register based on the outcome of the
memory access. This fixes the following instructions:
  * Load Byte and Zero with Update (lbzu)
  * Load Halfword and Zero with Update (lhzu)
  * Load Halfword Algebraic with Update (lhau)
  * Load Word and Zero with Update (lwzu)
  * Load Doubleword with Update (ldu)
  * Load Floating Single with Update (lfsu)
  * Load Floating Double with Update (lfdu)
  * Load Byte and Zero with Update Indexed (lbzux)
  * Load Halfword and Zero with Update Indexed (lhzux)
  * Load Halfword Algebraic with Update Indexed (lhaux)
  * Load Word and Zero with Update Indexed (lwzux)
  * Load Word Algebraic with Update Indexed (lwaux)
  * Load Doubleword with Update Indexed (ldux)
  * Load Floating Single with Update Indexed (lfsux)
  * Load Floating Double with Update Indexed (lfdux)
  * Load Byte And Reserve Indexed (lbarx)
  * Load Halfword And Reserve Indexed (lharx)
  * Load Word And Reserve Indexed (lwarx)
  * Load Doubleword And Reserve Indexed (ldarx)
  * Store Byte with Update (stbu)
  * Store Halfword with Update (sthu)
  * Store Word with Update (stwu)
  * Store Doubleword with Update (stdu)
  * Store Byte with Update Indexed (stbux)
  * Store Halfword with Update Indexed (sthux)
  * Store Word with Update Indexed (stwux)
  * Store Doubleword with Update Indexed (stdux)
  * Store Byte Conditional Indexed (stbcx.)
  * Store Halfword Conditional Indexed (sthcx.)
  * Store Word Conditional Indexed (stwcx.)
  * Store Doubleword Conditional Indexed (stdcx.)
  * Store Floating Single with Update (stfsu)
  * Store Floating Double with Update (stdsu)
  * Store Floating Single with Update Indexed (stfsux)
  * Store Floating Double with Update Indexed (stfdux)

Change-Id: If5f720619ec3c40a90c1362a9dfc8cc204e57acf
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40947
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:20:15 +00:00
Sandipan Das
f019d9f866 arch-power: Add support for trapping user faults
This adds support for trapping into GDB when user-mode
faults such as those pertaining to alignment (SIGBUS),
traps (SIGTRAP) and unimplemented opcodes (SIGILL) are
encountered.

Change-Id: Ieb557abd4173b5acb4be6f0c30964aea1eba71a5
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47359
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:19:56 +00:00
Sandipan Das
065362ddfc arch-power: Add multi-mode debugging support
This adds multi-mode support for remote debugging via GDB
with the addition of the XML target description files for
both 32-bit and 64-bit variants of the Power architecture.
Proper byte order conversions have also been added.

MSR has now been modeled to some extent but it is still
not exposed by getRegs() since its a privileged register
that cannot be modified from userspace. Similarly, the
target descriptions require FPSCR to also be part of the
payload and hence, it has been added too.

Change-Id: I156fdccb791f161959dbb2c3dd8ab1e510d9cd4b
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40946
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:19:47 +00:00
Sandipan Das
6b37a7e02c arch-power: Fix process initialization
During process initialization, special purpose registers
should either be explicitly set or cleared. These contain
flag bits which might have unforseen side effects on the
execution of a program.

Change-Id: If7c5af9a93283a53717cc8cbba4bf373a7e40560
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40945
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:19:35 +00:00
Sandipan Das
480effb522 arch-power: Add multi-mode support
This adds multi-mode support and allows the simulator to
read, interpret and execute 32bit and 64-bit, big and
little endian binaries in syscall emulation mode.

During process initialization, a minimal set of hardware
capabilities are also advertised by the simulator to show
support for 64-bit mode and little endian byte order.
This also adds some fixups specific to 64-bit ELF ABI v1
that readjust the entry point and symbol table due to the
use of function descriptors.

Change-Id: I124339eff7b70dbd14e50ff970340c88c13bd0ad
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40944
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:19:19 +00:00
Sandipan Das
be3a57e68a arch-power: Add MSR and associated dependencies
This adds the definition of the Machine State Register
(MSR) in preparation for multi-mode support. The MSR
has bits that define the state of the processor. This
defines all the bitfields and sets the ones that are
typically used for userspace environments.

In preparation for multi-mode support, the SF and LE
bits are used by instructions to check if the simulation
is running in 64-bit mode and if memory accesses are to
be performed in little endian byte order respectively.
This introduces changes in areas such as target address
computation for branch instructions, carry and overflow
computation for arithmetic instructions, etc.

Change-Id: If9ac69415ca85b0c873bd8579e7d1bd2219eac62
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40943
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:18:53 +00:00
Sandipan Das
0e8238d717 arch-power: Add hardware features
This adds definitions for the hardware feature bits that
are currently available from the AT_HWCAP and AT_HWCAP2
auxv entries for the Power architecture. These are being
defined for future use.

Change-Id: I8214a4a26c502b1b0f31837069084b2e7cb31c51
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40942
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:18:53 +00:00
Sandipan Das
52adf37ea4 arch-power: Refactor process initialization
This generalizes parts of the process initialization
routines in preparation for multi-mode support and
adds flexibility in terms of data types and byte order
used for setting up the environment corresponding to
the mode in use.

Change-Id: Ia9efb93d044682af8b0f0809bca64a17570bf197
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40941
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:18:53 +00:00
Sandipan Das
706f58c4e5 arch-power: Add byte order attribute for PC state
This adds byte order as an attribute for PC state by
introducing a new PCState class. The decoder can now
fetch instructions bytes in the specified byte order
in preparation for multi-mode support.

Change-Id: I917333df88114a733cc5a8077cc420d5328f608b
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40940
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:18:53 +00:00
Bobby R. Bruce
d879f390fe misc,tests: Remove support for GCC 5
Change-Id: I9d2e2958757d13330500fae555dde0abad58e23c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47459
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-07-02 19:12:11 +00:00
Bobby Bruce
b462c5031a tests: Add missing build targets to compiler tests
This commit ensures all build targets are tested during the compiler
tests. Previously some missing.

Change-Id: I48674ead876dd528574b518108725493d2b8abc3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47342
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-07-02 19:12:11 +00:00
Bobby Bruce
371f1b252f tests: Add 18.04/20.04 min/all-dependency compiler tests
The purpose of these additional tests is to ensure that:

1) gem5 compiles correctly on both ubuntu 18.04 and 20.04.
2) gem5 compiles for both minimum dependencies and all dependencies.

Change-Id: Id28fa59fbd899256ab0c6a964077e69462b461c4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47340
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-07-02 19:12:11 +00:00
Matthew Poremba
7aa3c4c638 gpu-compute: Add missing override in render driver
This fixes the build error in the clang-11 compiler check for GCN3_X86.

Change-Id: I2245589182b80811b8bc07409196adca98899213
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47479
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-02 00:50:28 +00:00
Daniel R. Carvalho
00cd307b13 mem-garnet: Add a garnet namespace
Add a namespace encapsulating all garnet files.

GarnetSyntheticTraffic, from
cpu/testers/garnet_synthetic_traffic/GarnetSyntheticTraffic.hh
has not been added to this namespace.

Change-Id: I5304ad3130100ba325e35e20883ee9286f51a75a
Issued-on: https://gem5.atlassian.net/browse/GEM5-987
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47306
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Srikant Bharadwaj <srikant.bharadwaj@amd.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Srikant Bharadwaj <srikant.bharadwaj@amd.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-07-01 19:08:24 +00:00
Daniel R. Carvalho
974a47dfb9 misc: Adopt the gem5 namespace
Apply the gem5 namespace to the codebase.

Some anonymous namespaces could theoretically be removed,
but since this change's main goal was to keep conflicts
at a minimum, it was decided not to modify much the
general shape of the files.

A few missing comments of the form "// namespace X" that
occurred before the newly added "} // namespace gem5"
have been added for consistency.

std out should not be included in the gem5 namespace, so
they weren't.

ProtoMessage has not been included in the gem5 namespace,
since I'm not familiar with how proto works.

Regarding the SystemC files, although they belong to gem5,
they actually perform integration between gem5 and SystemC;
therefore, it deserved its own separate namespace.

Files that are automatically generated have been included
in the gem5 namespace.

The .isa files currently are limited to a single namespace.
This limitation should be later removed to make it easier
to accomodate a better API.

Regarding the files in util, gem5:: was prepended where
suitable. Notice that this patch was tested as much as
possible given that most of these were already not
previously compiling.

Change-Id: Ia53d404ec79c46edaa98f654e23bc3b0e179fe2d
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46323
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-01 19:08:24 +00:00
Matthew Poremba
d4904b3b89 arch-gcn3: Remove unused files
These files are not used but are still popping up in style checks, such
as the new python Black checks. Removing these to reduce maintenance
overhead for GCN3.

Change-Id: I8d78c8246c29637958a8af99c4a9eb6bb8e23e3d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47419
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-01 13:52:52 +00:00
Daniel R. Carvalho
24041d6b77 mem-cache: Add Signature-Based Hit Predictor replacement policy
Add the SHiP Replacement Policy, as described in "SHiP: Signature-
based Hit Predictor for High Performance Caching", by Wu et al.

Instruction Sequence signatures have not been implemented.

Change-Id: I44f00d26eab4c96c9c5bc29740862a87356d30d1
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38118
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-07-01 11:21:30 +00:00
Daniel R. Carvalho
4a3e99fbcb mem-cache: Allow sending packet information to replacement policy
Some replacement policies can use information such as address or
PC to improve their re-reference prediction.

Change-Id: I412eee09efa2f3511ca1ece76fc2732509df4745
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38117
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-07-01 11:21:30 +00:00
Daniel R. Carvalho
ef99dc8310 mem-cache: Use PacketPtr in tags's accessBlock
Pass the packet to the tags, so that the replacement policies
more execution information.

Change-Id: I201884a6d60e3299fc3c9befebbb2e8b64a007f0
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38116
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
2021-07-01 11:21:30 +00:00
Daniel R. Carvalho
2911839c22 mem-cache: Make WeightedLRU inherit from LRU
WeightedLRU adds occupancy information to LRU, so remove the
duplicated code.

Change-Id: Ifec19ea59fb411a5ed7a891e8957b1ab93cdbf05
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47399
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
2021-07-01 11:21:30 +00:00
Sandipan Das
b91cfc14bd base: Add byte order attribute for object files
This adds byte order as an attribute for object files by
introducing new members to the ObjectFile class. This is
populated by the looking at the ELF headers.

Change-Id: Ibe55699175cc0295e0c9d49bdbe02e580988bc4f
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40939
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-01 01:25:23 +00:00
Sandipan Das
a947b45fcf arch-power: Refactor argument registers
This reintroduces the argument register constants that
were removed in commit 7bb456f02 ("arch-power: Delete
unused register related constants"), adds a definition
for the sixth argument register and switches to these
constants to specify the arguments used by the system
call ABI.

Change-Id: I5804f4d2b27a04d0e7b69132e5abce5761b239f5
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40938
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-01 01:23:48 +00:00
Sandipan Das
01c9f90e6f arch-power: Add time base instructions
This models a pseudo time base using the simulator ticks
and adds the following instructions.
  * Move From Time Base (mftb)
  * Move From Time Base Upper (mftbu)

Change-Id: Idb619ec3179b2a85925998282075bde8651c68c2
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40937
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-01 01:22:33 +00:00
Sandipan Das
09ec394844 arch-power: Add move condition field instructions
This adds the following instructions.
  * Move to CR from XER Extended (mcrxrx)
  * Move To One Condition Register Field (mtocrf)
  * Move From One Condition Register Field (mfocrf)

Change-Id: I5014160d77b1b759c1cb8cba34e6dd20eb2b5205
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40936
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-01 01:22:33 +00:00
Sandipan Das
c8207e2286 arch-power: Fix move condition field instructions
This introduces the S field for X form instructions which
is used to specify signed versus unsigned comparison. The
Power ISA does not specify a formal name for the third
1-bit opcode field required for decoding XFX form move to
and from CR field instructions, the S field can be used
to achieve the same as it has the same span and position.
This fixes the following instructions.
  * Move To Condition Register Fields (mtcrf)
  * Move From Condition Register (mfcr)

Change-Id: I8d291f707cd063781f0497f7226bebfc47bd9e63
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40935
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-01 01:22:33 +00:00
Sandipan Das
57181ee613 arch-power: Add trap instructions
This introduces new classes and new formats for D and X
form instructions, the TO field that is used to encode
the trap conditions and adds the following instructions.
  * Trap Word Immediate (twi)
  * Trap Word (tw)
  * Trap Doubleword Immediate (tdi)
  * Trap Doubleword (td)

Change-Id: I029147ef643c2ee6794426e5e90af4d75f22e92e
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40934
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-06-30 22:55:02 +00:00
Bobby Bruce
84837422d8 util-docker: Deprecate 18.04-min_dependencies for 20.04-min
While we still support Ubuntu 18.04, we will focus testing more-so on
20.04. Therefore, our min-dependency target will now be 20.04 intead of
18.04.

Change-Id: Ib136480e5f9953d216bd5ffc6f0ae3faa1bf2e82
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47341
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-06-30 16:55:25 +00:00
Bobby Bruce
2d86e88819 tests: Update the documentation in compiler-tests.sh
This was out-of-date and has been updated in this commit.

Change-Id: I18519bb2111dae4d2f86806618115153fa8d5372
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47339
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-06-30 16:55:25 +00:00
Kyle Roarty
c96f43d83e gpu-compute: Initialize GPUDriver member variables before use
A few member variables weren't initialized, but we were assuming that
they were 0 when first read. This explicitly sets those variables to 0.

Change-Id: I2c840d361ed3a7d306e22dc7561a3870f1ef94a1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46248
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-06-30 16:47:43 +00:00
Kyle Roarty
b1df141bed gpu-compute: Change certain IOCTL errors to warnings
There are certain IOCTL errors that were triggering with the change to
ROCm 4, however they could be set to warnings without causing any errors
in the program

Change-Id: Ie0052267f3ccfbdbadb90249b6f19e6a1205f57e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46247
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-06-30 16:47:43 +00:00
Kyle Roarty
5fad68f576 dev-hsa,gpu-compute: IOCTL updates for ROCm 4
This change copies over the up-to-date kfd_ioctl.h file from the linux
kernel, and updates the gpu_compute_driver to reflect the changes found
in the new version of the kfd_ioctl.h file

Change-Id: I51e8e7158762f4b7e06c0f84507e5889a17939a2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46246
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-06-30 16:47:43 +00:00
Kyle Roarty
f2a029058a gpu-compute: Ignore GPU kernel names
ROCm 4 seems to have updated the akc, and the only real issue that has
occured is that we're no longer able to read kernel names in the same
way as we were in ROCm 1.6. This patch removes the prior method of
reading kernel names and gives all kernels a temporary name

Change-Id: I0040e0cf4cd35d6f56ded6a8acfb10c600bcc77a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46245
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-06-30 16:47:43 +00:00
Kyle Roarty
a71801b9a0 configs,gpu-compute: Add render driver needed for ROCm 4
ROCm 4 utilizes the render driver located at /dev/dri/renderDXXX. This
patch implements a very simple driver that just returns a file
descriptor when opened, as testing has shown that's all that's needed

Change-Id: I65602346cbf17b2dc80e114046ebf5c9830a1507
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46244
Tested-by: kokoro <noreply+kokoro@google.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>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-06-30 16:47:43 +00:00
Kyle Roarty
bcd12f301d arch-x86,sim: Implement sched_getaffinity
sched_getaffinity is different from other syscalls in the raw syscall
return the size of the cpumask being used to represent the CPU bit mask.

Because of this, when a library (libnuma in this case) directly called
sched_getaffinity and got a return value of 0, it errored out, thinking
that there were no CPUs available.

This implementation assumes that all CPUs are available, so it sets
all simulated CPUs in the bitmask

Change-Id: Id95c919986cc98a411877056256604f57a29f0f9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46243
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-06-30 16:47:43 +00:00