gem5.git
3 years agomem-cache: Implement FPC cache compressor
Daniel R. Carvalho [Thu, 5 Jul 2018 12:53:15 +0000 (14:53 +0200)]
mem-cache: Implement FPC cache compressor

Implementation of Frequent Pattern Compression, proposed
by Alameldeen et al. in "Frequent Pattern Compression: A
Significance-Based Compression Scheme for L2 Caches".

Change-Id: I6dca8ca6b3043b561140bc681dbdbe9f7cef27d7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36395
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-cache: Make (de)compression latencies params
Daniel R. Carvalho [Thu, 22 Oct 2020 16:45:12 +0000 (18:45 +0200)]
mem-cache: Make (de)compression latencies params

Add 4 params to calculate compression and decompression latencies.
A pair of params informs how many chunks are parsed per cycle, and
the other pair informs how many extra cycles are needed after the
chunks are parsed to finish the (de)compression.

Change-Id: Ie67b0c298f06a08011f553789e3a9a1d89dd7c4f
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36497
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agopython: Add support for Proxy division
Daniel R. Carvalho [Thu, 22 Oct 2020 11:34:24 +0000 (13:34 +0200)]
python: Add support for Proxy division

Allow proxies to use python3's division operations. The dividends
and divisors can be either a proxy or a constant.

Change-Id: I96b854355b8f593edfb1ea52a52548b855b05fc0
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36496
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-cache: Undefine compression ratio of perfect compression
Daniel R. Carvalho [Thu, 22 Oct 2020 18:30:40 +0000 (20:30 +0200)]
mem-cache: Undefine compression ratio of perfect compression

Commit c0d67b2263aab6a729368373d9cdef9883870241 assumes that the
cache contains a parameter for its compression ratio. This is not
the case upstream, so force the user to provide it instead.

Change-Id: Ic7b4878bede6b0a34e4adfe7e0aa65a0ee48d1f6
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36495
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoutil: Fix an incorrect print statement in git pre-commit hook
Hoa Nguyen [Fri, 23 Oct 2020 08:43:27 +0000 (01:43 -0700)]
util: Fix an incorrect print statement in git pre-commit hook

Change-Id: I13d0a705b6cfab654635380e2adbf36243344a62
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36516
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-arm: Fix implementation of TLBI ALLEx instructions
Giacomo Travaglini [Thu, 17 Sep 2020 16:31:55 +0000 (17:31 +0100)]
arch-arm: Fix implementation of TLBI ALLEx instructions

The TLBIALL op in gem5 was designed after the AArch32 TLBIALL instruction.
and was reused by the TLBI ALLEL1, ALLE2, ALLE3 logic.

This is not correct for the following reasons:

- TLBI ALLEx invalidates regardless of the VMID
- TLBI ALLEx (AArch64) is "target regime" oriented, whereas TLBIALL
  (AArch32) is "current regime" oriented

TLBIALL has a different behaviour depending on the current exception
level: if issued at EL1 it will invalidate stage1 translations only; if
at EL2, it will invalidate stage2 translations as well.

TLBI ALLEx is more standard; every TLBI ALLE1 will invalidate stage1 and
stage2 translations. This is because the instruction is not executable
from the guest (EL1)

So for TLBIALL the condition for stage2 forwarding will be:

if (!isStage2 && isHyp) {

Whereas for TLBI ALLEx will be:

if (!isStage2 && target_el == EL1) {

Change-Id: I282f2cfaecbfc883e173770e5d2578b41055bb7a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35241
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-arm: Rewrite the TLB flushing interface
Giacomo Travaglini [Fri, 18 Sep 2020 13:53:46 +0000 (14:53 +0100)]
arch-arm: Rewrite the TLB flushing interface

We are now using an overloaded flush method which has
different TLBI ops as arguments.

This is simplifying the interface and it is allowing us to
encode some state in the TLBIOp which will then be passed
to the TLB. This is a step towards making the TLB a stateless
cache of translations

Change-Id: Ic4fbae72dc3cfe756047148b1cf5f144298c8b08
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35240
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>
3 years agoarch-arm: Reimplement TLB::flushAll
Giacomo Travaglini [Fri, 18 Sep 2020 14:08:52 +0000 (15:08 +0100)]
arch-arm: Reimplement TLB::flushAll

flushAll is a non architectural flush command; this is not based on
flushAllSecurity anymore. flushAll should always flush stage1 and stage2,
whereas flushAllSecurity is checking for the current state
(vmid, and if we are in Hyp)

Change-Id: I6b81ebfba387e646f256ecbecb7b5ee720745358
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35239
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>
3 years agoarch-arm: TLBIALL/TLBIASID/TLBIMVA base classes for I/D flavours
Giacomo Travaglini [Fri, 18 Sep 2020 13:30:09 +0000 (14:30 +0100)]
arch-arm: TLBIALL/TLBIASID/TLBIMVA base classes for I/D flavours

This will be exploited by the incoming patchset

Change-Id: Ic10a8d64910a04d4153b0f2abb133dfd56dbaf62
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35238
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

3 years agoscons: Don't check for Python 2
Andreas Sandberg [Fri, 23 Oct 2020 09:49:43 +0000 (10:49 +0100)]
scons: Don't check for Python 2

The build system will now refuse to build gem5 if Python 2.x is
detected. Remove Python 2 specific python-config variants from the
list of candidates we try.

Change-Id: Id59be4a2969ce180848e5df02afdfb4a5b8125c1
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36535
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoscons: Test if binaries can embed the Python interpreter
Andreas Sandberg [Wed, 21 Oct 2020 16:41:56 +0000 (17:41 +0100)]
scons: Test if binaries can embed the Python interpreter

Add some more stringent Python tests that ensure that we can link with
and run applications that embed Python. This is implemented by running
building a small c++ program that embeds Python using PyBind11. The
program is run by the build system and prints the version of the
Python interpreter. The version information is then used by the build
system to ensure that the installed version is supported.

Change-Id: I727e0832f171362f5506247c022bea365068a0f6
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36383
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: Replace enable_if<>::type with enable_if_t<>.
Gabe Black [Fri, 23 Oct 2020 04:52:26 +0000 (21:52 -0700)]
misc: Replace enable_if<>::type with enable_if_t<>.

This new abreviated form was added for C++14. Now that we're using that
version of the standard, we can move over to it.

Change-Id: Ia291d2b1e73e503c37593b1e1c4c1b3011abc63b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36477
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agodev-arm: Fix VExpressFastmodel interrupt configs
Yu-hsin Wang [Thu, 22 Oct 2020 10:12:06 +0000 (18:12 +0800)]
dev-arm: Fix VExpressFastmodel interrupt configs

HDLcd interrupt params should receive ArmSPI class

Change-Id: I4a5dacdfe5803511d19f2ed789017fb3b1857bdb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36455
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agox86: Move syscall handling for Linux into the EmuLinux workload.
Gabe Black [Wed, 21 Oct 2020 00:36:50 +0000 (17:36 -0700)]
x86: Move syscall handling for Linux into the EmuLinux workload.

Change-Id: I3fe1997e62491e9576b787660b7fae5ae99fb5c9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33903
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Alexandru Duțu <alexandru.dutu@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agox86: Create an SEWorkload for x86 linux.
Gabe Black [Wed, 21 Oct 2020 00:44:44 +0000 (17:44 -0700)]
x86: Create an SEWorkload for x86 linux.

This doesn't do anything interesting yet, but soon it will take over
system call duties from the x86 linux processes.

Change-Id: Ic126fc80def0b458de51d3a9c96120c58e5a75ad
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33902
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Alexandru Duțu <alexandru.dutu@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agobase,sim: Move BitUnion serialization support to bitunion.hh.
Gabe Black [Wed, 21 Oct 2020 02:53:47 +0000 (19:53 -0700)]
base,sim: Move BitUnion serialization support to bitunion.hh.

This keeps the BitUnion code centralized and out of the generic
serialization code.

Change-Id: I297638df4f8908096b7c439298fbaf03236f9011
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36283
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

3 years agosim: Move the serialization backend handlers to their own header.
Gabe Black [Wed, 21 Oct 2020 02:25:21 +0000 (19:25 -0700)]
sim: Move the serialization backend handlers to their own header.

This way other types which want to enable serialization can include just
these handlers and specialize them as necessary without bringing in all
the other dependencies of the serialization mechanism.

Change-Id: I7310e7741615e23ac0fc762e951bf5eac00aaa74
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36281
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agosim: Refactor how serialization types are handled in the backend.
Gabe Black [Wed, 21 Oct 2020 02:17:18 +0000 (19:17 -0700)]
sim: Refactor how serialization types are handled in the backend.

The parseParam and showParam functions partially worked using template
specialization, and partially worked using function overloading. The
template specialization could be resolved later once other functions
were added, but the regular function overloads could not. That meant
that it was practically impossible to add new definitions of those two
functions local to the types they worked with.

Also, because C++ does not allow partial specialization of template
functions, it would not be possible to truly use specialization to wire
in BitUnion types.

To fix these problems, these functions have been turned into structs
which wrap static functions. These can be partially specialized as
desired, making them compatible with BitUnions. Also, it's not possible
to overload structures like it is with functions, so only specialization
is considered, not overloading.

While making these changes, these functions (now structs) were also
reworked so that they share implementation more, and are generally
more streamlined.

Given the fact that the previous parseParam and showParam functions
could not actually be expanded beyond serialize.hh, and were not
actually called directly by any code outside of that file, they should
have never been considered part of the API.

Now that these structs actually *can* be specialized outside of this
file, they should be considered part of the interface.

Change-Id: Ic8e677b97fda8378ee1da1f3cf6001e02783fde3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36280
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
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>
3 years agobase: Narrow the applicability of the default to_number.
Gabe Black [Wed, 21 Oct 2020 02:11:07 +0000 (19:11 -0700)]
base: Narrow the applicability of the default to_number.

That template only works for integral (except bool), floating point,
or enum types, so restrict it to those types. That makes it easier to
detect what types will work with that function.

Change-Id: Ib29a9a0ea75dd617e28bb6850d60be905f93182f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36279
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agosim: Fix API comments for optParamIn.
Gabe Black [Wed, 21 Oct 2020 02:03:00 +0000 (19:03 -0700)]
sim: Fix API comments for optParamIn.

The top level comment was correct, but the parameter comments talked
about writing parameters instead of reading them. Also simplified the
wording of the return value comment.

Change-Id: I156aba5b69c281ee2f34297bf3f75fd0acfb2b6e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36278
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agosim: Generalize the arrayParamOut and arrayParamIn functions.
Gabe Black [Wed, 21 Oct 2020 04:11:53 +0000 (21:11 -0700)]
sim: Generalize the arrayParamOut and arrayParamIn functions.

These had been written specifically for the vector, list, set, and C
style array types. This change reworks them to share an implementation,
and to work with more general types. The arrayParamOut method requires
std::begin() and std::end() to accept that type, and the arrayParamIn
method requires either insert or push_back, or the type to be an array.

Also fix up a couple of files which accidentally depended on includes in
the serialize headers which are no longer necessary.

Change-Id: I6ec4fe3bb900603bbb4e35c4efa620c249942452
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36277
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: L1/L2 hit/miss tracking for MOESI_AMD_BASE/GPU_VIPER
Daniel Gerzhoy [Wed, 23 Sep 2020 21:22:17 +0000 (17:22 -0400)]
mem-ruby: L1/L2 hit/miss tracking for MOESI_AMD_BASE/GPU_VIPER

L1 and L2 access tracking was not fully implemented.
This patch adds the missing tracking actions, and corrects
several errors for the ones that were there.

Change-Id: I69a59283274c08e94b6650ab5f586cbfe5432503
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33915
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
3 years agomem-ruby: L3 hit/miss tracking to MOESI_AMD_BASE-dir
Daniel Gerzhoy [Wed, 23 Sep 2020 20:39:08 +0000 (16:39 -0400)]
mem-ruby: L3 hit/miss tracking to MOESI_AMD_BASE-dir

L3 access tracking added to the directory controller.

This commit adds L3 hit/miss tracking to the controller.
Hit/miss status is decided when the tag array of the
L3 Cache is checked for the first time for any given request.

Change-Id: Icac122f59509d79135265fb38b112d3f47419b6f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33314
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-garnet: Fix garnet network interface stats
jiemingyin [Wed, 21 Oct 2020 23:43:05 +0000 (19:43 -0400)]
mem-garnet: Fix garnet network interface stats

Fixing a bug in garnet network interface where flit source delay is
computed using both tick and cycle.

Change-Id: If21a985f371a818611d13e9cd5ce344dbcf5fb2b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36416
Reviewed-by: Srikant Bharadwaj <srikant.bharadwaj@amd.com>
Maintainer: Matthew Poremba <matthew.poremba@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: Update my email address.
Gabe Black [Wed, 21 Oct 2020 12:37:13 +0000 (05:37 -0700)]
misc: Update my email address.

Change-Id: Ibbed316125274b742dbcda62f114855176b922e8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36382
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoconfigs: Use absolute path for VirtIO9PDiod default root
Yu-hsin Wang [Wed, 21 Oct 2020 10:25:34 +0000 (18:25 +0800)]
configs: Use absolute path for VirtIO9PDiod default root

VirtIO9PDiod model requires an absolute path as its parameter. So we
should change the default root path to absolute path as well.

Change-Id: I68a2ae1115e84ed61055298b06b2d0b4bd6410b3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36381
Reviewed-by: Earl Ou <shunhsingou@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoconfigs: Fix FastmodelCluster cpu initialization
Yu-hsin Wang [Wed, 21 Oct 2020 10:23:00 +0000 (18:23 +0800)]
configs: Fix FastmodelCluster cpu initialization

We should create the thread and the interrupt controller of fastmodel by
calling the create function explicitly.

Change-Id: I269440e144e83fa0a31d8cdf285fed31642f4f73
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36380
Reviewed-by: Earl Ou <shunhsingou@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: Fix a few accidental transitive includes.
Gabe Black [Wed, 21 Oct 2020 02:50:28 +0000 (19:50 -0700)]
misc: Fix a few accidental transitive includes.

Some files depend on definitions from files that they weren't including
themselves. They were working accidentally by getting those definitions
transitively through other, unrelated headers.

Change-Id: I50c919a4eb6c4484d4ee6b7f4fe02f075132964d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36282
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agosim: Implement optParamIn using paramIn.
Gabe Black [Wed, 21 Oct 2020 01:46:02 +0000 (18:46 -0700)]
sim: Implement optParamIn using paramIn.

This means only paramIn needs to be specialized, and then optParamIn
will be as well for free. It also removes some duplicate implementation.

Change-Id: Id124a05d04e1c0897121d0e13dd46efe90e8eed0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36276
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch: Use getTlb in BaseMMU to reduce boilerplate
Giacomo Travaglini [Tue, 6 Oct 2020 10:18:46 +0000 (11:18 +0100)]
arch: Use getTlb in BaseMMU to reduce boilerplate

Change-Id: I22dcdf0769e854c252788d415d46da113cb8c60a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35735
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-arm: Replace any getDTBPtr/getITBPtr usage
Giacomo Travaglini [Sun, 13 Sep 2020 10:37:55 +0000 (11:37 +0100)]
arch-arm: Replace any getDTBPtr/getITBPtr usage

The getMMUPtr should be used instead

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

Change-Id: I8f09b0dc9844764fbe1a04b34dd963730c91f531
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34978
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agocpu: Remove unused demapInstPage and demapDataPage
Giacomo Travaglini [Fri, 11 Sep 2020 21:14:28 +0000 (22:14 +0100)]
cpu: Remove unused demapInstPage and demapDataPage

Change-Id: Iecc2ee8d91bfd3caf38e5f27e9689b7e0d488ed5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34977
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: BaseCPU using ArchMMU instead of ArchDTB/ArchITB
Giacomo Travaglini [Fri, 13 Dec 2019 00:18:47 +0000 (00:18 +0000)]
misc: BaseCPU using ArchMMU instead of ArchDTB/ArchITB

With this commit we replace every TLB pointer stored in the
cpu model with a BaseMMU pointer.

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

Change-Id: I4932a32f68582b25cd252b5420b54d6a40ee15b8
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34976
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agocpu-kvm, arch-x86: Fix KVM on Intel platforms
Jason Lowe-Power [Wed, 29 Aug 2018 01:50:21 +0000 (18:50 -0700)]
cpu-kvm, arch-x86: Fix KVM on Intel platforms

This is the minimal set of changes from the patch that's been floating
around for a few years originally by Mike Upton.

See http://reviews.gem5.org/r/2613/ and
https://gem5-review.googlesource.com/c/public/gem5/+/7361

The change to the tssDesc is the minimal change to get KVM working on
Intel platforms. However, the other changes seem prudent to add.

Tested on both Intel (i7-7700) and AMD (EPYC 7451) platforms.

Change-Id: I000c7ba102ba161c2bb5e224bf826216cf0ff87a
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12278
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agodev-arm: Adding a SRAM in VExpress_GEM5_V1
Giacomo Travaglini [Mon, 13 May 2019 09:32:13 +0000 (10:32 +0100)]
dev-arm: Adding a SRAM in VExpress_GEM5_V1

This is added in order to match the RS1 memory map

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

Change-Id: I51e7aeafe1468a68fe7a3d78c7a6c405114df88f
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34375
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoscons: Raise an exception when scons is run a Python2 environment
Hoa Nguyen [Thu, 15 Oct 2020 21:08:41 +0000 (14:08 -0700)]
scons: Raise an exception when scons is run a Python2 environment

As gem5 has started to use Python2 incompatible features, compiling
gem5 in a Python2 environment results in an error.

This commit addresses this issue by raising an Exception when scons
is run in a Python2 environment, and adding a few pointers on how to
install Python3 and on how to use scons in a Python3 environment. The
solution works in a system where both Python2 and Python3 are
installed.

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

Change-Id: I98d4a39f586f39d9253ab2517b77e86c5ed19466
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36157
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: Minor updates to CONTRIBUTING.md
Jason Lowe-Power [Fri, 16 Oct 2020 22:15:57 +0000 (15:15 -0700)]
misc: Minor updates to CONTRIBUTING.md

This brings the file slightly more up to date

Change-Id: I1ed3300ec3c4980ed22c6a6fb950fa724897906b
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36255
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: Wrap __attribute__((aligned())) in a macro in compiler.hh.
Gabe Black [Wed, 14 Oct 2020 08:09:21 +0000 (01:09 -0700)]
misc: Wrap __attribute__((aligned())) in a macro in compiler.hh.

This attribute is gcc specific (also implemented by clang for
compatibility), and so should be behind a level of abstraction to make
using different compilers easier.

Change-Id: I7495f011f617268dd7a589dc0bcf1b3b7f515046
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35976
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: Use compiler.hh macros when available.
Gabe Black [Wed, 14 Oct 2020 07:38:42 +0000 (00:38 -0700)]
misc: Use compiler.hh macros when available.

Some places were hand coding __attribute__s when macros in compiler.hh
were available to do that job. Using the macros helps abstract away
compiler specific details and should be used when possible.

Change-Id: I94befebcfde2d673e874e9959588f69781bd9021
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35975
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-arm: Implement ArmPMU DTB generation
Giacomo Travaglini [Thu, 24 Sep 2020 12:26:53 +0000 (13:26 +0100)]
arch-arm: Implement ArmPMU DTB generation

This has been implemented by following Linux documentation:

Documentation/devicetree/bindings/arm/pmu.txt

Change-Id: I22583eed3792d5828f9c260e952ec5e8cf9e118b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35476
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

3 years agodev: Use generateFdtProperty in the PioDevice
Giacomo Travaglini [Mon, 28 Sep 2020 16:48:58 +0000 (17:48 +0100)]
dev: Use generateFdtProperty in the PioDevice

Change-Id: I2126bf84e0648fe76570f9645179f90bdf79eb41
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35398
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

3 years agodev-arm: Use generateFdtProperty in the GenericTimer
Giacomo Travaglini [Mon, 28 Sep 2020 16:36:30 +0000 (17:36 +0100)]
dev-arm: Use generateFdtProperty in the GenericTimer

Change-Id: I4115d14ba65685627b51b0e5438fe5a3ed9328bc
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35397
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

3 years agodev-arm: Automate FdtProperty generation with ArmInterruptPin
Giacomo Travaglini [Mon, 28 Sep 2020 16:33:57 +0000 (17:33 +0100)]
dev-arm: Automate FdtProperty generation with ArmInterruptPin

Change-Id: I1963bd139d8abd8988d5ceedaf85c74279546078
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35396
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agodev-arm, fastmodel: Rewrite Gic.interruptCells
Giacomo Travaglini [Fri, 16 Oct 2020 10:09:44 +0000 (11:09 +0100)]
dev-arm, fastmodel: Rewrite Gic.interruptCells

The affinity number (aka PPI partition) is used differently
in GICv2 and GICv3. In GICv2 it is ORed to the triggering type
(3rd cell), whereas it is encoded in the 4th cell in GICv3

Change-Id: I36e45d4ec5fb39befa1a271b531dfed2d8e56c10
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36235
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agodev-arm: Define ArmInterruptType
Giacomo Travaglini [Mon, 28 Sep 2020 16:27:39 +0000 (17:27 +0100)]
dev-arm: Define ArmInterruptType

This is a scoped enum meant to be used mainly in the python world
for DTB autogeneration. By making an ArmInterruptPin self aware of
its own type, we can use it in the C++ world when modelling devices.

For example if a device spec is enforcing a specific triggering behaviour,
its gem5 implementation can query the interrupt type and panic if its
expectations are not met. In this way we are sure what the Linux kernel
sees in the DTB is in sync with how the model really behaves

Change-Id: I66ae3cfbc7b1ed94804f1f882c12eb31f70840da
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35395
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoconfigs: Make GPU_VIPER config python3 friendly
Matthew Poremba [Sat, 10 Oct 2020 01:57:21 +0000 (20:57 -0500)]
configs: Make GPU_VIPER config python3 friendly

There is no xrange in python3. This will be required when eventually
20.2 is released.

Change-Id: I3a0da6353b70e6e17ce1f77d6177d48059e32487
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35855
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoconfigs: python3 compatibility for apu_se
Kyle Roarty [Thu, 15 Oct 2020 21:29:53 +0000 (16:29 -0500)]
configs: python3 compatibility for apu_se

This patch changes xrange to range, as the former doesn't exist in
python3.

Change-Id: Ibe2c1fb073194e3e0713bb1718f2e323f7c4e397
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36159
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoutil: Update GCN dockerfile for python3
Kyle Roarty [Thu, 15 Oct 2020 21:21:52 +0000 (16:21 -0500)]
util: Update GCN dockerfile for python3

This patch installs python3 in the GCN dockerfile, due to python3
being required starting in 20.2.

Python2 (python-yaml) is still required in order to compile rocBLAS

Change-Id: I1a6f1707e076e8ca499804119447a8d1f237ffd4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36158
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>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agosim,python: Flip logic on loopback listeners
Jason Lowe-Power [Thu, 15 Oct 2020 23:46:23 +0000 (16:46 -0700)]
sim,python: Flip logic on loopback listeners

People are bitten by allowing external connections to gem5 runs too often
(it happend to me again today). This change flips the logic so the
default is to only allow localhost connections.

Change-Id: If9233f5ca383721017b30b5837a26c5042d925fd
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36175
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-by: Ayaz Akram <yazakram@ucdavis.edu>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agodev: Rework how PCI BARs are set up in python and C++.
Gabe Black [Fri, 2 Oct 2020 10:00:04 +0000 (03:00 -0700)]
dev: Rework how PCI BARs are set up in python and C++.

In python, the BARs had been configured using three arrays and a scalar
parameter. The arrays tracked the BAR value in the config, whether the
BAR was for a "legacy" IO range, and the size of the BAR, and the
scalar parameter was an offset for the "legacy" IO addresses to map
into the host physical address space. The nature of a BAR was implied
by its raw config space value, with each of the control bits (IO vs.
memory, 64 bit, reserved bits) encoded directly in the value.

Now, the BARs are represented by objects which have different types
depending on what type of BAR they are. There's one for IO, one for
memory, one for the upper 32 bits of a 64 bit BAR (so indices work
out), and one for legacy IO ranges. Each type has parameters which
are appropriate for it, and they're parameters are all grouped together
as a unit instead of being spread across all the previous values.
The legacy IO offset has been removed, since these addresses can be
offset like any other IO address. They can be represented naturally
in the config using their typical IO port numbers, and still be turned
into an address that gem5 will handle correctly in the back end.

Unfortunately, this exposes a problem in the config system where
a VectorParam can't be overwritten successfully one element at a time,
at least when dealing with SimObject classes. It might work with
actual SimObjects in a config, but I haven't tried it. If you were
to do that to, for instance, update the BARs for x86 so that they
used legacy IO ports for the IDE controller, it would complain that
you were trying to instantiate orphaned nodes. Replacing the whole
VectorParam with a new list of BAR objects seems to work, so that's
what's implemented in this change.

On the C++ side, BARs in the config space are treated as flat values
on reads, and are stored in the config structure associated with each
PCI device. On writes, the value is first passed to the BAR object,
and it has a chance to mask any bits which are fixed in hardware and
update its idea of what range it corresponds to in memory.

When sending AddrRanges up to the parent bus to set up routing, the
BARs generate each AddrRange if and only if their type has been
enabled in the config space command register. The BAR object which
represents the upper 32 bits of a 64 bit BAR does not claim to be
IO or memory, and so doesn't contribute a range. It communicates with
the BAR which represents the lower 32 bits, so that that BAR has the
whole base address.

Since the IO or memory BAR enable bits in the command register are now
handled by the PCI device base class, the IDE controller no longer has
to handle that manually. It does still need to keep track of whether
the bus master functionality has been enabled though, which it can
check when those registers are accessed.

There was already a mechanism for decoding addresses based on BARs
in the PCI device base class, but it was overly complicated and not
used consistently across devices. It's been consolidated, and used in
most places where it makes sense.

Finally, a few unnecessary values have been dropped from the base PCI
device's and IDE controller's checkpoint output. These were just local
copies of information already in the BARs, which in turn are already
stored along with the data in the device's config space.

Change-Id: I16d5f8cdf86d7a2d02a6b04d1f9e1b3eb1dd189d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35516
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agogpu-compute,mem-ruby: Properly create/handle WriteCompletePkts
Kyle Roarty [Fri, 28 Aug 2020 22:42:10 +0000 (17:42 -0500)]
gpu-compute,mem-ruby: Properly create/handle WriteCompletePkts

There is a flow of packets as so:
WriteResp -> WriteReq -> WriteCompleteResp

These packets share some variables, in particular senderState and a
status vector.

One issue was the WriteResp packet decremented the status vector, which
was used by the WriteCompleteResp packets to determine when to handle
the global memory response. This could lead to multiple
WriteCompleteResp packets attempting to handle the global memory
response.

Because of that, the WriteCompleteResp packets needed to handle the
status vector. this patch moves WriteCompleteResp packet handling back
into ComputeUnit::DataPort::processMemRespEvent from
ComputeUnit::DataPort::recvTimingResp. This helps remove some redundant
code.

This patch has the WriteResp packet return without doing any status
vector handling, and without deleting the senderState, which had
previously caused a segfault.

Another issue was WriteCompleteResp packets weren't being issued for
each active lane, as the coalesced request was being issued too early.
In order to fix that, we have to ensure every active lane puts their
request into their applicable coalesced request before issuing the
coalesced request. Because of that change, we change the issuing of
CoalescedRequests from GPUCoalescer::coalescePacket to
GPUCoalescer::completeIssue.

That change involves adding a new variable to store the
CoalescedRequests that are created in the calls to coalescePacket. This
variable is a map from instruction sequence number to coalesced
requests.

Additionally, the WriteCompleteResp packet was attempting to access
physical memory in hitCallback while not having any data, which
caused a crash. This can be resolved either by not allowing
WriteCompleteResp packets to access memory, or by copying the data
from the WriteReq packet. This patch denies WriteCompleteResp packets
memory access in hitCallback.

Finally, in VIPERCoalescer::writeCompleteCallback there was a map
that held the WriteComplete packets, but no packets were ever being
removed. This patch removes packets that match the address that was
passed in to the function.

Change-Id: I9a064a0def2bf6c513f5295596c56b1b652b0ca4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33656
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoconfigs: Remove dangling reference to bus port in devices.py
Giacomo Travaglini [Wed, 7 Oct 2020 12:41:39 +0000 (13:41 +0100)]
configs: Remove dangling reference to bus port in devices.py

Change-Id: I3f7b65a9e6d4ae88acc474bb0e3a55f28c3cd09b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35755
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agobase: Clean up some #ifs in _format_string.
Gabe Black [Wed, 14 Oct 2020 08:21:41 +0000 (01:21 -0700)]
base: Clean up some #ifs in _format_string.

These were checking for gcc version 3, well below the minimum version we
support, and were hard wired to be enabled anyway. This change gets rid
of the check and the dead code on the hard wired off branch.

Also, this change cleans up the style in the surviving code and
simplifies it slightly.

Change-Id: I8df73a378f478413c111a4dea962450a37fb4092
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35977
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: Standardize the way create() constructs SimObjects.
Gabe Black [Wed, 7 Oct 2020 13:49:23 +0000 (06:49 -0700)]
misc: Standardize the way create() constructs SimObjects.

The create() method on Params structs usually instantiate SimObjects
using a constructor which takes the Params struct as a parameter
somehow. There has been a lot of needless variation in how that was
done, making it annoying to pass Params down to base classes. Some of
the different forms were:

const Params &
Params &
Params *
const Params *
Params const*

This change goes through and fixes up every constructor and every
create() method to use the const Params & form. We use a reference
because the Params struct should never be null. We use const because
neither the create method nor the consuming object should modify the
record of the parameters as they came in from the config. That would
make consuming them not idempotent, and make it impossible to tell what
the actual simulation configuration was since it would change from any
user visible form (config script, config.ini, dot pdf output).

Change-Id: I77453cba52fdcfd5f4eec92dfb0bddb5a9945f31
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35938
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoext: Add support for comma-separated inputs of testlib argparser
Hoa Nguyen [Tue, 8 Sep 2020 20:04:14 +0000 (13:04 -0700)]
ext: Add support for comma-separated inputs of testlib argparser

Currently, the --isa, --variant and --length options of testlib
do not support comma-separated inputs. This commit adds the
support for such an input for those options.

The argument parser now supports specifying the parameters multiple
times as well as specifying multiple options at a time.

JIRA: https://gem5.atlassian.net/jira/software/c/projects/GEM5/issues/GEM5-770

Change-Id: I3c276a9b9d9c6b0b802ecf8e7f1f9a3dfafe45d1
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34198
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
3 years agocpu: Remove automatic overriding of numThreads in SE on O3.
Gabe Black [Mon, 12 Oct 2020 00:26:10 +0000 (17:26 -0700)]
cpu: Remove automatic overriding of numThreads in SE on O3.

On the O3 CPU, when the number of threads on the CPU (SMT) is too low to
hold all the old style CPU workload items, then it would increase the
number of threads to match. There are three problems with this.

1. This behavior was only implemented on O3.
2. It could silently hide a bug in the config where the number of
   workload items was accidentally too big.
3. It makes the DerivO3CPUParams struct tamper with itself in the
   create() method, which means not even config.ini will accurately
   reflect the actual config of the system.

Change-Id: I0aab70d4b98093f7f14156ca437e763f031049ab
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35937
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-arm: Implement Armv8.2-LPA
Jordi Vaquero [Fri, 3 Jul 2020 07:58:51 +0000 (09:58 +0200)]
arch-arm: Implement Armv8.2-LPA

This is enabled by setting the ArmSystem.phys_addr_range64 to 52.
This will automatically set the ID_AA64MMFR0_EL1.PARange to 0b0110
which encodes the presence of Armv8.2-LPA

Change-Id: If9b36e26cd2a72e55c8e929a632b7b50d909b282
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35956
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-arm: Implement Armv8.2-LVA
Jordi Vaquero [Thu, 25 Jun 2020 08:54:59 +0000 (10:54 +0200)]
arch-arm: Implement Armv8.2-LVA

Change-Id: I1b489a3629b2376e03e79b158631cb1d0cacc17e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35955
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agosystemc: Use the new M5_WEAK macro to hide [[gnu::weak]].
Gabe Black [Tue, 13 Oct 2020 11:01:00 +0000 (04:01 -0700)]
systemc: Use the new M5_WEAK macro to hide [[gnu::weak]].

Other compilers may need to support that macro in other ways.

Change-Id: If6ee05ce69c1bfd24108cf0785fac2d7bc259f0a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35940
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

3 years agobase: Add an M5_WEAK macro to compiler.hh.
Gabe Black [Tue, 13 Oct 2020 10:59:34 +0000 (03:59 -0700)]
base: Add an M5_WEAK macro to compiler.hh.

On gnu compatible systems, this will be implemented with the
[[gnu::weak]] attribute.

Change-Id: I1add373d648bbca24feab63420a9d87363646b6a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35939
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
3 years agofastmodel: Update to c++14, and add some missing consts.
Gabe Black [Sat, 10 Oct 2020 10:55:28 +0000 (03:55 -0700)]
fastmodel: Update to c++14, and add some missing consts.

During the review for the CortexR52 model, a comment pointed out where
two consts can be added. Also we switched gem5 over to c++14, but the
project files for these other wrappers were still set to c++11.

Change-Id: I5fecdc896b0290deadcd0f55ea1dfe3806a98177
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35857
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agopython: Remove a call to reduce() from code_formatter.py.
Gabe Black [Tue, 13 Oct 2020 12:00:37 +0000 (05:00 -0700)]
python: Remove a call to reduce() from code_formatter.py.

The built in reduce method is no longer available in python 3. Besides
that, this particular bit of code is simpler and easier to read if
reduce is replaced with the also built in sum() method.

Change-Id: I6daca42494ea0534721dfcfb1f6058517cd482d9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35941
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

3 years agocpu: Change how O3 handles requests for SMT in full system.
Gabe Black [Mon, 12 Oct 2020 00:19:51 +0000 (17:19 -0700)]
cpu: Change how O3 handles requests for SMT in full system.

Currently, when the numThreads parameter is set to something larger than
1 in full system mode, the O3 CPU will just silently change it back down
again to 1. This could be confusing to the user since it won't be
immediately apparent, even when looking at config.ini, that their config
isn't being respected.

This change moves that check into the CPU constructor, where CPU
behavior probably should be rather than the create() method which should
just build the object, and also turns it into an error.

Change-Id: I627ff8702b5e8aaad8839aa8d52524690be25619
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35936
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agocpu: Remove the "SingleThreaded" fetch policy from the O3 CPU.
Gabe Black [Mon, 12 Oct 2020 00:03:50 +0000 (17:03 -0700)]
cpu: Remove the "SingleThreaded" fetch policy from the O3 CPU.

The fetch policy is only meaningful for SMT simulations. The
"SingleThreaded" value is a placeholder which is the default, and is
only supposed to be used in non-SMT simulations.

Rather than have this enum value and have special checks for it in
various places in O3, we can just eliminate it and set the default,
which is still only meaningful in SMT simulations, be an SMT fetch
policy.

The DerivO3CPUParams::create() function would forcefully change the
the fetch policy from "SingleThreaded" to "RoundRobin" anyway if there
were more than one thread, so that can be the actual default instead of
the shadow effective default.

Change-Id: I458fda00b5bcc246b0957e6c937eab0c5b4563c3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35935
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: Remove an extra file in src/cpu
Hoa Nguyen [Tue, 13 Oct 2020 08:21:48 +0000 (01:21 -0700)]
misc: Remove an extra file in src/cpu

Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Change-Id: Iacbf202bc4c4e701b8c6d3a7eaae77d15ca5f397
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35895
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: allow qualifiers in SLICC functions
Tiago Mück [Tue, 10 Sep 2019 00:13:52 +0000 (19:13 -0500)]
mem-ruby: allow qualifiers in SLICC functions

All parameters in functions defined within SLICC are const& by default
(except for the implicit types, e.g. TBE). This allow us to specify
if we want to pass parameters as & or const&. Default behavior is
maintained.

A use case is to allow refactoring of common code in actions that
enqueue messages. Messages can be passed as a non-const ref. to
to functions with common initialization. E.g.:

void initRequestMsg(RequestMsg & out_msg) {
  // Common msg init code
}

action(sendRequest1, ...) {
  enqueue(...) {
    initRequestMsg(out_msg);
    // Request1 specific code
  }
}

action(sendRequest2, ...) {
  enqueue(...) {
    initRequestMsg(out_msg);
    // Request2 specific code
  }
}

Change-Id: Ic6a18169a661b3e36710b2a9f8a0e6bc5fce40f8
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31259
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: more specialized address to node mapping
Tiago Mück [Wed, 4 Sep 2019 17:26:02 +0000 (12:26 -0500)]
mem-ruby: more specialized address to node mapping

Added mapAddressToDownstreamMachine that may be used by the protocols
to map an address to different target donwstream controller of the same
type.

These functions do not use the global mapping provided by the network
and map addresses to one of the controllers specified in the
downstream_destinations parameter.

This change facilitates reusing the same cache state-machine/controllers
to model different levels of the cache hierarchy.

Change-Id: I9a202e9461e0d2f16ed232ff8b60bbde2d15570d
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31415
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: Expose MessageBuffer methods
Tiago Mück [Thu, 28 May 2020 17:31:03 +0000 (12:31 -0500)]
mem-ruby: Expose MessageBuffer methods

SLICC interface for checking the capacity of MessageBuffers

Change-Id: I28e2d22a405d33fcbe6a183dffc31bd936fa26c4
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31271
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: add addressOffset util
Tiago Mück [Fri, 5 Jun 2020 17:55:42 +0000 (12:55 -0500)]
mem-ruby: add addressOffset util

Returns the offset of an address with respect to a base address.
Looks unnecessary, but SLICC doesn't support casting and the '-'
operator for Addr types, so the alternative to this would be to add
more some helpers like 'addrToUint64' and 'uint64ToInt'.

Change-Id: I90480cec4c8b2e6bb9706f8b94ed33abe3c93e78
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31270
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agofastmodel: Add a wrapper for the CortexR52.
Gabe Black [Tue, 4 Aug 2020 07:46:52 +0000 (00:46 -0700)]
fastmodel: Add a wrapper for the CortexR52.

There has been some testing of this wrapper, but some components are
missing. It's not currently possible to read or set Misc registers,
64 bit integer registers, flattened integer registers, or vector
registers. In some cases that's because no mapping from gem5 indexes
to IRIS resource names has been set up, but in some cases, since R52
is 32 bit, no mapping *can* be set up, and we need to figure out what
to do with requests for 64 bit only state.

Change-Id: I2d650a7c1765b39f25058727502c96e6de5aa26b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35635
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoutil: Add a copyright to gem5img.py.
Gabe Black [Sat, 10 Oct 2020 11:08:10 +0000 (04:08 -0700)]
util: Add a copyright to gem5img.py.

This script was ported to python from a bash script by me back in 2011.
The original file didn't have a copyright, but since I made significant
modifications to it (porting it to python, improving its features), at
least those modifications should have become copyright Google.

Change-Id: Ia70bb1e6be5b188537bcf6899ba5884b359dbe18
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35875
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoconfigs,tests: Update configs to use compatible SE workloads.
Gabe Black [Tue, 1 Sep 2020 06:00:27 +0000 (23:00 -0700)]
configs,tests: Update configs to use compatible SE workloads.

If there's no more compatible workload than the base SEWorkload class it
will fall back to that for now.

Change-Id: Id27172c3074a7976823a891878ab9eecf6246c47
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33901
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch: Use finditer in the (Sub)OperandList classes.
Gabe Black [Wed, 30 Sep 2020 04:11:19 +0000 (21:11 -0700)]
arch: Use finditer in the (Sub)OperandList classes.

This method returns an iterator which goes through all the
non-overlapping matches for the given RE, without having to hand code
that same behavior with the more basic "search" method.

Change-Id: I4c4d95cfc8f72125566222aebb56604c3e9e2b03
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35817
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch: Pull the (Sub)OperandList classes into their own file.
Gabe Black [Wed, 30 Sep 2020 04:04:30 +0000 (21:04 -0700)]
arch: Pull the (Sub)OperandList classes into their own file.

Another step in breaking down the isa parser into more manageable parts.

Change-Id: I0c5e70fe481bd17c0069b768129731e99a93ed0d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35816
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-cache: Create ReplacementPolicy namespace
Daniel R. Carvalho [Sat, 28 Dec 2019 22:38:21 +0000 (23:38 +0100)]
mem-cache: Create ReplacementPolicy namespace

Encapsulate the replacement policy classes in their own namespace.

As a side effect these classes have been renamed to drop the RP
suffix in the C++ code.

Change-Id: Ibb65dfb584a1413492fcf11833cf91a859cbff4e
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35795
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: detailed transaction latency profiling
Tiago Mück [Thu, 16 Jul 2020 16:37:22 +0000 (11:37 -0500)]
mem-ruby: detailed transaction latency profiling

Add incomingTransactionStart/End and outgoingTransactionStart/End
functions that can be called from the protocol to profile events
that initiate a transaction locally (e.g. an incoming request) and
remotely (e.g. outgoing requests). The generated stats will include
histograms of the latency for completing each type of transaction.

This assumes assumes the protocol uses different trigger events for
initiating incoming and outgoing transactions.

Change-Id: Ib528641b9676c68907b5989b6a09bfe91373f9c9
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31421
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: John Alsop <johnathan.alsop@amd.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: expose transition info to actions
Tiago Mück [Thu, 16 Jul 2020 16:14:40 +0000 (11:14 -0500)]
mem-ruby: expose transition info to actions

SLICC compiler generates the curTransitionEvent and
curTransitionNextState functions, which allows actions to check which
event triggered the current transition and what's the next state.

Change-Id: I79c8c4f2839633b7fb3b23cbbdbb32f25db90eab
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31420
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: change MessageBuffer randomization param
Tiago Mück [Sat, 20 Jun 2020 02:16:45 +0000 (21:16 -0500)]
mem-ruby: change MessageBuffer randomization param

There are cases in which we need to prevent randomization for a
specific buffer when enabled at the RubySystem level (e.g. a internal
trigger queue that requires zero latency enqueue, while other buffers
can be randomized).

This changes the randomization parameter to support enabling and
disabling randomization regardless of the RubySystem setting.

Change-Id: If7520153cc5864897fa42e8911a6f8acbcf01db5
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31419
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: sequencer callback for unique writes
Tiago Mück [Tue, 9 Jun 2020 00:01:14 +0000 (19:01 -0500)]
mem-ruby: sequencer callback for unique writes

A controller may complete a write without obtaining a full copy of
the line. This patch adds a specific callback for this purpose that
prevents reads to be coalesced with a write on a potentially incomplete
line.

Change-Id: I3775f81699f38e406fee28f92c9c8e06deb3d528
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31269
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bradford Beckmann <bradford.beckmann@gmail.com>
3 years agomem-ruby: move AddrRange propagation to RubyPort
Tiago Mück [Mon, 1 Jun 2020 23:08:03 +0000 (18:08 -0500)]
mem-ruby: move AddrRange propagation to RubyPort

Doing the master address range notification from the RubyPort.
This allows us the DMASequencer to be replaced by Sequencer in future
protocols.

Change-Id: I95edb54b39a8adf0cac5caf2b58e4a2efb573f56
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31268
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: Sequencer can be used without cache
Tiago Mück [Thu, 28 May 2020 21:16:20 +0000 (16:16 -0500)]
mem-ruby: Sequencer can be used without cache

Moved the dcache check to the LLSC functions that use it.
This allows a Sequencer to be coupled with a gem5 object
that does not need a cache (as long as it doesn't issue
LLSC instructions).

Also, icache was not used at all so it was removed.

Change-Id: I04bd2711f8d0a7dfc952cff8e0020d2d1881cae1
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31267
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bradford Beckmann <bradford.beckmann@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: int to Cycle converter
Tiago Mück [Wed, 27 May 2020 21:40:33 +0000 (16:40 -0500)]
mem-ruby: int to Cycle converter

Change-Id: I493b16a0bdd01a4cef4891e273a376ebe9509fe8
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31266
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: support for template types in structs
Tiago Mück [Wed, 29 Apr 2020 23:04:21 +0000 (18:04 -0500)]
mem-ruby: support for template types in structs

Templated types can now be used within structures defined in SLICC.
Usage is similar to the TBETable: the templated type must have all
possible methods in it's SLICC definition. Eg.:

structure(Map, desc="Template map definition") {
    MachineID lookup(Addr);
    MachineID lookup(int);
}

structure(SomeType, desc="Some other struct definition") {
    MachineID addrMap, template="<Addr,MachineID>";
    MachineID intMap, template="<int,MachineID>";
}

Change-Id: I02a621cea5e4a89302762334651c6534c6574e9d
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31264
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Bradford Beckmann <bradford.beckmann@gmail.com>
Maintainer: Bradford Beckmann <bradford.beckmann@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: added function to check addr range
Tiago Mück [Tue, 25 Feb 2020 23:26:05 +0000 (17:26 -0600)]
mem-ruby: added function to check addr range

respondsTo checks if a controller address ranges includes a given
address.

Change-Id: I9a320011d93e7fd8df1ad3bda75c85d314261a99
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31263
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bradford Beckmann <bradford.beckmann@gmail.com>
3 years agomem-ruby: missing method in NetDest interface
Tiago Mück [Wed, 27 May 2020 23:41:23 +0000 (18:41 -0500)]
mem-ruby: missing method in NetDest interface

Change-Id: Ibf651c37c50174186daebebc06aa115e6bc2ed33
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31262
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Bradford Beckmann <bradford.beckmann@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: added %(mod) operator to SLICC
Tiago Mück [Fri, 13 Sep 2019 20:55:15 +0000 (15:55 -0500)]
mem-ruby: added %(mod) operator to SLICC

Change-Id: I9d1a10824ced3723d13e2843ad739ced72e476ce
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31260
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: John Alsop <johnathan.alsop@amd.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch: Minor cleanup of imports in isa_parser.py.
Gabe Black [Tue, 29 Sep 2020 08:09:20 +0000 (01:09 -0700)]
arch: Minor cleanup of imports in isa_parser.py.

The with statement and print function are no longer in the future, and
the "inspect" module is not used. Also alphabetize the imports.

Change-Id: I35f2b7b0f7495cb9ca79d2cbe05f020560ec3593
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35280
Reviewed-by: Steve Reinhardt <stever@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch: Split utility methods/variables out of the ISA parser.
Gabe Black [Tue, 29 Sep 2020 07:58:36 +0000 (00:58 -0700)]
arch: Split utility methods/variables out of the ISA parser.

Change-Id: Ifbff4bc6633cd11f98b02ba1291a91c3ad189285
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35279
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch: Split the operand types out of the ISA parser.
Gabe Black [Tue, 29 Sep 2020 07:49:22 +0000 (00:49 -0700)]
arch: Split the operand types out of the ISA parser.

These conceptually go together and don't depend on any other parts of
the parser.

Change-Id: Ia8bff0d0ec210bdeeb080808968faf9528ee03dd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35278
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch: Move the ISA parser into a package.
Gabe Black [Tue, 29 Sep 2020 07:24:26 +0000 (00:24 -0700)]
arch: Move the ISA parser into a package.

This will make splitting the parser into components easier, since it
will keep help keep everything together and organized.

Change-Id: I737641e124b6da8b1b18a49de9110c8424d8cc4f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35277
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agox86: Change how IO port devices are structured in the PC platform.
Gabe Black [Fri, 2 Oct 2020 09:50:18 +0000 (02:50 -0700)]
x86: Change how IO port devices are structured in the PC platform.

Before, for historical reasons, the PCI host device was the default
responder on the IO bus, meaning that when there was any type of
transaction which didn't have a device to go to, it would end up
looking like a PCI config transaction. It's very unlikely that this is
what it actually was, and what would happen would be arbitrary and
probably not helpful.

Also, there was no device in place to respond to accesses in x86's IO
port address space. On a real system, these accesses just return junk
and are otherwise legal. On systems where there would be physical bus
wires they would probably return whatever the last data on the bus was.

This would have been helpful when the platform was first being set up
because it would make it obvious when the OS tried to access a device
that wasn't implemented, but there were a few cases where it would
purposefully fiddle with ports with nothing on them. These had one off
backing devices in the config which would handle the accesses
harmlessly, but if the OS changed and tried to access other ports, the
configs would need to be updated.

Now, the PCI host is just another device on the bus. It claims all of
the PCI config space addresses, so any config access, even ones which
don't go with a device, will go to it, and it can respond with all 1s
like it's supposed to.

In it's place, the default responder is now a bus. On that bus is
a device which responds to the entire IO port address range with 0s.
The default on *that* bus is a device which will mark any accesses
as bad.

With this setup, accesses which don't go to a device, including a
device on the IO port address space, will go to the IO bus's default
port. There, if the access was an IO access, it will go to the device
which replies successfully with all 0s. If not, it's marked as an
error.

The device which backs the entire IO address space doesn't conflict
with the actual IO devices, since the access will only go towards it
if it's otherwise unclaimed, and the devices on the default bus don't
participate in routing on the higher level IO bus.

Change-Id: Ie02ad7165dfad3ee6f4a762e2f01f7f1b8225168
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35515
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agostats: Output new-world stats before legacy stats
Andreas Sandberg [Mon, 5 Oct 2020 14:27:55 +0000 (15:27 +0100)]
stats: Output new-world stats before legacy stats

Now that global stats have been converted to new-style stats, it's
desirable to output them before legacy stats. This ensures that global
statistics (e.g., host_seconds) show up first in the stat file.

Change-Id: Ib099d0152a6612ebbadd234c27f2f3448aef1260
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35617
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agosim, stats: Move global stats to Root
Andreas Sandberg [Mon, 5 Oct 2020 14:21:59 +0000 (15:21 +0100)]
sim, stats: Move global stats to Root

Global stats are currently exposed using the legacy stat system (i.e.,
without a parent group). This change moves global stats from
stat_control.cc to a group that gets exported from the Root object.

The implementation adds the Root::Stats class which has a single
global instance. This instance is exposed to the rest of the simulator
using the global rootStats symbol. The intention is that objects that
need global statistics in formulas access them through the rootStats
object.

The global names simSeconds, simTicks, simFreq, and hostSeconds are
now references to their respective members in the rootStats object.

Change-Id: I267b5244a0bcca93dd2dcf03388e7085bdd79c9e
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35616
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: Simplify Ruby prefetcher's filter access functions
Daniel R. Carvalho [Sat, 21 Dec 2019 21:53:44 +0000 (22:53 +0100)]
mem-ruby: Simplify Ruby prefetcher's filter access functions

The signatures request many things that do not need to be passed
around.

Change-Id: If780e848b19056c9213092b6fc8673bd4f37b65f
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24534
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: Use CircularQueue for prefetcher's non unit filter
Daniel R. Carvalho [Sat, 21 Dec 2019 13:55:30 +0000 (14:55 +0100)]
mem-ruby: Use CircularQueue for prefetcher's non unit filter

Ruby prefetcher's non-unit filter is a circular queue, so use the class
created for this functionality.

This changes the behavior, since previously iterating through the
filter was completely arbitrary, and now it iterates from the
beginning of the queue to the end when accessing and updating
the filter's contents.

Change-Id: I3148efcbef00da0c8f6cf2dee7fb86f6c2ddb27d
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24533
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: Use CircularQueue for prefetcher's unit filter
Daniel R. Carvalho [Sat, 21 Dec 2019 14:10:08 +0000 (15:10 +0100)]
mem-ruby: Use CircularQueue for prefetcher's unit filter

Ruby prefetcher's unit filter is a circular queue, so use the class
created for this functionality.

This changes the behavior, since previously iterating through the
filter was completely arbitrary, and now it iterates from the
beginning of the queue to the end when accessing and updating
the filter's contents.

Change-Id: I834be88a33580d5857c38e9bae8b289c5a6250b9
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24532
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch: Build the operand REs in the isa_parser on demand.
Gabe Black [Mon, 28 Sep 2020 08:12:14 +0000 (01:12 -0700)]
arch: Build the operand REs in the isa_parser on demand.

These regular expressions search code snippets to find places where
operands are used. Rather than build them explicitly at the end of
processing the operands{{}} construct, wait until they're first going to
be used. That way, we'll be able to define operands in as many places as
we want, as long as we've done all we're going to do before the first
instructions are defined.

This will pave the way to defining operands in regular python in let
blocks, and then possibly outside of the parser altogether, perhaps into
scons where having lots of output files for individual instructions will
be easier to manage. For now, this just lets you define multiple
operands blocks which is not all that exciting on its own :)

Change-Id: I1179092316c1c0ac2613810bfd236a32235502fb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35237
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Steve Reinhardt <stever@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: fix include dependency
Tiago Mück [Wed, 17 Jun 2020 01:06:49 +0000 (20:06 -0500)]
mem-ruby: fix include dependency

Removed include dependency between WriteMask and RubySystem.

Change-Id: I3e81267341e3875b1bb0fc3cb39f1a308e383dfd
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31258
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: additional WriteMask methods
Tiago Mück [Thu, 28 May 2020 17:31:36 +0000 (12:31 -0500)]
mem-ruby: additional WriteMask methods

Change-Id: Ib5d5f892075b38f46d1d802c043853f56e19ea12
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31257
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: Network can use custom data msg size
Tiago Mück [Thu, 5 Sep 2019 22:53:40 +0000 (17:53 -0500)]
mem-ruby: Network can use custom data msg size

The size for network data messages can be set using a configuration
parameter. This is necessary so line transfers may be split in multiple
messages at the protocol level.

Change-Id: I86a272de597b04a898071db412b921cbe1651ef0
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31256
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Srikant Bharadwaj <srikant.bharadwaj@amd.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>