gem5.git
8 years agosyscall_emul: move mmapGrowsDown() to LiveProcess
Steve Reinhardt [Thu, 17 Mar 2016 17:29:32 +0000 (10:29 -0700)]
syscall_emul: move mmapGrowsDown() to LiveProcess

The mmapGrowsDown() method was a static method on the OperatingSystem
class (and derived classes), which worked OK for the templated syscall
emulation methods, but made it hard to access elsewhere.  This patch
moves the method to be a virtual function on the LiveProcess method,
where it can be overridden for specific platforms (for now, Alpha).

This patch also changes the value of mmapGrowsDown() from being false
by default and true only on X86Linux32 to being true by default and
false only on Alpha, which seems closer to reality (though in reality
most people use ASLR and this doesn't really matter anymore).

In the process, also got rid of the unused mmap_start field on
LiveProcess and OperatingSystem mmapGrowsUp variable.

8 years agosyscall_emul: fix bugs for mmap2 system call and x86-32 syscalls
Brandon Potter [Thu, 17 Mar 2016 17:25:53 +0000 (10:25 -0700)]
syscall_emul: fix bugs for mmap2 system call and x86-32 syscalls

8 years agostats: update stats for mmap() change.
Steve Reinhardt [Thu, 17 Mar 2016 17:25:11 +0000 (10:25 -0700)]
stats: update stats for mmap() change.

SE O3 runs see an additional reg read per mmap() call.

8 years agosyscall_emul: extend mmap system call to support file backed mmaps
Brandon Potter [Thu, 17 Mar 2016 17:24:17 +0000 (10:24 -0700)]
syscall_emul: extend mmap system call to support file backed mmaps

For O3, which has a stat that counts reg reads, there is an additional
reg read per mmap() call since there's an arg we no longer ignore.
Otherwise, stats should not be affected.

8 years agosyscall_emul: add many Linux kernel flags
Brandon Potter [Thu, 17 Mar 2016 17:22:39 +0000 (10:22 -0700)]
syscall_emul: add many Linux kernel flags

8 years agosyscall_emul: rename OpenFlagTransTable struct
Brandon Potter [Thu, 17 Mar 2016 17:22:39 +0000 (10:22 -0700)]
syscall_emul: rename OpenFlagTransTable struct

The structure definition only had the open system call flag set in mind when
it was named, so we rename it here with the intention of using it to define
additional tables to translate flags for other system calls in the future.

8 years agosyscall_emul: add extra debug support for syscalls
Alexandru Dutu [Thu, 17 Mar 2016 17:22:39 +0000 (10:22 -0700)]
syscall_emul: add extra debug support for syscalls

Breaks the debug output from system calls into two levels: Base and Verbose.
A macro is added specifically for system calls which allows developers to
easily add new debug messages in a consistent manner. The macro also contains
a field to print thread IDs along with the CPU ID.

8 years agosyscall_emul, style: refactor lseek
Brandon Potter [Thu, 17 Mar 2016 17:22:39 +0000 (10:22 -0700)]
syscall_emul, style: refactor lseek

8 years agosyscall_emul, style: fix newline issue inside assert
Brandon Potter [Thu, 17 Mar 2016 17:22:39 +0000 (10:22 -0700)]
syscall_emul, style: fix newline issue inside assert

8 years agomem: Adjust cache queue reserve to more conservative values
Andreas Hansson [Thu, 17 Mar 2016 13:51:22 +0000 (09:51 -0400)]
mem: Adjust cache queue reserve to more conservative values

The cache queue reserve is there as an overflow to give us enough
headroom based on when we block the cache, and how many transactions
we may already have accepted before actually blocking. The previous
values were probably chosen to be "big enough", when we actually know
that we check the MSHRs after every single allocation, and for the
write buffers we know that we implicitly may need one entry for every
outstanding MSHR.
* * *
mem: Adjust cache queue reserve to more conservative values

The cache queue reserve is there as an overflow to give us enough
headroom based on when we block the cache, and how many transactions
we may already have accepted before actually blocking. The previous
values were probably chosen to be "big enough", when we actually know
that we check the MSHRs after every single allocation, and for the
write buffers we know that we implicitly may need one entry for every
outstanding MSHR.

8 years agostats: Bump stats to match cache changes
Andreas Hansson [Thu, 17 Mar 2016 13:51:21 +0000 (09:51 -0400)]
stats: Bump stats to match cache changes

Update stats to match current behaviour. As a result of the earlier
conflict check we are seeing a few prefetch requests being ignored
before being sent as upward snoops.

8 years agomem: Create a separate class for the cache write buffer
Andreas Hansson [Thu, 17 Mar 2016 13:51:18 +0000 (09:51 -0400)]
mem: Create a separate class for the cache write buffer

This patch breaks out the cache write buffer into a separate class,
without affecting any stats. The goal of the patch is to avoid
encumbering the much-simpler write queue with the complex MSHR
handling. In a follow on patch this simplification allows us to
implement write combining.

The WriteQueue gets its own class, but shares a common ancestor, the
generic Queue, with the MSHRQueue.

8 years agostats: overdue updates to long regressions
Steve Reinhardt [Wed, 16 Mar 2016 20:03:49 +0000 (13:03 -0700)]
stats: overdue updates to long regressions

8 years agomisc: Add a gitignore file based on the current hgignore
Andreas Sandberg [Wed, 16 Mar 2016 17:20:00 +0000 (17:20 +0000)]
misc: Add a gitignore file based on the current hgignore

Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
8 years agomisc: Fix argument handling for m5 initparam util
Gabor Dozsa [Wed, 16 Mar 2016 16:23:42 +0000 (16:23 +0000)]
misc: Fix argument handling for m5 initparam util

8 years agoarm: Fix disasm printing
Nathanael Premillieu [Wed, 16 Mar 2016 16:08:24 +0000 (16:08 +0000)]
arm: Fix disasm printing

Fix the printDataInst function to properly print the immediate value.

8 years agoscons: fix building in non-standard locations
Steve Reinhardt [Mon, 14 Mar 2016 00:47:33 +0000 (17:47 -0700)]
scons: fix building in non-standard locations

It's apparently not widely known that our scons scripts allow you to
put the build directory wherever you want; not only does it not have
to be immediately under the root of your repo, it doesn't even have
to be underneath the root at all.  (For example, sometimes it's useful
to build on a local disk if your repo is on a slow NFS mount.)

I point this out because this functionality has been broken for close
to two years but no one seems to have noticed yet.  This patch fixes
an assumption that crept in in changeset be0e1724eb39 (May 09 2014)
that the build dir would be immediately under the top level of the
repo, preventing builds anywhere else.

8 years agostats: update gpu-ruby-GPU_RfO stats
Steve Reinhardt [Thu, 18 Feb 2016 15:42:03 +0000 (10:42 -0500)]
stats: update gpu-ruby-GPU_RfO stats

Output changed way back in this cset:

changeset:   11345:b6a66a90e0a1
user:        John Kalamatianos <john.kalamatianos@amd.com>
summary:     gpu: fix bugs with MemFence, Flat Instrs and Resource utilization

8 years agoconfigs: Add a lat_mem_rd style test script
Andreas Hansson [Tue, 8 Mar 2016 22:51:02 +0000 (17:51 -0500)]
configs: Add a lat_mem_rd style test script

This patch adds a config script that broadly replicates the behaviour
of lat_mem_rd. The test is based on traffic generators, and as such we
simply randomise addresses in increasingly large ranges, and play them
back using the trace functionality of the traffic generator.

The test script is accompanied by a post-processing and visualisation
script. At the moment no configurability is added to tweak the memory
hierarchy, but a follow on patch could easily extend the
functionality.

8 years agosyscall_emul: Fix erroneous use of delete
Andreas Hansson [Tue, 8 Mar 2016 22:50:58 +0000 (17:50 -0500)]
syscall_emul: Fix erroneous use of delete

clang correctly points out an erroneous use of delete.

8 years agosim: Add voltage() function to clocked_object
David Guillen Fandos [Wed, 17 Jun 2015 15:49:40 +0000 (16:49 +0100)]
sim: Add voltage() function to clocked_object

Adding voltage function which returns the current voltage
for a given clocked object. It's handy for power models and
similar stuff that need to retrieve voltage. Function
frequency() is already there, so I see no reason for not having
this one too.

9 years agocpu: Change literal integer constants to meaningful labels
Rekai Gonzalez Alberquilla [Tue, 5 May 2015 15:47:24 +0000 (16:47 +0100)]
cpu: Change literal integer constants to meaningful labels

fu_pool and inst_queue were using -1 for "no such FU" and -2 for "all those
FUs are busy at the moment" when requesting for a FU and replying. This
patch introduces new constants NoCapableFU and NoFreeFU respectively.

In addition, the condition (idx == -2 || idx != -1) is equivalent to
(idx != -1), so this patch also simplifies that.

--HG--
extra : rebase_source : 4833717b9d1e09d7594d1f34f882e13fc4b86846

8 years agobase: Fix gpu-compute output stream creation
Andreas Hansson [Sat, 5 Mar 2016 01:14:10 +0000 (20:14 -0500)]
base: Fix gpu-compute output stream creation

Match changes in output stream.

8 years agokvm: Shutdown KVM and disconnect performance counters on fork
Andreas Sandberg [Fri, 27 Nov 2015 14:52:10 +0000 (14:52 +0000)]
kvm: Shutdown KVM and disconnect performance counters on fork

We can't/shouldn't use KVM after a fork since the child and parent
probably point to the same VM. Knowing the exact effects of this is
hard, but they are likely to be messy. We also disconnect the
performance counters attached to the guest. This works around what
seems to be a kernel bug where spurious SIGIOs get delivered to the
forked child process.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
[sascha.bischoff@arm.com: Rebased patches onto a newer gem5 version]
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
[andreas.sandberg@arm.com: Fatal if entering KVM in child process ]
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
8 years agosim: Add support for forking
Andreas Sandberg [Thu, 26 Nov 2015 10:11:57 +0000 (10:11 +0000)]
sim: Add support for forking

This changeset adds forking capabilities to the gem5 python scripts. A fork
method is added to simulate.py. This method is responsible for forking the
simulator itself, and will direct all output files to a new output directory
based on the fork sequence number. The default name of the output directory is
the same as the parent with the suffix ".fN" added where N is the fork sequence
number. The fork method provides the option to specify if the system should be
drained prior to forking, or not. By default the system is drained to ensure
that there are no in-flight transactions.

When forking the simulator, the fork method returns the PID of the child
process, or returns 0 if running in the child. This is in line with the standard
Python forking interface.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
[sascha.bischoff@arm.com: Rebased patches onto a newer gem5 version]
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
[andreas.sandberg@arm.com: Updated to comply with modern draining semantics ]
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
8 years agodev: Add post-fork handling for disk images
Andreas Sandberg [Thu, 26 Nov 2015 10:11:52 +0000 (10:11 +0000)]
dev: Add post-fork handling for disk images

This changeset adds support for notifying the disk images that the simulator has
been forked. We need to disable the saving of the CoW disk image from the child
process, and we need to make sure that systems which use a raw disk image are
not allowed to fork to avoid two or more gem5 processes writing to the same disk
image.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
[sascha.bischoff@arm.com: Rebased patches onto a newer gem5 version]
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
8 years agosim: Add support for notifying Drainable objects of a fork
Andreas Sandberg [Thu, 26 Nov 2015 10:03:43 +0000 (10:03 +0000)]
sim: Add support for notifying Drainable objects of a fork

When forking a gem5 process, some objects need to clean up resources
(mainly file descriptions) shared between the child and the parent of
the fork. This changeset adds the notifyFork() method to Drainable,
which is called in the child process.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
[sascha.bischoff@arm.com: Rebased patches onto a newer gem5 version]
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
8 years agobase: Add support for changing output directories
Andreas Sandberg [Fri, 27 Nov 2015 14:41:59 +0000 (14:41 +0000)]
base: Add support for changing output directories

This changeset adds support for changing the simulator output
directory. This can be useful when the simulation goes through several
stages (e.g., a warming phase, a simulation phase, and a verification
phase) since it allows the output from each stage to be located in a
different directory. Relocation is done by calling core.setOutputDir()
from Python or simout.setOutputDirectory() from C++.

This change affects several parts of the design of the gem5's output
subsystem. First, files returned by an OutputDirectory instance (e.g.,
simout) are of the type OutputStream instead of a std::ostream. This
allows us to do some more book keeping and control re-opening of files
when the output directory is changed. Second, new subdirectories are
OutputDirectory instances, which should be used to create files in
that sub-directory.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
[sascha.bischoff@arm.com: Rebased patches onto a newer gem5 version]
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
8 years agoutil: update Java JNI interface to m5ops
Prakash Ramrakhyani [Tue, 1 Mar 2016 01:13:15 +0000 (19:13 -0600)]
util: update Java JNI interface to m5ops

Synchronize with
ab19693da "pseudo inst,util: Add optional key to initparam pseudo instruction"

8 years agomem, cpu: Add assertions to snoop invalidation logic
Stephan Diestelhorst [Mon, 10 Aug 2015 10:25:52 +0000 (11:25 +0100)]
mem, cpu: Add assertions to snoop invalidation logic

This patch adds assertions that enforce that only invalidating snoops
will ever reach into the logic that tracks in-order load completion and
also invalidation of LL/SC (and MONITOR / MWAIT) monitors. Also adds
some comments to MSHR::replaceUpgrades().

8 years agocpu: Fix LLSC atomic CPU wakeup
Krishnendra Nathella [Sun, 19 Jul 2015 20:03:30 +0000 (15:03 -0500)]
cpu: Fix LLSC atomic CPU wakeup

Writes to locked memory addresses (LLSC) did not wake up the locking
CPU. This can lead to deadlocks on multi-core runs. In AtomicSimpleCPU,
recvAtomicSnoop was checking if the incoming packet was an invalidation
(isInvalidate) and only then handled a locked snoop. But, writes are
seen instead of invalidates when running without caches (fast-forward
configurations). As as simple fix, now handleLockedSnoop is also called
even if the incoming snoop packet are from writes.

8 years agoarm: Squash after returning from exceptions in v7
Mitch Hayenga [Tue, 1 Mar 2016 01:13:13 +0000 (19:13 -0600)]
arm: Squash after returning from exceptions in v7

Properly done for the ERET instruction in v8, but not for v7.
Many control register changes are only visible after explicit
instruction synchronization barriers or exception entry/exit.
This means mode changing instructions should squash any
younger in-flight speculative instructions.

8 years agobase: support gzip-compressed object files
Curtis Dunham [Tue, 1 Mar 2016 01:13:13 +0000 (19:13 -0600)]
base: support gzip-compressed object files

8 years agostats: Update stats to reflect forwarding of InvalidateReq
Andreas Hansson [Wed, 24 Feb 2016 09:16:59 +0000 (04:16 -0500)]
stats: Update stats to reflect forwarding of InvalidateReq

8 years agomem: Ensure that InvalidateReq is not forwarded as ReadExReq
Andreas Hansson [Wed, 24 Feb 2016 09:16:57 +0000 (04:16 -0500)]
mem: Ensure that InvalidateReq is not forwarded as ReadExReq

This patch fixes an issue where an InvalidationReq only traversed one
level of the cache hierarchy, and was subsequently turned into a
ReadExReq due to it needing writable, and the command not being
checked for explicitly.

8 years agocpu: TraceGen fix for tick frequency check
Matteo Andreozzi [Wed, 24 Feb 2016 09:16:55 +0000 (04:16 -0500)]
cpu: TraceGen fix for tick frequency check

Bug fix for check on protobuf file frequency being different than
global frequency.

The ASCII encoder script is also fixed, and the example trace used in
the regressions is updated.

8 years agodev, arm: Implement the NoMali reset callback
Andreas Sandberg [Tue, 23 Feb 2016 11:49:35 +0000 (11:49 +0000)]
dev, arm: Implement the NoMali reset callback

Add a callback handler for the NoMali reset callback. This callback is
called whenever the GPU is reset using the register interface or the
NoMali API. The callback can be used to override ID registers using
the raw register API.

8 years agodev, arm: Refactor the NoMali GPU
Andreas Sandberg [Tue, 23 Feb 2016 11:49:34 +0000 (11:49 +0000)]
dev, arm: Refactor the NoMali GPU

Refactor and cleanup the NoMaliGpu class:

  * Use a std::map instead of a switch block to map the parameter enum
    describing the GPU type to a NoMali type.

  * Remove redundant NoMali handle from the interrupt callback.

  * Make callbacks and API wrappers protected instead of private to
    enable future extensions.

  * Wrap remaining NoMali API calls.

8 years agoarm: Ship Linux device trees with gem5
Andreas Sandberg [Tue, 23 Feb 2016 11:21:07 +0000 (11:21 +0000)]
arm: Ship Linux device trees with gem5

Ship aarch32 and aarch64 device trees with gem5. We currently ship
device trees as a part of the gem5 Linux kernel repository. This makes
tracking hard since device trees are supposed to be platform dependent
rather than kernel dependent (Linux considers device trees to be a
stable kernel ABI). It also makes code sharing between aarch32 and
aarch64 impossible.

This changeset implements a set of device trees for the new
VExpress_GEM5_V1 platform. The platform is described in a shared file
that is separate from the memory/CPU description. Due to differences
in how secondary CPUs are initialized, aarch32 and aarch64 use
different base files describing CPU nodes and the machine's
compatibility property.

8 years agoscons: Add missing override to appease clang
Andreas Hansson [Tue, 23 Feb 2016 08:27:20 +0000 (03:27 -0500)]
scons: Add missing override to appease clang

Make clang happy...again.

8 years agoruby: move range change send from RubyPort to derived classes.
Tony Gutierrez [Thu, 18 Feb 2016 15:50:16 +0000 (10:50 -0500)]
ruby: move range change send from RubyPort to derived classes.

8 years agogpu: fix bugs with MemFence, Flat Instrs and Resource utilization
John Kalamatianos [Thu, 18 Feb 2016 15:42:03 +0000 (10:42 -0500)]
gpu: fix bugs with MemFence, Flat Instrs and Resource utilization

Both Memory Fence is now flagged as Global Memory only to avoid resource
oversubscribing.
Flat instructions now check for Shared Memory resource busy to avoid
oversubscribing resources.
All WaitClass resources now use cycles (not ticks) to register the number
of pipe stages between Scoreboard and Execute to be consistent with
instruction scheduling logic which always used clock cycles.

8 years agogpu-compute: remove brig_object.hh from hsa_object.cc
Tony Gutierrez [Wed, 17 Feb 2016 16:46:02 +0000 (11:46 -0500)]
gpu-compute: remove brig_object.hh from hsa_object.cc

brig_object.hh is specific to the HSAIL ISA, and hence should not be
included in ISA-agnostic code.

8 years agoruby: send address ranges from RubyPort
Tony Gutierrez [Wed, 17 Feb 2016 16:31:54 +0000 (11:31 -0500)]
ruby: send address ranges from RubyPort

8 years agoscons: Enable building with the gcc/clang Address Sanitizer
Andreas Hansson [Wed, 17 Feb 2016 08:56:20 +0000 (03:56 -0500)]
scons: Enable building with the gcc/clang Address Sanitizer

Allow the user to easily build gem5 with the Address Sanitizer, part
of both gcc and clang these days.

8 years agomisc: Add missing overrides to appease clang
Andreas Hansson [Mon, 15 Feb 2016 08:40:32 +0000 (03:40 -0500)]
misc: Add missing overrides to appease clang

Since the last round of fixes a few new issues have snuck in. We
should consider switching the regression runs to clang.

8 years agomem: Avoid using invalid iterator in cache lock list traversal
Andreas Hansson [Mon, 15 Feb 2016 08:40:04 +0000 (03:40 -0500)]
mem: Avoid using invalid iterator in cache lock list traversal

Fix up issue highlighted by Valgrind and the clang Address Sanitizer.

8 years agoruby: make DMASequencer inherit from RubyPort
Michael LeBeane [Mon, 15 Feb 2016 01:28:48 +0000 (20:28 -0500)]
ruby: make DMASequencer inherit from RubyPort

This patch essentially rolls back 10518:30e3715c9405 to make RubyPort the
parent class of DMASequencer.  It removes redundant code and restores some
features which were lost when directly inheriting from MemObject.  For
example,
DMASequencer can now communicate to other devices using PIO, which is useful
for memmory-mapped communication between multiple DMADevices.

8 years agoconfigs: add command-line option to stop debug output
Michael LeBeane [Sat, 13 Feb 2016 17:36:43 +0000 (12:36 -0500)]
configs: add command-line option to stop debug output

This patch adds a --debug-end flag to main.py so that debug output can be
stoped at a specified tick, while allowing the simulation to continue. It is
useful in situations where you would like to produce a trace for a region of
interest while still collecting stats for the entire run. This is in contrast
to the currently existing --debug-break flag, which terminates the simulation
at the tick.

8 years agosyscall_emul: Implement clock_getres() system call
Michael LeBeane [Sat, 13 Feb 2016 17:33:07 +0000 (12:33 -0500)]
syscall_emul: Implement clock_getres() system call

This patch implements the clock_getres() system call for arm and x86 in linux
SE mode.

8 years agostats: Update stats to reflect changes to cache and crossbar
Andreas Hansson [Wed, 10 Feb 2016 09:08:27 +0000 (04:08 -0500)]
stats: Update stats to reflect changes to cache and crossbar

8 years agomem: Be less conservative in clearing load locks in the cache
Andreas Hansson [Wed, 10 Feb 2016 09:08:25 +0000 (04:08 -0500)]
mem: Be less conservative in clearing load locks in the cache

Avoid being overly conservative in clearing load locks in the cache,
and allow writes to the line if they are from the same context. This
is in line with ALPHA and ARM.

8 years agomem: Move the point of coherency to the coherent crossbar
Andreas Hansson [Wed, 10 Feb 2016 09:08:25 +0000 (04:08 -0500)]
mem: Move the point of coherency to the coherent crossbar

This patch introduces the ability of making the coherent crossbar the
point of coherency. If so, the crossbar does not forward packets where
a cache with ownership has already committed to responding, and also
does not forward any coherency-related packets that are not intended
for a downstream memory controller. Thus, invalidations and upgrades
are turned around in the crossbar, and the memory controller only sees
normal reads and writes.

In addition this patch moves the express snoop promotion of a packet
to the crossbar, thus allowing the downstream cache to check the
express snoop flag (as it should) for bypassing any blocking, rather
than relying on whether a cache is responding or not.

8 years agomem: Align cache behaviour in atomic when upstream is responding
Andreas Hansson [Wed, 10 Feb 2016 09:08:24 +0000 (04:08 -0500)]
mem: Align cache behaviour in atomic when upstream is responding

Adopt the same flow as in timing mode, where the caches on the path to
memory get to keep the line (if present), and we use the
responderHadWritable flag to determine if we need to forward the
(invalidating) packet or not.

8 years agomem: Align how snoops are handled when hitting writebacks
Andreas Hansson [Wed, 10 Feb 2016 09:08:24 +0000 (04:08 -0500)]
mem: Align how snoops are handled when hitting writebacks

This patch unifies the snoop handling in case of hitting writebacks
with how we handle snoops hitting in the tags. As a result, we end up
using the same optimisation as the normal snoops, where we inform the
downstream cache if we encounter a line in Modified (writable and
dirty) state, which enables us to avoid sending out express snoops to
invalidate any Shared copies of the line. A few regressions
consequently change, as some transactions are sunk higher up in the
cache hierarchy.

8 years agomem: Deduce if cache should forward snoops
Andreas Hansson [Wed, 10 Feb 2016 09:08:24 +0000 (04:08 -0500)]
mem: Deduce if cache should forward snoops

This patch changes how the cache determines if snoops should be
forwarded from the memory side to the CPU side. Instead of having a
parameter, the cache now looks at the port connected on the CPU side,
and if it is a snooping port, then snoops are forwarded. Less error
prone, and less parameters to worry about.

The patch also tidies up the CPU classes to ensure that their I-side
port is not snooping by removing overrides to the snoop request
handler, such that snoop requests will panic via the default
MasterPort implement

8 years agoscons: always generate sim/tags.cc
Curtis Dunham [Mon, 8 Feb 2016 19:39:45 +0000 (13:39 -0600)]
scons: always generate sim/tags.cc

Due to insufficient build deps, the checkpoint tags might not get
updated; this commit solves this. Due to the uncommon nature of the
build target, regenerating tags.cc is a fairly clean solution. Since
SCons hashes file contents, it won't recompile anything unless a new
checkpoint upgrader is actually added.

--HG--
extra : amend_source : ed3879da7668554693f697076deaf5029cc9b954

8 years agox86: revamp cmpxchg8b/cmpxchg16b implementation
Alexandru Dutu [Sun, 7 Feb 2016 01:21:20 +0000 (17:21 -0800)]
x86: revamp cmpxchg8b/cmpxchg16b implementation

The previous implementation did a pair of nested RMW operations,
which isn't compatible with the way that locked RMW operations are
implemented in the cache models.  It was convenient though in that
it didn't require any new micro-ops, and supported cmpxchg16b using
64-bit memory ops.  It also worked in AtomicSimpleCPU where
atomicity was guaranteed by the core and not by the memory system.
It did not work with timing CPU models though.

This new implementation defines new 'split' load and store micro-ops
which allow a single memory operation to use a pair of registers as
the source or destination, then uses a single ldsplit/stsplit RMW
pair to implement cmpxchg.  This patch requires support for 128-bit
memory accesses in the ISA (added via a separate patch) to support
cmpxchg16b.

8 years agoarch, x86: add support for arrays as memory operands
Steve Reinhardt [Sun, 7 Feb 2016 01:21:20 +0000 (17:21 -0800)]
arch, x86: add support for arrays as memory operands

Although the cache models support wider accesses, the ISA descriptions
assume that (for the most part) memory operands are integer types,
which makes it difficult to define instructions that do memory accesses
larger than 64 bits.

This patch adds some generic support for memory operands that are arrays
of uint64_t, and specifically a 'u2qw' operand type for x86 that is an
array of 2 uint64_ts (128 bits).  This support is unused at this point,
but will be needed shortly for cmpxchg16b.  Ideally the 128-bit SSE
memory accesses will also be rewritten to use this support.

Support for 128-bit accesses could also have been added using the gcc
__int128_t extension, which would have been less disruptive.  However,
although clang also supports __int128_t, it's still non-standard.
Also, more importantly, this approach creates a path to defining
256- and 512-byte operands as well, which will be useful for eventual
AVX support.

8 years agoarch: get rid of dummy var init
Steve Reinhardt [Sun, 7 Feb 2016 01:21:20 +0000 (17:21 -0800)]
arch: get rid of dummy var init

MemOperand variables were being initialized to 0
"to avoid 'uninitialized variable' errors" but these
no longer seem to be a problem (with the exception of
one use case in POWER that is arguably broken and
easily fixed here).

Getting rid of the initialization is necessary to
set up a subsequent patch which extends memory
operands to possibly not be scalars, making the
'= 0' initialization no longer feasible.

8 years agosyscall_emul: fix bug in aux vector initialization
Steve Reinhardt [Sun, 7 Feb 2016 01:21:20 +0000 (17:21 -0800)]
syscall_emul: fix bug in aux vector initialization

Writing 16 bytes from an 8-byte source value is a bad idea.
This doesn't appear to have broken anything, but showed up
as spurious differences when tracediffing runs.

8 years agostyle: eliminate explicit boolean comparisons
Steve Reinhardt [Sun, 7 Feb 2016 01:21:20 +0000 (17:21 -0800)]
style: eliminate explicit boolean comparisons

Result of running 'hg m5style --skip-all --fix-control -a' to get
rid of '== true' comparisons, plus trivial manual edits to get
rid of '== false'/'== False' comparisons.

Left a couple of explicit comparisons in where they didn't seem
unreasonable:
invalid boolean comparison in src/arch/mips/interrupts.cc:155
>>        DPRINTF(Interrupt, "Interrupts OnCpuTimerINterrupt(tc) == true\n");<<
invalid boolean comparison in src/unittest/unittest.hh:110
>>            "EXPECT_FALSE(" #expr ")", (expr) == false)<<

8 years agox86: create function to check miscreg validity
Steve Reinhardt [Sun, 7 Feb 2016 01:21:20 +0000 (17:21 -0800)]
x86: create function to check miscreg validity

In the process of trying to get rid of an '== false' comparison,
it became apparent that a slightly more involved solution was
needed.  Split this out into its own changeset since it's not
a totally trivial local change like the others.

8 years agoutil: fix apparent statetrace bug
Steve Reinhardt [Sun, 7 Feb 2016 01:21:20 +0000 (17:21 -0800)]
util: fix apparent statetrace bug

In the process of trying to eliminate boolean comparisons,
I ran across this statement that appears to be a bug
(should have been an assignment).

8 years agoutil: added line length and boolean comparison style checkers
Steve Reinhardt [Sun, 7 Feb 2016 01:21:20 +0000 (17:21 -0800)]
util: added line length and boolean comparison style checkers

Added checkers for line length and boolean comparisons
(== true/== false) to the style script.

8 years agostyle: fix missing spaces in control statements
Steve Reinhardt [Sun, 7 Feb 2016 01:21:19 +0000 (17:21 -0800)]
style: fix missing spaces in control statements

Result of running 'hg m5style --skip-all --fix-control -a'.

8 years agostyle: remove trailing whitespace
Steve Reinhardt [Sun, 7 Feb 2016 01:21:18 +0000 (17:21 -0800)]
style: remove trailing whitespace

Result of running 'hg m5style --skip-all --fix-white -a'.

8 years agoutil: clean up and extend style checker
Steve Reinhardt [Sun, 7 Feb 2016 01:21:18 +0000 (17:21 -0800)]
util: clean up and extend style checker

Added a new Verifier object to check for and fix spacing
between if/while/for and following paren.

Restructured Verifier class to make it easier to add
new subclasses, particularly by using a global list of
verifiers to auto-generate command line options and
simplify the invocation loop.

8 years agoutil: delete old unused style-checking scripts
Steve Reinhardt [Sun, 7 Feb 2016 01:21:18 +0000 (17:21 -0800)]
util: delete old unused style-checking scripts

The functions in these scripts were apparently folded into style.py but the
old scripts were orphaned without being deleted.  Get rid of them so their
existence is no longer confusing.

8 years agodist, dev: add an ethernet switch model
Mohammad Alian [Sat, 6 Feb 2016 18:33:34 +0000 (13:33 -0500)]
dist, dev: add an ethernet switch model

8 years agostats: update EIO stats for recent changes
Steve Reinhardt [Sat, 6 Feb 2016 06:35:03 +0000 (01:35 -0500)]
stats: update EIO stats for recent changes

8 years agoext: fix SST connector
Curtis Dunham [Thu, 4 Feb 2016 22:57:59 +0000 (16:57 -0600)]
ext: fix SST connector

Should work with SST 5.1 and trunk as of right now.

8 years agoext: remove redundant parameter in example SST+gem5 test
Curtis Dunham [Fri, 29 Jan 2016 23:47:15 +0000 (17:47 -0600)]
ext: remove redundant parameter in example SST+gem5 test

The SST connector automatically adds --initialize-only to the gem5
"command line" (as it should); the config script doesn't need it.

8 years agoext: Update NoMali to external rev f08e0a5
Andreas Sandberg [Fri, 29 Jan 2016 12:14:21 +0000 (12:14 +0000)]
ext: Update NoMali to external rev f08e0a5

Update NoMali from external revision 9adf9d6 to f08e0a5 and bring in
the following changes:

f08e0a5 Add support for tracking address space state
f11099e Fix job slot register handling when running new jobs
b28c98e api: Add a reset callback
29ac4c3 tests: Update gitignore to cover all future test cases
1c6b893 Propagate reset calls to all job slots
8f8ec15 Remove redundant reg vector in MMU
85d90d2 tests: Fix incorrect extern declaration

8 years agostats: update stats to after GPU checkin
Tony Gutierrez [Fri, 22 Jan 2016 15:42:13 +0000 (10:42 -0500)]
stats: update stats to after GPU checkin

8 years agoruby: removed Write_Only AccessPermission
Brad Beckmann [Fri, 22 Jan 2016 15:42:12 +0000 (10:42 -0500)]
ruby: removed Write_Only AccessPermission

8 years agoruby: changed all references to numCPs to num-cp
Brad Beckmann [Fri, 22 Jan 2016 15:42:12 +0000 (10:42 -0500)]
ruby: changed all references to numCPs to num-cp

8 years agoruby: split CPU and GPU latency stats
David Hashe [Mon, 20 Jul 2015 14:15:18 +0000 (09:15 -0500)]
ruby: split CPU and GPU latency stats

8 years agogpu-compute: AMD's baseline GPU model
Tony Gutierrez [Tue, 19 Jan 2016 19:28:22 +0000 (14:28 -0500)]
gpu-compute: AMD's baseline GPU model

8 years agomem: write combining for ruby protocols
Tony Gutierrez [Tue, 19 Jan 2016 19:05:03 +0000 (14:05 -0500)]
mem: write combining for ruby protocols

This patch adds support for write-combining in ruby.

8 years ago* * *
Tony Gutierrez [Tue, 19 Jan 2016 18:57:50 +0000 (13:57 -0500)]
* * *
mem: support for gpu-style RMWs in ruby

This patch adds support for GPU-style read-modify-write (RMW) operations in
ruby. Such atomic operations are traditionally executed at the memory controller
(instead of through an L1 cache using cache-line locking).

Currently, this patch works by propogating operation functors through the memory
system.

8 years agomem: misc flags for AMD gpu model
Blake Hechtman [Mon, 20 Jul 2015 14:15:18 +0000 (09:15 -0500)]
mem: misc flags for AMD gpu model

This patch add support to mark memory requests/packets with attributes defined
in HSA, such as memory order and scope.

8 years agosim: fix redundant --debug-start help string
Steve Reinhardt [Mon, 18 Jan 2016 03:18:49 +0000 (19:18 -0800)]
sim: fix redundant --debug-start help string

Just changes the metavar for --debug-start from TIME
to TICK in cset 72046b9b3323 and didn't notice that the
comment "must be in ticks" is now redundant.

8 years agocpu. arch: add initiateMemRead() to ExecContext interface
Steve Reinhardt [Mon, 18 Jan 2016 02:27:46 +0000 (18:27 -0800)]
cpu. arch: add initiateMemRead() to ExecContext interface

For historical reasons, the ExecContext interface had a single
function, readMem(), that did two different things depending on
whether the ExecContext supported atomic memory mode (i.e.,
AtomicSimpleCPU) or timing memory mode (all the other models).
In the former case, it actually performed a memory read; in the
latter case, it merely initiated a read access, and the read
completion did not happen until later when a response packet
arrived from the memory system.

This led to some confusing things, including timing accesses
being required to provide a pointer for the return data even
though that pointer was only used in atomic mode.

This patch splits this interface, adding a new initiateMemRead()
function to the ExecContext interface to replace the timing-mode
use of readMem().

For consistency and clarity, the readMemTiming() helper function
in the ISA definitions is renamed to initiateMemRead() as well.
For x86, where the access size is passed in explicitly, we can
also get rid of the data parameter at this level.  For other ISAs,
where the access size is determined from the type of the data
parameter, we have to keep the parameter for that purpose.

8 years agocpu: remove unnecessary data ptr from O3 internal read() funcs
Steve Reinhardt [Mon, 18 Jan 2016 02:27:46 +0000 (18:27 -0800)]
cpu: remove unnecessary data ptr from O3 internal read() funcs

The read() function merely initiates a memory read operation; the
data doesn't arrive until the access completes and a response packet
is received from the memory system.  Thus there's no need to provide
a data pointer; its existence is historical.

Getting this pointer out of this internal o3 interface sets the
stage for similar cleanup in the ExecContext interface.  Also
found that we were pointlessly setting the contents at this pointer
on a store forward (the useful memcpy happens just a few lines
below the deleted one).

8 years agoarch: don't call *Timing functions from *Atomic versions
Steve Reinhardt [Mon, 18 Jan 2016 02:27:46 +0000 (18:27 -0800)]
arch: don't call *Timing functions from *Atomic versions

The readMemAtomic/writeMemAtomic helper functions were calling
readMemTiming/writeMemTiming respectively.  This is functionally
correct, since the *Timing functions are doing the same access
initiation operation as the *Atomic functions (just that the
*Atomic versions also complete the access in line).  It also
provides for some (very minimal) code reuse.  Unfortunately,
it's potentially pretty confusing, since it makes it look like
the atomic accesses are somehow being converted to timing
accesses.  It also gets in the way of specializing the timing
interface (as will be done in a future patch).

8 years agoarch: get rid of unused LargestRead typedef
Steve Reinhardt [Mon, 18 Jan 2016 02:27:46 +0000 (18:27 -0800)]
arch: get rid of unused LargestRead typedef

8 years agosim: don't ignore SIG_TRAP
Steve Reinhardt [Mon, 18 Jan 2016 02:27:46 +0000 (18:27 -0800)]
sim: don't ignore SIG_TRAP

By ignoring SIG_TRAP, using --debug-break <N> when not connected to
a debugger becomes a no-op.  Apparently this was intended to be a
feature, though the rationale is not clear.

If we don't ignore SIG_TRAP, then using --debug-break <N> when not
connected to a debugger causes the simulation process to terminate
at tick N.  This is occasionally useful, e.g., if you just want to
collect a trace for a specific window of execution then you can combine
this with --debug-start to do exactly that.

In addition to not ignoring the signal, this patch also updates
the --debug-break help message and deletes a handful of unprotected
calls to Debug::breakpoint() that relied on the prior behavior.

8 years agostats: update SPARC FS stats
Steve Reinhardt [Mon, 18 Jan 2016 02:13:29 +0000 (21:13 -0500)]
stats: update SPARC FS stats

The fs/80.solaris-boot/sparc/solaris/t1000-simple-atomic test was
broken for so long that, now that it's working again, the stats
output is out of date.  This changeset updates the outputs, on
the assumption that the stats changes are all valid differences
due to other changes made while it was broken.

8 years agodev, arm: Add a platform with support for both aarch32 and aarch64
Andreas Sandberg [Fri, 15 Jan 2016 11:30:13 +0000 (11:30 +0000)]
dev, arm: Add a platform with support for both aarch32 and aarch64

Add a platform with support for both aarch32 and aarch64. This
platform implements a subset of the devices in a real Versatile
Express and extends it with some gem5-specific functionality. It is in
many ways similar to the old VExpress_EMM64 platform, but supports the
following new features:

  * Automatic PCI interrupt assignment
  * PCI interrupts allocated in a contiguous range.
  * Automatic boot loader selection (32-bit / 64-bit)
  * Cleaner memory map where gem5-specific devices live in CS5 which
    isn't used by current Versatile Express platforms.
  * No fake devices. Devices that were previously faked will be
    removed from the device tree instead.
  * Support for 510 GiB contiguous memory

8 years agodev, arm: Add support for automatic PCI interrupt routing
Andreas Sandberg [Fri, 15 Jan 2016 11:30:06 +0000 (11:30 +0000)]
dev, arm: Add support for automatic PCI interrupt routing

Add support for automatic PCI interrupt routing using a device's ID on
the PCI bus. Our current DTBs typically tell the kernel that we do
this or something similar when declaring the PCI controller. This
changeset adds an option to make the simulator behave in the same way.

Interrupt routing can be selected by setting the int_policy parameter
in the GenericArmPciHost. The following values are supported:

  * ARM_PCI_INT_STATIC: Use the old static routing policy using the
    interrupt line from a device's configurtion space.

  * ARM_PCI_INT_DEV: Use device number on the PCI bus to map to an
    interrupt in the GIC. The interrupt is computed as:

    gic_int = int_base + (pci_dev % int_count)

  * ARM_PCI_INT_PIN: Use device interrupt pin on the PCI bus to map to
    an interrupt in the GIC. The PCI specification reserves pin ID 0
    for devices without interrupts, the interrupt therefore computed
    as:

    gic_int = int_base + ((pin - 1) % int_count)

8 years agomem: fix bug in packet access endianness changes
Steve Reinhardt [Mon, 11 Jan 2016 21:20:38 +0000 (16:20 -0500)]
mem: fix bug in packet access endianness changes

The new Packet::setRaw() method incorrectly still contained
an htog() conversion.  As a result, calls to the old set()
method (now defined as setRaw(htog(v))) underwent two htog
conversions, which breaks things when htog() is not a no-op.

Interestingly the only test that caught this was a SPARC
boot test, where an IsaFake device with a non-zero return
value was getting swapped twice resulting in a register
getting loaded with 0x100000000000000 instead of 1.
(Good reason for keeping SPARC around, perhaps?)

8 years agoscons: Enable -Wextra by default
Andreas Hansson [Mon, 11 Jan 2016 10:52:20 +0000 (05:52 -0500)]
scons: Enable -Wextra by default

Make best use of the compiler, and enable -Wextra as well as
-Wall. There are a few issues that had to be resolved, but they are
all trivial.

8 years agoext: Replace gzstream with iostream3 from zlib to avoid LGPL
Andreas Hansson [Mon, 11 Jan 2016 10:52:18 +0000 (05:52 -0500)]
ext: Replace gzstream with iostream3 from zlib to avoid LGPL

This patch replaces the gzstream zlib wrapper with the iostream3
wrapper provided as part of zlib contributions. The main reason for
the switch is to avoid including LGPL in the default gem5
build. iostream3 is provided under a more permissive license:

The code is provided "as is", with the permission to use, copy,
modify, distribute and sell it for any purpose without fee.

8 years agoconfigs: Fix inheritance of HMCSystem and cleanup spacing
Andreas Hansson [Mon, 11 Jan 2016 10:52:17 +0000 (05:52 -0500)]
configs: Fix inheritance of HMCSystem and cleanup spacing

Minor fix to ensure the HMCSystem can actually be instantiated
(SimObject cannot be created). Also address some spacing issues.

8 years agoconfig: Updates for distributed gem5 simulations
Gabor Dozsa [Thu, 7 Jan 2016 22:33:47 +0000 (16:33 -0600)]
config: Updates for distributed gem5 simulations

8 years agodev: Distributed Ethernet link for distributed gem5 simulations
Gabor Dozsa [Thu, 7 Jan 2016 22:33:47 +0000 (16:33 -0600)]
dev: Distributed Ethernet link for distributed gem5 simulations

Distributed gem5 (abbreviated dist-gem5) is the result of the
convergence effort between multi-gem5 and pd-gem5 (from Univ. of
Wisconsin). It relies on the base multi-gem5 infrastructure for packet
forwarding, synchronisation and checkpointing but combines those with
the elaborated network switch model from pd-gem5.

--HG--
rename : src/dev/net/multi_etherlink.cc => src/dev/net/dist_etherlink.cc
rename : src/dev/net/multi_etherlink.hh => src/dev/net/dist_etherlink.hh
rename : src/dev/net/multi_iface.cc => src/dev/net/dist_iface.cc
rename : src/dev/net/multi_iface.hh => src/dev/net/dist_iface.hh
rename : src/dev/net/multi_packet.hh => src/dev/net/dist_packet.hh

8 years agopseudo inst,util: Add optional key to initparam pseudo instruction
Gabor Dozsa [Thu, 7 Jan 2016 22:33:47 +0000 (16:33 -0600)]
pseudo inst,util: Add optional key to initparam pseudo instruction

The key parameter can be used to read out various config parameters from
within the simulated software.

8 years agomem: add CacheVerbose debug flag, filter noisy DPRINTFs
Steve Reinhardt [Thu, 31 Dec 2015 17:32:09 +0000 (09:32 -0800)]
mem: add CacheVerbose debug flag, filter noisy DPRINTFs

Some of the DPRINTFs added to the classic cache in cset 45df88079f04,
while useful to those unfamiliar with the cache code, end up being
noise when you're familiar with the code but are trying to debug tricky
protocol issues.  (Particularly getting two messages from each cache
as it receives a snoop request then declares that there was no match.)

This patch introduces a CacheVerbose debug flag, and moves a subset of
the added DPRINTFs into that category, so that Cache by itself returns
to being a more succinct summary of cache activity.

Also added a CacheAll compound flag to turn on all the cache-related
debug flags (other than CacheTags, which you *really* have to want badly
to turn it on, IMO).

8 years agomem: Do not rely on the NeedsWritable flag for responses
Andreas Hansson [Thu, 31 Dec 2015 14:34:18 +0000 (09:34 -0500)]
mem: Do not rely on the NeedsWritable flag for responses

This patch removes the NeedsWritable flag for all responses, as it is
really only the request that needs a writable response. The response,
on the other hand, should in these cases always provide the line in a
writable state, as indicated by the hasSharers flag not being set.

When we send requests that has NeedsWritable set, the response will
always have the hasSharers flag not set. Additionally, there are cases
where the request did not have NeedsWritable set, and we still get a
writable response with the hasSharers flag not set. This never happens
on snoops, but is used by downstream caches to pass ownership
upstream.

As part of this patch, the affected response types are updated, and
the snoop filter is similarly modified to check only the hasSharers
flag (as it should). A sanity check is also added to the packet class,
asserting that we never look at the NeedsWritable flag for responses.

No regressions are affected.