Commit Graph

14964 Commits

Author SHA1 Message Date
Gabe Black
7ca61b7ddf mips: Convert MIPS specific syscalls to Guest ABI.
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: I7e7c49e885a8c3395f2e6ca361c228bce3691dbe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23205
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-12 01:35:34 +00:00
Gabe Black
11fc132669 power: Convert POWER specific syscalls to Guest ABI.
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: Icdf41a0e2bf910813250249eff7a9f1b54c60b22
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23204
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-12 01:35:34 +00:00
Gabe Black
19c9ccf6e6 sparc: Convert SPARC specific syscalls to Guest ABI.
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: I144fc3fb0e408380294ea91fefa881494f44098b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23203
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-12 00:43:28 +00:00
Gabe Black
33593d77f9 riscv: Convert RISCV specific syscalls to Guest ABI.
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: I1a7041ba890f5f69d5506583c658ae6a777b5daf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23202
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-12 00:43:28 +00:00
Gabe Black
afa6ba0660 x86: Convert x86 specific syscalls to GuestABI.
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: I2ad9c0ac72eb875f30ece27d58549244de84e191
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23201
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-12 00:43:28 +00:00
Gabe Black
82d57d9b0b arm: Convert ARM specific syscalls to GuestABI.
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: I1055b72f34ea9e0bcce465492bd45b6fb0c36eef
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23200
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-12 00:43:28 +00:00
Gabe Black
eb4a5c15ce sim: Remove ISA specific KVM handling of the return from clone.
When the new thread context ctc is created, it should have a copy of
all the state in the original tc, including the original PC. This code
used to specially handle the KVM case by explicitly making this new
context return from the system call immediately by jumping right to
RCX which (assuming a particular instruction was used) is where user
mode should resume.

The first problem with this approach as far as I can tell is that the
CPU will still be in CPL0, ie supervisor mode, and will not have been
forced back into CPL3, ie user mode. This may not have any immediately
visible effect, but may down the line.

Second, this seems unnecessary. The non-special case code will advance
the PC beyond the instruction which triggered the system call. Then
once the new thread starts executing again, it will execute sysret and
return to rcx naturally, just like the original thread will.

The only observed difference is that when executing a gem5 instruction,
the IP is set to the currently executing instruction, and so to avoid
the new context from re-executing the system call, the PC needs to be
advanced. When calling in from KVM, the instruction has already been
"completed", and so the IP should *not* be advanced.

Also note that when reading the PCState object in KVM, it doesn't
figure out where the next instruction is and so NPC is just one
ExtMachInst sized blob later on. Advancing the PC will just move to
an address 8 bytes later, which is very unlikely to be what you want.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: I0d97f66e64ce39b13d6700dcf3d7da88d6fe0048
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23199
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-12 00:43:28 +00:00
Gabe Black
ca867678a6 arch,sim: Convert clone to GuestABI and define a cloneBackwardsFunc.
cloneBackwardsFunc takes its arguments in the order specified for
ARM and RISCV. Because of the new GuestABI mechanism, it can be a
simple wrapper around the normal clone implementation without the need
for #ifdefs.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: Iff1ffd6774b9162185a124585e9507a5bdbc46f4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23198
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-12 00:43:28 +00:00
Gabe Black
382dda67dc sim: Use variadic GuestABI arguments in a few additional syscalls.
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: Ib2f193e7409859469c853e11f121eba82b3c0ddc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23196
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-12 00:43:28 +00:00
Gabe Black
6fbf2e7b6e power: Implement translateFunctional.
Change-Id: I039a09879a50a7d50329c01c337cfa5674c34fae
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26549
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
2020-03-11 21:35:41 +00:00
Gabe Black
ca83295b6f mips: Implement translateFunctional.
Change-Id: I32df1b3b12a0adee4457b78c735936c4c73da048
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26548
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
2020-03-11 21:35:41 +00:00
Gabe Black
73fdc2eb57 config,arch,cpu,kern,sim: Extract kernel information from System.
Information about what kernel to load and how to load it was built
into the System object and its subclasses. That overloaded the System
object and made it responsible for too many things, and also was
somewhat awkward when working with SE mode which doesn't have a kernel.

This change extracts the kernel and information related to it from the
System object and puts into into a OsKernel or Workload object.
Currently the idea of a "Workload" to run and a kernel are a bit
muddled, an unfortunate carry-over from the original code. It's also an
implication of trying not to make too sweeping of a change, and to
minimize the number of times configs need to change, ie avoiding
creating a "kernel" parameter which would shortly thereafter be
renamed to "workload".

In future changes, the ideas of a kernel and a workload will be
disentangled, and workloads will be expanded to include emulated
operating systems which shephard and contain Process-es for syscall
emulation.

This change was originally split into pieces to make reviewing it
easier. Those reviews are here:

https: //gem5-review.googlesource.com/c/public/gem5/+/22243
https: //gem5-review.googlesource.com/c/public/gem5/+/24144
https: //gem5-review.googlesource.com/c/public/gem5/+/24145
https: //gem5-review.googlesource.com/c/public/gem5/+/24146
https: //gem5-review.googlesource.com/c/public/gem5/+/24147
https: //gem5-review.googlesource.com/c/public/gem5/+/24286

Change-Id: Ia3d863db276a023b6a2c7ee7a656d8142ff75589
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26466
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-11 15:57:14 +00:00
Andriani Mappoura
ba78eaf876 arch-arm: Correct the Ids and names of the PMU events
0x0C is the PC_WRITE_RETIRED event and 0x21 is the RetiredBranches.

Change-Id: I5f1173ff06f67b6a46e8a914c8acb9639edf67ec
Signed-off-by: Andriani Mappoura <andriani.mappoura@arm.com>
Reviewed-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/+/26485
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-11 10:54:24 +00:00
Giacomo Travaglini
077bc85196 arch-arm: Remove unnecessary RegIndex set for VSTR VFP inst
vd index is already set at the beginning of the
decodeExtensionRegLoadStore function.

Change-Id: Ic8cea43cf3a60881823195ef6da0bbda6940f1cf
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/+/23950
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
2020-03-10 16:44:26 +00:00
Adrian Herrera
6e06d231ec arch-arm: GenericTimer arch regs, perms/trapping
This patch enhances the Generic Timer architected registers handling:

- Reordering of miscregs for easier switch/case ranges
- Implement _EL12 reg versions for E2H environments
- AArch32/64 EL0/EL1/EL2 arch compliant trapping for all registers
    + Rely on CNTKCTL and CNTHCTL access controls
- UNDEFINED behaviour from EL0(NS)
- EL1(S) timer traps to EL3 when SCR.ST == 0

Change-Id: I4f018e103cf8f7323060516121838f90278b1c3e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25307
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-10 13:53:13 +00:00
Adrian Herrera
81fc073768 dev-arm: Refactor GenericTimer
The GenericTimer specification includes a global component for
a universal view of time: the System Counter.

If both per-PE architected and memory-mapped timers are instantiated
in a system, they must both share the same counter. SystemCounter is
promoted to be an independent SimObject, which is now shared by
implementations.

The SystemCounter may be controlled/accessed through the memory-mapped
counter module in the system level implementation. This provides
control (CNTControlBase) and status (CNTReadBase) register frames. The
counter module is now implemented as part of GenericTimerMem.

Frequency changes occur through writes to an active CNTFID or to
CNTCR.EN as per the architecture. Low-high and high-low transitions are
delayed until suitable thresholds, where the counter value is a divisor
of the increment given the new frequency.
Due to changes in frequency, timers need to be notifies to be
rescheduled their counter limit events based on CompareValue/TimerValue.
A new SystemCounterListener interface is provided to achieve
correctness.

CNTFRQ is no longer able to modify the global frequency. PEs may
use this to modify their register view of the former, but they should
not affect the global value. These two should be consistent.

With frequency changes, counter value needs to be stored to track
contributions from different frequency epochs. This is now handled
on epoch change, counter disable and register access.

References to all GenericTimer model components are now provided as
part of the documentation.

VExpress_GEM5_Base is updated with the new model configuration.

Change-Id: I9a991836cacd84a5bc09e5d5275191fcae9ed84b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25306
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-10 13:53:13 +00:00
Giacomo Travaglini
1fef1491e2 arch-arm: Hint the compiler to inline getArmSystem
By defining it in the header we are hinting the compiler to inline
the method

Change-Id: I132964bf8b8c0b5d5eb28868f15723177d049d38
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26323
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
2020-03-10 11:24:13 +00:00
Giacomo Travaglini
ea33d438a2 arch-arm: Speedup ARM execution by avoiding expensive RTTI check
getArmSystem is the building block for a lot of ArmSystem getters
a client can use to check for a specific feature.
This method is called very often during simulation and it is basically
casting a System pointer into an ArmSystem pointer.
To do so, it is using dynamic casting to check if the system is really
an ArmSystem. This is very expensive and usually not needed.

The only chance arm code would use a non ArmSystem is when in SE mode.
But if that's the case, we can just replace the assertion with a

assert(FullSystem).

Testing Linux boot with this patch provides a speedup of nearly 2x!
(atomic mode).

This is partially related to:

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

Since the PAuth patch changed the purifyTagged helper (on the critical
path of simulation) to rely more heavilly on getArmSystem (via
ArmSystem:: static methods)

Change-Id: Idbf079548ffe03513b4fc58c76f0d69613952a50
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/+/25964
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-10 11:24:13 +00:00
Giacomo Travaglini
41df2f8b26 arch-arm: python3 "/" will always produce a float
"/" was ambiguous in python2 and was producing a floor (integer)
division if the operands were int or long.
In python3 "/" will always produce a float which makes it unsuitable
in cases where an integer is expected

PEP238: https://www.python.org/dev/peps/pep-0238/

Change-Id: I481cf1e9c0f95a6f47ecf6539eee0c9bcaf31e17
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26247
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-10 09:35:56 +00:00
Giacomo Travaglini
656b18a414 misc: Replace basestring with six.string_types
Change-Id: I914adb545fe82efed386085d2f191ec54efccbf3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26246
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-10 09:35:56 +00:00
Giacomo Travaglini
3c1f87c81c misc: Replace __metaclass__ with six.add_metaclass
Change-Id: I45f73b71266c1edf9c4ec521d58db779b16bd591
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26245
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-10 09:35:56 +00:00
Giacomo Travaglini
4e7fe439d7 misc: string.join has been removed in python3
In general string methods are deprecated in favour of str ones

Change-Id: Ifba04e0b70be29e5a82a67cf11837f740de57e32
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26244
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-10 09:35:56 +00:00
Giacomo Travaglini
735267e111 python: The new module has been removed in python3
new.instance was used to instantiate a method bypassing the __init__
interface This patch is doing things properly by importing the LRTable
so that the LRParser interface is respected

Change-Id: I0b0ce184ef5ac297af40289a2896962c9a967a71
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26243
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-10 09:35:56 +00:00
Andreas Sandberg
5d70afd3a9 python: Make meta class declarations Python 3 safe
Python 2.x and Python 3 use different meta class syntax. Fix this by
implementing meta classes using the add_metaclass decorator in the six
Python library.

Due to the way meta classes are implemented in six,
MetaParamValue.__new__ seems to be called twice for some classes. This
triggers an assertion which when param that checks that Param types
have only been registered once. I have turned this assertion into a
warning.

The assertion was triggered in params.CheckedInt and params.Enum. It
seems like the cause of the issue is that these classes have their own
meta classes (CheckedIntType and MetaEnum) that inherit from
MetaParamValue and a base class (ParamValue) that also inherits from
MetaParamValue.

Change-Id: I5dea08bf0558cfca57897a124cb131c78114e59e
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26083
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
2020-03-10 09:35:56 +00:00
Gabe Black
ee9a360c60 mem: Change some default values in the Request class.
These values are more abnormal than the 0s they replace, and so it
would be more obvious when something is accidentally left
uninitialized.

Change-Id: Ie7f14abe9e22f9df1ff238f29d4a783c890f4a20
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26237
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
2020-03-10 01:10:44 +00:00
Gabe Black
b11b2e0b37 arch: Remove the "process.hh" switching header file.
This file is not included anywhere in gem5.

Change-Id: I936ac482b9b1d527f141267d0dfb86dda3de34df
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26235
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
2020-03-10 01:07:21 +00:00
Daniel R. Carvalho
61cfc6d4ce configs: Fix relative import in non-package in configs
Fix "ValueError: Attempted relative import in non-package"

Python "compilation" fails when running, among other configs:
    ./build/X86/gem5.fast ./configs/example/ruby_random_test.py

The files in the configs/folder_name folder that are not named
"folder_name.py" are not packages, and thus Python does not allow
relative imports in them.

This fixes the bug reported in
    https://gem5.atlassian.net/projects/GEM5/issues/GEM5-188

Change-Id: Ic8befc30e4cff1d6e8d2f5db1b7f9b89b0fc1395
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24163
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-09 22:28:00 +00:00
Gabe Black
10833b50fe base,cpu,sim: Stop including arch/vtophys.hh when not using vtophys.
These #includes are leftovers from when vtophys was used much more
prevalently in the simulator.

Change-Id: Ib2e947bc95f1e21acc9eff8e856f38b31d3fd933
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26225
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-09 21:31:50 +00:00
Gabe Black
4d5e1bf6a1 arch,cpu: Get rid of unused/unimplemented vtophys variants.
The version of vtophys which didn't take a ThreadContext had only been
implemented on Alpha which has since been removed, so this version of
the function was completely unimplemented and never used.

This change also gets rid of the dbg_vtophys which was sometimes
implemented but also never used, and takes the opportunity to fix up
some style problems in some of the vtophys arch files.

Change-Id: Ie10f881f8ce08c7188e71805357cf3264be4c81a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26224
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-09 21:31:50 +00:00
Gabe Black
ac275f96ec sparc: Implement translateFunctional in the TLB class.
This is a slightly munged version of vtophys, but which returns faults
like the normal translate functions if the address is malformed. It
attempts to return an approximately correct fault if the translation
isn't found, but since SPARC doesn't have hardware managed TLBs that
has to be an approximation.

translateFunctional also ignores permissions type checks (unless
they're built into the "lookup" method?) in line with vtophys type
semantics. The idea is that translateFunctional is used in conjunction
with functional accesses, and those are intended to reach beyond
normal barriers/boundaries to give unfettered access to the system for
debugging or setup purposes.

Change-Id: I000d9c31877b82043489792de037e7d664914fa9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26404
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-09 21:31:50 +00:00
Gabe Black
63c05c0717 base: Clean up condcodes.hh slightly.
Correct some minor style issues, make the functions static, and use the
single bit version of bits.

Change-Id: I4708961745a33caabecfbb06f8113ce8980e399e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26424
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-09 00:48:08 +00:00
Gabe Black
a17d8e5f2d sparc: Delete some commented out code in the TLB.
Change-Id: I80c455403422ec35bafa1f3ed86628f8327d1da0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26403
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
2020-03-08 15:37:20 +00:00
Gabe Black
4dd00b0153 arch,cpu,gpu-compute,mem: Remove asid from Request objects.
This is passed around a lot and set all over the place (usually to 0),
but it's never actually used for anything.

Change-Id: I38ca08387beabeaf9e339b4915ec7eba9e19eecb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26232
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
2020-03-07 00:40:41 +00:00
Gabe Black
86d32c4969 mem: Merge the virtual Request constructors.
The only difference was whether the the atomic op functor was accepted
as an argument. If it wasn't, setVirt would be called without an op
functor argument where it will default to nullptr.

This change deletes the constructor which doesn't take an atomic op
functor and in the other defaults the functor to nullptr. Functionally
nothing changes, but the code is now simpler.

Change-Id: Iff06543b1046594df297344e16961ee9d0f0a373
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26231
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
2020-03-07 00:40:41 +00:00
Gabe Black
935a0009b2 mem: Get rid of one more unused Request constructor.
Also collapse setPhys, which is private, into the only caller which is
the Request constructor which takes a physical address.

Change-Id: I872c489cd168d7c364a57e26efce2350a3632c82
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26230
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
2020-03-07 00:40:41 +00:00
Gabe Black
fe43e640be mem: Get rid of another unused Request constructor.
This one took an explicit "time" value instead of using curTick().

Change-Id: I935ba1dfc194dcf156d7defedb6ce540db461ce4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26228
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
2020-03-07 00:40:41 +00:00
Gabe Black
526b3c0485 mem: Add default initializers to the fields in Request.
This avoids having to have bunches of uninteresting initializers in the
Request constructors, and accidentally forgetting to initialize any of
them.

Change-Id: If7a91fdf4aa6cd774f6f53474f55034ed6eda5f0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26227
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
2020-03-07 00:40:41 +00:00
Gabe Black
b383997d4a base: Disable a warning in hdf5.cc which comes from an external header.
This warning comes from an external header which we don't have the
ability to fix directly. We can disable it in hdf5.cc specifically
which should keep things building without defeating the warning in
cases where we could fix it.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-365

Change-Id: Ie1f4d91340e68cee7514beab9d03bba1d1c9bb38
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26325
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-06 21:03:28 +00:00
Gabe Black
f4cf31f5e1 base: Optimize and otherwise fix a couple of functions in intmath.hh.
As described in the Jira issue, this replaces the implementation of
isPowerOf2() and power(). It also revamps floorLog2 so that there only
needs to be one implementation and no assumptions about how big certain
types are.

The way power() used to work was to raise a number n to an exponent e
by multiplying n times itself e times. As a warning in this function
explains, this can be quite slow for large e. A much more efficient
way to raise a number to an exponent is to square n over and over, and
to multiply in the current square if that bit of e is set.

n ^ 15 = (n^1) * (n^2) * (n^4) * (n^8)
n^8 = (n^4)^2
n^4 = (n^2)^2
n^2 = n^2
n^1 = n

So that takes 6 multiplications, n^2, (n^2)^2, (n^4)^2, and then each
multipy to compute the final result, instead of 14.

The difference is more pronounced for larger exponents, although you'd
quickly start to overflow a uint64_t.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-140

Change-Id: I0ae05aeba1b5882d2a616613b1679e6206b4cbfe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26164
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-05 23:42:44 +00:00
Gabe Black
8dc904cb93 mem: Get rid of an unused Request constructor.
This constructor took a physical address and a PC. After deleting it
all ISAs still compile.

Change-Id: I25f404f80ce7e995688165dc86ac8899da7aa919
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26226
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
2020-03-05 08:05:24 +00:00
Gabe Black
cd59a9afeb cpu: Switch away from some fringe Request constructors.
These are only used in these two files, one each, and pass one dummy
argument with a default value and one extra argument with an actual
value compared to the more common constructors.

Instead, switch to constructors without those two arguments and set the
one extra value explicitly after construction.

The constructor will likely be inlined, and merged with this additional
assignment.

Change-Id: I75ca539d5ca95b57b4f4322ffa050af2031544dd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26229
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
2020-03-05 08:05:24 +00:00
Gabe Black
7b48b38a92 mem: Remove the version of the FS translating port proxy with no tc.
This version is not used and is the only remaining consumer of the
vtophys variant with no ThreadContext.

Change-Id: I8cb870b841fe064cee121e4930cb163d2ec7628f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26223
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-05 02:59:34 +00:00
Giacomo Travaglini
b06142ec5f arch-arm: Remove unused getArmSystem helper
Change-Id: Ifbb1619fa1cfd6c6cda5c390889c423dbe62dc7e
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/+/25963
Reviewed-by: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-04 15:05:42 +00:00
Timothy Hayes
2e5d0198d6 mem-ruby: Minor Ruby Prefetcher fixes
Minor fixes to the Ruby stride prefetcher. This includes removing unused
statistics and changing where/when some statistics are updated.

Change-Id: If758bf009f53fad277cb3cd754d57a0b10737599
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24363
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-04 10:30:13 +00:00
Gabe Black
de24aafc16 x86: Track message based interrupt cleanup functions in sender state.
This makes sure the completion function follows the packet, and allows
multiple packets to be in flight at once without the functions
overwritting each other.

Change-Id: Ic49c7b646d56b32c0453931942ee22ae07828bb6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26163
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Ayaz Akram <yazakram@ucdavis.edu>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-04 09:10:38 +00:00
Gabe Black
ebd62eff3c arch,cpu,mem: Replace the mmmapped IPR mechanism with local accesses.
The new local access mechanism installs a callback in the request which
implements what the mmapped IPR was doing. That avoids having to have
stubs in ISAs that don't have mmapped IPRs, avoids having to encode
what to do to communicate from the TLB and the mmapped IPR functions,
and gets rid of another global ISA interface function and header files.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: I772c2ae2ca3830a4486919ce9804560c0f2d596a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23188
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-04 04:09:19 +00:00
Gabe Black
082ec1a9c7 ext: Disable the unused-value warning in clang for pybind.
pybind internally uses a construct which initializes an array of bools
as a way to run a function on each member of a parameter pack. It then
discards the array since it was just trying to run the function. This
triggers a warning in clang 11 called unused-value which breaks the
build.

This change adds some pragmas to the pybind11.h header which disable
that warning while in pybind11 which is less intrusive than trying to
fix the false positive warning, and better than disabling the warning
universally. Since g++ and clang++ will complain if they see this
pragma guarded by the other's name, these pragmas are also surrounded
by ifdefs which should make them only visible to clang.

Change-Id: Ie9b5c65e8cadc8b96fbc1bd7971bed4a61c4340d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25228
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2020-03-04 03:26:41 +00:00
Bobby R. Bruce
8cf9c5260c tests,misc: Created presubmit.yaml Google Cloud Build files
This will replicate kokoro on Google Cloud services. At present, this
can be run via execution of `gcloud builds submit--config
cloudbuild_presubmit.yaml`.

Jira: https://gem5.atlassian.net/browse/GEM5-271
Change-Id: I5a71ef7fdbe5546b4e6970e4f4641f9e14cc640b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24543
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-03 16:50:09 +00:00
Giacomo Travaglini
51ffa48620 tests: simple_ruby_test's valid_host is X86 only
This is because the binary is dynamically linked thus it can run
on a x86 host only.

Change-Id: I7391414fdcd8f861f62e54c4d681e29360eb7443
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26103
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
2020-03-03 09:47:52 +00:00
Yu-hsin Wang
e29d768226 python: Add a warning if pydot is not available.
Silently failing makes it hard to debug what happened. Add a warning.

Change-Id: Ia61b8de937bb254898726ad551fb5c894104d771
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26045
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-03-03 04:57:53 +00:00