Commit Graph

17019 Commits

Author SHA1 Message Date
Giacomo Travaglini
7c2140f576 tests: Add realview-kvm-dual regression
This is to test multiple KVM vCPUs

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: Ied4f578bcf8d30f9c1738aa1c4265220e78589e9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44326
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-04-12 13:13:17 +00:00
Giacomo Travaglini
0b8564f5b2 tests: Allow multi-KvmCPU regressions
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I3207074e794385528b680e54eaa9a536aef9eb43
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44325
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-04-12 13:13:17 +00:00
Gabe Black
1f41f50c9a fastmodel: Call the base class initFromIrisInstance in the R52.
In the CortexR52 model in the initFromIrisInstance method, call into
the base classes version of that function to ensure some basic, common
setup is performed.

Change-Id: I43198578ce1057d63d8e72d66b5370bf4d1ccd4d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43545
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-12 12:27:19 +00:00
Daniel R. Carvalho
0a80511aea dev: Fix compilation errors
'backing' was initialized after being used.
'buffer' was initialized after its data() was used
by the constructor.

Change-Id: I0f8d0f6efb5d4b7abc5fc6c2c3ecca2c9b0a2eaf
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44366
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-12 12:23:34 +00:00
Eduardo José Gómez Hernández
a6fc2797e8 arch-x86: Fixed locked cmpxchg8b allows reordering
Locked versions of cmpxcgh8b (and cmpxcgh16b) should
be guarded by mfences to prevent reordering from
surrounding memory instructions.

Change-Id: I4a04bb871b4f9a38efd78df194b43f785d5d2236
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44166
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-12 08:01:50 +00:00
Gabe Black
ae09f19fc8 arch-arm: Add a message to a static_assert in isa.hh.
static_asserts without a message are a c++17 feature.

Change-Id: I9d8b5f5a0d7f9b83784f0480afab0f534a466ee5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44386
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-04-11 22:17:31 +00:00
Gabe Black
0abef82db8 python: Don't try setting the parent of null SimObject pointers.
The line of code which would have added the null SimObject as a child
was already guarded by an if, but the line before it which would set the
parent of the null SimObject itself was not. This change moves it into
the if as well.

Change-Id: Icfbc0e87e0ab55917735f720de4e94c19185df46
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44387
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-11 22:16:52 +00:00
Gabe Black
6334ef4701 python: If a SimObject already has a parent, don't add it as a child.
The SimObject will have already been added to the other object's list
of children, and if it's given a new parent, it will be added as a
child to the new parent as well. The object will then be the child of
two other SimObjects which will cause a delightful variety of hard to
debug problems.

Another slightly better way to handle this situation would be to both
move to the new parent and also remove the SimObject from the original
parent's list of children. Unfortunately there isn't a simple way to
figure out what the parent called the child, and so we would have to
look through its children one by one until we found the right one.

Change-Id: I8f43dfab7adf58a43f806390a0c7c35a2efde11a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43905
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-11 22:16:40 +00:00
Daniel R. Carvalho
1525ee8cdd util: Fix cpt_upgrader
This had multiple issues related to the upgrade
to Python 3.

Change-Id: Iebac5618a05d7c3ad08b34652bf2ba08a82b5948
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44105
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2021-04-11 14:09:24 +00:00
Daniel R. Carvalho
667cad35db arch-riscv: Fix braces around scalar initializer
clang complains that this scalar should not be
surrounded by braces.

Change-Id: Id399d7fbe06f3edaa1e1d569f968cd1674b2ac1d
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44365
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-04-10 23:28:16 +00:00
Gabe Black
bdb941b6d7 arch: Remove unnecessary "typename"s from VecPredRegT.
Change-Id: If38e71ac79105b111d68df1e572f9a8e32a131ad
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41998
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-10 07:55:09 +00:00
Gabe Black
0dade68dae arch,cpu,gpu-compute: Further simplify VecRegContainer.
Get rid of VecRegT, and a few redundant or unused methods.

Change-Id: I6c88c40653e1939fe74b8ffb847ef50ab8064670
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41995
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-10 07:31:23 +00:00
Gabe Black
0e455475c8 arch-power: Pull non-public information out of registers.hh.
Also create a regs/ directory for register related headers.

Change-Id: Id376597b7b6254b26c05aa94e0141abacd807c79
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41740
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2021-04-10 01:11:21 +00:00
Gabe Black
a580e08426 arch-arm: Pull everything not purely public out of registers.hh.
There are currently only two types of values exported from registers.hh,
vector register definitions, and the zero reg index. The ZeroReg
constant is still defined in registers.hh. The vector register
information has been moved into a new file called arch/arm/regs/vec.hh
since it's used internally by the ISA itself, and then included in
registers.hh so it can be consumed externally too.

Change-Id: I31d8dd5bcb21818efa32ccc42f26b0e598a2c88e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41738
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
2021-04-10 01:10:57 +00:00
Giacomo Travaglini
6cb9c3e87f sim: Fix Temperature class
* Adding __str__ method: To fix its printing on config.ini
(Replacing <m5.params.Temperature> with the Temperature value)

* Replacing "fromKelvin" with from_kelvin
(that's how pybind exports it)

* Fixing config_value to allow JSON serialization
(JIRA: https://gem5.atlassian.net/browse/GEM5-951)

Change-Id: I1aaea9c9df6466a5cbed0a29c5937243796948d2
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44167
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-09 23:12:00 +00:00
Bobby R. Bruce
291bc67ef1 misc,mem-ruby: Fixing unused variable error for fast builds
This fixes the broken compiler tests for .fast builds:
https://www.mail-archive.com/gem5-dev@gem5.org/msg38412.html

Change-Id: Ibc377a57ce6455ca709003f326b0ca8d4c01377b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44086
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-07 16:55:22 +00:00
Giacomo Travaglini
b3af12ccd5 dev-arm: Align gem5 to FVP Base PCI
The VExpress_GEM5_Foundation platform was reserving
a region of the memory map (@ 0x4 0000 0000) for PCI.

The Armv8-A FVP Foundation platform is not PCI capable at
the moment, so any PCI logic is really gem5 specific.
With this patch we are aligning gem5 to the FVP Base Platform,
which supports PCI and it is reserving 256GiB of memory
starting at 0x40 0000 0000 (256GiB).

Fast Models - Reference Manual - Version 11.8

At the moment we are still supporting a single DRAM range,
starting at 2GiB. So DRAM could overlap with the PCI memory
region though it is unlikely to happen in near future as
it would require a DRAM size > 254 GiB.

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

Change-Id: I506fd6696cdddc39d057602581cb16b30db3f7c7
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44165
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2021-04-07 09:09:49 +00:00
Giacomo Travaglini
e30378e2d2 configs: Add --kvm-userspace-gic to fs_bigLITTLE.py
This will allow a user to select gem5 simulation of the GIC via
command line; Necessary option when the simulated GIC != than the
host GIC

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I30e151b774ddfa7f4e91054a375254e15007af3f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44006
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-07 08:21:28 +00:00
Daniel R. Carvalho
d67f28473a util: Revamp opening brace verifier
1 - Rename the verifier from ClassBraces to
StructureBraces.

2 - Add support for anonymous structures. This
includes anonymous classes, anonymous structs,
anonymous enums and anonymous unions. e.g.:

  struct {

3 - Make the verifier not trigger error for
structures that do not currently abide to gem5's
coding style and use non-uppercase characters as
their first character. e.g.:

  struct test {

4 - Improve handling of nested structures. e.g.:

  struct { enum { VAR, VAR2

becomes

  struct
  {
      enum {
          VAR, VAR2

But the verifier will fail for declarations like:

  struct { int a; }; struct {

which becomes

  struct
  {
      int a; struct {

However, this later issue is not a desired coding
style, so it should be handled by another kind of
verifier if desired.

Change-Id: I8f0536dcc2c164e2d3d2a2e5b7a35d5ee351a814
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43365
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
2021-04-07 01:37:12 +00:00
Daniel R. Carvalho
5c8983fc18 misc: Fix remaining opening braces
These were not caught by the previous patches because
the grep used ignored:
- anonymous structures
  (e.g., "struct {")
- opening braces without leading spaces
  (e.g., "struct Name{"),
- weird chars in auto-generation files
  (e.g., "struct $name {").
- extra characters after the opening brace.
  (e.g., "struct Name { // Comment")
- typedefs (note that this is not caught by the verifier)
  (e.g., "typedef struct Name {")

Most of this has been fixed be grepping structures
with the following regex:
  grep -nrE --exclude-dir=systemc \
    "^ *(typedef)* *(struct|class|enum|union) [^{]*{$" src/

The following makes sure that "struct{" is captured:
  grep -nrE --exclude-dir=systemc \
    "^ *(struct|class|enum|union){" src/

To find cases that contain a comment after the
opening brace:
  grep -nrE --exclude-dir=systemc \
    "^ *(struct|class|enum|union)[^{]*{\s*//" src/

Change-Id: I9f822bed628d13b1a09ccd6059373aff63a8d7bd
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43505
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-07 01:29:31 +00:00
Giacomo Travaglini
5e24869079 configs: Do not assume single mem range in RealView
The SimpleSystem was assuming a single memory range for RealView
platforms by selecting the first element of the list only:

mem_range = self.realview._mem_regions[0]

This patch is fixing this by evaluating the entire list of platform
ranges.

Change-Id: I453fff7857966076c1419b95ddb9177e51d9f8d5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39636
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-04-06 08:48:50 +00:00
Ayaz Akram
95fdb9f3c4 arch-riscv: Add riscv pmp support
This change adds the pmp (physical memory protection)
feature of riscv previliged isa.

Change-Id: Ica701223cfc1be91a0bf953e6a3df6d72d6d3130
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43945
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Peter Yuen <petery.hin@huawei.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-05 04:18:12 +00:00
Gabe Black
0877e5125c base: Report actual thread numbers to remote GDB.
This is more accurate, and will help when the GDB stub is able to manage
multiple threads through the same connection.

Change-Id: Ica04a8e2b5e93ca254fb2c2e1b44075634a69b9c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44029
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-03 14:03:20 +00:00
Gabe Black
ea631194d9 scons: Eliminate the useless USE_SSE2 flag.
This option would set the -msse2 compiler flag to avoid using x87
floating point, but every 64 bit x86 CPU supports sse2, and so sse2 is
enabled by default on compilers targeting it. 32 bit x86 CPUs are
obscure enough that it's not worth preserving this marginally meaningful
option which would only matter for them.

Change-Id: Ib425c261b27f1f74300e714619787d04970065ce
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40879
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-03 14:03:10 +00:00
Gabe Black
ab19f3c560 Revert "arch-arm: Use src/base/fenv.hh instead of raw fenv.h."
This reverts commit 8ff1dd9c9b.

Reason for revert: gerrit allowed rebasing this out of the original order, but it doesn't build without another uncommitted change going in first.

Change-Id: I678a22154b539691a962b4a686333cacf98731de
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44065
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-03 14:03:04 +00:00
Gabe Black
0d569c559b scons: Streamline the LTO option setting code and add options for clang.
Clang also supports an -flto option, although not with a thread count.

Change-Id: Ifc783ac3ab2e0ea93fad0402b288605a20725aa0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40962
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-03 05:53:31 +00:00
Gabe Black
59e0ce27a3 scons: Include libthr on freebsd no matter what compiler you're using.
The compiler won't change where the thread library is implemented.

Change-Id: Ic6fbaae2ff9c4a91ce86b06d62049b9d9a0e3132
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40960
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: B.A. Zeeb <baz21@cam.ac.uk>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-03 05:53:17 +00:00
Gabe Black
dd0d54d749 scons: Narrow the scope of the -Wno-parentheses flag.
This was added to avoid warnings from code generated as part of Ruby's
AST. Instead of applying this to all of gem5, apply it only to files
generated by Ruby.

Change-Id: I2b11d2df3cb631debdc594059d9d480a0e695c59
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40958
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-03 05:53:01 +00:00
Gabe Black
b464d16444 ext: Fix an operator precedence bug in the nomali library.
An expression in that library intended to create a bitmask by checking
if a bit should be set, and then using ?: to select between a bitmask
with that bit, or 0. Unfortunately | is higher precedence than ?:, and
so 0 would be |-ed with the condition of the next ?: instead. This CL
fixes the bug by adding some parenthesis.

Change-Id: Ib7e06f261e07a6ad00b9a96939d07b64c3a50409
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40954
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-03 05:52:43 +00:00
Gabe Black
c017caad88 scons: More narrowly target -Wno-self-assign.
This flag was necessary because of self assignments in the ISA parser
where self assignments are often hints to the parser itself, and in one
case because a pybind-ism used to attach the -= operator looked like a
self assignment.

This change narrows the scope of the flag that disables this warning to
only files generated by the ISA parser, and the single file in the
systemc code which uses that operator overload.

Change-Id: Ib64fc72e46f894cba9064afcdbdcc5859c30e745
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40952
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-03 05:52:24 +00:00
Gabe Black
64d71220d1 scons: Delete unnecessary imports from SConstruct.
Also get rid of the joinpath and splitpath aliases for os.path.join and
os.path.split. The aliases are only slightly shorter, and obscure these
extremely common python methods.

Change-Id: I0784e2d8dbaacb0690a59e9fa8c8258c1df0e6c3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40874
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-03 05:51:35 +00:00
Kyle Roarty
c734ab7602 dev-hsa,gpu-compute: Fix override for updateHsaSignal
Change 965ad12 removed a parameter from the updateHsaSignal
function. Change 25e8a14 added the parameter back, but only for the
derived class, breaking the override. This patch adds that parameter
back to the base class, fixing the override.

Change-Id: Id1e96e29ca4be7f3ce244bac83a112e3250812d1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44046
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Alex Dutu <alexandru.dutu@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-04-03 02:39:27 +00:00
Gabe Black
8ff1dd9c9b arch-arm: Use src/base/fenv.hh instead of raw fenv.h.
This provides a layer of indirection where the rounding mode
setting/getting code will do nothing if fenv.h isn't available. At build
time, if fenv.h can't be found, a warning is printed.

Also, the include for fenv.h was guarded in the includes in the ISA
header, but the functions from it weren't guarded in the actual code.

Finally, the code was setting the rounding mode, but not setting it
back. That would mean running these instructions would set the rounding
mode in gem5 as a whole, affecting its other behaviors and any other
instructions that might expect the default rounding mode.

Change-Id: Ic5cc32773652f423e66d78f31b80c6604f2c4a49
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41214
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2021-04-03 01:34:21 +00:00
Gabe Black
1791b8732c scons: Pull domain specific build setup out of SConstruct.
Use SConsopts files local to individual domains to pull
non-foundational build code out of SConstruct. This greatly simplifies
SConstruct, and also makes it easier to find build configuration having
to do with particular pieces of gem5.

This change also converts some python level variables, all_protocols,
protocol_dirs, and slicc_includes, into the environment where the timing
of their initialization is more flexible.

Change-Id: Ie61ceb75ae9e5557cc400603c972a9582e99c1ea
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40872
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2021-04-03 01:18:17 +00:00
Jason Lowe-Power
91f4ea6683 python: Improve type annotations in pystats
This fixes some errors and warning when running mypy.

`gem5/src/python/m5/ext> mypy pystats`

There is one error that is ignored, which is a bug in mypy. See
https://github.com/python/mypy/issues/6040

Change-Id: I18b648c059da12bd30d612f0e265930b976f22b4
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42644
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-02 20:47:35 +00:00
Ayaz Akram
2dfa2ddc6f arch-riscv,util: update riscv crosstool-ng config and m5 README entry
Change-Id: I751a6c97a0ac97f7b3fce360577d0ee16f29fda4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44032
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-02 20:45:12 +00:00
Kyle Roarty
df5ddabc03 gpu-compute: Fix scalar register ready check
Replaces some curly braces that were accidentally removed
causing the function to return false even when it shouldn't

Change-Id: I15fb4167468c8e3dd1107f1ca3dc98c48df4611b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44045
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Alex Dutu <alexandru.dutu@amd.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-02 20:12:29 +00:00
Hoa Nguyen
e6b62c0252 configs: Make MemConfig.py compatible with Python3
Change-Id: I0c180fca18a19412348cbb90837825e7b6b544c6
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44047
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-04-02 19:06:25 +00:00
Gabe Black
6d6fffe964 base: Generalize remote GDB query commands.
Dispatching qFoo style commands now use a lookup table instead of a
hand coded sequence of one off checks. It also splits the handling of
different queries into different functions.

Change-Id: I8f774760e856377c5cce90b23e57de6a7f828395
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44028
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-02 15:39:42 +00:00
Gabe Black
451f731748 base: Fix the syntax of the remote GDB command implementations.
Since these are methods, they should be camel case, not underscores. The
command map should also be camel case.

Change-Id: Ie646a19b6e2fc022078722c67a11d370af4e84fe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44027
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-02 15:38:56 +00:00
Gabe Black
b60b2800ce arch-x86: Clean up tags used in the x87 decoder.
Don't use the "E" tag when there is only a register or memory based
version of the instruction, since that decodes to both. Don't special
case the "st(1)" version of an instruction if it's just a matter of the
assembly syntax and not the instruction encoding. Don't decode based on
Mod, and then use the tag type "E" which will again decode on Mod, use
"E" for both the memory and register versions at the same time. Set the
default instruction to Inst::UD2 so that we don't have to specify it as
the default locally in each decode block. Let the "M" tag handle the Mod
= 3 case, which is built into that operand type. That's slightly
inconsistent with the "R" type which does not handle the "not 3" case,
but we can take advantage of it none the less.

There are instructions which, when decoded as the Inst format, will take
the "M" type tag and be able to drop their decoding of the Mod = 3 case,
but since they aren't Inst right now and can't sub-decode Mod on their
own, the 3 case needs to stay for now.

In most cases when dealing with x87 registers, the "dataSize" argument
to microops doesn't matter since the size doesn't change. There may be
an opportunity to consolidate the various FP microops and use dataSize
= 10 for x87 registers, although there are some nuances there that may
make that not work out.

Change-Id: Ia3ff6176796af66f6a3c463b538e750e65893a84
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42904
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2021-04-02 00:25:34 +00:00
Gabe Black
580b22fd00 sim,base: Get rid of the system/gdb "breakpoint" methods.
This unused pair of methods could be used to trigger a breakpoint within
the remote GDB stub, but was unused and would need to be called from an
instance of GDB attached to gem5 itself.

The system's version of breakpoint was also limitted in that it would
only cause a breakpoint in the first thread's GDB and no other.

Change-Id: I53ceab78667610177dbb8be1def3a88262befeec
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44031
Reviewed-by: Boris Shingarov <shingarov@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-01 20:02:51 +00:00
Gabe Black
14b0d6cc05 base: Get rid of the unused "debuggers" vector in the remote GDB stub.
This was presumably there for debuggers attached to gem5 itself to
examine, but doesn't provide much value and adds a small amount of
complexity.

Change-Id: Iaed08b63beafe8bf05f1496f6341a7feadc350ce
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44030
Reviewed-by: Boris Shingarov <shingarov@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-01 20:02:32 +00:00
Gabe Black
d8078f3665 base: Use the correct string size in BaseRemoteGDB::cmd_query_var.
The size of the command should be len, the length of the command string,
not len - 1. Looking at query strings shows that they were previously
being truncated by one character.

Change-Id: I283891eadafaa07d12453f085e8a106d59a4f889
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44026
Reviewed-by: Boris Shingarov <shingarov@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-04-01 20:00:47 +00:00
Kyle Roarty
49f7565904 arch-vega: Update FLAT instructions to use offset
In Vega, flat instructions use an offset when
computing the address (section 9.4 of chapter 9
'Flat Memory Instructions' in Vega ISA manual).
This is different from the GCN3 baseline.

Change-Id: I9fe36f028014889ef566055458c451442403a289
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42213
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-04-01 02:58:31 +00:00
Kyle Roarty
2bb8d6bc0c gpu-compute: remove index-based operand access
This commit removes functions that indexed into the
vectors that held the operands. Instead, for-each loops
are used, iterating through one of 6 vectors
(src, dst, srcScalar, srcVec, dstScalar, dstVec)
that all hold various (potentially overlapping)
combinations of the operands.

Change-Id: Ia3a857c8f6675be86c51ba2f77e3d85bfea9ffdb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42212
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-04-01 02:58:31 +00:00
Kyle Roarty
b40b361bee arch-vega, gpu-compute: Add vectors to hold op info
This removes the need for redundant functions like
isScalarRegister/isVectorRegister, as well as
isSrcOperand/isDstOperand. Also, the op info is only
generated once this way instead of every time it's needed.

Change-Id: I8af5080502ed08ed9107a441e2728828f86496f4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42211
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-04-01 02:58:31 +00:00
Tony Gutierrez
0e2564a629 arch-gcn3, gpu-compute: Update getRegisterIndex() API
This change removes the GPUDynInstPtr argument from
getRegisterIndex(). The dynamic inst was only needed
to get access to its parent WF's state so it could
determine the number of scalar registers the wave was
allocated. However, we can simply pass the number of
scalar registers directly. This cuts down on shared
pointer usage.

Change-Id: I29ab8d9a3de1f8b82b820ef421fc653284567c65
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42210
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-04-01 02:58:31 +00:00
Tony Gutierrez
236b4a502f gpu-compute: Add operand info class to GPUDynInst
This change adds a class that stores operand register info
for the GPUDynInst. The operand info is calculated when the
instruction object is created and stored for easy access
by the RF, etc.

Change-Id: I3cf267942e54fe60fcb4224d3b88da08a1a0226e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42209
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-04-01 02:58:31 +00:00
Kyle Roarty
9ddfe09649 arch-vega: Add Vega-specific opcodes
The opcodes aren't implemented yet, returning nullptr

Change-Id: I700c2158035aea84e6365a32d53304accab59d96
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42208
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-04-01 02:58:31 +00:00