Commit Graph

18450 Commits

Author SHA1 Message Date
Gabe Black
f7bfa30e77 misc: Use a PCStateBase unique_ptr in SkipFuncBase::process.
Change-Id: I0ffcf3abeaa7704a3b6eaccfd967a9654f59c741
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52046
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-11-23 07:45:29 +00:00
Gabe Black
ecd3cc85f0 arch,cpu: Use PCStateBase in StaticInst::branchTarget
Change-Id: I1b8a2ea088b52252601968b1b1083ed712a5bfd6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52045
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-11-23 07:45:29 +00:00
Gabe Black
9d48180e4a arch,cpu: Use PCStateBase in buildRetPC.
Change-Id: I9d9f5b25613440737b1d67134fcae09aa68baf8b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52044
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-11-23 07:45:29 +00:00
Gabe Black
5ad4cf0af1 arch,cpu,sim: Use PCStateBase in advancePC.
By using a PCStateBase pointer or reference, we can (mostly) avoid
having to know what the ISA specific PState class is, letting the ISA
specific instruction classes cast to the type they need internally.

There are a couple minor places where we need to do those casts outside
of ISA specific types, one in the generic NopStaticInstPtr class, and a
few in generic faults.

Right now, we'll just use the TheISA::PCState type in those isolated
spots (sometimes hidden by auto), and deal with it later, possibly
with a virtual "advance" method of some sort.

Change-Id: I774c67dc648a85556230f601e087211b3d5630a9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52043
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-11-23 07:45:29 +00:00
Gabe Black
cd772c1951 arch,cpu,sim: Use PCState * and & to trace and not TheISA::PCState.
Change-Id: Ia31919ef19f973aa7af973889366412f3999342a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52042
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-11-23 07:45:29 +00:00
Gabe Black
f784097f7a arch: Add a "set" function to set one PCState to another.
Most of the time, the type pointed to by a PCState pointer or reference
will be the same as all the others, if not nullptr.

This change adds a set of "set" functions which assume that the
underlying type of each pointer or reference are the same, and handles
casting, copying things over, creating a new copy, etc, for you. It uses
a new "update" virtual method on PCState subclasses which casts the
source to the same type as the destination and copies values over.

Note that the "set" function doesn't actually verify that the two types
are the same, just like the overloaded ==, != and << operators. In the
future, those checks can be added for debugging purposes, probably
guarded by a configuration variable which can be toggled on or off to
get better performance or more thorough error checking.

The main advantage of these wrappers are that they allows consistent
semantics whether your moving a value from a pointer, or from a yet
unconverted PCState subclass, or vice versa, which will be particularly
helpful while transitioning between using raw PCState instances and
using primarily pointers and references.

This change also adds wrappers which handle std::unique_ptr, which makes
it easier to use them as arguments to these functions. Otherwise, if the
std::unique_ptr is a temporary value, using the return value of .get()
will let the std::unique_ptr go out of scope, making it delete the data
pointed to by the returned pointed. By keeping the std::unique_ptr
around on the stack, that prevents it from going out of scope.

Change-Id: I2c737b08e0590a2c46e212a7b9efa543bdb81ad3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52041
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-11-23 07:45:29 +00:00
Gabe Black
3ecc9f8b66 arch: Add a newPCState method to the ISA class.
This method is the seed which creates a new PCState object of the
appropriate type. It can be used to initialize PCStateBase *s so that they
always point to something valid and can be manipulated without having to
first check if there's something there, as opposed to the alternative
where a pointer might be null until it's first pointed at something.

Change-Id: If06ee633846603acbfd2432f3d8bac6746a8b729
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52040
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-23 07:45:29 +00:00
Gabe Black
8de2e2ee77 arch: Virtualize printing a PCState.
Introduce a virtual output() method which prints the current PCState to
the given output stream, and define an overload for << to use that
method. This will make it possible to print a PCState without knowing
what the actual type is.

Change-Id: I663619b168c0b2b90c148b45ae16d77f03934e5b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52039
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
2021-11-23 07:45:29 +00:00
Gabe Black
e3a79d40f4 arch: Add a virtually backed PCState == operator.
Define a == operator and an equals() virtual method for the PCStateBase
class which it calls. The equals method will compare the owning PCState
instance with another instance of the same PCState class.

Change-Id: Ia704f1bc9e1217ce191671fe574c226ee1b73278
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52038
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Earl Ou <shunhsingou@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-11-23 07:45:29 +00:00
Bobby R. Bruce
8b496a1a12 stdlib: Fix enum comparison in 'requires'
Change-Id: Iff8e6edcbb553e8180c21c583d79b689f9a40bce
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53003
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-22 18:53:53 +00:00
Bobby R. Bruce
c9af404a8b tests: Removing unittests for .perf and .prof
.perf and .prof no longer exist as build targets. We now only test .opt
and .debug as of this commit.

Change-Id: Ieaf93edd33fe64330d50c6d446bfd21f9f07a895
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52983
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-22 18:53:45 +00:00
Giacomo Travaglini
8a9ea974ee configs: Replace master/slave terminology from configs scripts
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I6a1a06abeca1621efb378c400c5b24b33a7a3727
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52866
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-11-22 09:53:14 +00:00
Giacomo Travaglini
65c32dc491 configs: Replace master/slave terminology from ruby scripts
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: Iabc82a19e8d6c7cf619874dc2926276c349eba7c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52865
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-11-22 09:53:14 +00:00
Giacomo Travaglini
f1fc49ed13 learning_gem5: Replace master/slave terminology from learning_gem5 scripts
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I6c30d18155acb151d732ae7e35e29f6facad78fd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52864
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-11-22 09:53:14 +00:00
Giacomo Travaglini
34826f1892 tests: Replace master/slave terminology from tests scripts
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: Id7aafc082c7e4cfc977e807141e63a3feb5a6348
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52863
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
2021-11-22 09:53:14 +00:00
Yu-hsin Wang
3b5a960871 systemc: move tracefile registration into constructor
The TraceFile object needs to be registered into the scheduler for
triggering its trace function. For now only the TraceFile created by
sc_create_vcd_trace_file is registered automatically. This design is not
good for users to implement their own TraceFile class.

In addition, some libraries, ex Verilator, implement thier own trace file.
To bridge them into gem5, we also need the ability to create customized
TraceFile class.

Change-Id: I38fe510048655c6a2cd848a0a1263a66a1778eee
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52923
Reviewed-by: Earl Ou <shunhsingou@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-22 03:01:44 +00:00
huangjs
cdbeb07ffd mem: Targets per MSHR allocated should be always <= tgts_per_mshr
This modification indicates when tgts_per_mshr = 0 for particular level of Cache

Change-Id: Icc1ecffcd598a473bd26bc5115a5e0a7998fb527
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52783
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-22 01:31:02 +00:00
Bobby R. Bruce
2e05f69632 stdlib: Fix RISCVBoard when running O3 CPU with Ruby
The long/nightly tests were failing,
https://jenkins.gem5.org/job/nightly/47, due to a misconfiguration in
the RISCVBoard that caused a "fatal: Unable to find destination " error
when running the O3 CPU with a Ruby cache coherence protocol.

This patch resolves the issue by adding a "BadAddr" to handle bad
addresses occasionally produced by the O3 CPU.

Change-Id: I07fe06544e7588f45984032a022e73cd41d8a1e6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52963
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-19 07:34:57 +00:00
Gabe Black
e60fcfe004 cpu: Set up _*_ports values in BaseCPU in __init__.
This means that if ArchMMU came from the CPU class itself, subclasses
would have a chance to define their own version before the BaseCPU
method consumed it.

The intention is that Arch* *will* be defined in subclasses in later
changes, which will make this more important.

Change-Id: Ib20d5b10aeb26d33840cca4b5a1085d9c73f10de
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52489
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-18 17:08:34 +00:00
Gabe Black
3f5cab5a9d cpu: Remove an architecture check in addPrivateSplitL1Caches.
If there are iwc and dwc parameters, then they need to be hooked up. If
not, then they don't. There's no need to check the ISA as well.

Change-Id: I98cb831ab6d3f829ccab80e128105245e434a35c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52488
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-18 17:08:34 +00:00
Gabe Black
6dc5cfe34b cpu: Get rid of the BaseCPU UnifiedTLB parameter.
This parameter is not (and as far as I can tell has never been) used,
and is guarded with a check of TARGET_ISA.

Change-Id: I71f4894228391e2024dab20e1bf2618dcea4f421
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52487
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-18 17:08:34 +00:00
Gabe Black
97b8ca2ee4 sim: Remove some old transitional code in SEWorkload.
This code was just to catch cases where the SEWorkload init_compatible
function couldn't find a compatible SEWorkload subclass. Now that all of
these classes are set up with this mechanism, there's no need to keep
this code around.

Change-Id: Ie847f5a90ccf98eb58c149a22a6881529344946d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52107
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-18 17:08:34 +00:00
Gabe Black
bf5be72804 sim: Remove the byte_order parameter from System.
Instead, get the byte order from the workload. The workload has a better
idea what the byte order should be, for instance based on what software
it's loaded or how the hardware was configured, and this gets rid of a
use of TARGET_ISA which was setting a default endianness.

Change-Id: Ic5d8a6f69a664957c4f837e3799ff93397ccfc64
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52106
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2021-11-18 07:09:00 +00:00
Gabe Black
5e3226bed5 arch,sim: Add a byteOrder accessor to the Workload class.
The workload would have a better idea of what it's endianness is than
the system object that holds it. This is the first step towards getting
rid of the getByteOrder method on the system object, which currently
checks TARGET_ISA to determine what the default endianness should be.

If it makes sense for a Workload, it could determine the endianness
dynamically by, for instance, reading it out of a binary image before
putting it into memory.

This does assume that the workload has a consistent endianness
throughout which may not be true, but this is not a new assumption.

Also, mark the SEWorkload SimObject class as "abstract", since it isn't
useful until they get subclassed by some arch specific version.

Change-Id: I8d4ba8382f22236a81f9738cc3506cdb97bdbfb2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52104
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-18 07:09:00 +00:00
Gabe Black
8c4e854886 sim: Create a StubWorkload for System.workload to default to.
This way there will always be a workload object, even if nothing needs
to be set up. This default can also be used in low_power_sweep.py,
where the workload object was just a placeholder.

This will allow required functionality like determining endianness of a
system into the workload, rather than (for instance) in the more generic
System object. This also makes accessing less essential functionality
simpler, because we don't have to detect whether the workload is there,
and can just return default, placeholder values from the StubWorkload.

Change-Id: Idfc3e75c65318d75a3eae6a19944ae1f79a2d111
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52103
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-18 07:09:00 +00:00
Mahyar Samani
e3f472a912 cpu: Change GUPSGen::memSize to uint64_t
This change changes the type for GUPSGen::memSize to uint64_t.
Previously uint32_t was used that would overflow for memories
bigger than 4GB.

Change-Id: I45d992b166a0dee2322c03e40beef1eee73e1855
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52903
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-17 23:03:32 +00:00
Gabe Black
9df4025c23 arch: Promote the PC and microPC to the PCStateBase class.
Also move up the accessors for them. By putting the storage in the base
class, we can keep the accessors non-virtual and keep their overhead
low. Subclasses will be free to set those values to whatever they want
with no overhead, just as if they were natively part of that class.

Change-Id: I58e058def174e0bf591c0a9f050c23f61e9d8823
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52037
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-17 12:13:56 +00:00
Bobby R. Bruce
3aa8979210 stdlib: Call setup_memory_ranges() from the constructor
`setup_memory_ranges()`, now `_setup_memory_ranges()`, had to be called
by subclasses. Since `setup_memory_ranges() was always called at the top
of the `_setup_board()` function (or could be), this function is now
automatically called within the AbstractBoard's constructor prior to
`_setup_board` and `_connect_things`.

Change-Id: I6bf3231666b86059ffc484cfca44e45cfde52ea6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52883
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-16 18:52:13 +00:00
Bobby R. Bruce
c73e6e78a8 stdlib,tests: Fix boot_kvm_fork_run.py
The patch
https://gem5-review.googlesource.com/c/public/gem5/+/51949
changed the way in which kernel arguments were passed to the
'set_kernel_disk_workload' function. The 'kernel_args' parameter
overrides the kernel arguments, not amends them as before. This test
script was not updated to take into account this functionality, and, as
such, the test failed. This patch fixes this.

Change-Id: I737c59329acde3a064f933bc4d31e20cf6ca55ae
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52663
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-11-16 18:52:13 +00:00
Bobby R. Bruce
97565ecf6c stdlib: Fix component incorporation ordering
Running with KVM cores was not possible with the previous ordering. The
processor must be incorporated after the cache hierarchy when using a
KVM core. A more detailed account of this bug is noted here:
https://gem5.atlassian.net/browse/GEM5-1113

This patch only partially fixes the problem. Ideally the component
incorporation order should not cause problems.

Change-Id: I4bb69ffe7963ba3708458cff7f2b09e9e75830a7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52843
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-16 18:52:13 +00:00
Giacomo Travaglini
de7337a32a misc: Replace master/slave terminology from BaseCPU.py
In order to fix several regression failures [1] the master/slave
terminology in src/cpu/BaseCPU.py was reintroduced [2].

This patch is addressing the issue by providing 2 different
ways of connecting cpu ports:

*) connectBus: The method assumes an object with a bus interface is
passed as an argument, therefore it tries to bind cpu ports to the
bus.mem_side_ports and bus.cpu_side_ports

*) connectAllPorts: No assumption on the port owning device is made.
The method simply accepts ports as arguments which will be directly
connected to the peer cpu ports
This will be used for example by ruby Sequencers

[1]: https://gem5.atlassian.net/browse/GEM5-775
[2]: https://gem5-review.googlesource.com/c/public/gem5/+/34495

Change-Id: I715ab8471621d6e5eb36731d7eaefbedf9663a71
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52584
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2021-11-16 18:17:47 +00:00
Giacomo Travaglini
404077e8ff arch: Add vec_reg.test & vec_pred_reg.test unittests
Change-Id: Ieb85e0d35032585ead1e3b399f8eaf5dbc246d76
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44508
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-15 14:21:11 +00:00
Richard Cooper
378778fcb7 ext: Add extra defines to libelf to support Apple silicon.
The current version of libelf does not include a configuration
compatible with Apple silicon. This patch adds the required defines.

Change-Id: I9b7b9b1f711973159f31666d3fe480c2dc01a6b7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52723
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Austin Harris <mail@austin-harris.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-15 08:34:33 +00:00
Eduardo José Gómez Hernández
9979cdda37 arch-x86: Fix rcl implementation triggers "bits" assert
With some values of rotations and datasizes, is it possible to call
"bits" with first being smaller than seccond. To prevent it, rcl,
similar to other rotations had an if to check if the value to rotate
is bigger than 1, however, rcl was checking for 'shiftAmt' instead
of 'realShiftAmt'.

This was not detected before because:
 1 - The assert triggered in "bits" is from a recent commit
 2 - The result is correct.

Change-Id: I669f4e064e12b035538e5dd0cc61eb4546603512
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52803
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-13 09:05:28 +00:00
Gabe Black
5290ae8dbd scons: Make the perf and prof builds into options.
That makes it possible to add profiling options to debug or opt builds,
and not just the fast build which the perf/prof builds were implicitly
modeled after.

Change-Id: Id8502825146b01b4869e18d1239e32ebe3303d87
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51988
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
2021-11-12 21:43:40 +00:00
Giacomo Travaglini
93049b5143 testlib: Explicitly use python3 when running regressions
Change-Id: I7968bea5db15a25c97abb68333c04e3ff1ae78f9
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52743
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-12 08:59:39 +00:00
Yu-hsin Wang
2771572f76 arch-arm: gdb support Thumb ISA
BaseRemoteGDB only checks if the breakpoint size equals to MachInst size.
However, there are two kinds of instruction size in ARM. We should allow
the 16-bits breakpoint for Thumb ISA.

Change-Id: I79c0e1503092ecf233c719f2e354739edb8e6b25
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52624
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-12 01:17:59 +00:00
Yu-hsin Wang
13caaf4dcc arch-arm: add missing override for remote_gdb
Change-Id: Iecbf56d97784367e416f950658515343734f3bec
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52685
Reviewed-by: Earl Ou <shunhsingou@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-12 01:16:33 +00:00
Gabe Black
14b3fd396a fastmodel: Implement Iris::MMU::translateFunctional.
This new pure virtual method was not implemented, preventing the
automatic create() method from being generated, and causing a linking
error.

Change-Id: I5619da5216d5161cb5e227de627b02f395bea0e9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52705
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Earl Ou <shunhsingou@google.com>
2021-11-12 01:10:58 +00:00
Gabe Black
f7284c66b2 fastmodel: Fix params for the IrisTLB.
Add PARAMS(), and include the params header file.

This fixes the build when fast model is enabled.

Change-Id: If4babbade9bf896084060f3f3b3b620947d0c83a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52704
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Earl Ou <shunhsingou@google.com>
2021-11-12 01:10:58 +00:00
Gabe Black
2d11080e71 fastmodel: Delete the unused ArmFastModelBin.
Change-Id: I29fb6cdfac809fb0a3577470143714b1da2d4562
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52703
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Earl Ou <shunhsingou@google.com>
2021-11-12 01:10:58 +00:00
Bobby R. Bruce
bd6da8f88d tests: Fix riscv boot exit tests
Due to this change:
https://gem5-review.googlesource.com/c/public/gem5/+/52089
full RISCV boot tests were added, which makes the "tick_exit" parameter
optional (left to 'None' if simulating a full boot). However, the
simulation function was not updated to not pass the "tick_exit"
parameter if not set. This cause an error. This patch fixes this.

Change-Id: I9c62a6a46d9334a2e9fbad2221b42a1ff4843a54
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52644
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-11 16:06:53 +00:00
Bobby R. Bruce
b65b59d2d2 tests: Remove 'override-download' flag from insttest
This flag was previously passed to the 'simple_binary_run.py' to
override downloads. However, since this patch:
https://gem5-review.googlesource.com/c/public/gem5/+/52086
we no longer use the flag. It appears in this patch the insttest test
was not updated and, as such, this test failed:
https://jenkins.gem5.org/job/nightly/38/

This, in part, will fix the nightly build.

Change-Id: I4fb5ab175c73687304c04fe426f81519d23574a7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52643
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-11 16:06:53 +00:00
Yu-hsin Wang
76046ee3ce fastmodel: CortexR52 support gdb
We change several things to support basic gdb.

1. Correct the memory translation.
memory_getUsefulAddressTranslations returns an empty list. So there's no
memory translation in R52.

2. Implement FPSCR for gdb collecting status.

3. Correct the breakpoint memory space.

Change-Id: Icc824502faec5ac228003f0de7e9dbe26babe7ef
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52623
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Earl Ou <shunhsingou@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-11 01:32:16 +00:00
Giacomo Travaglini
1a72fc6c85 configs: Replace connectAllPorts with connectCachedPorts
Uncached ports are not used in Arm configs (X86 only [1])

[1]: https://github.com/gem5/gem5/blob/stable/src/cpu/BaseCPU.py#L181

Change-Id: I0f71f605ef73d9adc418414c891569bc475b2587
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52583
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-10 10:24:01 +00:00
Gabe Black
10e4d43345 cpu-o3: Manually flatten the index for vector reg elements.
There is a function for this purpose in RegId called flatIndex(), which
I had attempted to use with PhysRegId which inherits from RegId.
Unfortunately, PhysRegId redefines the flatIndex() method and makes it
do something completely different, which is to turn map the index into a
linearization of all registers in the CPU.

Instead of using the decoy wrong method, and because the one we actually
want is not accessible, we can just manually compute the flattened index
in the two places we use it.

Change-Id: I8bd02f0be0f4fb3742da48b2955e9e75ec57245b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52603
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-10 07:04:09 +00:00
Jui-min Lee
20e045a05f arch-riscv: Add NMI support
NMI is platform dependent according to riscv spec, so we intentionally
propose a very minimal design that doesn't give user any new accessible
register to interact with the NMI mechanism.

In current design, the NMI reset vector is fixed to 0x0 and always set
mcause to zero. mret from NMI handler is still possible, but it's up to
the user to detect whether a M-mode trap handler is interrupted and to
recover from it (if at all possible).

1. Add new fault type to represent NMI fault
2. Add non-standard registers to save the status of NMI
   a. nmivec[63:2] = NMI reset vector address
   b. nmie[0:0] = is NMI enabled = not in NMI handler
   c. nmip[0:0] = is NMI pending
3. Add new function in RiscvInterrupts to raise/clear NMI

Bug: 200169094
Test: None
Change-Id: Ia81e1c9589bc02f0690d094fff5f13412846acbe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52363
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-10 06:29:33 +00:00
Gabe Black
636783856f dev-arm: Ensure all fields of GicV2 are initialized.
The constructor tried to initialize all values, but in particular missed
intGroup, and may have missed other values as well.

Change-Id: Ibcd610e40259e46e3cde9b76c7f9ddc816832dfd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52406
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-09 21:40:58 +00:00
Bobby R. Bruce
4929c1260e tests: Move MI_Example tests to Long/Nightly
Two tests, one in test_kvm_fork_run.py and another in
test_kvm_cpu_switch.py, were trying to run the MI_Example protocol as
part of the quick/kokoro run. MI_Example requires the building of X86,
though we try to use GCN3_X86 exclusively to avoid compiling an
additional target. As such, these MI_Example tests have been moved to
the long/nightly run.

Change-Id: I3c196e7e336148a1b7a124b5810348a2e587fe24
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52563
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-09 19:09:41 +00:00
Jason Lowe-Power
1e8aeee698 ext: Update pybind11 to v2.8.1
Change-Id: Ia1c7081377f53fd470addf35526f8b28a949a7b0
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52523
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2021-11-09 15:34:32 +00:00