gem5.git
6 years agomem-cache: Remove extra block init in BaseSetAssoc
Daniel R. Carvalho [Tue, 27 Feb 2018 13:31:59 +0000 (14:31 +0100)]
mem-cache: Remove extra block init in BaseSetAssoc

Removed extra initialization of cache block just after they have been
created and organized the comments.

Change-Id: I75c1beaf0489e3e530fd8cbff2739dc7593e3e6f
Reviewed-on: https://gem5-review.googlesource.com/8661
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

6 years agomem-cache: Vectorize C arrays in BaseSetAssoc.
Daniel R. Carvalho [Mon, 26 Feb 2018 14:22:33 +0000 (15:22 +0100)]
mem-cache: Vectorize C arrays in BaseSetAssoc.

Transform BaseSetAssoc's arrays into C++ vectors to avoid unnecessary
resource management.

Change-Id: I656f42f29e5f9589eba491b410ca1df5a64f2f34
Reviewed-on: https://gem5-review.googlesource.com/8621
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agosim, power: Temperature used for power calculations
Anouk Van Laer [Mon, 21 Aug 2017 15:02:45 +0000 (16:02 +0100)]
sim, power: Temperature used for power calculations

The temperature used for the power calculations was fixed at 0
degrees, unless a thermal model was setup.  This commit allows
the user to set the temperature that needs to be used by the
power calculation during gem5 configuration.  This value will be
overwritten if there are thermal models present.

Change-Id: I7ca8fa6766bdcba9d362c12fc75d1e1f74385f35
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8602
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agosim: Added model type to power model
Anouk Van Laer [Wed, 1 Mar 2017 17:05:18 +0000 (17:05 +0000)]
sim: Added model type to power model

Static, dynamic or all to differentiate between types of power models
so for example static models will not be asked for a dynamic power

Change-Id: I3a0385821f7c671aedddaebeb038c677367faa81
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8601
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agomem-cache: Fix CacheSet memory leak
Daniel R. Carvalho [Fri, 23 Feb 2018 14:55:06 +0000 (15:55 +0100)]
mem-cache: Fix CacheSet memory leak

CacheSet blocks were being allocated but never freed.
Used vector to avoid using pure C array.

Change-Id: I6f32fa5a305ff4e1d7602535026c1396764102ed
Reviewed-on: https://gem5-review.googlesource.com/8603
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

6 years agosparc: Fix FS Checkpoint loading
Khalique [Thu, 22 Feb 2018 19:19:40 +0000 (13:19 -0600)]
sparc: Fix FS Checkpoint loading

Proposed changes to SPARC FS simulation, testing indicates that checkpoints are now loaded correctly with the following command: build/SPARC/gem5.opt configs/example/fs.py -r 1

Change-Id: Icd44f01a74c41a78828ef6fd7b661e584bdb6966
Reviewed-on: https://gem5-review.googlesource.com/8581
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoarch-arm: Make hlt64 a mem barrier with semihosting
Giacomo Travaglini [Thu, 15 Feb 2018 09:55:20 +0000 (09:55 +0000)]
arch-arm: Make hlt64 a mem barrier with semihosting

The HLT instruction is used to trap into semihosting. The semihosting
code can change the contents of memory behind the back of the CPU,
which requires instructions triggering semihosting to be
non-speculative and memory barriers.

Change-Id: I735166251aa194120ad49c08082d4ac65fe96524
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8373
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Add AArch32 HLT Semihosting interface
Giacomo Travaglini [Tue, 13 Feb 2018 14:01:57 +0000 (14:01 +0000)]
arch-arm: Add AArch32 HLT Semihosting interface

AArch32 HLT instruction is now able to issue Arm Semihosting commands as
the AArch64 counterpart in either Arm and Thumb mode.

Change-Id: I77da73d2e6a9288c704a5f646f4447022517ceb6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8372
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Add AArch32 SVC Semihosting interface
Giacomo Travaglini [Tue, 13 Feb 2018 13:55:36 +0000 (13:55 +0000)]
arch-arm: Add AArch32 SVC Semihosting interface

AArch32 Svc instruction is now able to issue Arm Semihosting commands as
the AArch64 counterpart in either Arm and Thumb mode.

Change-Id: Ibe47ac23d0c26f3f819cc0e2b3ee874b5cdbb3d3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8371
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Adding isa templates for semihosting ops
Giacomo Travaglini [Thu, 15 Feb 2018 09:57:00 +0000 (09:57 +0000)]
arch-arm: Adding isa templates for semihosting ops

A new class of Semihosting constructor templates has been added.  Their
main purpose is to check if the Exception Generation Instructions (HLT,
SVC) are actually a semihosting command.  If that is the case, the
IsMemBarrier flag is raised, so that in the O3 model we perform a
coherent memory access during the semihosting operation.

Change-Id: Ib87fdeb70ee7a930659563230a80cce0e1372c32
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8370
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: HLT using immediate when checking for semihosting
Giacomo Travaglini [Wed, 14 Feb 2018 18:42:19 +0000 (18:42 +0000)]
arch-arm: HLT using immediate when checking for semihosting

HLT can use the immediate field when checking for semihosting,
rather than re-parsing it from the machInst variable.

Change-Id: I072cb100029da34d129b90c5d17e1728f9016c88
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8369
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Fix Hlt64,Svc64,Hvc64,Smc64,Brk64 disassembly
Giacomo Travaglini [Wed, 14 Feb 2018 17:45:38 +0000 (17:45 +0000)]
arch-arm: Fix Hlt64,Svc64,Hvc64,Smc64,Brk64 disassembly

This patch fixes the disassembly of AArch64 Exception Generating
instructions, which were not printing the encoded immediate field. This
has been accomplished by changing their underlying type to a newly
defined one.

Change-Id: If58ae3e620d2baa260e12ecdc850225adfcf1ee5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8368
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agocpu-o3: Don't add non-speculative mem barriers to the IQ twice
Andreas Sandberg [Tue, 13 Feb 2018 19:01:17 +0000 (19:01 +0000)]
cpu-o3: Don't add non-speculative mem barriers to the IQ twice

There are cases where the IEW adds a non-speculative instruction to
the IQ twice. This can happen if an instruction is flagged as
IsMemBarrier and IsNonSpeculative. Avoid adding non-speculative
instructions in the IEW to the IQ by checking if it has been added
already.

Change-Id: Ifcff676a451b57b2406ce00ed8dae19ed399515f
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Javier Setoain <javier.setoain@arm.com>
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8374
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
6 years agomem: fix page_table bug for .fast build
Brandon Potter [Mon, 19 Feb 2018 18:54:46 +0000 (13:54 -0500)]
mem: fix page_table bug for .fast build

Since b8b13206c8, the '.fast' build has failed to compile with an error
caused by a variable and an assert.

As a reminder, assert macros are optimized out of the build for '.fast'.
If an assert check requires a variable that is unused anywhere else in
the code, the compiler complains that the variable is unused and the
scons build fails. The solution is to add a M5_VAR_USED specifier to
tell the compiler to ignore the variable.

Change-Id: I38f6bbed1e4c0506c5bbc1206c21f1f7e3d8dfe6
Reviewed-on: https://gem5-review.googlesource.com/8462
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

6 years agoarch-riscv: Fix compressed branch op offset
Alec Roelke [Mon, 19 Feb 2018 17:21:33 +0000 (12:21 -0500)]
arch-riscv: Fix compressed branch op offset

There is a bug in RISC-V's compressed branch instructions where the
offsets are not stored in ImmOp's immediate field, causing incorrect
branchTarget() return values.  This patch adds a new compressed branch
op format, CBOp, which correctly stores the offset.

Change-Id: Iac6e9b091d63f3dce4717ee5a9ec31a7cbd6c377
Reviewed-on: https://gem5-review.googlesource.com/8441
Reviewed-by: Tuan Ta <qtt2@cornell.edu>
Maintainer: Alec Roelke <ar4jc@virginia.edu>

6 years agoarch-arm: Semihosting not available in syscall emulation
Giacomo Travaglini [Wed, 14 Feb 2018 14:03:34 +0000 (14:03 +0000)]
arch-arm: Semihosting not available in syscall emulation

Arm Semihosting is not available in syscall emulation since we don't
have an Arm system in that scenario. Trying to use it in "se" mode will
make getArmSystem assertion fail.

Change-Id: I4cf49ae801ec6e6c93134ac6ae2a0f412040684c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8367
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Add support for secure state in semihosting
Andreas Sandberg [Tue, 13 Feb 2018 18:03:32 +0000 (18:03 +0000)]
arch-arm: Add support for secure state in semihosting

The semihosting component currently issues non-secure memory accesses
using the standard port proxy. This doesn't work when the guest is
running in secure state.

Change-Id: Id34b142cfcd9d77b455c040ae7f7397c29aebbc6
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8365
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
6 years agomem: Refactor port proxies to support secure accesses
Andreas Sandberg [Tue, 13 Feb 2018 18:00:22 +0000 (18:00 +0000)]
mem: Refactor port proxies to support secure accesses

The current physical port proxy doesn't know how to tag memory
accesses as secure. Refactor the class slightly to create a set of
methods (readBlobPhys, writeBlobPhys, memsetBlobPhys) that always
access physical memory and take a set of Request::Flags as an
argument. The new port proxy, SecurePortProxy, uses this interface to
issue secure physical accesses.

Change-Id: I8232a4b35025be04ec8f91a00f0580266bacb338
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8364
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

6 years agoarch-arm: Add aarch64 semihosting support
Andreas Sandberg [Thu, 8 Feb 2018 20:13:13 +0000 (20:13 +0000)]
arch-arm: Add aarch64 semihosting support

Add basic support for Arm Semihosting 2.0 simulation calls [1]. These
calls let the guest system call a simulator or debugger to request
OS-like support when running bare metal code.

With the exception of SYS_SYSTEM, this implementation supports all of
the Semihosting 2.0 specification in aarch64.

[1] https://developer.arm.com/docs/100863/latest/preface

Change-Id: I08c153c18a4a4fb9f95d318e2a029724935192a7
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8147
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
6 years agoarch-arm: IMPLEMENTATION DEFINED register
Giacomo Travaglini [Wed, 24 Jan 2018 16:11:38 +0000 (16:11 +0000)]
arch-arm: IMPLEMENTATION DEFINED register

A new pseudo register has been added to the Misc pool. It is the
implementation defined register. This kinds of registers are covered by
the architecture and must be treated differently than UNIMPLEMENTED
registers: their access can be trapped to EL2 (See HCR.TIDCP bit in the
arm arm).
Some previously undecoded registers in c9,c10,c11 have now this register
type.

Change-Id: Ibfc35982470b9dea0ecf39aaa6b1012a21852f53
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7922
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Arch regs and pseudo regs distinction
Giacomo Travaglini [Wed, 24 Jan 2018 15:53:43 +0000 (15:53 +0000)]
arch-arm: Arch regs and pseudo regs distinction

A new identifier has been introduced: NUM_PHYS_MISCREGS, which is used
as a boundary for the number of physical (real) Misc registers in the
system.  Pseudo registers (like CP15_UNIMPL) have been moved after the
NUM_PHYS_MISCREGS identifier, so that their enum number is
(NUM_PHYS_MISCREGS < number < NUM_MISCREGS).  Moving away those
registers has created some free slots that can be used for future Misc
register implementation.
SERIALIZE and UNSERIALIZE now only save/restore PHYSICAL Misc Registers.
This allows us to define as many pseudo registers as we want without
being concerned about checkpoint compatibility.

Change-Id: I7e297b814eeaa4bee640e81bee625fb66710af45
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7921
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Fix syntax error in TLB::getResultTe
Chuan Zhu [Tue, 23 Jan 2018 10:19:07 +0000 (10:19 +0000)]
arch-arm: Fix syntax error in TLB::getResultTe

The patch fixes one syntax error in TLB::getResultTe

Change-Id: I31a72a52d5c03f43929a69ca1be61d9c20e76f5b
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7983
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Fix big endian support in {Load,Store}Double64
Chuan Zhu [Wed, 26 Jul 2017 16:03:18 +0000 (17:03 +0100)]
arch-arm: Fix big endian support in {Load,Store}Double64

{Load, Store}Double64 didn't consider some of the big-endian
situations. Added big-endian related data conversions to correct them.

Change-Id: I8840613f94446e6042276779d1f02350ab57987f
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8145
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Fix big endian support in do{Long,L1,L2}Descriptor
Chuan Zhu [Wed, 2 Aug 2017 08:52:28 +0000 (09:52 +0100)]
arch-arm: Fix big endian support in do{Long,L1,L2}Descriptor

do{Long,L1,L2}Descriptor was not able to load descriptors correctly
for big-endian situations, causing recognised Descriptors.  Added
big-endian related data conversions to correct them.

Change-Id: I0fdfbbdf56f94bbed19172acae1b6e4a0382b5a0
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8144
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Add support for automatic reset addr selection
Andreas Sandberg [Fri, 9 Feb 2018 18:26:44 +0000 (18:26 +0000)]
arch-arm: Add support for automatic reset addr selection

Add an option to automatically set the aarch64 reset vector to the
entry point of the kernel. This is useful when running bare metal
workloads that don't use a normal boot loader.

Change-Id: Id472f865d461f0d8d8ea8efe5db582c170de0b90
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8143
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
6 years agoarch-arm: Change ArmFault cast from reinterpret to static
Giacomo Travaglini [Fri, 9 Feb 2018 11:07:53 +0000 (11:07 +0000)]
arch-arm: Change ArmFault cast from reinterpret to static

Changing casting type in src/arch/arm/isa.cc

Change-Id: Ia19b30a1bf8b1b25df149b52613a3533eaced03a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8241
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Decode Brk64 instructions
Andreas Sandberg [Thu, 8 Feb 2018 18:18:16 +0000 (18:18 +0000)]
arch-arm: Decode Brk64 instructions

The brk instruction in aarch64 was decoded as an unimplemented
instruction. Fix that.

Change-Id: I3eb36a016ab56d882426c5cdef3a0b594de0f9cd
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8142
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
6 years agomem: Add PortProxy read/write helper with explicit endianness
Andreas Sandberg [Fri, 9 Feb 2018 12:48:37 +0000 (12:48 +0000)]
mem: Add PortProxy read/write helper with explicit endianness

Change-Id: Ia9a11ca68b2892dafd02f2c37324b99b35c77d34
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8146
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
6 years agosim: Add gtoh/htog helpers that take an explicit endianness
Chuan Zhu [Wed, 2 Aug 2017 08:52:28 +0000 (09:52 +0100)]
sim: Add gtoh/htog helpers that take an explicit endianness

Add helper functions to swap between guest byte order and host byte
order that take a guest endianness as a parameter. These functions are
called htog and htog to be consistent with the helper functions that
extract guest byte order from a compile time constant.

Change-Id: Ie6be7dfd3b7a58ad6bfb57b25be5f85b5f425929
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8201
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
6 years agoarch-arm: Fix Secure state check in checkFPAdvSIMDTrap64
Chuan Zhu [Tue, 2 Jan 2018 16:14:33 +0000 (16:14 +0000)]
arch-arm: Fix Secure state check in checkFPAdvSIMDTrap64

The old code does secure state check by using "el <= EL2", which
mis-considers secure EL1 and EL0. This patch fixes this by using
inSecureState as in ARM ARM.

Change-Id: I01d847c6af022c1462b16206cbc576f15f5569fd
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8081
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agomem, sim-se: Fixed seg-fault in EmulationPageTable::remap
Rico Amslinger [Tue, 13 Feb 2018 14:34:43 +0000 (15:34 +0100)]
mem, sim-se: Fixed seg-fault in EmulationPageTable::remap

When moving a memory region the target region should be unmapped.
The assertion does reflect this, but the following line accesses
the invalid pointer regardless. This commit replaces the pointer
access with an emplace.

Change-Id: I85f9be4e6c223eab447c75043e593ed3f90017e1
Reviewed-on: https://gem5-review.googlesource.com/8261
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agodev: Remove unused interrupt controller in Terminal
Andreas Sandberg [Thu, 8 Feb 2018 20:14:12 +0000 (20:14 +0000)]
dev: Remove unused interrupt controller in Terminal

Change-Id: I412d0b5edf2a08217792fa2ed1e511c17d3d31d4
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8141
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
6 years agosim: Make Stats truly non-copy-constructible
Rekai Gonzalez-Alberquilla [Fri, 10 Feb 2017 17:27:33 +0000 (17:27 +0000)]
sim: Make Stats truly non-copy-constructible

The stats are silently non-copy constructible. Therefore, when someone
copy-constructs any object with stats, asserts happen when registering
the stats, as they were not constructed in the intended way.

This patch solves that by explicitly deleting the copy constructor,
trading an obscure run-time assert for a compile-time somehow more
meaningful error meassage.

This triggers some compilation errors as the FaultStats in the fault
definitions of ARM and SPARC use brace-enclosed initialisations in which
one of the elements derives from DataWrap, which is not
copy-constructible anymore. To fix that, this patch also adds a
constructor for the FaultVals in both ISAs.

Change-Id: I340e203b9386609b32c66e3b8918a015afe415a4
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8082
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoFix DDR4_2400_8x8 DRAMCTRL configuration
Wendy Elsasser [Fri, 9 Feb 2018 18:34:40 +0000 (12:34 -0600)]
Fix DDR4_2400_8x8 DRAMCTRL configuration

Change-Id: I7af361e146909acc158590354ab22732d4b2f3d5
Signed-off-by: Wendy Elsasser <wendy.elsasser@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8101
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agosim: Remove _numContexts member in System class
Giacomo Travaglini [Mon, 5 Feb 2018 17:08:43 +0000 (17:08 +0000)]
sim: Remove _numContexts member in System class

A System object has a _numContexts member variable which represent the
number of ThreadContext registered in the System.  Since this has to
match the size of the ThreadContext vector, this patch removes the
manually cached size. This was usually used as a for-loop index, whereas
we want to enforce the use of range-based loops whenever possible.

Change-Id: I1ba317c0393bcc9c1aeebbb1fc22d7b2bc2cf90c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8062
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>

6 years agodev: Fix i8042 device errors
Jason Lowe-Power [Wed, 10 Jan 2018 18:19:19 +0000 (10:19 -0800)]
dev: Fix i8042 device errors

The patch that added M5_FALLTHROUGH (5c41076bd7610 misc: Updates for gcc7.2
for x86) incorrectly added breaks to the i8042 device without implementing
the correct functions. This patch implements keyboard writes, but ignores
output writes.

Information on the PS2 controller can be found at
https://wiki.osdev.org/%228042%22_PS/2_Controller

Note: Without this patch Linux 4.14 won't boot.

Change-Id: I7de137b46cef00e6c1f1c14335cb52107cd7fe5b
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/7301
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agomem-cache: Make cache warmup percentage a parameter.
Daniel R. Carvalho [Wed, 7 Feb 2018 13:49:55 +0000 (14:49 +0100)]
mem-cache: Make cache warmup percentage a parameter.

The warmupPercentage is the percentage of different tags (based on the
cache size) that need to be touched in order to warm up the cache.
If Warmup failed (i.e., not enough tags were touched), warmup_cycle = 0.

The warmup is not being taken into account to calculate the stats (i.e.,
stats acquisition starts before cache is warmed up). Maybe in the future
this functionality should be added.

Change-Id: I2b93a99c19fddb99a4c60e6d4293fa355744d05e
Reviewed-on: https://gem5-review.googlesource.com/8061
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

6 years agoarch-arm: Correct SecureMonitorTrap vals for aarch32
Giacomo Travaglini [Tue, 28 Nov 2017 16:00:02 +0000 (16:00 +0000)]
arch-arm: Correct SecureMonitorTrap vals for aarch32

This patch replaces the dummy values which were defined for the
SecureMonitorTrap thus enabling its usage in aarch32 mode.  1) It
changes the vector table offset from 0x14 to 0x4 in compliance with the
armv8 documentation.  2) When trapping in monitor mode for aarch32, the
mon_lr is updated with the pc + a non zero offset (+4/2 depending on the
current instruction set: +4 for A32, +2 for T32).

Change-Id: I01e1e52bf5ecd405e7472e31e01cf9a599153b08
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8041
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Fixed error in choosing vector offset
Chuan Zhu [Fri, 5 Jan 2018 10:26:37 +0000 (10:26 +0000)]
arch-arm: Fixed error in choosing vector offset

The old code chose vector offset associated with exceptions taken
to EL3 by incorrectly using "from64", which is associated with the
exception level where the exception was taken from. However, the
offset should depends on the ISA of the lower EL and not of the
starting EL itself, as specified in ARM ARM. This patch corrects
this by implementing the method in AArch64.TakeException in ARM ARM.

Change-Id: I8f7c9aa777c5f2eef9e2d89c36e9daee23f3a822
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8001
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Don't change PSTATE in Illegal Exception return
Giacomo Travaglini [Tue, 19 Dec 2017 10:18:13 +0000 (10:18 +0000)]
arch-arm: Don't change PSTATE in Illegal Exception return

This patch fixes the Illegal Exception return handler. According to the
armarm documentation, when PSTATE.IL is set to one because of an illegal
exception return, PSTATE.{EL, nRW, SP} are unchanged. This means the
Exception level, Execution state, and stack pointer selection do not
change as a result of the return.

Change-Id: I35f2fe68fb2822a54fc4a21930871eab7a1aaab4
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8021
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Handle route to EL2 in Supervisor Trap
Chuan Zhu [Mon, 15 Jan 2018 16:14:11 +0000 (16:14 +0000)]
arch-arm: Handle route to EL2 in Supervisor Trap

Supervisor Trap is supposed to be able to handle exceptions routed
to EL2, which is enabled by HCR_EL2.TGE. This fix adds routeToHyp()
function to Supervisor Trap to handle this, similar to that in
UndefinedFault, DataAbort, etc.

Change-Id: I1fcf9f2d445ecbc13c8f6d3b7d599728b0250ab7
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7961
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Change the type of fault for dc ivac instructions
Nikos Nikoleris [Wed, 20 Dec 2017 19:20:42 +0000 (19:20 +0000)]
arch-arm: Change the type of fault for dc ivac instructions

Change-Id: I00f957a3bc4721a66db62b1257f10e9019a94608
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7829
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
6 years agoarch-arm: Unify permission checks for dc * instructions
Nikos Nikoleris [Wed, 20 Dec 2017 17:25:31 +0000 (17:25 +0000)]
arch-arm: Unify permission checks for dc * instructions

Change-Id: Ib47f4134e3f0a580e5356d384a5d3b293c1af7be
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7828
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Check cache maintenance insts for permission faults
Nikos Nikoleris [Thu, 4 Jan 2018 15:14:26 +0000 (15:14 +0000)]
arch-arm: Check cache maintenance insts for permission faults

In AArch32, data cache maintenance instructions that operate by VA do
not generate permission faults.

In AArch64, a data cache invalidate instruction can generate a
permission fault when there are no write permissions to the specified
VA. Data cache clean and data cache clean and invalidate instructions
do not generate permission faults.

Checks for external aborts are also bypassed for data cache
maintenance instructions.

Change-Id: Iea5bc665e4cf66d528e36b671535b66637c4b224
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7827
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Turn dc ivac to dc civac when some conditions are met
Nikos Nikoleris [Tue, 19 Dec 2017 21:49:08 +0000 (21:49 +0000)]
arch-arm: Turn dc ivac to dc civac when some conditions are met

The Arm ARM defines that at EL1 a data cache invalidate instruction
performs a data cache clean and invalidate operation if all of the
following apply:
* EL2 is implemented,
* HCR_EL2.VM is set to 1,
* SCR_EL3.NS is set to 1 or EL3 is not implemented.
This changeset implements this behavior.

Change-Id: I6b6aef2f4b1e7eb107c069fdb0a10f4aa8e6b196
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7826
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Fix printing of the data cache maintenance instructions
Nikos Nikoleris [Wed, 20 Dec 2017 12:13:08 +0000 (12:13 +0000)]
arch-arm: Fix printing of the data cache maintenance instructions

Change-Id: I2322c7bf65b38cb07a1ea2b5dc25dfc5a0496cf0
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7825
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
6 years agoarch-arm: Fix cache line size for cache maintenace inst
Nikos Nikoleris [Tue, 19 Dec 2017 21:43:51 +0000 (21:43 +0000)]
arch-arm: Fix cache line size for cache maintenace inst

Cache maintenance operations operate on whole cache blocks. This
changeset uses the system cache line size as the size of the cache
maintenance requests and masks the lower bits of the effective
address.

Change-Id: I6e7aefff51670c8cac39e4e73db21a0c5a0b7aef
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7824
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Fault when dc ivac is executed from EL0
Nikos Nikoleris [Tue, 19 Dec 2017 16:58:33 +0000 (16:58 +0000)]
arch-arm: Fault when dc ivac is executed from EL0

A previous change enabled execution of dc ivac from EL0 when
SCTLR_EL1.UCI=1. The Arm ARM specifies that dc ivac is the only data
cache maintenance operation by VA that cannot be executed from
EL0. This changeset essential reverts the change:
8d43922 arch-arm: Allow dc ivac from EL0 when SCTLR_EL1.UCI=1

Change-Id: Ia25fab13846a151f548e649a16067feb1ff65c9c
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7823
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agomem-cache: Only pendingModified MSHRs can satisfy CMO snoops
Nikos Nikoleris [Tue, 19 Dec 2017 14:44:11 +0000 (14:44 +0000)]
mem-cache: Only pendingModified MSHRs can satisfy CMO snoops

We set the satisfied flag when a cache clean request encounters:
1) a block with the dirty bit set, or
2) a pending modified MSHR which means that the cache will get copy of
the block that will be soon modified.

This changeset fixes a previous bug that set the satisfied flag on
snooping MSHR hits even the pendingModified flags was not set.

Change-Id: I4968c4820997be5cc1238148eea12a1ba39837d4
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Sudhanshu Jha <sudhanshu.jha@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7822
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agomem-cache: Cleaned blocks should be marked as not writable
Nikos Nikoleris [Thu, 14 Dec 2017 17:36:09 +0000 (17:36 +0000)]
mem-cache: Cleaned blocks should be marked as not writable

A writeclean packet writes a dirty block to the memory below and
therefore sets the dirty flag for the block when the memory below is a
cache. If the block was also marked as writable it can satisfy future
write requests without further requests/snoops. This can lead to
multiple copies of the same block marked as dirty which is not
allowed. This changeset clears the writable flag from the cleaned
block to prevent the cache from satisfying future write requests
without sending a downstream request.

Change-Id: I14d3c62fd33f81b1a8ba62374c8565ccab00a6fe
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7821
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
6 years agoarch-arm: Change function name for banked miscregs
Giacomo Travaglini [Tue, 9 Jan 2018 10:10:04 +0000 (10:10 +0000)]
arch-arm: Change function name for banked miscregs

This commit changes the function's name used for retrieving the index of a
security banked register given the flatten index. This will avoid confusion
with flattenRegId, which has a different purpose.

Change-Id: I470ffb55916cb7fc9f78e071a7f2e609c1829f1a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7982
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Fix AArch32 SETEND Instruction
Giacomo Travaglini [Thu, 14 Dec 2017 17:38:38 +0000 (17:38 +0000)]
arch-arm: Fix AArch32 SETEND Instruction

This patch fixes AArch32 SETEND instruction, which was previously
executed unconditionally without checking (H)SCTLR.SED field. This bit
enables/disables the trapping of the instruction.

Change-Id: Ib3d2194c8d16c34ec2a9ab3e8090081900c1e42e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7981
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Correct Illegal Exception Return detection
Giacomo Travaglini [Wed, 3 Jan 2018 11:02:00 +0000 (11:02 +0000)]
arch-arm: Correct Illegal Exception Return detection

Fixed Illegal Exception Return detection, which was not
covering all the documented cases.

Change-Id: If08ddc1490d1c0a1fccee1489d116384770ce0a5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7223
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: ELUsingAArch32K from armarm pseudocode
Giacomo Travaglini [Wed, 3 Jan 2018 11:01:17 +0000 (11:01 +0000)]
arch-arm: ELUsingAArch32K from armarm pseudocode

This patch implements the ELUsingAArch32K pseudocode, which is returning
true if the provided Exception Level is using A32 ISA, but it is not
panicking (quitting simulation) if the information is unknown (see
documentation).
The panicking is the current behaviour of the ELIs32 utility in gem5.

Change-Id: Iad7b56077d7e0f8ee223b5b9593cb8097f26bb29
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7222
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: isSecureBelow from armarm pseudocode
Giacomo Travaglini [Fri, 22 Dec 2017 12:30:05 +0000 (12:30 +0000)]
arch-arm: isSecureBelow from armarm pseudocode

This patch introduces the inSecureBelow pseudocode function
defined in the armarm documentation. It also replaces the
inSecureState function call which was improperly used in
ELIs32: we might be in secure state (EL3), but with non-secure
lower ELs (SCR.NS = 1).

Change-Id: I01febcb54392ad4e51e785b4d5153aeb3437c778
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Chuan Zhu <chuan.zhu@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7221
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Fix incorrect assumptions in ELIs64
Chuan Zhu [Wed, 26 Jul 2017 16:40:36 +0000 (17:40 +0100)]
arch-arm: Fix incorrect assumptions in ELIs64

The state of EL1 wasn't determined correctly when running in secure
mode if virtualisation was enabled. This changset updates the
implementation to match the canonical behavior from the ARM ARM.

Change-Id: I7ed6f5c003617773603f678667aac069d73b6f62
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7141
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
6 years agomem-cache: Remove extra numSets zero check.
Daniel R. Carvalho [Tue, 6 Feb 2018 10:24:30 +0000 (11:24 +0100)]
mem-cache: Remove extra numSets zero check.

numSets is unsigned, so it cannot be lower than 0. Besides, isPowerOf2(0)
is false by definition (and implemmentation*), so there is no need for the
double check.

* As presented in base/intmath.hh

Change-Id: I3f6296694a937434feddc7ed21f11c2a6fdfc5a9
Reviewed-on: https://gem5-review.googlesource.com/7901
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agomem: Standardize mem folder header guards
Daniel R. Carvalho [Mon, 5 Feb 2018 15:32:23 +0000 (16:32 +0100)]
mem: Standardize mem folder header guards

Standardize all header guards in the mem directory according to the most
frequent patterns. In general they have the form:
  mem:  __FOLDER_TREE_FILE_NAME_HH__
  ruby: __FOLDER_TREE_FILENAME_HH__

Change-Id: I983853e292deb302becf151bf0e970057dc24774
Reviewed-on: https://gem5-review.googlesource.com/7881
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

6 years agobase: Update #includes for bitunion.hh.
Gabe Black [Sun, 4 Feb 2018 06:25:14 +0000 (22:25 -0800)]
base: Update #includes for bitunion.hh.

<iostream> isn't actually used anywhere in bitunion.hh. The templated
hash struct type is defined in <functional> and should be included
explicitly.

Change-Id: I8691ccb2f9e28a01610ae8bb4d9591b07cb7320b
Reviewed-on: https://gem5-review.googlesource.com/7781
Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoconfig: remove dead code in fs.py
Nayan Deshmukh [Sun, 4 Feb 2018 12:28:46 +0000 (17:58 +0530)]
config: remove dead code in fs.py

We have not added the --generate-dtb option for non-ARM systems and
hence this case becomes dead code. It also leads to error on non-ARM
systems as is tries to access a non existent field.

Change-Id: Ia926bd0c61efa275bc5e3864b8a9c3ffb7aa3cb5
Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/7801
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agocpu: MinorCPU handling IsSquashAfter flag
Giacomo Travaglini [Wed, 8 Nov 2017 11:24:58 +0000 (11:24 +0000)]
cpu: MinorCPU handling IsSquashAfter flag

MinorCPU was not handling IsSquashAfter flagged instructions. The
behaviour was to force a branch (hence enforcing refetching) for
SerializeAfter instructions only. This has now been extended to
SquashAfter in order to correctly support ISB barrier instruction
behaviour.

Change-Id: Ie525b23350b0de121372d3b98b433e36b097d5c4
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5702
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: Removing Serializing flag from ISB
Giacomo Travaglini [Mon, 6 Nov 2017 15:22:43 +0000 (15:22 +0000)]
arch-arm: Removing Serializing flag from ISB

ISB Serializing behaviour is guaranteed by IsSquashAfter,
which is inherently serializing; when instruction is commited,
consecutive instructions are flushed and refetched.

Change-Id: I05e61b4cf9f01113d95b1502c996d04cbd69b759
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5701
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agobase: Fix unused function warning
Nikos Nikoleris [Thu, 1 Feb 2018 17:57:48 +0000 (17:57 +0000)]
base: Fix unused function warning

After refactoring the remote gdb interface, break_type is declared as
const function and is only used as a parameter to DPRINTF function
calls. This means that it is seen as unused when compiling
gem5.fast. This changeset fixes the warning.

Change-Id: Iea89b66c53c62341c043d8bd3838ebc27ee333bc
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7741
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

6 years agoalpha: fix for no 'break' in the case statement
Sujay Phadke [Tue, 23 Jan 2018 17:54:12 +0000 (23:24 +0530)]
alpha: fix for no 'break' in the case statement

gem5 won't compile correctly since g++ will throw a warning (error)
that the next case statement below this one is reachable since there is
no 'break' statement.

Signed-off-by: Sujay Phadke
Change-Id: Icab646ee5abcfeb6ba3e690909042927b4003eba
Reviewed-on: https://gem5-review.googlesource.com/7521
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agoscons: Resolve backtrace implementation existence testing failure
Hanhwi Jang [Tue, 30 Jan 2018 10:17:33 +0000 (19:17 +0900)]
scons: Resolve backtrace implementation existence testing failure

Change backtrace implementation testing code not to have NULL pointer.

SCons fails to find backtrace implementation even if it exists.
The implementation testing code contains NULL pointers as a backtrace
buffer argument. Some compilers check the buffer is NULL pointed
or not, and generate a compilation error.

Change-Id: Icc5bc9a887b7a6bbc804b5b8a5a35a935c78a922
Reviewed-on: https://gem5-review.googlesource.com/7681
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoarch-x86: consistent style of comments in system files
Christian Menard [Tue, 30 Jan 2018 10:12:31 +0000 (11:12 +0100)]
arch-x86: consistent style of comments in system files

Change-Id: I9f208819b8c1a5c46a77262eb533bb47adb2b905
Reviewed-on: https://gem5-review.googlesource.com/7701
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoarch-x86: Granularity bit and segment limit
Maximilian Stein [Mon, 29 Jan 2018 11:21:32 +0000 (12:21 +0100)]
arch-x86: Granularity bit and segment limit

If set, the granularity bit indicates that the segment limit of segment
descriptors shall be interpreted as number of 4K blocks rather than
bytes.

The high part (bit 48 to 51) of segment descriptor limits is only 4 bits
wide while the low part (bit 0 to 15) spans 16 bits.

Change-Id: Ie386224ca815275fdb31498fe68310ed9c62cc87
Reviewed-on: https://gem5-review.googlesource.com/7601
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoriscv: Add overrides to various StaticInst methods.
Gabe Black [Mon, 29 Jan 2018 23:17:08 +0000 (15:17 -0800)]
riscv: Add overrides to various StaticInst methods.

This makes riscv compile with the version of clang(++) I have on my
workstation.

Change-Id: I0478616810fbc8a715fd61323b7e0f73676c8328
Reviewed-on: https://gem5-review.googlesource.com/7643
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agobase: Remove the ability to cprintf stringstreams directly.
Gabe Black [Mon, 29 Jan 2018 22:42:26 +0000 (14:42 -0800)]
base: Remove the ability to cprintf stringstreams directly.

The cprintf functions don't know ahead of time what format characters
are going to be used with what underlying data types, and so any
type must be minimally usable with the default specialization of
format_integer, format_char, format_float and format_string. All of
those functions ultimately print their parameter with out << data
except the one which prints stringstreams. That function accesses the
buffer of the string stream with .str(), and then prints that instead.

That should technically work out ok as long as stringstreams are only
printed using %s, but there's no way to guarantee that ahead of time.
To avoid that problem, and because gem5 doesn't ever actually use the
ability to print stringstreams directly, this change removes that
feature and modifies the corresponding part of the unit test.

If we ever do want to print the contents of a string stream, it won't
be difficult to add a .str() to it.

Change-Id: Id902eaff042b96b374efe0183e5e3be9626e8c88
Reviewed-on: https://gem5-review.googlesource.com/7642
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agobase: Delete commented out versions of the format_integer function.
Gabe Black [Mon, 29 Jan 2018 22:38:37 +0000 (14:38 -0800)]
base: Delete commented out versions of the format_integer function.

If they're needed, they'd be fairly easy to recreate and are also
available in the revision history.

Change-Id: I5cf5e4b1271ce488016464048de69bc643dee4d9
Reviewed-on: https://gem5-review.googlesource.com/7641
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoarch-arm: understandably initialize register permissions
Curtis Dunham [Wed, 6 Dec 2017 22:51:26 +0000 (16:51 -0600)]
arch-arm: understandably initialize register permissions

Move massive initialization routine to the bottom of miscregs.cc.
Additionally, share register metadata across ISA instances by
making lookUpMiscReg a static member of the ISA and only
initializing it once.

Change-Id: I6d6ab26200c4e781151cc6efd97ce2420e2bf4cc
Signed-off-by: Curtis Dunham <Curtis.Dunham@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/6803
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarm: extend MiscReg metadata structures
Curtis Dunham [Fri, 3 Nov 2017 22:39:45 +0000 (17:39 -0500)]
arm: extend MiscReg metadata structures

Implement proper handling of RES0/RES1 and RAZ/RAO bitfields.

Change-Id: I344c32c3fb1d142acfb0521ba3590ddd2b1f5360
Signed-off-by: Curtis Dunham <Curtis.Dunham@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/6802
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-arm: understandably initialize register mappings
Curtis Dunham [Wed, 6 Dec 2017 20:42:07 +0000 (14:42 -0600)]
arch-arm: understandably initialize register mappings

The mappings for sharing a backing store between AArch32
and AArch64 system registers are made clearer using an
initializer object.

Change-Id: I29dcfab2797b4d36b3182342997edffde334a291
Signed-off-by: Curtis Dunham <Curtis.Dunham@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/6801
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoconfig, arm: enable device tree autogeneration for bigLITTLE
Curtis Dunham [Mon, 11 Sep 2017 20:17:00 +0000 (15:17 -0500)]
config, arm: enable device tree autogeneration for bigLITTLE

Change-Id: Iaa5eeb3504b3ff9e46b6f592a06d6b833c830d83
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5969
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoconfig: Embed Device Tree generation in fs.py config
Glenn Bergmans [Mon, 14 Mar 2016 20:29:12 +0000 (20:29 +0000)]
config: Embed Device Tree generation in fs.py config

Equips the fs.py config routine with an extra commandline option
--generate-dtb that will generate a dtb file automatically before
running the simulation. Only works with ARM systems and gives a warning
if the simulated system is not of --machine-type VExpress_GEM5_V1.

Change-Id: I7766e5459fd9bec2245de83cef103091ebaf7229
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5968
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarm: DT autogeneration - generate PCI node
Glenn Bergmans [Fri, 22 Jan 2016 15:40:14 +0000 (15:40 +0000)]
arm: DT autogeneration - generate PCI node

Enables automatic generation of Device Trees for RealView PCI host
controllers. Note that some parts are more hard coded than you'd want,
but this is due to the limited understanding the PCI host has of its
configuration (i.e. it doesn't know all memory ranges). Fixing this,
for now at least, went beyond the scope and intentions of the
Device Tree generating code: use with care!

Change-Id: I2041871e0eb4d04fb5191257c47dd38649d1c0cc
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5967
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarm: DT autogeneration - Generate energy controller node
Glenn Bergmans [Fri, 22 Jan 2016 15:40:14 +0000 (15:40 +0000)]
arm: DT autogeneration - Generate energy controller node

Adds Device Tree methods for the energy controller to allow for
DVFS simulations with automatically generated DTB files

Change-Id: Id8682f07dff1bbe63987e757faa0694e03ee86ab
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5966
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarm: DT autogeneration - autogenerate RealView Platform devices
Glenn Bergmans [Thu, 17 Dec 2015 11:49:51 +0000 (11:49 +0000)]
arm: DT autogeneration - autogenerate RealView Platform devices

Implements the Device Tree generating code for devices required by the
RealView VExpress_GEM5_V1 platform

Change-Id: I14244b2f3c028cbddba3c23ce7433fe3b301a0e8
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5965
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarm: DT autogeneration - Generate memory node
Glenn Bergmans [Fri, 22 Jan 2016 15:25:40 +0000 (15:25 +0000)]
arm: DT autogeneration - Generate memory node

Implements a high level method for generating a Device Tree node for
an AbstractMemory object.

Change-Id: I544ec642f182f103df26de535fdfaf03b3787a08
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5964
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarm: DT autogeneration - Generate cpus node
Glenn Bergmans [Fri, 22 Jan 2016 15:23:03 +0000 (15:23 +0000)]
arm: DT autogeneration - Generate cpus node

Equips cpu models with a method to generate the cpu node.

Note: even though official documentation requires that CPU ids start
counting from 0 in every cluster, GEM5 requires a globally unique cpu_id.

Change-Id: Ida3e17af3124a68ef7dbf2449cd034dfc3ec39df
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5963
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarm: DT autogeneration - Device Tree generation methods
Glenn Bergmans [Wed, 16 Dec 2015 15:43:42 +0000 (15:43 +0000)]
arm: DT autogeneration - Device Tree generation methods

This patch adds an extra layer to the pyfdt library such that usage
gets easier and device tree nodes can be specified in less code,
without limiting original usage. Note to not import both the pyfdt
and fdthelper in the same namespace (but generally fdthelper is all
you need, because it supplies the same classes even when they are not
extended in any way)

Also, this patch lays out the primary functionality for generating a
device tree, where every SimObject gets an empty generateDeviceTree
method and ArmSystems loop over their children in an effort to merge
all the nodes. Devices are implemented in other patches.

Change-Id: I4d0a0666827287fe42e18447f19acab4dc80cc49
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5962
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoext: DT autogeneration - Add PyFtd to m5 space
Glenn Bergmans [Wed, 16 Dec 2015 15:43:42 +0000 (15:43 +0000)]
ext: DT autogeneration - Add PyFtd to m5 space

This patch adds pyfdt.py to the m5.ext module. This is used in
succeeding patches for generating and editing dtb files and flat
device trees for DT autogeneration.

The file is in the m5_root/src/python/m5/ext directory, as opposed to
the m5_root/ext, because this library is part of the m5 object space
and linking to the m5_root/ext directory from the SConscript file
in src/python can not be done reliably. Linking from the root level
SConscript is also not an option, because it doesn't have the PySource
method defined.

Cloned from: https://github.com/superna9999/pyfdt
Commit: accbcd254584c9295a18878d32999d0c7c156f8e
Version: 0.3

Change-Id: I928bdc912a9507d1f8a3290acf445c7cae496552
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5961
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarm: make Arm GenericTimer a ClockedObject
Curtis Dunham [Thu, 7 Sep 2017 21:13:54 +0000 (16:13 -0500)]
arm: make Arm GenericTimer a ClockedObject

Within a device tree, the GenericTimer device needs to point (via phandle)
to a clock domain which is itself also an object in the device tree. Within
gem5, clock domains are managed by making all clocked SimObjects inherit
from ClockedObject rather than SimObject.

Without this change, the GenericTimer is unable to generate the appropriate
clock domain phandle, and will crash during DTB autogeneration.

Change-Id: I6d3fb6362847c6a01720b2f14b3d595d1e59f01f
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/4960
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agobase: Add an "override" to name() in the HardBreakpoint class.
Gabe Black [Sat, 27 Jan 2018 11:18:15 +0000 (03:18 -0800)]
base: Add an "override" to name() in the HardBreakpoint class.

clang reports an error otherwise and fails to compile.

Change-Id: I3603d6c710641f1289e35c67f89a49f5cb71e95e
Reviewed-on: https://gem5-review.googlesource.com/7582
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agobase: Get bitunions to compile on clang 3.8.
Gabe Black [Sat, 27 Jan 2018 11:15:13 +0000 (03:15 -0800)]
base: Get bitunions to compile on clang 3.8.

clang was getting very upset and interpretting a member function
pointer as a call to the actual underlying function, and then
complaining that it was a non-static function call without an instance.

It seems what it was really upset about was that the class who's scope
the member function pointer belonged to (the current class) wasn't done
being defined. This *should* be ok as far as I can tell, but clang was
having none of it.

This change reworks how the type of the setter function arguments are
determined to work around that limitation. The bitunion test was run
with clang++ and g++ and both pass, and I've built gem5.opt for ARM
successfully.

Change-Id: Ib9351784a897af4867fe08045577e0247334ea11
Reviewed-on: https://gem5-review.googlesource.com/7581
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoutil: Implement Lua module for m5ops.
Hanhwi Jang [Sat, 9 Dec 2017 17:02:34 +0000 (02:02 +0900)]
util: Implement Lua module for m5ops.

This module allows m5ops to be executed in Lua programs.
To compile it (in util/m5):
    The following command generates Lua moduel, gem5OpLua.so.

    make -f Makefile.<arch> gem5OpLua.so

To use it:
    First, put gem5OpLua.so in Lua library search path.
    Then, import the module and execute the m5op function.

Example usage, creating a checkpoint.

    m5 = require("gem5OpLua")
    m5.do_checkpoint(0, 0)

Change-Id: Icc18a1fb6c050afeb1cf4558fbdc724fb26a90e2
Reviewed-on: https://gem5-review.googlesource.com/6541
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarch-x86: Adding clflush, clflushopt, clwb instructions
Swapnil Haria [Tue, 16 Jan 2018 03:49:17 +0000 (21:49 -0600)]
arch-x86: Adding clflush, clflushopt, clwb instructions

This patch adds support for cache flushing instructions in x86.
It piggybacks on support for similar instructions in arm ISA
added by Nikos Nikoleris. I have tested each instruction using
microbenchmarks.

Change-Id: I72b6b8dc30c236a21eff7958fa231f0663532d7d
Reviewed-on: https://gem5-review.googlesource.com/7401
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoarch: Remove the "arch/tlb.hh" switching header.
Gabe Black [Tue, 9 Jan 2018 07:44:40 +0000 (23:44 -0800)]
arch: Remove the "arch/tlb.hh" switching header.

This header is no longer used.

Change-Id: I8da7f8618d647dd11c581818c13855c4e20d32d2
Reviewed-on: https://gem5-review.googlesource.com/7351
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agotarch, mem: Abstract the data stored in the SE page tables.
Gabe Black [Tue, 9 Jan 2018 07:37:57 +0000 (23:37 -0800)]
tarch, mem: Abstract the data stored in the SE page tables.

Rather than store the actual TLB entry that corresponds to a mapping,
we can just store some abstracted information (address, a few flags)
and then let the caller turn that into the appropriate entry. There
could potentially be some small amount of overhead from creating
entries vs. storing them and just installing them, but it's likely
pretty minimal since that only happens on a TLB miss (ideally rare),
and, if it is problematic, there could be some preallocated TLB
entries which are just minimally filled in as necessary.

This has the nice effect of finally making the page tables ISA
agnostic.

Change-Id: I11e630f60682f0a0029b0683eb8ff0135fbd4317
Reviewed-on: https://gem5-review.googlesource.com/7350
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agox86, mem: Rewrite the multilevel page table class.
Gabe Black [Mon, 8 Jan 2018 12:41:25 +0000 (04:41 -0800)]
x86, mem: Rewrite the multilevel page table class.

The new version extracts all the x86 specific aspects of the class,
and builds the interface around a variable collection of template
arguments which are classes that represent the different levels of the
page table. The multilevel page table class is now much more ISA
independent.

Change-Id: Id42e168a78d0e70f80ab2438480cb6e00a3aa636
Reviewed-on: https://gem5-review.googlesource.com/7347
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoutil: Implement PIC version of m5ops for X86.
Hanhwi Jang [Wed, 10 Jan 2018 02:39:38 +0000 (11:39 +0900)]
util: Implement PIC version of m5ops for X86.

Using m5ops for X86 in shared objects requires PIC for the m5ops.
Typically, the PIC version is used to make m5op interfaces to other
languages like python and lua.

Change-Id: I2463904c13ea8b839d0386d3c743d8dad1e1e6bc
Reviewed-on: https://gem5-review.googlesource.com/7261
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agox86, mem: Don't try to force physical addresses on the system.
Gabe Black [Mon, 8 Jan 2018 05:32:39 +0000 (21:32 -0800)]
x86, mem: Don't try to force physical addresses on the system.

Use the system object to allocate physical memory instead of manually
placing certain structures and then forcing the system to start other
allocations after them in physical memory.

Change-Id: Ie18c81645c3b648c64a6d7a649a0e50f7028f344
Reviewed-on: https://gem5-review.googlesource.com/7346
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
6 years agox86, mem: Get rid of PageTableOps::getBasePtr.
Gabe Black [Sat, 6 Jan 2018 07:52:29 +0000 (23:52 -0800)]
x86, mem: Get rid of PageTableOps::getBasePtr.

Pass this constant into the page table constructor.

Change-Id: Icbf730f18d9dfcfebd10a196f7f799514728b0fb
Reviewed-on: https://gem5-review.googlesource.com/7345
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
6 years agox86, mem: Pass the multi level page table layout in as a parameter.
Gabe Black [Sat, 6 Jan 2018 01:48:40 +0000 (17:48 -0800)]
x86, mem: Pass the multi level page table layout in as a parameter.

Don't get it from a global constant declared in an ISA header file.

Change-Id: Ie19440abdd76500a5e12e6791e6f755ad9e95af3
Reviewed-on: https://gem5-review.googlesource.com/7344
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Alexandru Duțu <alexandru.dutu@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
6 years agoarch, mem: Make the page table lookup function return a pointer.
Gabe Black [Fri, 5 Jan 2018 23:01:00 +0000 (15:01 -0800)]
arch, mem: Make the page table lookup function return a pointer.

This avoids having a copy in the lookup function itself, and the
declaration of a lot of temporary TLB entry pointers in callers. The
gpu TLB seems to have had the most dependence on the original signature
of the lookup function, partially because it was relying on a somewhat
unsafe copy to a TLB entry using a base class pointer type.

Change-Id: I8b1cf494468163deee000002d243541657faf57f
Reviewed-on: https://gem5-review.googlesource.com/7343
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agobase: Hide the BitUnion::__StorageType type.
Gabe Black [Mon, 8 Jan 2018 03:56:25 +0000 (19:56 -0800)]
base: Hide the BitUnion::__StorageType type.

Since this type is now accessible through a clean interface, hide it
from anybody that tries to peak around the curtain.

Change-Id: I1257b6675a45b8648be459ad8e8d0f27a6feee6b
Reviewed-on: https://gem5-review.googlesource.com/7205
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoarm, base: Generalize and move the BitUnion hash struct.
Gabe Black [Mon, 8 Jan 2018 03:44:55 +0000 (19:44 -0800)]
arm, base: Generalize and move the BitUnion hash struct.

The ARM types.hh file defined an STL style hash structure to operate
on the ExtMachInst, but it referred to the underlying storage type
using internal typedefs in the BitUnion types. To avoid having to do
that, this change adds a hash structure to bitunion.hh which will work
on any BitUnion, and gets rid of the ARM ExtMachInst version.

Change-Id: I7c1c84d61b59061fec98abaaeab6becd06537dee
Reviewed-on: https://gem5-review.googlesource.com/7204
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosim: Use the new BitUnion templates in serialize.hh.
Gabe Black [Mon, 8 Jan 2018 03:35:40 +0000 (19:35 -0800)]
sim: Use the new BitUnion templates in serialize.hh.

serialize.hh should not reference internal implementation details in
the underlying BitUnion types.

Change-Id: I1ce29243db63801b7788f037fdc54811bdab889c
Reviewed-on: https://gem5-review.googlesource.com/7203
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
6 years agobase: Enable specializing templates on BitUnion types.
Gabe Black [Mon, 8 Jan 2018 02:38:04 +0000 (18:38 -0800)]
base: Enable specializing templates on BitUnion types.

Previously these relied on reaching into private internal definitions
in the BitUnion types.

Change-Id: Ia6c94de92986b85ec9e5fcb197459d450111fb36
Reviewed-on: https://gem5-review.googlesource.com/7202
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agobase: Rework bitunions so they can be more flexible.
Gabe Black [Sat, 6 Jan 2018 13:30:46 +0000 (05:30 -0800)]
base: Rework bitunions so they can be more flexible.

They are now oriented around a class which makes it easy to provide
custom setter/getter functions which let you set or read bits in an
arbitrary way.

Future additions may add the ability to add custom bitfield methods,
and index-able bitfields.

Change-Id: Ibd6d4d9e49107490f6dad30a4379a8c93bda9333
Reviewed-on: https://gem5-review.googlesource.com/7201
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>