gem5.git
7 years agopython: Move native wrappers to the _m5 namespace
Andreas Sandberg [Fri, 27 Jan 2017 12:40:01 +0000 (12:40 +0000)]
python: Move native wrappers to the _m5 namespace

Swig wrappers for native objects currently share the _m5.internal name
space with Python code. This is undesirable if we ever want to switch
from Swig to some other framework for native binding (e.g., PyBind11
or Boost::Python). This changeset moves all of such wrappers to the
_m5 namespace, which is now reserved for native code.

Change-Id: I2d2bc12dbc05b57b7c5a75f072e08124413d77f3
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 agosyscall_emul: [patch 4/22] remove redundant M5_pid field from process
Brandon Potter [Wed, 9 Nov 2016 20:27:40 +0000 (14:27 -0600)]
syscall_emul: [patch 4/22] remove redundant M5_pid field from process

7 years agostyle: [patch 3/22] reduce include dependencies in some headers
Brandon Potter [Wed, 9 Nov 2016 20:27:40 +0000 (14:27 -0600)]
style: [patch 3/22] reduce include dependencies in some headers

Used cppclean to help identify useless includes and removed them. This
involved erroneously included headers, but also cases where forward
declarations could have been used rather than a full include.

7 years agosyscall_emul: #ifdef new system calls to allow builds on OSX and BSD
Brandon Potter [Fri, 20 Jan 2017 19:12:58 +0000 (14:12 -0500)]
syscall_emul: #ifdef new system calls to allow builds on OSX and BSD

7 years agoruby: guard usage of GPUCoalescer code in Profiler
Tony Gutierrez [Thu, 19 Jan 2017 16:59:34 +0000 (11:59 -0500)]
ruby: guard usage of GPUCoalescer code in Profiler

the GPUCoalescer code is used in the ruby profiler regardless of
whether or not the coalescer code has been compiled, which can
lead to link/run time errors. here we add #ifdefs to guard the
usage of GPUCoalescer code. eventually we should refactor this
code to use probe points.

7 years agoruby: Check MessageBuffer space in garnet NetworkInterface
Matthew Poremba [Thu, 19 Jan 2017 16:59:10 +0000 (11:59 -0500)]
ruby: Check MessageBuffer space in garnet NetworkInterface

Garnet's NetworkInterface does not consider the size of MessageBuffers when
ejecting a Message from the network. Add a size check for the MessageBuffer
and only enqueue if space is available. If space is not available, the
message if placed in a queue and the credit is held. A callback from the
MessageBuffer is implemented to wake the NetworkInterface. If there are
messages in the stalled queue, they are processed first, in a FIFO manner
and if succesfully ejected, the credit is finally sent back upstream. The
maximum size of the stall queue is equal to the number of valid VNETs
with MessageBuffers attached.

7 years agoruby: Add occupancy stats to MessageBuffers
Matthew Poremba [Thu, 19 Jan 2017 16:58:59 +0000 (11:58 -0500)]
ruby: Add occupancy stats to MessageBuffers

This patch is an updated version of /r/3297.

"The most important statistic for measuring memory hierarchy performance is
throughput, which is affected by independent variables, buffer sizing and
communication latency. It is difficult/impossible to debug performance issues
through series buffers without knowing which are the bottlenecks. For finite
buffers, this patch adds statistics for the average number of messages in the
buffer, the occupancy of the buffer slots, and number of message stalls."

7 years agoruby: Check all VNETs for injection in garnet NetworkInterface
Matthew Poremba [Thu, 19 Jan 2017 16:58:49 +0000 (11:58 -0500)]
ruby: Check all VNETs for injection in garnet NetworkInterface

The NetworkInterface wakeup currently iterates over all VNETs and breaks the
loop if a VNET is unable to allocate a VC. This can cause a deadlock if a
lower numbered VNET is unable to allocate a VC while a higher numbered VNET
has idle VCs. This seems like a bug as Garnet 1.0 uses a while loop over an
if-statement, suggesting the break was intended for this while loop. This
patch removes the break statement, which allows up to one message to be
dequeued from a VNET and injected into the network.

7 years agosyscall_emul: [patch 2/22] move SyscallDesc into its own .hh and .cc
Brandon Potter [Wed, 9 Nov 2016 20:27:40 +0000 (14:27 -0600)]
syscall_emul: [patch 2/22] move SyscallDesc into its own .hh and .cc

The class was crammed into syscall_emul.hh which has tons of forward
declarations and template definitions. To clean it up a bit, moved the
class into separate files and commented the class with doxygen style
comments. Also, provided some encapsulation by adding some accessors and
a mutator.

The syscallreturn.hh file was renamed syscall_return.hh to make it consistent
with other similarly named files in the src/sim directory.

The DPRINTF_SYSCALL macro was moved into its own header file with the
include the Base and Verbose flags as well.

--HG--
rename : src/sim/syscallreturn.hh => src/sim/syscall_return.hh

7 years agostyle: [patch 1/22] use /r/3648/ to reorganize includes
Brandon Potter [Wed, 9 Nov 2016 20:27:37 +0000 (14:27 -0600)]
style: [patch 1/22] use /r/3648/ to reorganize includes

7 years agomisc: fixes deprecated sc_time function for SystemC 2.3.1
Matthias Jung [Mon, 9 Jan 2017 15:34:36 +0000 (09:34 -0600)]
misc: fixes deprecated sc_time function for SystemC 2.3.1

The non-standard sc_time constructors

- sc_time( uint64, bool scale )
- sc_time( double, bool scale )

have been deprecated in SystemC 2.3.1 and a warning is issued when being
used. Insted the new 'sc_time::from_value' function is used to omit the
warning message.

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
7 years agomisc: Documentation Update
Matthias Jung [Mon, 9 Jan 2017 15:33:42 +0000 (09:33 -0600)]
misc: Documentation Update

Updates for READMEs of /util/cxx_config, /util/systemc, /util/tlm.
Some minor corrections, mostly with respect to MAC/OSX

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoconfig: Fix missing include in fs.py
Matthias Jung [Mon, 9 Jan 2017 15:32:13 +0000 (09:32 -0600)]
config: Fix missing include in fs.py

Bugfix for Elastic Traces

This patch fixes the bug when elastic traces are used:

    build/ARM/gem5.opt \
    configs/example/fs.py \
    --cpu-type=arm_detailed \
    --num-cpu=1 \
    --mem-type=SimpleMemory \
    --mem-size=512MB \
    --mem-channels=1 \
    --caches \
    --elastic-trace-en \
    --data-trace-file=data.proto.gz \
    --inst-trace-file=inst.proto.gz \
    --machine-type=VExpress_EMM \
    --dtb-filename=vexpress.aarch32.ll_20131205.0-gem5.1cpu.dtb \
    --kernel=vmlinux.aarch32.ll_20131205.0-gem5 \
    --disk-image=linux-aarch32-ael.img

NameError: global name 'CpuConfig' is not defined

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

7 years agosim: Remove declaration of unused CountedDrainEvent
Andreas Sandberg [Tue, 3 Jan 2017 17:31:39 +0000 (17:31 +0000)]
sim: Remove declaration of unused CountedDrainEvent

The CountedDrainEvent event was used to keep track of objects that
required additional simulation to drain. It was removed as a part of
the great drain rewrite, but the declaration remained.

Change-Id: I767a3213669040d3f27e2afafa2e4a5bb997e325
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
7 years agopython: Don't use Swig to cast stats
Andreas Sandberg [Tue, 3 Jan 2017 12:03:45 +0000 (12:03 +0000)]
python: Don't use Swig to cast stats

Call the stat visitor from the stat itself rather than casting stats
in Python. This reduces the number of ways visitors are called.

Change-Id: Ic4d0b7b32e3ab9897b9a34cd22d353f4da62d738
Signed-off-by: Andreas Sandberg <andreas.sandberg@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: Joe Gross <joseph.gross@amd.com>
7 years agosim: Remove redundant export_method_cxx_predecls
Andreas Sandberg [Tue, 3 Jan 2017 12:03:06 +0000 (12:03 +0000)]
sim: Remove redundant export_method_cxx_predecls

The headers declared in export_method_cxx_predecls are redundant since a
SimObject's main header is automatically included.

Change-Id: Ied9e84630b36960e54efe91d16f8c66fba7e0da0
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Joe Gross <joseph.gross@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoutil: Add maintainer tools to create upstream patches
Andreas Sandberg [Tue, 3 Jan 2017 11:31:46 +0000 (11:31 +0000)]
util: Add maintainer tools to create upstream patches

This changeset adds a maintainer script, create_patches.sh, that can
be used to prepare for upstream from a git repository. The script can
be used to generate patches in Mercurial or git format. The commit
messages in the exported patches are all filtered, see
upstream_msg_filter.sed, to ensure that irrelevant meta data isn't
included in the upstream commit.

Kudos to Curtis Dunham and Nikos Nikoleris for reviews and usability
enhancements for earlier versions of this patch.

Change-Id: Ia4cd089a32834b5e046ef58c0a173ca285b77bca
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
7 years agosim: Fix SE mode checkpoint restore file handling
Joel Hestness [Fri, 23 Dec 2016 14:43:18 +0000 (08:43 -0600)]
sim: Fix SE mode checkpoint restore file handling

When restoring from a checkpoint, the simulation used to use file handles from
the checkpoint. This disallows multiple separate restore simulations from using
separate input and output files and directories, and plays havoc when the
checkpointed file locations may have changed. Add handling to allow the command
line specified files to be used as input/output for the restored simulation
(Note: this is the similar functionality to FS mode for output and error).

7 years agocpu: implement an L-TAGE branch predictor
Arthur Perais [Wed, 21 Dec 2016 21:25:13 +0000 (15:25 -0600)]
cpu: implement an L-TAGE branch predictor

This patch implements an L-TAGE predictor, based on AndrĂ© Seznec's code
available from CBP-2
(http://hpca23.cse.tamu.edu/taco/camino/cbp2/cbp-src/realistic-seznec.h).

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

7 years agocpu: disallow speculative update of branch predictor tables (o3)
Arthur Perais [Wed, 21 Dec 2016 21:07:16 +0000 (15:07 -0600)]
cpu: disallow speculative update of branch predictor tables (o3)

The Minor and o3 cpu models share the branch prediction
code. Minor relies on the BPredUnit::squash() function
to update the branch predictor tables on a branch mispre-
diction. This is fine because Minor executes in-order, so
the update is on the correct path. However, this causes the
branch predictor to be updated on out-of-order branch
mispredictions when using the o3 model, which should not
be the case.

This patch guards against speculative update of the branch
prediction tables. On a branch misprediction, BPredUnit::squash()
calls BpredUnit::update(..., squashed = true). The underlying
branch predictor tests against the value of squashed. If it is
true, it restores any speculatively updated internal state
it might have (e.g., global/local branch history), then returns.
If false, it updates its prediction tables. Previously, exist-
ing predictors did not test against the "squashed" parameter.

To accomodate for this change, the Minor model must now call
BPredUnit::squash() then BPredUnit::update(..., squashed = false)
on branch mispredictions. Before, calling BpredUnit::squash()
performed the prediction tables update.

The effect is a slight MPKI improvement when using the o3
model. A further patch should perform the same modifications
for the indirect target predictor and BTB (less critical).

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
7 years agocpu: correct comments in tournament branch predictor
Arthur Perais [Wed, 21 Dec 2016 21:06:13 +0000 (15:06 -0600)]
cpu: correct comments in tournament branch predictor

The tournament predictor is presented as doing speculative
update of the global history and non-speculative update
of the local history used to generate the branch prediction.
However, the code does speculative update of both histories.

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
7 years agocpu: Resolve targets of predicted 'taken' decode for O3
Arthur Perais [Wed, 21 Dec 2016 21:05:24 +0000 (15:05 -0600)]
cpu: Resolve targets of predicted 'taken' decode for O3

The target of taken conditional direct branches does not
need to be resolved in IEW: the target can be computed at
decode, usually using the decoded instruction word and the PC.

The higher-than-necessary penalty is taken only on conditional
branches that are predicted taken but miss in the BTB. Thus,
this is mostly inconsequential on IPC if the BTB is big/associative
enough (fewer capacity/conflict misses). Nonetheless, what gem5
simulates is not representative of how conditional branch targets
can be handled.

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
7 years agocpu: Clarify meaning of cachePorts variable in lsq_unit.hh of O3
Arthur Perais [Wed, 21 Dec 2016 21:04:06 +0000 (15:04 -0600)]
cpu: Clarify meaning of cachePorts variable in lsq_unit.hh of O3

cachePorts currently constrains the number of store packets written to the
D-Cache each cycle), but loads currently affect this variable. This leads
to unexpected congestion (e.g., setting cachePorts to a realistic 1 will
in fact allow a store to WB only if no loads have accessed the D-Cache
this cycle). In the absence of arbitration, this patch decouples how many
loads can be done per cycle from how many stores can be done per cycle.

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
7 years agoruby: Make MessageBuffers actually finite sized
Joel Hestness [Tue, 20 Dec 2016 17:38:24 +0000 (11:38 -0600)]
ruby: Make MessageBuffers actually finite sized

When Ruby controllers stall messages in MessageBuffers, the buffer moves those
messages off the priority heap and into a per-address stall map. When buffers
are finite-sized, the test areNSlotsAvailable() only checks the size of the
priority heap, but ignores the stall map, so the map is allowed to grow
unbounded if the controller stalls numerous messages. This patch fixes the
problem by tracking the stall map size and testing the total number of messages
in the buffer appropriately.

7 years agoruby: fix typo in DMASequencer::ackCallback()
Tony Gutierrez [Tue, 20 Dec 2016 16:53:36 +0000 (11:53 -0500)]
ruby: fix typo in DMASequencer::ackCallback()

7 years agoruby: fix issue with unused var in DMASequencer
Tony Gutierrez [Tue, 20 Dec 2016 16:47:30 +0000 (11:47 -0500)]
ruby: fix issue with unused var in DMASequencer

the iterator declared in DMASequencer::ackCallback() is only used in an
assert, this causes clang to fail when building fast. here we move
the find call on the request table directly into the assert.

7 years agodist, dev: fix etherswitch upgrade script
Curtis Dunham [Mon, 19 Dec 2016 18:12:28 +0000 (12:12 -0600)]
dist, dev: fix etherswitch upgrade script

The aforementioned upgrader in [1] assumes every option in [system]
has a delimiting '.', and also seems to do its rewriting work a bit too
unconditionally.  Most checkpoints in the wild don't have this device,
in which case this script should be a safe no-op.

[1] 2aa4d7b  dist, dev: Fixed the packet ordering in etherswitch

Change-Id: Icfd0350985109df1628eb9ab864cda42c54060a8
Reviewed-by: Gabor Dozsa <gabor.dozsa@arm.com>
7 years agostats: update references
Curtis Dunham [Mon, 19 Dec 2016 17:03:28 +0000 (11:03 -0600)]
stats: update references

7 years agoarm: provide correct timer availability in ID_PFR1 register
Curtis Dunham [Mon, 19 Dec 2016 17:03:28 +0000 (11:03 -0600)]
arm: provide correct timer availability in ID_PFR1 register

Change-Id: Id4cd839c12b70616017a5830e3f9bbb59b0f97ba
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm: compute ID_AA64PFR{0,1}_EL1 registers
Curtis Dunham [Mon, 19 Dec 2016 17:03:28 +0000 (11:03 -0600)]
arm: compute ID_AA64PFR{0,1}_EL1 registers

Compute the proper values of the aforementioned registers from
the system configuration rather than configuring the values themselves.

Change-Id: If9774b6610a29568b80ae4866107b9a6a5b5be0f
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm: compute ID_PFR{0,1} registers
Curtis Dunham [Mon, 19 Dec 2016 17:03:27 +0000 (11:03 -0600)]
arm: compute ID_PFR{0,1} registers

Compute the proper values of the aforementioned registers from
the system configuration rather than configuring the values themselves.

Change-Id: Ie7685b5d8b5f2dd9d6380b4af74f16d596b2bfd1
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm: miscreg refactoring
Curtis Dunham [Mon, 19 Dec 2016 17:03:27 +0000 (11:03 -0600)]
arm: miscreg refactoring

Change-Id: I4e9e8f264a4a4239dd135a6c7a1c8da213b6d345
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm: audit SCTLR
Curtis Dunham [Mon, 19 Dec 2016 17:03:27 +0000 (11:03 -0600)]
arm: audit SCTLR

Change-Id: I814f1431a5f754f75721c9ac51171f860a714d24
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm: remove SCTLR.FI
Curtis Dunham [Mon, 19 Dec 2016 17:03:27 +0000 (11:03 -0600)]
arm: remove SCTLR.FI

Removed from ARMARM.

Change-Id: Ie8f28e4fa6e1b46dfd9c8c4b379e5b42fe25421d
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm: update AArch{64,32} register mappings
Curtis Dunham [Mon, 19 Dec 2016 17:03:27 +0000 (11:03 -0600)]
arm: update AArch{64,32} register mappings

Change-Id: Idaaaeb3f7b1a0bdbf18d8e2d46686c78bb411317
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agomem: Make the BaseXBar public to not confuse Python wrappers
Andreas Sandberg [Mon, 19 Dec 2016 16:25:40 +0000 (16:25 +0000)]
mem: Make the BaseXBar public to not confuse Python wrappers

The Python wrappers generally assume that destructors are public. Make
the BaseXBar destructor public to avoid confusing the Python wrapper.

Change-Id: If958802409c0be74e875dd6e279742abfdb3ede1
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
7 years agopython: Export periodicStatDump
Andreas Sandberg [Mon, 19 Dec 2016 16:25:39 +0000 (16:25 +0000)]
python: Export periodicStatDump

Some configuration scripts need periodic stat dumps. One of the ways
this can be achieved is by using the pariodicStatDump helper
function. This function was previously only exported in the internal
name space. Export it as a normal function in m5.stat instead.

Change-Id: Ic88bf1fd33042a62ab436d5944d8ed778264ac98
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
7 years agodev: Include DmaDevice in NULL builds
Andreas Sandberg [Mon, 19 Dec 2016 16:25:38 +0000 (16:25 +0000)]
dev: Include DmaDevice in NULL builds

Builds for the NULL ISA include Device.py, which contains the Python
declaration of DmaDevice, but don't include the actual C++
implementation. Add dma_device.cc to the NULL build to the Python and
C++ worlds consistent again.

Change-Id: I47a57181a1f4d5a7276467678bf16fbc7f161681
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
7 years agopython: Fix incorrect header in the DmaDevice wrapper
Andreas Sandberg [Mon, 19 Dec 2016 16:25:38 +0000 (16:25 +0000)]
python: Fix incorrect header in the DmaDevice wrapper

The header declared in the DmaDevice wrapper doesn't actually contain
the DmaDevice class. This can potentially lead to incorrect type cases
in Swig.

Change-Id: If2266d4180d1d6fd13359a81067068854c5e96fe
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
7 years agosim: Remove redundant buildEnv import
Andreas Sandberg [Mon, 19 Dec 2016 16:25:37 +0000 (16:25 +0000)]
sim: Remove redundant buildEnv import

Change-Id: Id6bdbc0c988aa92b96e292cabc913e6b974f14bb
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
7 years agoruby: Detect garnet network-level deadlock.
Jieming Yin [Thu, 15 Dec 2016 21:59:17 +0000 (16:59 -0500)]
ruby: Detect garnet network-level deadlock.

This patch detects garnet network deadlock by monitoring
network interfaces. If a network interface continuously
fails to allocate virtual channels for a message, a
possible deadlock is detected.

7 years agobase: remove header file to prevent a macro name collision
Brandon Potter [Wed, 9 Nov 2016 20:27:37 +0000 (14:27 -0600)]
base: remove header file to prevent a macro name collision

7 years agosyscall_emul: implement fallocate
Brandon Potter [Thu, 15 Dec 2016 18:16:25 +0000 (13:16 -0500)]
syscall_emul: implement fallocate

7 years agosyscall_emul: add support for x86 statfs system calls
Brandon Potter [Thu, 15 Dec 2016 18:16:03 +0000 (13:16 -0500)]
syscall_emul: add support for x86 statfs system calls

7 years agosyscall_emul: extend sysinfo system call to include mem_unit
Brandon Potter [Thu, 15 Dec 2016 18:14:41 +0000 (13:14 -0500)]
syscall_emul: extend sysinfo system call to include mem_unit

7 years agodev: Fix race conditions at terminating dist-gem5 simulations
Gabor Dozsa [Tue, 6 Dec 2016 17:33:06 +0000 (17:33 +0000)]
dev: Fix race conditions at terminating dist-gem5 simulations

Two problems may arise when a distributed gem5 simulation terminates:
(i) simulation thread(s) may get stuck in an incomplete synchronisation
event which prohibits processing  the simulation exit event; and (ii) a
stale receiver thread may try to access objects that have already been
deleted while exiting gem5. This patch terminates receive threads properly
and aborts the processing of any incomplete synchronisation event.

Change-Id: I72337aa12c7926cece00309640d478b61e55a429
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoarm, config: Add missing IOCache in bL config
Gabor Dozsa [Tue, 6 Dec 2016 17:10:36 +0000 (17:10 +0000)]
arm, config: Add missing IOCache in bL config

This patch adds an IOCache to the example bigLITTLE
configuration. An IOCache is required for correct DMA
transfers when we have caches in the system.

Change-Id: Ifeddc1b360aacbb16b1393f361dd98873c834012
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
7 years agoruby: Remove RubyMemoryControl and associated files
Andreas Hansson [Mon, 5 Dec 2016 21:49:07 +0000 (16:49 -0500)]
ruby: Remove RubyMemoryControl and associated files

This patch removes the deprecated RubyMemoryControl. The DRAMCtrl
module should be used instead.

7 years agostats: Update stats to reflect cache changes
Andreas Hansson [Mon, 5 Dec 2016 21:48:34 +0000 (16:48 -0500)]
stats: Update stats to reflect cache changes

7 years agoconfig: Add an option to generate a random topology in memcheck
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:31 +0000 (16:48 -0500)]
config: Add an option to generate a random topology in memcheck

This change adds the option to use the memcheck with random memory
hierarchies at the moment limited to a maximum depth of 3 allowing
testing with uncommon topologies.

Change-Id: Id2c2fe82a8175d9a67eb4cd7f3d2e2720a809b60
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
7 years agoconfig: Add whole line accesses to improve memchecker's coverage
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:30 +0000 (16:48 -0500)]
config: Add whole line accesses to improve memchecker's coverage

Change-Id: Ie1a047139e350ce7400f3a20be644eaff1e21428
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
7 years agomem: Respond to InvalidateReq when the block is (pending) dirty
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:29 +0000 (16:48 -0500)]
mem: Respond to InvalidateReq when the block is (pending) dirty

Previously when an InvalidateReq snooped a cache with a dirty block or
a pending modified MSHR, it would invalidate the block or set the
postInv flag. The cache would not send an InvalidateResp. though,
causing memory order violations. This patches changes this behavior,
making the cache with the dirty block or pending modified MSHR the
ordering point.

Change-Id: Ib4c31012f4f6693ffb137cd77258b160fbc239ca
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
7 years agomem: Invalidate a blk when servicing the 1st invalidating target
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:28 +0000 (16:48 -0500)]
mem: Invalidate a blk when servicing the 1st invalidating target

Previously an MSHR with one or more invalidating targets would first
service all targets in the MSHR TargetList and then invalidate the
block. As a result any service snooping targets would lookup in the
cache and incorrectly find the block. This patch forces the
invalidation to happen when the first invalidating target is
encountered.

Change-Id: I9df15de24e1d351cd96f5a2c424d9a03d81c2cce
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
7 years agomem: Allow non invalidating snoops on an InvalidateReq MSHR
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:27 +0000 (16:48 -0500)]
mem: Allow non invalidating snoops on an InvalidateReq MSHR

This patch changes an assertion that previously assumed that a non
invalidating snoop request should never be serviced by an
InvalidateReq MSHR. The MSHR serves as the ordering point for the
snooping packet. When the InvalidateResp reaches the cache the
snooping packet snoops the caches above to find the requested
block. One or more of the caches above will have the block since
earlier it has seen a WriteLineReq.

Change-Id: I0c147c8b5d5019e18bd34adf9af0fccfe431ae07
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
7 years agomem: Don't use hasSharers in the snoopFilter for memory responses
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:26 +0000 (16:48 -0500)]
mem: Don't use hasSharers in the snoopFilter for memory responses

When the snoopFilter receives a response, it updates its state using
the hasSharers flag (indicates whether there are more than one copies
of the block in the caches above). The hasSharers flag of the packet
was previously populated when the request was traversing and snooping
the caches looking for the block.
1) When the response is coming from the memory-side port, its order
with respect to other responses is not necessarily preserved (e.g., a
request that arrived second to the xbar can get its response first). As
a result the snoopFilter might process responses out of order updating
its residency information using the non valid hasSharers flag which was
populated much earlier.
2) When the response is from an on-chip, the MSHRs preserve a well
defined order and the hasSharers flag should contain valid
information.

This patch changes the snoopFilter by avoiding the hasSharers flag
when the response is from the memory-side port.

Change-Id: Ib2d22a5b7bf3eccac64445127d2ea20ee74bb25b
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Stephan Diestelhorst <stephan.diestelhorst@arm.com>
7 years agomem: Always use InvalidateReq to service WriteLineReq misses
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:25 +0000 (16:48 -0500)]
mem: Always use InvalidateReq to service WriteLineReq misses

Previously, a WriteLineReq that missed in a cache would send out an
InvalidateReq if the block lookup failed or an UpgradeReq if the
block lookup succeeded but the block had sharers. This changes ensures
that a WriteLineReq always sends an InvalidateReq to invalidate all
copies of the block and satisfy the WriteLineReq.

Change-Id: I207ff5b267663abf02bc0b08aeadde69ad81be61
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
7 years agomem: Assert that the responderHadWritable is set only once
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:24 +0000 (16:48 -0500)]
mem: Assert that the responderHadWritable is set only once

Change-Id: Ie3beeef25331f84a0a5bcc17f7a791f4a829695b
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Stephan Diestelhorst <stephan.diestelhorst@arm.com>
7 years agomem: Ensure InvalidateReq is considered isForward by MSHRs
Andreas Hansson [Mon, 5 Dec 2016 21:48:23 +0000 (16:48 -0500)]
mem: Ensure InvalidateReq is considered isForward by MSHRs

This patch fixes an issue where an MSHR would incorrectly be perceived
to provide data to targets arriving after an InvalidateReq. To address
this the InvalidateReq is now treated as isForward, much like an
UpgradeReq that did not hit in the cache.

Change-Id: Ia878444d949539b5c33fd19f3e12b0b8a872275e
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Stephan Diestelhorst <stephan.diestelhorst@arm.com>
7 years agomem: Make packet debug printing more uniform
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:21 +0000 (16:48 -0500)]
mem: Make packet debug printing more uniform

Previously DPRINTFs printing information about a packet would use ad hoc
formats. This patch changes all DPRINTFs to use the print function
defined by the packet class, making the packet printing format more
uniform and easier to change.

Change-Id: Idd436a9758d4bf70c86a574d524648b2a2580970
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Stephan Diestelhorst <stephan.diestelhorst@arm.com>
7 years agocpu: Change traffic generators to use different values for writes
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:20 +0000 (16:48 -0500)]
cpu: Change traffic generators to use different values for writes

Previously all traffic generators would use the same value for write
requests. With this change traffic generators use their master id as
the payload of write requests making them more useful for the
memchecker.

Change-Id: Id1a6b8f02853789b108ef6003f4c32ab929bb123
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Stephan Diestelhorst <stephan.diestelhorst@arm.com>
7 years agomem: Service only the 1st FromCPU MSHR target on ReadRespWithInv
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:19 +0000 (16:48 -0500)]
mem: Service only the 1st FromCPU MSHR target on ReadRespWithInv

A response to a ReadReq can either be a ReadResp or a
ReadRespWithInvalidate. As we add targets to an MSHR for a ReadReq we
assume that the response will be a ReadResp. When the response is
invalidating (ReadRespWithInvalidate) servicing more than one targets
can potentially violate the memory ordering. This change fixes the way
we handle a ReadRespWithInvalidate. When a cache receives a
ReadRespWithInvalidate we service only the first FromCPU target and
all the FromSnoop targets from the MSHR target list. The rest of the
FromCPU targets are deferred and serviced by a new request.

Change-Id: I75c30c268851987ee5f8644acb46f440b4eeeec2
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Stephan Diestelhorst <stephan.diestelhorst@arm.com>
7 years agomem: Keep track of allocOnFill in the TargetList
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:18 +0000 (16:48 -0500)]
mem: Keep track of allocOnFill in the TargetList

Previously the information of whether a response was allocating or not
was a property of the MSHR. This change makes this flag a property of
the TargetList. Differernt TargetLists, e.g. the targets and the
deferred targets lists might have different values. Additionally, the
information about whether each of the target expects an allocating
response is stored inside the TargetList container. This allows for
repopulating the flag in case some of the targets are removed.

Change-Id: If3ec2516992f42a6d9da907009ffe3ab8d0d2021
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Stephan Diestelhorst <stephan.diestelhorst@arm.com>
7 years agomem: Add support for repopulating the flags of an MSHR TargetList
Nikos Nikoleris [Mon, 5 Dec 2016 21:48:17 +0000 (16:48 -0500)]
mem: Add support for repopulating the flags of an MSHR TargetList

This patch adds support for repopulating the flags of an MSHR
TargetList. The added functionality makes it possible to remove
targets from a TargetList without leaving it in an inconsistent state.

Change-Id: I3f7a8e97bfd3e2e49bebad056d11bbfb087aad91
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Stephan Diestelhorst <stephan.diestelhorst@arm.com>
7 years agohsail: disable asserts to allow immediate operands i.e. 0 with loads
Brandon Potter [Fri, 2 Dec 2016 23:01:58 +0000 (18:01 -0500)]
hsail: disable asserts to allow immediate operands i.e. 0 with loads

7 years agohsail: add stub type and stub out several instructions
Brandon Potter [Fri, 2 Dec 2016 23:01:57 +0000 (18:01 -0500)]
hsail: add stub type and stub out several instructions

7 years agohsail: add popcount type and generate popcount instructions
Brandon Potter [Fri, 2 Dec 2016 23:01:55 +0000 (18:01 -0500)]
hsail: add popcount type and generate popcount instructions

7 years agohsail: add a wavesize case statement to register operand code
Brandon Potter [Fri, 2 Dec 2016 23:01:52 +0000 (18:01 -0500)]
hsail: add a wavesize case statement to register operand code

7 years agohsail: generate mov instructions for more arith_types and bit_types
Brandon Potter [Fri, 2 Dec 2016 23:01:49 +0000 (18:01 -0500)]
hsail: generate mov instructions for more arith_types and bit_types

7 years agohsail: remove the panic guarding function directives
Brandon Potter [Fri, 2 Dec 2016 23:01:42 +0000 (18:01 -0500)]
hsail: remove the panic guarding function directives

HSA functions calls are still not supported properly with HSAIL, but
the recent AMP runtime modifications rely on being able to parse the
BRIG/HSAIL files that are extracted from the application binaries.
We need to parse the function call HSAIL definitions, but we do not
actually need to make the function calls.

The reason that this happens is that HCC appends a set of routines
to every HSAIL binary that it creates. These extra, unnecessary
routines exist in the HCC source as a file; this file is cat'd onto
everything that the compiler outputs before being assembled into the
application's binary. HCC does this because it might call these helper
functions. However, it doesn't actually appear to do so in the AMP
codes so we just parse these functions with the HSAIL parser and
then ignore them.

7 years agohsail: fix unsigned offset bug in address calculation
Tony Gutierrez [Fri, 2 Dec 2016 16:40:52 +0000 (11:40 -0500)]
hsail: fix unsigned offset bug in address calculation

it's possible for the offset provided to an HSAIL mem inst to be a negative
value, however the variable we use to hold the offset is an unsigned type.
this can lead to excessively large offset values when the offset is negative,
which will almost certainly cause the access to go out of bounds.

7 years agoruby: Fix overflow reported by ASAN in MessageBuffer.
Matthew Poremba [Fri, 2 Dec 2016 16:40:40 +0000 (11:40 -0500)]
ruby: Fix overflow reported by ASAN in MessageBuffer.

In MessageBuffer the m_not_avail_count member is incremented but not used.
This causes an overflow reported by ASAN. This patch changes from an int to
Stats::Scalar, since the count is useful in debugging finite MessageBuffers.

7 years agotests: Regression stats updated for recent patches
Jason Lowe-Power [Wed, 30 Nov 2016 22:12:59 +0000 (17:12 -0500)]
tests: Regression stats updated for recent patches

7 years agoriscv: [Patch 8/5] Added some regression tests to RISC-V
Alec Roelke [Wed, 30 Nov 2016 22:12:56 +0000 (17:12 -0500)]
riscv: [Patch 8/5] Added some regression tests to RISC-V

This patch is the eighth patch in a series adding RISC-V to gem5, and
third of the bonus patches to the original series of five. It adds some
regression tests to RISC-V.

Regression tests included:
- se/00.hello
- se/02.insttest (split into several binaries which are not included due
  to large size)

The tests added to 00.insttest will need to be build manually; to
facilitate this, a Makefile is included. The required toolchain and
compiler (riscv64-unknown-elf-gcc) can be built from the riscv-tools
GitHub repository at https://github.com/riscv/riscv-tools.

Note that because EBREAK only makes sense when gdb is running or while in
FS mode, it is not included in the linux-rv64i insttest. ERET is not
included because it does not make sense in SE mode and, in fact, causes
a panic by design.

Note also that not every system call is tested in linux-rv64i; of the ones
defined in linux/process.hh, some have been given numbers but not
definitions for the toolchain, or are merely stubs that always return 0. Of
the ones that do work properly, only a subset are tested due to similar
functionality.

Signed-off by: Alec Roelke

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

7 years agoriscv: [Patch 7/5] Corrected LRSC semantics
Alec Roelke [Wed, 30 Nov 2016 22:10:28 +0000 (17:10 -0500)]
riscv: [Patch 7/5] Corrected LRSC semantics

RISC-V makes use of load-reserved and store-conditional instructions to
enable creation of lock-free concurrent data manipulation as well as
ACQUIRE and RELEASE semantics for memory ordering of LR, SC, and AMO
instructions (the latter of which do not follow LR/SC semantics). This
patch is a correction to patch 4, which added these instructions to the
implementation of RISC-V. It modifies locked_mem.hh and the
implementations of lr.w, sc.w, lr.d, and sc.d to apply the proper gem5
flags and return the proper values.

An important difference between gem5's LLSC semantics and RISC-V's LR/SC
ones, beyond the name, is that gem5 uses 0 to indicate failure and 1 to
indicate success, while RISC-V is the opposite. Strictly speaking, RISC-V
uses 0 to indicate success and nonzero to indicate failure where the
value would indicate the error, but currently only 1 is reserved as a
failure code by the ISA reference.

This is the seventh patch in the series which originally consisted of five
patches that added the RISC-V ISA to gem5. The original five patches added
all of the instructions and added support for more detailed CPU models and
the sixth patch corrected the implementations of Linux constants and
structs. There will be an eighth patch that adds some regression tests
for the instructions.

[Removed some commented-out code from locked_mem.hh.]
Signed-off by: Alec Roelke

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

7 years agoriscv: [Patch 6/5] Improve Linux emulation for RISC-V
Alec Roelke [Wed, 30 Nov 2016 22:10:28 +0000 (17:10 -0500)]
riscv: [Patch 6/5] Improve Linux emulation for RISC-V

This is an add-on patch for the original series that implemented RISC-V
that improves the implementation of Linux emulation for SE mode. Basically
it cleans up linux/linux.hh by removing constants that haven't been
defined for the RISC-V Linux proxy kernel and rearranging the stat
struct so it aligns with RISC-V's implementation of it. It also adds
placeholders for system calls that have been given numbers in RISC-V
but haven't been given implementations yet. These system calls are
as follows:
- readlinkat
- sigprocmask
- ioctl
- clock_gettime
- getrusage
- getrlimit
- setrlimit

The first five patches implemented RISC-V with the base ISA and multiply,
floating point, and atomic extensions and added support for detailed
CPU models with memory timing.

[Fixed incompatibility with changes made from patch 1.]
Signed-off by: Alec Roelke

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

7 years agoriscv: [Patch 5/5] Added missing support for timing CPU models
Alec Roelke [Wed, 30 Nov 2016 22:10:28 +0000 (17:10 -0500)]
riscv: [Patch 5/5] Added missing support for timing CPU models

Last of five patches adding RISC-V to GEM5. This patch adds support for
timing, minor, and detailed CPU models that was missing in the last four,
which basically consists of handling timing-mode memory accesses and
telling the minor and detailed models what a no-op instruction should
be (addi zero, zero, 0).

Patches 1-4 introduced RISC-V and implemented the base instruction set,
RV64I, and added the multiply, floating point, and atomic memory
extensions, RV64MAFD.

[Fixed compatibility with edit from patch 1.]
[Fixed compatibility with hg copy edit from patch 1.]
[Fixed some style errors in locked_mem.hh.]
Signed-off by: Alec Roelke

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

7 years agoriscv: [Patch 4/5] Added RISC-V atomic memory extension RV64A
Alec Roelke [Wed, 30 Nov 2016 22:10:28 +0000 (17:10 -0500)]
riscv: [Patch 4/5] Added RISC-V atomic memory extension RV64A

Fourth of five patches adding RISC-V to GEM5. This patch adds the RV64A
extension, which includes atomic memory instructions. These instructions
atomically read a value from memory, modify it with a value contained in a
source register, and store the original memory value in the destination
register and modified value back into memory. Because this requires two
memory accesses and GEM5 does not support two timing memory accesses in
a single instruction, each of these instructions is split into two micro-
ops: A "load" micro-op, which reads the memory, and a "store" micro-op,
which modifies and writes it back.  Each atomic memory instruction also has
two bits that acquire and release a lock on its memory location.
Additionally, there are atomic load and store instructions that only either
load or store, but not both, and can acquire or release memory locks.

Note that because the current implementation of RISC-V only supports one
core and one thread, it doesn't make sense to make use of AMO instructions.
However, they do form a standard extension of the RISC-V ISA, so they are
included mostly as a placeholder for when multithreaded execution is
implemented.  As a result, any tests for their correctness in a future
patch may be abbreviated.

Patch 1 introduced RISC-V and implemented the base instruction set, RV64I;
patch 2 implemented the integer multiply extension, RV64M; and patch 3
implemented the single- and double-precision floating point extensions,
RV64FD.

Patch 5 will add support for timing, minor, and detailed CPU models that
isn't present in patches 1-4.

[Added missing file amo.isa]
[Replaced information removed from initial patch that was missed during
division into multiple patches.]
[Fixed some minor formatting issues.]
[Fixed oversight where LR and SC didn't have both AQ and RL flags.]
Signed-off by: Alec Roelke

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

7 years agoriscv: [Patch 3/5] Added RISCV floating point extensions RV64FD
Alec Roelke [Wed, 30 Nov 2016 22:10:28 +0000 (17:10 -0500)]
riscv: [Patch 3/5] Added RISCV floating point extensions RV64FD

Third of five patches adding RISC-V to GEM5. This patch adds the RV64FD
extensions, which include single- and double-precision floating point
instructions.

Patch 1 introduced RISC-V and implemented the base instruction set, RV64I
and patch 2 implemented the integer multiply extension, RV64M.

Patch 4 will implement the atomic memory instructions, RV64A, and patch
5 will add support for timing, minor, and detailed CPU models that is
missing from the first four patches.

[Fixed exception handling in floating-point instructions to conform better
to IEEE-754 2008 standard and behavior of the Chisel-generated RISC-V
simulator.]
[Fixed style errors in decoder.isa.]
[Fixed some fuzz caused by modifying a previous patch.]
Signed-off by: Alec Roelke

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

7 years agoriscv: [Patch 2/5] Added RISC-V multiply extension RV64M
Alec Roelke [Wed, 30 Nov 2016 22:10:28 +0000 (17:10 -0500)]
riscv: [Patch 2/5] Added RISC-V multiply extension RV64M

Second of five patches adding RISC-V to GEM5.  This patch adds the
RV64M extension, which includes integer multiply and divide instructions.

Patch 1 introduced RISC-V and implemented the base instruction set, RV64I.

Patch 3 will implement the floating point extensions, RV64FD; patch 4 will
implement the atomic memory instructions, RV64A; and patch 5 will add
support for timing, minor, and detailed CPU models that is missing from
the first four patches.

[Added mulw instruction that was missed when dividing changes among
patches.]
Signed-off by: Alec Roelke

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

7 years agoarch: [Patch 1/5] Added RISC-V base instruction set RV64I
Alec Roelke [Wed, 30 Nov 2016 22:10:28 +0000 (17:10 -0500)]
arch: [Patch 1/5] Added RISC-V base instruction set RV64I

First of five patches adding RISC-V to GEM5. This patch introduces the
base 64-bit ISA (RV64I) in src/arch/riscv for use with syscall emulation.
The multiply, floating point, and atomic memory instructions will be added
in additional patches, as well as support for more detailed CPU models.
The loader is also modified to be able to parse RISC-V ELF files, and a
"Hello world\!" example for RISC-V is added to test-progs.

Patch 2 will implement the multiply extension, RV64M; patch 3 will implement
the floating point (single- and double-precision) extensions, RV64FD;
patch 4 will implement the atomic memory instructions, RV64A, and patch 5
will add support for timing, minor, and detailed CPU models that is missing
from the first four patches (such as handling locked memory).

[Removed several unused parameters and imports from RiscvInterrupts.py,
RiscvISA.py, and RiscvSystem.py.]
[Fixed copyright information in RISC-V files copied from elsewhere that had
ARM licenses attached.]
[Reorganized instruction definitions in decoder.isa so that they are sorted
by opcode in preparation for the addition of ISA extensions M, A, F, D.]
[Fixed formatting of several files, removed some variables and
instructions that were missed when moving them to other patches, fixed
RISC-V Foundation copyright attribution, and fixed history of files
copied from other architectures using hg copy.]
[Fixed indentation of switch cases in isa.cc.]
[Reorganized syscall descriptions in linux/process.cc to remove large
number of repeated unimplemented system calls and added implmementations
to functions that have received them since it process.cc was first
created.]
[Fixed spacing for some copyright attributions.]
[Replaced the rest of the file copies using hg copy.]
[Fixed style check errors and corrected unaligned memory accesses.]
[Fix some minor formatting mistakes.]
Signed-off by: Alec Roelke

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

7 years agomem: Split the hit_latency into tag_latency and data_latency
Sophiane Senni [Wed, 30 Nov 2016 22:10:27 +0000 (17:10 -0500)]
mem: Split the hit_latency into tag_latency and data_latency

If the cache access mode is parallel, i.e. "sequential_access" parameter
is set to "False", tags and data are accessed in parallel. Therefore,
the hit_latency is the maximum latency between tag_latency and
data_latency. On the other hand, if the cache access mode is
sequential, i.e. "sequential_access" parameter is set to "True",
tags and data are accessed sequentially. Therefore, the hit_latency
is the sum of tag_latency plus data_latency.

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
7 years agocpu: Remove branch predictor function predictInOrder
Jason Lowe-Power [Wed, 30 Nov 2016 22:10:27 +0000 (17:10 -0500)]
cpu: Remove branch predictor function predictInOrder

This function was used by the now-defunct InOrderCPU model. Since this
model is no longer in gem5, this function was not called from anywhere in
the code.

7 years agotests: Check for TrafficGen as part of memcheck regression
Andreas Hansson [Wed, 30 Nov 2016 16:15:21 +0000 (11:15 -0500)]
tests: Check for TrafficGen as part of memcheck regression

Since protobuf is still considered optional we do not always have the
TrafficGen. Check before running the memcheck regression.

7 years agodev: Fix buffer length when unserializing an eth pkt
Michael LeBeane [Tue, 29 Nov 2016 18:04:45 +0000 (13:04 -0500)]
dev: Fix buffer length when unserializing an eth pkt

Changeset 11701 only serialized the useful portion of of an ethernet packets'
payload. However, the device models expect each ethernet packet to contain
a 16KB buffer, even if there is no data in it. This patch adds a 'bufLength'
field to EthPacketData so the original size of the packet buffer can always
be unserialized.

Reported-by: Gabor Dozsa <Gabor.Dozsa@arm.com>
7 years agoscons: fix sanitizer flags with multiple sanitizers
Joe Gross [Mon, 28 Nov 2016 17:44:54 +0000 (12:44 -0500)]
scons: fix sanitizer flags with multiple sanitizers

There has been some problem when using address and undefined-behavior
sanitizers at the same time. This patch will look for the special case
where both are enabled at once and change the flags passed to the compiler
to reflect this.

7 years agostyle: Add options to select checkers and apply fixes
Andreas Sandberg [Fri, 25 Nov 2016 10:33:15 +0000 (10:33 +0000)]
style: Add options to select checkers and apply fixes

Add an option, --checker/-c, to style.py that selects individual style
checkers to apply. When this option isn't specified, the script
defaults to all available style checkers. The option may be specified
multiple times to run multiple style checkers.

The option, --fix/-f, can be specified to automatically fix style
violations.

Change-Id: Id7597fba6b65cecfa17a88b1c87c8a4c8315af59
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
7 years agoutil: git pre-commit hook to check staged files
Rekai Gonzalez Alberquilla [Fri, 25 Nov 2016 10:31:21 +0000 (10:31 +0000)]
util: git pre-commit hook to check staged files

This patch updates the git-pre-commit hook to check the files as they
will be after the commit, instead of as they are currently, this way we
prevent the undesired situation:
    - unstylish modification of a file
    - stage said file for commit
    - try to commit and fail due to style
    - fix style, forgetting staging changes
    - try to commit and fail, as although the changes staged are not
      styly, the current content of the file is.

Change-Id: I5cc3f783375d9e4162e310e176103ebbf0a59023
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
[andreas.sandberg@arm.com: Rebased ontop of latest gem5]

7 years agoruby: Fix potential bugs in garnet2.0
Jieming Yin [Mon, 21 Nov 2016 20:41:30 +0000 (15:41 -0500)]
ruby: Fix potential bugs in garnet2.0

1. Delete unused variable from struct LinkEntry
2. Correct GarnetExtLink and GarnetIntLink inheritance

7 years agogpu-compute: fix segfault when constructing GPUExecContext
Tony Gutierrez [Mon, 21 Nov 2016 20:40:03 +0000 (15:40 -0500)]
gpu-compute: fix segfault when constructing GPUExecContext

the GPUExecContext context currently stores a reference to its parent WF's
GPUISA object, however there are some special instructions that do not have
an associated WF. when these objects are constructed they set their WF pointer
to null, which causes the GPUExecContext to segfault when trying to
dereference
the WF pointer to get at the WF's GPUISA object. here we change the GPUISA
reference in the GPUExecContext class to a pointer so that it may be set to
null.

7 years agogpu-compute: init valid field of GpuTlbEntry in default ctor
Tony Gutierrez [Mon, 21 Nov 2016 20:38:30 +0000 (15:38 -0500)]
gpu-compute: init valid field of GpuTlbEntry in default ctor

valid field for GpuTlbEntry is not set in the default ctor, which can
lead to strange behavior, and is also flagged by UBSAN.

7 years agoruby: add default ctor for MachineID type
Tony Gutierrez [Mon, 21 Nov 2016 20:37:07 +0000 (15:37 -0500)]
ruby: add default ctor for MachineID type

not all uses of MachineID initialize its fields, so here we add a default
ctor.

7 years agox86: fix issue with casting in Cvtf2i
Tony Gutierrez [Mon, 21 Nov 2016 20:35:56 +0000 (15:35 -0500)]
x86: fix issue with casting in Cvtf2i

UBSAN flags this operation because it detects that arg is being cast directly
to an unsigned type, argBits. this patch fixes this by first casting the
value to a signed int type, then reintrepreting the raw bits of the signed
int into argBits.

7 years agoruby: init MessageSizeType of SequencerMsg to Request_Control
Sooraj Puthoor [Sat, 19 Nov 2016 17:39:04 +0000 (12:39 -0500)]
ruby: init MessageSizeType of SequencerMsg to Request_Control

SequencerMsg is autogenerated by slicc scripts and the MessageSizeType is
initialized to the max enume value by default. The DMASequencer pushes this
message to the mandatory queue and since the MessageSizeType is unitialized,
string_to_MessageSizeType() function used by traces to print the message fails
with a panic. This patch avoids this problem by initializing MessageSizeType
of SequencerMsg to Request_Control.

7 years agox86: fix loading/storing of Float80 types
Tony Gutierrez [Sat, 19 Nov 2016 17:35:14 +0000 (12:35 -0500)]
x86: fix loading/storing of Float80 types

7 years agoext: Update fputils to rev 13589cd
Andreas Sandberg [Fri, 18 Nov 2016 18:08:20 +0000 (18:08 +0000)]
ext: Update fputils to rev 13589cd

This patch updates fputils to the latest revision (13589cd) from the
upstream repository (github.com/andysan/fputils).

7 years agostats, alpha: Update ALPHA stats
Andreas Hansson [Thu, 17 Nov 2016 09:54:18 +0000 (04:54 -0500)]
stats, alpha: Update ALPHA stats

Reflect the removal of the syscall tracking.

7 years agotests, ruby: Move rubytests from ALPHA (linux) to NULL (none)
Andreas Hansson [Thu, 17 Nov 2016 09:54:16 +0000 (04:54 -0500)]
tests, ruby: Move rubytests from ALPHA (linux) to NULL (none)

This patch avoids compiling ALPHA six times as part of running
'util/regress', and instead relis on NULL with different protocols to
run the rubytest. All we need is the memory system, so there is really
no need to compile the ISA over and over again.

The one downside is the removal of running 'hello' for the variuos
ALPHA and protocol combinations, but if this is a concern we should
rather beef up the synthetic tests for the variuos protocols.

--HG--
rename : build_opts/NULL => build_opts/NULL_MESI_Two_Level
rename : build_opts/NULL => build_opts/NULL_MOESI_CMP_directory
rename : build_opts/NULL => build_opts/NULL_MOESI_CMP_token
rename : build_opts/NULL => build_opts/NULL_MOESI_hammer
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MESI_Two_Level/config.ini => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MESI_Two_Level/config.ini
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MESI_Two_Level/simerr => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MESI_Two_Level/simerr
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MESI_Two_Level/simout => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MESI_Two_Level/simout
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MESI_Two_Level/stats.txt => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MESI_Two_Level/stats.txt
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_CMP_directory/config.ini => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_CMP_directory/config.ini
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_CMP_directory/simerr => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_CMP_directory/simerr
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_CMP_directory/simout => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_CMP_directory/simout
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_CMP_directory/stats.txt => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_CMP_directory/stats.txt
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_CMP_token/config.ini => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_CMP_token/config.ini
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_CMP_token/simerr => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_CMP_token/simerr
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_CMP_token/simout => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_CMP_token/simout
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_CMP_token/stats.txt => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_CMP_token/stats.txt
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_hammer/config.ini => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_hammer/config.ini
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_hammer/simerr => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_hammer/simerr
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_hammer/simout => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_hammer/simout
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby-MOESI_hammer/stats.txt => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby-MOESI_hammer/stats.txt
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby/config.ini => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby/config.ini
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby/simerr => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby/simerr
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby/simout => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby/simout
rename : tests/quick/se/60.rubytest/ref/alpha/linux/rubytest-ruby/stats.txt => tests/quick/se/60.rubytest/ref/null/none/rubytest-ruby/stats.txt

7 years agoalpha: Remove ALPHA tru64 support and associated tests
Andreas Hansson [Thu, 17 Nov 2016 09:54:14 +0000 (04:54 -0500)]
alpha: Remove ALPHA tru64 support and associated tests

No one appears to be using it, and it is causing build issues
and increases the development and maintenance effort.

7 years agohsail,gpu-compute: fixes to appease clang++
Tony Gutierrez [Thu, 27 Oct 2016 02:48:45 +0000 (22:48 -0400)]
hsail,gpu-compute: fixes to appease clang++

fixes to appease clang++. tested on:

Ubuntu clang version 3.5.0-4ubuntu2~trusty2
(tags/RELEASE_350/final) (based on LLVM 3.5.0)

Ubuntu clang version 3.6.0-2ubuntu1~trusty1
(tags/RELEASE_360/final) (based on LLVM 3.6.0)

the fixes address the following five issues:

1) the exec continuations in gpu_static_inst.hh were marked
   as protected when they should be public. here we mark
   them as public

2) the Abs instruction uses std::abs() in its execute method.
   because Abs is templated, it can also operate on U32 and U64,
   types, which cause Abs::execute() to pass uint32_t and uint64_t
   types to std::abs() respectively. this triggers a warning
   because std::abs() has no effect in this case. to rememdy this
   we add template specialization for the execute() method of Abs
   when its template paramter is U32 or U64.

3) Some potocols that utilize the code in cprintf.hh were missing
   includes to BoolVec.hh, which defines operator<< for the BoolVec
   type. This would cause issues when the generated code would try
   to pass a BoolVec type to a method in cprintf.hh that used
   operator<< on an instance of a BoolVec.

4) Surprise, clang doesn't like it when you clobber all the bits
   in a newly allocated object. I.e., this code:

   tlb = new GpuTlbEntry\[size\];
   std::memset(tlb, 0, sizeof(GpuTlbEntry) \* size);

   Let's use std::vector to track the TLB entries in the GpuTlb now...

5) There were a few variables used only in DPRINTFs, so we mark them
   with M5_VAR_USED.

7 years agodev: Add m5 op to toggle synchronization for dist-gem5.
Michael LeBeane [Thu, 27 Oct 2016 02:48:40 +0000 (22:48 -0400)]
dev: Add m5 op to toggle synchronization for dist-gem5.
This patch adds the ability for an application to request dist-gem5 to begin/
end synchronization using an m5 op. When toggling on sync, all nodes agree
on the next sync point based on the maximum of all nodes' ticks. CPUs are
suspended until the sync point to avoid sending network messages until sync has
been enabled. Toggling off sync acts like a global execution barrier, where
all CPUs are disabled until every node reaches the toggle off point. This
avoids tricky situations such as one node hitting a toggle off followed by a
toggle on before the other nodes hit the first toggle off.