Commit Graph

17225 Commits

Author SHA1 Message Date
Giacomo Travaglini
1cecc752d7 arch-arm: Implement ARMv8.1-VMID16, 16-bit VMID
In an Armv8.1 implementation, when EL2 is using AArch64, the VMID size
is an IMPLEMENTATION DEFINED choice of 8 bits or 16 bits.
When implemented, this feature is supported only when EL2 is using AArch64.
The ID_AA64MMFR1_EL1.VMIDBits field identifies the supported VMID size.

Change-Id: I7acde0a9ba285d4740771133debd60a7a7515954
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45187
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-17 10:22:41 +00:00
Giacomo Travaglini
cf83aec07a arch-arm: Using 16 bit VMID
Change-Id: Ia4f408b8e84b5f52f6b48fd5d4bbc2a5fac87154
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45186
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-17 10:22:41 +00:00
Gabe Black
26c03495fa cpu: Stop using macros for constants in the multiperpsective_perceptron.
Enums work just as well and respect namespaces and scopes.

Change-Id: If726ff325be7114c9a749f5f4e1a193552a24c2b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45519
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-15 06:30:13 +00:00
Bobby R. Bruce
3225820e7c base,tests: Fix debug.cc tests to reflect new API changes
Due to simplifications in how the debug flag is enabled (here:
https://gem5-review.googlesource.com/c/public/gem5/+/45007), the
debug.cc.test tests were failing when compiled to .fast (`scons
build/NULL/unittests.fast`). This patch fixes the tests to work with
this new API.

Change-Id: Ifd49f698dcc9e5d2a81d4b4a9363b82dd8a91a97
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45480
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-14 18:14:15 +00:00
Bobby R. Bruce
521d04f92f arch-gcn3: Fixing .fast compilation for gcn3
DPRINTF was altered here:
https://gem5-review.googlesource.com/c/public/gem5/+/44988.
This change results in DPRINTFs always compiling. As such, the
variables decladed within NDEBUG ifdefs, and later used in DPRINTFs,
cause an error when compiling .fast. In this patch the NDEBUG ifdefs
have been removed.

Change-Id: I54992cfe152c84b265e64e1389bf2656c95ba42e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45481
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-14 18:13:59 +00:00
Daniel R. Carvalho
9b675ebea8 misc: Add missing compiler.hh include
Add some missing base/compiler.hh includes.

Found by manually checking the files in:
  grep -r --include \*.hh -L \
    '#include "base/compiler.hh"' \
    $(grep -r -l "GEM5_" src/)

And occasionally checking some .cc files through
a similar methodology.

Change-Id: I6b6e27189c627bb76ace73c338486743d469be46
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45459
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-14 10:02:14 +00:00
Matthew Poremba
aa19af29ad arch-vega,arch-gcn3: Fix s_cmp_lt_u32
Was using less-than-or-equal rather than less-than. All other comparison
instructions look correct otherwise.

Change-Id: Iee0374554f21a80a6da2eb75f38b22c83b6e1e9c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45499
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-14 07:56:17 +00:00
Gabe Black
6d7c3afcd4 mem: Get rid of the SET* macros in packet.cc.
Replace these with a helper function which merges attributes into a
unsigned long long which the bitset constructor can accept.

Change-Id: I36f809503a47c17b82dc75dee0d5bb8615eda27b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45367
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-12 23:10:55 +00:00
Gabe Black
6719ad3201 base: Stop using macros to handle nan in stats/text.cc.
c++ provides a standard way to retrieve the value of nan. Use that
instead of a function to compute it, or macros defined for c.

Change-Id: I483e8642d28cc3187682ce6bb7457b5e796cf61c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45366
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-12 21:07:47 +00:00
Gabe Black
311603d923 base: Stop both conditionally and unconditionally including cmath.
base/stats/text.cc was both conditionally (in two places) and unconditionally
including cmath. Once should be enough.

Change-Id: I941dfb8631eb71d1a8b423011022f78d628baa33
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45365
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-12 20:49:49 +00:00
Gabe Black
3889795886 arch-sparc: Replace M5_HWCAP_SPARC_* constants.
These were not using correct style and were using an obsolete M5 prefix.

Change-Id: I24273857bee2fcf52f203262b431c23665d5e87f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45244
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-12 16:11:11 +00:00
Daniel R. Carvalho
bf365b962d mem: Fix compilation issues in qos
Fix circular dependency and related issues.

Change-Id: I48490519fa0a00619a4baede72ebae2868560660
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45245
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-05-12 11:23:21 +00:00
Gabe Black
b1a396bfcf arch: Stop using deprecated M5_AT_* constants.
Also stop using the non-namespaced version of AuxVector.

Change-Id: I26fc0cf1f27c1a1dcae479096b183ab1f5abc8e2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45243
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
6e9725199e sim: Deprecate M5_AT_* constants.
These are formatted as #defines, but they are actually enum constants.
If they were actually macros, they should use a GEM5_ prefix. Put them
in the gem5 namespace to remove the need for that prefix, and an auxv
namespace to remove the need for the AT prefix.

Since we now have a gem5::auxv namespace, move the AuxVector template
into it and deprecate the old, global namespace version.

Also, one of the constants was M5_BASE_PLATFORM, which was inconsistent
with the rest of the constants which were M5_AT_... This was not
actually because the constant in any header files was different, it was
just incorrectly transcribed and should have been M5_AT_BASE_PLATFORM.
Since we're changing names anyway, replace this with
gem5::auxv::BasePlatform.

Change-Id: Ie0dc34a683b113a4ed4bc76054eb822676f6e802
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45242
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
02ae343c66 misc: Replace M5_CLASS_VAR_USED with GEM5_CLASS_VAR_USED.
Change-Id: Ibd2230d684f41201b07fa9083881145e36176a68
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45241
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
2fd7508e9f misc: Replace M5_FOR_EACH_IN_PACK with GEM5_FOR_EACH_IN_PACK.
Change-Id: I5d565c496129033634d2b913f83d014c5e07b1dc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45240
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
f1879bdc17 base: Replace M5_UNLIKELY with GEM5_UNLIKELY.
Change-Id: Id5f01675da5110f6503bd799a7889e8eb73433a1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45239
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
c480558532 misc: Replace M5_UNREACHABLE with GEM5_UNREACHABLE.
Change-Id: Id4cbdb8ae58c1077411e01579ac3a2d72b3b7465
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45238
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
e92f64b0b7 misc: Replace M5_ALIGNED with GEM5_ALIGNED.
Change-Id: Ia06bc959c81e9b37e0a506c022b8f8d86a0897ac
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45237
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
97ef1472ad misc: Replace M5_LOCAL and M5_WEAK with GEM5_LOCAL and GEM5_WEAK.
Change-Id: Ieb8350e647480f9bf582479b7933f0462f18d14d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45236
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
650b27f755 arch-sparc: Replace M5_NO_INLINE with GEM5_NO_INLINE.
Change-Id: Ibea33196765cc2d038d12c1388e6585275eaba55
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45235
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
ce6b5e7e33 misc: Replace M5_ATTR_PACKED with GEM5_PACKED.
Change-Id: Ie59071ca1fc81a76267a54ddd2d35dfc4477995d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45234
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
11fe13c311 misc: Replace M5_FALLTHROUGH with GEM5_FALLTHROUGH.
Change-Id: I058f311b6d9c284f745bcc915db72236d05db21b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45233
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-11 20:16:31 +00:00
Gabe Black
e1fea279e2 misc: Replace M5_NODISCARD with GEM5_NO_DISCARD.
Change-Id: I1ddaf03afe865092d1664e395b51b1f573c19c85
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45232
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
fb3befcc6d misc: Replace M5_VAR_USED with GEM5_VAR_USED.
Change-Id: I64a874ccd1a9ac0541dfa01971d7d620a98c9d32
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45231
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-11 20:16:31 +00:00
Gabe Black
e55ae090b3 base: Move the macros in compiler.hh to a GEM5_ prefix.
Also add macros which define the old names to the new names for
backwards compatibility.

This change also takes the opportunity to rename the M5_ATTR_PACKED
macro to GEM5_PACKED, dropping the ATTR. None of the other attribute
based macros bother to specify that they stand for an attribute, making
this one inconsistent and overly verbose.

Similarly, it renames M5_NODISCARD to GEM5_NO_DISCARD to be consistent
with other macros which separate out individual words like GEM5_VAR_USED
and GEM5_NO_INLINE

Change-Id: I22d404492faf28b79a8247f869f14af21c9cf967
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45230
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-11 20:16:31 +00:00
Gabe Black
eef05e8821 sim: Use type_traits to steer swap_bytes.
Rather than have a function with a if which checks against each
supported size of a type T which calls the right version of
swap_bytesNN, this change uses SFINAE and type traits to select the
function, and adds the requirement that the type being swapped is
actually convertible to the unsigned integer type of the appropriate
size.

This has the nice benefit of also avoiding hard coding which sizes can
be supported by the base swap_bytes, although that's probably not much a
limit in practice, avoids forcing all types to be convertible to all
sizes of uint*_ts for unused branches of the if, and removes a
dependence on base/logging.hh for the panic.

Change-Id: I2267f69a2868fcba2318c7562a49d27fef785395
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45286
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
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-05-11 20:15:10 +00:00
Gabe Black
00caced648 dev: Overload swap_bytes, don't specialize the template.
The effect is the same, the rules for overloads are easier to work with
than the rules for templates, and it removes the assumption that
swap_bytes actually is a template.

Also some minor style fixes.

Change-Id: Id9439177185b5269dd89605bbd05b09390a18d40
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45285
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-11 20:14:56 +00:00
Gabe Black
8076a41183 arch-x86: Build source picking into the operands.
The parser is able to add extra code to generate the operand value, but
we were explicitly adding that code ourselves. That added complexity
particularly to the reg microops, but made other types a little more
complex as well.

Change-Id: Idae36c27662c79302ea9b2831062c8c067ba174c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42971
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2021-05-11 04:53:04 +00:00
Gabe Black
cba6374f57 arch: Set %(op_idx)s properly when predicated operands are present.
This should be either the fixed index if there are no predicated
operands (ie operands which may not be used), and an auto incrementing
index otherwise. This is still not bulletproof since the auto
incrementing index is just code which ++-es the index, and so the index
will be different and incremented each time that value is substituted
in.

Also, the mixture of predicated operands and the vector operands is
broken and will not generate compilable code, but I'm not going to try
to fix that here.

Change-Id: I1ceae519649762e54eaa019610e51bb8c21d28d6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42970
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2021-05-11 04:52:32 +00:00
Gabe Black
0d390f1593 arch-x86: Create some infrastructure for x86 microop operands.
These are currently only used in the reg, float and media ops, but
should be expanded to the other types eventually. This is part of an
attempt to use common machinery for the microops instead of having
each type recreate the mechanisms it needs locally.

Change-Id: I67f521b6b161310ba50a30ac4c73305cc75a63d5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42969
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2021-05-11 04:52:21 +00:00
Gabe Black
1192f16f60 arch-x86: Clean up x86 integer indexes.
Instead of having a bunch of implicit integer registers which are
identified only by number, except in the ISA description where there are
operands hard coded to certain numeric offsets into the implicit
registers, and having an independent count of those implicit registers,
just create a set of named indices for the registers we need.

Redefine NUM_INTREGS to be the total number of registers, and
NUM_ARCH_INTREGS to be the number of architectural integer registers.
Instead of using NUM_INTREGS as a coincidental short hand for the first
microop register (since that comes after the architectural ones), and
implicitly knowing that that's the zero register, define an INTREG_T0
constant which at least makes it clear what register we're talking
about, even if it's not clear that the semantics of that register make
it mostly a placeholder.

Change-Id: I5fa41169b9619ea68a50d6d5241ff9a07440bceb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42523
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-11 04:52:09 +00:00
Gabe Black
2e27ed2351 python,scons: Move readCommand and compareVersions into site_scons.
These functions are only used by scons, so it makes sense to move them
to site_scons/gem5_scons/util.py.

Change-Id: If2b3995f208cb71adf3c59aac4eabe378c47f94f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41599
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-10 23:33:22 +00:00
Gabe Black
016440c58e python: Collapse away the now unused readCommandWithReturn function.
This had been used when detecting python versions, but can now be
absorbed into readCommand.

Change-Id: I4385357c3ce33a0f1b58e741067aa7ae3a7daa3b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41598
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2021-05-10 23:33:11 +00:00
Gabe Black
24175fb9bd scons: Update comments in SConstruct.
Make them consistently styled, gramatically and factually correct, and
try to make sure they're reasonably clear.

Change-Id: I3566734b0ac386113ef45ac7fd24c9fb1f2007d3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40972
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>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-10 23:33:04 +00:00
Gabe Black
8bfcaa8abc scons: Simplify finding the python lib with ParseConfig.
A comment in that section of SConstruct talked about how ParseConfig
couldn't understand -Xlinker and -export-dynamic, and how that meant
they needed to parse the output of python-config manually. Some
searching around turned up this:

https://bugs.python.org/issue36508

which seems to suggest that exactly those two options weren't actually
supposed to be returned by python-config in the first place, and are
really for python's own internal build.

This change switches over to using ParseConfig, but to avoid bad options
sneaking through, it uses an option argument to ParseConfig to intervene
before the options are consumed and filter out everything except
required libraries, and library and header search directories.

Change-Id: I1a50eb030019a447b919381c32168fb3bb27b89b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40971
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-10 23:32:53 +00:00
Gabe Black
3c2fa06bff scons: Pull builder definitions out of SConstruct.
Put them in site_scons/gem5_scons/builders.py. This decreases the bulk
of SConstruct and keeps related functionality together.

Change-Id: I9e1f2d606c3801131badad15f8f4419186bb7e1d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40969
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
2021-05-10 23:32:45 +00:00
Gabe Black
d84123e106 scons,misc: Remove the ability to disable some trivial features.
These are HDF5, PNG, FENV, and TUNTAP support, all of which add
capabilities to gem5 which can be ignored if not wanted. It could be
argued that FENV changes behavior because it makes setting the FP
rounding mode work or not as used by SPARC, but since the difference is
trivial and in a niche area, that (along with the other options) doesn't
seem to justify having a top level control in the build system.

Since these are no longer options which say whether to *use* a
particular feature, and are instead flags which say whether we *have* a
particular feature, change their names from USE_* to HAVE_*, to stay
consistent with other variables.

Most of the remaining USE_* flags, KVM, FASTMODEL, SYSTEMC, and
(indirectly) USE_PYTHON, toggle on and off major systems which can have
a significant effect on boot time, or, in the case of FASTMODEL, even
consume external resources which may not be available and which may
break the build.

USE_POSIX_TIMER was also left alone since it selects between two
implementations of some functions. By forcing it to be on or off
depending on the host, we would be forcing some code to be excluded in
either case. That would make that other code impossible to test without
hacking up scons or modifying the host machine.

Change-Id: I0b03f23e65478caefd50cd3516974386e3dbf0db
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40964
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-10 23:32:33 +00:00
Gabe Black
f2d3011333 cpu: Get rid of the redundant PhysRegIndex type.
It was defined to be effectively the same type as RegIndex, which is a
uint16_t. Having two types for essentially the same thing (which the
compiler would treat as equivalent) adds unnecessary complexity.

Change-Id: Ibf6badc19e3b0a27c3bc3e68def1e686dbef3ea8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45228
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2021-05-10 20:04:00 +00:00
Gabe Black
8f0b33612e cpu: Get rid of the unused NumRegClasses constant.
Change-Id: Icb2918a97f58a79159307a5d7cba877899268caa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45227
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2021-05-10 20:03:49 +00:00
Gabe Black
16fa9f9812 arch,cpu: Get rid of is*Reg() methods in RegId.
These bake in the existing set of RegClass values and are not flexible
or scalable.

Change-Id: I107460cd82960d96916d1644403b7635820045a0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45226
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-10 20:03:38 +00:00
Gabe Black
ed5832c273 cpu: Delete an unnecessary return in RegId::flatIndex.
panic() is marked [[noreturn]], so there's no need to put a dummy return
after it.

Change-Id: Icebba480ef583a149188d4d6f9481fe0bbd95082
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45225
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2021-05-10 20:03:26 +00:00
Gabe Black
8e2c9e64b3 arch-arm: Use src/base/fenv.hh instead of raw fenv.h.
Re-upload of https://gem5-review.googlesource.com/c/public/gem5/+/41214

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: I3ff2b97189487579554aae890e14889bd63461d2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44085
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-10 20:02:32 +00:00
Gabe Black
ab65690895 base,arch-sparc: Overhaul the small fenv wrapper in base.
This was written in C, broke the style guide, used macros, used an
obsolete m5_ prefix, and used extern "C" in an odd way.

Change-Id: If38f9a1bca6fd4a4f7f533ddb1e81d6207bc9c44
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40878
Reviewed-by: Gabe Black <gabe.black@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-05-10 20:02:11 +00:00
Gabe Black
41d934cf18 misc: Collapse all uses of DTRACE(x) to Debug::x.
Also mark the DTRACE macro as deprecated.

Change-Id: I99d9a9544b539117b375186e3e425d73d3c5cab7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45009
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-10 20:00:48 +00:00
Gabe Black
2af00af0f6 base: Move TRACING_ON check into Flag::tracing().
Now DTRACE is simply an alias for Debug::x. We should keep it now for
compatibility, but it can be removed over time.

Change-Id: Icda18ff57126328e98e440e3a81bf13caa0c27df
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45008
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-05-10 11:16:52 +00:00
Gabe Black
429e53a600 base,python: Simplify how we check if a debug flag is enabled.
Compound debug flags are intended to be a way to enable or disable a
group of simple debug flags at once, so that you don't need to enumerate
every more specialized flag in an area to get a broad amount of
debugging, nor do you give up the ability to select a general area
easily by making more specific flags.

It doesn't, however, make a lot of sense to check the value of a
compound debug flag, since it could be enabled but then have individual
subflags disabled. Exactly whether that means the compound flag should
be enabled or not is not clear, and figuring it out takes a fair amount
of work since each member simple flag needs to be visited.

Also, by having different behavior depending on the flag type, the
"enabled" method needed to be virtual.

This change eliminates the virtual method and moves the _tracing bool
member into the base class. If a subclass (only SimpleFlag currently)
wants to start or stop tracing based on itself, it should set or clear
this flag. Also, the "enabled" method has been renamed to "tracing",
since that's actually what it tracked. Being enabled by itself is not
sufficient to be tracing since there is also a global enable.

Finally, rather than duplicate the logic to convert a flag to bool in
the python wrapper, we can just use a cast to bool and take advantage of
the version in C++.

Change-Id: I3dc64c2364f0239294093686ddac6fcc8441f306
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45007
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2021-05-10 11:16:36 +00:00
Giacomo Travaglini
35b6961dcb arch-arm: Fix SMM* instructions
A recent clean up patch [1] introduced some bugs in the instruction
implementation of:

SMMLA, SMMLAR, SMMLS, SMMLSR, SMMUL, SMMULR

[1]: https://gem5-review.googlesource.com/c/public/gem5/+/42387

Change-Id: I459fe99bd2711e00027e9ef0c7796af7a374a509
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44945
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-10 09:08:44 +00:00
Gabe Black
924fb60aad base: Simplify the definition of DTRACE.
Instead of gating the behavior of DTRACE based on TRACING_ON in the
preprocessor, move it to C++. Beyond being a little simpler, this
ensures that the value of Debug::x is always valid (the proper header is
included, x is spelled correctly, etc) even if TRACING_ON is false.

Change-Id: Ie0085c0f8753ad5283ef1850d493706b977c21a8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45006
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2021-05-10 07:31:38 +00:00
Gabe Black
3e689021a2 base: Collapse the DTRACE macro in DPRINTF.
We've already checked if TRACING_ON is set, so we can just check the
value of Debug::x directly.

Change-Id: Ifcc183b9e56fd45a2c6278ab5739ae2fbe2b32c0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45005
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
2021-05-10 07:31:27 +00:00