gem5.git
4 years agoutil,tests: Added gcc version 10 to compiler tests
Bobby R. Bruce [Tue, 23 Jun 2020 00:18:27 +0000 (17:18 -0700)]
util,tests: Added gcc version 10 to compiler tests

In addition, gcc version 9 has been added, which was previously
served by "ubuntu-20.04_all-dependencies".

Change-Id: I57aeac2aa75b7751f0d4010efee7780e23d447d4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30515
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
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: Added Dockerfile for GCC versions on ubuntu 20.04
Bobby R. Bruce [Mon, 22 Jun 2020 22:56:16 +0000 (15:56 -0700)]
util: Added Dockerfile for GCC versions on ubuntu 20.04

Ubuntu 20.04 contains GCC verisons 9 and 10, which are not easily
obtainable (at least through APT) on Ubuntu 18.04. Therefore, a
Dockerfile for obtaining GCC versions in Ubuntu 20.04 has been added.
The orignal GCC version Dockerfile (Ubuntu 18.04) has been kept as
GCC versions 4.8, 5, and 6 are not obtainable, via APT, on Ubuntu
20.04. A complete migration to the 20.04 Dockerfile is not possible
until these earlier GCC versions are dropped.

The Docker images for GCC Versions 9 and 10 can be found here:
https://gcr.io/gem5-test/gcc-version-10
https://gcr.io/gem5-test/gcc-version-9

The other Dockerfile directories have been renamed for consistency.

Change-Id: I569249331095ee62d1be5be479c7ba7da0077422
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30514
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoutil,tests: Added compiler test script
Bobby R. Bruce [Wed, 17 Jun 2020 22:50:28 +0000 (15:50 -0700)]
util,tests: Added compiler test script

This script runs a series of compilations on gem5. The following
compilers are tested:

clang-9
clang-8
clang-7
clang-6
clang-5
clang-4
clang-3.9
gcc-9
gcc-8
gcc-7
gcc-6
gcc-5
gcc-4.8 (to be dropped soon:
         https://gem5.atlassian.net/browse/GEM5-218)

They are tested by building the following build targets:

ARM
ARM_MESI_Three_Level
Garnet_standalone
GCN3_X86
MIPS
NULL_MESI_Two_Level
NULL_MOESI_CMP_directory
NULL_MOESI_CMP_token
NULL_MOESI_hammer
POWER
RISCV
SPARC
X86
X86_MOESI_AMD_BASE

For each, ".opt" and ".fast" compiler build settings are tested.

clang-9 and gcc-9 are tested against all targets with each build
setting. For the remaining compilers, a random build target is
chosen. After the script has run, the output of the tests can be
found in "compile-test-out".

Docker is required to run this script.

Change-Id: Id3bf4c89b9d424c87e9409930ee2aceaef72cb29
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30395
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: Add support for MemSync reqs in VIPER
Tony Gutierrez [Thu, 2 May 2019 23:03:50 +0000 (19:03 -0400)]
mem-ruby: Add support for MemSync reqs in VIPER

Change-Id: Ib129e82be5348c641a8ae18093324bcedfb38abe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29939
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 agomem-ruby: Fix type casting in makeNextStrideAddress
seanzw [Tue, 14 Jul 2020 22:51:59 +0000 (15:51 -0700)]
mem-ruby: Fix type casting in makeNextStrideAddress

The RubyPrefetcher uses makeNextStrideAddress() with
a negative stride to find prefetched address.
The type of this expression is:
uint64_t + uint32_t * int;
This gives wrong result due to implicit conversion.
Fix this with static cast and it works correctly:
uint64_t + int * int;

Change-Id: I36e17e00d5c66c3699fe1d5b287971225a162d04
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31314
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: AddressSize check on translateMmuOff for AArch64 only
Giacomo Travaglini [Tue, 14 Jul 2020 16:09:11 +0000 (17:09 +0100)]
arch-arm: AddressSize check on translateMmuOff for AArch64 only

Motivation:
An AddressSizeFault on AArch32 can only happen during a table walk
since the register used as a base by LD/ST is always 32 bit wide.
On AArch64 on the other hand, addresses can be 64bit wide;
when MMU is off (no virtual memory) an invalid physical address
can be specified

Change-Id: Id3ef170e99202c6b0b511fa7205c754956861720
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31274
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Add a code of conduct
Jason Lowe-Power [Fri, 3 Jul 2020 15:49:23 +0000 (08:49 -0700)]
misc: Add a code of conduct

This file codifies our current unofficial policies. This doesn't change
the community in any way except for clarifying our policies.

This was modeled off of https://www.contributor-covenant.org/.

Change-Id: Ib976636b490bbe4d46bf79260e6a345b46c02e2c
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30954
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agogpu-compute: enable kernel-end WB functionality
Xianwei Zhang [Thu, 28 Jun 2018 06:34:41 +0000 (02:34 -0400)]
gpu-compute: enable kernel-end WB functionality

Change-Id: Ib17e1d700586d1aa04d408e7b924270f0de82efe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29938
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Xianwei Zhang <xianwei.zhang@amd.com>
4 years agoarch-gcn3: Implementation of flat atomic swap instruction
Alexandru Dutu [Thu, 9 Nov 2017 07:20:54 +0000 (02:20 -0500)]
arch-gcn3: Implementation of flat atomic swap instruction

Change-Id: I9b9042899e65e8c9848b31c509eb2e3b13293e52
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29937
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
4 years agomisc: Remove support for checking out as a mercurial repo.
Gabe Black [Fri, 10 Jul 2020 20:40:55 +0000 (13:40 -0700)]
misc: Remove support for checking out as a mercurial repo.

This will still be technically possible with the right converters, but
this removes the tags, ignore file, and style checking hooks related to
mercurial. We no longer maintain a mercurial mirror of the main git
repository, and this support adds clutter and could diverge from the git
style hooks, etc, over time.

Change-Id: Icf4833c4f0fda51ea98989d1d741432ae3ddc6dd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31174
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-gcn3: Fix VOP2 dissasembly prints
Michael LeBeane [Thu, 7 Jun 2018 20:49:26 +0000 (16:49 -0400)]
arch-gcn3: Fix VOP2 dissasembly prints

VOP2 prints VSRC1 register index as hex instead of decimal if the
instruction contains a literal operand.  This patch resets the
format specifiers in the stream to print the register correctly.

Change-Id: Icc7e6588b3c5af545be6590ce412460e72df253f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29936
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

4 years agoarch-gcn3, gpu-compute: Implement out-of-range accesses
Michael LeBeane [Thu, 31 May 2018 17:03:38 +0000 (13:03 -0400)]
arch-gcn3, gpu-compute: Implement out-of-range accesses

Certain buffer out-of-range memory accesses should be special
cased and not generate memory accesses. This patch implements
those special cases and supresses lanes from accessing memory
when the calculated address falls in an ISA-specified out-of-range
condition.

Change-Id: I8298f861c6b59587789853a01e503ba7d98cb13d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29935
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

4 years agoarch-gcn3: Fix writelane src0,src1 usage
Michael LeBeane [Thu, 17 May 2018 21:17:24 +0000 (17:17 -0400)]
arch-gcn3: Fix writelane src0,src1 usage

Src1 should only be used for lane select.  The data should come
from src0.

Change-Id: Ibe960df2e56d351a3819b40194104d2972a5cd4c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29933
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
4 years agogpu-compute: Dropping fetchs when no entry is reserved in the buffer
Onur Kayiran [Mon, 14 May 2018 17:51:35 +0000 (13:51 -0400)]
gpu-compute: Dropping fetchs when no entry is reserved in the buffer

This changeset drops fetches if there is no entry reserved in the
fetch buffer for that instruction. This can happen due to a fetch
attempted to be issued in the same cycle where a branch instruction
flushed the fetch buffer, while an ITLB or I-cache request is still
pending.

Change-Id: I3b80dbd71af27ccf790b543bd5c034bb9b02624a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29932
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Onur Kayıran <onur.kayiran@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

4 years agoarch-gcn3: fix bits that SDWA selects
Matt Sinclair [Thu, 3 May 2018 22:14:03 +0000 (18:14 -0400)]
arch-gcn3: fix bits that SDWA selects

This commit fixes a bug in 200f2408 where the SDWA support was selecting bits
backwards.  As part of this commit, to help resolve this problem in the
future, I have added asserts in the helper functions in bitfield.hh to ensure
that the number of bits aren't negative.

Change-Id: I4b0ecb0e7c110600c0b5063101b75f9adcc512ac
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29931
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

4 years agoarch-arm: Fix coding style in self_debug.[cc, hh]
Giacomo Travaglini [Wed, 8 Jul 2020 13:39:36 +0000 (14:39 +0100)]
arch-arm: Fix coding style in self_debug.[cc, hh]

Change-Id: I67be98af412b745ea9e16d4e8c6d422c9fbb29fc
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/+/31082
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Remove getters/setters from SelfDebug class
Giacomo Travaglini [Tue, 7 Jul 2020 14:46:04 +0000 (15:46 +0100)]
arch-arm: Remove getters/setters from SelfDebug class

Change-Id: I63e5ed25e453cb8fcb2c39ba0728cc81c499c166
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/+/31081
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix pmc == on SelfDebug
Giacomo Travaglini [Wed, 8 Jul 2020 15:15:23 +0000 (16:15 +0100)]
arch-arm: Fix pmc == on SelfDebug

The Assignment operator was used instead of the Equal-To

Change-Id: Ibf5a0006bce79b67d662fd1f8942699582956d58
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/+/31080
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Move breakpoint/watchpoint check out of the TLB
Giacomo Travaglini [Tue, 7 Jul 2020 14:30:22 +0000 (15:30 +0100)]
arch-arm: Move breakpoint/watchpoint check out of the TLB

The breakpoint, watchpoint, vector catch and software step checks
have been moved from the TLB to the SelfDebug class.

This is cleaningup the TLB model which is simply asking the SelfDebug
class if there is a pending debug fault

Change-Id: I1724896b24e4728b32a6b46c5cd51cc6ef279fd7
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/+/31079
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Style fixes for src/dev/arm/gic_v2.hh
Giacomo Travaglini [Tue, 7 Jul 2020 11:52:56 +0000 (12:52 +0100)]
dev-arm: Style fixes for src/dev/arm/gic_v2.hh

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

Change-Id: I80dce7b72775beabafa3b54e915a369571f2e4c9
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31057
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Implement Level Sensitive PPIs in GICv2
Giacomo Travaglini [Tue, 7 Jul 2020 11:41:52 +0000 (12:41 +0100)]
dev-arm: Implement Level Sensitive PPIs in GICv2

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

Change-Id: I9ae411110f08f4a1de95469ff5ed6788354abafc
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31056
Reviewed-by: Hsuan Hsu <kugwa2000@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Use getIntConfig when reading/writing GICD_ICFGR
Giacomo Travaglini [Tue, 7 Jul 2020 09:46:34 +0000 (10:46 +0100)]
dev-arm: Use getIntConfig when reading/writing GICD_ICFGR

This patch is changing the getIntConfig helper (which has been
used so far by isLevelSensitive only) to make it usable by the
read/writes of the GICD_ICFGR register.

While the helper was previously returning the irq config bits
provided a single irq as an input, this new version is returning
the entire GICD_ICFGR word (read/writable)

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

Change-Id: I07e455a9e2819fed1f97a0e372d9d9a2e5ad4801
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31055
Reviewed-by: Hsuan Hsu <kugwa2000@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Move GICv2 intConfig for consistency
Giacomo Travaglini [Tue, 7 Jul 2020 09:10:09 +0000 (10:10 +0100)]
dev-arm: Move GICv2 intConfig for consistency

Every other helper is placed below the respective array storage

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

Change-Id: I398ac23eb68d84a8e0ed856550bfac8e403a86b3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31054
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch,cpu: Consolidate most of the StackTrace classes into a base class.
Gabe Black [Sun, 5 Jul 2020 06:16:08 +0000 (23:16 -0700)]
arch,cpu: Consolidate most of the StackTrace classes into a base class.

These classes are all basically empty now that Alpha has been deleted,
except in cases where the arch versions had copied versions of the Alpha
code.

This change pulls all the generic logic out of the arch versions, making
the arch versions much simpler and making it clearer what the core
functionality of the class is, and what parts are architecture specific
details.

In the future, the way the StackTrace class is instantiated should be
delegated to the Workload class so that ISA agnostic code doesn't need
to know about a particular ISA's StackTrace class, and so that
StackTrace logic can, at least theoretically, be specialized for a
particular workload. The way a stack trace is collected could vary from
OS to OS, for example.

Change-Id: Id8108f94e9fe8baf9b4056f2b6404571e9fa52f1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30961
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Slightly modernize and simplify code in cpu/profile.(hh|cc).
Gabe Black [Sat, 4 Jul 2020 22:28:02 +0000 (15:28 -0700)]
cpu: Slightly modernize and simplify code in cpu/profile.(hh|cc).

Change-Id: Ideb104d20b333305ead2356cbfff2aac2e0173b5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30960
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
4 years agoarch-arm: Initialized some variables
Tony Gutierrez [Wed, 8 Jul 2020 16:54:06 +0000 (12:54 -0400)]
arch-arm: Initialized some variables

Some of the variables in pauth_helpers.cc
are uninitialized in certain control paths
which causes a compiler warning. We initialize
these to false since they should be updated
to the correct value in all valid code paths.

Change-Id: If34d7daaf2404c2cf014c7b4c0c2f979580f36b9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31094
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Add basic support for KVM_CAP_ARM_USER_IRQ
Hsuan Hsu [Sun, 5 Jul 2020 14:56:07 +0000 (22:56 +0800)]
arch-arm: Add basic support for KVM_CAP_ARM_USER_IRQ

KVM_CAP_ARM_USER_IRQ is a KVM extension introduced in newer versions of
Linux (>= 4.12). It supports delivering interrupt from the kernel-space
timer to the user-space GIC, which means that it will be unnecessary to
use the memory-mapped timer and emulate it in gem5 anymore.

Using the option provided by this change, Linux is able to boot with 1
CPU successfully, and the speed is slightly faster then the memory-
mapped timer option. However, multicore seems to hang during boot and
still needs more investigation to be enabled.

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

Change-Id: I146bbcce3cf66f8f5ebee04ea5f1b9f54868721a
Signed-off-by: Hsuan Hsu <hsuan.hsu@mediatek.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30921
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

4 years agocpu-kvm,arch-arm: Improve KvmCPU tick event scheduling
Hsuan Hsu [Sat, 23 May 2020 16:41:58 +0000 (00:41 +0800)]
cpu-kvm,arch-arm: Improve KvmCPU tick event scheduling

The memory-mapped timer emulated by gem5 is driven by the underlying
gem5 tick, which means that we must align the tick with the host time
to make the timer interrupt fire at a nearly native rate.

In each KVM execution round, the number of ticks incremented is
directly calculated from the number of instructions executed. However,
when a guest CPU switches to idle state, KVM seems to stay in kernel-
space until the POSIX timer set up in user-space raises an expiration
signal, instead of trapping to user-space immediately; and somehow the
instruction count is just too low to match the elapsed host time. This
makes the gem5 tick increment very slowly when the guest is idle and
drastically slow down workloads being sensitive to the guest time which
is driven by timer interrupt.

Before switching to KVM to execute the guest code, gem5 programs the
POSIX timer to expire according to the remaining ticks before the next
event in the event queue. Based on this, we can come up with the
following solution: If KVM returns to user-space due to POSIX timer
expiration, it must be time to process the next gem5 event, so we just
fast-forward the tick (by scheduling the next CPU tick event) to that
event directly without calculating from the instruction count.

There is one more related issue needed to be solved. The KVM exit
reason, KVM_EXIT_INTR, was treated as the case where the KVM execution
was disturbed by POSIX timer expiration. However, there exists a case
where the exit reason is KVM_EXIT_INTR but the POSIX timer has not
expired. Its cause is still unknown, but it can be observed via the
"old_value" argument returned by timer_settime() when disarming the
POSIX timer. In addition, it seems to happen often when a guest CPU is
not in idle state. When this happens, the above tick event scheduling
incorrectly treats KVM_EXIT_INTR as POSIX timer expiration and fast-
forwards the tick to process the next event too early. This makes the
guest feel external events come too fast, and will sometimes cause
trouble. One example is the VSYNC interrupt from HDLCD. The guest seems
to get stuck in VSYNC handling if the KVM CPU is not given enough time
between each VSYNC interrupt to complete a service. (Honestly I did not
dig in to see how the guest handled the VSYNC interrupt and how the
above situation became trouble. I just observed from the debug trace of
GIC & HDLCD & timer, and made this conclusion.) This change also uses
a workaround to detect POSIX timer expiration correctly to make the
guest work with HDLCD.

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

Change-Id: I6159238a36fc18c0c881d177a742d8a7745a23ca
Signed-off-by: Hsuan Hsu <hsuan.hsu@mediatek.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30919
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Fix handling of writing timer control registers
Hsuan Hsu [Wed, 10 Jun 2020 03:10:33 +0000 (11:10 +0800)]
dev-arm: Fix handling of writing timer control registers

We should also deal with change of the imask bit, or we will lose timer
interrupt if the timer expires before the guest kernel unmasks the bit.
More precisely, consider the following common pattern in timer interrupt
handling:

    1. Set the interrupt mask bit (CNTV_CTL.IMASK)
    2. Reprogram the downcounter (CNTV_TVAL) for the next interrupt
    3. Clear the interrupt mask bit (CNTV_CTL.IMASK)

The timer can expires between step 2 & 3 if the value programmed in step
2 is small enough, and this seems very likely to happen in KVM mode. If
we don't check for timer expiration right after unmasking, we will miss
the only chance to inject the interrupt.

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

Change-Id: I75e8253bb78d15ae72cb985ed132f896d8e92ca6
Signed-off-by: Hsuan Hsu <hsuan.hsu@mediatek.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30918
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu-kvm: Initialize _hasKernelIRQChip in the constructor
Hsuan Hsu [Wed, 22 Apr 2020 08:39:56 +0000 (16:39 +0800)]
cpu-kvm: Initialize _hasKernelIRQChip in the constructor

This class member was only correctly set to true when using an in-kernel
interrupt controller, but was un-initialized when trying to use a user-
space one and would cause trouble.

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

Change-Id: I71b052c6da7e8790b05a15c07e7933bc4f912785
Signed-off-by: Hsuan Hsu <hsuan.hsu@mediatek.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30917
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Make generic timer work with level-sensitive support
Hsuan Hsu [Wed, 27 May 2020 07:41:39 +0000 (15:41 +0800)]
dev-arm: Make generic timer work with level-sensitive support

Support for level-sensitive PPIs and SPIs has been added to GICv2 now.
It is therefore the timer's responsibility to notify GICv2 to clear its
interrupt pending state. Without doing this, the guest will get stuck
in just a single round of the interrupt handler because GICv2 does not
clear the pending state, and eventually make the guest treat this
interrupt as problematic and then just disable it.

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

Change-Id: Ia8fd96bf00b28e91aa440274e6f8bb000446fbe3
Signed-off-by: Hsuan Hsu <hsuan.hsu@mediatek.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30916
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: Add earlycon to default kernel_cmd.
Chris January [Wed, 17 Jun 2020 13:57:33 +0000 (14:57 +0100)]
configs: Add earlycon to default kernel_cmd.

The earlyprintk kernel command line argument does not take a value on Arm.
Rather pass early console name using the earlycon command line argument.

Change-Id: Ie14fc425e87c50a0b59fa4270a3743ed4fe97589
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31074
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem: Optionally share the backing store
Boris Shingarov [Sun, 8 Mar 2020 16:37:16 +0000 (12:37 -0400)]
mem: Optionally share the backing store

This patch adds the ability for a host-OS process external to gem5
to access the backing store via POSIX shared memory.
The new param shared_backstore of the System object is the filename
of the shared memory (i.e., the first argument to shm_open()).

Change-Id: I98c948a32a15049a4515e6c02a14595fb5fe379f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30994
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: Don't use pseudo instructions to implement regular instructions.
Gabe Black [Mon, 13 Apr 2020 05:05:00 +0000 (22:05 -0700)]
arm: Don't use pseudo instructions to implement regular instructions.

Some ARM instructions were using quiesce and quiesceSkip pseudo
instruction bodies instead of implementing the one line of each of those
functions themselves. This creates two problems. First, it adds an
artificial depedence on the pseudo instruction implementations. Second,
it would confusing cause pseudo instruction DPRINTFs to fire when normal
instructions were executing.

This change simply replaces the calls with their targets one line
implementation, with some very minor duplication from multiple call
sights factored out into a local variable.

Change-Id: I596eafd8714227fa7f69edd542108598c9809b11
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27790
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Verify number of CPUs when restoring Generic Timer Cpts.
Richard Cooper [Wed, 17 Jun 2020 14:30:51 +0000 (15:30 +0100)]
dev-arm: Verify number of CPUs when restoring Generic Timer Cpts.

When restoring a checkpoint containing a generic timer, the checkpoint
expects to connect the timer to the same number of CPUs that were
present when the checkpoint was taken. If the number of CPUs in the
new simulation is different, deserialization will fail. In the case
that the number of CPUs expected by the checkpoint is greater than the
number of CPUs present, this will cause a segmentation fault caused by
reading off the end of the list of Thread Contexts.

This commit fixes the problem by checking the number of CPUs present
in the simulation matches the number of CPUs expected by the generic
timer checkpoint. If there is a mismatch, a fatal error is triggered
with an informative message to the user.

Change-Id: Iff9ad68d64e67b3df51682b7e4e272e5f355bcd6
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30576
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

4 years agoarch-arm: mark ID_AA64ISAR1_EL1.JSCVT implemented
Ciro Santilli [Fri, 5 Jun 2020 10:06:13 +0000 (11:06 +0100)]
arch-arm: mark ID_AA64ISAR1_EL1.JSCVT implemented

The feature was implemented at: I1b24839daef775bbb1eb9da5f32c4bb3843e0b28

Change-Id: I0c0f55e55a1ca3ca6bf40206a989ef0bb353ee84
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30934
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu-o3: Avoid passing ReExec 'faults' on CPU tracing interface
Michiel W. van Tol [Thu, 4 Jun 2020 15:01:26 +0000 (16:01 +0100)]
cpu-o3: Avoid passing ReExec 'faults' on CPU tracing interface

The O3 model uses ReExec faults to flush the pipeline and restart
after a memory ordering violation, e.g. due to an incoming snoop.

These, just like branch mispredict flushes, are not architectural
faults but micro-architectural events, and should therefore not
show up on the instruction tracing interface.

This adds a check on faulting instructions in commit, to verify
if the instruction faulted due to ReExec, to avoid tracing it.

Change-Id: I1d3eaffb0ff22411e0e16a69ef07961924c88c10
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30554
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-arm: Fix routeToHyp conditions for Excp Type
Jordi Vaquero [Thu, 25 Jun 2020 13:03:44 +0000 (15:03 +0200)]
arch-arm: Fix routeToHyp conditions for Excp Type

Change-Id: I8eadd8e1f8c53d5e61969b492d9f2cbd12110188
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30620
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agox86: Fix the indentation in arch/x86/stacktrace.hh.
Gabe Black [Sat, 4 Jul 2020 21:10:15 +0000 (14:10 -0700)]
x86: Fix the indentation in arch/x86/stacktrace.hh.

The namespace shouldn't be indented.

Change-Id: I2bd5fa5adbbad62a35cfb54a9509c48d45076539
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30959
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: Delete the unused ProcessInfo class.
Gabe Black [Sat, 4 Jul 2020 21:04:55 +0000 (14:04 -0700)]
arch: Delete the unused ProcessInfo class.

Change-Id: Ie67f696005fa60e117e1e4e4e985aee5e767ccec
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30958
Reviewed-by: Andreas Sandberg <andreas.sandberg@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: Delete util/batch, util/pbs, and util qdo.
Gabe Black [Sat, 4 Jul 2020 23:47:41 +0000 (16:47 -0700)]
util: Delete util/batch, util/pbs, and util qdo.

The util/pbs directory has a set of python scripts which were written to
submit jobs to the PBS pool at the University of Michigan. They aren't
incredibly specialized for that environment, but they do have a little
bit of hard coding which, for instance, uses paths which are only
meaningful there.

The util/batch directory was added alongside a seemingly unrelated
change (perhaps by accident?) and is a slightly updated copy of util/pbs
which also (or instead?) supports OAR.

The qdo script seems to be a script for managing job queues on PBS
and/or OAR, and is also tuned to the UofM environment, for instance
insisting that a path starts with /n/poolfs so that files are available
on an NFS volume shared with the pool.

All three of these scripts could potentially be useful with modification
in a similar environment, but also all three are unmaintained. The
environment in UofM may no longer actually match the expectations of
these scripts, and even if it does/did, gem5 may no longer be 100%
compatible with them.

If these scripts sit in util not being used by anyone, they add clutter
and complexity without adding any value. If someone really needs to know
what was once in them, they can be recovered from revision control.

Change-Id: I0192bd119893f7a41fcb820f4cf408609b03cd27
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30957
Reviewed-by: Steve Reinhardt <stever@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@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 agosim: Add M5_VAR_USED to var used in dprint
Tony Gutierrez [Thu, 2 Jul 2020 18:03:07 +0000 (14:03 -0400)]
sim: Add M5_VAR_USED to var used in dprint

Change-Id: I8f8654b8546ee8df3d4acd1ccbc5080ad38764c1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30896
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Remove some unused vars from self_debug.hh
Tony Gutierrez [Thu, 2 Jul 2020 17:37:29 +0000 (13:37 -0400)]
arch-arm: Remove some unused vars from self_debug.hh

Change-Id: I68b4ddfe66a34a29c0abfd52a8448e0b8a5bbe94
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30895
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jordi Vaquero <jordi.vaquero@metempsy.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Add missing override to ARM faults
Tony Gutierrez [Thu, 2 Jul 2020 17:35:54 +0000 (13:35 -0400)]
arch-arm: Add missing override to ARM faults

Change-Id: I7d64bdb4dfb0ba204e734f727b016bea168180ef
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30894
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Add Check for AddressSize Fault
Jordi Vaquero [Tue, 23 Jun 2020 09:27:35 +0000 (11:27 +0200)]
arch-arm: Add Check for AddressSize Fault

This patch add a check for AddressSize Fault during translation when
MMU is disabled.

Change-Id: Iff3a1543df010b086813869b4b6c4fe776e74499
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30619
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
4 years agoarch-arm: Implementation of Vector Catch debug exception
Jordi Vaquero [Tue, 29 Oct 2019 17:32:45 +0000 (18:32 +0100)]
arch-arm: Implementation of Vector Catch debug exception

This commit implements Vector Catch exception as they are described
in Armv8 reference manual chapter G2. This exception is just for AArch32.

+ tlb.cc: Implements the entry point for vector catch in addres mode
+ faults.hh/cc: Implements the entry point for vector catch in exception trap mode.
+ miscregs.cc: enables the use of vector catch releated registers
+ miscregs_types.hh: New bitwise type for vector catch control registers.
+ types.hh: declaration of EC for vector catch exception
+ self_debug.hh/cc: Main implementation of the vector catch functions to
                    match address and exceptions type.

Change-Id: Idbef26b16eff059e94ff16fac13bf5708dfe647f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30618
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Retrofit the VPtr type.
Gabe Black [Thu, 7 May 2020 11:17:31 +0000 (04:17 -0700)]
sim: Retrofit the VPtr type.

Rename it to be ProxyPtr and ConstProxyPtr, merge it with the
functionality of BufferArg and TypedBufferArg, etc., as described in
this design doc.

https://docs.google.com/document/d/1BYHBJcf7dB2Z25zAZ9snbeRKfstK9uERYH_3h66w_tc/

Change-Id: I2fddde20cc0ece257685bc50bd3419a4e9a00145
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29400
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Reverting version numbers
Bobby R. Bruce [Sat, 4 Jul 2020 03:59:44 +0000 (20:59 -0700)]
misc: Reverting version numbers

Change-Id: Ib423bf30e3a45c6e0c869499cd490851feeac5d1

4 years agomisc: Merged m5ops_base hotfix into develop
Bobby R. Bruce [Sat, 4 Jul 2020 03:46:28 +0000 (20:46 -0700)]
misc: Merged m5ops_base hotfix into develop

This hotfix was a cherry-pick of
https://gem5-review.googlesource.com/c/public/gem5/+/30914.

Change-Id: Icb57bca196d8112d8b4457264b8e695cef0b1068

4 years agomisc: Updated release notes and version number v20.0.0.3
Bobby R. Bruce [Fri, 3 Jul 2020 22:39:52 +0000 (15:39 -0700)]
misc: Updated release notes and version number

Updated the release notes and version number for the v20.0.0.3
hot-fix.

Change-Id: I3fe8eda1e6859f76a91fbcee595426bd25bfe432
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30956
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Remove m5ops_base declaration from ArmSystem
Hsuan Hsu [Fri, 3 Jul 2020 01:41:03 +0000 (09:41 +0800)]
arch-arm: Remove m5ops_base declaration from ArmSystem

This declaration should have been removed but was accidentally re-added.
It keeps m5ops_base from being passed correctly from Python to C++ when
using ARM ISA, and hence triggers gem5 crash when the guest tries to
call m5ops. This change removes it again to fix the crash.

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

Change-Id: I8df4ff19ecc0d64255f24dc991f71b065d2a894e
Signed-off-by: Hsuan Hsu <hsuan.hsu@mediatek.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30914
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
(cherry picked from commit e3793fd8a9b7096a67a0f4260a36cd4dd5afe72f)
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30955
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Hsuan Hsu <kugwa2000@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

4 years agocpu: Some cleanups in the O3 rename map.
Gabe Black [Sat, 20 Jun 2020 00:45:24 +0000 (17:45 -0700)]
cpu: Some cleanups in the O3 rename map.

Fix some style problems, mostly having to do with return type, but also
one with indentation.

Also simplify the very nested set of std::min-s into one.

Change-Id: I6dbb22128755d5b0c6bb71bd6f1b01e6234e2377
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30454
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Get rid of auto return types in the PhysRegFile.
Gabe Black [Sat, 20 Jun 2020 00:06:16 +0000 (17:06 -0700)]
cpu: Get rid of auto return types in the PhysRegFile.

This is a C++14 feature, where we only support up to C++11 currently. It
also unnecessarily obfuscates what these functions are doing, since the
return type is a simple and fixed.

Change-Id: I7459ed885c3f006edbcecd4c6be9835d77dbbbae
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30434
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Add .mailmap file
Jason Lowe-Power [Sat, 30 May 2020 00:59:50 +0000 (17:59 -0700)]
misc: Add .mailmap file

This file helps map committers' ids to a canonical name and email. This
is useful for tracking the same committer over time.

I've done my best to map the ids manually. I've tried to choose current
institutions/emails for the people that I personally know, but I am sure
to have missed many. Feel free to correct your own!

Change-Id: I17d57368a2ecb056025a6dabef37485ec5ce6aa9
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29672
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Remove m5ops_base declaration from ArmSystem
Hsuan Hsu [Fri, 3 Jul 2020 01:41:03 +0000 (09:41 +0800)]
arch-arm: Remove m5ops_base declaration from ArmSystem

This declaration should have been removed but was accidentally re-added.
It keeps m5ops_base from being passed correctly from Python to C++ when
using ARM ISA, and hence triggers gem5 crash when the guest tries to
call m5ops. This change removes it again to fix the crash.

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

Change-Id: I8df4ff19ecc0d64255f24dc991f71b065d2a894e
Signed-off-by: Hsuan Hsu <hsuan.hsu@mediatek.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30914
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: Updated DTB warnings in fs.py for Arm platforms.
Richard Cooper [Fri, 5 Jun 2020 14:27:45 +0000 (15:27 +0100)]
configs: Updated DTB warnings in fs.py for Arm platforms.

fs.py warns when an Arm platform is being created without a DTB file,
if the platform does not support the automatic creation of a DTB.

Updated the list of supported platforms with recent additions in order
to remove incorrect and potentially confusing warnings.

Change-Id: I549124a1afbc36e313f614dccab17973582bc3f7
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30575
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

4 years agoarch-arm: Implementation of SelfHosted Debug Software step
Jordi Vaquero [Tue, 29 Oct 2019 15:28:30 +0000 (16:28 +0100)]
arch-arm: Implementation of SelfHosted Debug Software step

This commit implements SelfHosted Debug Software step as is defined in
Armv8 Reference manual chapter D2.

+ decoder.hh/cc/isa: Checks the software step bit in order to skip the instruction
              before its decode.
+ faults.hh/cc: implemented SoftwareStep exception and proper modification
                of spsr during the invoke of other exceptions
+ isa.cc: Set debug mask if needed during cpsr modification
+ tlb.cc: Checks if software step is in ACTIVE state to avoid trigger
          breakpoint or watchpoint exception
+ self_debug.hh/cc: Implementation of State change and ss bit based during eret.
+ types.hh: Define sofware step flags like step, load or stepped to check the different flags
        that triggering software step should use for the ISS code.
+ pseudo.hh/isa: Triggers the sofware step esception after decode.
+ static_inst.cc: Call debugExceptionReturnsSS durint eret routine.

Change-Id: I3a64507c64842c34c76ad7f6daa5f4306bd55d2c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30617
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-ruby: Support device memories
Matthew Poremba [Wed, 27 May 2020 22:28:51 +0000 (17:28 -0500)]
mem-ruby: Support device memories

Adds support for device memories in the system and RubySystem classes.
Devices may register memory ranges with the system class and packets
which originate from the device MasterID will update the device memory
in Ruby. In RubySystem functional access is updated to keep the packets
within the Ruby network they originated from.

Change-Id: I47850df1dc1994485d471ccd9da89e8d88eb0d20
JIRA: https://gem5.atlassian.net/browse/GEM5-470
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29653
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 agostats: add --stats-root option to dump only under some SimObjects
Ciro Santilli [Tue, 17 Mar 2020 16:51:14 +0000 (16:51 +0000)]
stats: add --stats-root option to dump only under some SimObjects

This commit makes it possible to make invocations such as:

gem5.opt se.py --stats-root 'system.cpu[:].dtb' --stats-root 'system.membus'

When --stats-root is given, only stats that are under any of the root
SimObjects get dumped. E.g. the above invocation would dump stats such as:

system.cpu0.dtb.walker.pwrStateResidencyTicks::UNDEFINED
system.cpu1.dtb.walker.pwrStateResidencyTicks::UNDEFINED
system.membus.pwrStateResidencyTicks::UNDEFINED
system.membus.trans_dist::ReadReq

but not for example `system.clk_domain.clock`.

If the --stats-root is given, only new stats as defined at:
Idc8ff448b9f70a796427b4a5231e7371485130b4 get dumped, and old ones are
ignored. The commits following that one have done some initial conversion
work, but many stats are still in the old format.

Change-Id: Iadaef26edf9a678b39f774515600884fbaeec497
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28628
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem: Fix python3 incompatibility issue in slicc's HTML builder
Hoa Nguyen [Wed, 1 Jul 2020 02:07:35 +0000 (19:07 -0700)]
mem: Fix python3 incompatibility issue in slicc's HTML builder

In python3, an iterator does not have the next() method.
next(iterator) works in both python2.7+ and python3.

Change-Id: Ic1ceb993018a0f37e8d30086a054ffc2e311bb46
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30874
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: Improve error message occurs when base couldn't open a file
Hoa Nguyen [Tue, 30 Jun 2020 02:31:15 +0000 (19:31 -0700)]
base: Improve error message occurs when base couldn't open a file

Change-Id: Icaa571216f0eed4527a6aaddcf0c6814ad282c56
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30794
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 agoarch-arm: Implementation of ARMv8 SelfDebug Watchpoints
Jordi Vaquero [Tue, 29 Oct 2019 15:01:56 +0000 (16:01 +0100)]
arch-arm: Implementation of ARMv8 SelfDebug Watchpoints

This change includes ArmV8 SelfDebug Watchpoint implementation
as is described in Armv8 Reference manual D2/G2
The changes specific descriptions are as follow:
+ ArmISA.py: Enable up to 16 DBGWn registers
+ isa.cc: Include in setMiscReg specific cases for DBGWCn registers enable bit
+ miscregs_types.hh: Define DBGWC bitwise types
+ miscregs.hh/cc: Definition of watchpoint registers and its initialization
+ tlb.cc: Call for watchpoint entry point on tlb translation for dtlb.
+ fault.cc/hh: Definition/implementation of Watchpoint exception and
               modification on DataAbort Exception accordingly to handle
               AArch32 Watchpoint exceptions.
+ types.hh: Exception Code for watchpoint.
+ self_debug.cc/hh: Watchpoint check and comparison. Definition and
                    implementation of all the watchpoint auxiliar functions.

Change-Id: If275e4df0d28918dd887ab78166e653da875310a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28589
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
4 years agoutil: Add missing iostream header to util/m5/src/commands.cc
Hoa Nguyen [Fri, 26 Jun 2020 21:05:29 +0000 (14:05 -0700)]
util: Add missing iostream header to util/m5/src/commands.cc

Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Change-Id: I93f99284ecda22c73572cc0ffa8c3be0160ce560
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30734
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarm: Add a missing "break" in an ARM miscreg decode function.
Gabe Black [Thu, 25 Jun 2020 23:03:17 +0000 (16:03 -0700)]
arm: Add a missing "break" in an ARM miscreg decode function.

This change accidentally left out a "break" which gcc found and
complained about.

arch-arm: Implementation of Hardware Breakpoint exception

This change adds in the break based on the assumption that the function
should not fall through that case to the next.

Change-Id: Id728a0c9a504d1b6d231d3fe1e7c5ece05d3ac4d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30654
Reviewed-by: Jordi Vaquero <jordi.vaquero@metempsy.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoext: Remove dead code from results.py
Giacomo Travaglini [Thu, 11 Jun 2020 16:29:28 +0000 (17:29 +0100)]
ext: Remove dead code from results.py

This has been tested with vulture:
https://pypi.org/project/vulture

JIRA: https://gem5.atlassian.net/projects/GEM5/issues/GEM5-533

Change-Id: Ib145f8916fdde9f1571eb71ca2fef3501b48804b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30244
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 agoext: Remove dead code from main.py
Giacomo Travaglini [Thu, 11 Jun 2020 16:29:07 +0000 (17:29 +0100)]
ext: Remove dead code from main.py

This has been tested with vulture:
https://pypi.org/project/vulture

JIRA: https://gem5.atlassian.net/projects/GEM5/issues/GEM5-533

Change-Id: I5f0fbe6c4f5620503c03dfb1b3c8eb1fac31409e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30243
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 agoext: Remove dead code from configuration.py
Giacomo Travaglini [Thu, 11 Jun 2020 16:01:11 +0000 (17:01 +0100)]
ext: Remove dead code from configuration.py

This has been tested with vulture:
https://pypi.org/project/vulture

JIRA: https://gem5.atlassian.net/projects/GEM5/issues/GEM5-533

Change-Id: Ibaf812ace94c2ae0e2115552a87fb506a427bb89
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30242
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 agostats: add option to disable alignment spaces in stats.txt file
Ciro Santilli [Mon, 16 Mar 2020 18:02:26 +0000 (18:02 +0000)]
stats: add option to disable alignment spaces in stats.txt file

The alignment spaces in stats.txt takes up a lot of space and increases
simulation time, this commit adds the option to disable them with:

--stats-file stats.txt?spaces=False

Sample old lines with ?desc=False:

system.cpu.op_class::FloatMultAcc                   0      0.00%     65.92%
system.cpu.op_class::FloatDiv                       0      0.00%     65.92%

Sample new lines with ?desc=False;spaces=False:

system.cpu.op_class::FloatMultAcc 0 0.00% 65.92%
system.cpu.op_class::FloatDiv 0 0.00% 65.92%

On a 1000 dumpstats m5op loop spaces=False reduces:

* size: from 38MB to 20MB
* time: from 4.5s to 3.5s

Change-Id: Ib738b996b5646c329094cf61aaa1d977e844e759
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28627
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix minor bug PAUTH comparision with 0
Jordi Vaquero [Sat, 20 Jun 2020 12:58:39 +0000 (14:58 +0200)]
arch-arm: Fix minor bug PAUTH comparision with 0

Change-Id: I887e5fa256a8c9cc24f7b9ef1fc0353dea555e82
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30615
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

4 years agoarch-arm: Fix SCR.NS compare to 0
Jordi Vaquero [Tue, 23 Jun 2020 09:29:13 +0000 (11:29 +0200)]
arch-arm: Fix SCR.NS compare to 0

Change-Id: Iba7628640bb222fd21fd067ff60dbe4d34f4b196
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30614
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

4 years agoutil: Move the call type implementations into their own subdir.
Gabe Black [Sat, 4 Apr 2020 13:53:00 +0000 (06:53 -0700)]
util: Move the call type implementations into their own subdir.

Change-Id: Ie94c2ef4783b6b5700beb0f0bbeb765ce9b03934
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27551
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
4 years agoutil: c++-ify command line arguments in the m5 utility.
Gabe Black [Sat, 4 Apr 2020 13:34:11 +0000 (06:34 -0700)]
util: c++-ify command line arguments in the m5 utility.

Change-Id: Icfdd95c61ac9937823027563d086e5a690870fb4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27550
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agoutil: c++-ify the call type in the m5 utility.
Gabe Black [Sat, 4 Apr 2020 12:39:50 +0000 (05:39 -0700)]
util: c++-ify the call type in the m5 utility.

Use a class to track call type information, and mostly avoid having to
use ifdefs to include or not include support for individual call types.

Change-Id: I731c99e67ea1c511d53431df3f77b4a959919a59
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27549
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agoutil: Convert the m5 utility to C++.
Gabe Black [Sat, 4 Apr 2020 07:55:41 +0000 (00:55 -0700)]
util: Convert the m5 utility to C++.

This will make it possible to use the googletest unit testing framework,
and will let us use c++ mechanisms to simplify and streamline the code.

Change-Id: I8ab358de47ce6b5c2d601cc0b9f2a694b2037a9b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27548
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agoutil: Pull most code out of m5.c.
Gabe Black [Sat, 4 Apr 2020 07:05:48 +0000 (00:05 -0700)]
util: Pull most code out of m5.c.

By pulling the code out, this code can be tested by unit tests.

Change-Id: I2d0510995d3e97d721f1de3024120f0c90b7a5ba
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27547
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agopython,util: Fixed string decoding in include verifier
Bobby R. Bruce [Tue, 16 Jun 2020 18:00:19 +0000 (11:00 -0700)]
python,util: Fixed string decoding in include verifier

The Python2 <-> Python3 port included a decode on a string as part of
the include statement git-hook verifier. This results in a failure. To
fix this issue, the file to be checked is opened in binary mode.

This issue was highlighted by Gabe Black here:
https://gem5-review.googlesource.com/c/public/gem5/+/28588

Change-Id: I9a30ecc24d4741853ed1c2d0c03addf57c3e5b6c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30336
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Fix -Werror=maybe-uninitialized in system.cc
Giacomo Travaglini [Thu, 25 Jun 2020 08:27:58 +0000 (09:27 +0100)]
sim: Fix -Werror=maybe-uninitialized in system.cc

The patch is simply initializing when to 0 before unserializing
the real value

Change-Id: I4e19eeafa9334116b440948af1943f3835803671
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30594
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

4 years agoarch-arm: Fix arm switcheroo regressions
Giacomo Travaglini [Thu, 25 Jun 2020 09:18:40 +0000 (10:18 +0100)]
arch-arm: Fix arm switcheroo regressions

These were failing with the combination of:

https://gem5-review.googlesource.com/c/public/gem5/+/29233

with

https://gem5-review.googlesource.com/c/public/gem5/+/27967

Change-Id: I8d3c3701faf4828e76aaa2cb895b9589f057d370
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/+/30616
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim-se: Ignore chmod syscall
Kyle Roarty [Tue, 23 Jun 2020 22:51:29 +0000 (17:51 -0500)]
sim-se: Ignore chmod syscall

chmod caused crashes in certain MIOpen apps with the newer
version of MIOpen used in the Dockerfile. Ignoring it allows
those apps to finish.

Change-Id: If8d144d64f76ae04f384ebf983024c571b26875e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30534
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 MIOpen version used in Docker
Kyle Roarty [Mon, 22 Jun 2020 18:04:46 +0000 (13:04 -0500)]
util: Update MIOpen version used in Docker

The updated MIOpen version uses rocBLAS instead of MIOpenGEMM for
both convolution and rnn GEMM kernels, which provides a speedup in
simulation.

Change-Id: I4b81f18e95d39fd79b22d0bf92563ede61e44e32
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30494
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 agofastmodel,cpu,sim: Eliminate EndQuiesceEvent and plumbing.
Gabe Black [Thu, 6 Feb 2020 06:26:15 +0000 (22:26 -0800)]
fastmodel,cpu,sim: Eliminate EndQuiesceEvent and plumbing.

Change-Id: Ifca504bc298c09cbc16ef7cded21da455fb1e118
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25146
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: Move guts of quiesce and quiesceTick from ThreadContext to System.
Gabe Black [Thu, 6 Feb 2020 05:14:13 +0000 (21:14 -0800)]
sim: Move guts of quiesce and quiesceTick from ThreadContext to System.

The functions in ThreadContext are now just convenience wrappers.

Change-Id: Ib56c4bdd27e611fb667a8056dfae37065f4034eb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25145
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: Implementation of Hardware Breakpoint exception
Jordi Vaquero [Tue, 11 Feb 2020 16:22:25 +0000 (17:22 +0100)]
arch-arm: Implementation of Hardware Breakpoint exception

This code implementes hardware breakpoint exception as part of
software debug explained in ARMv8 reference manual ChapterD2.

+ ArmISA.py: Modify register to allow up to 15 Breakpoint registers
+ Sconscript: Add new file self_debug
+ faults.cc/hh: Defintion and implementation of HardwareBreakpoint
                exception inheriting ArmFault.
+ isa.cc/hh: ArmISA contains now an attribute pointing to the SelfDebug
             object that will be used to be access SelfDebug infrastructure
             Added special cases for setMiscReg to cache debug enable bits.
+ miscregs.hh/cc: Definition and initialization of DBGDCn and DBGDVn
                  registers.
+ tlb.cc/hh: We include the access to check for breakpoint instruction as
             part of the tlb translation process, checking if it comes from a
             fetch in the itlb
+ types.hh: Definition of new bitwise register types.
+ utility.cc/hh: Definition and implementation of auxiliar functions for
                the selfDebug.
+ self_debug.hh/cc: Main files that include the implemenattion of
            breakpoint checks, selfdebug enable and auxiliar functions.

Change-Id: I0e2a4be7f778de560c512253a9148da61e3e7e7a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27967
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agogpu-compute: Make headTailMap a std::unordered_map
Tony Gutierrez [Tue, 13 Aug 2019 18:15:16 +0000 (14:15 -0400)]
gpu-compute: Make headTailMap a std::unordered_map

There is no reason that the headTailMap needs to be
sorted, so let's use a std::unordered_map.

Change-Id: I18641b893352c18ec86e3775c8947a05a6c6547d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29930
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agogpu-compute: Remove unused function hostWakeUp from shader
Tony Gutierrez [Tue, 13 Aug 2019 17:52:25 +0000 (13:52 -0400)]
gpu-compute: Remove unused function hostWakeUp from shader

Change-Id: Ib4415a7c5918da03bbd16fe9adb4dd593dcaa95c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29929
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-gcn3: Fix V_MAD_I32_I24 sign extension
Michael LeBeane [Wed, 9 May 2018 21:02:17 +0000 (17:02 -0400)]
arch-gcn3: Fix V_MAD_I32_I24 sign extension

We are not properly sign extending the bits we hack off for
V_MAD_I32_I24.

This fixes rnn_fwdBwd 64 1 1 lstm pte assertion failure.

Change-Id: I2516e5715227cbd822e6a62630674f64f7a109e0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29928
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-gcn3, gpu-compute: Fix issue when reading const operands
Tony Gutierrez [Thu, 26 Jul 2018 21:28:39 +0000 (17:28 -0400)]
arch-gcn3, gpu-compute: Fix issue when reading const operands

Currently, when an instruction has an operand that reads a const
value, it goes thru the same readMiscReg() api call as other
misc registers (real HW registers, not constant values). There
is an issue, however, when casting from the const values (which are
32b) to higher precision values, like 64b.

This change creates a separate, templated function call to the GPU's
ISA state that will return the correct type.

Change-Id: I41965ebeeed20bb70e919fce5ad94d957b3af802
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29927
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-gcn3: Updating implementation of atomics
Alexandru Dutu [Wed, 10 Apr 2019 15:34:37 +0000 (11:34 -0400)]
arch-gcn3: Updating implementation of atomics

This changeset is moving the access of the data operand
from initiateAcc to the execute method of atomic instructions.

Change-Id: I1debae302f0b13f79ed2b7a9ed2f6b07fcec5128
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29926
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev: add support for HSA's barrier bit kernel synchronization
Matt Sinclair [Thu, 24 May 2018 18:02:13 +0000 (14:02 -0400)]
dev: add support for HSA's barrier bit kernel synchronization

This commit adds support for the HSA's barrier bit version of
synchronization.  This method of synchronization is used for all
HIP benchmarks, and thus is necessary to ensure that multiple
kernels from the same queue are synchronizing properly.

Change-Id: I64f2d311a3970b71194e0555e2b932800df65e98
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29925
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase: Fix build errors with gcc 10.x
Sandipan Das [Fri, 12 Jun 2020 13:41:27 +0000 (19:11 +0530)]
base: Fix build errors with gcc 10.x

This fixes conditions that perform a redundant check to
see if an unsigned value is greater than or equal to
zero. With gcc 10.x, this generates the following error
because of implicit usage of the "-Werror=type-limits"
flag.

"comparison of unsigned expression in '>= 0' is always true"

Change-Id: Ib1a88035ef5fba410d18de0adf614db4bc634faf
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30474
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: Use new InstRecord faulting flag in cpu models
Michiel W. van Tol [Wed, 10 Jun 2020 12:30:42 +0000 (13:30 +0100)]
cpu: Use new InstRecord faulting flag in cpu models

This patch sets the faulting flag in atomic, timing, minor and o3 CPU
models.

It also fixes the minor/timing CPU models which were not respecting the
ExecFaulting flag. This is now checked before calling dump() on the
tracing object, to bring it in line with the other CPU models.

Change-Id: I9c7b64cc5605596eb7fcf25fdecaeac5c4b5e3d7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30135
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: Add faulting flag to instruction tracing interface
Michiel W. van Tol [Tue, 19 May 2020 17:41:11 +0000 (18:41 +0100)]
sim: Add faulting flag to instruction tracing interface

This patch adds a faulting flag to InstRecord.
This allows tracers to identify that the traced instruction has
faulted, when ExecFaulting is enabled. It can be set with
InstRecord::setFaulting() and read with Instrecord::getFaulting().

Change-Id: I390392d59de930533eab101e96dc4d3c76500748
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30134
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 MARSHAL_XXFLAGS_EXTRA for the marshal object
Giacomo Travaglini [Thu, 4 Jun 2020 11:45:52 +0000 (12:45 +0100)]
scons: Add MARSHAL_XXFLAGS_EXTRA for the marshal object

We already provide to the user the CCFLAGS_EXTRA, LDFLAGS_EXTRA
variables to pass flags to scons when compiling/linking gem5.
Those variables are not passed to the marshal object.
We add an extra pair:

MARSHAL_CCFLAGS_EXTRA, MARSHAL_LDFLAGS_EXTRA

to add flag injection capabilities to the marshal object.

The patch is also renaming base_py_env to marshal_env.
This happens for 2 reasons:

1) At the moment the marshal compilation is the only task
making use of the base python environment.

2) Consistency with the EXTRA variable names added with this patch.
I could have named them as BASE_XXFLAGS_EXTRA, but it seems too much
generic and users might be confused by that, as they might think
the BASE_XXFLAGS_EXTRA is a subset of the XXFLAGS_EXTRA so that
setting it will affect gem5 compilation as well.

Change-Id: I3e420caa897059455ff8f35462db2b38da050e93
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30016
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarm: Teach gem5 to recognize the gem5 semihosting immediate values.
Gabe Black [Sat, 28 Mar 2020 00:28:26 +0000 (17:28 -0700)]
arm: Teach gem5 to recognize the gem5 semihosting immediate values.

These give access to the gem5 extension calls, currently only the pseudo
ops.

Change-Id: I60ece82f1f084791971a2de0b54be2f0d9da243e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27246
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
4 years agoutil: Add a semihosting implementation to the aarch64 m5 utility.
Gabe Black [Sat, 28 Mar 2020 00:27:30 +0000 (17:27 -0700)]
util: Add a semihosting implementation to the aarch64 m5 utility.

This will allow it to work on CPUs that only support semihosting like
ARM's fastmodels.

Change-Id: I74e536d79d0f77b864e1e4b9d73e265b6d0b1fcb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27245
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: Allow overriding the magic address in the m5 utility.
Gabe Black [Fri, 27 Mar 2020 10:05:19 +0000 (03:05 -0700)]
util: Allow overriding the magic address in the m5 utility.

This is useful in situations where the address is hard to know ahead of
time, for instance on ARM systems where the address map is hard to
predict.

The default address is now M5OP_ADDR, or 0 if that's not defined.

Change-Id: I3140e05b04365c1a76e52f8c3dc85f472c230ae4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27244
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
4 years agomem-ruby: add cache hit/miss statistics for TCP and TCC
Kyle Roarty [Wed, 10 Jun 2020 22:20:44 +0000 (17:20 -0500)]
mem-ruby: add cache hit/miss statistics for TCP and TCC

Change-Id: Ifa6fdbb9dd062a3684b9620eac6683c57e651a72
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30174
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bradford Beckmann <brad.beckmann@amd.com>
Maintainer: Bradford Beckmann <brad.beckmann@amd.com>

4 years agoarch-gcn3: Implement instruction v_div_fixup_f32
Xianwei Zhang [Thu, 24 May 2018 21:50:47 +0000 (17:50 -0400)]
arch-gcn3: Implement instruction v_div_fixup_f32

Instruction v_div_fixup_f32 was unimplemented. The
implementation was added by mimicking v_div_fixup_f64.

Change-Id: I9306b198f327e9fde3414aa1bb2bec20503b1efd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29924
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Xianwei Zhang <xianwei.zhang@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-gcn3: Implement instruction v_div_fmas_f32
Xianwei Zhang [Thu, 24 May 2018 17:49:43 +0000 (13:49 -0400)]
arch-gcn3: Implement instruction v_div_fmas_f32

Instruction v_div_fmas_f32 was unimplemented. The
implementation was added by mimicking v_div_fmas_f64.

Change-Id: I262820a7a66877d140eb99b538715c3cae4d1860
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29923
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Xianwei Zhang <xianwei.zhang@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-gcn3: fix bug with SDWA support
Matt Sinclair [Fri, 22 Jun 2018 06:42:39 +0000 (02:42 -0400)]
arch-gcn3: fix bug with SDWA support

Instructions that use the SDWA field need to use the extra SRC0
register associated with the SDWA instruction instead of the
"default" SRC0 register, since the default SRC0 register contains
the SDWA information when SDWA is being used.  This commit fixes
15de044c to take this into account.  Additionally, this commit
removes reads of the registers from the SDWA helper functions,
since they overwrite any changes made to the destination register.
Finally, this change modifies the instructions that use SDWA to
simplify the flow through the execute() functions.

Change-Id: I3bad83133808dfffc6a4c40bbd49c3d76599e669
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29922
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>