gem5.git
3 years agoarch-gcn3: Fix sign extension for branches with multiplied offset
Kyle Roarty [Wed, 10 Feb 2021 01:26:21 +0000 (19:26 -0600)]
arch-gcn3: Fix sign extension for branches with multiplied offset

Certain branch instructions specify that the result of (simm16 * 4)
gets sign-extended before being added to the PC.

Previously, that result was being sign extended as if it was still a
16-bit number. This patch fixes that by having the result be sign
extended as an 18-bit number.

Change-Id: Id4d430f8daa71ca7910b570e7e39790626f1decf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41053
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoscons: Simplify kvm architecture compatibility check.
Gabe Black [Sun, 7 Feb 2021 11:45:11 +0000 (03:45 -0800)]
scons: Simplify kvm architecture compatibility check.

The original implementation had a function we'd call back into later
which checked if a given ISA has KVM support on the current host.
Instead, this change reverse that and statically figures out which
single target ISA could possibly run under KVM on this host. Then later,
we can just check if the ISA we're trying to build is that one.

Change-Id: I3e7e06180983dfcc4611181718eb5d6210844d36
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40870
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agoscons: Merge redundant checks for the socket library.
Gabe Black [Sun, 7 Feb 2021 11:29:38 +0000 (03:29 -0800)]
scons: Merge redundant checks for the socket library.

scons can accept more than one library at a time, so lets check for both
at once instead of writing out almost the same check twice.

Change-Id: I82f9bdf59a349e28ca75a615d711051256ec73a4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40869
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agoscons: Simplify the check for protoc.
Gabe Black [Sun, 7 Feb 2021 11:17:21 +0000 (03:17 -0800)]
scons: Simplify the check for protoc.

Collapse nesting, and constrain the try/except to only the line in that
section which might actually be expected to throw an exception when
things are working normally.

This makes the code easier to read, and won't absorb and discard
exceptions which are thrown for unexpected reasons.

Change-Id: Id3ac417ab5545bef35ed8a87d05211c8ef2f5a50
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40867
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agoscons: Create a Configure checker for pkg-config.
Gabe Black [Sun, 7 Feb 2021 10:58:47 +0000 (02:58 -0800)]
scons: Create a Configure checker for pkg-config.

This will check if a pkg-config package exists at all, and then if it
does will attempt to use the supplied pkg-config arguments and
ParseConfig to set up the environment as needed.

Change-Id: I1495e5370b60dcebb1c9ce38517e84d727abc2fd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40866
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agoscons: Simplify the check for hdf5 support.
Gabe Black [Sun, 7 Feb 2021 10:32:01 +0000 (02:32 -0800)]
scons: Simplify the check for hdf5 support.

Collapse the check_hdf5 to the only place it was called, to set a simple
flag variable. Pull the invariant have_pkg_config check out of
check_hdf5_pkg, since if we don't have pkg-config there's no reason to
even try to use to set up hdf5. Turn the one-off, non-standard "Warning"
print into an actual warning().

Change-Id: I04793ae862aeaf1605467d205837b9dd744f93cb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40865
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agoscons: Simplify backtrace implementation detection.
Gabe Black [Sun, 7 Feb 2021 10:13:31 +0000 (02:13 -0800)]
scons: Simplify backtrace implementation detection.

There are really only two options current, glibc or none. If there's a
working implementation there's no real reason to select none, and if
there isn't there's no other option but to select none.

Instead of building up a list, having a default, and making what option
on the list is selected configurable, boil it down to either using glibc
if that implementation is detected, or warning and using none. Also
merge the "normal" and *BSD versions of the checks to reduce redundancy.

The complexity can be added back in if/when there are other
implementations to choose from.

Change-Id: I27c77996a00018302f4daea40924cf059d5a4323
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40864
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agoscons: Simplify check for have_posix_clock.
Gabe Black [Sun, 7 Feb 2021 09:57:35 +0000 (01:57 -0800)]
scons: Simplify check for have_posix_clock.

The "library" argument can actually be a list, in which case each
element of the list is checked, one after the other. Use that rather
than calling the CheckLibWithHeader method multiple times and manually
oring the results.

Change-Id: I5c774be15eaa9a7e52ec3ee5a1bbcc5ef1fa0f41
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40863
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agoscons: Move a displaced have_posix_clock check back where it goes.
Gabe Black [Sun, 7 Feb 2021 09:50:53 +0000 (01:50 -0800)]
scons: Move a displaced have_posix_clock check back where it goes.

This check had been separated from the code handling have_posix_clock by
some intervening code doing something else. Bring the check back
alongside the code setting that variable.

Change-Id: I6acb54fddbb5c41d6c38d4b93e649835a4775fa0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40862
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agoscons: Use conf to determine if some flags are supported.
Gabe Black [Sun, 7 Feb 2021 09:48:20 +0000 (01:48 -0800)]
scons: Use conf to determine if some flags are supported.

Use conf rather than checking for particular combinations of OS and/or
compiler versions. This *should* be just as correct, and not require
keeping track of what versions of the tools particular flags were added.

Change-Id: Icaa4c273fe89801e2808e6a814ce476700fd6956
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40861
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agoscons: In Check(Cxx|Link)Flag, only install the flag if it exists.
Gabe Black [Thu, 11 Feb 2021 06:21:06 +0000 (22:21 -0800)]
scons: In Check(Cxx|Link)Flag, only install the flag if it exists.

These functions where correctly returning whether a flag had existed,
and also correctly not installing it if asked not to. Unfortunately if
they *were* asked to install the flag, they ignored whether or not it
had actually existed to begin with.

Change-Id: I2dca0e1a0ddbc182576d48237aeea5452a02c51b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41159
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
3 years agomem-ruby: fix Sequencer latency reporting
Tiago Mück [Thu, 1 Oct 2020 21:45:56 +0000 (16:45 -0500)]
mem-ruby: fix Sequencer latency reporting

Most protocols won't set initialRequestTime, forwardRequestTime, and
firstResponseTime, thus leading to calculated latency being always 0.

Change-Id: Id2c73314a964bf6efb262d40b3df515373023b84
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41114
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: fix functional reads in abstract ctrl
Tiago Mück [Tue, 29 Sep 2020 19:07:23 +0000 (14:07 -0500)]
mem-ruby: fix functional reads in abstract ctrl

When calling functionalMemoryRead we need to check the mem req. queue
first as it may have write data not yet forwarded to the memory port.

Change-Id: Id37aa0837a3462d92ae9ac3b45ca756b2c4f7d97
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41153
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: fixes for masked writes
Tiago Mück [Fri, 22 Nov 2019 21:34:47 +0000 (15:34 -0600)]
mem-ruby: fixes for masked writes

This adds DataBlock::setData(PacketPtr) to update the block with
packet data. The method uses the packet's writeData to copy the
correct bytes if the request is a masked write.

Change-Id: I9e5f70fed29edcf55fef94a4b145aa838dc60eac
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41134
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem-ruby: warns on masked functional writes
Tiago Mück [Fri, 17 Jul 2020 15:49:31 +0000 (10:49 -0500)]
mem-ruby: warns on masked functional writes

It's not expected to issue masked functional writes or to receive
functional writes to an address with a pending masked write.

Change-Id: Ibc8ba5f642ff72f897e3a50011c0da6d3000b741
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41133
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-arm: Fix CPTR_EL2 writes
Giacomo Travaglini [Mon, 25 Jan 2021 13:24:28 +0000 (13:24 +0000)]
arch-arm: Fix CPTR_EL2 writes

* If E2H==1, CPTR_EL2.ZEN bits are not RES0.
* If E2H==1, CPTR_EL2.FPEN bits are not RES0.

Change-Id: Ic82b266975d89056d7c2f55464bd8a0c18a43e03
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39702
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomem: Initialize pendingWrites stat of NVMStats
Hoa Nguyen [Wed, 10 Feb 2021 10:52:33 +0000 (02:52 -0800)]
mem: Initialize pendingWrites stat of NVMStats

The initialization for this stat was mistakenly removed here
https://gem5-review.googlesource.com/c/public/gem5/+/39276

Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Change-Id: I27b6ddf6d6b925c9787acb07552a8d5acb081c22
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41073
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>
3 years agoscons: Pull Configure() to earlier in SConstruct so we can use it more.
Gabe Black [Sun, 7 Feb 2021 09:41:27 +0000 (01:41 -0800)]
scons: Pull Configure() to earlier in SConstruct so we can use it more.

This mechanism lets us check if headers are available, flags are
supported, etc. We should use that more often, rather than checking for
specific versions of tools where problematic new warnings were added, etc.

Change-Id: I5b1a6499147f27cc8944fcb8c61eb69e9fa8fb7a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40860
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agobase: Fix copyright of base/stats/SConscript
Daniel R. Carvalho [Fri, 5 Feb 2021 16:36:15 +0000 (13:36 -0300)]
base: Fix copyright of base/stats/SConscript

The original copyright was accidentally removed by
e59557af500d1633b1f41b023d6c072acaf145a0.

Change-Id: Ib3b7a34ea889fbd9a6f2a8e21a6bb24432939da9
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40755
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoscons: Extract the gem5 specific Configure call to its own file.
Gabe Black [Sun, 7 Feb 2021 08:38:59 +0000 (00:38 -0800)]
scons: Extract the gem5 specific Configure call to its own file.

This modularizes that fairly generic code and pulls it out of the main
SConstruct file.

Change-Id: I5f5edc866af43753b4e0a9cc63774ded0fffe06b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40858
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoscons: Trim down a check for mac OS and arch setting flags.
Gabe Black [Sun, 7 Feb 2021 08:20:25 +0000 (00:20 -0800)]
scons: Trim down a check for mac OS and arch setting flags.

This check used uname to determine if scons was running on macos, and
then a fairly elaborate check to see if the version was above 9, and if
the hardware supported 64 bit. I think at this point it's safe to assume
both that we're at least at macos 10 which is 19 years old, and that Mac
hardware supports 64 bit.

Change-Id: Ice66df2530bbcc929d3a37e7679634b75ba7b860
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40857
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agoscons: Remove "TIMEOUT" variable and checks.
Gabe Black [Sun, 7 Feb 2021 08:10:33 +0000 (00:10 -0800)]
scons: Remove "TIMEOUT" variable and checks.

This was used when regression tests were run from scons. Since that
hasn't been done for a while, these checks and this setting have no
purpose and can be removed.

Change-Id: Ibe383944f1427571061fd25ed6e97d9acfbbc7f1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40856
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agoscons: Update the Check(Cxx|Link)Flag checks to set their vars.
Gabe Black [Sun, 7 Feb 2021 07:41:35 +0000 (23:41 -0800)]
scons: Update the Check(Cxx|Link)Flag checks to set their vars.

This avoids boilerplate where we check to see if flag X is supported,
and if so then set flag X. Since there are shared and static versions of
the linker flags but we only explicitly check the static ones, this
change also adds a parameter to CheckLinkFlag to set both flavors. This
defaults to true since I assume most of the time linking flags will
apply to both.

Change-Id: I983222169e9835aeb98570362f7004e2ef0240d0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40855
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoscons: Remove partial linking.
Gabe Black [Sat, 6 Feb 2021 02:26:41 +0000 (18:26 -0800)]
scons: Remove partial linking.

This feature didn't actually provide any benefit in the end, and
increased build directory size and scons complexity.

Change-Id: Ia5aa16a8dd008599645076cea8131799f6086e0f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40795
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agocpu: Delete the empty, default off "nocpu".
Gabe Black [Sun, 7 Feb 2021 12:37:08 +0000 (04:37 -0800)]
cpu: Delete the empty, default off "nocpu".

This very nearly empty CPU directory does nothing except define a CPU at
the scons level which is off by default. It seems safe to delete it.

Change-Id: I5bd3a52062bbc67fb1ee7d350519cd85a3f8fdb8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40871
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

3 years agodev-arm: Add VRAM to VExpress_GEM5_Base
Giacomo Travaglini [Wed, 13 Jan 2021 14:28:03 +0000 (14:28 +0000)]
dev-arm: Add VRAM to VExpress_GEM5_Base

Change-Id: Ibd3ae59730c6d00a6bd8b129f973b79a565f66e4
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40973
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoscons: Add support for debug info compression.
Gabe Black [Fri, 5 Feb 2021 06:05:25 +0000 (22:05 -0800)]
scons: Add support for debug info compression.

If supported this will compress the debug information in object files,
libraries, and binaries. This decreases the size of the build/ARM
directory from 11GB to 7.2GB.

Because the benefit of this mechanism depends on the performance and
capacity of the build machine's storage, it can be disabled with the
--no-compress-debug scons flag. For instance if your storage is very
fast, writing out a larger binary may take less time than compressing
that same number of bytes, plus the time to write out the smaller
file.

This feature seems to make our presubmit test machine run out of memory
when trying to build gem5, and so is disabled in the testing scripts.

Change-Id: I71919062d23742b7658918b0fa9c4d91d0521fbf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40715
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agocpu: Remove units from stats description
Hoa Nguyen [Fri, 5 Feb 2021 07:32:55 +0000 (23:32 -0800)]
cpu: Remove units from stats description

A recent change https://gem5-review.googlesource.com/c/public/gem5/+/40622
allows units to be shown in stats dump; the units in stats
descriptions are nolonger necessary. This change removes units
from stats descriptions. However, for units that are multiples
of a supported unit (e.g. MegaBytes), the units

Change-Id: Ib63ea44e757f755f761b20b40e045bc37c90baff
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40735
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>

3 years agoarch-riscv: Fixed the style of stats variable names in TlbStats
Hoa Nguyen [Fri, 5 Feb 2021 05:50:18 +0000 (21:50 -0800)]
arch-riscv: Fixed the style of stats variable names in TlbStats

The variable names should be of camel case style.

Change-Id: I397c9f165a53ecc120ec57f7214c90a65e12407e
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40695
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

3 years agodev,dev-arm: Remove units from stats description
Hoa Nguyen [Fri, 5 Feb 2021 05:20:06 +0000 (21:20 -0800)]
dev,dev-arm: Remove units from stats description

A recent change https://gem5-review.googlesource.com/c/public/gem5/+/40622
allows units to be shown in stats dump; the units in stats
descriptions are nolonger necessary. This change removes units
from stats descriptions. However, for units that are multiples
of a supported unit (e.g. MegaBytes), the units in the descriptions
are kept until unit prefixes are supported.

Change-Id: I199afbf29fee13b08eeb323c4cb56c8a974dbe94
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40675
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>

3 years agomem: Remove units from stats description
Hoa Nguyen [Thu, 4 Feb 2021 23:24:43 +0000 (15:24 -0800)]
mem: Remove units from stats description

The change https://gem5-review.googlesource.com/c/public/gem5/+/40622
allows units to be shown in stats dump, the units in stats
descriptions are nolonger necessary. This change removes units
from stats descriptions. However, for units that are multiples
of a supported unit (e.g. MegaBytes), the units in the descriptions
are kept until unit prefixes are supported.

Change-Id: I4d87139290a8458e87da776e4328edbd6c224546
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40655
Tested-by: kokoro <noreply+kokoro@google.com>
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>

3 years agobase-stats: Print Units in Stats dump
Hoa Nguyen [Thu, 4 Feb 2021 09:12:22 +0000 (01:12 -0800)]
base-stats: Print Units in Stats dump

Change-Id: I8fba4f19805c3149175ff730d014383dcaa1bf81
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40622
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>
3 years agomem: Change warmupCycle stat to warmupTick
Hoa Nguyen [Wed, 3 Feb 2021 23:37:28 +0000 (15:37 -0800)]
mem: Change warmupCycle stat to warmupTick

Change-Id: I96399dc5c062479049e7bf0de91d9f4f97903c43
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40575
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>

3 years agocpu: Add Units to cpu stats
Hoa Nguyen [Thu, 14 Jan 2021 12:10:48 +0000 (04:10 -0800)]
cpu: Add Units to cpu stats

Change-Id: I387b2e9f6ecf62757242056f732bd443c457ebea
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39095
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

3 years agolearning-gem5: Add units to stats
Hoa Nguyen [Wed, 20 Jan 2021 10:17:30 +0000 (02:17 -0800)]
learning-gem5: Add units to stats

Change-Id: Iaff6c19b0b87250d15f5afb0763680fafe782d52
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39417
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>

3 years agoarch-arm,arch-riscv,arch-x86: Add units to stats
Hoa Nguyen [Wed, 20 Jan 2021 10:15:49 +0000 (02:15 -0800)]
arch-arm,arch-riscv,arch-x86: Add units to stats

Change-Id: I6bf506c223207306d71511491e024546b209030f
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39416
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
3 years agodev,dev-arm: Add units to stats in /src/dev
Hoa Nguyen [Wed, 20 Jan 2021 09:55:39 +0000 (01:55 -0800)]
dev,dev-arm: Add units to stats in /src/dev

Change-Id: I9d2449ef173f2f467717a9d233aef8d9a2f43f26
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39415
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

3 years agosim: Add units to src/sim
Hoa Nguyen [Mon, 18 Jan 2021 12:38:57 +0000 (04:38 -0800)]
sim: Add units to src/sim

Change-Id: I5fa147aa1319d62be1790bbd74fd097ac566f808
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39296
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

3 years agomem: Add Units to mem stats
Hoa Nguyen [Mon, 18 Jan 2021 07:13:21 +0000 (23:13 -0800)]
mem: Add Units to mem stats

Add units to mem stats except mem-ruby stats

Change-Id: Iab214b5d08eb1accc2b35af0c3aed7d30df5b5f3
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39276
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agocpu,mem: Converting stats to supported units
Hoa Nguyen [Tue, 9 Feb 2021 01:24:55 +0000 (17:24 -0800)]
cpu,mem: Converting stats to supported units

There are several stats having unit being a multiple of supported
units. This change makes the following conversions:
  * MiB/s -> bytes/s
  * percentage -> ratio

Change-Id: I9832796e87698daa7f87f91fa39ce40bbf92e737
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41013
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

3 years agomem: Fix/Improve stats in src/mem
Hoa Nguyen [Thu, 28 Jan 2021 08:50:29 +0000 (00:50 -0800)]
mem: Fix/Improve stats in src/mem

* Improved/Fixed the stat description of several stats.
* Fixed the value assigned to `warmupCycle` stat of cache tags,
it was set to curTick().
* Use ADD_STAT in CacheCmdStats.

Change-Id: Iabff7d42318fcc73df79ee7f3c5430f4c45555e5
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39975
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agobase-stats: Add Units to Stats
Hoa Nguyen [Thu, 7 Jan 2021 11:18:57 +0000 (03:18 -0800)]
base-stats: Add Units to Stats

This commit adds an option to add SI and its derived units to stats.

Units are now the third parameter of every Stat class constructor.

The following are convenient macros that could be used to add units
to stats,
   * UNIT_CYCLE: represents clock cycles.
   * UNIT_TICK: represents the count of gem5's Tick.
   * UNIT_SECOND: represents the base unit of time defined by SI.
   * UNIT_BIT: represents the number of computer bits.
   * UNIT_BYTE: represents 8 bits.
   * UNIT_VOLT: a SI derived unit measuring potential difference.
   * UNIT_JOULE: represents joule, a unit of energy, as defined by SI.
   * UNIT_WATT: represents 1 watt, where 1 watt = 1 joule / second.
   * UNIT_CELSIUS: represents 1 Celsius degree as defined by SI.
   * UNIT_RATE(T1, T2): represents the unit of a quantity of T1 divided
                        by a quantity of T2.
   * UNIT_RATIO: represents the unit of a quantity of unit T divided by
                 a quantity of unit T.
   * UNIT_UNSPECIFIED: the unit of the stat is unspecified. This type of
                       unit is mainly for backward compatibility. Newly
                       introduced stats should have the units specified.

This commit also alters the behavior of the ADD_STAT macro.
Specifically, ADD_STAT syntax is unchanged, but the unit of the stat
is hardcoded to be UNIT_UNSPECIFIED.

link: https://gem5.atlassian.net/browse/GEM5-849
This change is an effort towards supporting new stats schema:
https://github.com/gem5/stats-schema

Change-Id: I791704a6c4d9e06332797dbfc5eb611cb43f4710
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38855
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
3 years agocpu: Track misc regs in vectors in the O3 CPU instruction class.
Gabe Black [Tue, 8 Dec 2020 02:11:50 +0000 (18:11 -0800)]
cpu: Track misc regs in vectors in the O3 CPU instruction class.

Most instructions won't actually write to misc regs, so the overhead
should be quite small, particularlly compared to the other overheads in
the O3.

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

3 years agocpu: Track flat register indices in the Minor CPU with a vector.
Gabe Black [Tue, 8 Dec 2020 01:43:58 +0000 (17:43 -0800)]
cpu: Track flat register indices in the Minor CPU with a vector.

That avoids having to know the maximum number of dest registers there
can be in any instruction, and will likely not affect the performance of
the Minor CPU overall.

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

3 years agocpu: Factor MaxInst(SrcDest)Regs out of the trace CPU.
Gabe Black [Tue, 8 Dec 2020 01:39:02 +0000 (17:39 -0800)]
cpu: Factor MaxInst(SrcDest)Regs out of the trace CPU.

Manage register and ROB dependencies using lists instead of arrays to
better support random removals, and avoid having to know the global
maximum number of registers in an instruction.

Change-Id: Ie9f30c61bac52ad31745a1011f62c95622908d2f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38386
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agobase: Add XOR and modulo operator to ChannelAddr
David Schall [Thu, 18 Jun 2020 15:14:44 +0000 (16:14 +0100)]
base: Add XOR and modulo operator to ChannelAddr

Channel address class did not offer bitwise
XOR and modulo operation. These two functions
where now added to the ChannelAddr class.

Change-Id: I02a5e49e9700cc5283415c921a25989a130e5d07
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39235
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agosim: Get rid of the IsConforming type trait template.
Gabe Black [Wed, 3 Feb 2021 03:03:56 +0000 (19:03 -0800)]
sim: Get rid of the IsConforming type trait template.

The idea of this template was to distinguish types which should
grow/shrink based on the native size of the ABI in question. Or in other
words, if the ABI was 32 bit, the type should also be 32 bit, or 64 bit
and 64 bit.

Unfortunately, I had intended for Addr to be a conforming type (since
local pointers would be conforming), but uint64_t not to be. Since Addr
is defined as a typedef of uint64_t, the compiler would make *both*
types conforming, giving incorrect behavior on 32 bit systems.

Local pointers will need to be handled in a different way, likely with
the VPtr template, so that they will be treated correctly and not like
an explicitly 64 bit data type.

Change-Id: Idfdd5351260b48bb531a1926b93e0478a297826d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40495
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch,sim: Use VPtr<> instead of Addr in system call signatures.
Gabe Black [Wed, 3 Feb 2021 08:25:48 +0000 (00:25 -0800)]
arch,sim: Use VPtr<> instead of Addr in system call signatures.

This tells the GuestABI mechanism that these are guest pointers and not
uint64_ts, and that they should be treated as 32 bit or 64 bit values
depending on the size of pointers in the target ABI.

Change-Id: Ia9b5447848c52668a975d8b07b11ad457e756b13
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40498
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
3 years agodev-arm: Reduce boilerplate when read/writing to Pio devices
Giacomo Travaglini [Tue, 12 Jan 2021 15:07:02 +0000 (15:07 +0000)]
dev-arm: Reduce boilerplate when read/writing to Pio devices

Change-Id: Id59ac950f37d7f4f2642daf324d501da1ee622de
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40775
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agodev: Fix register bank unit test in .debug
Daniel R. Carvalho [Sun, 7 Feb 2021 03:14:58 +0000 (00:14 -0300)]
dev: Fix register bank unit test in .debug

The lack of definition of this static variable was throwing
and undefined reference error when running

  scons build/X86/unittests.opt.

For more info, check

  https://stackoverflow.com/questions/
    8016780/undefined-reference-to-static-constexpr-char

Change-Id: Id736dc42a82aea871da6a53c06d89fd399d3559a
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40836
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agobase: Fix storage unit test in .fast
Daniel R. Carvalho [Sun, 7 Feb 2021 02:49:36 +0000 (23:49 -0300)]
base: Fix storage unit test in .fast

These tests depend on assertions being triggered, which
does not happen in .fast.

Change-Id: I0dd78f184809a453035046bc76640dfb5988bb5f
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40835
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agotests,base: Delete the SymbolTable::load method and symtest test.
Gabe Black [Thu, 4 Feb 2021 07:57:47 +0000 (23:57 -0800)]
tests,base: Delete the SymbolTable::load method and symtest test.

This test expects to load a symbol file using the load method of gem5's
SymbolTable class, and then to search through it for a given symbol or
address.

Unfortunately, the type of file it expects to load has a format where
each line is of the form:

0x00000000, symbol_name

where the numerical part is the address of the symbol, and the part
after the comma is the symbol name. I have not been able to find any
tool which outputs a symbol file in this format, or any tool for
inspecting an existing object file which will output symbols in this
format. I looked at objdump, objcopy, nm, and the map file format output
by gnu's linker. nm has 3 different output formats, none of which match.
Usually when working with ELF files, one would just generate a new ELF
file which only had debugging information like the symbol table, and
then strip the symbols out of the original.

Since this file format seems to have been invented from thin air, there
isn't really a good way to generate a canonical file to test the loading
code against, nor is being able to load this obscure format likely to be
useful to anybody. If someone *did* want to load an external symbol
table, they would use the ELF loader and not this.

This CL deletes both this test, and the loading code in SymbolTable.

Change-Id: I20402e3f35e54d1e186a92d9c83d1c06ec86bf7d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40620
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-power: Restore consistency with other platforms
Boris Shingarov [Thu, 4 Feb 2021 16:15:28 +0000 (11:15 -0500)]
arch-power: Restore consistency with other platforms

The 32-bit POWER reference test binary was removed in c1ebdf66f
(as a nasty surprise for POWER users).

The remaining platforms split between two approaches:

MIPS rebuilds "hello" from source.
This fails for two reasons:
1) The trivial reason is that on POWER make abends due to no makefile.
2) The more fundamental reason is that gem5 is not completely bug-free
(especially the Decoder on POWER in this case), therefore regression
testing is only possible if we have not just some hello program, but
a very particular bit sequence to serve as an immutable reference.

ARM and X86 follow the reference-bit-sequence approach.  POWER will
be consistent with same.  Including the sha1 for hello32,
77b27b67393311546e768b5ff35202490bad71aa, as a simple immutability
assurance.  I have also renamed hello to hello32 in anticipation to
merge Sandipan's e52dbcb.

Change-Id: I77ef31349c9e50b987c6f58bb23324844527366d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40635
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-by: Pratik Sampat <pratik.r.sampat@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agosim: Add a void * analogue to VPtr.
Gabe Black [Wed, 3 Feb 2021 08:22:11 +0000 (00:22 -0800)]
sim: Add a void * analogue to VPtr.

The default type for VPtr is now void, and the void partial
specialization of VPtr is basically just a fancy container for Addr. Its
purpose is to distinguish guest addresses from actual uint64_t-s in the
signature of simcalls so that types which are purposefully 64 bits will
stay that way, and addresses will scale to the size of pointers in the
target ABI.

Change-Id: I71e2201f5917005861ba678c6675dbcbaa0965b3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40497
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
3 years agoarch,sim: Add a UintPtr type to the ABI types for GuestABI.
Gabe Black [Wed, 3 Feb 2021 04:17:36 +0000 (20:17 -0800)]
arch,sim: Add a UintPtr type to the ABI types for GuestABI.

This type is primarily used to determine the size of a pointer when
using that ABI, similar to the uintptr_t type, but also less directly
to determine the "native" size of the ABI. For instance, for 32 bit ARM
ABIs, it should be defined as uint32_t since that's both the size of a
uintptr_t, and, less directly, the size of a 32 bit ARM register and
"naturally" sized types in that ABI.

This type can be used by the VPtr template to retrieve its actual value
from a simcall's parameters. In general, when accepting or returning a
pointer or address in a simcall, the VPtr template should be used so
that it's managed correctly by GuestABI. Addr will be treated as a
uint64_t allways which will be incorrect for 32 bit ABIs.

Change-Id: I3af046917387541d6faff96a21a1f1dbf7317e06
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40496
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
3 years agobase: Initialize storage params on constructor
Daniel R. Carvalho [Sat, 15 Feb 2020 13:54:21 +0000 (14:54 +0100)]
base: Initialize storage params on constructor

Force error checking on storage params by imposing it on construction.

Change-Id: I66a902cd5a7c809d3ac5be65b406de29fc0acf1c
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25426
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

3 years agobase: Fix storage params safe_cast
Daniel R. Carvalho [Wed, 3 Feb 2021 21:15:10 +0000 (18:15 -0300)]
base: Fix storage params safe_cast

Although they provide the exact same behavior, the params
created in the tests did not have the type expected by the
internal safe cast.

The following error was triggered:

storage.test.debug: build/NULL/base/cast.hh:47: T safe_cast(U)
 [with T = const Stats::SampleStor::Params*;
  U = const Stats::StorageParams*]:
 Assertion `ret' failed.

Change-Id: I4f2ba51f3ccdb44589e61f235997245e7d9bf3c9
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40555
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

3 years agobase: Make read-only functions const in ScalarBase
Daniel R. Carvalho [Wed, 19 Feb 2020 08:27:17 +0000 (09:27 +0100)]
base: Make read-only functions const in ScalarBase

These functions do not need to modify their storage's contents.

ScalarBase's non-const value() has been removed.

Change-Id: I4dd3899a29a741a7d8cd199ccd254b346d86ae07
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27084
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

3 years agotests: Delete the now unused unittest/unittest.[cc|hh].
Gabe Black [Thu, 4 Feb 2021 07:00:29 +0000 (23:00 -0800)]
tests: Delete the now unused unittest/unittest.[cc|hh].

These files were originally used to provide a more gtest like mechanism
for the UnitTest executables, many of which didn't actually test
anything. With the definitions in those files, the tests could check
whether their expectations were met, and either pass or fail without a
human having to inspect the output and knowing what output to expect.

Change-Id: Ie0601391b994859eb544b37201333838fa3ba02a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40618
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>

3 years agobase,tests: Convert cprintftime from a "UnitTest" to a normal bin.
Gabe Black [Thu, 4 Feb 2021 06:28:24 +0000 (22:28 -0800)]
base,tests: Convert cprintftime from a "UnitTest" to a normal bin.

This "UnitTest" was really not a unit test, it was a timing utility for
measuring the performance of gem5's cprintf implementation. The name was
misleading, but more than that, it was linked against all of gem5 which
created a approximately 1.5 gigabyte binary for what is a very small
program.

Instead, the new version of cprintftime, which has the same
functionality as the old version, weighs in at a svelte 500k with debug
information.

This also trims down the number of misleading "UnitTest" entries to 3,
getting us closer to the point where we can eliminate that type of
entity entirely.

Change-Id: Id30d094f2844e948fe67e820c89412f8667aaa52
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40617
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
3 years agoscons: Remove the "abstract" tag from Executable classes.
Gabe Black [Thu, 4 Feb 2021 06:35:22 +0000 (22:35 -0800)]
scons: Remove the "abstract" tag from Executable classes.

That tag was intended to mark an Executable subclass as abstract, aka
only suitable for using as bases for other Executable subclasses and not
for direct instantiation. The only place it was used was the base
Executable class however, and that class is actually directly useful
when setting up a generic executable from other gem5 sources.

Change-Id: I70204b63c03bb45bf21b8c312a7b8581be5e0cab
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40616
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>

3 years agobase: Replace a "panic" in cprintf with an M5_UNREACHABLE.
Gabe Black [Thu, 4 Feb 2021 06:33:30 +0000 (22:33 -0800)]
base: Replace a "panic" in cprintf with an M5_UNREACHABLE.

The panic was just to signal that a point in the code should be
unreachable, and brought with it a thread of dependencies which would
bring in more and more extra files as it was followed.

Change-Id: I46fb99b91929dca78a6547bdc7635aab9a63a9f3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40615
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>

3 years agoutil,python: Ignore ELF binary blobs in pre-commit
Boris Shingarov [Thu, 4 Feb 2021 16:43:23 +0000 (11:43 -0500)]
util,python: Ignore ELF binary blobs in pre-commit

Change-Id: I60554b2ae7536687a6c0a883a7678f793c3c77d4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40636
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agobase: Remove unnecessary includes from base/loader/symtab.[cc|hh].
Gabe Black [Thu, 4 Feb 2021 07:03:10 +0000 (23:03 -0800)]
base: Remove unnecessary includes from base/loader/symtab.[cc|hh].

These were either completely unnecessary, or headers in the .cc which
had already been included in the .hh and were not needed beyond their
use in the .hh.

Change-Id: Ic95e29f3fdd8cab00ab93d254d2e1c25aacf4632
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40619
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>
3 years agoarch,cpu: Move a Decode DPRINTF into the arch Decoder classes.
Gabe Black [Fri, 29 Jan 2021 01:34:43 +0000 (17:34 -0800)]
arch,cpu: Move a Decode DPRINTF into the arch Decoder classes.

This DPRINTF accesses the ExtMachInst typed machInst member of the
StaticInst class, and so is ISA dependent. Move the DPRINTF to where the
instructions are actually decoded where that type doesn't have to be
disambiguated.

Also, this change makes this DPRINTF more accurate, since microops are
not really "decoded" when they are extracted from a macroop. The process
of unpacking them to feed into the rest of the CPU should be fairly
trivial, so really they're just being retrieved. With the DPRINTF in
this new position, it will only trigger when an instruction is actually
decoded from memory.

Change-Id: I14145165b93bb004057a729fa7909cd2d3d34d29
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40099
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agocpu: Replace fixed sized arrays in the O3 inst with variable arrays.
Gabe Black [Mon, 7 Dec 2020 12:41:45 +0000 (04:41 -0800)]
cpu: Replace fixed sized arrays in the O3 inst with variable arrays.

The only way to allocate fixed sized arrays which will definitely be big
enough for all source/destination registers for a given instruction is
to track the maximum number of each at compile time, and then size the
arrays appropriately. That creates a point of centralization which
prevents breaking up decoder and instruction definitions into more
modular pieces, and if multiple ISAs are ever built at once, would
require coordination between all ISAs, and wasting memory for most of
them.

The dynamic allocation overhead is minimized by allocating the storage
for all variable arrays in one chunk, and then placing the arrays there
using placement new. There is still some overhead, although less than it
might be otherwise.

Change-Id: Id2c42869cba944deb97da01ca9e0e70186e22532
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38384
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agocpu: Style fixes in the trace CPU.
Gabe Black [Mon, 7 Dec 2020 13:19:10 +0000 (05:19 -0800)]
cpu: Style fixes in the trace CPU.

Change-Id: I3ef51aa8667926f3c4fab3c11e188102dd4bab3c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38385
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

3 years agomisc: Revert version info for develop branch
Bobby R. Bruce [Wed, 3 Feb 2021 19:54:13 +0000 (11:54 -0800)]
misc: Revert version info for develop branch

Change-Id: Ie01f41cb40b025ef31028bff4d59023e380fcf07
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40536
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoMerge "misc: Merge branch v20.1.0.3 hotfix into develop" into develop
Bobby R. Bruce [Thu, 4 Feb 2021 05:01:00 +0000 (05:01 +0000)]
Merge "misc: Merge branch v20.1.0.3 hotfix into develop" into develop

3 years agofastmodel: fix cntfrq in A76
Earl Ou [Tue, 2 Feb 2021 09:31:15 +0000 (17:31 +0800)]
fastmodel: fix cntfrq in A76

Change-Id: I7d1167e8b61d6768039c34fe1ee54560f7845dfa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40355
Reviewed-by: Ahbong Chang <cwahbong@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-gcn3: Implementation of s_sleep
Alexandru Dutu [Tue, 22 May 2018 18:09:54 +0000 (14:09 -0400)]
arch-gcn3: Implementation of s_sleep

This changeset implements the s_sleep instruction in a similar
way to s_waitcnt.

Change-Id: I4811c318ac2c76c485e2bfd9d93baa1205ecf183
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39115
Maintainer: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-x86: Make JRCXZ instruction do 64-bit jump
Kyle Roarty [Sun, 31 Jan 2021 01:45:14 +0000 (19:45 -0600)]
arch-x86: Make JRCXZ instruction do 64-bit jump

Per the AMD64 Architecture Programming Manual:

The size of the count register (CX, ECX, or RCX) depends on the
address-size attribute of the JrCXZ instruction. Therefore, JRCXZ can
only be executed in 64-bit mode

and

In 64-bit mode, the operand size defaults to 64 bits. The processor
sign-extends the 8-bit displacement value to 64 bits before adding it
to the RIP.

This patch also renames the instruction from JRCX to JRCXZ to match the
language in the programming manual.

Change-Id: Id55147d0602ff41ad6aaef483bef722ff56cae62
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40195
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agotests: Changed 'long' boot tests to X86 from GCN3_X86
Bobby R. Bruce [Tue, 2 Feb 2021 20:27:19 +0000 (12:27 -0800)]
tests: Changed 'long' boot tests to X86 from GCN3_X86

We compile GCN3_X86 for the 'quick' tests, as a substitute for X86. We
compile X86 as part of our nightly tests, along with the running of the
'long' tests. This leads to a needless duplicate compilation of the X86
isa during our nightly tests. Therefore, this commit removes GCN3_X86
for the 'long' tests (only the x86 boot tests are affected).

Change-Id: Ifd8aaf0e7b8178c588ace33b27671d4ba9b353ed
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40415
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: Merge branch v20.1.0.3 hotfix into develop
Bobby R. Bruce [Wed, 3 Feb 2021 19:48:51 +0000 (11:48 -0800)]
misc: Merge branch v20.1.0.3 hotfix into develop

Change-Id: I12cca586627718bf41fe24f0fcd3f10c4fe48b2d

3 years agoscons,python: Fix `--without-python` flag
Bobby R. Bruce [Mon, 25 Jan 2021 21:54:03 +0000 (13:54 -0800)]
scons,python: Fix `--without-python` flag

Even with the `--without-python` flag, checks were still done to ensure
the correct version of Python was being used. This commit fixes this so
these checks are not performed when `--without-python` is enabled.

Change-Id: I2242f2971a49ef28cff229ad0337bce0a998413d
Issue-on: https://gem5.atlassian.net/browse/GEM5-880
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39715
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Lukas Steiner <lsteiner@rhrk.uni-kl.de>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: Updated the RELEASE-NOTES and version number
Bobby R. Bruce [Tue, 2 Feb 2021 21:27:38 +0000 (13:27 -0800)]
misc: Updated the RELEASE-NOTES and version number

Updated the RELEASE-NOTES.md and version number for the v20.1.0.3
hotfix release.

Change-Id: I95ab84ea259f5e0529ebaa32be65d9a14370f219
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40435
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>
3 years agogpu-compute,misc: Remove unused private variable
Bobby R. Bruce [Tue, 2 Feb 2021 19:53:30 +0000 (11:53 -0800)]
gpu-compute,misc: Remove unused private variable

Clang 9 fails to compile GCN3 due to the unused private variable,
`_nxtFreeIdx`, in `src/gpu-compute/dyn_pool_manager.hh`. This variable
has therefore been removed.

Change-Id: I33f2e9634bbf8d5cea7a42ae2ac9f3ea8298d406
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40397
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agogpu-compute,misc: Fix Clang missing override errors
Bobby R. Bruce [Tue, 2 Feb 2021 19:51:41 +0000 (11:51 -0800)]
gpu-compute,misc: Fix Clang missing override errors

Clang fails to compile GCN3 due to missing overrides in
`src/gpu-compute/gpu_command_processor.hh`. This commit fixes this
errror.

Change-Id: I6da9fce7c3eb86a5418a931ee4f225cceda488a5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40396
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-riscv,misc: Fix clang missing override errors
Bobby R. Bruce [Tue, 2 Feb 2021 19:48:28 +0000 (11:48 -0800)]
arch-riscv,misc: Fix clang missing override errors

Clang 9 failed to compile RISC-V due to missing overrides in
`src/arch/riscv/remote_gdb.hh`. This commit adds these missing
overrides.

Change-Id: Id0bfc371ca3e3e1b91e9112a837e1862072bf9d2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40395
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agotests: Increase presubmit (Kokoro) timeout to 6 hours
Bobby R. Bruce [Wed, 3 Feb 2021 02:16:12 +0000 (18:16 -0800)]
tests: Increase presubmit (Kokoro) timeout to 6 hours

Kokoro is now frequnetly timing out. This will increase the timeout from
5 hours to 6 hours.

Change-Id: I2124567142358ab183d962fcbd73ee9ea4e809a3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40455
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-arm: Add destRegIdxArr arrays to TME instructions
Giacomo Travaglini [Tue, 26 Jan 2021 10:54:30 +0000 (10:54 +0000)]
arch-arm: Add destRegIdxArr arrays to TME instructions

This is needed as the base StaticInst class is no longer holding the
index array and it is up to the derived class to allocate the
storage depending on the number of registers used

Change-Id: I389e39a7e09d31f370d63a6e61fe6ee3faaac7db
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40375
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agomisc: Re-remove Authors lines from source files.
Gabe Black [Tue, 2 Feb 2021 01:38:48 +0000 (17:38 -0800)]
misc: Re-remove Authors lines from source files.

These were universally removed a while ago, but a bunch have crept back
in. Remove them.

Change-Id: I3cb5b9f40c9c19aafb5e39a51d1baeae60a591c0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40335
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>

3 years agoscons: Add an "All" compound debug flag
Daniel R. Carvalho [Wed, 13 Jan 2021 23:48:00 +0000 (20:48 -0300)]
scons: Add an "All" compound debug flag

Add an "All" compound debug flag, which encapsulates all
debug flags.

Since this is the broadest compound flag, allowing users
to include it would imply in extremely generic includes.
Moreover, it is highly unlikely that any correct C++ code
would ever use all debug flags. Therefore, a header file
for this flag is not generated to force users to directly
include only the debug flags they need.

Change-Id: If40f2f708be1495fa2b2380266164d5d44d7cffa
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39077
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nathanael Premillieu <nathanael.premillieu@huawei.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

3 years agoarch-arm,cpu: Use getEMI() in more places.
Gabe Black [Fri, 29 Jan 2021 02:50:54 +0000 (18:50 -0800)]
arch-arm,cpu: Use getEMI() in more places.

Use that method to avoid reading the machInst.

Change-Id: I11434206c0b7a1aa3793aa46b5056ad60a64b01c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40100
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-arm,cpu: Introduce a getEMI virtual method on StaticInst.
Gabe Black [Fri, 29 Jan 2021 01:18:26 +0000 (17:18 -0800)]
arch-arm,cpu: Introduce a getEMI virtual method on StaticInst.

This takes the place of direct access to the machInst field as used in
the MinorCPU model which makes the incorrect assumption that it can
arbitrarily treat the ExtMachInst as an integer, and that masking in a
certain way can meaningfully classify what the instruction will do.

Because that assumption is not correct in general, that had been
ifdef-ed out in most ISAs except ARM, and for the other ISAs the value
was simply set to zero.

Change-Id: I8ac05e65475edc3ccc044afdff09490e2c05ba07
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40098
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch: Templatize the BasicDecodeCache.
Gabe Black [Fri, 29 Jan 2021 01:02:47 +0000 (17:02 -0800)]
arch: Templatize the BasicDecodeCache.

While the arch/generic directory is in arch/, it still shouldn't assume
any particular ISA. This change templatizes away the ISA specific types
so it can be used in multiple ISAs at a time.

Change-Id: I1abb4f5081a0a25f743be786ad8e7e3d55cfc67a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40097
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agobase,tests: Create unit tests for Stats::Stor
Daniel R. Carvalho [Wed, 5 Feb 2020 21:12:38 +0000 (22:12 +0100)]
base,tests: Create unit tests for Stats::Stor

Create unit tests for the stats storage types. As a side effect
storage-related classes have been moved to separate files.

HistStor's grow_up, grow_out, and grow_convert have been made
private and renamed to comply with gem5's naming convention
and make grow_convert match its grow_up counterpart (growDown)
which is more suitable for its expected behavior.

The params declarations have been moved to be close to their
storage class' constructor.

HistStor has a explicit condition stating that there must be
at least 2 buckets.

Added documentation!

Fixed grow_convert so that it yields consistent histograms.
Previously buckets could not fully intersect, so doubling their
bucket size would make them steal contents innaproprietly. For
example, the neighbors [-6,-2[, [-2,2[, [2,6[, when doubled,
become [-12,-4[, [-4,4[, [4,12[; however, since the individual
values are not stored, it is impossible to know how to populate
the middle bucket with its neighbor's partial contents.
This fix forces the middle bucket of a storage to have its lower
bound at 0, solving the partial intersection issue.

Change-Id: Idb063e3dbda3cce3a8969e347660143162146eb9
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25425
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agobase: Move Stats::Info functions to its own source file
Daniel R. Carvalho [Wed, 5 Feb 2020 08:46:18 +0000 (09:46 +0100)]
base: Move Stats::Info functions to its own source file

Move information needed by Stats::Info and its derived classes
from base/statistics.cc to its own source file.

Create a SConscript in the stats sub-dir to start clustering
stats related files.

Change-Id: I1e5e828c7814748c2582755f664550241caf860e
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25424
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agobase,tests: Add a basic fake class to handle curTick
Daniel R. Carvalho [Tue, 26 Jan 2021 23:28:35 +0000 (20:28 -0300)]
base,tests: Add a basic fake class to handle curTick

Add this basic fake class that handles the initialization
and update of the current tick.

Change-Id: Iba8ecc049acdd097caa4d9cf05ac8d78bbaf03cc
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39836
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agosim: Move cur tick to its own files
Daniel R. Carvalho [Sun, 17 Jan 2021 00:55:12 +0000 (21:55 -0300)]
sim: Move cur tick to its own files

When declared within sim/core.hh, unit tests that use the
current tick would have to unnecessarily include many other
extra files.

Change-Id: Ib4348312afb90765edb4f94c80785df1275b2004
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39835
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

3 years agoscons: Separate debug flags from debug-format flags
Daniel R. Carvalho [Wed, 13 Jan 2021 23:58:47 +0000 (20:58 -0300)]
scons: Separate debug flags from debug-format flags

Debug flags are flags that aid with debugging by printing
relevant information when enabled. Debug-formatting flags
define how the debug flags will print the information.

Although a viability, this patch does not support declaring
compound format flags.

As a side effect, now debug flags and debug-formatting flags
are printed in different lists, when using --debug-help.

Change-Id: Ieae68745276218cf4e9c1d37d7bf3bd1f19709ae
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39076
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoutil,python: Add check to ensure files are utf-8 in pre-commit
Bobby R. Bruce [Thu, 28 Jan 2021 05:33:15 +0000 (21:33 -0800)]
util,python: Add check to ensure files are utf-8 in pre-commit

The `file_from_index` function throws a UnicodeDecodeError if a modified
file targetted for style-checking (i.e. source-code) cannot be decoded
using `.decode("utf-8")`.

This check throws an error informing the user a submitted file must be
utf-8 encoded if this case arises.

Change-Id: I2361017f2e7413ed60f897d2301f2e4c7995dd76
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40015
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoutil,python: Fix Pre-commit hooks to ignore non-source files
Bobby R. Bruce [Thu, 28 Jan 2021 05:44:31 +0000 (21:44 -0800)]
util,python: Fix Pre-commit hooks to ignore non-source files

Previously if binary blobs were modified the pre-commit hook attempted
to run style-checks on the binary, causing an error when attempting to
decode to utf-8. This commit runs a check on each file to ensure it has
a valid source-code extension prior to running style checks. If a file
does not have a valid extension style checks are not run.

Change-Id: Id1263cac0d6c190ad1a3d67720b3f373e0e42234
Issue-on: https://gem5.atlassian.net/browse/GEM5-903
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39795
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoext: testlib loading tests from multiple directories
Giacomo Travaglini [Fri, 29 Jan 2021 22:19:13 +0000 (22:19 +0000)]
ext: testlib loading tests from multiple directories

We currently run regressions with the following command line

./main.py run [...] <directory>

Where <directory> is the positional argument pointing to the tests root
directory: Testlib will walk through the directory and load every
testsuite it encounters in its path.

./main.py run [...] <directory1> <directory2> ...

Allowing testlib to load tests from multiple directories will make it
possible to load out of tree regressions (living in an EXTRAS repository
for example)

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

Change-Id: I802d8753a18f4dfb00347252f031b5438e9be672
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40136
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agosystemc: remove boost header dependency
Earl Ou [Mon, 1 Feb 2021 09:49:18 +0000 (17:49 +0800)]
systemc: remove boost header dependency

The current tests included don't require boost header to work. Remove
the dependency. This also gets rid of the warning message generated by
the latest boost headers.

Tested by running systemC tests:

src/systemc/tests/verify.py --update-json \
  --filter-file=src/systemc/tests/working.filt -j 56 build/ARM/

Change-Id: I9d3bfe145597335abdf24f2de85ed3c0708aea27
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40315
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-arm: don't expose FEAT_VHE by default
Adrian Herrera [Mon, 25 Jan 2021 12:13:48 +0000 (12:13 +0000)]
arch-arm: don't expose FEAT_VHE by default

If FEAT_VHE is implemented and Linux boots in EL2, it programs itself
to operate in EL2. This causes a later boot stall as explained in
https://gem5.atlassian.net/browse/GEM5-901.
We provide a parameter "have_vhe" to enable FEAT_VHE on demand. This is
disabled by default until fixed. This avoids users stalling on the common
case of booting Linux without a hypervisor.

Change-Id: I3ee7be1ca59afc0cbbda59fb3aad4c897c06405f
Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39695
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoext: Update pybind11 to version 2.6.2.
Gabe Black [Sun, 31 Jan 2021 14:07:28 +0000 (06:07 -0800)]
ext: Update pybind11 to version 2.6.2.

This should help reduce warning spew when building with newer compilers.
The pybind11::module type has been renamed pybind11::module_ to avoid
conflicts with c++20 modules, according to the pybind11 changelog, so
this CL also updates gem5 source to use the new type. There is
supposedly an alias pybind11::module which is for compatibility, but we
still get linker errors without changing to pybind11::module_.

Change-Id: I0acb36215b33e3a713866baec43f5af630c356ee
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40255
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agofastmodel: add interface to update system counter freq
Earl Ou [Mon, 1 Feb 2021 02:24:44 +0000 (10:24 +0800)]
fastmodel: add interface to update system counter freq

This CL set the cntfrq and system counter frequency at once from python
script. This aligns the fastmodel implementation to other part of gem5
CPU.

Change-Id: I78c9a7be801112844c03d2669a94d57015136d16
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40278
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agofastmodel: create base class for EVS CPU
Earl Ou [Mon, 1 Feb 2021 01:41:33 +0000 (09:41 +0800)]
fastmodel: create base class for EVS CPU

Previously we use attribute and event for communication between gem5
SimObject to systemC fastmodel sc_module. Creating a base class allows us
to perform casting once and get all the interface required. Also,
instead of warning on attribute not found, we should make simulator
panic if the sc_module does not provide the interface we need.

Change-Id: I91e1036cb792d556dfc4010e7a0f138b1519b079
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40277
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
3 years agoarch-power: Delete unused register related constants.
Gabe Black [Mon, 25 Jan 2021 07:16:43 +0000 (23:16 -0800)]
arch-power: Delete unused register related constants.

Change-Id: I7b2dc3a9ce29f67d304a22ab15268390fc461e4e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39680
Reviewed-by: Boris Shingarov <shingarov@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>