gem5.git
7 years agosyscall_emul, riscv: add override keyword to RISCV Process class
Brandon Potter [Mon, 15 May 2017 19:03:20 +0000 (14:03 -0500)]
syscall_emul, riscv: add override keyword to RISCV Process class

Change-Id: I2a146ae57aac3787389997961208474a97e7c155
Reviewed-on: https://gem5-review.googlesource.com/3360
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Alec Roelke <ar4jc@virginia.edu>

7 years agoconfigs: fix cpu names in big.LITTLE example
Pierre-Yves Péneau [Fri, 12 May 2017 15:50:35 +0000 (17:50 +0200)]
configs: fix cpu names in big.LITTLE example

CPU aliases have been dropped, this change fixes the big.LITTLE example.

Change-Id: Idd59a6eca93448ef0e23087365fb5452bcef9247
Signed-off-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
Reviewed-on: https://gem5-review.googlesource.com/3300
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agoarm, config: added support for ex5 model of big.LITTLE
Pierre-Yves Péneau [Wed, 22 Mar 2017 17:36:13 +0000 (18:36 +0100)]
arm, config: added support for ex5 model of big.LITTLE

This patch enables using calibrated big and LITTLE cores, ex5_big and
ex5_LITTLE instead of the default 'arm_detailed' and 'minor' cpus. The ex5
model is based on the Samsung Exynos 5 Octa (5422) SoC. Operation and memory
hierarchy latencies have been calibrated using the lmbench micro-benchmark
suite. The preliminary validation results have been published as: 'Full-System
Simulation of big.LITTLE Multicore Architecture for Performance and Energy
Exploration', in International Symposium on Embedded Multicore/Many-core
Systems-on-Chip (MCSoC'16), Lyon, France (Sep, 2016).

From http://reviews.gem5.org/r/3666

Change-Id: I4935dee0a9222bd1bf7adfccb9443014945bb2d7
Signed-off-by: Anastasiia Butko <abutko@lbl.gov>
Signed-off-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
Reviewed-on: https://gem5-review.googlesource.com/2464
Reviewed-by: Gabor Dozsa <gabor.dozsa@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agoext: Include SystemC 2.3.1 into gem5
Matthias Jung [Wed, 1 Mar 2017 17:39:56 +0000 (18:39 +0100)]
ext: Include SystemC 2.3.1 into gem5

In the past it happened several times that some changes in gem5 broke the
SystemC coupling. Recently Accelera has changed the licence for SystemC
from their own licence to Apache2.0, which is compatible with gem5.
However, SystemC usually relies on the Boost library, but I was able to
exchange the boost calls by c++11 alternatives. The recent SystemC version
is placed into /ext and is integrated into gem5's build system. The goal is
to integrate some SystemC tests for the CI in some following patches.

Change-Id: I4b66ec806b5e3cffc1d7c85d3735ff4fa5b31fd0
Reviewed-on: https://gem5-review.googlesource.com/2240
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agoconfig: Changes to boot Android N
Weiping Liao [Fri, 13 Jan 2017 02:12:20 +0000 (18:12 -0800)]
config: Changes to boot Android N

necessary kernel command line options in FSConfig.py

Change-Id: Id66f640b6beb4efa9c23080c3d2516eda688c72d
Reviewed-on: https://gem5-review.googlesource.com/3320
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agox86: Fix the multiplication microops.
Gabe Black [Tue, 16 May 2017 02:39:51 +0000 (19:39 -0700)]
x86: Fix the multiplication microops.

If the operands were 64 bit, an intermediate calculation could lose a
carry bit. This change rearranges that intermediate calculation if the
operand width is large, and reworks the microop implementation in general
in an attempt to make it easier to understand.

Change-Id: Ib36333f3f2695a33cd9623e43682de22ebd2e7ea
Reviewed-on: https://gem5-review.googlesource.com/3381
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

7 years agopython: Add a helper function to create Python events
Andreas Sandberg [Tue, 9 May 2017 18:06:39 +0000 (19:06 +0100)]
python: Add a helper function to create Python events

Add a helper function, m5.event.create(), to create events from
Python. This function takes a callable Python object (e.g., a
function) as an argument and optionally a priority as a keyword
argument. This function was accidentally dropped from the public API
when switching to PyBind.

Change-Id: Icbd0e392d9506934ec2c9f541199aa35c1c2df8c
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/3220
Reviewed-by: Gabe Black <gabeblack@google.com>
7 years agostyle: fix line lengths and include ordering
Brandon Potter [Mon, 15 May 2017 20:13:19 +0000 (15:13 -0500)]
style: fix line lengths and include ordering

The style checker complains about line length and ordering for these
files. This fix should make these two files kosher.

Change-Id: I822a0518a98d9e379a543d2017e90c4e9666a58d
Reviewed-on: https://gem5-review.googlesource.com/3380
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>

7 years agocpu: fix problem with forwarding and locked load
Alec Roelke [Sun, 9 Apr 2017 19:23:23 +0000 (15:23 -0400)]
cpu: fix problem with forwarding and locked load

If a (regular) store is followed closely enough by a locked load that
overlaps, the LSQ will forward the store's data to the locked load and
never tell the cache about the locked load.  As a result, the cache will
not lock the address and all future store-conditional requests on that
address will fail.  This patch fixes that by preventing forwarding if
the memory request is a locked load and adding another case to the LSQ
forwarding logic that delays the locked load request if a store in the
LSQ contains all or part of the data that is requested.

[Merge second and last if blocks because their bodies are the same.]

Change-Id: I895cc2b9570035267bdf6ae3fdc8a09049969841
Reviewed-on: https://gem5-review.googlesource.com/2400
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agoarm, dev: stub out GIC distributor interrupt groups
Curtis Dunham [Wed, 29 Mar 2017 19:07:03 +0000 (14:07 -0500)]
arm, dev: stub out GIC distributor interrupt groups

We don't implement the GICD_IGROUPRn registers, which is allowed, but
to be correct, they should be RAZ/WI (read as zero, writes ignored).

Change-Id: I8039baf72f45c0095f41e165b8e327c79b1ac082
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2620
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agobase: Make the VNC server more resilient.
Gabe Black [Wed, 10 May 2017 07:35:43 +0000 (00:35 -0700)]
base: Make the VNC server more resilient.

If the client does something bad, don't kill the whole simulation, just
complain, drop the client and keep going.

Change-Id: I824f2d121e2fe03cdf4323a25c192b68e0370acc
Reviewed-on: https://gem5-review.googlesource.com/3200
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agomisc: Make the remote GDB stub more resilient to bad connections.
Gabe Black [Wed, 10 May 2017 06:18:48 +0000 (23:18 -0700)]
misc: Make the remote GDB stub more resilient to bad connections.

Currently, if the remote gdb stub fails to read a byte from an incoming
packet because the connection has been dropped, the read call will return
anyway and the calling code will have no way to know something bad
happened. It might reattempt the read over and over again waiting for some
particular byte, doomed to never make forward progress.

This change modifies the remote GDB code so that if a read or write call
fails, it will instead detach from the debugger and continue. Before this
change, When simulating a port scan, ie connecting to the debugger port
and then immediately dropping the connection using this command:

nc -v -n -z -w 1 127.0.0.1 7000

gem5 would enter the previously described death spiral. After it, gem5
detaches from the bad connection and resumes execution. Subsequently
attaching with gdb was successful.

This code is written in a C centric style, and would benefit from some
refactoring.

Change-Id: Ie3c0bb35b9cfe3671d0f731e3907548bae0d292f
Reviewed-on: https://gem5-review.googlesource.com/3180
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agosyscall_emul: Fix undefined macro behavior
Andreas Sandberg [Wed, 10 May 2017 12:10:23 +0000 (13:10 +0100)]
syscall_emul: Fix undefined macro behavior

Clang's UBSAN implementation complains about macros that expand to
expressions that contain 'defined'. Explicitly set the various feature
macros to 1 or 0 to avoid this issue.

Change-Id: Iba239dacfe526c43ab9c5da5183a350fc4fdc57d
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/3241

7 years agoarm: Remove unused DumpStatsPCEventF class in FreeBSD system
Andreas Sandberg [Wed, 10 May 2017 12:11:57 +0000 (13:11 +0100)]
arm: Remove unused DumpStatsPCEventF class in FreeBSD system

The DumpStatsPCEventF is declared but lacks an implementation. This
confuses RTTI in clang. Remove this class since it is clearly not
needed.

Change-Id: Ib95f09f2ba8593f8d0e072b96afd5f8a9ed31070
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/3240
Reviewed-by: B.A. Zeeb <baz21@cam.ac.uk>
7 years agoscons: Use the generalized switching headers on the GPU ISA.
Gabe Black [Tue, 2 May 2017 05:05:00 +0000 (22:05 -0700)]
scons: Use the generalized switching headers on the GPU ISA.

Now that the switching header implementation has been generalized, there's
no need to have two nearly identical implementations for the two different
groups of headers.

Change-Id: Ie7c24fcddbc672ac5ca2d69bfc35696f42c55580
Reviewed-on: https://gem5-review.googlesource.com/2984
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoscons: arch: Generalize the switching header code.
Gabe Black [Tue, 2 May 2017 04:58:41 +0000 (21:58 -0700)]
scons: arch: Generalize the switching header code.

Factor out the ISA ness of the switching header generating function. Also
turn it into a SCons builder which builds a single header, and a wrapping
method which uses the builder on a group of header files which all target
the same subdirectory.

Change-Id: I87705f97b6ebd9baebd4ebcfea19cc1218a64ad0
Reviewed-on: https://gem5-review.googlesource.com/2983
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agoconfig: Fix up some configs to not use CPU aliases.
Gabe Black [Mon, 8 May 2017 06:57:47 +0000 (23:57 -0700)]
config: Fix up some configs to not use CPU aliases.

Support for CPU aliases were removed recently.

Change-Id: I3c1173dc34170d8639d95e52bf660f248848f77f
Reviewed-on: https://gem5-review.googlesource.com/3100
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agoscons: Get rid of the all_isa_deps variable.
Gabe Black [Tue, 2 May 2017 03:08:59 +0000 (20:08 -0700)]
scons: Get rid of the all_isa_deps variable.

This value can be computed more directly and more locally near where it's
used.

Change-Id: Ib5f45015494a6c8033ce0ac4b8931688f37492c8
Reviewed-on: https://gem5-review.googlesource.com/2982
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agomisc: Add the --listener-loopback-only command line option.
Gabe Black [Fri, 5 May 2017 23:53:42 +0000 (16:53 -0700)]
misc: Add the --listener-loopback-only command line option.

This option invokes the Listener::loopbackOnly() static function which
will make the port listeners bind to the loopback device exclusively and
ignore connections on other devices. That prevents external agents like
port scanners from disrupting simulations with spurious connections.

Change-Id: I46b22165046792a6f970826c109bdbce7db25c84
Reviewed-on: https://gem5-review.googlesource.com/3082
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agomisc: Expose the listener loopbackOnly function to python.
Gabe Black [Fri, 5 May 2017 23:52:21 +0000 (16:52 -0700)]
misc: Expose the listener loopbackOnly function to python.

Change-Id: Ibb405af54a46a93706a6f476b5314491e84be0c8
Reviewed-on: https://gem5-review.googlesource.com/3081
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agobase: Teach the socket listeners how to bind to the loopback.
Gabe Black [Fri, 5 May 2017 23:50:22 +0000 (16:50 -0700)]
base: Teach the socket listeners how to bind to the loopback.

The loopback device will allow access to various services like remote GDB
debugging, connecting to the terminal, etc., without letting external
agents like port scanners connect and disrupting the simulation.

Change-Id: I76dccbf152fa278ae9f342b25f7e345a1329fbe4
Reviewed-on: https://gem5-review.googlesource.com/3080
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agostyle: Treat PyBind headers as Python headers
Andreas Sandberg [Tue, 2 May 2017 13:04:44 +0000 (14:04 +0100)]
style: Treat PyBind headers as Python headers

Some PyBind11 headers need to include Python.h. This means that we need
to include PyBind11 headers before any standard library headers. Enforce
this by applying the Python.hh rules for anything in pybind11/.

Change-Id: Id175a4f613960a17f84f98b81bfd02806e905d5a
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/3120
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
7 years agopython: Fix debug flag listing regression
Andreas Sandberg [Mon, 8 May 2017 15:53:29 +0000 (16:53 +0100)]
python: Fix debug flag listing regression

The PyBind11 changes slightly modified gem5's internal debug
interfaces. The corresponding change to the public API went missing
before the new bindings were merged. This change updates the Python
glue to use the new interface.

Change-Id: I3ecca5a3f6c35b99d55126d697371124f81a12dd
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Matteo Andreozzi <matteo.andreozzi@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/3140
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoutil, arm: Support mmapped m5ops on aarch64
Andreas Sandberg [Fri, 2 Dec 2016 16:51:18 +0000 (16:51 +0000)]
util, arm: Support mmapped m5ops on aarch64

Add support for memory-mapped m5ops in the aarch64 version of the m5
utility. To enable support for memory-mapped m5ops, compile the tool
with the define M5OP_ADDR set to the base of the m5op PA range.

Change-Id: I13e21e48536b9849bf4081411b66b2f350f7a8ac
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2966

7 years agoarm: Enable m5ops by default for VExpress_GEM5_V1
Andreas Sandberg [Fri, 28 Apr 2017 09:55:06 +0000 (09:55 +0000)]
arm: Enable m5ops by default for VExpress_GEM5_V1

Allocate 0x10010000-0x1001ffff for m5 pseudo-ops. This range is a part
of the CS5 address range in the RS1/RS2 memory map.

Change-Id: Ica45cd53bc4ebb62966afa099fa465e27fb0452c
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2965

7 years agoarm: Add support for memory-mapped m5ops
Andreas Sandberg [Tue, 16 Feb 2016 19:21:04 +0000 (13:21 -0600)]
arm: Add support for memory-mapped m5ops

Add support for a memory mapped m5op interface. When enabled, the TLB
intercepts accesses in the 64KiB region designated by the
ArmTLB.m5ops_base parameter. An access to this range maps to a
specific m5op call. The upper 8 bits of the offset into the range
denote the m5op function to call and the lower 8 bits denote the
subfunction.

Change-Id: I55fd8ac1afef4c3cc423b973870c9fe600a843a2
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2964

7 years agokvm, arm: Fix incorrect PSTATE sync
Andreas Sandberg [Fri, 28 Apr 2017 11:08:32 +0000 (11:08 +0000)]
kvm, arm: Fix incorrect PSTATE sync

The state transfer code wasn't reading back PSTATE correctly from the
CPU prior to updating the thread context and was incorreclty writing
the register as a 32-bit value when updating KVM. Correctly read back
the state before updating gem5's view of PSTATE and cast the value to
a uint64_t.

Change-Id: I0a6ff5b77b897c756b20a20f65c420f42386360f
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2963
Reviewed-by: Rahul Thakur <rjthakur@google.com>
7 years agoutil: Correctly handle short writes in m5 (read|exec)file
Andreas Sandberg [Wed, 26 Apr 2017 16:46:13 +0000 (16:46 +0000)]
util: Correctly handle short writes in m5 (read|exec)file

The m5 tool has subcommands that writes a file to the simulated file
system. The implementation of this command currently doesn't check the
return value from write, which leads to compiler warnings and
potentially incorrect behavior. Add the necessary checks.

Change-Id: If558534d3245aa24cf15edf06bd0af4c6ba3908c
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2962
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
7 years agoutil: Add the m5_loadsymbol pseudo op to the m5 tool
Andreas Sandberg [Mon, 8 May 2017 09:57:17 +0000 (10:57 +0100)]
util: Add the m5_loadsymbol pseudo op to the m5 tool

Change-Id: Ib8bf4eac77170db8b2bf44796fd9d46b02217d03
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/3122
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
7 years agoutil: Fix incorrect use of m5_loadsymbol
Andreas Sandberg [Wed, 26 Apr 2017 16:44:23 +0000 (16:44 +0000)]
util: Fix incorrect use of m5_loadsymbol

It seems like the m5 utility incorrectly called m5_loadsymbol instead
of m5_addsymbol. Judging by the signature of the loadsymbol command,
the expected behavior is to add a new symbol to gem5's symbol
table. This is behavior is implemented by m5_addsymbol.

Change-Id: I83b61c48d6f8d7b1e8b57d884dfca00481c83c3a
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2961
Reviewed-by: Gabe Black <gabeblack@google.com>
7 years agomisc: fix build failure in cxx_config example
Paul Rosenfeld [Tue, 2 May 2017 21:07:55 +0000 (15:07 -0600)]
misc: fix build failure in cxx_config example

Fix a missing header in the cxx_config example which is used as a
simple example of using libgem5.so without python.

Change-Id: I758bfe42ba735ce0c7eaedd49b94a130e3bd21e3
Reviewed-on: https://gem5-review.googlesource.com/3000
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agoscons: Get rid of the PHONY_BASE construction variable.
Gabe Black [Tue, 2 May 2017 02:50:30 +0000 (19:50 -0700)]
scons: Get rid of the PHONY_BASE construction variable.

The value of that variable can be computed more directly and more locally
to where it's consumed.

Change-Id: I5ca1f732a34e22d4dae2aeb6ee7fc8adebe1caa0
Reviewed-on: https://gem5-review.googlesource.com/2981
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoutil: Fix incorrect return type in m5 writefile
Andreas Sandberg [Wed, 26 Apr 2017 16:43:03 +0000 (16:43 +0000)]
util: Fix incorrect return type in m5 writefile

Change-Id: Ic24a1c3c1488e970ed27bb6b99262d201f535384
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2960
Reviewed-by: Gabe Black <gabeblack@google.com>
7 years agoscons: Replace str(foo.get_contents()) with foo.get_text_contents().
Gabe Black [Sat, 6 May 2017 01:05:36 +0000 (18:05 -0700)]
scons: Replace str(foo.get_contents()) with foo.get_text_contents().

For Value() nodes, the get_contents() method and the get_text_contents()
method are just aliases to the same thing, both of which return a value
which has already been converted using str(). The str() which was included
explicitly in the SConscript was redundant, except that it showed that the
value from get_contents was being treated as a string. To avoid the
redundancy but to still leave a hint to the value's type, this change
converts those bits of code to use get_text_contents() and removes the
str().

Change-Id: I8f7da9b652f749e741b553c9a0e2248ae15ec3ca
Reviewed-on: https://gem5-review.googlesource.com/3084
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agoscons: Make env['USE_PYTHON'] a source for createEnumStrings.
Gabe Black [Sat, 6 May 2017 01:01:33 +0000 (18:01 -0700)]
scons: Make env['USE_PYTHON'] a source for createEnumStrings.

That clues scons in to the fact that the contents of the target of that
function depends on the value of that construction variable.

Change-Id: I803322ea1a178152da3d95dffffe20acd4271c88
Reviewed-on: https://gem5-review.googlesource.com/3083
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Paul Rosenfeld <prosenfeld@micron.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agoconfig: Remove support for CPU aliases.
Gabe Black [Fri, 28 Apr 2017 03:47:10 +0000 (20:47 -0700)]
config: Remove support for CPU aliases.

This was added for backwards compatability, but it adds a decent amount
of complexity.

The table below shows what CPU class name to use in place of a given
alias.

+==========+========================================================+
|  Alias   |                       CPU class                        |
+==========+========================================================+
| timing   | TimingSimpleCPU                                        |
| atomic   | AtomicSimpleCPU                                        |
| minor    | MinorCPU                                               |
| detailed | DrivO3CPU                                              |
| kvm      | ArmKvmCPU, ArmV8KvmCPU or X86KvmCPU, depending on arch |
| trace    | TraceCPU                                               |
+==========+========================================================+

Change-Id: I251c4f64b7869c6b64dd25b36967ae240f01ef08
Reviewed-on: https://gem5-review.googlesource.com/2940
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agosyscall_emul: Argument retrieval bug fix
Alexandru Dutu [Tue, 2 May 2017 17:56:36 +0000 (13:56 -0400)]
syscall_emul: Argument retrieval bug fix

This commit fixes a stack-buffer underflow
by fixing the way the array is indexed.

Change-Id: I44400e2b99a2f8e1f48f673cd110b9dcd6480a72
Reviewed-on: https://gem5-review.googlesource.com/3040
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>

7 years agoscons: Merge reading test SConscripts into makeEnv.
Gabe Black [Tue, 2 May 2017 00:50:43 +0000 (17:50 -0700)]
scons: Merge reading test SConscripts into makeEnv.

We're already visiting each of the environments, there's no reason to
track them all and then set up test SConscripts on a second pass.

Change-Id: I2d1166f58ac907e874d6ad5de7bd53ff7ad645f8
Reviewed-on: https://gem5-review.googlesource.com/2980
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agoscons: Fix the compiler flag used for partial linking.
Gabe Black [Wed, 3 May 2017 07:37:19 +0000 (00:37 -0700)]
scons: Fix the compiler flag used for partial linking.

It seems that g++ can generally handle the -r flag for generating a
relocatable object file, but ld can't always handle the  --relocatable
flag.

Change-Id: I15f32e469590a814131d4e992b392a7ad6c52b83
Reviewed-on: https://gem5-review.googlesource.com/3001
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agopython: Remove SWIG
Andreas Sandberg [Mon, 30 Jan 2017 12:00:21 +0000 (12:00 +0000)]
python: Remove SWIG

Remove SWIG-specific Python code.

Change-Id: If1d1b253d84021c9a8f9a64027ea7a94f2336dff
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2922
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
7 years agobase, sim, dev: Remove SWIG
Andreas Sandberg [Mon, 30 Jan 2017 12:00:05 +0000 (12:00 +0000)]
base, sim, dev: Remove SWIG

Remove SWIG guards and SWIG-specific C++ code.

Change-Id: Icaad6720513b6f48153727ef3f70e0dba0df4bee
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2921
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
7 years agoscons: Remove SWIG support
Andreas Sandberg [Mon, 30 Jan 2017 11:59:57 +0000 (11:59 +0000)]
scons: Remove SWIG support

Remove remaining SWIG support from the build infrastructure.

Change-Id: I7549cd0f952ca3a51481918eefef3a29f03af359
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2920
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
7 years agopython: Use PyBind11 instead of SWIG for Python wrappers
Andreas Sandberg [Mon, 27 Feb 2017 13:17:51 +0000 (13:17 +0000)]
python: Use PyBind11 instead of SWIG for Python wrappers

Use the PyBind11 wrapping infrastructure instead of SWIG to generate
wrappers for functionality that needs to be exported to Python. This
has several benefits:

  * PyBind11 can be redistributed with gem5, which means that we have
    full control of the version used. This avoid a large number of
    hard-to-debug SWIG issues we have seen in the past.

  * PyBind11 doesn't rely on a custom C++ parser, instead it relies on
    wrappers being explicitly declared in C++. The leads to slightly
    more boiler-plate code in manually created wrappers, but doesn't
    doesn't increase the overall code size. A big benefit is that this
    avoids strange compilation errors when SWIG doesn't understand
    modern language features.

  * Unlike SWIG, there is no risk that the wrapper code incorporates
    incorrect type casts (this has happened on numerous occasions in
    the past) since these will result in compile-time errors.

As a part of this change, the mechanism to define exported methods has
been redesigned slightly. New methods can be exported either by
declaring them in the SimObject declaration and decorating them with
the cxxMethod decorator or by adding an instance of
PyBindMethod/PyBindProperty to the cxx_exports class variable. The
decorator has the added benefit of making it possible to add a
docstring and naming the method's parameters.

The new wrappers have the following known issues:

  * Global events can't be memory managed correctly. This was the
    case in SWIG as well.

Change-Id: I88c5a95b6cf6c32fa9e1ad31dfc08b2e8199a763
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Andrew Bardsley <andrew.bardsley@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2231
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoext: Fix undefined macro in pybind
Andreas Sandberg [Mon, 27 Feb 2017 13:17:51 +0000 (13:17 +0000)]
ext: Fix undefined macro in pybind

Change-Id: I63a2506d3c028f78cacce8308e2f0e4880531dec
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2230
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
7 years agoext: Add pybind rev f4b81b3
Andreas Sandberg [Mon, 27 Feb 2017 13:17:51 +0000 (13:17 +0000)]
ext: Add pybind rev f4b81b3

Change-Id: I52e4fc9ebf2f59da57d8cf8f3e37cc79598c2f5f
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2229
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
7 years agoscons: Remove the SPAWN hack added earlier.
Gabe Black [Fri, 28 Apr 2017 11:11:38 +0000 (04:11 -0700)]
scons: Remove the SPAWN hack added earlier.

A previous change forced scons to spawn child processes by exec-ing it
directly rather than going through the shell because the command line
length would be too long for the shell to handle. Now that incremental
linking should keep the command line lengths more under control, that
change should no longer be necessary.

Change-Id: I9e82a62083afd1414324a7fd697bd6d4b76367ae
Reviewed-on: https://gem5-review.googlesource.com/2947
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agoscons: Group Source-s based on what SConscript included them.
Gabe Black [Fri, 28 Apr 2017 11:03:01 +0000 (04:03 -0700)]
scons: Group Source-s based on what SConscript included them.

The groups won't be perfectly balanced or optimally planned, but this
requires no thought and breaks the object files down into a reasonable
number of reasonably sized groups.

Change-Id: I6542fc807aaf356a9be751093f68e2e29f0b1586
Reviewed-on: https://gem5-review.googlesource.com/2946
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agoscons: Put Source objects in groups and partially link them.
Gabe Black [Fri, 28 Apr 2017 11:00:42 +0000 (04:00 -0700)]
scons: Put Source objects in groups and partially link them.

The groups will be linked together into intermediate partially linked
object files. Right now the hierarchy is assumed to be flat, but with some
effort it could be extended to allow truly hierarchical linking.

Change-Id: I77b77710554e5f05e8b00720a0170afaf4afac2d
Reviewed-on: https://gem5-review.googlesource.com/2945
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agoscons: Add builders for partially linked object files.
Gabe Black [Fri, 28 Apr 2017 10:57:09 +0000 (03:57 -0700)]
scons: Add builders for partially linked object files.

These intermediate object files can be used to perform a hierarchical
link.

Change-Id: I27634731734eebe6531ce6b0894abdd59ffdc5c9
Reviewed-on: https://gem5-review.googlesource.com/2944
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agoarch-sparc: Fix wrong indentation causing warnings for gcc 6
Nikos Nikoleris [Wed, 26 Apr 2017 09:52:13 +0000 (10:52 +0100)]
arch-sparc: Fix wrong indentation causing warnings for gcc 6

Change-Id: I94e15ae79f0e73692d882f62fd2b7bf45cf0c841
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2900
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agodev: Add ATA command used in recent Linux kernels
Jason Lowe-Power [Mon, 24 Apr 2017 13:55:24 +0000 (08:55 -0500)]
dev: Add ATA command used in recent Linux kernels

Add a case for the ATA command ATAPI_IDENTIFY_DEVICE.
This avoids the panic: Unsupported ATA command when booting a recent Linux
kernel. This was tested on 4.8.13.

Change-Id: Ib297a2c02da0730d8698c59801254dd0f5ee9f7f
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/2863
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
7 years agoscons: Add a Transform() for when linking shared libraries.
Gabe Black [Fri, 28 Apr 2017 10:49:24 +0000 (03:49 -0700)]
scons: Add a Transform() for when linking shared libraries.

Change-Id: I7ddba0cc7be559633328011c1c7e2282f509b78c
Reviewed-on: https://gem5-review.googlesource.com/2943
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agoscons: Find ext build directories automatically.
Gabe Black [Fri, 28 Apr 2017 06:50:09 +0000 (23:50 -0700)]
scons: Find ext build directories automatically.

The ext directories with SConscripts in them are easy to find
automatically. Avoid boilerplate listing them out and SConscript()ing
them manually.

Change-Id: Ib723882aebc00e639eb8ec44904bb05ffa2c6b55
Reviewed-on: https://gem5-review.googlesource.com/2942
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

7 years agomisc: Add MAINTAINERS file
Jason Lowe-Power [Tue, 11 Apr 2017 21:17:10 +0000 (16:17 -0500)]
misc: Add MAINTAINERS file

This file defines all of the commit keywords used for gem5 commits and
the maintainter(s) for each of these keywords.

This patch introduces a number of new keywords, and changes to previous
keywords. The new keywords better follow gem5's directory structure and
are more extensible.

Currently, most keywords do not have a maintainer. More maintainers will
be added as more people volunteer to be maintainers.

This patch also updates the CONTRIBUTING.md file to point to this file
instead of listing the keywords separately. When this file is committed
the wiki will also be updated accordingly.

Change-Id: Ib0abfeb39a3ca01b74b340e24dc9a2cd95ff813f
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/2760
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
7 years agotests: Remove unused options from tests.py
Andreas Sandberg [Fri, 21 Apr 2017 09:41:49 +0000 (10:41 +0100)]
tests: Remove unused options from tests.py

The test sub-command in tests.py incorrectly accepts various
formatting options in its usage string. These options aren't needed
since the test command doesn't produce any output.

Change-Id: I6d4731aa32a25a2286aa66548eaa0154a9392f79
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2840
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agox86: fixed branching() computation for branch uops
Santi Galan [Tue, 18 Apr 2017 16:08:46 +0000 (11:08 -0500)]
x86: fixed branching() computation for branch uops

When a branch micro-op belongs to a flow and the micro-op does not change
the nPC and just updates the nuPC (like a 'rep movs' flow), branching()
function always returns not-taken no matter  actual micro-branch outcome.
Provided fix adds to the equation  nuPC attribute checking since these kind
of branch micro-op only updates that pointer.

This issue has been found while debugging the performance of a copy-loop
implemented with memcopy function. Without the fix, 'rep movss' internal
micro-branch was always predicted as not-taken causing an squash event
after every branch micro-branch execution.

Using the provided test, branch mispredition went from 1922 without the fix
to 7.

Change-Id: I1bcbefae26aef47e3135817ef99b53d0ea0a98fa

7 years agoscons: When spawning the linker process, don't involve the shell.
Gabe Black [Fri, 14 Apr 2017 00:13:10 +0000 (17:13 -0700)]
scons: When spawning the linker process, don't involve the shell.

The command line can be too long, causing bash to choke. This means we can't
use any shell syntax like shell variables or redirection when linking, but
that should be easy to avoid.

Change-Id: Ie6c8ecab337cef6bd3c7e403346ced06f46f0993
Reviewed-on: https://gem5-review.googlesource.com/2780
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Steve Reinhardt <stever@gmail.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agoconfig, arm: Add an example power model
Andreas Sandberg [Wed, 5 Apr 2017 16:02:21 +0000 (17:02 +0100)]
config, arm: Add an example power model

Add a script to demonstrate how power models can be wired to gem5
models. The script is meant as an example only and does not correlate
with any realistic implementation.

Change-Id: Ib95a74b2cb4af77a7816e3e8e89c89f3460775a1
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2721
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agopower: Allow global stats in power equations
Stephan Diestelhorst [Thu, 6 Apr 2017 13:53:41 +0000 (14:53 +0100)]
power: Allow global stats in power equations

Allow global stats such as sim_seconds in power equations to make it
possible to convert from event stats to rate stats.

Change-Id: I429abe0ffadc0dbd162eb39e0897143be472ef65
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2720
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agomisc: minor fix for the gem5-SystemC/TLM coupling.
Éder F. Zulian [Thu, 23 Mar 2017 15:29:32 +0000 (16:29 +0100)]
misc: minor fix for the gem5-SystemC/TLM coupling.

This patch has a minor fix for the coupling between gem5 and SystemC-TLM.

It also fixes some typos in the related documentation.

Change-Id: I894568729b8ebdacc5b81c9f46e8f9d137da210f
Reviewed-on: https://gem5-review.googlesource.com/2480
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agoriscv: Fix crashes with large or frequent mmaps
Alec Roelke [Thu, 30 Mar 2017 20:35:08 +0000 (16:35 -0400)]
riscv: Fix crashes with large or frequent mmaps

This patch fixes a bug where increasing the mmap region too much causes
it to run into already-allocated memory, which causes gem5 to fail an
assertion.  Previously, the stack was incorrectly set up such that the
end of the mmap region and the top of the stack were the same address
and both would grow downward.  With this patch, the top of the stack has
been separated from the end of mmap and moved up, and the mmap region
now grows upward instead of downward.

[Rebase to master branch and remove dependencies.]

Change-Id: I7271ff478fff2994f918bc5003a6139b9ba6a520
Reviewed-on: https://gem5-review.googlesource.com/2680
Maintainer: Alec Roelke <ar4jc@virginia.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agopower: Clarify the unit used for the power equations (W)
Stephan Diestelhorst [Thu, 6 Apr 2017 13:53:41 +0000 (14:53 +0100)]
power: Clarify the unit used for the power equations (W)

Change-Id: Iab5070fc9b666fcb5b49b0e2b99a4a1605b3b721
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agopower: Add a voltage variable to power expressions
Andreas Sandberg [Wed, 5 Apr 2017 15:40:08 +0000 (16:40 +0100)]
power: Add a voltage variable to power expressions

There is currently no good way of extracting the current operating
voltage in MathExprPowerModels. This change adds a magic variable,
'voltage', that can be referenced from such expressions to get the
current operating voltage.

Change-Id: Ice3c9a4a221921a542de5da52f83f3f88862d246
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2662
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agopower: Add error checking to MathExprPowerModel
Andreas Sandberg [Wed, 5 Apr 2017 15:38:00 +0000 (16:38 +0100)]
power: Add error checking to MathExprPowerModel

MathExprPower model currently doesn't print any useful error messages
if an expression fails to evaluate. To add insult to injury, the model
only detects a failure when dumping stats and not at
initialization. This change adds a verification step in startup() that
ensures that all of the referenced stats actually exist.

Change-Id: I8f71c73341578d5882c8d93e482f5383fbda5f1d
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2661
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agoruby: Fix MOESI_CMP_directory for new DMA status changes.
Javier Cano-Cano [Mon, 13 Mar 2017 15:38:18 +0000 (16:38 +0100)]
ruby: Fix MOESI_CMP_directory for new DMA status changes.

Multiple outstanding DMA requests introduced new DMA states that didn't
be considered into slicc code. This patch implements the missed DMA state
changes on MOESI_CMP_directory protocol.

Change-Id: I700d441d76556b7e77e0d507904af6ec6ba59cc2
Signed-off-by: Michael LeBeane <michael.lebeane@amd.com>
Reviewed-on: https://gem5-review.googlesource.com/2380
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agoriscv: fix Linux problems with LR and SC ops
Alec Roelke [Tue, 21 Mar 2017 16:58:25 +0000 (12:58 -0400)]
riscv: fix Linux problems with LR and SC ops

Some of the functions in the Linux toolchain that allocate memory make
use of paired LR and SC instructions, which didn't work properly for
that toolchain.  This patch fixes that so attempting to use those
functions doesn't cause an endless loop of failed SC instructions.

Change-Id: If27696323dd6229a0277818e3744fbdf7180fca7
Reviewed-on: https://gem5-review.googlesource.com/2340
Maintainer: Alec Roelke <ar4jc@virginia.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoriscv: fix compatibility with Linux toolchain
Alec Roelke [Tue, 21 Mar 2017 16:56:32 +0000 (12:56 -0400)]
riscv: fix compatibility with Linux toolchain

Previously, RISC-V in gem5 only supported RISC-V's Newlib toolchain
(riscv64-unknown-elf-*) due to incorrect assumptions made in the initial
setup of the user stack in SE mode.  This patch fixes that by referring
to the RISC-V proxy kernel code (https://github.com/riscv/riscv-pk) and
setting up the stack according to how it does it.  Now binaries compiled
using the Linux toolchain (riscv64-unknown-linux-gnu-*) will run as
well.

[Update for recent changes to MemState to add accessors and mutators to
get its members.]

Change-Id: I6d2c486df7688efe3df54273e9aa0fd686851285
Reviewed-on: https://gem5-review.googlesource.com/2305
Maintainer: Alec Roelke <ar4jc@virginia.edu>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoriscv: add remote gdb support
Alec Roelke [Tue, 21 Mar 2017 16:54:50 +0000 (12:54 -0400)]
riscv: add remote gdb support

This patch adds support for debugging with remote GDB to RISC-V. Using
GDB compiled with the RISC-V GNU toolchain, it is possible to pause
and continue execution, view debugging information, etc.  As with the
rest of RISC-V, this does not support full-system mode.

Change-Id: I2d3a8be614725e1be4b4c283f9fb678a0a30578d
Reviewed-on: https://gem5-review.googlesource.com/2304
Maintainer: Alec Roelke <ar4jc@virginia.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoriscv: fix error on memory op address overflow
Alec Roelke [Tue, 21 Mar 2017 16:53:29 +0000 (12:53 -0400)]
riscv: fix error on memory op address overflow

Previously, if a memory operation referenced an address that caused the
data to wrap around to the beginning of the memory (such as -1 or
0xFFFFFFFFFFFFFFFF), an assert would fail during address translation and
gem5 would crash.  This patch fixes that by checking for such a case in
RISC-V's TLB code and returning a fault from translateData if that would
happen.  Because RISC-V does support unaligned memory accesses, no
checking is performed to make sure that an access doesn't cross a cache
line.

[Update creation of page table fault to use make_shared.]
[Add comment explaining the change and assertion that the memory request
isn't zero size.]

Change-Id: I7b8ef9a5838f30184dbdbd0c7c1655e1c04a9410
Reviewed-on: https://gem5-review.googlesource.com/2345
Maintainer: Alec Roelke <ar4jc@virginia.edu>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoriscv: enable unaligned memory accesses
Alec Roelke [Tue, 21 Mar 2017 16:51:54 +0000 (12:51 -0400)]
riscv: enable unaligned memory accesses

Sometimes an ld instruction will be split across a
cache boundary.  Previously RISC-V was set to not
allow this.  This patch fixes that.

Change-Id: I8bc8ea6d67f65a9b3662e14c4037f4224799d20f
Reviewed-on: https://gem5-review.googlesource.com/2341
Maintainer: Alec Roelke <ar4jc@virginia.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Update some stats after simulated program exit behavior was changed.
Gabe Black [Wed, 29 Mar 2017 23:14:05 +0000 (16:14 -0700)]
stats: Update some stats after simulated program exit behavior was changed.

The following CL delayed program exit and changed the stats for many if not
most of the SE mode regressions.

    commit 2c1286865fc2542a0586ca4ff40b00765d17b348
    Author: Brandon Potter <Brandon.Potter@amd.com>
    Date:   Wed Mar 1 14:52:23 2017 -0600

        syscall-emul: Rewrite system call exit code

Change-Id: Id241f2b7d5374947597c715ee44febe1acc5ea16
Reviewed-on: https://gem5-review.googlesource.com/2656
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Update the stats for 70.twolf for x86 o3-timing mode.
Gabe Black [Fri, 31 Mar 2017 00:59:34 +0000 (17:59 -0700)]
stats: Update the stats for 70.twolf for x86 o3-timing mode.

The following CL changed the stats:

    commit 43418e7f81099072fb7d56dae11110ae1d858162
    Author: Brandon Potter <Brandon.Potter@amd.com>
    Date:   Wed Mar 1 13:07:43 2017 -0600

        syscall-emul: Move memState into its own file

It would be a good idea to try to figure out why, since it doesn't *look* like
this change was intended to move things around in memory or otherwise change
simulated behavior.

Change-Id: I0173ffdfb680a91b8c91f2bf5d7f72c76e7a8b63
Reviewed-on: https://gem5-review.googlesource.com/2655
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Update 04.gpu stats.
Gabe Black [Tue, 28 Mar 2017 23:55:31 +0000 (16:55 -0700)]
stats: Update 04.gpu stats.

A new stat was added by the CL:

    commit b043dcf58ad766582aeab162fb855cc3fc95f2cf
    Author: Andreas Sandberg <andreas.sandberg@arm.com>
    Date:   Mon Feb 27 13:17:51 2017 +0000

        gpu-compute: Fix Python/C++ object hierarchy discrepancies

Change-Id: I665a7eb0bea19f379c5fbaaf4686fcbe8c008159
Reviewed-on: https://gem5-review.googlesource.com/2654
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Update ARM FS stats.
Gabe Black [Thu, 30 Mar 2017 01:50:49 +0000 (18:50 -0700)]
stats: Update ARM FS stats.

The change below changed the behavior of interrupts on ARM and changed the
stats for the 10.linux-boot regression.

    commit 746e2f3c27ad83c36b7bc3b8bd3c92004fcf995b
    Author: Sudhanshu Jha <sudhanshu.jha@arm.com>
    Date:   Mon Feb 27 10:29:56 2017 +0000

        arm, kmi: Clear interrupts in KMI devices

Change-Id: Ie1cfc26777f6ed2d3fd4340175941fda1fdb5b6a
Reviewed-on: https://gem5-review.googlesource.com/2653
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Update the 40.m5threads stats.
Gabe Black [Thu, 30 Mar 2017 04:01:37 +0000 (21:01 -0700)]
stats: Update the 40.m5threads stats.

The change below changed the stats for the o3 version of the 40.m5threads
regression.

    commit 2367198921765848a4f5b3d020a7cc5776209f80
    Author: Brandon Potter <brandon.potter@amd.com>
    Date:   Mon Feb 27 14:10:15 2017 -0500

        syscall_emul: [PATCH 15/22] add clone/execve for threading and
        multiprocess simulations

Change-Id: I601c58d8d1453cf93f2065ea5816b63b553610e0
Reviewed-on: https://gem5-review.googlesource.com/2652
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Rename num_syscalls to numSyscalls in the reference stats.
Gabe Black [Mon, 3 Apr 2017 23:51:24 +0000 (16:51 -0700)]
stats: Rename num_syscalls to numSyscalls in the reference stats.

The name of the stat was changed in the following change which broke all the
reference outputs.

    commit 2367198921765848a4f5b3d020a7cc5776209f80
    Author: Brandon Potter <brandon.potter@amd.com>
    Date:   Mon Feb 27 14:10:15 2017 -0500

        syscall_emul: [PATCH 15/22] add clone/execve for threading and
        multiprocess simulations

Change-Id: Id98b085ccae098c50c434ad81a72beee46084f40
Reviewed-on: https://gem5-review.googlesource.com/2651
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Update 01.hello-2T-smt and 40.perlbmks stats on ARM/Alpha o3-timing.
Gabe Black [Thu, 30 Mar 2017 04:40:35 +0000 (21:40 -0700)]
stats: Update 01.hello-2T-smt and 40.perlbmks stats on ARM/Alpha o3-timing.

The following change removed a write to an integer register when completing
a system call. This changed the reference statistics slightly.

    commit 073cb266079edddec64ea8cd5169dd2cbef8f812
    Author: Brandon Potter <brandon.potter@amd.com>
    Date:   Mon Feb 27 14:10:02 2017 -0500

        syscall_emul: [patch 14/22] adds identifier system calls

Change-Id: I3bee42ab826dd9cbc49aab34340da57caf4f045d
Reviewed-on: https://gem5-review.googlesource.com/2650
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Update the stats for 04.gpu for x86/linux/gpu-ruby-GPU_Rf0.
Gabe Black [Tue, 28 Mar 2017 22:32:42 +0000 (15:32 -0700)]
stats: Update the stats for 04.gpu for x86/linux/gpu-ruby-GPU_Rf0.

These stats were changed by this CL:

    commit a4b546c3a139aeb33f087422637ac06fc4477d11
    Author: Matthew Poremba <matthew.poremba@amd.com>
    Date:   Thu Jan 19 11:58:59 2017 -0500

        ruby: Add occupancy stats to MessageBuffers

Change-Id: I9713ed44d94cba424cdfa92d746dfe8007583b40
Reviewed-on: https://gem5-review.googlesource.com/2649
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Update the solaris boot stats for the new op classes.
Gabe Black [Tue, 4 Apr 2017 10:11:17 +0000 (03:11 -0700)]
stats: Update the solaris boot stats for the new op classes.

The change below introduced some new op classes which have their own stats,
and the counts the instructions used to be under have gone down.

    commit 6c72c3551978ef2eabbe9727bf24fd2fcf385318
    Author: Fernando Endo <fernando.endo2@gmail.com>
    Date:   Sat Oct 15 14:58:45 2016 -0500

        cpu, arm: Distinguish Float* and SimdFloat*, create FloatMem* opClass

Change-Id: Ifa3a279493f503585a7b2cbb2785b106e24184bb
Reviewed-on: https://gem5-review.googlesource.com/2648
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Update the solaris boot stats for the default snoop_filter.
Gabe Black [Tue, 4 Apr 2017 09:44:49 +0000 (02:44 -0700)]
stats: Update the solaris boot stats for the default snoop_filter.

The snoop_filter was enabled by default by this change:

    commit 080d4e08d627b5b726afec71d38370373b7376c5
    Author: Andreas Hansson <andreas.hansson@arm.com>
    Date:   Fri Aug 12 14:11:45 2016 +0100

        mem: Add snoop filter to SystemXBar by default

Change-Id: I850473c70437588b47812f1dc00d6ecdb66daa36
Reviewed-on: https://gem5-review.googlesource.com/2647
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Update the solaris boot stats for new snoopTraffic stat.
Gabe Black [Tue, 4 Apr 2017 09:24:07 +0000 (02:24 -0700)]
stats: Update the solaris boot stats for new snoopTraffic stat.

The following change added the new stat:

    commit 0020662459fdd9efcfe9864ef12160515434ccdb
    Author: David Guillen Fandos <david.guillen@arm.com>
    Date:   Thu Jul 21 17:19:14 2016 +0100

        mem: Add snoop traffic statistic

Change-Id: I9ee0fb4b8cc97c6b94e76ab5524f89c78c97d1a6
Reviewed-on: https://gem5-review.googlesource.com/2646
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoconfig: Add a default system disk image for SPARC FS.
Gabe Black [Mon, 3 Apr 2017 22:50:24 +0000 (15:50 -0700)]
config: Add a default system disk image for SPARC FS.

When the change below removed the hard coded disk name for the SPARC FS
configuration, it broke the regression which had not specified a disk name.
This change adds a default disk name so that the regression will continue to
work like it used to, but preserving the effect of this other change.

    commit 86a25bbcee88f6e69299867b6264885d738f636e
    Author: Jakub Jermar <jakub@jermar.eu>
    Date:   Tue Jul 19 09:52:46 2016 -0500

        config: Allow SPARC FS image to be specified on the command line

Change-Id: Ieb317b2bf573a4f2fc435d34cccd1f246c28d84c
Reviewed-on: https://gem5-review.googlesource.com/2645
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Update SPARC solaris boot stats.
Gabe Black [Tue, 4 Apr 2017 09:04:37 +0000 (02:04 -0700)]
stats: Update SPARC solaris boot stats.

The CPU power state bins where changed by the following
CL:

    commit fb5fc11da49938660ea22c336964677cdba890e1
    Author: David Guillen Fandos <david.guillen@arm.com>
    Date:   Mon Jun 6 17:16:43 2016 +0100

        pwr: Low-power idle power state for idle CPUs

Change-Id: I8b3924681c8a85b7bbe061b671faf274ce882f91
Reviewed-on: https://gem5-review.googlesource.com/2644
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Remove stats from the SPARC solaris boot which were silenced.
Gabe Black [Tue, 4 Apr 2017 08:19:22 +0000 (01:19 -0700)]
stats: Remove stats from the SPARC solaris boot which were silenced.

These were silenced in:

    commit d4342aff4ce347ad8ab5a01fdd41993106cd3ece
    Author: Andreas Sandberg <andreas.sandberg@arm.com>
    Date:   Mon Jun 6 17:16:43 2016 +0100

        stats: Silence unused power stats

Change-Id: I273e8190b76335505bedfea88ef89abee1739b8a
Reviewed-on: https://gem5-review.googlesource.com/2643
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Add a boat load of stats to the SPARC solaris boot regression.
Gabe Black [Tue, 4 Apr 2017 07:56:29 +0000 (00:56 -0700)]
stats: Add a boat load of stats to the SPARC solaris boot regression.

A large number of stats were added by the following change:

    commit 5350879f499470a2683dfec6cff021dd7ac20fa6
    Author: David Guillen Fandos <david.guillen@arm.com>
    Date:   Mon Jun 6 17:16:43 2016 +0100

        pwr: Add power states to ClockedObject

Change-Id: Iec32bb7f701db0a09be26fe5ffb2812385f972c2
Reviewed-on: https://gem5-review.googlesource.com/2642
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostats: Un-empty the SPARC FS stats.txt file.
Gabe Black [Tue, 28 Mar 2017 06:51:10 +0000 (23:51 -0700)]
stats: Un-empty the SPARC FS stats.txt file.

This was emptied accidentally by the CL below. A lot of other files were too,
but those were eventually refilled.

    commit 62b6ff22ec1f90014b1d0fc778014bdb38cc09ce
    Author: Curtis Dunham <Curtis.Dunham@arm.com>
    Date:   Tue May 31 11:07:18 2016 +0100

        stats: update for snoop filter tweak

Change-Id: I34aefca51a92a6a98f6a8fdbdab7106cc1fff171
Reviewed-on: https://gem5-review.googlesource.com/2641
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agoscons: Fix hook installation error caused by stale cache
Andreas Sandberg [Wed, 5 Apr 2017 08:53:43 +0000 (09:53 +0100)]
scons: Fix hook installation error caused by stale cache

Due to the way SCons caches some file system state internally, it
sometimes "remembers" that a file or directory didn't exist at some
point. The git hook installation script sometimes needs to create a
hooks directory in the repository. Due to the cached state of the
hooks directory, the build system tries to create it twice. The second
mkdir operation leads to an error since the directory already exists.

Fix this issue by clearing the cached state of the hooks directory
after creating it.

Change-Id: I3f67f75c06ef928b439a0742f7619b7e92ed093b
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2660
Reviewed-by: Gabe Black <gabeblack@google.com>
7 years agoarm, kvm: implement GIC state transfer
Curtis Dunham [Fri, 27 Jan 2017 20:21:59 +0000 (20:21 +0000)]
arm, kvm: implement GIC state transfer

This also allows checkpointing of a Kvm GIC via the Pl390 model.

Change-Id: Ic85d81cfefad630617491b732398f5e6a5f34c0b
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2444
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Weiping Liao <weipingliao@google.com>
7 years agoarm, dev: add basic support for GICC_BPR register
Curtis Dunham [Thu, 9 Mar 2017 17:30:59 +0000 (17:30 +0000)]
arm, dev: add basic support for GICC_BPR register

The Binary Point Register (BPR) specifies which bits belong to the
group priority field (which are used for preemption) and which to the
subpriority field (which are ignored for preemption).

Change-Id: If51e669d23b49047b69b82ab363dd01a936cc93b
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2443
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Weiping Liao <weipingliao@google.com>
7 years agoarm, dev: refactor GIC Pl390 GICD_ITARGETSRn handling
Curtis Dunham [Tue, 31 Jan 2017 17:11:24 +0000 (17:11 +0000)]
arm, dev: refactor GIC Pl390 GICD_ITARGETSRn handling

The aforementioned registers (Interrupt Processor Targets Registers) are
banked per-CPU, but are read-only.  This patch eliminates the per-CPU
storage of these values that are simply computed.

Change-Id: I52cafc2f58e87dd54239a71326c01f4923544689
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2442
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Weiping Liao <weipingliao@google.com>
7 years agoarm: refactor packet processing in Pl390 GIC
Curtis Dunham [Fri, 27 Jan 2017 20:16:23 +0000 (20:16 +0000)]
arm: refactor packet processing in Pl390 GIC

Change-Id: I696703418506522ba90df5c2c4ca45c95a6efbea
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2441
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Weiping Liao <weipingliao@google.com>
7 years agoarm: Don't panic when checking coprocessor read/write permissions
Nikos Nikoleris [Wed, 1 Mar 2017 20:55:15 +0000 (20:55 +0000)]
arm: Don't panic when checking coprocessor read/write permissions

Instructions that use the coprocessor interface check the current
program status to determine whether the current context has the
priviledges to read from/write to the coprocessor. Some modes allow
the execution of coprocessor instructions, some others do not allow it,
while some other modes are unexpected (e.g., executing an AArch32
instruction while being in an AArch64 mode).

Previously we would unconditionally trigger a panic if we were in an
unexpected mode. This change removes the panic and replaces it
with an Undefined Instruction fault that triggers if and when a
coprocessor instruction commits in an unexpected mode. This allows
speculative coprocessor instructions from unexpected modes to execute
but prevents them from gettting committed.

Change-Id: If2776d5bae2471cdbaf76d0e1ae655f501bfbf01
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Rekai Gonzalez Alberquilla <rekai.gonzalezalberquilla@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2281
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Weiping Liao <weipingliao@google.com>
7 years agoarm: Treat Write-Through Normal memory as Non-Cacheable
Nikos Nikoleris [Mon, 27 Feb 2017 15:57:31 +0000 (15:57 +0000)]
arm: Treat Write-Through Normal memory as Non-Cacheable

A completed write to a memory location that is Write-Through Cacheable
has to be visible to an external observer without the need of explicit
cache maintenance. This change adds support for Write-Through
Cacheable Normal memory and treats it as Non-cacheable. This incurs a
small penalty as accesses to the memory do not fill in the cache but
does not violate the properties of the memory type.

Change-Id: Iee17ef9d952a550be9ad660b1e60e9f6c4ef2c2d
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2280
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agosim: Handle cases where Drainable::resume() creates objects
Andreas Sandberg [Tue, 28 Mar 2017 13:50:06 +0000 (13:50 +0000)]
sim: Handle cases where Drainable::resume() creates objects

There are cases where Drainable objects need to create new objects in
Drainable::resume(). In such cases, the local drain state will be
inherited from the DrainManager. We currently set the state to Running
as soon as we start resuming the simulator. This means that new
objects are created in the Running state rather than the Drained
state, which the resume code assumes. Depending on the traversal order
in DrainManager::resume(), this sometimes triggers a panic because the
object being resumed is in the wrong state.

This change introduces a new drain state, Resuming, that the
DrainManager enters as soon as it starts resuming the
simulator. Objects that are created while resuming are created in this
state. Such objects are then resumed in a subsequent pass over the
list of Drainable objects that need to be resumed. Once all objects
have been resumed, the simulator enters the Running state.

Change-Id: Ieee8645351ffbdec477e9cd2ff86fc795e459617
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2600
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Weiping Liao <weipingliao@google.com>
7 years agoconfig, arm: Add multi-core KVM support to bL config
Andreas Sandberg [Fri, 17 Mar 2017 11:10:55 +0000 (11:10 +0000)]
config, arm: Add multi-core KVM support to bL config

Add support for KVM in the big.LITTLE(tm) example configuration. This
replaces the --atomic option with a --cpu-type option that can be used
to switch between atomic, kvm, and timing simulation.

When running in KVM mode, the simulation script automatically assigns
separate event queues (threads) to each of the simulated CPUs. All
simulated devices, including CPU child devices (e.g., interrupt
controllers and caches), are assigned to event queue 0.

Change-Id: Ic9a3f564db91f5a3d3cb754c5a02fdd5c17d5fdf
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-by: Gabor Dozsa <gabor.dozsa@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2561
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Weiping Liao <weipingliao@google.com>
7 years agoconfig, arm: Unify checkpoint path handling in bL configs
Andreas Sandberg [Mon, 20 Mar 2017 10:44:07 +0000 (10:44 +0000)]
config, arm: Unify checkpoint path handling in bL configs

The vanilla bL configuration file and the dist-gem5 configuration file
use slightly different code paths when restoring from
checkpoints. Unify this by passing the parsed options to the
instantiate() method and adding an optional checkpoint keyword
argument for checkpoint directories (only used by the dist-gem5
script).

Change-Id: I9943ec10bd7a256465e29c8de571142ec3fbaa0e
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-by: Gabor Dozsa <gabor.dozsa@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2560
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Weiping Liao <weipingliao@google.com>
7 years agoarm, kvm: Override the kernel's default MPIDR value
Andreas Sandberg [Mon, 20 Mar 2017 14:36:48 +0000 (14:36 +0000)]
arm, kvm: Override the kernel's default MPIDR value

The kernel and gem5 derive MPIDR values from CPU IDs in slightly
different ways. This means that guests running in a multi-CPU setup
sometimes fail to bring up secondary CPUs. Fix this by overriding the
MPIDR value in virtual CPUs just after they have been instantiated.

Change-Id: I916d44978a9c855ab89c80a083af45b0cea6edac
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2461
Reviewed-by: Weiping Liao <weipingliao@google.com>
7 years agodev, arm: Fix multi-core KVM race in the generic timer
Andreas Sandberg [Fri, 17 Mar 2017 11:57:23 +0000 (11:57 +0000)]
dev, arm: Fix multi-core KVM race in the generic timer

The generic timer sometimes needs to access global state. This can
lead to race conditions when simulating a multi-core KVM system where
each core lives in its own thread. In that case, the setMiscReg and
readMiscReg methods are called from the thread owning the CPU and not
the global device thread.

Change-Id: Ie3e982258648c8562cce0b30a0c122dfbfaf42cd
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Gabor Dozsa <gabor.dozsa@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2460
Reviewed-by: Weiping Liao <weipingliao@google.com>
7 years agodev: Align BAR0 size to power of 2 for VirtIO devices
Sascha Bischoff [Fri, 24 Mar 2017 16:02:30 +0000 (16:02 +0000)]
dev: Align BAR0 size to power of 2 for VirtIO devices

When setting the size of a PCI BAR, the kernel only supports powers of
two (as per the PCI spec). Previously, the size was incorrectly read
by the kernel, and the address ranges assigned to the PCI devices
could overlap, resulting in gem5 crashes.  We now round up to the next
power of two.

Kudos to Sergei Trofimov who helped to debug this issue!

Change-Id: I54ca399b62ea07c09d4cd989b17dfa670e841bbe
Reviewed-by: Anouk Van Laer <anouk.vanlaer@arm.com>
Reviewed-by: Sergei Trofimov <sergei.trofimov@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2580
Reviewed-by: Paul Rosenfeld <prosenfeld@micron.com>
7 years agodev: Add a dummy VirtIO device
Andreas Sandberg [Mon, 7 Nov 2016 18:16:51 +0000 (18:16 +0000)]
dev: Add a dummy VirtIO device

VirtIO transport interfaces always expect a VirtIO device
pointer. However, there are cases (in particular when using VirtIO's
MMIO interface) where we want to instantiate an interface without a
device. Add a dummy device using VirtIO device ID 0 and no queues to
handle this use case.

Change-Id: I6cbe12fd403903ef585be40279c3b1321fde48ff
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Sudhanshu Jha <sudhanshu.jha@arm.com>
Reviewed-by: Rekai Gonzalez Alberquilla <rekai.gonzalezalberquilla@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2325
Reviewed-by: Weiping Liao <weipingliao@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>