gem5.git
7 years agoscons: Stop generating an a.out checking the "as" version.
Gabe Black [Fri, 24 Mar 2017 07:36:16 +0000 (00:36 -0700)]
scons: Stop generating an a.out checking the "as" version.

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

7 years agoarm: correct register read bug in Pl390 GIC
Curtis Dunham [Fri, 20 Jan 2017 20:55:03 +0000 (20:55 +0000)]
arm: correct register read bug in Pl390 GIC

Change-Id: I4c0de7c2a5b40c1a9f009ca12062cb108b450b04
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agopython: Automatically disable listeners in batch setups
Andreas Sandberg [Mon, 28 Nov 2016 16:40:45 +0000 (16:40 +0000)]
python: Automatically disable listeners in batch setups

Determine if gem5 is running in a batch environment by checking if
STDIN is wired to a TTY or not. If the simulator is running in a batch
environment, disable all listeners by default. This behavior can be
overridden using the --enable-listeners option.

Change-Id: I404c709135339144216bf08a2769c016c543333c
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Sean McGoogan <sean.mcgoogan@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2322
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoutil: Add a tool to list outgoing/incoming changes
Andreas Sandberg [Tue, 7 Mar 2017 14:38:25 +0000 (14:38 +0000)]
util: Add a tool to list outgoing/incoming changes

Add a small Python script that uses Gerrit's Change-Id: tags to list
incoming and outgoing changes.

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

7 years agomisc: add copyright/name information for contribution
Pierre-Yves Péneau [Fri, 10 Mar 2017 08:58:16 +0000 (09:58 +0100)]
misc: add copyright/name information for contribution

Change-Id: I9242ce50b86b02ec1880d411627da11265cb8961
Signed-off-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
Reviewed-on: https://gem5-review.googlesource.com/2328
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agosyscall-emul: Hotfix for FreeBSD/Mac builds
Brandon Potter [Sun, 29 Jan 2017 12:22:33 +0000 (12:22 +0000)]
syscall-emul: Hotfix for FreeBSD/Mac builds

The clone system call added in 236719892 relies on header files
from Linux systems. Obviously, this prevents compilation for
anyone using FreeBSD or Mac to compile the simulator. This
changeset is meant as a temporary fix to allow builds on
non-Linux systems until a proper solution is found.

Change-Id: I404cc41c588ed193dd2c1ca0c1aea35b0786fe4e
Reviewed-on: https://gem5-review.googlesource.com/2420
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agosyscall-emul: change NULL to nullptr in Process files
Brandon Potter [Wed, 15 Mar 2017 16:09:36 +0000 (11:09 -0500)]
syscall-emul: change NULL to nullptr in Process files

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

7 years agocpu: Print progress messages in Trace CPU
Radhika Jagtap [Tue, 16 Aug 2016 13:14:58 +0000 (14:14 +0100)]
cpu: Print progress messages in Trace CPU

This change adds the ability to print a message at intervals
of committed instruction count to indicate progress in the
trace replay.

Change-Id: I8363502354c42bfc52936d2627986598b63a5797
Reviewed-by: Rekai Gonzalez Alberquilla <rekai.gonzalezalberquilla@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2321
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agotests: Warn not fail when reading invalid pickle status files
Nikos Nikoleris [Thu, 1 Sep 2016 16:27:20 +0000 (17:27 +0100)]
tests: Warn not fail when reading invalid pickle status files

With this change, the test script will output a warning when it reads
an incomplete (e.g., when a regression is still running) or corrupt
status file instead of throwing an exception. When the scipt is used
to show the results the corrupt file is skipped; when it is used to
test if all regressions run successfully it will return an error value
(2).

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

7 years agoarm, dev: Add missing override in the Pl390 GIC model
Andreas Sandberg [Wed, 15 Mar 2017 14:36:37 +0000 (14:36 +0000)]
arm, dev: Add missing override in the Pl390 GIC model

The Pl390::getAddrRanges() method should have been flagged using the
override keyword. Other methods in this class already use the override
keyword, so this results in a warning about inconsistent override
usage when compiling using clang.

Change-Id: I17449687a8e074262232562487b58c96466bd54e
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agodev, arm: Add draining to the GIC model
Andreas Sandberg [Wed, 17 Feb 2016 14:50:41 +0000 (08:50 -0600)]
dev, arm: Add draining to the GIC model

The GIC model currently adds a delay to interrupts when posting them
to a target CPU. This means that an interrupt signal will be
represented by an event for a short period of time. We currently
ignore this when draining and serialize the tick when the interrupt
will fire. Upon loading the checkpoint, the simulated GIC reschedules
the pending events. This behaviour is undesirable when we implement
support for switching between in-kernel GIC emulation and gem5 GIC
emulation. In that case, the (kernel) GIC model gets a lot simpler if
we don't need to worry about in-flight interrupts from the gem5 GIC.

This changeset adds a draining check to force the GIC into a state
where all interrupts have been delivered prior to checkpointing/CPU
switching. It also removes the now redundant serialization of
interrupt events.

Change-Id: I8b8b080aa291ca029a3a7bdd1777f1fcd5b01179
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2331
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoarm: Clean up the GIC implementation
Andreas Sandberg [Tue, 27 Sep 2016 13:16:50 +0000 (14:16 +0100)]
arm: Clean up the GIC implementation

Lots of minor cleaups:
  * Make cached params const
  * Don't serialize params
  * Use AddrRange to represent the distributor and CPU address spaces
  * Store a const AddrRangeList of all PIO ranges

Change-Id: I40a17bc3a38868fb3b8af247790e852cf99ddf1d
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2330
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agostyle: change NULL to nullptr in syscall files
Brandon Potter [Wed, 1 Mar 2017 21:15:51 +0000 (15:15 -0600)]
style: change NULL to nullptr in syscall files

Change-Id: I02719f3572f6665cace1eb5681f297dcde9e71ce
Reviewed-on: https://gem5-review.googlesource.com/2271
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agosyscall-emul: Ignore unimplemented system calls
Brandon Potter [Wed, 1 Mar 2017 21:11:50 +0000 (15:11 -0600)]
syscall-emul: Ignore unimplemented system calls

This changeset sets the implementation policy for a subset of
system calls to the ignoreFunc implementation (for x86 only).
The ignored system calls likely will never be implemented and
this allows a warning to be issued instead of the simulation
exiting with a fatal.

Change-Id: I8d9741ad683151e88cc71156d3602e2d0ccb0acf
Reviewed-on: https://gem5-review.googlesource.com/2270
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agosyscall-emul: Rewrite system call exit code
Brandon Potter [Wed, 1 Mar 2017 20:52:23 +0000 (14:52 -0600)]
syscall-emul: Rewrite system call exit code

The changeset does a major refactor on the exit, exit_group, and
futex system calls regarding exit functionality.

A FutexMap class and related structures are added into a new
file. This increases code clarity by encapsulating the futex
operations and the futex state into an object.

Several exit conditions were added to allow the simulator to end
processes under certain conditions. Also, the simulation only
exits now when all processes have finished executing.

Change-Id: I1ee244caa9b5586fe7375e5b9b50fd3959b9655e
Reviewed-on: https://gem5-review.googlesource.com/2269
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agosyscall-emul: Add the tgkill system call
Brandon Potter [Wed, 1 Mar 2017 20:34:11 +0000 (14:34 -0600)]
syscall-emul: Add the tgkill system call

This changeset adds support to kill a thread group by calling
the tgkill system call. The functionality is needed in some
pthread applications.

Change-Id: I0413a3331be69b74dfab30de95384113ec4efb63
Reviewed-on: https://gem5-review.googlesource.com/2268
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com>
7 years agosyscall-emul: Adds SE mode signal feature
Brandon Potter [Wed, 1 Mar 2017 20:29:00 +0000 (14:29 -0600)]
syscall-emul: Adds SE mode signal feature

This changeset adds a simple class definition and a member
in the System object to track signals sent between processes.
The implementation cannot support all signals that might be
sent between processes, but it can support some of the simple
use cases like SIGCHLD.

Change-Id: Id5f95aa60e7f49da1c5b5596fbfa26e729453ac7
Reviewed-on: https://gem5-review.googlesource.com/2267
Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agosyscall-emul: Add or extend dup, dup2, and pipe
Brandon Potter [Wed, 1 Mar 2017 19:35:02 +0000 (13:35 -0600)]
syscall-emul: Add or extend dup, dup2, and pipe

This changeset extends the pipe system call to work with
architectures other than Alpha (and enables the syscall for
x86). For the dup system call, it sets the clone-on-exec
flag by default. For the dup2 system call, the changeset
adds an implementation (and enables it for x86).

Change-Id: I00ddb416744ee7dd61a5cd02c4c3d97f30543878
Reviewed-on: https://gem5-review.googlesource.com/2266
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com>
7 years agosyscall-emul: Add functionality to open syscalls
Brandon Potter [Wed, 1 Mar 2017 19:24:16 +0000 (13:24 -0600)]
syscall-emul: Add functionality to open syscalls

This changeset adds refactors the existing open system call,
adds the openat variant (enabled for x86 builds), and adds
additional "special file" test cases for /proc/meminfo and
/etc/passwd.

Change-Id: I6f429db65bbf2a28ffa3fd12df518c2d0de49663
Reviewed-on: https://gem5-review.googlesource.com/2265
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com>
7 years agostyle: Correct some style issues
Brandon Potter [Wed, 1 Mar 2017 19:18:49 +0000 (13:18 -0600)]
style: Correct some style issues

This changeset fixes line alignment issues, spacing, spelling,
etc. for files that are used during SE Mode.

Change-Id: Ie61b8d0eb4ebb5af554d72f1297808027833616e
Reviewed-on: https://gem5-review.googlesource.com/2264
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
7 years agosyscall-emul: Move memState into its own file
Brandon Potter [Wed, 1 Mar 2017 19:07:43 +0000 (13:07 -0600)]
syscall-emul: Move memState into its own file

The Process class is full of implementation details and
structures related to SE Mode. This changeset factors out an
internal class from Process and moves it into a separate file.
The purpose behind doing this is to clean up the code and make
it a bit more modular.

Change-Id: Ic6941a1657751e8d51d5b6b1dcc04f1195884280
Reviewed-on: https://gem5-review.googlesource.com/2263
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 agomisc: add missing copyright/author information in previous commit
Pierre-Yves Péneau [Fri, 24 Feb 2017 08:45:21 +0000 (09:45 +0100)]
misc: add missing copyright/author information in previous commit

See a06a46f and a854373.

Change-Id: Id66427db22b7d7764c218b9cd78d95db929f4127
Signed-off-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
Reviewed-on: https://gem5-review.googlesource.com/2224
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agoruby: fix MOESI_hammer directory to work with > 3GB memory
Lena Olson [Sun, 5 Feb 2017 23:20:34 +0000 (17:20 -0600)]
ruby: fix MOESI_hammer directory to work with > 3GB memory

The MOESI_hammer directory assumes a contiguous address space, but X86
has an IO gap from 3-4GB. This patch allows the directory to work with
more than 3GB of memory on X86.

Assumptions: the physical address space (range of possible physical
addresses) is 0-XGB when X <= 3GB, and 0-(X+1)GB when X > 3GB. If there
is no IO gap this patch should still work.

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

7 years agoruby: fix and/or precedence in slicc
Lena Olson [Sun, 5 Feb 2017 20:47:37 +0000 (14:47 -0600)]
ruby: fix and/or precedence in slicc

The slicc compiler currently treats && and || with the same precedence.
This is highly non-intuitive to people used to C, and was probably an
error. This patch makes && bind tighter than ||.

For example, previously:
if (A || B && C)
compiled to:
if ((A || B) && C)
With this patch, it compiles to:
if (A || (B && C))

Change-Id: Idbbd5b50cc86a8d6601045adc14a253284d7b791
Signed-off-by: Lena Olson (leolson@google.com)
Reviewed-on: https://gem5-review.googlesource.com/2168
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Joe Gross <criusx@gmail.com>
Reviewed-by: Sooraj Puthoor <puthoorsooraj@gmail.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

Conflicts:
COPYING

7 years agomisc: Add a CONTRIBUTING document
Jason Lowe-Power [Thu, 9 Mar 2017 16:13:10 +0000 (10:13 -0600)]
misc: Add a CONTRIBUTING document

This document details how to contribute to gem5 based on our new
contribution flow with git and gerrit.

Change-Id: I0a7e15fd83a3ee3ab6c85c1192f46f1e1d33b7c2
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: http://reviews.gem5.org/r/3814/
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Pierre-Yves Peneau <pierre-yves.peneau@lirmm.fr>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Brad Beckmann <brad.beckmann@amd.com>
Reviewed-by: Ali Saidi <Ali.Saidi@ARM.com>
7 years agogpu-compute: Fix Python/C++ object hierarchy discrepancies
Andreas Sandberg [Mon, 27 Feb 2017 13:17:51 +0000 (13:17 +0000)]
gpu-compute: Fix Python/C++ object hierarchy discrepancies

The GPUCoalescer and the Shader classes have different base classes in
C++ and Python. This causes subtle bugs in SWIG and compilation errors
for PyBind.

Change-Id: I1ddd2a8ea43f083470538ddfea891347b21d14d8
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2228
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
Reviewed-by: Bradford Beckmann <brad.beckmann@amd.com>
7 years agopower: Avoid forward declarations that confuse wrappers
Andreas Sandberg [Mon, 27 Feb 2017 13:17:51 +0000 (13:17 +0000)]
power: Avoid forward declarations that confuse wrappers

The Python wrappers get confused by the forward declarations in the
power framework. This changeset restructures the code slightly to
avoid the troublesome forward declarations.

Change-Id: Id8c93224f1988edb5fdf9d3abc6237f2f688c02d
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-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2227
Reviewed-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agodev, arm: Render HDLCD frames at a fixed rate in KVM
Sudhanshu Jha [Wed, 1 Mar 2017 17:38:51 +0000 (17:38 +0000)]
dev, arm: Render HDLCD frames at a fixed rate in KVM

Use the new fast scan-out API in the PixelPump to render frames at a
fixed frame rate in KVM mode. The refresh rate when running in KVM can
be controlled by the virt_refresh_rate parameter.

Change-Id: Ib3c78f174e3f8f4ca8a9b723c4e5d311a433b8aa
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2242
Reviewed-by: Rahul Thakur <rjthakur@google.com>
7 years agodev: Add support for single-pass scan out in the PixelPump
Sudhanshu Jha [Fri, 24 Feb 2017 13:34:22 +0000 (13:34 +0000)]
dev: Add support for single-pass scan out in the PixelPump

Add a helper function to scan out an entire frame in one time
step. This requires the public PixelPump to be changed somewhat to
separate timing updates from general PixelPump control. Instead of
calling PixelPump::start(timings), timings now need to be updated
using a separate call to PixelPump::updateTimings(timings) before
calling PixelPump::start().

Display controllers that don't need accurate timing (e.g., in KVM
mode), can use the new PixelPump::renderFrame() API to render an
entire frame in one step. This call results in the same callbacks
(e.g., calls to nextPixel()) as the timing calls, but they all happen
in immediately. Unlike the timing counterpart, renderFrame() doesn't
support buffer underruns and will panic if nextPixle() indicates an
underrun.

Change-Id: I76c84db04249b02d4207c5281d82aa693d0881be
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2241
Reviewed-by: Rahul Thakur <rjthakur@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agodev, kvm: Add a fast KVM-aware mode in DmaReadFifo
Sudhanshu Jha [Mon, 27 Feb 2017 10:29:56 +0000 (10:29 +0000)]
dev, kvm: Add a fast KVM-aware mode in DmaReadFifo

Use a fast, functional, read operations keep the DMA FIFO full when
running in KVM mode.

Change-Id: I5b378c2fb6a1d3e687cef15e807e63a0a53a60e2
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2226
Reviewed-by: Rahul Thakur <rjthakur@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agoarm, kmi: Clear interrupts in KMI devices
Sudhanshu Jha [Mon, 27 Feb 2017 10:29:56 +0000 (10:29 +0000)]
arm, kmi: Clear interrupts in KMI devices

Added functionality to check and clear interrupts for KMI
devices. This fixes a boot bug when using KVM and in-kernel GIC
emulation.

Change-Id: Ia3e91d07567b7faf3f82b0adfda4a165a502a339
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2225
Reviewed-by: Rahul Thakur <rjthakur@google.com>
7 years agosyscall-emul: Remove unused class and member
Brandon Potter [Wed, 1 Mar 2017 17:10:28 +0000 (11:10 -0600)]
syscall-emul: Remove unused class and member

The WaitRec structure in the Process class is unnecessary. There
is a member declaration inside of the Process class, waitList,
that uses the WaitRec definition. However, waitList is unused so
they are both dead bits of code. This changeset removes both the
WaitRec struct and waitList member from Process.

Change-Id: Ia6ee7488b9f47fd0f0ae29c818fba6ea0710699c
Reviewed-on: https://gem5-review.googlesource.com/2262
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

7 years agomem: Make blkAlign a common function between all tag classes
Nikos Nikoleris [Mon, 31 Oct 2016 12:02:24 +0000 (12:02 +0000)]
mem: Make blkAlign a common function between all tag classes

blkAlign was defined as a separate function in the base associative
and fully-associative tags classes although both functions implemented
identical functionality. This patch moves the blkAlign in the base
tags class.

Change-Id: I3d415d0e62bddeec7ce0d559667e40a8c5fdc2d4
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
7 years agomem: Use pkt::getBlockAddr instead of BaseCace::blockAlign
Nikos Nikoleris [Wed, 26 Oct 2016 10:07:27 +0000 (11:07 +0100)]
mem: Use pkt::getBlockAddr instead of BaseCace::blockAlign

Change-Id: I0ed4e528cb750a323facdc811dde7f0ed1ff228e
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
7 years agoarm, kvm: enable running 32-bit Guest under ARM KVM64
Rahul Thakur [Wed, 1 Mar 2017 18:27:05 +0000 (10:27 -0800)]
arm, kvm: enable running 32-bit Guest under ARM KVM64

1) Pass KVM_ARM_VCPU_EL1_32BIT to kvmArmVCpuInit
   when running 32-bit OS

2) Correctly map 64-bit registers to banked 32-bit ones

Change-Id: I1dec6427d6f5c3bba599ccdd804f1dfe80d3e670
Reviewed-on: https://gem5-review.googlesource.com/2261
Maintainer: Rahul Thakur <rjthakur@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm, kvm: fix saving/restoring conditional flags in ARM KVM64
Rahul Thakur [Wed, 1 Mar 2017 18:15:57 +0000 (10:15 -0800)]
arm, kvm: fix saving/restoring conditional flags in ARM KVM64

The gem5 stores flags separately from other fields CPSR, so we need to
split them out and recombine on trips to/from KVM.

Change-Id: I28ed00eb6f0e2a1436adfbc51b6ccf056958afeb
Reviewed-on: https://gem5-review.googlesource.com/2260
Reviewed-by: Rahul Thakur <rjthakur@google.com>
Maintainer: Rahul Thakur <rjthakur@google.com>

7 years agoconfig: exit with fatal() if error
Pierre-Yves Péneau [Thu, 23 Feb 2017 09:12:05 +0000 (10:12 +0100)]
config: exit with fatal() if error

If output redirection is activated, the error message is printed in
simout. This change ensure it will be printed in simerr.

Change-Id: Ie661ac6b6978bf2e4aaaccdf23134795d764d459
Signed-off-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
Reviewed-on: https://gem5-review.googlesource.com/2221
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 agoruby: fix and/or precedence in slicc
Lena Olson [Sun, 5 Feb 2017 20:47:37 +0000 (14:47 -0600)]
ruby: fix and/or precedence in slicc

The slicc compiler currently treats && and || with the same precedence.
This is highly non-intuitive to people used to C, and was probably an
error. This patch makes && bind tighter than ||.

For example, previously:
if (A || B && C)
compiled to:
if ((A || B) && C)
With this patch, it compiles to:
if (A || (B && C))

Change-Id: Idbbd5b50cc86a8d6601045adc14a253284d7b791
Signed-off-by: Lena Olson (leolson@google.com)
Reviewed-on: https://gem5-review.googlesource.com/2168
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Joe Gross <criusx@gmail.com>
Reviewed-by: Sooraj Puthoor <puthoorsooraj@gmail.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
[ Rebased onto master ]
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoscons: Automatically add a git commit message hook
Andreas Sandberg [Sun, 5 Feb 2017 05:00:38 +0000 (05:00 +0000)]
scons: Automatically add a git commit message hook

Gerrit requires that all commit messages have a Change-Id tag. This
tag is added automatically by a commit message hook in Git. Include
the default Gerrit commit message hook and add it automatically using
scons to make life easier for everyone.

Change-Id: I1270fbaaadf6ed151bddf14521a38e0c1a02d131
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2166
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

7 years agosyscall_emul: [PATCH 15/22] add clone/execve for threading and multiprocess simulations
Brandon Potter [Mon, 27 Feb 2017 19:10:15 +0000 (14:10 -0500)]
syscall_emul: [PATCH 15/22] add clone/execve for threading and multiprocess simulations

Modifies the clone system call and adds execve system call. Requires allowing
processes to steal thread contexts from other processes in the same system
object and the ability to detach pieces of process state (such as MemState)
to allow dynamic sharing.

7 years agosyscall_emul: [patch 14/22] adds identifier system calls
Brandon Potter [Mon, 27 Feb 2017 19:10:02 +0000 (14:10 -0500)]
syscall_emul: [patch 14/22] adds identifier system calls

This changeset add fields to the process object and adds the following
three system calls: setpgid, gettid, getpid.

7 years agox86: remove unnecessary parameter from functions
Brandon Potter [Mon, 27 Feb 2017 19:09:30 +0000 (14:09 -0500)]
x86: remove unnecessary parameter from functions

7 years agogpu-compute: remove unnecessary member from class
Tony Gutierrez [Mon, 27 Feb 2017 18:18:51 +0000 (13:18 -0500)]
gpu-compute: remove unnecessary member from class

The clang compiler complains that the wavefront member in
the GpuISA class is unused. This changeset removes the member,
because it does not appear serve a purpose.

7 years agogpu-compute: mark functions with override if replacing virtual
Brandon Potter [Mon, 27 Feb 2017 18:18:38 +0000 (13:18 -0500)]
gpu-compute: mark functions with override if replacing virtual

The clang compiler is more stringent than the recent versions of
GCC when dealing with overrides. This changeset adds the specifier
to the methods which need it to silence the compiler.

7 years agoarch: Include generated decoder header after normal headers
Andreas Sandberg [Mon, 27 Feb 2017 12:06:00 +0000 (12:06 +0000)]
arch: Include generated decoder header after normal headers

The generated decoder header defines macros that represent bit fields
within instructions. These fields typically have short names that
conflict with names in other header files. Include the generated
header after all normal header to avoid this issue.

Change-Id: I53d149b75432c20abdbf651e32c3c785d897973b
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agobase: Refactor logging to make log level selection cleaner
Andreas Sandberg [Mon, 27 Feb 2017 11:25:01 +0000 (11:25 +0000)]
base: Refactor logging to make log level selection cleaner

It's currently possible to change the log level in gem5 by tweaking a
set of global variables. These variables are currently exposed to
Python using SWIG. This mechanism is far from ideal for two reasons:
First, changing the log level requires that the Python world enables
or disables individual levels. Ideally, this should be a single call
where a log level is selected. Second, exporting global variables is
poorly supported by most Python frameworks. SWIG puts variables in
their own namespace and PyBind doesn't seem to support it at all.

This changeset refactors the logging code to create a more abstract
interface. Each log level is associated with an instance of a Logger
class. This class contains common functionality, an enable flag, and a
verbose flag.

Available LogLevels are described by the LogLevel class. Lower log
levels are used for more critical messages (PANIC being level 0) and
higher levels for less critical messages. The highest log level that
is printed is controlled by calling Logger:setLevel().

Change-Id: I31e44299d242d953197a8e62679250c91d6ef776
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: Jason Lowe-Power <jason@lowepower.com>
7 years agotests: Disable descriptions in stat files
Andreas Sandberg [Mon, 27 Feb 2017 11:25:00 +0000 (11:25 +0000)]
tests: Disable descriptions in stat files

Don't output verbose text descriptions in stat files when running
tests. This saves a lot of space when storing reference data.

Change-Id: I2a7ead4843586e800ecf83846694b73f0c356373
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-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
7 years agopython: Add a generalized mechanism to configure stats
Andreas Sandberg [Mon, 27 Feb 2017 11:24:59 +0000 (11:24 +0000)]
python: Add a generalized mechanism to configure stats

Add a mechanism to configure the stat output format using a URL-like
syntax. This makes it possible to specify both an output format
(currently, only text is supported) and override default
parameters.

On the Python-side, this is implemented using a helper function
(m5.stats.addStatVisitor) that adds a visitor to the list of active
stat visitors. The helper function parses a URL-like stat
specification to determine the stat output type. Optional parameters
can be specified to change how stat visitors behave.

For example, to output stats in text format without stat descriptions:

    m5.stats.addStatVisitor("text://stats.txt?desc=False")

From the command line:

    gem5.opt --stats-file="text://stats.txt?desc=False"

Internally, the stat framework uses the _url_factory decorator
to wrap a Python function with the fn(path, **kwargs) signature in a
function that takes a parsed URL as its only argument. The path and
keyword arguments are automatically derived from the URL in the
wrapper function.

New output formats can be registered in the m5.stats.factories
dictionary. This dictionary contains a mapping between format names
(URL schemes) and factory methods.

To retain backwards compatibility, the code automatically assumes that
the user wants text output if no format has been specified (i.e., when
specifying a plain path).

Change-Id: Ic4dce93ab4ead07ffdf71e55a22ba0ae5a143061
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: Ilias Vougioukas <ilias.vougioukas@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
8 years agosyscall_emul: [patch 13/22] add system call retry capability
Brandon Potter [Mon, 20 Jul 2015 14:15:21 +0000 (09:15 -0500)]
syscall_emul: [patch 13/22] add system call retry capability

This changeset adds functionality that allows system calls to retry without
affecting thread context state such as the program counter or register values
for the associated thread context (when system calls return with a retry
fault).

This functionality is needed to solve problems with blocking system calls
in multi-process or multi-threaded simulations where information is passed
between processes/threads. Blocking system calls can cause deadlock because
the simulator itself is single threaded. There is only a single thread
servicing the event queue which can cause deadlock if the thread hits a
blocking system call instruction.

To illustrate the problem, consider two processes using the producer/consumer
sharing model. The processes can use file descriptors and the read and write
calls to pass information to one another. If the consumer calls the blocking
read system call before the producer has produced anything, the call will
block the event queue (while executing the system call instruction) and
deadlock the simulation.

The solution implemented in this changeset is to recognize that the system
calls will block and then generate a special retry fault. The fault will
be sent back up through the function call chain until it is exposed to the
cpu model's pipeline where the fault becomes visible. The fault will trigger
the cpu model to replay the instruction at a future tick where the call has
a chance to succeed without actually going into a blocking state.

In subsequent patches, we recognize that a syscall will block by calling a
non-blocking poll (from inside the system call implementation) and checking
for events. When events show up during the poll, it signifies that the call
would not have blocked and the syscall is allowed to proceed (calling an
underlying host system call if necessary). If no events are returned from the
poll, we generate the fault and try the instruction for the thread context
at a distant tick. Note that retrying every tick is not efficient.

As an aside, the simulator has some multi-threading support for the event
queue, but it is not used by default and needs work. Even if the event queue
was completely multi-threaded, meaning that there is a hardware thread on
the host servicing a single simulator thread contexts with a 1:1 mapping
between them, it's still possible to run into deadlock due to the event queue
barriers on quantum boundaries. The solution of replaying at a later tick
is the simplest solution and solves the problem generally.

8 years agostyle: [patch 12/22] fix preliminary style issues for subsequent fault patch
Brandon Potter [Mon, 20 Jul 2015 14:15:21 +0000 (09:15 -0500)]
style: [patch 12/22] fix preliminary style issues for subsequent fault patch

This changeset add spaces in a few spots and removes an unnecessary comment.

8 years agosyscall_emul: [patch 11/22] extend functionality of fcntl
Brandon Potter [Mon, 20 Jul 2015 14:15:21 +0000 (09:15 -0500)]
syscall_emul: [patch 11/22] extend functionality of fcntl

This changeset adds the ability to set a close-on-exec flag for a given
file descriptor. It also reworks some of the logic surrounding setting and
retrieving flags from the file description.

7 years agox86: remove redundant condition check in tlb code
Brandon Potter [Thu, 23 Feb 2017 18:27:48 +0000 (13:27 -0500)]
x86: remove redundant condition check in tlb code

7 years agobase: fix small memory leak in the ELF loader
Brandon Potter [Thu, 23 Feb 2017 18:27:38 +0000 (13:27 -0500)]
base: fix small memory leak in the ELF loader

7 years agomem: Remove unused size field from the CacheBlk class
Nikos Nikoleris [Tue, 21 Feb 2017 14:14:45 +0000 (14:14 +0000)]
mem: Remove unused size field from the CacheBlk class

Change-Id: I6149290d6d2ac1a4bd6165871c93d7b7d6a980ad
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agomem: Remove the unused asid field from the CacheBlk class
Nikos Nikoleris [Tue, 21 Feb 2017 14:14:45 +0000 (14:14 +0000)]
mem: Remove the unused asid field from the CacheBlk class

Change-Id: I29f45733c5fad822bdd0d8dcc7939d86b2e8c97b
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agomem: Remove unused arguments (asid/contex_id) from accessBlock
Nikos Nikoleris [Tue, 21 Feb 2017 14:14:44 +0000 (14:14 +0000)]
mem: Remove unused arguments (asid/contex_id) from accessBlock

Change-Id: I79c2662fc81630ab321db8a75be6cd15fa07d372
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agomem: Remove unused type BlkList from the cache and the tags
Nikos Nikoleris [Tue, 21 Feb 2017 14:14:44 +0000 (14:14 +0000)]
mem: Remove unused type BlkList from the cache and the tags

Change-Id: If9ebb8488e8db587482ecfa99d2c12cfe5734fb9
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agomem: Remove unused functions from the tag classes
Nikos Nikoleris [Tue, 21 Feb 2017 14:14:44 +0000 (14:14 +0000)]
mem: Remove unused functions from the tag classes

Change-Id: I4f3c2c027b1acaaf791a4c71086f34a9b9fbf4df
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agomem: Always use the helper function to invalidate a block
Nikos Nikoleris [Tue, 21 Feb 2017 14:14:44 +0000 (14:14 +0000)]
mem: Always use the helper function to invalidate a block

Policies like the LRU need to be notified when a block is invalidated,
the helper function does this along with invalidating the block.

Change-Id: I3ed59cf07938caa7f394ee6054b0af9e00b267ea
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agomem: Fix MSHR assert triggering for invalidated prefetches
Sascha Bischoff [Tue, 21 Feb 2017 14:14:44 +0000 (14:14 +0000)]
mem: Fix MSHR assert triggering for invalidated prefetches

This changeset updates an assert in src/mem/cache/mshr.cc which was
erroneously catching invalidated prefetch requests. These requests can
become invalidated if another component writes (an exclusive access)
to this location during the time that the read request is in
flight. The original assert made the assumption that these cases can
only occur for reads generated by the CPU, and hence
prefetcher-generated requests would sometimes trip the assert.

Change-Id: If4f043273a688c2bab8f7a641192a2b583e7b20e
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agomem: Populate the secure flag in the writeback visitor
Nikos Nikoleris [Tue, 21 Feb 2017 14:14:44 +0000 (14:14 +0000)]
mem: Populate the secure flag in the writeback visitor

Previously the writeback visitor would not consider and set the secure
flag for the blocks that are written back to memory. This patch fixes
this.

Change-Id: Ie1a425fa9211407a70a4343f2c6b3d073371378f
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agomisc: Add dtb files to the ignore list for git and mercurial
Nikos Nikoleris [Tue, 21 Feb 2017 14:14:44 +0000 (14:14 +0000)]
misc: Add dtb files to the ignore list for git and mercurial

Change-Id: Ifb135c60e050c55769914e853b07a387c06e4007
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agomem: Remove stale argument from a panic statement
Nikos Nikoleris [Tue, 21 Feb 2017 14:14:44 +0000 (14:14 +0000)]
mem: Remove stale argument from a panic statement

Change-Id: I7ae5fa44a937f641a2ddd242a49e0cd23f68b9f2
Reviewed-by: Sudhanshu Jha <sudhanshu.jha@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm: Fix DPRINTFs with arguments in the instruction declarations
Nikos Nikoleris [Tue, 21 Feb 2017 14:14:44 +0000 (14:14 +0000)]
arm: Fix DPRINTFs with arguments in the instruction declarations

Change-Id: I0e373536897aa5bb4501b00945c2a0836100ddf4
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm: Blame the right instruction address on a Prefetch Abort
Nikos Nikoleris [Tue, 21 Feb 2017 14:14:44 +0000 (14:14 +0000)]
arm: Blame the right instruction address on a Prefetch Abort

CPU models (e.g., O3CPU) issue instruction fetches for the whole cache
block rather than a specific instruction. Consequently the TLB lookups
translate the cache block virtual address. When the TLB lookup fails,
however, the Prefetch Abort must be raised for the PC of the
instruction that caused the fault rather than for the address of the
block.

This change fixes the way we instantiate the PrefetchAbort faults to
use the PC of the request rather the address of the instruction fetch
request.

Change-Id: I8e45549da1c3be55ad204a060029c95ce822a851
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Rekai Gonzalez Alberquilla <rekai.gonzalezalberquilla@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agostats: Get all stats updated to reflect current behaviour
Andreas Hansson [Sun, 19 Feb 2017 10:30:32 +0000 (05:30 -0500)]
stats: Get all stats updated to reflect current behaviour

Line everything up again.

7 years agosim: Ensure draining is deterministic
Andreas Hansson [Sun, 19 Feb 2017 10:30:31 +0000 (05:30 -0500)]
sim: Ensure draining is deterministic

The traversal of drainable objects could potentially be
non-deterministic when using an unordered set containing object
pointers. To ensure that the iteration is deterministic, we switch to
a vector. Note that the lookup and traversal of the drainable objects
is not performance critical, so the change has no negative consequences.

7 years agomem: Ensure deferred snoops are cache-line aligned
Andreas Hansson [Sun, 19 Feb 2017 10:30:31 +0000 (05:30 -0500)]
mem: Ensure deferred snoops are cache-line aligned

This patch fixes a bug where a deferred snoop ended up being to a
partial cache line, and not cache-line aligned, all due to how we copy
the packet.

7 years agomem: Fix memory footprint includes
Andreas Hansson [Sun, 19 Feb 2017 10:30:31 +0000 (05:30 -0500)]
mem: Fix memory footprint includes

Fix compilation errors due to missing include.

7 years agosyscall_emul: [patch 10/22] refactor fdentry and add fdarray class
Brandon Potter [Wed, 9 Nov 2016 20:27:42 +0000 (14:27 -0600)]
syscall_emul: [patch 10/22] refactor fdentry and add fdarray class

Several large changes happen in this patch.

The FDEntry class is rewritten so that file descriptors now correspond to
types: 'File' which is normal file-backed file with the file open on the
host machine, 'Pipe' which is a pipe that has been opened on the host machine,
and 'Device' which does not have an open file on the host yet acts as a pseudo
device with which to issue ioctls. Other types which might be added in the
future are directory entries and sockets (off the top of my head).

The FDArray class was create to hold most of the file descriptor handling
that was stuffed into the Process class. It uses shared pointers and
the std::array type to hold the FDEntries mentioned above.

The changes to these two classes needed to be propagated out to the rest
of the code so there were quite a few changes for that. Also, comments were
added where I thought they were needed to help others and extend our
DOxygen coverage.

7 years agosyscall_emul: [patch 9/22] remove unused global variable (num_processes)
Brandon Potter [Wed, 9 Nov 2016 20:27:42 +0000 (14:27 -0600)]
syscall_emul: [patch 9/22] remove unused global variable (num_processes)

7 years agosyscall_emul: [patch 8/22] refactor process class
Brandon Potter [Wed, 9 Nov 2016 20:27:41 +0000 (14:27 -0600)]
syscall_emul: [patch 8/22] refactor process class

Moves aux_vector into its own .hh and .cc files just to get it out of the
already crowded Process files. Arguably, it could stay there, but it's
probably better just to move it and give it files.

The changeset looks ugly around the Process header file, but the goal here is
to move methods and members around so that they're not defined randomly
throughout the entire header file. I expect this is likely one of the reasons
why I several unused variables related to this class. So, the methods are
declared first followed by members. I've tried to aggregate them together
so that similar entries reside near one another.

There are other changes coming to this code so this is by no means the
final product.

7 years agosyscall_emul: [patch 7/22] remove numCpus method
Brandon Potter [Wed, 9 Nov 2016 20:27:41 +0000 (14:27 -0600)]
syscall_emul: [patch 7/22] remove numCpus method

The numCpus method is misleading in that it's not really a measure of
how many CPUs might be executing a process, but how many thread contexts
are assigned to the process at any given point in time.

It's nice to highlight this distinction because thread contexts are never
reused in the same way that a CPU can be reused for multiple processes.
The reason that there is no reuse is that there is no CPU scheduler for SE.

The tru64 code intends to use this method and the accompanying contextIDs
field to support SMT and track the number of threads with some system calls.
With the up coming clone and exec patches, this paradigm must change. There
needs to be a 1:1 mapping between the thread contexts and processes so that
the process state between threads is allowed to vary when needed by Linux.
This should not break SMT for tru64 if the Process class is refactored so that
multiple Processes can share state between themselves. The following patches
will do the refactoring incrementally as features are added.

7 years agosyscall_emul: [patch 6/22] remove unused fields from Process class
Brandon Potter [Wed, 9 Nov 2016 20:27:41 +0000 (14:27 -0600)]
syscall_emul: [patch 6/22] remove unused fields from Process class

It looks like tru64 has some nxm* system calls, but the two fields that
are defined in the Process class are unused by any of the code. There doesn't
appear to be any reference in the tru64 code.

7 years agosyscall_emul: [patch 5/22] remove LiveProcess class and use Process instead
Brandon Potter [Wed, 9 Nov 2016 20:27:40 +0000 (14:27 -0600)]
syscall_emul: [patch 5/22] remove LiveProcess class and use Process instead

The EIOProcess class was removed recently and it was the only other class
which derived from Process. Since every Process invocation is also a
LiveProcess invocation, it makes sense to simplify the organization by
combining the fields from LiveProcess into Process.

7 years agosparc: fix bugs caused by cd7f3a1dbf55
Brandon Potter [Fri, 17 Feb 2017 17:01:51 +0000 (12:01 -0500)]
sparc: fix bugs caused by cd7f3a1dbf55

Turns out that SPARC SE mode relied on M5_pid being "0" in
all cases. The entries in the SPARC TLBs are accessed with
M5_pid as their context. This is buggy in the sense that it
will never work with more than one process or any
initialization that doesn't have the M5_pid value passed in
as "0".

cd7f3a1dbf55 broke the SPARC build because it deletes M5_pid
and uses a _pid with a default of "100" instead. This caused
the SPARC TLB to never return any valid lookups for any
request; the program never moved past the first instruction
with SPARC SE in the regression tester.

The solution proposed in this changeset is to initialize
the address space identification register with the PID value
that is passed into the process class as a parameter from
Python. This should return the correct responses from the TLB
since the insertions and lookups into the page table will be
using the same PID.

Furthermore, there are corner cases in the code which elevate
privileges and revert to using context "0" as the context in
the TLB. I believe that these are related to kernel level
traps and hypervisor privilege escalations, but I'm not
completely sure. I've tried to address the corner cases
properly, but it would be beneficial to have someone who is
familiar with the SPARC architecture to take a look at this
fix.

7 years agosim: fix out-of-bounds error in syscall_desc
Brandon Potter [Fri, 17 Feb 2017 17:01:50 +0000 (12:01 -0500)]
sim: fix out-of-bounds error in syscall_desc

7 years agomem, stats: fix typos in CommMonitor and Stats
Pierre-Yves Péneau [Wed, 15 Feb 2017 20:59:06 +0000 (14:59 -0600)]
mem, stats: fix typos in CommMonitor and Stats

Signed-off-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed at http://reviews.gem5.org/r/3802/

7 years agomem, misc: fix building issue with CommMonitor (unused variables)
Pierre-Yves Péneau [Wed, 15 Feb 2017 20:56:54 +0000 (14:56 -0600)]
mem, misc: fix building issue with CommMonitor (unused variables)

Signed-off-by: Pierre-Yves Péneau <pierre-yves.peneau@lirmm.fr>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed at http://reviews.gem5.org/r/3801/

7 years agomem: fix assertion in respondEvent
Wendy Elsasser [Wed, 15 Feb 2017 15:28:44 +0000 (09:28 -0600)]
mem: fix assertion in respondEvent

Assertion in the respondEvent erroneously fired.
The assertion verifies that the controller has not moved to a low-power
state prior to receiving read data from the memory.
The original assertion triggered if the state was not:
PWR_IDLE or PWR_ACT.

In the case that failed, a periodic refresh event occurred around the
read.  The REF is stalled until the final read burst is issued
and the subsequent PRE closes the bank.  While the PRE will temporarily
move the state to PWR_IDLE, state will immediately transition to PWR_REF
due to the pending refresh operation.  This state does not match the
assertion, which is subsequently triggered.

Fixed the assertion by explicitly checking that the state is not a low
power state
!PWR_SREF && !PWR_PRE_PDN && !PWR_ACT_PDN

Change-Id: I82921a733bbeac2bcb5a487c2f981448d41ed50b
Reviewed-by: Radhika Jagtap <radhika.jagtap@arm.com>
7 years agoarm,config: Add dist-gem5 support to the big.LITTLE(tm) config
Gabor Dozsa [Tue, 14 Feb 2017 21:36:15 +0000 (15:36 -0600)]
arm,config: Add dist-gem5 support to the big.LITTLE(tm) config

This patch extends the example big.LITTLE configuration to enable
dist-gem5 simulations of big.LITTLE systems.

Change-Id: I49c095ab3c737b6a082f7c6f15f514c269217756
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoconfig: Refactor the network switch configuration file
Gabor Dozsa [Tue, 14 Feb 2017 21:09:18 +0000 (15:09 -0600)]
config: Refactor the network switch configuration file

This patch prevents the body of the script getting executed when
the script is imported as a module.

Change-Id: I70a50f6295f1e7a088398017f5fa9d06fe90476a
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm,config: Refactor the example big.LITTLE(tm) configuration
Gabor Dozsa [Tue, 14 Feb 2017 21:09:18 +0000 (15:09 -0600)]
arm,config: Refactor the example big.LITTLE(tm) configuration

This patch prepares future extensions and customisation of the example
big.LITTLE configuration script. It breaks out the major phases into
functions so they can be called from other python scripts.

Change-Id: I2cb7c207c410fe14602cf17af7482719abba6c24
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm, kvm: remove KvmGic
Curtis Dunham [Tue, 14 Feb 2017 21:09:18 +0000 (15:09 -0600)]
arm, kvm: remove KvmGic

KvmGic functionality has been subsumed within the new MuxingKvmGic
model, which has Pl390 fallback when not using KVM for fast emulation.
This simplifies configuration and will enable checkpointing between
KVM emulation and full-system simulation.

Change-Id: Ie61251720064c512843015c075e4ac419a4081e8
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm, kvm: Automatically use the MuxingKvmGic
Andreas Sandberg [Tue, 14 Feb 2017 21:09:18 +0000 (15:09 -0600)]
arm, kvm: Automatically use the MuxingKvmGic

Automatically use the MuxingKvmGic in the VExpress_GEM5_V1
platform. This removes the need to patch the host kernel or the
platform configuration when using KVM on ARM.

Change-Id: Ib1ed9b3b849b80c449ef1b62b83748f3f54ada26
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
7 years agoarm, kvm: implement MuxingKvmGic
Curtis Dunham [Tue, 14 Feb 2017 21:09:18 +0000 (15:09 -0600)]
arm, kvm: implement MuxingKvmGic

This device allows us to, when KVM support is detected and compiled in,
instantiate the same Gic device whether the actual simulation is with
KVM cores or simulated cores.  Checkpointing is not yet supported.

Change-Id: I67e4e0b6fb7ab5058e52c933f4f3d8e7ab24981e
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agosim, kvm: make KvmVM a System parameter
Curtis Dunham [Tue, 14 Feb 2017 21:09:18 +0000 (15:09 -0600)]
sim, kvm: make KvmVM a System parameter

A KVM VM is typically a child of the System object already, but for
solving future issues with configuration graph resolution, the most
logical way to keep track of this object is for it to be an actual
parameter of the System object.

Change-Id: I965ded22203ff8667db9ca02de0042ff1c772220
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agosim,kvm,arm: fix typos
Curtis Dunham [Tue, 14 Feb 2017 21:09:18 +0000 (15:09 -0600)]
sim,kvm,arm: fix typos

Change-Id: Ifc65d42eebfd109c1c622c82c3c3b3e523819e85
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agomem: Update DRAM configuration names
Wendy Elsasser [Tue, 14 Feb 2017 21:09:18 +0000 (15:09 -0600)]
mem: Update DRAM configuration names

Names of DRAM configurations were updated to reflect both
the channel and device data width.

Previous naming format was:
<DEVICE_TYPE>_<DATA_RATE>_<CHANNEL_WIDTH>

The following nomenclature is now used:
<DEVICE_TYPE>_<DATA_RATE>_<n>x<w>
where n = The number of devices per rank on the channel
      x = Device width

Total channel width can be calculated by n*w

Example:
A 64-bit DDR4, 2400 channel consisting of 4-bit devices:
n = 16
w = 4
The resulting configuration name is:
DDR4_2400_16x4

Updated scripts to match new naming convention.

Added unique configurations for DDR4 for:
1) 16x4
2) 8x8
3) 4x16

Change-Id: Ibd7f763b7248835c624309143cb9fc29d56a69d1
Reviewed-by: Radhika Jagtap <radhika.jagtap@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
7 years agotests: check for gem5 binary before tests
Curtis Dunham [Tue, 14 Feb 2017 21:09:18 +0000 (15:09 -0600)]
tests: check for gem5 binary before tests

Provides a helpful error when tests.py is invoked without the gem5 binary.

Before:
Running 0 tests

After:
gem5 binary 'quick/...' not an executable file

Change-Id: I1566802206c9e21ca89bd03e91db22844168a085
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agosim: allow forward dependencies in checkpoint upgraders
Curtis Dunham [Tue, 14 Feb 2017 21:09:18 +0000 (15:09 -0600)]
sim: allow forward dependencies in checkpoint upgraders

The notion of forward dependencies is just expressing the same
dependency but at the other end of the dependency edge, i.e. at
the dependee rather than the depender.  As there is no more
'power' here, it's strictly a convenience feature for handling
dependencies with tags that are not in the upstream repository.

Change-Id: Ic7c68de6aff4094aaa12de62cdf690a5dc65ccb5
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agosim: add support for checkpoint downgrading
Curtis Dunham [Tue, 14 Feb 2017 21:09:18 +0000 (15:09 -0600)]
sim: add support for checkpoint downgrading

This commit supports the use case of transitioning tags and their
associated checkpoint rewrites out of use for whatever reason.  Just
replace the upgrader() method with a downgrader() method that performs
the appropriate inverse operation.

The tag name is still used, but only in this negative, 'zombie' state,
as it will be removed from the tags in the checkpoint and gem5 binary.

Change-Id: If9d26cccfe8449e026762b1a72f0c2ae5a9cf2d7
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoriscv: Remove ECALL tests from insttest
Alec Roelke [Mon, 13 Feb 2017 20:26:05 +0000 (14:26 -0600)]
riscv: Remove ECALL tests from insttest

The system calls tested in rv64i.cpp in RISC-V's insttest suite have
different behavior depending on the operating system and file system they
are run on. This patch ignores the output of those tests and only
ensures that the instructions in RV64I complete successfully.

[Change deletion of ECALL test to block comment.]
[Restore ECALL test but remove test output to test only for completion
without error.]
[Update patch description and again try to push EMPTY files for rv64i
tests.]

7 years agomisc: Clean up and complete the gem5<->SystemC-TLM bridge [6/10]
Christian Menard [Mon, 13 Feb 2017 20:25:16 +0000 (14:25 -0600)]
misc: Clean up and complete the gem5<->SystemC-TLM bridge [6/10]

The current TLM bridge only provides a Slave Port that allows the gem5
world to send request to the SystemC world. This patch series refractors
and cleans up the existing code, and adds a Master Port that allows the
SystemC world to send requests to the gem5 world.

This patch:
 * Update the README

7 years agoruby: fix round robin arbiter in garnet2.0
Tushar Krishna [Sun, 12 Feb 2017 20:00:03 +0000 (15:00 -0500)]
ruby: fix round robin arbiter in garnet2.0
The rr arbiter pointer in garnet was getting updated on every request,
even if there is no grant. This was leading to a huge variance in wait
time at a router at high injection rates.
This patch corrects it to update upon a grant.

7 years agomem: fix printing of 1st cache tags line
Bjoern A. Zeeb [Sat, 11 Feb 2017 16:11:48 +0000 (11:11 -0500)]
mem: fix printing of 1st cache tags line

Rather than having the 1st line on the Log line and every other line on its
own, add a new line to have a common format for all of them.  Makes parsing
a lot easier.

Reviewed at http://reviews.gem5.org/r/3808/

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
7 years agox86: Fix implicit stack addressing in 64-bit mode
Jason Lowe-Power [Fri, 10 Feb 2017 16:19:34 +0000 (11:19 -0500)]
x86: Fix implicit stack addressing in 64-bit mode

When in 64-bit mode, if the stack is accessed implicitly by an instruction
the alternate address prefix should be ignored if present.

This patch adds an extra flag to the ldstop which signifies when the
address override should be ignored. Then, for all of the affected
instructions, this patch adds two options to the ld and st opcode to use
the current stack addressing mode for all addresses and to ignore the
AddressSizeFlagBit.  Finally, this patch updates the x86 TLB to not
truncate the address if it is in 64-bit mode and the IgnoreAddrSizeFlagBit
is set.

This fixes a problem when calling __libc_start_main with a binary that is
linked with a recent version of ld. This version of ld uses the address
override prefix (0x67) on the call instruction instead of a nop.

Note: This has not been tested in compatibility mode and only the call
instruction with the address override prefix has been tested.

See [1] page 9 (pdf page 45)

For instructions that are affected see [1] page 519 (pdf page 555).

[1] http://support.amd.com/TechDocs/24594.pdf

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
7 years agomisc: Update #!env calls for python to explicit version
Jason Lowe-Power [Fri, 10 Feb 2017 15:00:18 +0000 (10:00 -0500)]
misc: Update #!env calls for python to explicit version

In some newer Linux distributions, env python default to Python 3.0. This
patch explicitly uses "python2" instead of just "python" for all scripts
that use #!

Reported-by: Sanchayan Maity <maitysanchayan@gmail.com>
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
7 years agomisc: Add Python.h header to pyevents.hh
Jason Lowe-Power [Fri, 10 Feb 2017 15:00:18 +0000 (10:00 -0500)]
misc: Add Python.h header to pyevents.hh

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
7 years agomisc: Clean up and complete the gem5<->SystemC-TLM bridge [10/10]
Christian Menard [Fri, 10 Feb 2017 00:15:51 +0000 (19:15 -0500)]
misc: Clean up and complete the gem5<->SystemC-TLM bridge [10/10]

The current TLM bridge only provides a Slave Port that allows the gem5
world to send request to the SystemC world. This patch series refractors
and cleans up the existing code, and adds a Master Port that allows the
SystemC world to send requests to the gem5 world.

This patch:
  * Add callbacks for the Gem5SimControl that are called at before and
  * after simulate()

Reviewed at http://reviews.gem5.org/r/3799/

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>