Commit Graph

17189 Commits

Author SHA1 Message Date
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
Gabe Black
072cddd765 base,arch,dev,mem: Always compile DPRINTFs, even if they're disabled.
The code in the body of a DPRINTF will always be compiled, even if it's
disabled. If TRACING_ON is false, the if around it will short circuit to
false without actually running any code to check the specified
condition, and the body of the if will be elided by the compiler as
unreachable code.

This creates a more consistent environment whether TRACING_ON is on or
not, so that variables which are only used in DPRINTF don't have to be
guarded by their own TRACING_ON #ifs at the call site. It also ensures
that the code inside DPRINTF is always checked to be valid code, even if
the DPRINTF itself will never go off. This helps avoid syntax errors,
etc, which aren't found because of the configuration of the build being
tested with.

Change-Id: Ia95ae229ebcd2fc9828f62e87f037f76b9279819
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44988
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-10 07:31:12 +00:00
Gabe Black
458cce669e base: Mark the unused DPRINTF_UNCONDITIONAL macro as deprecated.
Change-Id: I9443051034c58efa223a69eefa20037068ae3e1c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44987
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-05-10 07:30:58 +00:00
Gabe Black
cc656e6248 base: Add macros to mark things as deprecated.
GEM5_DEPRECATED(message) expands to the [[gnu::deprecated(message)]]
attribute on gnu compatible compilers and marks an entity (function,
variable, etc) as deprecated. The msg parameter should be used to tell
the user what they should do to move away from the deprecated entity.

GEM5_DEPRECATED_MACRO(name, definition, message) is used inside an
expression-like macro with definition "definition" to mark that macro as
deprecated with message "message". For instance, if there were macros
like this:

 #define SUM(a, b) ((a) + (b))
 #define ONE 1

We could mark that as deprecated like so:

 #define SUM(a, b) GEM5_DEPRECATED_MACRO(SUM, (a) + (b), \
     "The SUM macro is deprecated, use the + operator instead.")
 #define ONE GEM5_DEPRECATED_MACRO(ONE, 1, "Use the literal 1.")

Note that this macro should not be used for macros which, for instance,
declare variables, since it assumes the body of the macro expands into
an expression and not a statement or statements.

Change-Id: I58f5e834cfeeb23e37a6548433dfe7e4f695a5ec
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45086
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 06:29:00 +00:00
Gabe Black
855fa77c3d arch-x86: Get rid of the now unused print(Src|Dest)Reg methods.
These would extract particular numbered source or destination registers
from an instruction and feed them into a printReg method. Now that the
register operands know how to print themselves with printReg directly,
these methods are no longer used.

Change-Id: I4244cb2ee97015f51f4783f377282e2a1db5d69b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42363
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-09 01:04:29 +00:00
Gabe Black
b5b123afa6 arch-x86: Move the step division helper out of the ISA desc.
Change-Id: I3c5714d6485c3b000561bdaa478c9393bc844bca
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42362
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-09 01:04:21 +00:00
Gabe Black
e25201b58d arch-x86: Use the new multiplication helpers in the mul uops.
Change-Id: Ib12b2e357fae19455a1a11dd890dda6602a6dc41
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42361
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-09 01:04:06 +00:00
Gabe Black
da649727f7 arch-x86: Make pick, signedPick and merge take indexes directly.
These methods had looked up the register index using an index into the
src or dest index arrays. This level of indirection is less efficient
than using the index itself (which we know already), and also requires
that the array is layed out like how we think it is.

Before:
array idx => reg idx => folded?
After:
reg idx => folded?

Change-Id: Ice2262250ff77582ba5530fc52e6738ba1bebe18
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42356
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-09 01:03:56 +00:00
Gabe Black
ae303671ec arch: Delete a few unused vector register types/constants.
These are used internally in ARM, but dummy versions of them were being
published by all ISAs even though nobody was consuming them.

Change-Id: I93d9e53c503e375a2f901bb6f7f4c00a7cdadb20
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42003
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 19:37:26 +00:00
Gabe Black
61ba9dab4d arch-x86: Specialize the remaining operand types for uops.
Change-Id: Ibe49b7fa020d3c722fe6f41cf83786dcfaf16819
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42355
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 10:49:58 +00:00
Gabe Black
6c62d6c7ee arch-x86: Create a separate type for floating point reg idxs.
This will ensure that floating point registers are used when required
and never otherwise.

Change-Id: I303c42d8a74c56b7b433b91fd36dc6aaf5ddef32
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42354
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 10:49:45 +00:00
Gabe Black
a1b4ce84f7 arch-x86: Eliminate the DependenceTags in registers.hh.
These were a weird holdover from when register indices were all squished
into a single scalar value, offset based on the register type. When that
change happened, the person who made it misunderstood what the
InstRegIndex type was for, and decided to build RegId into it for some
reason. The only purpose of InstRegIndex is to make sure everybody
agrees that the value being passed around is going to be used as a
register index and not a literal value, or vice versa. There is no type
associated with it as far as floating point, integer, or misc registers.
That gets applied at a different step, and actually can't be part of
InstRegIndex since the same base class may need to hold register indices
that are going to be treated as integer or floating point depending on
the subclass using them.

Also, since the values of the various constants in the DepdenceTags enum
where never actually added into register indices in the first place, the
code in the InstRegIndex constructor would never do anything. All
registers would be arbitrarily sorted into Int, FP, etc, and then when
they actually went to be used the category would be thrown away.

Change-Id: I8c4e8d6e9cdb53e298c00ad2f56e8c7304e51e96
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40339
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 10:49:26 +00:00
Gabe Black
b8d52fee57 arch-x86: Use regIdx() instead of creating an InstRegIndex directly.
The microcode assembler provides a regIdx() wrapper which will wrap
constants with an appropriate InstRegIndex constructor without having to
do so manually.

Change-Id: I782289bdfcbe4e3552ff44123dfce2ccc86f9266
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42353
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:41:00 +00:00
Gabe Black
39f76bb2b1 arch-x86: Style fixes and use uop args in the media ops.
Change-Id: I73b125888895acb74db16fc766af2571a73fb147
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42352
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:39:02 +00:00
Gabe Black
ef59d8504f arch-x86: Fix style and use uop args in seqop.isa.
Change-Id: I41ed7f0aa8dd00ed0f6f8361837945810d12bf9e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42351
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:38:41 +00:00
Gabe Black
16525011ad arch-x86: Correct style and use uop args in specop.isa.
Also spin fixed code out into header files.

Change-Id: I1b326c8cb999d797102ba36b5c13850023a50615
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42350
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:38:27 +00:00
Gabe Black
39235f1be3 arch-x86: Use the newly flexible RegOpT to implement the limm uop.
Change-Id: I7ac632d891b0f6b42794eb894bde3c18ce82718a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42349
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:38:15 +00:00
Gabe Black
be5a73ebaf arch-x86: Use the *Op classes with FP microops.
Change-Id: I79e68ad5a0233047d44079d8453bf232cb64d27e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42348
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:38:03 +00:00
Gabe Black
090c22e631 arch-x86: Remove static code from debug.isa and fix style.
Fix style problems in debug.isa, and move static code out of the ISA
description into a plain header file.

Change-Id: I8369bd8d46ad11b66cac8249cc981a8d279a1492
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42347
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:37:50 +00:00
Gabe Black
6142401b55 arch-x86: Use the new op bases for memory microops.
Change-Id: I73538b547093e6f872e085686ea164ef89527321
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42346
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:36:56 +00:00
Gabe Black
9271dd659c arch-x86: Generalize the RegOp operands.
This mechanism can now be used in other types of microops.

Change-Id: I82cb15b9d7b3c1e684aaa7482ea98b313f1d85d9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42345
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:36:45 +00:00
Gabe Black
0271c14805 arch-x86: Factor out duplication in the new RegOp base classes.
Instead of having the cross product of dest/src1/src2 and folded int,
debug, control, misc, and segment operands, break them up so they can be
mixed together in different combinations using "using" declarations.

Change-Id: I04357b08bd8a6cd91c2e4df64a2c6cb760bfe90e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42344
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:36:30 +00:00
Gabe Black
4b1ac05dfa arch-x86: Let individual reg uops specialize their arguments.
Rather than force all x86 microops to have one destination and two
sources, the second of which is a register or immediate, make it
possible for these microops to pick any combination of those elements by
modularizing the operand aspects of the base class. This prevents having
a bunch of extra parameters and members of the classes, or having a lot
of explicitly laid out classes with various combinations.

This also improves the accuracy/usefulness of Exec traces since register
types and therefore names will be determined correctly.

Also, there was a branchTarget override added to all register uops which
would be used when the macroop was an direct control transfer
instruction. The assumption was that the immediate value of the whole
instruction would be the PC offset, which is not necessarily correct but
is probably a fairly safe assumption.

This override was only provided for all *register* uops though, and
there's nothing saying the last uop in a branch instruction has to be a
a register uop. This change moves that override to the uop base class so
that *any* uop can be last in the macroop and still support branchTarget
correctly (or at least as correctly as a register uop would).

Change-Id: I9d42d22609d511fa757a784c04a5a9874beca479
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42343
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:36:13 +00:00
Gabe Black
fb7eb04f42 arch-x86: Fix x86 build.
Variation of fix by Maximilian Stein:

https://gem5-review.googlesource.com/c/public/gem5/+/45185

Placate gcc, which thinks we're doing something wrong when using
strncpy. Also ensure that fixed size buffers for strings are filled
completely, rather than just filling in the part which holds the string
we want.

Change-Id: I59f51f6a56a3a3e2632eb89ecb6db709fbbd165d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45205
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 04:16:12 +00:00
Gabe Black
0899f4135e scons,tests: Delete support for the UnitTest scons class/function.
There are no more UnitTest()s, and we shouldn't write any new ones.
Delete the function-like class used to set them up.

Change-Id: Ia353cf698c907b5c7f7c383495f611089fa8b019
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45168
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 01:04:30 +00:00
Gabe Black
b8f90fd5e0 misc: Delete the unittest/genini.py script.
It looks like this script was intended to be used to generate config.ini
files from a given gem5 configuration, although some of the functions
and paths it uses are quite obsolete and won't work any more, for
instance m5execfile and the util/pbs directory.

The currently recommended way to generate a config.ini file is to run a
configurtion up to the point it would be generated and then stop it,
that *will* work today, and while it's not necessarily elegant to have
to run a simulation to an arbitrary point and then kill it, relying on
the config.ini itself, an intermediate artifact, is also not
particularly elegant.

Rather than move this script to util or config, either of which would be
a more appropriate home for it, and then also attempting to fix it up to
work with modern gem5, where it may then still sit unused and forgotten,
it's better to just delete it and rely on the other existing method.

Change-Id: I1ae2842730bbe5e76549eb1d962d7d30fb5edfc0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45167
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-08 01:04:25 +00:00
Gabe Black
7f28585843 tests: Remove the stattest "UnitTest".
This "UnitTest" would compile against and exercise the various stats
types in gem5, but did not verify that anything that happened was
correct. It was also not really a unit test in the sense that while it
did try to do something fairly specific, it did that using an
arbitrarily large portion of gem5.

Actual unit tests using the googletest framework are a more appropriate
way to test these mechanisms.

Change-Id: I3b424e9f5ffcf41f7de1cb42e6a222bf1c40054a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45166
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 01:04:20 +00:00
Gabe Black
2a429b9ef5 tests: Delete the nmtest "UnitTest".
This "UnitTest" actually links against all of gem5, and can be used to
look at a binary and find either what symbol goes with an address, or
what address goes with a symbol.

While that could be a useful thing to want to do, there are other ways
to do that with external tools. Also, other than by seeing if this tool
compiles and manually seeing if it returns reasonable results, this
doesn't really actually test anything.

Finally, this is one of the old style "UnitTest"s, quotes intentional,
since while it may try to do a fairly specific thing, it actually
exercises an arbitrarily large portion of gem5 as a whole to do it, does
not self report success or failure, contain any test cases or input data
or expected output, and is not run automatically as part of our testing
suite.

Tests for the underlying classes in the Loader namespace would be/are
more appropriate, and make this test unnecessary.

Change-Id: I48db315d3da440fd26be0a81cc8e07affcacda46
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45165
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-08 01:04:10 +00:00
Gabe Black
d33a693e43 arch,cpu: Rename arch/registers.hh to arch/vecregs.hh.
The only thing still in arch/registers.hh were related to vector
registers. To make it obvious that nothing else should be added, this
change renames the file so that it has the much less generic name
arch/vecregs.hh.

Change-Id: I729697dc576e1978047688d9700dc07ff9b17044
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42686
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-07 19:36:08 +00:00
Sandipan Das
35d8a9fd2f arch-power: Refactor load-store instructions
This changes the base classes for load-store instructions
and introduces two new classes for DS form instructions
which use a shifted signed immediate field as the offset
from the base address and for X form instructions which
use registers for both the offset and the base address.
The formats have also been updated to make use of the new
base classes.

Change-Id: Ib5d1bb5d7747813e0e5b1e3075489f1a3aa72660
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40892
Reviewed-by: Boris Shingarov <shingarov@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-07 13:59:53 +00:00
Maximilian Stein
e63562417a configs: Use MADT in x86 full system simulation
ACPI's MADT describes the interrupt system of a processor/system and
partially replaces the Intel MP tables. The config now simply adds the
ACPI variant, so an OS can use either Intel MP or ACPI for interrupt
configuration.

Change-Id: Ie3d293aac0925666f7661a03eab10218f04c8d0c
Signed-off-by: Maximilian Stein <m@steiny.biz>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42825
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-05-07 13:28:57 +00:00
Maximilian Stein
11315b39f4 arch-x86: Add ACPI support for MADT
This extends the ACPI implementation to support the MADT. This table
contains information about the interrupt system (Local APIC, IO-APIC)
and partially replaces the Intel MP tables.
The change is particularly needed to support other OSes than Linux that
do not support Intel MP.

Change-Id: I132226f46f4d54e2e0b964e2986004e3e5f5f347
Signed-off-by: Maximilian Stein <m@steiny.biz>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41953
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-07 13:28:57 +00:00
Maximilian Stein
6e1b3d7da0 arch-x86: Implement ACPI root tables
The RSDP points to the RSDT (32 bit) and/or the XSDT (64 bit), which are
both instances of the abstract System Description Table.
This commit implements the mechanism to write the three data structures
to memory based on the full system's configuration. The SysDescTable
class acts as base class for the RSDT and XSDT as well as any future
implementation of other System Description Tables.

Change-Id: I710279a72376c04f2a636ff2e96fa80228d03eaf
Signed-off-by: Maximilian Stein <m@steiny.biz>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42824
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-07 13:28:57 +00:00
Sandipan Das
bd99d938c0 arch-power: Add fields for DS form instructions
This introduces the DS field used by DS form instructions
which specifies a signed integer immediate operand.

Change-Id: I0e7a77e7a63fce4e50b7941850c277f556e65724
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40891
Reviewed-by: Boris Shingarov <shingarov@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-07 06:35:20 +00:00
Sandipan Das
73eb5a84cb arch-power: Fix precedence of register operands
When RS and RA are both used as operands by an instruction,
RS takes precedence over RA. In such cases, either both the
register operands are used as sources or RS is a source and
RA is a destination.

This changes the order by giving RS the highest precedence
and will be useful for proper disassembly generation.

Change-Id: If351a03a814653f2f371afa936ec7a5cd4377b3a
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40890
Reviewed-by: Boris Shingarov <shingarov@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-07 06:33:55 +00:00
Hoa Nguyen
808056ce4e util-docker: Use python3 by default for Ubuntu 18.04 docker images
gem5 dropped the support for python2. This change sets python3
to have a higher priority than python2 in the Ubuntu 18.04 docker
images. This is done so that gem5 will be compiled and tested
in the python3 environment by default.

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

Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Change-Id: I11ffb06697ecf4cebf9f98b611641faa42805547
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45125
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-05-06 04:36:43 +00:00
Hoa Nguyen
e9ac090991 base: Add warnings for legacy stats
Legacy stat is defined as a stat that doesn't belong to any
Stats::Group.

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

Change-Id: I8d426882b6bf7600998e181f18d1339ce82d5917
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44706
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-05 21:24:09 +00:00