gem5.git
4 years agox86: Stop setting the physical address in finalizePhysical.
Gabe Black [Fri, 15 May 2020 23:29:20 +0000 (16:29 -0700)]
x86: Stop setting the physical address in finalizePhysical.

The physical address has already been set (it's read earlier in the
function), and so doesn't need to be set again. Reading the virtual
address can cause an assert if the virtual address had never been set in
the first place, for example when an access comes from KVM which might
give you an access to complete which is based on a physical address
only.

Change-Id: Ic46a40b1a94235538b5bd53065e5019273b3d3f3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29172
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Pouya Fotouhi <pfotouhi@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Added 'python3-config' to the config list
Bobby R. Bruce [Wed, 6 May 2020 00:13:51 +0000 (17:13 -0700)]
scons: Added 'python3-config' to the config list

Previously scons looked for 'python-config' and 'python2-config'. This
caused an error in Python3-exclusive environments. With only python3
installed, 'python3-config' is now an option. With this setup,
'python2-config' is used by default, unless overridden by the user
via the scons command line.

Change-Id: I11186328b0eb0825cc53c3889b31a5345a7f40d1
Issue-on: https://gem5.atlassian.net/browse/GEM5-275
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28648
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoutil: Update style file->open for python3
Jason Lowe-Power [Thu, 14 May 2020 00:32:58 +0000 (17:32 -0700)]
util: Update style file->open for python3

Change-Id: Ibcce194b1905f0e7f29aa91fd0ff881ba879ad51
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29068
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
4 years agomisc: Add Arm contributions to gem5-20 RELEASE-NOTES.md
Giacomo Travaglini [Tue, 12 May 2020 08:42:15 +0000 (09:42 +0100)]
misc: Add Arm contributions to gem5-20 RELEASE-NOTES.md

* Arm architectural extensions
* Arm TFA support
* DRAM changes

Change-Id: I434c501ee8413c8cd64af25c2c18eabf45e3ee77
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Wendy Elsasser <wendy.elsasser@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28908
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agox86: Set a physical address for local accesses.
Gabe Black [Tue, 12 May 2020 22:02:00 +0000 (15:02 -0700)]
x86: Set a physical address for local accesses.

This avoids problems when other parts of the simulator blindly try to
retrieve the physical address.

Change-Id: Ia13a2b85b9f919e1e81a6a0f67d10858e98244e5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28987
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Fixes for mremap
Matthew Poremba [Tue, 12 May 2020 14:56:07 +0000 (09:56 -0500)]
sim: Fixes for mremap

Remapping memory was trying to map old pages to the same new page and
calling MemState mapRegion unnecessarily. Properly increment the new
page address and remove the redundant mapRegion as remapRegion covers
its functionality.

JIRA: https://gem5.atlassian.net/browse/GEM5-475
Change-Id: Ie360755cfe488b09cbd87cd0ce525b11ac446b51
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28948
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Get gem5 to build with Clang 8
Mark Hildebrand [Tue, 12 May 2020 17:06:01 +0000 (10:06 -0700)]
misc: Get gem5 to build with Clang 8

Added missing overrides:
- src/mem/token_port.hh
- src/sim/power/mathexpr_powermodel.hh

Remove Unused static constants:
- src/arch/x86/process.cc

Related Issue: https://gem5.atlassian.net/projects/GEM5/issues/GEM5-534

Change-Id: Icc725e2522dcee919e299f4ea7a9f1773f5dfa4d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28947
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Added missing optional dependencies to 18.04 Docker
Bobby R. Bruce [Mon, 11 May 2020 18:08:01 +0000 (11:08 -0700)]
misc: Added missing optional dependencies to 18.04 Docker

Change-Id: Ibc43664f99ce9fbd28d14352243fb17b7754289b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28892
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Added python-six as a dependency in 18.04 docker
Bobby R. Bruce [Mon, 11 May 2020 17:46:12 +0000 (10:46 -0700)]
misc: Added python-six as a dependency in 18.04 docker

Previously the docker utilized Python-Pip. This is an intermediate
dependency we don't need. We can install the Python-six module directly
via the APT framework.

Change-Id: I30e3e1cdca802ca19422140f39af7dc9dc166ed7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28891
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Removed python3 Dockerfile
Bobby R. Bruce [Fri, 8 May 2020 21:54:40 +0000 (14:54 -0700)]
misc: Removed python3 Dockerfile

This was previously used to test gem5 being compiled and run in a
Python3 environment. This is redundant with the introduction of
"util/dockerfiles/ubuntu-20.04_all-dependencies", which uses python3
exclusively.

Change-Id: Ie837da338c3985ba92aff84144948a23fd6ece3f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28890
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Added Dockerfile for Ubuntu 20.04
Bobby R. Bruce [Fri, 8 May 2020 21:42:46 +0000 (14:42 -0700)]
misc: Added Dockerfile for Ubuntu 20.04

This Dockerfile creates an image which simulates an Ubuntu 20.04
environment. Unlike the Ubuntu 18.04 Dockerfile, this does not use
Python2. It uses exclusively Python3. Ubuntu 20.04 has Python3 installed
by default. The image this Dockerfile creates can be obtained from
"gcr.io/gem5-test/ubuntu-20.04_all-dependencies". To pull:

docker pull gcr.io/gem5-test/ubuntu-20.04_all-dependencies

Change-Id: I73b51028e0d6a3198aa6e7b1906d20ed6eb6c815
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28889
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Update python-config flags for python3.8
Jason Lowe-Power [Thu, 7 May 2020 00:38:41 +0000 (17:38 -0700)]
scons: Update python-config flags for python3.8

Starting in python 3.8 the python3-config utility requires the --embed
flag to output -lpython3.8. Without this flag, gem5 won't link to the
python library.

More details: https://bugs.python.org/issue36721
https://github.com/python/cpython/pull/13500

Change-Id: Id9c63577dcd2defa7ae62cc32e042c4a245e7082
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28687
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Add readCommandWithReturn helper
Giacomo Travaglini [Mon, 11 May 2020 09:01:46 +0000 (10:01 +0100)]
scons: Add readCommandWithReturn helper

In this way it will be possible to reliably catch any error
in the command execution which is not raising an exception
to Popen.

Change-Id: I4dc15648423f9bb8e8a470d97291dbd065c48eba
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28847
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv,tests: small update to make gem5.fast compile
Ayaz Akram [Mon, 11 May 2020 19:43:24 +0000 (12:43 -0700)]
arch-riscv,tests: small update to make gem5.fast compile

This small change is meant to enable gem5.fast compilation
for riscv. Also, the riscv tests based on gem5.fast
work now and are removed from .testignore.

Change-Id: Id9c96d8e4682a74ec1d77a66eae53d6f9b64d302
Issue-On: https://gem5.atlassian.net/browse/GEM5-526
Issue-On: https://gem5.atlassian.net/browse/GEM5-527
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28893
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem: Defer deletion of respQueue.front() in DRAMCtrl
Matthew Poremba [Fri, 8 May 2020 22:18:43 +0000 (17:18 -0500)]
mem: Defer deletion of respQueue.front() in DRAMCtrl

The front() of respQueue was being deleted before the last usuage of
dram_pkt (which points to the same object) causing random crashes.

Change-Id: I89862d10599dc0d1a50717dac8ed9298b4d74a3d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28808
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Updated resources bucket url to version 20
Bobby R. Bruce [Wed, 6 May 2020 00:44:34 +0000 (17:44 -0700)]
misc: Updated resources bucket url to version 20

This will fix this v20.0.0.0 of gem5 to the v20 gem5 resources bucket
subdirectory.

Change-Id: I0c1f1a2c28c18e684bcb009d1650f9e9d2950a93
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28708
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Updated version to 20.0.0.0
Bobby R. Bruce [Wed, 6 May 2020 00:40:30 +0000 (17:40 -0700)]
misc: Updated version to 20.0.0.0

Change-Id: I5ba4a6e728b2daccea898685d3c27b0f7c7a02cd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28707
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: MESI_Two_Level missing function compilation fix
Timothy Hayes [Thu, 7 May 2020 11:03:03 +0000 (12:03 +0100)]
mem-ruby: MESI_Two_Level missing function compilation fix

The recent commit dd6cd33 removed the Ruby Sequencer function
invalidateSC in favour of doing this implicitely via
evictionCallback. The protocol MESI_Two_Level still contains one
explicit call to this function, however, this is now superflous
as forward_eviction_to_cpu is called in the same transition. This
patch removes the remaining calls to invalidateSC.

JIRA: https://gem5.atlassian.net/browse/GEM5-499

Change-Id: If51d8bebf6aa39d20789639aab0d262d5173ca59
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28747
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Ayaz Akram <yazakram@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: MOESI_CMP_directory sync fix
Timothy Hayes [Thu, 7 May 2020 10:07:05 +0000 (11:07 +0100)]
mem-ruby: MOESI_CMP_directory sync fix

The recent commit dd6cd33 modified the behaviour of the the Ruby
sequencer to handle load linked requests as loads rather than
stores. This caused the regression test
realview-simple-timing-dual-ruby-ARM-x86_64-opt
to become stuck when booting Linux. This patch fixes the issue by
adding a missing forward_eviction_to_cpu action to the state
transition(OM, Fwd_GETX, IM).

Change-Id: I8f253c5709488b07ddc5143a15eda406e31f3cc6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28787
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase,sim: allow m5writeFile with stdout/stderr.
Nils Asmussen [Fri, 21 Feb 2020 12:58:04 +0000 (13:58 +0100)]
base,sim: allow m5writeFile with stdout/stderr.

If m5writeFile opens stdout/stderr, no file is registered in
OutputDirectory and thus we don't want to search for it on close.

In order to write multiple times to stdout/stderr in a reasonable way,
we also want to prevent seeking. Thus, don't seek if the offset is 0, in
which case this would be a noop anyway (we just opened the file without
append).

Finally, it is helpful for debugging if the stream is flushed on every
write.

Change-Id: I102f82dcd2c63420b6f3fe55d67f03c62349e69d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28727
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: Remove old boot files
Jason Lowe-Power [Fri, 1 May 2020 16:14:11 +0000 (09:14 -0700)]
configs: Remove old boot files

Most of these "rcS" scripts are only useful for specific disk images
that have long been lost to the gem5 community. This commit deletes all
of these scripts. It keeps the generally useful hack_back_cktp script
and the bbench scripts that work with the android images that are still
available.

In the future, these remaning scripts should be moved to the gem5
resources repository.

Issue-on: https://gem5.atlassian.net/browse/GEM5-350
Change-Id: Iba99e70fde7f656e968b4ecd95663275bd38fd6e
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28507
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: Deep renaming of Prefetcher to RubyPrefetcher
Ayaz Akram [Tue, 5 May 2020 04:11:38 +0000 (21:11 -0700)]
mem-ruby: Deep renaming of Prefetcher to RubyPrefetcher

A recent change (https://gem5-review.googlesource.com/c/
public/gem5/+/27949) updated the ruby prefetcher name,
which breaks the use of old name in some SLICC files.
This change makes sure that the new name is used at all
places.

Issue-On: https://gem5.atlassian.net/browse/GEM5-498
Change-Id: Ic667b61eac13dc7c267cee7dce3aa970f7ae9a8b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28667
Reviewed-by: Timothy Hayes <timothy.hayes@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agopython: Manually convert float to int when using %x
Giacomo Travaglini [Tue, 5 May 2020 09:38:10 +0000 (10:38 +0100)]
python: Manually convert float to int when using %x

This is required by python3.5 which is not allowing a
floating point value to be printed in hex and will trigger
a TypeError assertion:

TypeError: %X format: an integer is required, not float

Change-Id: I2033366751924579cc87e7fccda8fdb33a31412d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28607
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoutil: Make cpt_upgraders python3 compatible
Giacomo Travaglini [Mon, 4 May 2020 13:01:52 +0000 (14:01 +0100)]
util: Make cpt_upgraders python3 compatible

It won't be possible to build gem5 in a python3 only environment
otherwise since the cpt_upgrader.py script is automatically run at the
end of compilation

Change-Id: Iea4217e5cd64ca44b99aa0db5dabfdced7aeb3ea
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28587
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoutil: Port git hooks to python3
Giacomo Travaglini [Mon, 4 May 2020 13:16:08 +0000 (14:16 +0100)]
util: Port git hooks to python3

This involves changing:
* git-commit
* git-pre-commit
* style verifiers

JIRA: https://gem5.atlassian.net/browse/GEM5-473

Change-Id: I7bd0b54469f942bf927c8be1fd94d12f67594d48
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28588
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: MESI_Three_level prefetcher page crossing
Timothy Hayes [Tue, 21 Apr 2020 17:58:03 +0000 (18:58 +0100)]
mem-ruby: MESI_Three_level prefetcher page crossing

This patch allows MESI_Three_level using the Ruby prefetcher to
safely cross page boundaries by determining if an address is bad
and cannot be mapped to a memory controller.

Change-Id: I675a13dfa6deb5b6a9f986ced5a3130436db911d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28048
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: MESI_Three_level prefetcher support
Timothy Hayes [Mon, 21 Oct 2019 16:08:22 +0000 (17:08 +0100)]
mem-ruby: MESI_Three_level prefetcher support

Add support for the Ruby stride prefetcher to MESI_Three_Level.

Change-Id: Id68935e2a7d3ccd0e22a59f43a15f167410632a2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27715
Reviewed-by: Bradford Beckmann <brad.beckmann@amd.com>
Maintainer: Bradford Beckmann <brad.beckmann@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: MESI_Three_Level LL/SC improvements
Timothy Hayes [Mon, 27 Apr 2020 14:04:09 +0000 (15:04 +0100)]
mem-ruby: MESI_Three_Level LL/SC improvements

This patch fixes the MESI_Three_Level protocols so that it correctly
informers the Ruby sequencer when a line eviction occurs. Furthermore,
the patch allows the protocol to recognize the 'Store_Conditional'
RubyRequestType and shortcuts this operation if the monitored line
has been cleared from the address monitor. This prevents certain
livelock behaviour in which a line could ping-pong between competing
cores.

The patch establishes a new C/C++ preprocessor definition which allows
the Sequencer to send the 'Store_Conditional' RubyRequestType to
MESI_Three_Level instead of 'ST'. This is a temporary measure until
the other protocols explicitely recognize 'Store_Conditional'.

Change-Id: I27ae041ab0e015a4f54f20df666f9c4873c7583d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28328
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: LL/SC fixes
Timothy Hayes [Mon, 27 Apr 2020 14:03:26 +0000 (15:03 +0100)]
mem-ruby: LL/SC fixes

The implementation for load-linked/store-conditional did not work
correctly for multi-core simulations. Since load-links were treated as
stores, it was not possible for a line to have multiple readers which
often resulted in livelock when using these instructions to implemented
mutexes. This improved implementation treats load-linked instructions
similarly to loads but locks the line after a copy has been fetched
locally. Writes to a monitored address ensure the 'linked' property is
blown away and any subsequent store-conditional will fail.

Change-Id: I19bd74459e26732c92c8b594901936e6439fb073
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27103
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoutil: Add support for multiple call types in the m5 utility.
Gabe Black [Fri, 27 Mar 2020 08:57:13 +0000 (01:57 -0700)]
util: Add support for multiple call types in the m5 utility.

Using mechanisms added in previous CLs, this change modifies the m5
utility so that it can use any of the back ends enabled and implemented
by each variant, defaulting to one particular implementation if not is
selected explicitly.

On x86, the default mechanism is the magic address. All other variants
default to the magic instruction since they don't have a well
established address to use or even in most cases an implementation to
use.

The ability to override the particular magic address the utility wants
to use (necessary on variants such as aarch64) will be added in a future
CL.

Change-Id: I5fc414740e30759e7dde719cddcc8d5d41f8cc74
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27242
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Pouya Fotouhi <pfotouhi@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: added news on RISC-V to RELEASE-NOTES.md.
Nils Asmussen [Fri, 1 May 2020 08:10:59 +0000 (10:10 +0200)]
misc: added news on RISC-V to RELEASE-NOTES.md.

Change-Id: I9b60cd2f533e6d4ce677e8a9b7bb5a5698e51c61
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28448
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv: be prepared for CSR changes during PT walk.
Nils Asmussen [Fri, 1 May 2020 08:27:01 +0000 (10:27 +0200)]
arch-riscv: be prepared for CSR changes during PT walk.

If the address space is changed (by writing to SATP), it can happen that
a page table walk is in progress. Previously, this failed if the ASID
changed, because we then used the wrong ASID for the lookup.

This commit makes sure that we don't access CSRs after the beginning of
the walk by loading SATP, STATUS, and PRV at the beginning.

Change-Id: I8c184c7ae7dd44d78e881bb5ec8d430dd480849c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28447
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: fix MESI_Three_Level erroneous transition
Timothy Hayes [Tue, 21 Apr 2020 09:26:02 +0000 (10:26 +0100)]
mem-ruby: fix MESI_Three_Level erroneous transition

The MESI_Three_Level protocol includes a transition in its L1
definition to invalidate an SM state but this transition does
not notify the L0 cache. The unintended side effect of this
allows stale values to be read by the L0 cache. This can cause
incorrect behaviour when executing LL/SC based mutexes. This
patch ensures that all invalidates to SM states are exposed to
the L0 cache.

Change-Id: I7fefabdaa8027fdfa4c9c362abd7e467493196aa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28047
Reviewed-by: John Alsop <johnathan.alsop@amd.com>
Reviewed-by: Pouya Fotouhi <pfotouhi@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Update tests to save output on failure
Jason Lowe-Power [Wed, 17 Jul 2019 00:16:16 +0000 (17:16 -0700)]
tests: Update tests to save output on failure

The previous commit which tried to do this, did not work with parallel
execution. In this case, the fixtures that were modified were in the
child process and the parent process's fixtures were never updated.
Instead of modifying the object, use the information passed in from the
testlib.

See 4c28149ffa5d09e6fe14952dcaf8df5d0cd8f328
Previous review:
https://gem5-review.googlesource.com/c/public/gem5/+/17451

Change-Id: Ib4c06c5e3f82994199d6f0c1fa69452e93444d75
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19529
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoext: Fix tmpfiles in testlib
Jason Lowe-Power [Tue, 16 Jul 2019 22:13:06 +0000 (15:13 -0700)]
ext: Fix tmpfiles in testlib

Previously, the testlib would generate and not clean up 100s of
temporary files in /tmp. This puts all of the tempfiles in the same
directory to make sure they are cleaned up on a successful test.

Change-Id: If4dcd93ab4b5df556c046753266a71365d1388c1
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19528
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Build the marshal binary in a bare minimum environment
Nikos Nikoleris [Thu, 30 Apr 2020 16:33:13 +0000 (17:33 +0100)]
scons: Build the marshal binary in a bare minimum environment

This change adds an additional bare minimum environment that includes
python only and changes the marshal binary to compile using it.

Change-Id: Id5d1ee6899796d746d8dc1a004cfe4795f040c55
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28428
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: update linux boot tests
Ayaz Akram [Fri, 1 May 2020 07:14:35 +0000 (00:14 -0700)]
tests: update linux boot tests

This change updates the config scripts used by linux boot
tests to make them compatible with change that deprecated
LinuxX86System

JIRA: https://gem5.atlassian.net/browse/GEM5-440

Change-Id: I04beff2915c03a2c3a774351edbba60d7ff26867
Signed-off-by: Ayaz Akram <yazakram@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28427
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Use AssociativeSet in Stride prefetcher
Daniel R. Carvalho [Sun, 29 Dec 2019 09:14:26 +0000 (10:14 +0100)]
mem-cache: Use AssociativeSet in Stride prefetcher

Avoid replicating associative set functionality in Stride prefetcher's
pc tables.

The indexing policy used previously had some peculiarities, so both
the extractTag and extractSet have been made virtual so that previous
behavior could be kept.

Change-Id: I19a86cb3c4b40031fef427d5f7eed9d5c5673a44
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24603
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Use SatCounter in Stride prefetcher
Daniel R. Carvalho [Sun, 29 Dec 2019 13:18:22 +0000 (14:18 +0100)]
mem-cache: Use SatCounter in Stride prefetcher

There is no need to reimplement saturating counter functionality.

Change-Id: Ie7753089873f41a378ab88fd5f095302c3428797
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24542
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Cleanup of SBOOE prefetcher
Daniel R. Carvalho [Sun, 29 Dec 2019 18:09:46 +0000 (19:09 +0100)]
mem-cache: Cleanup of SBOOE prefetcher

Made the latencyBuffer a CircularQueue.

Improved encapsulation of the Sandbox struct.

Fixed score() to follow function declaration guidelines.

Removed redundant fatal error checking for score threshold.

Change-Id: I1904884e96f103c67930abafc28b75796aadc406
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24541
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Use CircularQueue in PIF prefetcher
Daniel R. Carvalho [Sun, 29 Dec 2019 17:43:47 +0000 (18:43 +0100)]
mem-cache: Use CircularQueue in PIF prefetcher

Use CircularQueue for PIF's history buffer, and change the indexing
storage to a CQ iterator.

Change-Id: I75bbb75a6be41bd063f662baedbd4c9de33644de
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24540
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Use CircularQueue for the STeMS's RMOB
Daniel R. Carvalho [Sun, 29 Dec 2019 15:20:04 +0000 (16:20 +0100)]
mem-cache: Use CircularQueue for the STeMS's RMOB

Replace rmobHead functionality with a CircularQueue. As a side
effect, RMOB entry's valid bit was removed.

Change-Id: If0b39cfe15de1e47dde0689a0ebc46b623ec1e55
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24539
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Javier Bueno Hedo <javier.bueno@metempsy.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Fix DCPT with CircularQueue
Daniel R. Carvalho [Mon, 30 Dec 2019 00:10:30 +0000 (01:10 +0100)]
mem-cache: Fix DCPT with CircularQueue

This patch fixes the following bugs:

- Previously when deltaPointer was 0 or 1, getting the last or penultimate deltas
  would be wrong for non-pow2 deltas.size(). For example, if the last added delta
  was to position 0, the previous should be in position 19, if deltas.size() = 20.
  However, 0-1=4294967295, and 4294967295%20=15.

- When searching for the previous late and penultimate, the oldest entry was being
  skipped.

Change-Id: Id800b60b77531ac4c2920bb90c15cc8cebb137a9
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24538
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Javier Bueno Hedo <javier.bueno@metempsy.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Don't assert on branch target addresses
Hsuan Hsu [Thu, 30 Apr 2020 10:45:33 +0000 (18:45 +0800)]
cpu: Don't assert on branch target addresses

We should assume a branch target can be any address.

JIRA: https://gem5.atlassian.net/browse/GEM5-483

Change-Id: I6f6da1f9260d6e8978536967dc7fcf1808965db2
Signed-off-by: Hsuan Hsu <hsuan.hsu@mediatek.com>
Signed-off-by: Howard Wang <Howard.Wang@mediatek.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28347
Reviewed-by: Trivikram Reddy <tvreddy@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Added RELEASE-NOTES.md
Bobby R. Bruce [Tue, 14 Apr 2020 00:55:07 +0000 (17:55 -0700)]
misc: Added RELEASE-NOTES.md

These release notes will enable users to keep track of the main changes
between gem5 versions. The RELEASE-NOTES.md should also notify the user
of any API changes they should be aware of when using this release of
gem5.

Notes on major changes should be apended to the end of the list as
they are added to the repo.

Change-Id: If75748306a8086b2abbe2f912dbb2ec9f1a6895f
Issue-on: https://gem5.atlassian.net/browse/GEM5-439
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27807
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agopython: Fix compareVersions for python 3.
Gabe Black [Thu, 30 Apr 2020 09:00:02 +0000 (02:00 -0700)]
python: Fix compareVersions for python 3.

When the internal utility function make_version_list sees a string, it
tries to convert it into a list using the map() function. In python 3,
that returns an iterator. The following call to zip() will consume those
iterators, and then the following calls to len() will die because they
don't work on map iterators.

This is only a problem if all the common components of the version lists
are equal, and the comparison needs to then check if one of the lists
was equal to the other but with more components. When versions are
equal, for instance when compiling with the oldest supported version of
gcc (4.8.0) this error surfaces and breaks our scons build.

A simple fix is to just wrap the call to map() with list() to convert
the iterator to a flat list, making the other logic work as before.

Change-Id: If9dc5cd7fff70c21229ac3dd9a017edeccd26148
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28309
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Fix priority of multi compressor
Daniel R. Carvalho [Sun, 5 Apr 2020 21:24:08 +0000 (23:24 +0200)]
mem-cache: Fix priority of multi compressor

The priority queue comparator orders such that false gives the
entry a higher priority. Therefore, if it is desired to make
the entry with lowest decompression latency have higher priority,
the comparison must be inverted.

Can be tested with:
  MultiCompressor(compressors=[
    PerfectCompressor(decompression_latency=1),
    PerfectCompressor(decompression_latency=2)])

Where it is expected that compressor0 (the one with decomp lat
of 1) is always chosen.

Change-Id: I44acbf5f51c6e47efdd2a16fba9596935cf2eb69
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28367
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem: Token port implementation
Matthew Poremba [Wed, 23 May 2018 22:58:54 +0000 (15:58 -0700)]
mem: Token port implementation

Adds a TokenPort which uses tokens for flow control rather than the
standard retry mechanism in gem5. The port is intended to be used
for flow control where speculatively sending packets is not possible.
For example, GPU instructions require this to send memory requests
to the cache coalescer.

Change-Id: Id0d55ab65b7c773e97752b8514a780cdf7d88707
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27428
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Add build opts for GCN3 GPU ISA
Tony Gutierrez [Sat, 28 Apr 2018 00:04:27 +0000 (20:04 -0400)]
misc: Add build opts for GCN3 GPU ISA

Change-Id: I5f2662fe72d876b7bf816b0353aaefb85fc6c1c9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28130
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: add option to set the timeouts for the TCPs and SQCs
Joe Gross [Fri, 27 Apr 2018 23:50:44 +0000 (19:50 -0400)]
configs: add option to set the timeouts for the TCPs and SQCs

Change-Id: Icff2bd0237ddcc0d21db17208df8e53ff6f43e86
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28129
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-hsa: Add HSA device and HSA packet processor
Tony Gutierrez [Fri, 27 Apr 2018 23:40:11 +0000 (19:40 -0400)]
dev-hsa: Add HSA device and HSA packet processor

This change adds support for HSA devices, which are
DMA devices that have an HSA packet processor (HSAPP).

An HSA packet processor model is also included. The
HSAPP is a DMA device that matains AQL packet queues
and handles extraction of AQL packets, scheduling
of AQL queues, and initiates kernel launch for HSA
devices.

Because these devices directly interact with low-level
software and aid in the implementation of the HSA ABI
we also include some headers from the ROCm runtime:
the hsa.h and kfd_ioctl.h headers. These aid with
support ROCm for the HSA devices and drivers.

Change-Id: I24305e0337edc6fa555d436697b4e607a1e097d5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28128
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-gcn3: Add files for arch gcn3 (GPU machine ISA)
Tony Gutierrez [Fri, 27 Apr 2018 23:38:30 +0000 (19:38 -0400)]
arch-gcn3: Add files for arch gcn3 (GPU machine ISA)

Decoder: gpu_decoder.hh and decoder.cc:
    The decoder is defined in these files. The decoder
    is implemented as a lookup table of function pointers
    where each decode function will decode to a unique
    ISA instruction, or do some sub-decoding to infer
    the next decode function to call.

    The format for each OP encoding is defined in the
    header file.

Registers:
    registers.[hh|cc] define the special registers and
    operand selector values, which are used to map
    operands to registers/special values. many
    convenience functions are also provides to determine
    the source/type of an operand, for example vector
    vs. scalar, register operand vs. constant, etc.

GPU ISA:
    Some special GPU ISA state is maintained in gpu_isa.hh
    and isa.cc. This class is used to hold some special
    registers and values that can be used as operands
    by ISA instructions. Eventually more ISA-specific
    state should be moved here, and out of the WF class.

Vector Operands:
    The operands for GCN3 instructions are defined in
    operand.hh. This file defines both scalar and
    vector operands wth GCN3 specific semantics. The
    vector operand class is desgned around the generic
    vec_reg.hh that is already present in gem5.

Instructions:
    The GCN3 instructions are defined and implemented
    throughout gpu_static_inst.[hh|cc], instructions.[hh|cc],
    op_encodings.[hh|cc], and inst_util.hh. GCN3 instructions
    all fall under one of the OP encoding types; for example
    scalar memory operands are of the type SMEM, vector
    ALU instructions can be VOP3, VOP2, etc. The base code
    common to all instructions of a certain OP encoding type
    is implemented in the OP encodings files, which includes
    operand information, disassembly methods, encoding type,
    etc.

    Each individual ISA isntruction is implemented as
    a class object in instructions.[hh|cc] and are derived
    from one of the OP encoding types. The instructions.cc
    file is primarily for the execute() methods of each
    individual instruction, and the header file provides
    the class definition and a few instruction specific
    API calls.

    Note that these instruction classes were auto-generated
    but not using the gem5 ISA description language. A
    custom ISA description was used and that cannot be released
    publicly, therefore we are providing them already in C++.

Change-Id: I14d2a02d6b87109f41341c8f50a69a2cca9f3d14
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28127
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Inheritance fixes in varargs
Nikos Nikoleris [Thu, 23 Apr 2020 19:05:57 +0000 (20:05 +0100)]
sim: Inheritance fixes in varargs

Change-Id: I3c6027223893363df098d1990a4ad3d07c2ff5ff
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28250
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: Avoid const from member due to &Message::operator=(...)
Nikos Nikoleris [Thu, 23 Apr 2020 19:03:34 +0000 (20:03 +0100)]
mem-ruby: Avoid const from member due to &Message::operator=(...)

Change-Id: I172f48ce8ee4a3870165309342dadc2ac39ded9a
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28249
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix access modifier in Arm*ProcessBits class
Nikos Nikoleris [Thu, 23 Apr 2020 16:30:03 +0000 (17:30 +0100)]
arch-arm: Fix access modifier in Arm*ProcessBits class

Change-Id: Ie983abc94dd9e62bbec3f584b70b0d04d6e8305d
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28248
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Disable unsupported -Wl,--as-needed in MacOS
Nikos Nikoleris [Thu, 23 Apr 2020 19:07:51 +0000 (20:07 +0100)]
scons: Disable unsupported -Wl,--as-needed in MacOS

Change-Id: Id6f8199b818217c4fcf4b80efdb7cc9e1d14e32b
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28173
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix inconsistency in variable name
Nikos Nikoleris [Thu, 23 Apr 2020 18:46:32 +0000 (19:46 +0100)]
arch-arm: Fix inconsistency in variable name

Change-Id: I091a2d0cc8bfa7b8d98c4f508d175868d0fd7249
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28172
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: Removed the unused parameter m_id from VirtualChannel
Nikos Nikoleris [Thu, 23 Apr 2020 17:57:57 +0000 (18:57 +0100)]
mem-ruby: Removed the unused parameter m_id from VirtualChannel

Change-Id: Ie6f8db9b1cb0d0e0ca694c631c6662413fd833c1
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28171
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Srikant Bharadwaj <srikant.bharadwaj@amd.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix function signature inconsistencies in semihosting
Nikos Nikoleris [Thu, 23 Apr 2020 17:49:44 +0000 (18:49 +0100)]
arch-arm: Fix function signature inconsistencies in semihosting

Change-Id: Icb1aa30cb67b676d49681f68e1d62b3af409e26b
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28170
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Fix mismatch between #ifndef and #define in varargs.hh
Nikos Nikoleris [Thu, 23 Apr 2020 16:28:53 +0000 (17:28 +0100)]
sim: Fix mismatch between #ifndef and #define in varargs.hh

Change-Id: I558b6c3c69a5003a77cc95b414e620715c3dbbae
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28169
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm, mem-ruby, sim: Add missing overrides
Nikos Nikoleris [Thu, 23 Apr 2020 16:27:44 +0000 (17:27 +0100)]
arch-arm, mem-ruby, sim: Add missing overrides

Change-Id: I5ab18960bd61953e68777746426adb657818f825
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28168
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Downgrade constexpr causing build errors to const
Nikos Nikoleris [Thu, 23 Apr 2020 16:26:02 +0000 (17:26 +0100)]
arch-arm: Downgrade constexpr causing build errors to const

Change-Id: Idf5ae62603b6181d44aaaef91b774fa7b26eb718
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28167
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Add an option to suppress the return value in invokeSimcall.
Gabe Black [Wed, 29 Apr 2020 08:32:40 +0000 (01:32 -0700)]
sim: Add an option to suppress the return value in invokeSimcall.

Sometimes when using the GuestABI mechanism, gem5 wants to know that a
function was called and with what arguments to do its own processing,
but doesn't want to return its own value since it will still let the
simulated system execute its own function. There are also situations
where gem5 wants to return a value, but not through the normal
mechanism. That happens when, for instance, a gem5 op is triggered by a
memory access, and that access is what should return the value, not a
particular fixed register.

This option is a template parameter rather than a function argument so
that if it's not going to be used, no "Return" type needs to be defined
since it's not present at all in the chain of functions invokeSimcall
expands to.

This will also make it easier to reuse generic ABIs in those situations
without having to make custom wrappers.

Change-Id: I969e78495c8f4e73f4de1a3dfb4d74c9b30f5af5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28288
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Use the protobuf version to choose between ByteSize(Long).
Gabe Black [Wed, 29 Apr 2020 06:40:17 +0000 (23:40 -0700)]
misc: Use the protobuf version to choose between ByteSize(Long).

Older versions of protobuf are apparently still what's provided with
some current versions of some distributions. To avoid breaking the build
on those distributions and to avoid an annoying deprecation warning on
newer systems, check GOOGLE_PROTOBUF_VERSION to choose which to use.

According to the CHANGES.txt file here:

https://github.com/protocolbuffers/protobuf/blob/master/CHANGES.txt

The new ByteSizeLong function was introduced in version 3.1.0 in 2016.

Change-Id: I7f8eeda144bf9556d17d7a0a741996f3137b48b4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28287
Reviewed-by: Tommaso Marinelli <tommarin@ucm.es>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim-power: Addition of PowerDomains
Anouk Van Laer [Wed, 20 Sep 2017 17:04:25 +0000 (18:04 +0100)]
sim-power: Addition of PowerDomains

PowerDomains group multiple objects together to regulate their power
state. There are 2 types of objects in a PowerDomain: leaders and
followers. The power state of a PowerDomain is the most performant
power state of any of the leaders. The power state of the followers is
determined by the power state of the PowerDomain they belong to: they
need to be in a power state which is more or equally performant to the
power state of the PowerDomain.

Leaders can be ClockedObjects or other PowerDomains. Followers can
only be ClockedObjects. PowerDomains can be be nested but a
PowerDomain can only be a leader of another PowerDomain, NOT a
follower. PowerDomains are not present in the hierarchy by default,
the user needs to create and configure them in the configuration file.

The user can add an hierachy by setting the led_by parameter. gem5
will then create leaders and followers for each domain and calculate
the allowed power states for the domain.

Objects in a PowerDomain need to have at least the ON state in the
possible_states.

An example of a powerDomain config is:

pd = PowerDomain()
cpu0 = BaseCPU()
cpu1 = BaseCPU()
shared_cache = BaseCache()
cache.power_state.led_by = pd
pd.led_by = [cpu0, cpu1]

This will create a PowerDomain, where the CPUs determine their own
power states and the shared cache (via the PowerDomain) follows those
power states (when possible).

Change-Id: I4c4cd01f06d45476c6e0fb2afeb778613733e2ff
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28051
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim-power: Specify the states a PowerState object can be in
Anouk Van Laer [Wed, 4 Oct 2017 13:15:36 +0000 (14:15 +0100)]
sim-power: Specify the states a PowerState object can be in

This commit adds the concept of possible power states to the
PowerState SimObject. This is a list of the power states a specific
object can be in. Before transitioning to a power state, a PowerState
object will first check if the requested power states is actually an
allowed state. The user can restricted the power states a
ClockedObject can go to during configuration. In addition, this change
sets the power states, a CPU can be in.

Change-Id: Ida414a87554a14f09767a272b54b5d19bfc8e911
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28050
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim-power: Creation of PowerState class
Anouk Van Laer [Wed, 4 Oct 2017 13:14:33 +0000 (14:14 +0100)]
sim-power: Creation of PowerState class

This commit does not make any functional changes but just rearranges
the existing code with regard to the power states. Previously, all
code regarding power states was in the ClockedObjects. However, it
seems more logical and cleaner to move this code into a separate
class, called PowerState. The PowerState is a now SimObject. Every
ClockedObject has a PowerState but this patch also allows for objects
with PowerState which are not ClockedObjects.

Change-Id: Id2db86dc14f140dc9d0912a8a7de237b9df9120d
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28049
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: Change fs_power.py to use absolute paths for stats
Nikos Nikoleris [Tue, 7 Apr 2020 14:43:23 +0000 (15:43 +0100)]
configs: Change fs_power.py to use absolute paths for stats

fs_power.py is an example script that demonstrates how power models
can be used with gem5. Previously, the formulas used to calculate the
dynamic and static power of the cores and the L2 cache were using
stats in equations as determined by their path relative to the
SimObject where the power model is attached to or full paths. This CL
changes these formulas to refer to the stats only by their full paths.

Change-Id: I91ea16c88c6a884fce90fd4cd2dfabcba4a1326c
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27893
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim-power: Fix the way the power model accesses stats
Nikos Nikoleris [Fri, 13 Mar 2020 12:56:54 +0000 (12:56 +0000)]
sim-power: Fix the way the power model accesses stats

With the introduction of StatGroups the organization of stats has
changed and the power modeling framework has been broken. This CL uses
the new function Stats::resolve to retrieve pointers to the necesary
stats and use them in the power estimation formulas.

Change-Id: Iedaa97eeddf51f7a0a1f222918715da309943be3
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27892
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
4 years agobase, python, sim: Add support for resoving a stat using its name
Nikos Nikoleris [Tue, 7 Apr 2020 15:04:41 +0000 (16:04 +0100)]
base, python, sim: Add support for resoving a stat using its name

This CL adds resolve, a function in the Stats namespace that allows
access to a stat as specified by its name.

Change-Id: I4fa8bed394b4cb35d9c6cf5d8db062b8d6bb9ca5
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27891
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase: Add support for resolving stats within groups by name
Nikos Nikoleris [Fri, 3 Apr 2020 10:57:31 +0000 (11:57 +0100)]
base: Add support for resolving stats within groups by name

This change adds a member function to the Group class that returns a
stat given its name. The function will go through all stats in the
group and its subgroups and will return the stat that matches the
name. For example, if g is the Group system.bigCluster.cpus then a
call to

p = g.resolveStat("ipc")

will return a pointer to the stat system.bigCluster.cpus.ipc.

Change-Id: I5af8401b38b41aee611728f6d1a595f99d22d9de
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27890
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Add function that returns all variables in a MathExpr
Nikos Nikoleris [Fri, 3 Apr 2020 11:07:13 +0000 (12:07 +0100)]
sim: Add function that returns all variables in a MathExpr

This changes adds support for retrieving all variables in a math
expression. The added function can be called in all valid expressions
and will return the variables in a vector of strings.

Change-Id: I086ba04aa1f798400c97a0b6bf982018a2457c64
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27889
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: create tests for various traffic generators on NULL
Ciro Santilli [Wed, 11 Mar 2020 14:20:38 +0000 (14:20 +0000)]
tests: create tests for various traffic generators on NULL

New tests were added for:

- garnet_synth_traffic.py
- ruby_random_test.py
- ruby_direct_test.py

These tests are factored out with the tests for:

- memcheck.py
- ruby_mem_test.py

Each new test was calibrated to last about 5 seconds on a Lenovo ThinkPad
P51.

Change-Id: Ie13d3963e1163cffae5dce329b623fbebbf2b983
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26808
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: fix the memcheck test
Ciro Santilli [Wed, 11 Mar 2020 12:42:45 +0000 (12:42 +0000)]
tests: fix the memcheck test

The file was raising due to the undefined constant `verifiers`, leading
the test to be ignored.

./main.py list -v

would show this as:

```
Traceback (most recent call last):
  File "/gem5/tests/../ext/testlib/loader.py", line 239, in load_file
    execfile(path, newdict, newdict)
  File "/gem5/tests/gem5/memcheck/test_memcheck.py", line 32, in <module>
    verifiers=verifiers,
NameError: name 'verifiers' is not defined

Exception thrown while loading "/gem5/tests/gem5/memcheck/test_memcheck.py"
Ignoring all tests in this file.
```

The test has been modified to have an empty verifiers list, which should
still catch bugs since src/mem/mem_checker.cc has several asserts already
which would be caught by the test system due to the exit status.

Also make the following changes to the test:

-   move it to tests/gem5/memory/test.py with other memory tests.

    This makes it easier to see all the tests in the source in one go, and
    might make it easier to factor certain memory things out later on.

-   reduce --maxtick to a value that finishes in 7 seconds on a Lenovo
    ThinkPad P51.

    The previous value would take 50x longer, which feels too long for a
    single test.

-   enable --prefetchers to also stress a prefetcher in the test

Change-Id: I58bd598b1142f349d25fa4fa4a8e41529e61a9ee
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26807
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem: make MemTest panic on a packet error
Ciro Santilli [Tue, 10 Mar 2020 18:43:12 +0000 (18:43 +0000)]
mem: make MemTest panic on a packet error

Before this change, running:

./build/NULL/gem5.opt configs/example/ruby_mem_test.py -m 20000000 \
  --functional 10

would only print warning for memory errors such as:

warn: Read access failed at 0x107a00

and there was no way to make the simulation fail.

This commit makes those warnings into errors such as:

panic: Read access failed at 0x107a00

unless --suppress-func-errors is given.

This will be used to automate MemTest testing in later commits.

Change-Id: I1840c1ed1853f1a71ec73bd50cadaac095794f91
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26804
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: remove exec of Options.py from ruby_mem_test.py
Ciro Santilli [Tue, 10 Mar 2020 15:26:26 +0000 (15:26 +0000)]
configs: remove exec of Options.py from ruby_mem_test.py

The removed exec statement does not appear to be needed however,
since Options is already imported above with:

from common import Options

Change-Id: I934a65d21fa5099a786224a5476d609e4d707205
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26803
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv: report that we don't have debugging support.
Nils Asmussen [Sat, 22 Feb 2020 15:05:43 +0000 (16:05 +0100)]
arch-riscv: report that we don't have debugging support.

According to the debugging spec (page 47), a debugger can test which
triggers are enabled by writing 0 to TSELECT and reading it back. If a
different value is read, the trigger is not supported.

Therefore, we currently always set a different value to indicate that
we do not support any triggers.

Change-Id: If222e913c4517adb2da4f6f0ffeedb4e4808a586
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25659
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: respect IALIGN, influenced by toggling 'c' extension.
Nils Asmussen [Sat, 22 Feb 2020 15:02:49 +0000 (16:02 +0100)]
arch-riscv: respect IALIGN, influenced by toggling 'c' extension.

According to the privileged ISA spec, SEPC[0]/MEPC[0] reads always 0
and SEPC[1]/MEPC[1] reads 0 if the compressed extension is disabled.

Additionally, the compressed extension can only be disabled if the next
instruction is 4-byte aligned.

Change-Id: I590c05e4000b59a5ba283f47933f7a92959d8e38
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25658
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: let FPU instructions fault if status.FS = off.
Nils Asmussen [Fri, 14 Feb 2020 16:40:35 +0000 (17:40 +0100)]
arch-riscv: let FPU instructions fault if status.FS = off.

These checks are required for some tests in the RISC-V test suite.
However, actually we also need to set the INITIAL/CLEAN/DIRTY flags
accordingly, which is not done yet.

Change-Id: If5d6ac22069b51a57b6353cd6d45b77ee51a4d55
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25657
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: make uret,sret,mret SerializeAfter,NonSpeculative.
Nils Asmussen [Fri, 21 Feb 2020 12:51:11 +0000 (13:51 +0100)]
arch-riscv: make uret,sret,mret SerializeAfter,NonSpeculative.

These instructions potentially change the privilege level, upon which
the execution of other instructions depends. For that reason, we need to
make *ret SerializeAfter and we also don't want to execute them
speculatively.

Change-Id: If3b5ba6ec3b4102d53c51cf723eba5d5da3eaa2f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25656
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: make accesses to CSRs SerializeAfter.
Nils Asmussen [Fri, 14 Feb 2020 16:35:30 +0000 (17:35 +0100)]
arch-riscv: make accesses to CSRs SerializeAfter.

According to page 57 in the RISC-V manual, CSR accesses "need to be
performed in program order with respect to those instructions whose
execution behavior is affected by the state of the accessed CSR".

Thus, we need to make them SerializeAfter to ensure that the following
instructions are executed with the potential changes to the CSR. In
theory, we could be smarter here by only considering write accesses to
CSRs and considering the following instructions, but for now we simply
serialize for every CSR access.

Change-Id: I69391fccaec31c34d944c55bac2f04d37947ebfe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25655
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: fault according to status.{TVM,TSK,TW}.
Nils Asmussen [Fri, 14 Feb 2020 14:39:44 +0000 (15:39 +0100)]
arch-riscv: fault according to status.{TVM,TSK,TW}.

Change-Id: I38dddadb3373d2156b8fc57eabff861a062021cf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25654
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: added dummy implementation of wfi instruction.
Nils Asmussen [Sat, 21 Mar 2020 11:25:22 +0000 (12:25 +0100)]
arch-riscv: added dummy implementation of wfi instruction.

Change-Id: I7ca86f57c7d794bf544e34e747875049a3f29d6a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25653
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: fault on mstatus accesses from lower privilege modes.
Nils Asmussen [Fri, 14 Feb 2020 10:45:29 +0000 (11:45 +0100)]
arch-riscv: fault on mstatus accesses from lower privilege modes.

Change-Id: If2e35445770eaa52f5af6f9ef02fb5e11bef8da4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25652
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: ignore writes to SXL/UXL fields in status register.
Nils Asmussen [Mon, 24 Feb 2020 12:47:43 +0000 (13:47 +0100)]
arch-riscv: ignore writes to SXL/UXL fields in status register.

We currently only support SXL=UXL=2 (64 bit). These fields are WARL,
so that we have to make sure that no other value can be set.

Change-Id: I62ddc7d68b8c31ca655ba1ccee7a294912f46b09
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25651
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: added (un)serialization of miscRegFile.
Nils Asmussen [Sat, 15 Feb 2020 07:27:55 +0000 (08:27 +0100)]
arch-riscv: added (un)serialization of miscRegFile.

Change-Id: I127dbf4a6bb4a144eaee05a87495830dce82eb58
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25650
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: show names of MiscRegs on accesses.
Nils Asmussen [Thu, 13 Feb 2020 13:15:56 +0000 (14:15 +0100)]
arch-riscv: show names of MiscRegs on accesses.

Printing the number of the MiscRegs makes it hard to debug problems.
Therefore, this commit adds a name table and prints the name of the
register.

Change-Id: Icd53d5524a5d5daf3e50f253cdda56341663f26e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25649
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: fixed read of {M,S,U}TVEC.
Nils Asmussen [Thu, 13 Feb 2020 13:15:05 +0000 (14:15 +0100)]
arch-riscv: fixed read of {M,S,U}TVEC.

As stated in 4.1.4 of the privileged ISA manual, the BASE field in the
STVEC register contains the bits [SXLEN-1:2] of the base address, not
the base address shifted left by 2.

Change-Id: I799ec0dc1cbd7b271b91b53adb033a5d1ca3306f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25648
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoconfigs: added bare metal FS support for RISC-V.
Nils Asmussen [Sat, 21 Mar 2020 10:02:41 +0000 (11:02 +0100)]
configs: added bare metal FS support for RISC-V.

Change-Id: Id412186d868680b9af97503a5337fc394fd84f68
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26989
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu,configs: let RISC-V use the PT walker cache.
Nils Asmussen [Sat, 21 Mar 2020 10:01:31 +0000 (11:01 +0100)]
cpu,configs: let RISC-V use the PT walker cache.

Change-Id: I19b1dd9e3c55c433c897988d36e6715017273c66
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26988
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: fixed formatting.
Nils Asmussen [Sat, 21 Mar 2020 10:00:01 +0000 (11:00 +0100)]
arch-riscv: fixed formatting.

Change-Id: I134993a4aced07e75bf62fec56081b0f9d8fc18c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26986
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: implement RemoteGDB::acc for FS mode.
Nils Asmussen [Sat, 21 Mar 2020 09:59:36 +0000 (10:59 +0100)]
arch-riscv: implement RemoteGDB::acc for FS mode.

Change-Id: I78b37db43fbb16d4dafa74294117e8beba62f903
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26985
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: implement sfence.vma to flush TLBs.
Nils Asmussen [Sat, 21 Mar 2020 09:58:58 +0000 (10:58 +0100)]
arch-riscv: implement sfence.vma to flush TLBs.

Change-Id: I424123d3c94c9673269f922cd6755f0bbf5b6cc0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26984
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv: make sure only supported modes can be set in SATP.
Nils Asmussen [Sat, 21 Mar 2020 09:57:37 +0000 (10:57 +0100)]
arch-riscv: make sure only supported modes can be set in SATP.

Change-Id: I37c67e491d64bf03d1125e23db28611fa0b16038
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26983
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-riscv: added TLB and page table walker.
Nils Asmussen [Sat, 21 Mar 2020 09:55:20 +0000 (10:55 +0100)]
arch-riscv: added TLB and page table walker.

That is, RISC-V has now a TLB and page table walker for Sv39 paging
according to the privileged ISA 1.11.

Both the TLB and PT walker are based on x86 (the code duplication of the
page table walkers will be reduced by a separate commit).

Change-Id: I5e29683bdd40c0d32c06e4d75a8382bf313f2086
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25647
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarm: Add a unit test for some aspects of the aapcs64 ABI.
Gabe Black [Mon, 27 Apr 2020 20:46:42 +0000 (13:46 -0700)]
arm: Add a unit test for some aspects of the aapcs64 ABI.

This test covers the templates which attempt to classify types, but not the
actual gathering of arguments of distribution of return values. As before, we
can't really use standard C++ to accurately test for HFAs and HVAs, so we stick
with approximating them by detecting arrays of the right types.

For example, I think technically we should also accept a struct with only 4
float members, but c++ templates aren't able to match against types in that way
as far as I know.

Change-Id: I1d7756a964a86c0c5ea13e068a5fc74603e14e30
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28268
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarm: Fix some bugs in the aapcs64 implementation.
Gabe Black [Mon, 27 Apr 2020 20:44:42 +0000 (13:44 -0700)]
arm: Fix some bugs in the aapcs64 implementation.

The templates which checked for short vectors, and our approximation of
HFA, HVA and HXA types were not correct. This change actually simplifies
them along with getting them to produce correct results. In the case of
HXA, there was a logic bug where an && was used where an || was
intended.

There may still be bugs in the actual collection of arguments and
setting of return values since those aspects are harder to test.

Change-Id: Ice3177205a98c678ecb43ba600813b3909c44e6b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28267
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: Add missing requestToMemory MessageBuffers
Matthew Poremba [Fri, 24 Apr 2020 17:47:52 +0000 (10:47 -0700)]
configs: Add missing requestToMemory MessageBuffers

In commit 53b6e21 two protocol config files were missed when the new
requestToMemory MessageBuffers were added. This fixes the issue such
that all Ruby protocols are working again.

Change-Id: Iaa04c792eaf6d659ba13c19f003e7e31b71ffdb4
JIRA: https://gem5.atlassian.net/browse/GEM5-468
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28187
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix clasta/b and lasta/b simd&fp instructions
Jordi Vaquero [Thu, 9 Apr 2020 09:52:07 +0000 (11:52 +0200)]
arch-arm: Fix clasta/b and lasta/b simd&fp instructions

The simd&fp version of this instructions required zeroing the result
vector except for the first element, that contains the result.

Change-Id: I231ad3c44d89f34acae26d299ab676e2ed09acdc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28247
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: Do not require args.kernel to be set in baremetal.py
Giacomo Travaglini [Fri, 24 Apr 2020 14:59:25 +0000 (15:59 +0100)]
configs: Do not require args.kernel to be set in baremetal.py

This is allowing to us run baremetal.py with the --dtb-gen option
without needing to specify a --kernel argument

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