gem5.git
4 years agobase: create DPRINTF_UNCONDITIONAL
Ciro Santilli [Fri, 11 Oct 2019 16:01:24 +0000 (17:01 +0100)]
base: create DPRINTF_UNCONDITIONAL

This is similar to DPRINTFN, but it also prints a given flag to allow
communicating to users which flag enabled a given log.

This is useful for logs which are enabled with DTRACE instead of directly
with DPRINTF.

Change-Id: Ife2d2ea88aede1cdcb713f143340a8788a755b01
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22005
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agobase: add the --debug-flag to DPRINTF output with FmtFlag
Ciro Santilli [Tue, 8 Oct 2019 13:31:47 +0000 (14:31 +0100)]
base: add the --debug-flag to DPRINTF output with FmtFlag

This makes it easier to determine which messages come from which
flags when enabling multiple flags at once.

This commit covers the bulk of the debug messages, which use the DPRINTF*
family of macros. There however macros that use DTRACE to check for
enable, those will be covered in future patches.

Change-Id: I6738b18f08ccfd1e11f2874b426c1827b42e82a2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22004
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Make the Tarmac parsed registers case insensitive
Giacomo Travaglini [Tue, 8 Oct 2019 16:16:59 +0000 (17:16 +0100)]
arch-arm: Make the Tarmac parsed registers case insensitive

This will make parsing more robust, considering the tarmac
format changes between AA32 and AA64.

Change-Id: I0e4905d70e2e494104706a4c6c75b8169deaecf9
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22845
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv: Fix immediate decoding for integer shift immediate instructions
Ian Jiang [Mon, 25 Nov 2019 03:30:41 +0000 (11:30 +0800)]
arch-riscv: Fix immediate decoding for integer shift immediate instructions

The "shamt" in integer shift immediate instructions is an unsigned
immediate encoded in bits[25:20]. While the original Gem5 uses bits[31:20]
as an int64_t. This patch fixes the problem by:
- Adding a new parameter "imm_code" for format IOp and use the correct
bitfields SHAMT5 or SHAMT6 to assign "imm_code" for each instruction.
- Use uint64_t instead of default int64_t to assign parameter "imm_type"
of format IOp.

The instructions affected include:
- Shift Left Logical Immediate, slli
- Shift Right Logical Immediate, srli
- Shift Right Arithmetic Immediate, srai
- Shift Left Logical Word Immediate, slliw
- Shift Right Logical Word Immediate, srliw
- Shift Right Arithmetic Word Immediate, sraiw

Change-Id: Iad34ccd036c11630409f84f6de2b939224e100e6
Signed-off-by: Ian Jiang <ianjiang.ict@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22563
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv: Fix disassembling for fence and fence.i
Ian Jiang [Thu, 14 Nov 2019 08:41:25 +0000 (16:41 +0800)]
arch-riscv: Fix disassembling for fence and fence.i

The original Gem5 does not give correct disassembly for instruction fence
and fence.i. This patch fixes the problem by adding two bitfields PRED and
SUCC and a new format FenceOp and a template FenceExecute, in which
operands are generated based on PRED and SUCC in the disassembling
function.

Change-Id: I78dbf125fef86ce40785c498a318ffb1569da46c
Signed-off-by: Ian Jiang <ianjiang.ict@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22569
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch,cpu: Get rid of ISA_HAS_CC_REGS and its associated ifdefs.
Gabe Black [Tue, 5 Nov 2019 00:27:34 +0000 (16:27 -0800)]
arch,cpu: Get rid of ISA_HAS_CC_REGS and its associated ifdefs.

This conditional compilation was unnecessary and makes gem5 more
brittle and harder to understand.

Change-Id: I63abaf2668252c988cdd4626ff6a462eb6f54b04
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22544
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarm: Stop serializing ISA values wihch are cached from the system.
Gabe Black [Mon, 4 Nov 2019 23:48:52 +0000 (15:48 -0800)]
arm: Stop serializing ISA values wihch are cached from the system.

These values are not really part of the ISA state and could be
retrieved from the system during execution. Also these values are
already being set in the ISA constructor.

Change-Id: Iea5f9bbb27add4ecebc6391da6c1c1e49e76508f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22543
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: default MIDR for Armv8 ISA processors
Adrian Herrera [Wed, 16 Oct 2019 09:04:01 +0000 (10:04 +0100)]
arch-arm: default MIDR for Armv8 ISA processors

Software such as Trusted Firmware-A checks the MIDR register
to identify which core model is present in the platform.
The previous default value referred to a Cortex-A15 Armv7-A
processor, however when AArch64 is enabled, an Armv8 processor
is expected.
This patch assigns the Cortex-A57 MIDR if AArch64 is enabled.

Change-Id: Id1677a77d2f04843423f7b013405445f3d253399
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22846
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Adjust off_chip ranges in VExpress_GEM5 platform
Giacomo Travaglini [Fri, 22 Nov 2019 23:10:47 +0000 (23:10 +0000)]
dev-arm: Adjust off_chip ranges in VExpress_GEM5 platform

This is need after commit b4c9996d894118be04cdf4ed793b35a1d5001942
which makes the AddrRange end address non inclusive.

Change-Id: I859b84f6a91107815236b67c4596291c78881fe3
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/+/23003
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: log thread activate and suspend with --debug-flags Thread
Ciro Santilli [Tue, 8 Oct 2019 11:35:13 +0000 (12:35 +0100)]
cpu: log thread activate and suspend with --debug-flags Thread

The original motivation of this is to help debug syscall emulation
deadlocks.

Change-Id: I1c4f611fa2f2e464a30dc92baac89ca819e16a97
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21759
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim-se: don't wake up threads that are halted on futex
Ciro Santilli [Wed, 20 Nov 2019 16:51:47 +0000 (16:51 +0000)]
sim-se: don't wake up threads that are halted on futex

At Ia6b4d3e6148c64721d810b8f1fffaa208a394b06 the futex wake up started
skipping selecting threads that are already awake, which already prevented
some deadlocks.

However, threads that are Halting or Halted should not be woken up either,
as those represent cores in which processes have already exited.

Before this commit, this could lead an exited core to wake up, which would
then immediately re-execute the exit syscall, and possibly leave one
genuinely sleeping core locked and:

Exiting @ tick 18446744073709551615 because simulate() limit reached

Change-Id: I1531b56d605d47252dc0620bb3e755b7cf84df97
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22963
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv: Fix disassembling for atomic instructions
Ian Jiang [Sun, 3 Nov 2019 08:25:06 +0000 (16:25 +0800)]
arch-riscv: Fix disassembling for atomic instructions

The original Gem5 does not give correct disassembly for atomic
instructions, which are implemented with one or two micro instructions.
The correct register indices are not decoded until subsequent micro
instruction is processed. This patch fixes the problem by getting the
register indices and other properties (aq and rl) from certain bitfields
of the machine code in the disassembling function.

Change-Id: I2cdaf0b3c48ff266f19ca707a5de48c9050b3897
Signed-off-by: Ian Jiang <ianjiang.ict@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22568
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agoarch-riscv: Fix disassembling of operand list for compressed instructions
Ian Jiang [Thu, 31 Oct 2019 06:27:35 +0000 (14:27 +0800)]
arch-riscv: Fix disassembling of operand list for compressed instructions

In disassembling compressed instructions, the original Gem5 gives needless
operands, such as register or immediate. This patch fixes the problem.
- Existing formats fixed: CIOp, CJOp, CBOp and Jump.
- New formats added: CIAddi4spnOp (for c.addi4spn only) and CompressedROp (with
  templates CBasicDeclare and CBasicExecute)

Change-Id: Ic293836983256a59d3a7aca091c8184b410516a4
Signed-off-by: Ian Jiang <ianjiang.ict@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22566
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>

4 years agoarch-riscv: Fix disassembling of immediate for U-type instructions
Ian Jiang [Fri, 15 Nov 2019 02:07:06 +0000 (10:07 +0800)]
arch-riscv: Fix disassembling of immediate for U-type instructions

For U-type instructions auipc and lui, the 20-bit immediate is left-shifted
by 12 bits in decoding. While the original Gem5 gives the left-shifted
value directly in disassembly.
This patch fixes the problem by
- Assign the original 20-bit immediate to internal variable "imm".
- Output "imm" directly in disassembly, as how the original Gem5 does.
- Do the left-shift to "imm" later in the function defining of each
instruction, rather than in decoding.

Change-Id: I300e26fd9c79478783c39fcd6ff70ea06db88884
Signed-off-by: Ian Jiang <ianjiang.ict@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22564
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agoarch-riscv: Fix bug in serialize and unserialize of Interrutps
IanJiangICT [Wed, 6 Nov 2019 14:00:03 +0000 (22:00 +0800)]
arch-riscv: Fix bug in serialize and unserialize of Interrutps

When serialize and unserialize an variable, the parameters passed to
SERIALIZE_SCALAR() and UNSERIALIZE_SCALAR() must be the same and should be a
general variable name. If not, the expected item would not be found with
UNSERIALIZE_SCALAR() and a fatal error would be introduced.
This patch fix the bug in class Interrupts of RISCV.

Change-Id: I7dd7ab6805651149304959bdf7ee9f3be9d9eaff
Signed-off-by: Ian Jiang <ianjiang.ict@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22643
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>

4 years agoscons: Use the new error() and warning() methods.
Gabe Black [Tue, 19 Nov 2019 01:41:49 +0000 (17:41 -0800)]
scons: Use the new error() and warning() methods.

Also clean up some error messages which were missing capitalization,
etc.

Change-Id: Iaef6b4343a693d30b579e72218cbb7723ebf7d48
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22886
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Add "warning" and "error" methods.
Gabe Black [Tue, 19 Nov 2019 01:40:37 +0000 (17:40 -0800)]
scons: Add "warning" and "error" methods.

These methods will make reporting errors less verbose and more
consistent, since they'll handle some formating, setting colors,
prefixing with an appropriate "Warning:" or "Error:" tag, and exiting
in the case of an error.

Change-Id: Iddea5bf342a4fc4b26002d8e98292f9dc57fa8cc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22885
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Use HAVE_PROTOC when building protobuf files.
Gabe Black [Tue, 19 Nov 2019 00:03:12 +0000 (16:03 -0800)]
scons: Use HAVE_PROTOC when building protobuf files.

Also wrap PROTOC in {}s which is better form.

Change-Id: I3f80c260593a1d5b7fb5394fe4b71cb774e652ce
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22884
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Don't use PROTOC for the protoc command and to flag its presence.
Gabe Black [Tue, 19 Nov 2019 00:00:22 +0000 (16:00 -0800)]
scons: Don't use PROTOC for the protoc command and to flag its presence.

Commands that blindly use PROTOC will try to execute "False" which is
very confusing for someone looking at the console output and error
messages. Instead, create a new environment setting HAVE_PROTOC which
is either true or false depending on if the protoc command exists and
passes muster.

Also, if there's an error running protoc, catch that and use it to
mark protoc as unavailable. The previous behavior was to supress errors
and just return an empty string instead, I assume with the expectation
that that would be an invalid version and fail later checks.

Change-Id: I1251b4e7e0e9894cdd3343e59498cc653b648b26
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22883
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests,base: Added GTests for exec_ecoff.h and exec_aout.h
Bobby R. Bruce [Tue, 29 Oct 2019 17:43:48 +0000 (10:43 -0700)]
tests,base: Added GTests for exec_ecoff.h and exec_aout.h

Change-Id: Iec76ba24a06425caefd28d640c6479720f401c06
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22323
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotest,base: Added GTest for base/loader/image_file_data.cc
Bobby R. Bruce [Wed, 13 Nov 2019 02:57:36 +0000 (18:57 -0800)]
test,base: Added GTest for base/loader/image_file_data.cc

image_file_data.cc reads an image file, or an image file compressed with
gzip. Mock image file data, and that data in a gzipped state, has been
included in base/loader/small_image_file.test.hh to aid testing.

Change-Id: I69691b93ca03c34d6bd736cbc5c6503115bd7b3f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22743
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase: Remove tests making use of Big/LittleEndianOrder Namespace
Giacomo Travaglini [Wed, 20 Nov 2019 10:09:20 +0000 (10:09 +0000)]
base: Remove tests making use of Big/LittleEndianOrder Namespace

Unit tests are currently broken.
commit d40f0bc579fb8b10da7181d3a144cd3e9a0a0e59 is removing the
BigEndianOrder and LittleEndianOrder namespace.
Therefore we shouldn't test them and their helpers.

Change-Id: I68a45f264b782334d0a0f725c2c435c27337e757
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/+/22943
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase,tests: Expanded GTests for addr_range.hh
Brandon Potter [Fri, 18 Oct 2019 18:43:14 +0000 (14:43 -0400)]
base,tests: Expanded GTests for addr_range.hh

These tests assume the "end address" is not included in the range. This
exposed some bugs in addr_range.hh which have been fixed. Where
appropriate code comments in addr_range.hh have been extended to improve
understanding of the class's behavior.

Hard-coded AddrRange values in the project have been updated to take
into account that end address is now exclusive. The python params.py
interface has been updated to conform to this new standard.

Change-Id: Idd1e75d5771d198c4b8142b28de0f3a6e9007a52
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22427
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystem-arm: gitignore the aarch64 bootloader object files
Ciro Santilli [Wed, 30 Oct 2019 11:43:17 +0000 (11:43 +0000)]
system-arm: gitignore the aarch64 bootloader object files

Change-Id: I0cb494fb82c557cfce553bc925ea89a8220e4c16
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22826
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystem-arm: ignore .gen directory that contains DTS files
Ciro Santilli [Wed, 30 Oct 2019 11:14:48 +0000 (11:14 +0000)]
system-arm: ignore .gen directory that contains DTS files

Those files are removed by default because they are intermediary,
but it is possible to explicitly build them with an explicit target:

make .gen/armv7_gem5_v1_1cpu.dts

Change-Id: Id86968fbb2f2b95ce71109de5a0cb8039a048a27
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22825
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystem-arm: Use dts include instead of cpp in ARM DTBs
Bertrand Marquis [Wed, 25 Sep 2019 17:24:56 +0000 (18:24 +0100)]
system-arm: Use dts include instead of cpp in ARM DTBs

Change-Id: I342691a42e84dfe53659a7acb3b8db04e52e3002
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22824
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystem-arm: Rework boot loader makefile to be more generic
Bertrand Marquis [Wed, 25 Sep 2019 13:42:11 +0000 (14:42 +0100)]
system-arm: Rework boot loader makefile to be more generic

add all, clean and install rules
use variables for CROSS_COMPILE, CC, LD, DESTDIR
use generic rules to produce objects and link

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
[ciro.santilli@arm.com: Also add BUILDDIR and to allow fully
 out-of-tree builds.]
Signed-off-by: Ciro Santilli <ciro.santilli@arm.com>
Change-Id: Id84bc6a8e5dde409b6fb968925ca268376730196
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22823
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests, base: Added GTests for base/intmath.cc
Bobby R. Bruce [Tue, 22 Oct 2019 21:35:29 +0000 (14:35 -0700)]
tests, base: Added GTests for base/intmath.cc

Testing intmath.hh and intmath.cc. Here is the
list of the functions that are tested.
intmath.isPowerOf2, intmath.power, intmath.floorLog2,
intmath.ceilLog2, intmath.divCeil, intmath.roundUp,
intmath.roundDown. Other functions are not tested,
because they are not currently used and are dead code.

Change-Id: I150ac1b5cead93c6698a8c9e9cec80bd87ef181a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22081
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Mahyar Samani <msamani@ucdavis.edu>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agotests, base: Removed dead code from base/intmath
Mahyar Samani [Tue, 5 Nov 2019 20:01:14 +0000 (12:01 -0800)]
tests, base: Removed dead code from base/intmath

The below list of functions were dead code and are now
deleted.
intmath.prevPrime, intmath.isPrime, intmath.leastSigBit,
intmath.floorPow2, intmath.ceilPow2, intmath.isHex,
intmath.isOct, intmath.isDec, intmath.hex2Int. The source
file intmath.cc is now effectively useless and deleted.

Change-Id: I28e4350056b8d03e02fecd5c7f7f9c62bc2df7ce
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22584
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
4 years agoarch: Get rid of the (Big|Little)EndianGuest namespaces.
Gabe Black [Wed, 30 Oct 2019 01:56:27 +0000 (18:56 -0700)]
arch: Get rid of the (Big|Little)EndianGuest namespaces.

These namespaces were used to set up an environment/context where there
was an implicit guest namespace. This is an issue when there may be
multiple guest endiannesses which might be different. In cases where
we don't know what the guest endianness is, we can't rely on it being
an implicit part of our context since that would be ambiguous. In cases
where we do know, for instance in ISA specific code, we can just use
the endianness specific version that's appropriate for that context.

This also (somewhat) removes the assumption that there is a single
endianness that applies for a particular ISA. Practically speaking this
assumption will probably still stand though, since there would likely
be a non-trivial performance penalty to apply a configurable endianness
instead of a fixed one the compiler can optomize/remove.

Change-Id: I2dff338b58726d724f387388efe32d9233885680
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22374
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch: Make and use endian specific versions of the mem helpers.
Gabe Black [Wed, 30 Oct 2019 02:31:37 +0000 (19:31 -0700)]
arch: Make and use endian specific versions of the mem helpers.

Rather than using TheISA to pick an endian conversion function, we can
have a version defined for big and little endian and call the right one
from the ISA code.

Change-Id: I5014504968952e21abff3c5f6cbe58ca24233f33
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22373
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: R/W interface to AArch32 HCR2 misc reg
Adrian Herrera [Fri, 8 Nov 2019 15:25:21 +0000 (15:25 +0000)]
arch-arm: R/W interface to AArch32 HCR2 misc reg

This patch implements read/write interfaces to HCR2 AArch32 register,
which is mapped to the upper 32 bits of HCR_EL2.

Change-Id: I996023f3ad8233457d19de8a506ebcf106409165
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22832
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Initialize all members of `QueuedPrefetcher::DeferredPacket`.
Isaac Sánchez Barrera [Fri, 15 Nov 2019 15:17:23 +0000 (16:17 +0100)]
mem-cache: Initialize all members of `QueuedPrefetcher::DeferredPacket`.

Members `tc` and `ongoingTranslation` were uninitialized in the constructor for
`QueuedPrefetcher::DeferredPacket`. If `ongoingTranslation` is not initialized to
`false` by default, some translation requests from queued prefetchers are not
properly handled and executions are nondeterministic.

Change-Id: Ia278f9e74847d6b847984d47f6a45643bae57794
Signed-off-by: Isaac Sánchez Barrera <isaac.sanchez@bsc.es>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22844
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Fix destructor of `BasePrefetcher::PrefetchInfo`.
Isaac Sánchez Barrera [Fri, 15 Nov 2019 14:55:42 +0000 (15:55 +0100)]
mem-cache: Fix destructor of `BasePrefetcher::PrefetchInfo`.

The destructor of `BasePrefetcher::PrefetchInfo` was calling `delete` for a
dynamically-allocated array. Changed to `delete[]` to remove potential undefined
behaviour.

Change-Id: I6f531bfb6fb7108f1d3e743ae0384d80173e15ef
Signed-off-by: Isaac Sánchez Barrera <isaac.sanchez@bsc.es>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22843
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix short descriptors cacheability during table walks
Giacomo Travaglini [Thu, 7 Nov 2019 09:45:01 +0000 (09:45 +0000)]
arch-arm: Fix short descriptors cacheability during table walks

This implies checking for the SCTLR.C bit TTBR1.IRGN0 bits.

Change-Id: I341faf85692ce2d2b4afd30a2f4aabac0e133192
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/+/22724
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix long descriptors cacheability during table walks
Giacomo Travaglini [Mon, 4 Nov 2019 16:00:36 +0000 (16:00 +0000)]
arch-arm: Fix long descriptors cacheability during table walks

Prior to this patch table walks were always cacheable unless
cacheability was globally disabled by SCTLR.C being 0.  Arm allows to
select the memory attributes of table walks via the TCR registers.

For example the TCR.IRGN0 bits:

Inner cacheability attribute for memory associated with translation
table walks using TTBR0_EL1.

IRGN0   Meaning
0b00    Normal memory, Inner Non-cacheable.
0b01    Normal memory, Inner Write-Back Read-Allocate Write-Allocate
        Cacheable.
0b10    Normal memory, Inner Write-Through Read-Allocate No
        Write-Allocate Cacheable.
0b11    Normal memory, Inner Write-Back Read-Allocate No Write-Allocate
        Cacheable.

Note: we check IRGNx bits (Inner Shareable domain) instead of ORGNx
(Outer Shareable domain) since in gem5 we consider everything as
Inner Shareable.

Change-Id: If472c218040029c9d165b056a052f522d48d4a82
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/+/22723
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Added GTests for byteswap.hh
Bobby R. Bruce [Tue, 22 Oct 2019 21:08:24 +0000 (14:08 -0700)]
tests: Added GTests for byteswap.hh

In addition to the test, "#include base/logging.hh" was added to the
"byteswap.hh". It is is required to compile the header.

Added tests ByteswapTest.swap_byte64, ByteswapTest.swap_byte32,
ByteswapTest.swap_byte16, ByteswapTest.swap_byte, ByteswapTest.htog,
and ByteswapTest.gtoh. The file byteswap.hh is mostly templates.

Added test for BigEndianGuest and LittleEndianGuest namespaces.

Change-Id: I8870a55594ed439fe9e1fb333384f73261d1b1b8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22080
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Specify a non-default root folder for regressions
Giacomo Travaglini [Wed, 13 Nov 2019 13:47:19 +0000 (13:47 +0000)]
tests: Specify a non-default root folder for regressions

The new testlib library is looking for regressions walking from
a root folder. This by default points to the tests dir.
Since all regressions are supposed to live in the tests/gem5 subdir,
the patch is assigning the gem5 subdir as a root directory.

This will prevent the example garbage to be printed in the ci framework:

Exception thrown while loading
"/tmpfs/src/git/jenkins-gem5-prod/tests/long/fs/10.linux-boot/test.py"
Ignoring all tests in this file.
Exception thrown while loading
"/tmpfs/src/git/jenkins-gem5-prod/tests/long/fs/80.solaris-boot/test.py"
Ignoring all tests in this file.
[...]

Change-Id: Ia12c6bbeda4ceac71ccd38156ab1e3bb98b05c89
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/+/22726
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests, base: Removed ambiguity from base/intmath.hh
Mahyar Samani [Tue, 5 Nov 2019 19:54:35 +0000 (11:54 -0800)]
tests, base: Removed ambiguity from base/intmath.hh

The function intmath.leastSigBit is ambiguous given
its name. It does not return the value of the least
significant bit, or the position of the least significant
set bit, but instead 2 to the power of the position of
the least significant set bit. It has thereby been removed
and the function intmath.isPowerOf2 has been refactored to
not require intmath.leastSigBit.

Change-Id: I22479c666cdd059865b8c73b70b5388f98a4584d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22583
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Refactor code to check if gic is GicV2
Chun-Chen TK Hsu [Tue, 1 Oct 2019 13:22:27 +0000 (21:22 +0800)]
arch-arm: Refactor code to check if gic is GicV2

Refactor code to use cpu_addr only when gic is GicV2 since cpu_addr is
only meanful to GicV2.

Test: Boot Android P successfully with the following command:
M5_PATH=$PWD/fs_files ./build/ARM/gem5.opt
./configs/example/arm/fs_bigLITTLE.py --dtb
$PWD/fs_files/binaries/armv8_gem5_v2_1cpu.dtb --kernel
$PWD/fs_files/binaries/vmlinux --disk $PWD/fs_files/disks/disk.img
--kernel-init "/init" --cpu-type fastmodel --machine-type
VExpressFastmodel --big-cpu-clock "2GHz" --big-cpus 1 --little-cpus 0
--mem-size 8GB --kernel-cmd "earlyprintk=pl011,0x1c090000
console=ttyAMA0 lpj=19988480 norandmaps rw loglevel=8 mem=8GB
root=/dev/vda1 init=/init androidboot.hardware=gem5 qemu=1 qemu.gles=2
android.bootanim=0 vmalloc=640MB android.early.fstab=/fstab.gem5
androidboot.selinux=permissive audit=0 cma=128M"

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

4 years agoconfig: Add fastmodel cluster in fs_bigLITTLE.py
Chun-Chen TK Hsu [Fri, 13 Sep 2019 04:43:00 +0000 (12:43 +0800)]
config: Add fastmodel cluster in fs_bigLITTLE.py

One can create a system with ARM FastModels CPU and GICv3 with
--cpu-type fastmodel --machine-type VExpressFastmodel options.
Currently the FastmodelCluster only supports one CPU.

Change-Id: I2e985f08f9df01a703e21441c6f9bc1fbae4a222
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20901
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Add VExpressFastmodel platform
Chun-Chen TK Hsu [Wed, 2 Oct 2019 08:42:10 +0000 (16:42 +0800)]
fastmodel: Add VExpressFastmodel platform

A VExpress based platform with FastModelGIC as interrupt controller.

Change-Id: I5ef6d04573d271225d7b39c110e93350a290c371
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21359
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarm: Replace most htog and gtoh with htole and letoh.
Gabe Black [Tue, 29 Oct 2019 23:55:26 +0000 (16:55 -0700)]
arm: Replace most htog and gtoh with htole and letoh.

We already know what endianness to use when with ARM. In places where
a ISA was being supplied through an argument, those were left as htog
or gtoh.

Change-Id: Iff01e8b09a061d9a72e657cdd4570836e0da933f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22372
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: fix routeToHyp for AArch64 in faults
Adrian Herrera [Fri, 8 Nov 2019 11:12:24 +0000 (11:12 +0000)]
arch-arm: fix routeToHyp for AArch64 in faults

This patch fixes several bugs in Fault classes "routeToHyp" member
function by which mode checking was not taking into account AArch64
execution state. For the particular case of SVC calls from NS EL0, this
prevented a correct routing to EL2 when HCR_EL2.TGE was set.

Change-Id: I5815fe6dcf4501f52bf92f61687ef6d6ef950e52
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22725
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
4 years agotests: Added GTests for base/chunk_generator.hh
Bobby R. Bruce [Thu, 10 Oct 2019 18:13:36 +0000 (11:13 -0700)]
tests: Added GTests for base/chunk_generator.hh

Change-Id: Ic6ededfc7fed1f91a75e48a0933e61b4670e5af1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21679
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

4 years agofastmodel: Implement reading vector registers with readVecReg.
Gabe Black [Wed, 16 Oct 2019 02:24:27 +0000 (19:24 -0700)]
fastmodel: Implement reading vector registers with readVecReg.

The n other flavors of vector reading functions and all the vector
writing functions are not implemented currently.

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

4 years agotests: Added GTests for base/types.cc
Bobby R. Bruce [Wed, 9 Oct 2019 23:07:16 +0000 (16:07 -0700)]
tests: Added GTests for base/types.cc

Change-Id: I9515735efdd452a9f8c98f37f4ec2c27120929f5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21659
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests,base: Added GTests for base/condcodes.hh
Bobby R. Bruce [Wed, 9 Oct 2019 22:20:57 +0000 (15:20 -0700)]
tests,base: Added GTests for base/condcodes.hh

The documentation for the "findParity" and "findCarry" functions in
base/condcodes.hh has been enhanced to better explain their behavior.

Change-Id: I9ba3bf68eb56529a3030e965ec21e41d2dacfad6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21639
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Using super in arm_generic whenever possible
Giacomo Travaglini [Fri, 8 Nov 2019 17:09:41 +0000 (17:09 +0000)]
tests: Using super in arm_generic whenever possible

This exclude the case where multiple inheritance is used.

Change-Id: Id1a46ca5c6c526a1a29a2cff7b00d7e3b6a79273
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22685
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Using super for calling superclass __init__
Giacomo Travaglini [Fri, 8 Nov 2019 16:50:52 +0000 (16:50 +0000)]
tests: Using super for calling superclass __init__

Change-Id: I19906db9ce1b9ffb4107b47fe2bc64a8e005e776
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22684
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Remove Noncoherent cache from regressions
Giacomo Travaglini [Fri, 8 Nov 2019 15:53:11 +0000 (15:53 +0000)]
tests: Remove Noncoherent cache from regressions

Change-Id: I1d499477acec09fd0b36e3b7c2f5eecee737bd93
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22683
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix TarmacParser handling of 64bit LD/ST
Giacomo Travaglini [Thu, 3 Oct 2019 14:04:34 +0000 (15:04 +0100)]
arch-arm: Fix TarmacParser handling of 64bit LD/ST

The TarmacParser was assuming 32 bit accesses only.
This was creating a mismatch when parsing a trace with 64 bit
accesses.

E.g.

In

clk IT (18) 002001f4 f8008441 O EL3h_s : STR      x1,[x2],#8
clk MW8 00201008:000000201008 00000000_40000401

Only the 32 MSBs were checked (00000000)

Change-Id: I51e803b53efe953edcd9378f6c9481c04932331e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21562
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Provide SVE support to the TarmacTracer
Giacomo Travaglini [Mon, 30 Sep 2019 15:14:02 +0000 (16:14 +0100)]
arch-arm: Provide SVE support to the TarmacTracer

Change-Id: I86ff5f49a0c0aa126d53076964f208716e70aacb
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21561
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Provide SVE support to the TarmacParser
Giacomo Gabrielli [Mon, 30 Sep 2019 13:30:48 +0000 (14:30 +0100)]
arch-arm: Provide SVE support to the TarmacParser

This patch is providing SVE support to the tarmac parser, so that
it is recognizing Vector & Predicate entries.

Change-Id: I268e621cffa05644d3f1d80170b067aacaa2d5ea
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21560
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarm: Set the number of FloatRegs to zero.
Gabe Black [Mon, 4 Nov 2019 23:05:18 +0000 (15:05 -0800)]
arm: Set the number of FloatRegs to zero.

ARM no longer uses the floating point register file and uses the
vector registers instead. This avoids checkpointing a bunch of unused
registers, making it hard to tell where floating point instructions
are keeping their values, etc.

Change-Id: I23145ba750f1dd9ff5b815395e073c410120840d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22524
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests,base: Added GTests for base/match.cc
Bobby R. Bruce [Fri, 1 Nov 2019 19:44:08 +0000 (12:44 -0700)]
tests,base: Added GTests for base/match.cc

In order to aid testing the method "match.getExpressions()" has been added.

Change-Id: I11acf9bed286ee2809dfa3d05ef573dea85eb786
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22503
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Fix a bug in getCurrentInstCount in the checker CPU.
Gabe Black [Wed, 6 Nov 2019 22:17:45 +0000 (14:17 -0800)]
cpu: Fix a bug in getCurrentInstCount in the checker CPU.

An earlier change accidentally left out the actualTC-> prefix in the
getCurrentInstCount method which was supposed to delegate the call to
another thread context. Without that, it just called itself and would
infinitely recurse.

This bug was pointed out in email by Robert Henry.

Change-Id: Ibf1fee6b48ff87790309c6d435bd76fa95c6cab9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22623
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agopower: Replace gtoh and htog with betoh and htobe.
Gabe Black [Tue, 29 Oct 2019 23:41:41 +0000 (16:41 -0700)]
power: Replace gtoh and htog with betoh and htobe.

We already know what endianness to use when within power.

Change-Id: Id4ced279d21c56855307a5a8da51654101a13786
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22371
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agox86: Replace htog and gtoh with htole and letoh.
Gabe Black [Tue, 29 Oct 2019 23:40:51 +0000 (16:40 -0700)]
x86: Replace htog and gtoh with htole and letoh.

We already know what endianness to use from within x86.

Change-Id: Ie92568efe8b23fbb7d9edad55fef09c6302cbe62
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22370
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomips: Replace gtoh and htog with letoh and htole.
Gabe Black [Tue, 29 Oct 2019 23:23:45 +0000 (16:23 -0700)]
mips: Replace gtoh and htog with letoh and htole.

We already know what endianness to use from within MIPS.

Change-Id: Ic4cd295a7a66c4c8ef55ebcf976fe6637567391f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22369
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosparc: Replace htog and gtoh with htobe and betoh.
Gabe Black [Tue, 29 Oct 2019 23:12:37 +0000 (16:12 -0700)]
sparc: Replace htog and gtoh with htobe and betoh.

We know what endianness to use when we're implicitly working with
SPARC.

Change-Id: I85eaac1da087a8086b9450b762a52323f2498e2e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22368
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystemc: Remove boost dependency caused by tlm
Hoa Nguyen [Wed, 6 Nov 2019 23:43:18 +0000 (15:43 -0800)]
systemc: Remove boost dependency caused by tlm

This commit replaces the tlm header file, which caused the boost
dependency.

Change-Id: Ie4b1af71202522d8139e9a861144863097188072
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22624
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Plumb the ITB and DTB through the IRIS thread context.
Gabe Black [Wed, 16 Oct 2019 01:19:18 +0000 (18:19 -0700)]
fastmodel: Plumb the ITB and DTB through the IRIS thread context.

These might be necessary to, for instance, translate virtual addresses.
A custom TLB which uses the IRIS API will be written which can be
substituted in for the normal ARM TLB.

Change-Id: Ic44822db6692ca3a4ca13875b2260b08547a24da
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22116
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chun-Chen TK Hsu <chunchenhsu@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

4 years agofastmodel: Implement inst count events in the IRIS thread contexts.
Gabe Black [Tue, 15 Oct 2019 23:57:07 +0000 (16:57 -0700)]
fastmodel: Implement inst count events in the IRIS thread contexts.

These use the IRIS stepping API.

Change-Id: Ib45744cb0928fece664187e4df6b25b064b19f0e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22115
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: Simplify AMO code generation templates
Nikos Nikoleris [Wed, 30 Oct 2019 22:45:36 +0000 (23:45 +0100)]
arch-arm: Simplify AMO code generation templates

This change simplifies the isa template for the atomic memory
operation (AMO). Previously the flow had unecessary if statements that
ended up breaking build using clang, due to variables that could
seemingly be used before they were unitialized.

Change-Id: I1b46dfd5f1e90377245c4f649c08b6532b507b9c
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22603
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Use std::array for registers in SimpleThread.
Gabe Black [Mon, 4 Nov 2019 23:02:04 +0000 (15:02 -0800)]
cpu: Use std::array for registers in SimpleThread.

If the number of one of the register types is zero (useful on ARM in
the near future), memset will complain that it's given the length of
the array without multiplying by the size of the array elements. This
is a false positive since the length of the array and the number of
elements are both zero.

To avoid that warning/error and to simplify and update the SimpleThread
class slightly, this change replaces the C style arrays with
std::array.

Change-Id: Ifedd081a1940a578765c4d585e623236008ace67
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22523
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Annotate original address in CMOs
Giacomo Travaglini [Wed, 9 Oct 2019 13:53:38 +0000 (14:53 +0100)]
arch-arm: Annotate original address in CMOs

This is needed when a CMO triggers an exception (e.g. DataAbort) In that
case the faulting address should be the one encoded in the instruction
rather than the cacheline address:

According to armarm:
If a memory fault that sets FAR_EL1 is generated from a data cache
maintenance or other DC instruction, FAR_EL1[63:0] holds the address
specified in the register argument of the instruction.

Change-Id: I6d0dadbef6e70db57438b01a76c5def3bdd2d974
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22443
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: Reset Ruby Sequencer Outstanding Requests stats
Polydoros Petrakis [Mon, 4 Nov 2019 11:49:37 +0000 (13:49 +0200)]
mem-ruby: Reset Ruby Sequencer Outstanding Requests stats

Change-Id: I14b106e0eb7abd9c14badeedf35d6d1c9f198f98
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22446
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: optional instantiation of GICv3 ITS
Adrian Herrera [Wed, 9 Oct 2019 16:58:19 +0000 (17:58 +0100)]
dev-arm: optional instantiation of GICv3 ITS

GICv3 ITS is an optional component of GICv3. The previous behaviour
was for a stub ITS to be created by default, which resulted in a crash
for use cases where a GICv3 with no ITS is required.
This patch removes the instantiation of the ITS by default and adds
checks for its presence both in initialization and device tree
generation code.

Change-Id: Id424924c8c1152d512aaa2837de4aa60329ec234
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22423
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Modify compressor to appease newer compilers
Daniel R. Carvalho [Thu, 31 Oct 2019 10:54:42 +0000 (11:54 +0100)]
mem-cache: Modify compressor to appease newer compilers

The type of the local unique_ptr variable was different from the return type.

In C++11 because of such difference, a copy-ellision would not be possible,
and that required the use of a std::move.

In C++14 the restriction of same types being required was removed, so
std::move would not be needed anymore.

With the addition of the -Wredundant-move warning in newer compilers, having
the std::move on the return became an issue, breaking compilation.

Change-Id: I45d18dfc500bb5db5fe360814feb91853c735a19
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22403
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
4 years agomem-cache: Implement a perfect compressor
Daniel R. Carvalho [Mon, 22 Jul 2019 17:59:18 +0000 (19:59 +0200)]
mem-cache: Implement a perfect compressor

Implement a perfect compressor that always manages to compresses data
exactly to its maximum allowed compression ratio. This allows tracking
a compression upper bound.

Change-Id: Ibc68bf2dc84b75207795d5ba6304b9ed6dbeae8f
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21160
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
4 years agomem-cache: Make BDI a multi compressor
Daniel R. Carvalho [Mon, 9 Sep 2019 16:24:20 +0000 (18:24 +0200)]
mem-cache: Make BDI a multi compressor

BDI is a compressor containing multiple sub-compressors.

Change-Id: I98411e2ef9dcc2182801a172dfc59ed7a8ee7dd4
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21159
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
4 years agomem-cache: Implement a multi compressor
Daniel R. Carvalho [Mon, 29 Jul 2019 14:36:59 +0000 (16:36 +0200)]
mem-cache: Implement a multi compressor

Implement a compressor that contains multiple sub-compressors and
choses the one that provides the best compression results for each
compression.

Change-Id: I758cf67c84bd85edbea16b2a07b2068b00454461
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21158
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Implement BDI sub-compressors
Daniel R. Carvalho [Fri, 6 Sep 2019 16:36:25 +0000 (18:36 +0200)]
mem-cache: Implement BDI sub-compressors

Implement sub-compressors of BDI as public compressors so that
they can be used separately.

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

4 years agomem-cache: Implement a repeated values compressor
Daniel R. Carvalho [Thu, 5 Sep 2019 13:29:45 +0000 (15:29 +0200)]
mem-cache: Implement a repeated values compressor

The repeated values compressor can only compress data composed solely
repeated instances of the same value.

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

4 years agomem-cache: Implement a zero compressor
Daniel R. Carvalho [Thu, 5 Sep 2019 10:00:18 +0000 (12:00 +0200)]
mem-cache: Implement a zero compressor

The zero compressor can only compress data composed solely of zero
bits.

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

4 years agomem-cache: Implement FPC-D cache compression
Daniel R. Carvalho [Fri, 12 Jul 2019 09:40:16 +0000 (11:40 +0200)]
mem-cache: Implement FPC-D cache compression

Implementation of Frequent Pattern Compression with limited Dictionary
support (FPC-D) cache compressor, as described in "Opportunistic
Compression for Direct-Mapped DRAM Caches", by Alameldeen et al.

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

4 years agoarch,cpu: Move endianness conversion of inst bytes into the ISA.
Gabe Black [Tue, 29 Oct 2019 22:12:10 +0000 (15:12 -0700)]
arch,cpu: Move endianness conversion of inst bytes into the ISA.

It doesn't matter if the bytes are converted before or after they're
fed into the decoder. The ISA already knows what endianness to use
implicitly, and this frees the CPU which doesn't from having to worry
about it.

Change-Id: Id6574ee81bbf4f032c1d7b2901a664f2bd014fbc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22343
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem: Delete the packet accessors which use guest endianness.
Gabe Black [Fri, 12 Oct 2018 12:14:01 +0000 (05:14 -0700)]
mem: Delete the packet accessors which use guest endianness.

These accessors create an extra dependency on the guest OS, and can be
avoided. Now that all their uses have been removed, they aren't needed
any more.

Change-Id: I466c07fef99bce2d7964c07a7ac3dd398691378b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/13465
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agoarch-x86: Fix FLDCW_P and FNSTCW_P to use rip.
seanzw [Fri, 1 Nov 2019 17:34:31 +0000 (10:34 -0700)]
arch-x86: Fix FLDCW_P and FNSTCW_P to use rip.

FLDCW_P and FNSTCW_P should use rip to compute address.

Change-Id: Ide7327e243d42bdd8791e43773385b2a79d45418
Signed-off-by: Zhengrong Wang <seanzw@ucla.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22483
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: add squashfs make to m5-exit
Ciro Santilli [Wed, 23 Oct 2019 17:01:07 +0000 (18:01 +0100)]
tests: add squashfs make to m5-exit

An ARM squashfs rootfs that runs m5 exit can be generated for example
with:

make ARCH=arm_A64 CROSS_COMPILE=aarch64-linux-gnu- squashfs

The existing Makefile.x86 was not used as a basis because we would
like to provide a setup that allows users to use their own compilers
if they wish, without requiring dockcross.

Change-Id: I19c54cf0575b405f191f45aaf1e4a05c3f2e69ae
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22223
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: generic method for getting an ArmSystem
Adrian Herrera [Fri, 25 Oct 2019 18:21:59 +0000 (19:21 +0100)]
arch-arm: generic method for getting an ArmSystem

This patch provides a generic method for casting a System object
into an ArmSystem object. This is specially useful in dev-arm,
since devices by default obtain a generic System reference which
needs to be casted to use ArmSystem-specific functionality.

Change-Id: Ib100002413cb48cd93772dcf38f13be65badd1d3
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22426
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Add SMMUv3 to VExpress_GEM5_V*
Giacomo Travaglini [Mon, 12 Aug 2019 14:07:15 +0000 (15:07 +0100)]
dev-arm: Add SMMUv3 to VExpress_GEM5_V*

The VExpress_GEM5_V* Platforms will now optionally make use of the
SMMUv3.
In order to attach a devices to it, a user must simply use the
attachSmmu method, making sure the device it is not part of the
_on_chip_devices().

Change-Id: Ib819eb50d43dba1f5e5d1a1f7159ac4fbaccff6e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21559
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfig: Add --kernel-cmd option in fs_bigLITTLE.py
Chun-Chen TK Hsu [Fri, 13 Sep 2019 04:25:18 +0000 (12:25 +0800)]
config: Add --kernel-cmd option in fs_bigLITTLE.py

Allow users to specify their custom Linux kernel command.

Change-Id: I1e88523c918369ea5dd86c088eca82471663e76a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20900
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agoconfig: Add --mem-size option in fs_bigLITTLE.py
Chun-Chen TK Hsu [Fri, 13 Sep 2019 04:06:17 +0000 (12:06 +0800)]
config: Add --mem-size option in fs_bigLITTLE.py

Allow users to specify system memory size.

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

4 years agofastmodel: Add CortexA76x[234] models.
Gabe Black [Sat, 21 Sep 2019 06:38:12 +0000 (23:38 -0700)]
fastmodel: Add CortexA76x[234] models.

These use the parameterization added in earlier commits.

Change-Id: Id7b99b97894f8fc1f1e5cc34e3e5d32146fed1c7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21505
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Enable auto bridging and use it to simplify CortexA76x1.
Gabe Black [Sat, 21 Sep 2019 06:00:48 +0000 (23:00 -0700)]
fastmodel: Enable auto bridging and use it to simplify CortexA76x1.

This lets us avoid having to set up bridges for all the different
interrupt signals coming out of the CPU. When we have more cores, like
in the x2, x3, and x4 versions of the CPU, we won't have to have a
set of bridges for each set of signals, and can connect them all to
external ports using array notation, keeping everything simple,
concise, and maintainable.

Change-Id: I1a5f707073868516e93c106dc17d105409de668a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21504
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Chun-Chen TK Hsu <chunchenhsu@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Templatize the xn versions of the CortexA76.
Gabe Black [Sat, 21 Sep 2019 00:42:12 +0000 (17:42 -0700)]
fastmodel: Templatize the xn versions of the CortexA76.

This will make it a lot easier and more succinct to define the x2-x4
versions of that CPU.

Change-Id: I951cd3af4419c62892c57968e729fd11c0e4a59e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21503
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,tests: add page boundary access test
Brandon Potter [Tue, 29 Oct 2019 15:41:05 +0000 (11:41 -0400)]
cpu-o3,tests: add page boundary access test

The O3 model supports unaligned accesses across page boundaries.
This changeset provides a stress test for the feature.

Other benchmarks exercise it, but their coverage is spotty. This
test does nothing else except poke bytes which straddle page
boundaries.

Change-Id: Ic20c2862bcb7af7be091030c12916ba499db10c7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22303
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agomem-cache: Fix missing header in associative set
Daniel R. Carvalho [Thu, 31 Oct 2019 15:48:56 +0000 (16:48 +0100)]
mem-cache: Fix missing header in associative set

Add missing intmath header to AssociativeSet, so that isPowerOf2 can
be used.

error: there are no arguments to 'isPowerOf2' that depend on a template
parameter, so a declaration of 'isPowerOf2' must be available

Change-Id: Ib2b194f9e71284ee439786bdb76d99858e57e2f5
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22444
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-ruby: Fixed pipeline squashes caused by aliased requests
Joe Gross [Mon, 20 Jul 2015 14:15:18 +0000 (09:15 -0500)]
mem-ruby: Fixed pipeline squashes caused by aliased requests

This patch was created by Bihn Pham during his internship at AMD.

This patch fixes a very significant performance bug when using the O3
CPU model and Ruby. The issue was Ruby returned false when it received
a request to the same address that already has an outstanding request or
when the memory is blocked. As a result, O3 unnecessary squashed the
pipeline and re-executed instructions. This fix merges readRequestTable
and writeRequestTable in Sequencer into a single request table that
keeps track of all requests and allows multiple outstanding requests to
the same address. This prevents O3 from squashing the pipeline.

Change-Id: If934d57b4736861e342de0ab18be4feec464273d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21219
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: Add baremetal.py example script
Giacomo Travaglini [Wed, 25 Sep 2019 12:59:55 +0000 (13:59 +0100)]
configs: Add baremetal.py example script

Change-Id: I7a4818836decbf743f6c9b1f2e5361a43fca2d10
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21799
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu-o3: bugfix for partial faults in x86
Brandon Potter [Tue, 29 Oct 2019 15:19:59 +0000 (11:19 -0400)]
cpu-o3: bugfix for partial faults in x86

The c58cb8c9 changeset broke some code related to checking
consistency model guarantees (found in X86 benchmarks).

This changeset adds some documentation to the code and obviates
the problem.

Change-Id: Ied9c6b0b1d237538efe4beb2f97ef76248ce2746
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22283
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
4 years agoext: Fix undefined-behavior bug in bitshift
Samuel Grayson [Thu, 17 Oct 2019 18:15:57 +0000 (13:15 -0500)]
ext: Fix undefined-behavior bug in bitshift

If a small number or zero is passed in, fp64_exp could be very
negative (-1000 for example). The intent of the line is to evaluate to
zero in these cases, but what it actually did was bitshift right by
1000, which is undefined behavior (according to ubsan) that so happens
to result in 0 on GCC/most architectures. This commit changes the code
to check for cases where the bitshift is larger than the width of the
integer.

Change-Id: I8de4bd8ad170f0321d54689460de449b7f8fb60a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21859
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoalpha: Convert htog and gtoh to htole and letoh.
Gabe Black [Tue, 29 Oct 2019 23:01:17 +0000 (16:01 -0700)]
alpha: Convert htog and gtoh to htole and letoh.

When within the Alpha arch, we know the guest endianness already.

Change-Id: Iee22a33451a06c6e6a5c7d1e8c71f0b00e98ae3f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22367
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agoarch,sim: Make copyStringArray take an explicit endianness.
Gabe Black [Tue, 29 Oct 2019 22:59:35 +0000 (15:59 -0700)]
arch,sim: Make copyStringArray take an explicit endianness.

Change-Id: I5cf4291b19dd2d2bdbbf145ad8e00994fabf5547
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22366
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agokern: When dumping dmesg, detect the byte order dynamically.
Gabe Black [Tue, 29 Oct 2019 22:52:09 +0000 (15:52 -0700)]
kern: When dumping dmesg, detect the byte order dynamically.

The dmesg dumper has access to the system object and so has access to
the getGuestByteOrder accessor. Use that instead of TheISA to determine
the byte order.

Change-Id: I4df7b1bcd807aaced1d7dc8d2030123e2d4d1d2b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22365
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: Use the system and OS to get endianness.
Gabe Black [Tue, 29 Oct 2019 22:50:48 +0000 (15:50 -0700)]
sim: Use the system and OS to get endianness.

This converts the syscall implementations to either use the
OS::byteOrder constant or, if that's not available, the system's
getGuestByteOrder() accessor, to determine the byte order, instead of
relying on TheISA to provide the correct accessor.

Change-Id: Idf7b02ee8d73990224ceac9a5efaec91a5ebf79f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22364
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch: Make endianness a property of the OS class syscalls can consume.
Gabe Black [Tue, 29 Oct 2019 22:31:04 +0000 (15:31 -0700)]
arch: Make endianness a property of the OS class syscalls can consume.

That way the syscall implementations won't have to find the right
endianness to use on their own, typically by referring to TheISA.

Change-Id: I186b2f419d5dbee72cc9b5abce7356f3143f0c83
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22363
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev: Make the virtio devices track endianness explicitly.
Gabe Black [Tue, 29 Oct 2019 04:07:16 +0000 (21:07 -0700)]
dev: Make the virtio devices track endianness explicitly.

These classes now track what endianness they're supposed to use
explicitly, initially set by the getGuestByteOrder accessor on the
system object. In the future, if the endianness depends on the
version of the VirtIO spec as the comment suggest, it will be easier
to dynamically set the endianness in the various structures based on
the version being used,

Since there isn't anything special about the virt IO versions of these
converters other than their types, and since the endianness conversion
infrastructure can be taught how to convert new types, the code was
switched over to using the standard htog and gtoh but with the
explicit byte order provided.

This also gets rid of the final use of TheISA in the dev directory.

Change-Id: I9345e3295eb27fc5eb87e8ce0d8d424ad1e75d2d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22273
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>