gem5.git
4 years agoscons: Disable spurious "array-bounds" warnings for protobuf cc files.
Gabe Black [Thu, 30 Jan 2020 07:47:03 +0000 (23:47 -0800)]
scons: Disable spurious "array-bounds" warnings for protobuf cc files.

These files are generated and so, even if they're wrong, there isn't
anything we can do about it.

Change-Id: I933057a04f09dd1c22b525a102278bbdc5fbc22b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24924
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Add a mechanism to append flags when building particular files.
Gabe Black [Thu, 30 Jan 2020 07:44:54 +0000 (23:44 -0800)]
scons: Add a mechanism to append flags when building particular files.

This could be used to tweak settings for a particular file if it needed
special treatment. I plan to use this for protobuf files which generate
code that produce a warning in gcc 9 which turns into an error.

Change-Id: I53e2dac48cd68f0cc8ad9031d8484c5036d6e4a6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24923
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: allow fs.py and fs_bigLITTLE.py to work without M5_PATH
Ciro Santilli [Tue, 29 Oct 2019 14:18:24 +0000 (14:18 +0000)]
configs: allow fs.py and fs_bigLITTLE.py to work without M5_PATH

The requirement to have an environment variable exported to run a program
is not common, and many new users trip up on it.

Before this commit, M5_PATH was a requirement to run those scripts, or
else simulation would fail with:

IOError: Can't find a path to system files.

After this patch, as long as users indicate all required files with
command line options, M5_PATH is not needed.

This patch changes the M5_PATH semantics slightly to more closely match
PATH and so be more intuitive to users: after this commit, if the
given path contains a slash /, then the path is not searched for inside
M5_PATH, which is exactly how PATH works. Users can then select images
in the CWD with a leading ./ just as done for executables.

This is backwards incompatible if users were already specifying their paths
as ./, but this interface feels saner, because otherwise writing on the CLI
e.g.:

--disk-image path/to/my.disk

would previously fail to find the disk, even if it existed, which is very
counter-intuitive. The following will still fail however:

--disk-image my.disk

which is not ideal, but for now is a comprise between backwards
compatibility of having an M5_PATH and what users expect from CLI
interfaces.

Change-Id: Ic91e1cc20557b35b69490b6dc420e7d324fae1fc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23672
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: fs.py can take multiple disk images on most ISAs
Ciro Santilli [Tue, 29 Oct 2019 16:00:24 +0000 (16:00 +0000)]
configs: fs.py can take multiple disk images on most ISAs

All ISAs except SPARC can now take multiple disk images by passing
the --disk-image option multiple times.

Before this patch, several ISAs automatically mounted a secondary disk
called "linux-bigswap2.img", which had to be in M5_PATH even if the end
user did not want more than one disk. This was the case for for example
for X86 but not ARM.

This change was done to:

* allow ARM to have a second disk image in fs.py, which was not possible,
  and allow other ISAs like X86 and ARM to take any number of disk images

* provide a simpler, more intuitive CLI interface that does not require
  magic disk images to be present in M5_PATH to work for ISAs such as X86.

  Linux does not need that secondary image to boot correctly, so it is
  more friendly to support a minimal setup that requires the least amount
  of binaries to boot, and let supply the second image manually only if
  they need it.

* make fs.py --disk-image work more similarly across all ISAs

SPARC was left with a single disk only because its setup was a bit more
complex and would require further testing.

Change-Id: I8b6e08ae6daf0a5b6cd1d57d285a9677f01eb7ad
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23671
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfig: add --bootloader to fs.py and fs_bigLITTLE.py
Ciro Santilli [Mon, 18 Nov 2019 15:30:49 +0000 (15:30 +0000)]
config: add --bootloader to fs.py and fs_bigLITTLE.py

This allows explicitly selecting which bootloader to use.

Before this commit, the bootloader had a fixed basename which
had to be present inside M5_PATH.

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

4 years agodev-arm: add boot_loader param to RealView setupBootLoader
Ciro Santilli [Tue, 29 Oct 2019 13:48:19 +0000 (13:48 +0000)]
dev-arm: add boot_loader param to RealView setupBootLoader

This serves as a basis to select different bootloaders at runtime in
future commits.

Change-Id: I2ad0006fae9ad38ec1a6b1f11063be955a4dd2ea
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23669
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

4 years agomem: Make slicc generate some default methods explicitly.
Gabe Black [Thu, 30 Jan 2020 07:50:25 +0000 (23:50 -0800)]
mem: Make slicc generate some default methods explicitly.

Implicitly using the default copy constructor and assignment operator
is apparently deprecated, and gcc 9 will warn about it, breaking the
build.

Change-Id: Ida7a8a577e9d1cde9841eac7eee1af74563f1e27
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24927
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Bradford Beckmann <brad.beckmann@amd.com>
Reviewed-by: John Alsop <johnathan.alsop@amd.com>
Maintainer: Bradford Beckmann <brad.beckmann@amd.com>

4 years agomisc: Updated old gem5 website URLs with new gem5 website URLs
Bobby R. Bruce [Fri, 17 Jan 2020 07:48:12 +0000 (23:48 -0800)]
misc: Updated old gem5 website URLs with new gem5 website URLs

Jira: https://gem5.atlassian.net/browse/GEM5-272
Change-Id: Ieadb6dd7a44dde4b0be647c91896551822b06a57
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24503
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: move initCPU calls from initState to init
Ayaz Akram [Wed, 29 Jan 2020 00:22:03 +0000 (16:22 -0800)]
cpu: move initCPU calls from initState to init

This commit moves the initCPU calls from initState to init
of base cpu (which were added in commit 0b8d02dec492215aa).
This is a temporary fix to solve the problem of X86System
initState getting called before initState of base cpu.

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

Change-Id: I7434cd811536175562cfa2646f4326907fadad8c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24884
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystem-arm: AArch64 boot, init CNTFRQ_EL0
Adrian Herrera [Thu, 5 Dec 2019 15:50:59 +0000 (15:50 +0000)]
system-arm: AArch64 boot, init CNTFRQ_EL0

CNTFRQ_EL0 should be initialised to a uniform value in all cores present
in the system. Previously, this was only done if EL3 was present,
however architecture states CNTFRQ_EL0 may be written from the highest
EL implemented.
This patch moves this initilization outside of the EL3-only one.

Change-Id: Ibaa197de53d531ba898e5137ba4f46a8c9554699
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24683
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Add a GuestABI mechanism to allocate space for a return value.
Gabe Black [Wed, 11 Dec 2019 05:48:26 +0000 (21:48 -0800)]
sim: Add a GuestABI mechanism to allocate space for a return value.

Some ABIs (including 32 bit ARM, 64 bit x86) allocate their argument
registers differently depending on their return value. For instance,
if the value needs to be returned in memory because it's too big,
the caller could pass a pointer to where the result should be stored
when the function returns. This pointer acts like an invisible first
argument, offsetting where all the normal arguments actually live.

This change adds a mechanism to handle that case. The Result templates
can now declare an allocate() static method which is given a
ThreadContext *, and a reference to the Position object. It can perform
any adjustment it needs to before the normal argument extraction
starts.

Change-Id: Ibda9095f0e8c9882742d24f5effe309ccb514188
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23747
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
4 years agotests: Removed 70.twolf tests
Bobby R. Bruce [Tue, 14 Jan 2020 19:57:41 +0000 (11:57 -0800)]
tests: Removed 70.twolf tests

In an effort to cleanup the old tests, and migrate useful tests to be
executed via `test/main.py`, it has been decided that the
`test/quick/70.twolf` tests should be removed.

Jira: https://gem5.atlassian.net/browse/GEM5-109
Change-Id: I19f2e20298e14a92f49adf0b8369e1fa09e0c1bc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24383
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Removed old quick/se/00.hello test resources
Bobby R. Bruce [Tue, 14 Jan 2020 00:24:07 +0000 (16:24 -0800)]
tests: Removed old quick/se/00.hello test resources

Change-Id: I0579e2b7a131c679fd7488457595f046702d64ef
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24326
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Removed the old ALPHA tests
Bobby R. Bruce [Tue, 14 Jan 2020 20:41:01 +0000 (12:41 -0800)]
tests: Removed the old ALPHA tests

Jira: https://gem5.atlassian.net/browse/GEM5-109
Change-Id: Id24c84c70d977f7dbd2815b862af9b7eab638aca
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24388
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Removed 50.vortex tests
Bobby R. Bruce [Tue, 14 Jan 2020 20:25:56 +0000 (12:25 -0800)]
tests: Removed 50.vortex tests

In an effort to cleanup the old tests, and migrate useful tests to be
executed via `test/main.py`, it has been decided that the
`test/long/se/50.vortex` tests should be removed.

Jira: https://gem5.atlassian.net/browse/GEM5-109
Change-Id: I9c40ca74aad11a80bd2a91bd67c9561ffa76e78f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24387
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Removed 60.bzip2 tests
Bobby R. Bruce [Tue, 14 Jan 2020 20:13:24 +0000 (12:13 -0800)]
tests: Removed 60.bzip2 tests

In an effort to cleanup the old tests, and migrate useful tests to be
executed via `test/main.py`, it has been decided that the
`test/quick/60.bzip2` tests should be removed.

Jira: https://gem5.atlassian.net/browse/GEM5-109
Change-Id: I8469814a2f4715655960b9049182e426e10380ed
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24385
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Removed 30.eon tests
Bobby R. Bruce [Tue, 14 Jan 2020 20:22:53 +0000 (12:22 -0800)]
tests: Removed 30.eon tests

In an effort to cleanup the old tests, and migrate useful tests to be
executed via `test/main.py`, it has been decided that the
`test/long/se/30.eon` tests should be removed.

Jira: https://gem5.atlassian.net/browse/GEM5-109
Change-Id: Ieb32196a5f0ed3b3375ede5aec6f8fb8d162a865
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24386
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Removed 40.perlbmk tests
Bobby R. Bruce [Tue, 14 Jan 2020 20:18:36 +0000 (12:18 -0800)]
tests: Removed 40.perlbmk tests

In an effort to cleanup the old tests, and migrate useful tests to be
executed via `test/main.py`, it has been decided that the
`test/long/se/40.perlbmk` tests should be removed.

Jira: https://gem5.atlassian.net/browse/GEM5-109
Change-Id: I3c7ea79717c90acf0656f30b878eb3f9f33fdb70
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24403
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Removed 20.parser tests
Bobby R. Bruce [Tue, 14 Jan 2020 20:06:35 +0000 (12:06 -0800)]
tests: Removed 20.parser tests

In an effort to cleanup the old tests, and migrate useful tests to be
executed via `test/main.py`, it has been decided that the
`test/long/se/70.twolf` tests should be removed.

Jira: https://gem5.atlassian.net/browse/GEM5-109
Change-Id: Ie0c0cd310ee51a37e80a84af3bf1cb603061da7c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24384
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Fix ExeTraceRecord::traceInst.
Gabe Black [Thu, 23 Jan 2020 04:29:36 +0000 (20:29 -0800)]
cpu: Fix ExeTraceRecord::traceInst.

A recent-ish change modified ExeTraceRecord::traceInst to make it more
consistent with DPRINTF-s by using dprintf_flag to print the trace
string. The generated string was passed as the format however, and that
means that all % characters in the output (from register names, for
example) are interpreted as format characters, mangling the output and
making cprintf angry since there are no corresponding arguments.

This change sets the format to "%s" instead, and passes the trace
string as the first argument. The argument won't be parsed for format
specifiers, and so should no longer get mangled.

Change-Id: I8fa9c2c22179a5b55104a618a4af4080a3931c5f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24643
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Move findFreeContext to System.
Gabe Black [Mon, 13 Jan 2020 06:58:48 +0000 (22:58 -0800)]
sim: Move findFreeContext to System.

This method searches through the ThreadContexts stored in the system,
and has no concrete connection to Process other than it happened to be
used by a Process in the clone system call.

By moving it, we can use its functionality in classes other than
Process.

Change-Id: Ic6899c335dc13841c6fe948ea3a4f8ad67e562bb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24285
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
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>
4 years agosim: Eliminate the breakAtKernelFunction function.
Gabe Black [Thu, 23 Jan 2020 04:40:38 +0000 (20:40 -0800)]
sim: Eliminate the breakAtKernelFunction function.

It looks like this function is supposed to allow you to set up a PC
based event which will trigger when the simulator executes a particular
kernel function. That event doesn't actually do anything, but you can
set a breakpoint there with gdb when debugging gem5 itself.

There are a couple of problems with this function. First, it assumes
that you want to set the breakpoint based on the first system in your
simulation. Frequently simulations have only one system, but there
isn't any rule that says they must, or any way to pick a different
system.

Second, this function assumes that you're in FS mode, that there is a
kernel, and that there is a kernel symbol table to look symbols up in.

On top of that, this function is a bit redundant since you can just use
gdb to debug the kernel inside a simulated system.

Change-Id: I8dadbd42fc7d4ccba2a035a2a72e6ede4b872f3c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24644
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: SP805 peripherals in VExpress_GEM5_Base
Adrian Herrera [Thu, 14 Nov 2019 14:57:27 +0000 (14:57 +0000)]
dev-arm: SP805 peripherals in VExpress_GEM5_Base

This patch adds the SP805 watchdog peripherals to the
VExpress_GEM5_Base platform.

Change-Id: I5c597d4d169359c1bde4bc4c7b3403091c772808
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24206
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

4 years agotests: Removing 10.mcf tests
Bobby R. Bruce [Thu, 5 Dec 2019 20:27:01 +0000 (12:27 -0800)]
tests: Removing 10.mcf tests

10.mcf depends upon the proprietary SPEC benchmarks. It has been decided
that tests which rely on them should be removed.

Change-Id: If7ce915072643294bb4eb683ca1647d1022ee352
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24325
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Consolidate and move the CPU's calls to TheISA::initCPU.
Gabe Black [Thu, 9 Jan 2020 10:10:15 +0000 (02:10 -0800)]
cpu: Consolidate and move the CPU's calls to TheISA::initCPU.

TheISA::initCPU is basically an ISA specific implementation of reset
logic on architectural state. As such, it only needs to be called if
we're not going to load a checkpoint, ie in initState.

Also, since the implementation was the same across all CPUs, this
change collapses all the individual implementations down into the base
CPU class.

Change-Id: Id68133fd7f31619c90bf7b3aad35ae20871acaa4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24189
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
4 years agoscons: fix --gold-linker build after --as-needed
Ciro Santilli [Wed, 15 Jan 2020 16:11:30 +0000 (16:11 +0000)]
scons: fix --gold-linker build after --as-needed

The build was failing with:

/usr/bin/ld: unrecognized option '--as-needed -fuse-ld=gold'

and --verbose confirms that a single quoted CLI parameter was being
executed:

"-Wl,--as-needed -fuse-ld=gold"

This happened because at Ifb001786a66b0dd9b29865e39a5740313002f250
--as-needed was added, and because it is the second option to happen before
the following main.subst, it exposed the fact that the existing main.subst
was wrong, because it returns a string instead of the expected array.

Change-Id: I619d242d60fe9d27438638ac11c2b92512881f26
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24624
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: add Watchdog Module SP805 model
Adrian Herrera [Thu, 24 Oct 2019 11:47:22 +0000 (12:47 +0100)]
dev-arm: add Watchdog Module SP805 model

This provides a model of the Arm Watchdog Module SP805. This is based
on the public TRM rev. r1p0 (ARM DDI 0270B). Integration test harness
is not supported. Auto-generation of device tree entries is provided.

Change-Id: I6157cec2212d0a1d2685bcfa983d2acbae1f3377
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24205
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: VExpress_GEM5_Base, add refclock 32KHz
Adrian Herrera [Tue, 3 Dec 2019 14:31:12 +0000 (14:31 +0000)]
dev-arm: VExpress_GEM5_Base, add refclock 32KHz

This patch adds the reference 32KHz clock to VExpress_GEM5_Base derived
platforms. This is in preparation for supporting the SP805 Watchdog.
I/O voltage domain and platform clock domain coupling is transferred
to the __init__ method for correctness.

Change-Id: Ic743fd986793f1e43b75fa60260c9b43b2737763
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24204
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Fix python line break in m5_exit test
Giacomo Travaglini [Tue, 21 Jan 2020 10:32:52 +0000 (10:32 +0000)]
tests: Fix python line break in m5_exit test

A bug has been introduced with the new test url.
The line break should have used a backslash or (this is the recommended
way by PEP8) the implied line continuation via parenthesis.
This error was preventing the test to be loaded with the error message:

Exception thrown while loading
"/tmpfs/src/git/jenkins-gem5-prod/tests/gem5/m5_util/test_exit.py"
Ignoring all tests in this file.

and was not producing a failure (the test was not run: it was jus
ignored).

Change-Id: I0afe252d66d2f6546caaf5e7be811f34f88df82c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24625
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Implement CC reg accessors.
Gabe Black [Tue, 12 Nov 2019 00:30:27 +0000 (16:30 -0800)]
fastmodel: Implement CC reg accessors.

Change-Id: I4d8a7eaa097446b6aa3483880c2a7ed1a2e0d97c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23790
Reviewed-by: Chun-Chen TK Hsu <chunchenhsu@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarm: Remove checkpointing from the ARM TLBs.
Gabe Black [Tue, 14 Jan 2020 23:47:43 +0000 (15:47 -0800)]
arm: Remove checkpointing from the ARM TLBs.

All of the state being checkpointed would either be provided by the
config directly, or would be brought into the TLB through normal fill
operations. Having this state in the checkpoint complicates the
checkpoint and significantly decreases compatibility with other TLB
implementations, or even variations of the same TLB, for instance if
the size was changed.

Change-Id: I4ea079dd01ff18fbc458b3aaaf88519dbcfdd869
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24389
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch: Get rid of the unused (and mostly undefined) zeroRegisters.
Gabe Black [Thu, 9 Jan 2020 10:46:30 +0000 (02:46 -0800)]
arch: Get rid of the unused (and mostly undefined) zeroRegisters.

Change-Id: Iadf56e4e742506af7ae4b617d2dc5a56439aa407
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24188
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Updated CONTRIBUTING.md to discuss branches
Bobby R. Bruce [Fri, 10 Jan 2020 02:44:38 +0000 (18:44 -0800)]
misc: Updated CONTRIBUTING.md to discuss branches

There are some circumstances in which branches may be beneficial.
Though, in general, they should be discouraged. Therefore,
CONTRIBUTING.md has been enhanced to outline under what circumstances
creation of new branches is allowed and how they may be created and
used.

Change-Id: I2df8b38868e5c8146b068d9e7e957abbe3cf3b38
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24263
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Add a timeout to getremotetime
Giacomo Travaglini [Fri, 17 Jan 2020 19:48:40 +0000 (19:48 +0000)]
tests: Add a timeout to getremotetime

The helper is meant to check if the local binary is younger than the
remote binary (on gem5.org). If the call fails it is giving up and
it is just using the local regression (producing a warning).
The code is not handling the blocking behaviour of the connection:
simulaton might stall indefinitely
The patch is addressing this by providing a 10 seconds timeout.

Change-Id: I8f9c2e555c9a55d850a66d02f8e55f56ceda2ca3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24531
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agodev-arm: add FixedClock SimObject
Adrian Herrera [Wed, 4 Dec 2019 18:31:39 +0000 (18:31 +0000)]
dev-arm: add FixedClock SimObject

This patch adds a simple fixed-rate clock implementation based on
SrcClockDomain. This provides RealView-derived platform users with
a convenient way for auto-generating their platform clocks in the DTB.

Change-Id: Ifade0cc8ed1b9e3423745698442cac5d8b99ab63
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24223
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Adding --bin-path option to select tests bin directory
Giacomo Travaglini [Thu, 16 Jan 2020 10:39:46 +0000 (10:39 +0000)]
tests: Adding --bin-path option to select tests bin directory

So far lots of tests will download binaries inside the gem5 directory.
The path is also specific to the test being run.
This doesn't play well with an environment where gem5 is cloned from
scratch for every build, or if several gem5 are cloned in a single
machine.
Binaries will be automatically downloaded every time this happens.

This patch is adding a --bin-path option, so that it's possible to
setup a fixed directory with all pre-downloaded binaries.
By default it is set to None to preserve original behaviour.

Change-Id: I42fb25e3ce0a495c73672b15a097b1bd2607795c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24525
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: fs/linux/arm passing M5_PATH via commandline
Giacomo Travaglini [Thu, 16 Jan 2020 10:34:42 +0000 (10:34 +0000)]
tests: fs/linux/arm passing M5_PATH via commandline

This will make it configurable from the testing framework

Change-Id: If82d5e44927c67a1eaecf41505d1d55a6469a4cf
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24524
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
4 years agomem-cache: Fix invalidation of prefetchers
Daniel R. Carvalho [Sat, 18 Jan 2020 15:19:53 +0000 (16:19 +0100)]
mem-cache: Fix invalidation of prefetchers

Add an invalidation function to the AssociativeSet, so that entries
can be properly invalidated by also invalidating their replacement
data.

Both setInvalid and reset have been merged into invalidate to
indicate users that they are using an incorrect approach by
generating compilation errors, and to match CacheBlk's naming
convention.

Change-Id: I568076a3b5adda8b1311d9498b086c0dab457a14
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24529
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix EL2 target exception level for SP alignment fault.
Jordi Vaquero [Mon, 13 Jan 2020 09:47:55 +0000 (10:47 +0100)]
arch-arm: Fix EL2 target exception level for SP alignment fault.

This commit fixes the target exception Level EL2 for alignmemt fault, it
is based on HCR_EL2.tge bit.

Change-Id: Ief78b2aa0c86f1c3d9a5d3ca00121d163a9d6a86
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24303
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Updated tests to download from http://dist.gem5.org
Bobby R. Bruce [Sat, 18 Jan 2020 01:32:44 +0000 (17:32 -0800)]
tests: Updated tests to download from dist.gem5.org

Previously some tests, and test resources, downloaded content from
http://gem5.org . This is being migrated to http://dist.gem5.org.
http://dist.gem5.org should be used to store and retrieve resources
going forward.

Change-Id: I7162c76b9b8dc07657a6ba50d643fc93c9824fdf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24548
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Add print function to ReplaceableEntry
Daniel R. Carvalho [Thu, 12 Dec 2019 10:05:25 +0000 (11:05 +0100)]
mem-cache: Add print function to ReplaceableEntry

Add a basic print function to acquire and display information about
replaceable entries.

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

4 years agomem-cache: Add getter for the number of valid sub-blks
Daniel R. Carvalho [Thu, 22 Aug 2019 12:15:46 +0000 (14:15 +0200)]
mem-cache: Add getter for the number of valid sub-blks

Add a getter function so that the number of valid sub-blocks can be
retrieved. As a side effect, make the respective counter private.

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

4 years agomem-cache: Add multiple eviction stats
Daniel R. Carvalho [Fri, 19 Oct 2018 10:24:02 +0000 (12:24 +0200)]
mem-cache: Add multiple eviction stats

Add stats to inform how many blocks were evicted due to a sector
replacement/eviction.

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

4 years agomem-cache: Make findVictim non-const
Daniel R. Carvalho [Fri, 19 Oct 2018 10:28:25 +0000 (12:28 +0200)]
mem-cache: Make findVictim non-const

In order to acquire stats when a victim is found,
findVictim must be made const.

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

4 years agomem-cache: Add more compression stats
Daniel R. Carvalho [Fri, 15 Feb 2019 13:48:19 +0000 (14:48 +0100)]
mem-cache: Add more compression stats

Add stats to calculate the total number of compressions, decompressions
and the average compression size, in number of bits.

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

4 years agomem-cache: Factor out multiple block eviction
Daniel R. Carvalho [Wed, 12 Jun 2019 15:26:11 +0000 (17:26 +0200)]
mem-cache: Factor out multiple block eviction

Create a function to try to evict multiple blocks while checking for
transient state.

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

4 years agoconfigs: MESI_Three_level python parameters
Timothy Hayes [Fri, 18 Oct 2019 15:12:38 +0000 (16:12 +0100)]
configs: MESI_Three_level python parameters

Allow specifying the L0 cache parameters via command line in
MESI_Three_Level.

Change-Id: Ie2a7f74790ed4c81c408857eccc2b439c60627f5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24255
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: add Arm build_opts for MESI_Three_Level and MOESI_hammer
Timothy Hayes [Fri, 18 Oct 2019 14:02:20 +0000 (15:02 +0100)]
misc: add Arm build_opts for MESI_Three_Level and MOESI_hammer

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

4 years agoutil: Add fastmodel in valid tag list
Chun-Chen TK Hsu [Mon, 30 Dec 2019 08:32:49 +0000 (16:32 +0800)]
util: Add fastmodel in valid tag list

The "fastmodel" tag has been used since 2019-08-22 so it should be an
valid tag in commit header.

Change-Id: I0032deaabc94e5896851da9afc28e1b1a699fed3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23923
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarm: A couple small fixes for the arm64 bootloader makefile.
Gabe Black [Tue, 14 Jan 2020 01:18:24 +0000 (17:18 -0800)]
arm: A couple small fixes for the arm64 bootloader makefile.

First, remove a deprecated flag that gcc no longer recognizes.

Second, disable suffix based implicit makefile rules. These, in
combination with the %.o: boot.S rule, were tricking make into deleting
it's own makefile. How, you might ask?

make wants to update its makefile, since that's a thing it does
automatically. This is useful if you, for instance, have computed
header dependencies.

make decides it can make a file called "makefile" from a file called
"makefile.o" by doing a linking step.

make decides it can make makefile.o from boot.S from the %.o: boot.S
rule, which it does.

It then attempts to link makefile.o into makefile, but that fails
because it lacks a "main" function since it's using a built in rule
which doesn't know not to expect main. The makefile is clobbered in the
process.

make then deletes makefile.o because it was an implicit target,
eliminating all the evidence.

Change-Id: Ib0dfc333dc554caf5772dd8468dba6ba821f98ac
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24329
Reviewed-by: Chun-Chen TK Hsu <chunchenhsu@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Renaming tests to include dash between words
Bobby R. Bruce [Mon, 25 Nov 2019 20:11:53 +0000 (12:11 -0800)]
tests: Renaming tests to include dash between words

In `gem/hello_se/test_hello_se.py`, test suites were being generated
with no space between the word "test" and the test name. A dash has now
been added to make this a more readable.

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

4 years agotests: Migrated old quick/se/00.hello tests
Bobby R. Bruce [Sat, 23 Nov 2019 00:39:30 +0000 (16:39 -0800)]
tests: Migrated old quick/se/00.hello tests

Migrated old quick/se/00.hello tests over to the new testing frame work
(i.e., that executed via `./tests/main.py run`). These fail, so they are
currently being ignored.

These tests now pull from the http://dist.gem5.org cloud storage.

Change-Id: Iff94cce53655bc629a3deb1e11d8d194824751d4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23024
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
4 years agoarch-arm: ELIsInHost, check VHE and SecEL2
Adrian Herrera [Fri, 29 Nov 2019 17:49:07 +0000 (17:49 +0000)]
arch-arm: ELIsInHost, check VHE and SecEL2

This patch modifies ELIsInHost to correctly check for VHE
and Secure EL2 implementation.

Change-Id: I947dddfc6761794493fef3d59b3b35754d07ed6b
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24046
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Virtualization Host Extensions checking
Adrian Herrera [Fri, 29 Nov 2019 17:22:28 +0000 (17:22 +0000)]
arch-arm: Virtualization Host Extensions checking

This patch adds Armv8.1-VHE checking. This is based on the bit
ID_AA64MMFR1_EL1.VH being 0b1.

Change-Id: Ia3f278c63fe1b5448a686db87a46853fc8b6bea5
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24045
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystem-arm: bigLITTLE with VExpress_GEM5_V2 in dtb
Adrian Herrera [Wed, 14 Aug 2019 11:11:17 +0000 (12:11 +0100)]
system-arm: bigLITTLE with VExpress_GEM5_V2 in dtb

This patch adds targets in the device tree Makefile for using
bigLITTLE DTS with VExpress_GEM5_V2 platform.

Change-Id: I7a424a36c78a24b96224526aa112ac5d060f790b
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24083
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-garnet: Use smart pointers for CrossbarSwitch's members
Daniel R. Carvalho [Tue, 7 Jan 2020 22:49:52 +0000 (23:49 +0100)]
mem-garnet: Use smart pointers for CrossbarSwitch's members

Use smart pointers for the pointers managed by CrossbarSwitch.

Change-Id: I71958c72cde5981d730aa3f68bba0ffbe4c2506f
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24244
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agox86: Stop clearing RAX for BIST in initCPU.
Gabe Black [Thu, 9 Jan 2020 09:08:09 +0000 (01:08 -0800)]
x86: Stop clearing RAX for BIST in initCPU.

This doesn't actually change any behavior since RAX was being zeroed
anyway, but since we don't and almost certainly never will have a BIST
and the BIST is optional even in real hardware, we can drop it and
simplify initCPU a little further.

This reduces x86's initCPU function to just an invocation of
InitInterrupt's invoke.

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

4 years agox86: Move local APIC initialization out of initCPU.
Gabe Black [Thu, 9 Jan 2020 09:00:55 +0000 (01:00 -0800)]
x86: Move local APIC initialization out of initCPU.

The APIC can (and probably should) set its version register on its
own. Also it already configures its CPUID register when associated
with a CPU and doesn't need initCPU to do that.

Change-Id: I4611563668d197c48caf2f23fcde9ec2ec101fe7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24186
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
4 years agox86: Move miscreg initialization to the ISA class.
Gabe Black [Thu, 9 Jan 2020 08:53:15 +0000 (00:53 -0800)]
x86: Move miscreg initialization to the ISA class.

The initCPU function was setting a lot of values to zero or other
initial values, but that's something the ISA object can do as part of
its clear() method. This gets rid of a lot of code that was
individually zeroing registers, and also centralizes responsibility
for those registers in the ISA.

Change-Id: Iafcffd3f9329c39f77009b38b1696f91c36c117e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24185
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: Remove check for kernel in fs.py.
Gabe Black [Mon, 13 Jan 2020 07:04:22 +0000 (23:04 -0800)]
configs: Remove check for kernel in fs.py.

It is *not* true that a kernel is required in FS mode. For example,
in SPARC, gem5 is set up to run actual system firmware which will load
a kernel from the disk image. Other systems can run in a bare metal
mode where they also have no kernel.

If a configuration requires a kernel, it should check for it in C++
where there context lives, not globally in fs.py.

Change-Id: Ib094c29474c248f866bd08d4f975648a2c707a19
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24284
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Add a dumpSimcall mechanism to GuestABI.
Gabe Black [Sun, 8 Dec 2019 09:33:23 +0000 (01:33 -0800)]
sim: Add a dumpSimcall mechanism to GuestABI.

This dumps a signature for a simcall as if it was going to be invoked,
and can be used for debugging.

Change-Id: I6262b94ad4186bac8dc5a1469e9bb3b8ae9d34e1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23460
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Add a unit test for the GuestABI mechanism.
Gabe Black [Thu, 28 Nov 2019 06:54:48 +0000 (22:54 -0800)]
sim: Add a unit test for the GuestABI mechanism.

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

Change-Id: I76934d94b4c61570a4ca603388012c65280e2b7c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23197
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Implement a varargs like mechanism for GuestABI system.
Gabe Black [Thu, 28 Nov 2019 05:34:53 +0000 (21:34 -0800)]
sim: Implement a varargs like mechanism for GuestABI system.

This will let a function called with a GuestABI emulate the ...
mechanism available in C. To make that possible without the functions
knowing anything about the ABI and to follow C++'s (sensible)
templating and virtual function rules, you have to tell VarArgs what
types you might want to extract from it, unlike the pure ... varargs
style mechanism.

Also unlike ..., there is no mechanism in place to force the varargs
to appear last in the argument list. It will pick up the progress
through the arguments at the point it's reached, and will ignore any
later arguments. It would be possible to be more rigorous about this
by changing the callFrom templates, but the overhead in complexity
is probably not worth it.

Also, retrieving arguments through a VarArgs happens live, meaning at
the point that the argument is asked for. If the ThreadContext or
memory the argument lives in is modified before that point, the
retrieved value will reflect that modification and not what the
function was originally called with. Care should be taken so that this
doesn't cause corrupted arguments.

Finally, this mechansim (and the Guest ABI mechanism in general) is
complex and should have tests written for it. That should be possible
since ThreadContext is forward declared and so the test can say it
works however it wants or even ignore it completely. If that changes
in the future, we may need a mock ThreadContext implementation.

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

Change-Id: I37484b50a3e8c0d259d9590e32fecbb5f76670c1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23195
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystemc: keep SC_CONCAT* macro
Earl Ou [Thu, 2 Jan 2020 07:24:46 +0000 (15:24 +0800)]
systemc: keep SC_CONCAT* macro

Call of TLM_DECLARE_EXTENDED_PHASE requires SC_CONCAT* macros.  This change
keeps those macros to avoid compile errors.

Change-Id: I573c4c126a350ef1a752d1c50658e7d9cedaaeae
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24123
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch: Make the generic micropc enabled PCState set nupc to 1.
Gabe Black [Thu, 9 Jan 2020 08:40:32 +0000 (00:40 -0800)]
arch: Make the generic micropc enabled PCState set nupc to 1.

The default constructor of the micropc enabled generic PCState class
set the next micropc to 0, when the non-default constructor and at
least the x86 initCPU utility function set it to 1. This makes more
sense since either the micropc doesn't matter as a concept if the
instruction isn't microcoded, or, unless redirected by a micropc
branch, you're going to want to execute the next microop and not just
repeat the first one.

Change-Id: I418ea986a071453563c4c8aad4fc4eb4f7beb641
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24184
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: VExpress_GEM5_Base, fix daughterboard reference
Adrian Herrera [Thu, 24 Oct 2019 11:36:09 +0000 (12:36 +0100)]
dev-arm: VExpress_GEM5_Base, fix daughterboard reference

VExpress_GEM5_Base states that its memory map is based on
CoreTile Express A15x2 A7x3, while the model used for the
Daughterboard Configuration Controller (DCC) is based on
Coretile Express A15x2.
These two daughterboard specifications differ in both on-chip
memory map and DCC clocks as of the TRMs.

This patch makes the reference consistent to Coretile Express
A15x2 and adds several non-confidential references to aid in
understanding the platform and adding new peripherals.

Change-Id: Ia55e7362bdc9ed6509f8eff4cbd7eb38e538d774
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24203
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests,base: Added GTest for base/socket.cc
Bobby R. Bruce [Sat, 4 Jan 2020 01:47:35 +0000 (17:47 -0800)]
tests,base: Added GTest for base/socket.cc

It should be noted that some features of this class have not been fully
tested due to interaction with system-calls.

Change-Id: I8315188327e022ac4c98aa9ce4bd38243266ab17
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23984
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Updated gtest/logging.cc to print log rather than fail.
Bobby R. Bruce [Fri, 3 Jan 2020 21:01:13 +0000 (13:01 -0800)]
tests: Updated gtest/logging.cc to print log rather than fail.

Previously the `GTestExitLogger.log` function utilized GTest's
`ADD_FAILURE_AT` macro. This meant, whenever `GTestExitLogger.log` were
called, the calling test would be fail. This is problematic when
trying to test code we expect to fail (i.e., when testing the error
handling code is working correctly). Therefore, the `log` function now
writes to stderr.

The `GTestExitLogger` class is used by the `panic` and `fatal` loggers
when running GTests. Instead of callnig `exit(1)` they throw a GTest
exception, which can be captured in a test using
`EXPECT_ANY_THROW(expection_thrower())`. Catching and verifying error
logs can be done via:

```
testing::internal::CaptureStderr();
/*
 * "exception_thrower()" is a method we'd expect to call `fatal` or
 * `panic`, and therefore exit the simulation with a non-zero exit
 * code. When running via GTest, an exception is thrown instead.
 */
EXPECT_ANY_THROW(exception_thrower());
EXPECT_EQ("<error message>", testing::internal::GetCapturedStderr()));
```

Change-Id: I84a5f86bc573668d3dd5b40f626b43108dddb8e9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23983
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase: Include some required headers in amo.hh.
Gabe Black [Thu, 9 Jan 2020 09:14:21 +0000 (01:14 -0800)]
base: Include some required headers in amo.hh.

amo.hh was using several non-default definitions including
std::function, uint8_t, and std::array without including any headers
at all, and instead apparently relying on those having already been
brought in by an earlier include.

This change adds those includes explicitly.

Change-Id: I92166ff581e74bd705e10fd4fa454df179ae1a97
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24183
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase, gpu-compute: Move gpu AMOs into the generic header
Giacomo Travaglini [Thu, 5 Dec 2019 12:06:17 +0000 (12:06 +0000)]
base, gpu-compute: Move gpu AMOs into the generic header

Change-Id: I10d8aeaae83c232141ddd2fd21ee43bed8712539
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23565
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: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Added functionality to allow the ignoring of test suites
Bobby R. Bruce [Sat, 23 Nov 2019 00:16:58 +0000 (16:16 -0800)]
tests: Added functionality to allow the ignoring of test suites

Previously, when `tests/main.py run` was executed all the tests found
were run. It is now necessary to ignore some test suites as they fail.
Therefore, `gem5/suite.py` has been updated to read from `gem5/.testignore`
(if present). This file contains a list of all the test suites which are to
be ignored.

Change-Id: I699ea662b701d82199980084261496f24b13d340
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23023
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch, base: Move arm AtomicOpFunctor into the generic header
Giacomo Travaglini [Thu, 5 Dec 2019 11:16:12 +0000 (11:16 +0000)]
arch, base: Move arm AtomicOpFunctor into the generic header

These AtomicGenericxOp functors are not arm specific:
They just define a set of different functors depending
on the number of operands they are using.

Change-Id: Ida75066823c7718aee05717194cdb8225b700c5d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23564
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase: Move AtomicOpFunctors to a dedicated header
Giacomo Travaglini [Thu, 5 Dec 2019 11:05:49 +0000 (11:05 +0000)]
base: Move AtomicOpFunctors to a dedicated header

src/base/types.hh file definition is:

/**
 * @file
 * Defines global host-dependent types:
 * Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
 */

I feel AtomicOpFunctor doesn't fall in this cathegory so I am
moving those into a dedicated header: base/amo.hh

Change-Id: I8f05fb0944c03e4053cfaf2ffe65cac803df1d93
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23563
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Add '-Wl,--as-needed' to default LINKFLAGS
Yu-hsin Wang [Mon, 6 Jan 2020 04:27:19 +0000 (12:27 +0800)]
scons: Add '-Wl,--as-needed' to default LINKFLAGS

In current build flow, EXTRAS flag is evaluated before building gem5
tools and binaries. Such that, unneeded libraries may be linked into
gem5 binaries. Adding '-Wl,--as-needed' can fix this problem also
shrinks binaries.

Change-Id: Ifb001786a66b0dd9b29865e39a5740313002f250
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24003
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch,sim: Promote the m5ops_base param to the System base class.
Gabe Black [Tue, 26 Nov 2019 00:22:57 +0000 (16:22 -0800)]
arch,sim: Promote the m5ops_base param to the System base class.

This mechanism is shared between ARM and x86, even if x86 has a typical
address range it choses to use. By moving this to the base class, it's
now possible for anybody to find out where the m5 ops are, and no ISA
specific assumptions need to be made.

Because the x86 address is well known, it's set in the x86 System
subclass as the default.

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

Change-Id: Ifdb9f5cd1ce38b3c4dafa7566c50f245f14cf790
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23180
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Disable O3CPU value forwarding with write strobes
Gabor Dozsa [Wed, 23 Jan 2019 15:15:16 +0000 (15:15 +0000)]
cpu: Disable O3CPU value forwarding with write strobes

https://gem5-review.googlesource.com/c/public/gem5/+/19173 did the same
for MinorCPU

Change-Id: I22d631a3d2032570f6e84b0f5eb018d1f84414ef
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23952
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Use enums for O3CPU store value forwarding
Gabor Dozsa [Mon, 6 Jan 2020 10:55:36 +0000 (10:55 +0000)]
cpu: Use enums for O3CPU store value forwarding

This is aligning with MinorCPU, where an enum is tagging a Full, Partial
and No address coverage.

Change-Id: I0e0ba9b88c6f08c04430859e88135c61c56e6884
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23951
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystem-arm: GICv2/GICv3 have different Distributor addresses
Giacomo Travaglini [Mon, 6 Jan 2020 16:11:55 +0000 (16:11 +0000)]
system-arm: GICv2/GICv3 have different Distributor addresses

https://gem5-review.googlesource.com/c/public/gem5/+/22823 didn't
take into consideration that GICv3's Distributor is placed at a
different address than GICv2's one.
This is reflected by the value in VExpress_GEM5_V2 and in the
FDT in system/arm/dt/platforms/vexpress_gem5_v2_base.dtsi

Change-Id: Ie7661d4e9d3db0c5fe9eb9cea3a24a5e7c266676
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Adrian Herrera <adrian.herrera@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23953
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystem-arm: Rename ARM bootloader source
Giacomo Travaglini [Fri, 3 Jan 2020 14:01:21 +0000 (14:01 +0000)]
system-arm: Rename ARM bootloader source

The AArch32 assembly source has been renamed from simple.S to boot.S,
and the Makefile has been renamed to makefile (lowercase) to match
the AArch64 convention

Change-Id: Ia4581fe0223c156460edcc558622b5d7962258dc
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Adrian Herrera <adrian.herrera@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23949
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystem-arm: Rename ARM bootloader directories
Giacomo Travaglini [Fri, 3 Jan 2020 13:54:40 +0000 (13:54 +0000)]
system-arm: Rename ARM bootloader directories

The patch is renaming:

system/arm/simple_bootloader -> system/arm/bootloader/arm
system/arm/aarch64_bootloader -> system/arm/bootloader/arm64

Change-Id: Ia7380be3914e277624060f1c96361a0f16dbea9d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Adrian Herrera <adrian.herrera@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23948
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Reflect changes of arm bootloader name
Adrian Herrera [Fri, 3 Jan 2020 12:49:27 +0000 (12:49 +0000)]
misc: Reflect changes of arm bootloader name

With https://gem5-review.googlesource.com/c/public/gem5/+/22687 the
VExpress_GEM5_Base platform is changing the required bootloader name
by removing the _emm suffix.
While this had been changed in the prebuilt binaries in gem5.org, it
hadn't in the bootloader makefiles or in other utility functions.

The patch is not completely removing the _emm bootloaders since those
are still used by VExpress_EMM and VExpress_EMM64 platforms.

Change-Id: Iea3148eab313ab06cf2e74660e11708e1a22ce5f
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-by: Adrian Herrera <adrian.herrera@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23947
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Cleanup code that enables asan and ubsan
Nikos Nikoleris [Fri, 20 Dec 2019 12:41:40 +0000 (12:41 +0000)]
scons: Cleanup code that enables asan and ubsan

Change-Id: Ie29efc99067dac051536bb099a89f29c940192ec
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23883
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Forward snoops when the cache is not responding
Nikos Nikoleris [Thu, 12 Dec 2019 15:49:36 +0000 (15:49 +0000)]
mem-cache: Forward snoops when the cache is not responding

When the MSHR is handling a request that will make the block dirty the
current cache commits respond. When that's not the case the cache
should forward any snoops. This CL fixes MSHR::handleSnoop() to
implement this behavior.

Change-Id: I207e3ca4968fd9528fd4cdbfb3eb95f470b4744d
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23668
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
4 years agomem-cache: Ensure that responses get data from the right source
Nikos Nikoleris [Thu, 7 Nov 2019 10:50:36 +0000 (10:50 +0000)]
mem-cache: Ensure that responses get data from the right source

This CL makes sure that we use the right source for data for
responses after a response from the cache below.

Change-Id: I7329f3e6bcb7ce2054e912eb9dea48c9d169d45a
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23667
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystemc: fix gem5_to_tlm bridge
Earl Ou [Wed, 18 Dec 2019 07:06:01 +0000 (15:06 +0800)]
systemc: fix gem5_to_tlm bridge

The original implementation doesn't set trans and phase correctly when
scheduling PayloadEvent, and causes unexpected behavior after the event started.

This change fixes the wrong event triggering by directly applying
tlm_utils::peq instead of creating another one.

Change-Id: I207567b57f4b49c3c4ebe117d624e5cc9915c12a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23823
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Implement the vecPredReg accessor functions.
Gabe Black [Wed, 6 Nov 2019 22:05:58 +0000 (14:05 -0800)]
fastmodel: Implement the vecPredReg accessor functions.

Change-Id: Iaf6f7d8d1db427bfd486e4bd43f67cc006751873
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23789
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agoarch,sim: Stop decoding the pseudo inst subfunc value.
Gabe Black [Mon, 25 Nov 2019 11:00:59 +0000 (03:00 -0800)]
arch,sim: Stop decoding the pseudo inst subfunc value.

This isn't used by anything any more. The func field is left in place
to ensure compatability, but there's no reason to decode a value
nobody is going to use.

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

Change-Id: I85fcd0e4a362551c29af6bff350d99af86050415
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23179
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agoarch,sim: Use the guest ABI mechanism with pseudo instructions.
Gabe Black [Mon, 25 Nov 2019 10:53:47 +0000 (02:53 -0800)]
arch,sim: Use the guest ABI mechanism with pseudo instructions.

Right now, there are only two places which call the pseudoInst function
directly, the ARM KVM CPU and the generic mmapped IPR. These two
callers currently use the generic "PseudoInstABI" which is just a
wrapper around the existing getArgument function.

In the future, this getArgument function will be disolved, and the
PseudoInstABI will be defined for each ABI. Since it currently mimics
the Linux ABI since gem5 can only handle one ABI at a time right now,
this implementation will probably be shared by linux system calls,
except that the pseudo inst implementation will eat return values since
those are returned through other means when the pseudo inst is based on
magic address ranges.

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

Change-Id: Ied97e4a968795158873e492289a1058c8e4e411b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23178
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Semihosting, specify files root dir
Adrian Herrera [Fri, 15 Nov 2019 10:55:36 +0000 (10:55 +0000)]
arch-arm: Semihosting, specify files root dir

This patch adds an option to "ArmSemihosting" which allows for
specifying an optional search path for host files.
Previously, behaviour was fixed to search in the directory from where
the gem5 binary was run from.

Change-Id: I57b932b38d022f132af78857104633d7bfdd1442
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23903
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Fix SMMUv3 walkMasks in page table ops
Michiel van Tol [Wed, 13 Nov 2019 17:01:14 +0000 (17:01 +0000)]
dev-arm: Fix SMMUv3 walkMasks in page table ops

The masks did not include the high bits above the active addressing
bits.
This could cause overlapping issues when using high addresses.
(Translated with TTBR1)

Change-Id: Ib705558aac456c1b3f069e1bd3ccdd9229a1c1d2
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23764
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Fix SMMUv3 16KB next-level table address masking
Giacomo Travaglini [Tue, 12 Nov 2019 14:43:23 +0000 (14:43 +0000)]
dev-arm: Fix SMMUv3 16KB next-level table address masking

The next-level table address for a granule size of 16KB is retrieved
from the 47:14 bits of the current table descriptor (instead of
47:12, which is the valid masking for a 4KB granule)

Change-Id: I570138a34003dc034d8e67dc1209316157d57205
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Michiel van Tol <michiel.vantol@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23763
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: GICv3, handle GICR_ICFGR0 WI behaviour
Adrian Herrera [Thu, 12 Dec 2019 16:25:46 +0000 (16:25 +0000)]
dev-arm: GICv3, handle GICR_ICFGR0 WI behaviour

Architecture states write accesses to GICR_ICFGR0 are WI. This patch
implements handling of this behaviour instead of crashing as an invalid
offset. This is required to support certain software behaviour.

Change-Id: I1f8c57838566c360d243a925306ec35c64a920b2
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24063
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Avoid write merging if there are reads in between
Nikos Nikoleris [Tue, 26 Nov 2019 12:59:03 +0000 (12:59 +0000)]
mem-cache: Avoid write merging if there are reads in between

This CL reworks the logic in the MSHR to make sure we do not coalesce
requests unless there is a series of write requests for the whole
cache block without any other incompatible requests (e.g., read) in
between.

Change-Id: I0b3195858fb33ef85d7aae27376506057dd53ea7
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23666
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs-arm: enable PMU instantiation in CpuCluster
Adrian Herrera [Wed, 16 Oct 2019 11:59:26 +0000 (12:59 +0100)]
configs-arm: enable PMU instantiation in CpuCluster

This patch adds a new method to the CpuCluster object
which allows passing the PMU interrupt numbers and events
to record for each core.
This lets users create CPU clusters with PMUs.

Change-Id: Id49fd0aee50f49e4c6fca95e4ee673da3dca73cd
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22848
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Move destructor of Port to public
Yu-hsin Wang [Fri, 3 Jan 2020 05:32:33 +0000 (13:32 +0800)]
sim: Move destructor of Port to public

To preventing from instantiating an abstract class, hiding its
constructor is enough. Moving destructor to public doesn't break this
intention. This also makes us can use smart pointer to manage derived
Port class.

Change-Id: Ic9cf97e90a6c26108d359eb459df48cd23eaf15c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23925
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Fix issue with MinorCPU predicated-false mem. accesses
Giacomo Gabrielli [Thu, 7 Nov 2019 09:37:25 +0000 (09:37 +0000)]
cpu: Fix issue with MinorCPU predicated-false mem. accesses

The code block was relying on passed_predicate only (conditional
execution). This was not covering the case where the instruction
gets executed, but the predicate register is false. Using the inLSQ
variable is covering both cases and it makes more sense in terms of
readibility.

Change-Id: Ie1954f37968379a5bda9d0dc9f824a68304cc229
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23280
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Disable MinorCPU value forwarding with write strobes
Gabor Dozsa [Wed, 23 Jan 2019 15:15:16 +0000 (15:15 +0000)]
cpu: Disable MinorCPU value forwarding with write strobes

Change-Id: I7cb50b80b70fcf43ab23eb9e7333d16328993fe1
Signed-off-by: Gabor Dozsa <gabor.dozsa@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19173
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Added 'fastmodel' to MAINTAINERS
Bobby R. Bruce [Thu, 2 Jan 2020 21:42:13 +0000 (13:42 -0800)]
misc: Added 'fastmodel' to MAINTAINERS

Gabe Black added as the maintainer.

Change-Id: I69273d090bf17da4e54f50340a33a589fdc63c51
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23963
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Fix compilation errors
Chun-Chen TK Hsu [Mon, 30 Dec 2019 08:23:40 +0000 (16:23 +0800)]
fastmodel: Fix compilation errors

This changes fixes two compilation errors when compiling with
FastModels. One is that CurrentMsn should be Iris::CurrentMsn and the
other is that currEL() function needs arch/arm/utility.hh header file.

Test by compiling GEM5 with FastModels:
scons -j64 build/ARM/gem5.opt \
  USE_ARM_FASTMODEL=1     \
  PVLIB_HOME=...          \
  MAXCORE_HOME=...        \
  ARMLMD_LICENSE_FILE=... \

Change-Id: Iabe0a5f25246591f99b57219428b8f87ecd3363c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23924
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

4 years agofastmodel: Move ARM but not CortexA76 specific bits to the IRIS TC.
Gabe Black [Wed, 6 Nov 2019 00:58:14 +0000 (16:58 -0800)]
fastmodel: Move ARM but not CortexA76 specific bits to the IRIS TC.

Now that the IRIS thread context can be specific to ARM, some things
which had been pushed to a different level of abstraction can be mvoed
back. This will hopefully allow more code sharing in the future when
other types of CPUs are supported.

Change-Id: Ic3a5f0db53ebe93e18f7507ed71812bce27b6d01
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23788
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>