gem5.git
5 years agomem: Use a const T & in write<> to avoid an unnecessary copy.
Gabe Black [Thu, 2 May 2019 03:16:56 +0000 (20:16 -0700)]
mem: Use a const T & in write<> to avoid an unnecessary copy.

If the type T is complex/large, the it makes sense to access it in place
and not copy it and then not modify it.

Change-Id: Idd24be4fbba636375637ff72b1ba5ee32eb76215
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18573
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agoarch, base, dev, sim: Remove now unnecessary casts from PortProxy methods.
Gabe Black [Thu, 2 May 2019 03:14:13 +0000 (20:14 -0700)]
arch, base, dev, sim: Remove now unnecessary casts from PortProxy methods.

Change-Id: Ia73b2d86a10d02fa09c924a4571477bb5f200eb7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18572
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem, arm: Replace the pointer type in PortProxy with void *.
Gabe Black [Thu, 2 May 2019 03:12:05 +0000 (20:12 -0700)]
mem, arm: Replace the pointer type in PortProxy with void *.

The void * type is for pointers which point to an unknown type. We
should use that when handling anonymous buffers in the PortProxy
functions, instead of uint8_t * which points to bytes.

Importantly, C/C++ doesn't require you to do any casting to turn an
arbitrary pointer type into a void *. This will get rid of lots of
tedious, verbose casting throughout the code base.

Change-Id: Id1adecc283c866d8e24524efd64f37b079088bd9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18571
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem, arm: Move some helper methods into the base PortProxy class.
Gabe Black [Thu, 2 May 2019 02:03:28 +0000 (19:03 -0700)]
mem, arm: Move some helper methods into the base PortProxy class.

These were originally in the SETranslatingPortProxy class, but they're
not specific to SE mode in any way and are an unnecessary divergence
between the SE and FS mode translating port proxies.

Change-Id: I8cb77531cc287bd15b2386410ffa7b43cdfa67d0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18570
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agoarm, mem: Move the SecurePortProxy subclass into it's own file.
Gabe Black [Thu, 2 May 2019 00:56:39 +0000 (17:56 -0700)]
arm, mem: Move the SecurePortProxy subclass into it's own file.

The idea of a "secure" memory area/access is specific to ARM and
shouldn't be in the common mem directory, although it's built in to the
generic memory protocol at this point.

Regardless, it should minimially be in its own file like the virtual
and physical port proxy classes are.

Change-Id: I140d4566ee2deded784adb04bcf6f11755a85c0c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18569
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem: Parameterize coherent xbar sanity checks
Tiago Muck [Mon, 4 Mar 2019 22:42:13 +0000 (16:42 -0600)]
mem: Parameterize coherent xbar sanity checks

Parameters can be used to change coherent xbar limits for the routing
table and outstanding snoops. We need the ability to tweak these values
as the current defaults may be violated in simulations with large core
counts.

Change-Id: Idb64b8c105683d02d8beba5bce13b815181ba824
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18789
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem: Snoop filter support for large systems
Tiago Muck [Thu, 7 Feb 2019 19:37:40 +0000 (13:37 -0600)]
mem: Snoop filter support for large systems

Changed SnoopMask to use std::bitset instead of uint64 so we can simulate
larger systems without having to workaround limitations on the number of
ports. No noticeable performance drop was observed after this change.
The size of the bitset is currently set to 256 which should fit most
needs.

Change-Id: I216882300500e2dcb789889756e73a1033271621
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18791
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agobase: Add warn_if_once macro
Tiago Muck [Thu, 24 Jan 2019 21:40:46 +0000 (15:40 -0600)]
base: Add warn_if_once macro

Change-Id: Ie68f3b07a35ed2e6b0eee20b3b34050542fcdc6c
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18420
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agocpu: Remove assert causing issues with x86 Linux boot
Giacomo Gabrielli [Thu, 23 May 2019 13:00:24 +0000 (14:00 +0100)]
cpu: Remove assert causing issues with x86 Linux boot

Change-Id: I5e0b189ced0dd59ac6dbbb2c498c068e132b9b93
Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18910
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: Fix fallthrough when trapping at EL2
Giacomo Travaglini [Fri, 24 May 2019 09:10:25 +0000 (10:10 +0100)]
arch-arm: Fix fallthrough when trapping at EL2

This had been caused by the introduction of GICv3 registers trapping in
commit 32a23114c14cebc5ec0067ac739144b50e412219

Change-Id: I5073e2891f3ff5c5a9e05d3456dad6f4f8ffba0d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18909
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: Trap virtual accesses to GICv3 SGI registers
Giacomo Travaglini [Tue, 12 Feb 2019 13:09:18 +0000 (13:09 +0000)]
arch-arm: Trap virtual accesses to GICv3 SGI registers

According to GICv3 documentation, a virtual write (which means
HCR.IMO/FMO = 1) to ICC_SGI0R_EL1, ICC_SGI1R_EL1, ICC_ASGI1R_EL1 should
trap to EL2.

Change-Id: Ie7a952c2ff08590bb0c6e3854df567d714c2dc94
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17990
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: Expose haveGicv3CPUInterface to the ISA interface
Giacomo Travaglini [Tue, 19 Feb 2019 09:51:31 +0000 (09:51 +0000)]
arch-arm: Expose haveGicv3CPUInterface to the ISA interface

Change-Id: I36232b7618ad875983f34b741c51f12ddb9ae166
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17989
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: Change mcrMrc15TrapToHyp signature
Giacomo Travaglini [Tue, 19 Feb 2019 10:20:14 +0000 (10:20 +0000)]
arch-arm: Change mcrMrc15TrapToHyp signature

This patch is moving MiscRegs reading inside the mcrMrc15TrapToHyp
helper function. Rather than passing registers as arguments,
we are just passing a ThreadContext pointer

Change-Id: I6636dd3a4f92f757479d8a8d2c47de050a0b9eae
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17988
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem: Add invalid context id check on LLSC checks
Tiago Muck [Wed, 12 Dec 2018 21:52:41 +0000 (15:52 -0600)]
mem: Add invalid context id check on LLSC checks

If the request's address is in the LLSC list, its context Id was being
fetched unconditionally, which could cause the assert at
Request::contextId() to fail.

Change-Id: Iae9791f81c8fe9a7fcd842cd8ab7db18f34f2808
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18792
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: remove comment for code that moved
Brandon Potter [Tue, 28 Aug 2018 18:39:24 +0000 (14:39 -0400)]
sim-se: remove comment for code that moved

The page table code must have moved from this class, because
the comment no longer accurately reflects upon any of the
surrounding code.

Change-Id: If08a4298c1237a541d9875ddeaf3d3ecfd98e9db
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12300
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
5 years agodev-arm: Provide a GICv3 ITS Implementation
Giacomo Travaglini [Tue, 16 Apr 2019 08:20:22 +0000 (09:20 +0100)]
dev-arm: Provide a GICv3 ITS Implementation

This patch introduces the GICv3 ITS module, which is in charge of
translating MSIs into physical (GICv3) and virtual (GICv4) LPIs.  The
patch is only GICv3 compliant, which means that there is no direct
virtual LPI injection (this also means V* commands are unimplemented)
Other missing features are:

* No 2level ITS tables (only flat table supported)

* Command errors: when there is an error in the ITS, it is
IMPLEMENTATION DEFINED on how the ITS behaves.  There are three possible
scenarios (see GICv3 TRM) and this implementation only supports one of
these (which is, aborting the command and jumping to the next one).
Furter patches could make it possible to select different reactions

* Invalidation commands (INV, INVALL) are only doing the memory table
walks, assuming the current Gicv3Redistributor is not caching any
configuration table entry.

Change-Id: If4ae9267ac1de7b20a04986a2af3ca3109743211
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18601
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: change syscall function signature
Brandon Potter [Tue, 28 Aug 2018 14:13:04 +0000 (10:13 -0400)]
sim-se: change syscall function signature

The system calls had four parameters. One of the parameters
is ThreadContext and another is Process. The ThreadContext
holds the value of the current process so the Process parameter
is redundant since the system call functions already have
indirect access.

With the old API, it is possible to call into the functions with
the wrong supplied Process which could end up being a confusing
error.

This patch removes the redundancy by forcing access through the
ThreadContext field within each system call.

Change-Id: Ib43d3f65824f6d425260dfd9f67de1892b6e8b7c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12299
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: remove /sys from special paths
Tony Gutierrez [Wed, 18 Apr 2018 22:25:23 +0000 (18:25 -0400)]
sim-se: remove /sys from special paths

Currently, the open system call implementation in SE mode
treats /sys/ as a special path that is opened using a
special open handler. The ROC runtime, however, reads
several files in /sys/ that are supported via path
redirection. Here we remove /sys/ from the special files
so that the necessary files may be read via path
redirection.

Change-Id: Ifdab38ea1e6cc486ad43aec96b6e032fe63f137d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12127
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoscons: Move the marshal binary to the build directory
Chun-Chen TK Hsu [Mon, 20 May 2019 16:38:31 +0000 (00:38 +0800)]
scons: Move the marshal binary to the build directory

The current marshal binary is in $BUILD/python/ directory which makes
the dynamic linker fail to find shared libraries with rpath information
when the marshal is executing. Moving $BUILD/python/marshal to
$BUILD/marshal solves this problem.

This is because the marshal binary is built with the same flags as gem5
binary. And if one adds rpath information with add_local_rpath() in some
SConscripts, the marshal binary will also link to those shared libraries
and have the same rpath information.  So it must be in the same
directory as gem5 binary such that the dynamic linker could find those
shared libraries with the rpath information.

Signed-off-by: Chun-Chen TK Hsu
Change-Id: I98d9c3e0180abefe6b2b6a78ee5a96324038eb53
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18888
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomisc: Added dot_writer for Ruby's network topology
Tiago Muck [Wed, 31 Oct 2018 21:42:26 +0000 (16:42 -0500)]
misc: Added dot_writer for Ruby's network topology

Change-Id: Ic71ca7bc2eb4174d70afa368bc9cc987f3df89e9
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17548
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem-cache: Add multi-prefetcher adaptor
Andreas Sandberg [Tue, 12 Apr 2016 14:10:13 +0000 (09:10 -0500)]
mem-cache: Add multi-prefetcher adaptor

This patch adds a meta-prefetcher that enables gem5's cache models to
connect to multiple prefetchers. Sub-prefetchers still use the
probes-based interface and training can be controlled
independently. However, when the cache requests a prefetch packet, the
adaptor traverses the priority list of prefetchers and uses the first
prefetcher that is able to generate a prefetch.

Kudos to Mitch Hayenga for the original version of this patch.

Change-Id: I25569a834997e5404c7183ec995d212912c5dcdf
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18868
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim: Make the Process create function use the object loader mechanism.
Gabe Black [Fri, 3 May 2019 05:58:08 +0000 (22:58 -0700)]
sim: Make the Process create function use the object loader mechanism.

This gets rid of the big mass of #if-s around headers and around the
code which creates an object file.

As a nice side bonus, this also means that in addition to supporting
multiple OS/arch combinations simultaneously, the object file loader
could support multiple ISAs simultaneously as well, since each could
load and set up its object file loaders indepedently and without the
base process classes knowledge/involvement.

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

5 years agox86: Add an object file loader for linux.
Gabe Black [Fri, 3 May 2019 05:54:08 +0000 (22:54 -0700)]
x86: Add an object file loader for linux.

Change-Id: I283dd1f52fd020ad3c226eb00fc9216ee034c67f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18630
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosparc: Add an object file loader for linux and solaris.
Gabe Black [Fri, 3 May 2019 05:53:55 +0000 (22:53 -0700)]
sparc: Add an object file loader for linux and solaris.

Change-Id: I76bcbc06714f7d538f03a8311994a868de3640f1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18629
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoriscv: Add an object file loader for linux.
Gabe Black [Fri, 3 May 2019 05:53:41 +0000 (22:53 -0700)]
riscv: Add an object file loader for linux.

Change-Id: I3accca91cc4e02fa8e3a1169590cbe6696cf05e2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18628
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>

5 years agopower: Add an object file loader for linux.
Gabe Black [Fri, 3 May 2019 05:53:23 +0000 (22:53 -0700)]
power: Add an object file loader for linux.

Change-Id: I64ce81e98a6dc96754554d0fdcd7d16b8a2752d4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18587
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Sandipan Das <sandipan@linux.ibm.com>
5 years agomips: Add an object file loader for linux.
Gabe Black [Fri, 3 May 2019 05:53:03 +0000 (22:53 -0700)]
mips: Add an object file loader for linux.

Change-Id: Icae6430a210076117cf2ceadce52d6efbe58a5f3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18586
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarm: Add an object file loader for linux and freebsd.
Gabe Black [Fri, 3 May 2019 05:52:46 +0000 (22:52 -0700)]
arm: Add an object file loader for linux and freebsd.

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

5 years agoalpha: Add an object file loader for linux.
Gabe Black [Fri, 3 May 2019 05:52:23 +0000 (22:52 -0700)]
alpha: Add an object file loader for linux.

Change-Id: I91c4019567bdf74b2517fda597121a6ad107cb86
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18584
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agobase: Add a type for keeping track of object file loaders.
Gabe Black [Fri, 3 May 2019 05:51:09 +0000 (22:51 -0700)]
base: Add a type for keeping track of object file loaders.

This avoids having a big pile of #if-s in sim/process.cc and allows
dynamically adding new types of object file loaders which might
recognize new arch/OS combinations.

Change-Id: Ie3b9c1aa2974d30a61afc4fcc529ffd6a74d43e0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18583
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch, base, cpu, dev, mem, sim: Remove #if 0-ed out code.
Gabe Black [Thu, 2 May 2019 22:33:32 +0000 (15:33 -0700)]
arch, base, cpu, dev, mem, sim: Remove #if 0-ed out code.

This code will be preserved through version control, but otherwise
creates clutter and will rot in place since it's never compiled.

Change-Id: Id265f6deac445116843956ea5cf1210d8127274e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18608
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoconfigs: Generalize FileSystemConfig for non se.py
Jason Lowe-Power [Fri, 17 May 2019 02:09:56 +0000 (19:09 -0700)]
configs: Generalize FileSystemConfig for non se.py

This patch updates the FileSystemConfig so it works with more kinds of
config scripts (e.g., the Learning gem5 scripts).

There are 4 main changes:
- Added system as a parameter to the config_filesystem function so the
function can search the system for the number of CPUs instead of relying
on options from Options.py
- Instead of calling redirect_paths everywhere config_filesystem is
used, now it is implicitly called.
- Cleaned up the Ruby scripts a bit to remove redundant calls to
config_filesystem
- Added a config_filesystem call to the Ruby Learning gem5 script
(currently the only Learning gem5 script that requires it).

In the future, I think it would be better to move the config_filesystem
call into simulate.py, probably into the instantiate function. I tried to
use the per-CPU configuration parameters instead of options from
Options.py, but that's not possible until after the SimObject params
have been finalized in instantiate.

Change-Id: Ie6501a7435cfb3ac9d2b45be3722388b34063b1e
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18848
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: implement VMINNM and VMAXNM scalar version
Ciro Santilli [Tue, 30 Apr 2019 17:24:00 +0000 (18:24 +0100)]
arch-arm: implement VMINNM and VMAXNM scalar version

ARMv8.2 16-bit versions have not yet been implemented, but a placeholders
were created for them.

Refactor the nearby decoding tree to closely match the ARM spec A32 decode
table.

That piece of the tree can also be called from thumb which decodes it in
the same way, although the thumb decode table has a different terminology

The old code didn't match neither A32 or T32 terminologies, so it is
better to at least match one of them to help verify correctness.

Change-Id: Iabbbca2932557cf6c98ce36690c385c3ddf39ed8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18690
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: implement VMINNM and VMAXNM SIMD version
Ciro Santilli [Wed, 10 Apr 2019 13:34:03 +0000 (14:34 +0100)]
arch-arm: implement VMINNM and VMAXNM SIMD version

This instruction is backported from aarch64.

In order to use the existing fplibMinNum backend, we first move
VMIN and VPMIN to use fplib. Adding VMINNM is then trivial.

Change-Id: I404daabeb6079f60e51a648a06d5b3e54f1c24a9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18689
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: rename operands to match spec in isa/formats/fp.isa
Ciro Santilli [Wed, 10 Apr 2019 13:12:47 +0000 (14:12 +0100)]
arch-arm: rename operands to match spec in isa/formats/fp.isa

Matches ARM DDI 0487D.a decoding tables.

Change-Id: I48338ef956a04308d55d1022229ebe0962a8fe5d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18688
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem-ruby: MOESI_CMP_dir cleanup
Tiago Muck [Thu, 4 Apr 2019 22:08:08 +0000 (17:08 -0500)]
mem-ruby: MOESI_CMP_dir cleanup

Removed unused states and actions

Change-Id: I3dc684c78d4b92d219e71522ddb706a13f9874d1
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18415
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: John Alsop <johnathan.alsop@amd.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-ruby: Cache latencies for MOESI_CMP_dir
Tiago Muck [Wed, 20 Feb 2019 00:01:44 +0000 (18:01 -0600)]
mem-ruby: Cache latencies for MOESI_CMP_dir

Modified both L1 and L2 controllers to take into account the cache
latency parameters. Default values in the configuration script updated
as well.

Change-Id: I72bb8dd29ee0b02da06e1addf13b266fe4d1e979
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18414
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-ruby: Hit latencies defined by the controllers
Tiago Muck [Tue, 19 Feb 2019 21:58:33 +0000 (15:58 -0600)]
mem-ruby: Hit latencies defined by the controllers

Removed the icache/dcache hit latency parameters from the Sequencer.
They were replaced by the mandatory queue enqueue latency that is now
defined by the top-level cache controller. By default, the latency is
defined by the mandatory_queue_latency parameter. When the latency
depends on specific protocol states or on the request type, the protocol
may override the mandatoryQueueLatency function.

Change-Id: I72e57a7ea49501ef81dc7f591bef14134274647c
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18413
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-ruby: Do not change blocked msg enqueue info
Tiago Muck [Mon, 25 Feb 2019 22:20:32 +0000 (16:20 -0600)]
mem-ruby: Do not change blocked msg enqueue info

Updating the message counter and enqueue times when adding blocked
messages back to the queue does not make a lot of sense since these
messages are not new arrivals.
More importantly, this may lead to starvation. See the scenario below:

1) Request A for a blocked line X arrives
2) A is handled; X is blocked so A is stalled
3) Request B for X arrives; Reponse for X arrives
4) Response is handled; X unblocked; A added back to the request queue
5) B is handled ahead of A (since A's arrival was updated);
   X may become blocked again

If new requests keep comming for X, A may will be stalled forever.

Change-Id: Icad79f3f716a870e91cb3455437b8b3c35f130ac
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18412
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-ruby: Unique ranks for MOESI_CMP_dir in ports
Tiago Muck [Tue, 19 Feb 2019 18:48:06 +0000 (12:48 -0600)]
mem-ruby: Unique ranks for MOESI_CMP_dir in ports

Setting different values for the rank parameter for all inputs ports.
If left unset, it defaults to 0. This may cause issues since the rank is
used as an index in the controller's list of stalled buffers.

Change-Id: Ie8ff660b7450df959292311040aebf802657efcf
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18411
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-ruby: Change MOESI_CMP_Dir L2 addressing
Tiago Muck [Thu, 14 Feb 2019 23:38:29 +0000 (17:38 -0600)]
mem-ruby: Change MOESI_CMP_Dir L2 addressing

L1 controller selects the L2 to message based on the assigned address
ranges instead of explicitly interleaving bits in the L1 controller. This
simplifies the L1 controller implementation a bit and allows for more
flexibility when changing the address->controller mapping.

Change-Id: Ie67999bb977566939432a5045f65dbd2da81816a
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18410
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-ruby: Fix MOESI_CMP_dir debug msg
Tiago Muck [Thu, 14 Feb 2019 23:12:11 +0000 (17:12 -0600)]
mem-ruby: Fix MOESI_CMP_dir debug msg

Change-Id: I3fd32bd2e81dbf9a8ea49a43727564b8a9d64767
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18409
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-ruby: Prevent response stalls on MOESI_CMP_directory
Tiago Muck [Thu, 7 Feb 2019 17:36:56 +0000 (11:36 -0600)]
mem-ruby: Prevent response stalls on MOESI_CMP_directory

When a message triggers a transition that has actions which allocate
TBEs, the generated code automatically includes a check for the TBETable
size before executing any action. If the table is full, the transition
returns TransitionResult_ResourceStall and no more messages from the
buffer are handled (until the next cycle).

This behavior may lead to deadlocks in the MOESI_CMP_directory protocol
since events triggered by the response queue may allocate TBEs (e.g.
L2 replacements triggered by the response queue). If the table is full,
the queue is stalled preventing other responses from freeing TBEs.

This patch fixes this by handling WRITEBACK_DIRTY_DATA/CLEAN_DATA messages
as requests and WB_ACK/WB_NACK as responses. All controllers are changed
to work with the new types. With this fix, responses are always
handled first in all controllers, and no response triggers TBE
allocations.

Change-Id: I377c0ec4f06d528e9f0541daf3dcc621184f2524
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18408
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: John Alsop <johnathan.alsop@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agoarch-arm: Do not check MustBeOne flag for TLB requests from the prefetcher
Javier Bueno [Tue, 14 May 2019 08:14:23 +0000 (10:14 +0200)]
arch-arm: Do not check MustBeOne flag for TLB requests from the prefetcher

Allow TLB requests generated from prefetchers to override the
MustBeOne arch flag. This allows the prefetchers to issue requests
without having to know architecutre-specific flags.

Change-Id: Id83e0c93f3d1a614da11c4f344ab4dc594423672
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18768
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoconfigs: Fix duplicate branchPred reference in Simulation.py
Javier Bueno [Tue, 14 May 2019 09:16:43 +0000 (11:16 +0200)]
configs: Fix duplicate branchPred reference in Simulation.py

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

5 years agoRevert "cpu: fix how a thread starts up in MinorCPU"
Giacomo Travaglini [Fri, 1 Mar 2019 13:56:59 +0000 (13:56 +0000)]
Revert "cpu: fix how a thread starts up in MinorCPU"

This reverts commit 02dafc5498750d9734ba8f2a1608a846f90b71d1.
The commit was part of a patchset which broke MinorCPU regressions
(switcheroo)

Change-Id: I0a8098fc71abe5838014e587dbe372b258d8aa9f
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18604
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoRevert "cpu: stop scheduling suspended threads in MinorCPU"
Giacomo Travaglini [Fri, 1 Mar 2019 13:56:25 +0000 (13:56 +0000)]
Revert "cpu: stop scheduling suspended threads in MinorCPU"

This reverts commit 6a6668bbc4b038b98eb3ee64ffb034719316afd9.
The commit was part of a patchset which broke MinorCPU regressions
(switcheroo)

Change-Id: I3c16a6478ba44b9d27cdd3d64a710a356999df05
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18603
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoRevert "cpu: fix branching when thread is suspended in MinorCPU"
Giacomo Travaglini [Fri, 1 Mar 2019 13:56:15 +0000 (13:56 +0000)]
Revert "cpu: fix branching when thread is suspended in MinorCPU"

This reverts commit e437086341712f1435db655b3527ea29b3311f4e.
The commit was part of a patchset which broke MinorCPU regressions
(switcheroo)

Change-Id: Ib8482034c2402008ccfa552325a8eb31e731b619
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18602
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem-cache: Use SatCounter for prefetchers
Daniel [Thu, 11 Apr 2019 06:37:56 +0000 (08:37 +0200)]
mem-cache: Use SatCounter for prefetchers

Many prefetchers re-implement saturating counters with ints. Make
them use SatCounters instead.

Added missing operators and constructors to SatCounter for that to
be possible and their respective tests.

Change-Id: I36f10c89c27c9b3d1bf461e9ea546920f6ebb888
Signed-off-by: Daniel <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17995
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Javier Bueno Hedo <javier.bueno@metempsy.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agobase: Add operators to SatCounter
Daniel [Sat, 13 Apr 2019 09:02:43 +0000 (11:02 +0200)]
base: Add operators to SatCounter

Add shift, add and subtract assignment operators, as well as
copy and move constructor and assignments to SatCounter, so
that it they can be used by the prefetchers.

Also add extra useful functions to calculate saturation
oercentile so that the instantiator does not need to be aware
of the counter's maximum value.

Change-Id: I61d0cb28c8375b9d2774a39011e4a0aa6fe9ccb7
Signed-off-by: Daniel <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17996
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agobase: Add GTest to SatCounter
Daniel [Wed, 10 Apr 2019 21:40:39 +0000 (23:40 +0200)]
base: Add GTest to SatCounter

Add a GTest to the SatCounter class.

Change-Id: Iaf1b18db9fe8d7fe32e0e40c7947dcd1fd6cc33b
Signed-off-by: Daniel <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17994
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
5 years agobase: Move SatCounter to base directory
Daniel [Wed, 10 Apr 2019 21:11:46 +0000 (23:11 +0200)]
base: Move SatCounter to base directory

Saturating counters are used by many objects, not only
the cpu predictors. Therefore, move the class to the
base folder so that it can be more easily used.

Change-Id: I26f799324bdd8720ab8834c72a2002149cee777c
Signed-off-by: Daniel <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17993
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
5 years agocpu: Revamp saturating counters
Daniel [Fri, 5 Apr 2019 09:28:53 +0000 (11:28 +0200)]
cpu: Revamp saturating counters

Revamp the SatCounter class, improving comments, implementing
increment, decrement and read operators to solve an old todo,
and adding missing error checking.

Change-Id: Ia057c423c90652ebd966b6b91a3471b17800f933
Signed-off-by: Daniel <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17992
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoconfig: add an option to list and select indirect branch predictor
Jairo Balart [Mon, 7 Jan 2019 06:45:14 +0000 (07:45 +0100)]
config: add an option to list and select indirect branch predictor

Change-Id: I9a855d36de7d95b7785ff8a897899037cea6a3d8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/15320
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agocpu: Make the indirect predictor into a SimObject
Jairo Balart [Sun, 6 Jan 2019 21:26:12 +0000 (22:26 +0100)]
cpu: Make the indirect predictor into a SimObject

Change-Id: Ice6549773def7d3e944fae450d4a079bc351e2ba
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/15319
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem-ruby: Replace string parameter in MultiBitSelBloomFilter
Daniel R. Carvalho [Mon, 6 May 2019 16:23:34 +0000 (18:23 +0200)]
mem-ruby: Replace string parameter in MultiBitSelBloomFilter

Replace string parameter from MultiBitSelBloomFilter's constructor
by their tokenized counterparts.

Change-Id: I2e3db109dc4814fa0e9c13259f1136a6c4083092
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18728
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: Add initial support for SVE contiguous loads/stores
Giacomo Gabrielli [Wed, 8 Nov 2017 16:06:12 +0000 (16:06 +0000)]
arch-arm: Add initial support for SVE contiguous loads/stores

Thanks to Pau Cabre and Adria Armejach Sanosa for their contribution
of bugfixes.

Change-Id: If8983cf85d95cddb187c90967a94ddfe2414bc46
Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/13519
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

5 years agocpu,mem: Add support for partial loads/stores and wide mem. accesses
Giacomo Gabrielli [Fri, 7 Jul 2017 13:13:11 +0000 (14:13 +0100)]
cpu,mem: Add support for partial loads/stores and wide mem. accesses

This changeset adds support for partial (or masked) loads/stores, i.e.
loads/stores that can disable accesses to individual bytes within the
target address range.  In addition, this changeset extends the code to
crack memory accesses across most CPU models (TimingSimpleCPU still
TBD), so that arbitrarily wide memory accesses are supported.  These
changes are required for supporting ISAs with wide vectors.

Additional authors:
- Gabor Dozsa <gabor.dozsa@arm.com>
- Tiago Muck <tiago.muck@arm.com>

Change-Id: Ibad33541c258ad72925c0b1d5abc3e5e8bf92d92
Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/13518
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agocpu: Add a memory access predicate
Giacomo Gabrielli [Tue, 23 Oct 2018 12:51:52 +0000 (13:51 +0100)]
cpu: Add a memory access predicate

This changeset introduces a new predicate to guard memory accesses.
The most immediate use for this is to allow proper handling of
predicated-false vector contiguous loads and predicated-false
micro-ops of vector gather loads (added in separate changesets).

Change-Id: Ice6894fe150faec2f2f7ab796a00c99ac843810a
Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17991
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bradley Wang <radwang@ucdavis.edu>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agoconfig, sim-se: bugfix for 54c77aa0
Brandon Potter [Thu, 9 May 2019 20:09:01 +0000 (16:09 -0400)]
config, sim-se: bugfix for 54c77aa0

The NULL ISA does not have some members for the options
class which are referenced by the FileSystemConfig
code.

Create default values for the members so that the
simulation does not fail during the configuration phase.

Change-Id: Ie65bf0e5550c964eae42d1df4c36c2c5bc4ea703
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18748
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoconfigs: Fix FileSystemConfig import
Daniel R. Carvalho [Wed, 8 May 2019 17:58:41 +0000 (19:58 +0200)]
configs: Fix FileSystemConfig import

Add source to FileSystemConfig import

Change-Id: I2cd70a332244cbdc58b1b7c06d589b4339f6e19a
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18709
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
5 years agotests: Fix import scope of test
Daniel R. Carvalho [Wed, 8 May 2019 17:17:26 +0000 (19:17 +0200)]
tests: Fix import scope of test

Add missing scope delimiters to Alpha tester

Change-Id: Ib6796864c0dc8fc3108d9d2a7c2f770d2122889a
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18708
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-ruby: Fix MOESI_CMP_directory blocked line handling
Tiago Muck [Thu, 24 Jan 2019 21:03:21 +0000 (15:03 -0600)]
mem-ruby: Fix MOESI_CMP_directory blocked line handling

Using recycle in the L2 controllers to put messages back into the buffer
may lead to starvation when there are many L1 requests for the same line.
This can easily trigger the deadlock detection mechanism in configurations
with many cores (16+). Replacing recycle by stall_and_wait for L1
requests avoids this issue. wakeUpBuffers calls were added to all
transitions from transient to stable states.

Change-Id: I28b8aeacc48919ccf38e69653cd9205a4153514b
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17568
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem-cache: Remove writebacks packet list
Daniel R. Carvalho [Thu, 18 Apr 2019 13:53:21 +0000 (15:53 +0200)]
mem-cache: Remove writebacks packet list

Previously all atomic writebacks concerned a single block,
therefore, when a block was evicted, no other block would be
pending eviction. With sector tags (and compression),
however, a single replacement can generate many evictions.

This can cause problems, since a writeback that evicts a block
may evict blocks in the lower cache. If one of these conflict
with one of the blocks pending eviction in the higher level, the
snoop must inform it to the lower level. Since atomic mode does
not have a writebuffer, this kind of conflict wouldn't be noticed.

Therefore, instead of evicting multiple blocks at once, we
do it one by one.

Change-Id: I2fc2f9eb0f26248ddf91adbe987d158f5a2e592b
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18209
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem-cache: Handle data expansion
Daniel R. Carvalho [Wed, 8 Aug 2018 15:27:22 +0000 (17:27 +0200)]
mem-cache: Handle data expansion

When a block in compressed form is overwriten, it may change
its size. If the new compressed size is bigger, and the total
size becomes bigger than the block size, one or more blocks
will have to be evicted. This is called data expansion, or
fat writes.

This change assumes that a first level cache cannot have a
compressor, since otherwise data expansion should have been
handled for atomic operations and writes. As such, data
expansions should only be seen on writebacks. As writebacks
are forwarded to the next level when failed, there should
be no data expansions when servicing misses either.

This patch adds the functionality to handle data expansions
by evicting the co-allocated blocks to make room for an
expanded block.

Change-Id: I0bd77bf6446bfae336889940b2f75d6f0c87e533
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12087
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem-cache: Add co-allocation function to compressed tags
Daniel R. Carvalho [Tue, 19 Jun 2018 15:31:26 +0000 (17:31 +0200)]
mem-cache: Add co-allocation function to compressed tags

Implement a co-allocation function in compressed tags, so
that compressed blocks can be co-allocated in a superblock.
Co-allocation is possible when compression ratio (CR) blocks
that share a superblock tag can be compressed to up to (100/CR)%
of their size.

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

5 years agomem-cache: Add compression and decompression calls
Daniel R. Carvalho [Tue, 19 Jun 2018 15:08:35 +0000 (17:08 +0200)]
mem-cache: Add compression and decompression calls

Add a compressor to the base cache class and compress within
block allocation and decompress on writebacks.

This change does not implement data expansion (fat writes) yet,
nor it adds the compression latency to the block write time.

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

5 years agomem-cache: Create BDI Compressor
Daniel R. Carvalho [Wed, 13 Jun 2018 14:39:38 +0000 (16:39 +0200)]
mem-cache: Create BDI Compressor

Implement Base-Delta-Immediate compression, as described in
'Base-Delta-Immediate Compression: Practical Data Compression
for On-Chip Caches'

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

5 years agomem-cache: Add compression stats
Daniel R. Carvalho [Tue, 29 May 2018 15:30:29 +0000 (17:30 +0200)]
mem-cache: Add compression stats

Add compression statistics to the compressors. It tracks
the number of blocks that can fit into a certain power
of two size, and the number of decompressions.

For example, if a block is compressed to 100 bits, it will
belong to the 128-bits compression size. Although it could
also fit bigger sizes, they are not taken into account for
the stats (i.e., the 100-bit compression will fit only the
128-bits size, not 256 or higher).

We save stats for compressions that fail (i.e., compressed
size is bigger than original cache line size).

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

5 years agomem-cache: Create cache compressor
Daniel R. Carvalho [Wed, 13 Jun 2018 12:36:38 +0000 (14:36 +0200)]
mem-cache: Create cache compressor

Create basic template for cache compressors. A basic compressor
must implement a compression and a decompression method.

Change-Id: I83dc4d2b8d2bc5ed9f760c938edfa4ebdd6b8583
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11100
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
5 years agomem-cache: Add block size to findVictim
Daniel R. Carvalho [Fri, 15 Jun 2018 14:10:25 +0000 (16:10 +0200)]
mem-cache: Add block size to findVictim

Add block size to findVictim. For standard caches it
will not be used. Compressed caches, however, need to
know the size of the compressed block to decide whether
a block is co-allocatable or not.

Change-Id: Id07f79763687b29f75d707c080fa9bd978a408aa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11198
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Mohammad Seyedzadeh <sm.seyedzade@gmail.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
5 years agomem-cache: Add compression data to CompressionBlk
Daniel R. Carvalho [Fri, 30 Mar 2018 13:09:51 +0000 (15:09 +0200)]
mem-cache: Add compression data to CompressionBlk

Add a compression bit, decompression latency and compressed
block size and their respective getters and setters.

Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11102
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
5 years agomem-cache: Create CacheComp debug flag
Daniel R. Carvalho [Tue, 29 May 2018 15:42:34 +0000 (17:42 +0200)]
mem-cache: Create CacheComp debug flag

Create a debug flag for cache compression.

Change-Id: Id4b8e86d658d3aa550906ee0f8da3b54f4cdab7d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11104
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-cache: Stub compression framework
Daniel R. Carvalho [Tue, 29 May 2018 08:11:35 +0000 (10:11 +0200)]
mem-cache: Stub compression framework

Create a stub of a compression framework where we can have
multiple data blocks per tag entry. Only consecutive blocks
can share a tag as of now.

For each tag entry there can be multiple data blocks. We have
the same number of tags a conventional cache would have, but
we instantiate the maximum number of data blocks (according to
the compression ratio) per tag, to virtually implement
compression without increasing the complexity of the simulator.

Change-Id: I549940c7afb2f744ab293ff8bb283967e7551a11
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/10763
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
5 years agox86: Mark translation as delayed in case of a hw page table walk
Gabor Dozsa [Tue, 30 Apr 2019 09:20:40 +0000 (10:20 +0100)]
x86: Mark translation as delayed in case of a hw page table walk

This information is used by the LSQ in the O3 cpu (since commit
"51becd2... cpu-o3: O3 LSQ Generalisation")

Change-Id: I35fe7e2f8428641d863af0e79e28b0b259fb0b00
Signed-off-by: Gabor Dozsa <gabor.dozsa@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18508
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: correct statfs inclusion on !linux host
Andrea Mondelli [Sat, 4 May 2019 13:43:24 +0000 (09:43 -0400)]
sim-se: correct statfs inclusion on !linux host

- Added missing header
- Fixed typo on __linux__ macro conditional
- s/ifdef/if defined/g for consistency

Change-Id: I83b69856e5ec8b23b707642c0e14216cf62db31e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18668
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-riscv: Implement MHARTID CSR
Alec Roelke [Sun, 3 Mar 2019 20:13:51 +0000 (15:13 -0500)]
arch-riscv: Implement MHARTID CSR

This patch implements the MHARTID CSR by intercepting attempts to access
it, similar to the way accesses to the performance counters are
intercepted, to return the thread's context ID.

Change-Id: Ie14a31036fbe0e49fb3347ac0c3c508d9427a10d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/16988
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: fix a few bugs/warns from GCC 6
Joe Gross [Wed, 18 Apr 2018 21:59:50 +0000 (17:59 -0400)]
sim-se: fix a few bugs/warns from GCC 6

Change-Id: Ib2ad860324fd234b23262d141be3e82628ff61f0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12126
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>

5 years agosim-se: add eventfd system call
Brandon Potter [Wed, 18 Apr 2018 21:39:26 +0000 (17:39 -0400)]
sim-se: add eventfd system call

Change-Id: I7aeb4fe808d0c8f2fb8041e3662d330d8458f09c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12125
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>

5 years agomem-cache: Mark block as dirty after a SWPrefetchEXResp
Nikos Nikoleris [Thu, 7 Mar 2019 11:48:01 +0000 (11:48 +0000)]
mem-cache: Mark block as dirty after a SWPrefetchEXResp

This is a workaround for a bug introduced from the change:
59e3585a8 arch-arm: We add PRFM PST instruction for arm
which can cause deadlocks in the memory system.

The design of the classic memory system in gem5 makes the folloing two
assumptions:
* A cache that fetches a block with an intention to modify it, becomes
  the point of ordering and therefore commits to respond to any snoop
  requests [1].
* A cache that fetches an exclusive copy of the block, does so with
  the intention to modify it [2]. Immediately after it receives the
  block, it will write to it and mark it as dirty. As the point of
  ordering, it responds to any outstanding snoops.

The current implementation of prefetch exclusive request breaks the
second assumption. A cache can fetch an exclusive block without an
immediate intention to modify it. If the block is not modified, it
will not be marked as dirty. However, the cache has committed to
respond to outstanding snoops, and if the block is clean it
won't. This can result in deadlocks where a snoop gets stuck waiting
for responses.

One solution (implemented by this patch) is to unconditionally mark
the block dirty when filling due to a prefetch exclusive request.
This makes the PrefetchExReq behave like a WriteReq. However, as it
may mark as dirty a clean block, it creates the requirement for an
uncessary WritebackDirty in the future. In practice, this shouldn't be
a big problem unless the application is unnecessarily using prefetch
exclusive instructions.

Other solutions, would require deeper changes to the design of the
memory system to handle this properly.

[1]: When a cache commits to respond, it "informs" the xbar/PoC (point
of coherence) and the other caches of its intention to respond. As a
result the request will not be send to the main memory.
[2]: In fact the assumption is that in the needsWritable MSHR there is
at least one WriteReq before any snoops from other caches.

Change-Id: I378d3c0dadf25fc52e430b67102347b44d2f18ea
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17729
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-riscv,isa: Fix for compressed jump (c_j) imm
Avishai Tvila [Thu, 4 Apr 2019 20:20:24 +0000 (13:20 -0700)]
arch-riscv,isa: Fix for compressed jump (c_j) imm

c_j(al) has a special format, called CJ.
The jump offset format is instbits[12:2] --> offset[11|4|9:8|10|6|7|3:1|5]
Currently in decoder.isa, c_j format is JOp, the imm and branchTarget are incorrect
In the execute section (decoder.isa:228), the imm fields is ignored and the offset is calculated correctlly.
As a result, we get decoder flush for each c_j instance
I've added CJOp format in compressed.isa, and use it in execute section.
In addition, c_j is mappped to jal zero, cj_imm, and actually is neither indirect control nor a function call
I fixed the flags accordently.
I'll fix all IsRet, IsCall and IsIndirectControl flags for rest of (c_)jal(r) in my next commit.
I ran coremark -O0 before my fix and I got 37.7% branch miss-rate, after the fix the branch miss-rate is <13%

Change-Id: I608d5894a78a1ebefe36f21e21aaea68b42bccfc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17808
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
5 years agodev: StreamID generation in DMA device
Giacomo Travaglini [Mon, 28 Jan 2019 12:37:51 +0000 (12:37 +0000)]
dev: StreamID generation in DMA device

This patch is adding a StreamID tag to any DMA Packet. StreamIDs are
tags which are used by IOMMUs to distinguish between different
devices/functions.

For PCI devices for example, the RID (Pci Bus number, Pci Device
number, Pci Function number) could be stored in the Packet streamID
field.

For the DmaDevice base class, a simple pair of (Sub)StreamIDs has been
provided.  This is basically attaching a fixed (decided at python config
time) streamID per device.  If a derived device wants to implement a
more elaborate packet tagger (for example if it wants to have more than
one streamID), it needs to pass a different StreamID and SubstreamID to
the DmaPort interface (like dmaAction).

Change-Id: Ia17cf00437f7d3eb79211c1374134b174f90de59
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/16749
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agotests: There is no architecture called "timing".
Gabe Black [Wed, 1 May 2019 23:39:38 +0000 (16:39 -0700)]
tests: There is no architecture called "timing".

I'm sure that's supposed to be "x86". By switching it over, the x86
regression tests became runnable again.

Change-Id: I9505703a0be71047ef3dd312ae83e76c2b32fdb5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18568
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Store a PhysProxy port in Gicv3Redist
Giacomo Travaglini [Wed, 1 May 2019 09:59:22 +0000 (10:59 +0100)]
dev-arm: Store a PhysProxy port in Gicv3Redist

This spares us from retrieving the TC pointer every time we want to
write/read to memory (LPIs)

Change-Id: Iad76b5e69188fa0ac5c6777a3b2664b0fc66b12f
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18600
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Add named variable for GICD_TYPER.IDBits
Giacomo Travaglini [Tue, 30 Apr 2019 16:16:19 +0000 (17:16 +0100)]
dev-arm: Add named variable for GICD_TYPER.IDBits

This could be used by other GICv3 components to query the maximum
number of implemented interrupt identifiers

Change-Id: I132e50de331aea22523260bcefba7e961b53eccd
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18599
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Read correct version of ICC_BPR register
Giacomo Travaglini [Sat, 27 Apr 2019 18:37:25 +0000 (19:37 +0100)]
dev-arm: Read correct version of ICC_BPR register

Some methods like groupPriorityMask check for the value of binary point
registers. Those registers have a minimum value.  Writing to those
register is taking this into account, but the problem with the minimum
value arises when the value is checked before sw is writing to them.
In this case the minimum value won't be considered if the read is
directly forwarded to the ISA class.

Change-Id: Id432a37f1634b02bc478d65c52ffb88323d4bb77
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18598
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Get a Gicv3Redistributor ptr from phys address
Giacomo Travaglini [Fri, 26 Apr 2019 10:24:17 +0000 (11:24 +0100)]
dev-arm: Get a Gicv3Redistributor ptr from phys address

The patch is adding the following method to Gicv3:

* Gicv3::getRedistributorByAddr
This will be needed by the ITS when trying to select the target
redistributor after decoding the collection table entry (RDBase).

Change-Id: I40e2c155f2fdc8ca6d3c20ff7a27702e02499f20
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18597
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Add several LPI methods in Gicv3Redistributor
Giacomo Travaglini [Mon, 15 Apr 2019 15:42:43 +0000 (16:42 +0100)]
dev-arm: Add several LPI methods in Gicv3Redistributor

Refactoring the existing in code in smaller methods will be crucial when
adding the ITS module, which is a client for the redistributor class and
which will require it to take different actions depending on the command
it receives from software.

List of methods:

* read/writeEntryLPI
Reading/Writing a byte from the LPI pending table

* isPendingLPI
Checks if the pINTID LPI is set. Knowing if an LPI is set is needed by
the MOVI command, which is transfering the pending state from one
redistributor to the other only if the LPI is pending.

Change-Id: If14b1c28ff7f2aa20b12dcd822bf6a490cbe0270
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18596
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Take LPIs into account when interacting with CPUIF regs
Giacomo Travaglini [Thu, 25 Apr 2019 09:43:48 +0000 (10:43 +0100)]
dev-arm: Take LPIs into account when interacting with CPUIF regs

Previous code was not handling LPIs when it came to
activation/deactivation of interrupts.

Change-Id: Ie38f83c66afdc42132679d7e2e5823990f1710d0
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18595
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Fix GICv3 LPIs priority value
Giacomo Travaglini [Thu, 25 Apr 2019 09:45:58 +0000 (10:45 +0100)]
dev-arm: Fix GICv3 LPIs priority value

Priority bits in the LPI configuration table entry are only the MSBits
([7:2]) and need to be shifted in order to get the real LPI priority
value.

Change-Id: Id04dd4fa9113a32712c73a7094df498de3c0d2b5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18594
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Disable LPI Configuration Table caching
Giacomo Travaglini [Thu, 25 Apr 2019 15:31:55 +0000 (16:31 +0100)]
dev-arm: Disable LPI Configuration Table caching

This is done since caching is not done correctly, and we don't care for
now about performance degradations since the redistributor is using
PhysProxy ports.
Caching will make sense once the magical accesses will be replaced by
real atomic/timing transactions.

Change-Id: Iafe2a7843210111efc82c265bd0d5ec3cd9abb5a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18593
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Check EnableLPIs before checking for pending LPIs
Giacomo Travaglini [Fri, 26 Apr 2019 12:21:59 +0000 (13:21 +0100)]
dev-arm: Check EnableLPIs before checking for pending LPIs

Before reading the tables, GICR_PENDBASER and GICR_PROPBASER need to be
properly set, and those will have a consistent value only once sw
enables LPIs.

Change-Id: Ifb87944a491045e7a13ce7a280c555cb0c1e47f4
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18592
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: GICv3 LPI tables are using physical addresses
Giacomo Travaglini [Tue, 23 Apr 2019 16:06:23 +0000 (17:06 +0100)]
dev-arm: GICv3 LPI tables are using physical addresses

Change-Id: I439112f318720ae74c43a374fd3a524c607b3a23
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18591
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Fix GICv3 LPI loop
Giacomo Travaglini [Tue, 23 Apr 2019 16:38:54 +0000 (17:38 +0100)]
dev-arm: Fix GICv3 LPI loop

Loop was mistakenly increasing the upper bound of the iteration rather
than the index variable itself.

Change-Id: I0a5a7bc189bc0954a8a6d9581032c2ed902030da
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18590
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Fix Bitwise operation in GICv3
Giacomo Travaglini [Tue, 23 Apr 2019 15:08:14 +0000 (16:08 +0100)]
dev-arm: Fix Bitwise operation in GICv3

GICv3 LPI code is wrongly using the xor operator (^) in order to
evaluate powers of two.

Change-Id: Ib1131fd5940d334967a3741f8fd15d86625be356
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18589
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agotests: Add missing kernels to system creation
Daniel R. Carvalho [Wed, 1 May 2019 20:53:29 +0000 (22:53 +0200)]
tests: Add missing kernels to system creation

Change 149c1fc2d070a8ce073263880ecf2ccf7535e569 removed the
default value of the kernels, and fs tests rely on those.

Change-Id: I6d83420af5881ab59c2d223a9915f363dd8a1c69
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18528
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch: Stop using TheISA within the ISAs.
Gabe Black [Tue, 30 Apr 2019 00:12:08 +0000 (17:12 -0700)]
arch: Stop using TheISA within the ISAs.

We know for sure what the ISA is, so there's no need for the
indirection.

Change-Id: I73ff04c50890d40a4c7f40caeee746b68b846cb3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18488
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agox86: Get rid of some unnecessary TheISA-es in x86.
Gabe Black [Mon, 29 Apr 2019 23:32:37 +0000 (16:32 -0700)]
x86: Get rid of some unnecessary TheISA-es in x86.

The X86ISA namespace is already available.

Change-Id: I5774968fdfb30b01eba52cdec5e6ef2c75cb66e4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18471
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosparc: Move translation constants from isa_traits.hh into tlb.hh.
Gabe Black [Mon, 29 Apr 2019 23:28:58 +0000 (16:28 -0700)]
sparc: Move translation constants from isa_traits.hh into tlb.hh.

These aren't used outside of SPARC. Also get rid of some unused
constants.

Change-Id: Icfe119f88189348245a6f225a61e62dfa93ea951
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18470
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosparc: Move the interrupt types out of isa_traits.hh into interrupts.hh.
Gabe Black [Mon, 29 Apr 2019 23:20:45 +0000 (16:20 -0700)]
sparc: Move the interrupt types out of isa_traits.hh into interrupts.hh.

Those types aren't generic or used outside of SPARC.

Change-Id: I9bb154920a9625f12388c3d295dc933ab51fadde
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18469
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>