Commit Graph

19299 Commits

Author SHA1 Message Date
Bobby R. Bruce
d9b6a7ff9e stdlib: Create BaseCPUCore type
This separates the idea of a SimpleCore and a BaseCPUCore. A SimpleCore
selects the correct BaseCPU subclass based on user-specified CPUTypes
and target ISA. The new BaseCPUCore type simply wraps any BaseCPU core
for usage in the stdlib.

Much of the code previously handled in SimpleCore has been moved to
BaseCPUCore.

The `cpu_simobject_factory` method has been moved from AbstractCore to
SimpleCore; a more logical location for this function.

Change-Id: I29ce9e381e7d5e8fe57e0db5deb04ad976b7dab9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62292
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-08-17 20:31:16 +00:00
Bobby R. Bruce
d023d8a3dd stdlib: Remove "CPUType" from AbstractCore
This constraint bound us in many ways. There are many cases where we
want a core in a component which does not correspond to a CPUType
enum value.

This refactoring makes it so only SimpleCore utilizes this.

Docstrings have been updated to reflect this change.

Change-Id: I918c73310fc530dd060691cf9be65163cacfffb4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62291
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-08-17 20:31:16 +00:00
Jason Lowe-Power
d4cde65327 tests: Remove functional tests from Garnet
Garnet doesn't support functional reads. We were getting lucky in our
tests that no functional reads were going to the network. This change
removes the functional read check from the garnet-specific Ruby random
test.

Change-Id: I9c12c4aaab662555a1de58b73813118914ee495f
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62431
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-17 16:47:04 +00:00
Giacomo Travaglini
0ad684a6f2 arch-arm: XPACD, XPACI, XPACLRI do not trap
The HCR_EL2.API and SCR_EL3.API bits do not control the trapping of
those stripping instructions.

Change-Id: I84349937f8c50d63b5b52146743b035d1058fd8d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34055
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Kaustav Goswami <kggoswami@ucdavis.edu>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-08-17 13:30:08 +00:00
Giacomo Travaglini
5bbc326423 mem-ruby: Replace deprecated Stats namespace with statistics
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I5633510c91ba35852a63965bbe508e8965744093
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62311
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-16 16:36:11 +00:00
Bobby R. Bruce
631e6ced3c stdlib: Add the "GEM5_USE_PROXY" seting for download proxy
This patch allows a user to set the "GEM5_USE_PROXY" environment
variable, in the format of "<host>:<port>", to declare a socks5 proxy
server to use when obtaining gem5 resources and the resources.json
file.

Note, this requires the Python SOCKS client module, which can be
installed via `pip install PySocks`.

Change-Id: I13f50d71fb6e0713f6a280ec9d2f0b3049c27eb6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62391
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-08-16 06:04:50 +00:00
Bobby R. Bruce
5dc8833f23 misc: Remove trailing whitespaces from src/Doxyfile
This was causing our pre-commit checks to fail when this file was
modified.

Change-Id: I144bbb72fa81358ef343b979b7a1422704306069
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62332
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-08-15 16:06:44 +00:00
Philip Metzler
50c8d9655e fastmodel: Use current execution state for memory lookup
The previous implementation used the physical memory view when reporting
memory back to GDB. This circumvents MMUs and caches, and leads to wrong
backtraces at the least.

Current architectures support EL3, EL2, and EL1/EL0, and the Iris
interface presents a Msn that corresponds to that (`0x10ff`), see
table "Canonical memory space numbers" in the Iris user guide.

As GDB expects the view of the processor when querying memory (e.g. for
backtraces), this will allow proper backtraces.

Not sure if there is an implicit way of expressing memory attributes
(like in Lauterbach with the access modifiers before address
specifications), or if there is a need to implement special monitor
commands. But for the common use, using `CurrentMsn` should be the
correct choice.

Change-Id: Ibd14c1f94163105539a7fb9132550fe713b5c295
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61951
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-12 05:02:40 +00:00
yiwkd2
1dd30723c4 arch-x86: A bug in rcr instruction of x86 solved.
A bug found in rotate carry right (rcr) instruction of x86 architecture
(src/arch/x86/isa/microops/regop.isa:891)

If realShiftAmt is dataSize * 8, bits function raises an assertion error
because the range is (dataSize * 8, dataSize * 8 - 1), which is invalid.

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

Change-Id: Ida59c56eb042f374c69d4a4d1380f7f770bb911b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62213
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-08-11 10:36:55 +00:00
Giacomo Travaglini
25d2a8366a configs: Enable EL3 in the arm-ubuntu-boot-exit example
EL3 (SECURITY) had been temporarily disabled to address the
FEAT_PAuth trapping issue.

This was caused by the EL3 bootloader not disabling pointer
authentication traps. Now that this has been implemented [1],
we should re-enable EL3 in this example platform

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

Change-Id: I62ee1dddc9b5d2d531f2603da7b2bccb23b3c9f0
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62271
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Kaustav Goswami <kggoswami@ucdavis.edu>
2022-08-11 08:18:03 +00:00
Jui-Min Lee
afd3e17f17 arch-riscv: Fix WFI race condition
Current WFI implementation always put the CPU to sleep even if there's
an pending interrupt. This might cause issue because an interrupt might
happen just before the WFI is executed, and there might not be any
further interrupts to wake the CPU up, so the CPU sleeps indefinitely.

In this CL, we ensure the CPU sleeps only if there's no pending
interrupt at all, regardless whether the interrupt is masked or not. We
intentionally check for masked interrupt as well because a masked
interrupt is also able to wake the CPU up if it occurs after WFI. This
will make the behavior consistent no matter the interrupt comes before
or after WFI.

Change-Id: I74dbc01fed52652101675f1ae8e481b77c932088
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62251
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-08-11 02:36:11 +00:00
Gabe Black
3b7ac7aa54 stdlib: Fix get_supported_isas.
This was equating the presence of the USE_*_ISA variables with the
support of that ISA, without actually checking that variable's value.

Change-Id: I4a19a694fa808de4d962ae2f5b30d9981b036224
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62200
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-08-11 02:21:46 +00:00
Wei-Han Chen
e046342f4f configs: fix fastmodel configs to run with kernel 5.x
The original config can't run under kernel 5.x. Since atomic operation
on fastmodel doesn't work well, I decide to disable related configs
(BROADCASTATOMIC and BROADCASTOUTER) to unblock the boot process.

Change-Id: Ibe622e22ee918446ae4f5a4b7fc8bcacd280ba6f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62211
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-10 06:40:45 +00:00
Wei-Han Chen
b3781ce93d configs: Add ITS in fastmodel cluster
There's a gic-its domain in gem5_vexpress_v2 device tree, thus adding ITS
domain in fastmodel cluster config.

Change-Id: Ieb0221fec2e85710531cef1723c492a07f47290a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62212
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-08-10 06:40:35 +00:00
Gabe Black
13d298e7c4 arch-arm: Implement RegClass based register flattening.
Change-Id: Iba5c74d5b6dccd7de3ff59fea18a0c27c74c56a3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51229
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-08-09 09:18:36 +00:00
Gabe Black
04ef1c7cd1 arch-x86: Implement RegClass flattening.
This implements flattening in the x86 integer and floating point
RegClass-es, as well as adding regName functions for each. These came
from the X86StaticInst::printReg function, and the flattening functions
in the X86ISA::ISA class.

Change-Id: If026e3b44aa64441222451d91e99778f6054d9f0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51228
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-08-09 09:18:12 +00:00
Gabe Black
3c2ce6f381 cpu: Use flattened register IDs in stored results in the checker CPU.
This makes the IDs comparable to ones recorded by the O3 CPU which works
in renamed (and hence flattened) IDs.

Change-Id: If5b028798b1065d8dbaf3a10ec2e22bb8c260ddd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53663
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-08-09 09:18:03 +00:00
Gabe Black
e59f01a55e cpu: Make RegClass able to flatten RegIds.
This makes RegIds and the RegClass-es associated with them responsible
for their own flattening. If they don't need to be flattened (a common
case) then they just mark themselves as already flat and that step can
be skipped.

This will also make it possible to get rid of the (get|set)RegFlat APIs,
since if you want to use flattened registers, you'll either have or
create a flattened RegId and pass it into the same (get|set)Reg method.

By making flattening work on RegIds instead of RegIndexes, this will
also make it possible for registers to start out in one RegClass and
move into another one. This would be useful if, for instance, there were
multiple groups of integer registers which had different indexing
semantics, but which should all end up in the same pool for renaming.

For instance, on x86, there are three distinct classes of FP registers.
They are the MMX registers, the pairs of registers which back the XMM
registers, and the X87 registers. Only the last of these needs
flattening. These could all be treated as different RegClass-es
pre-flattening, and could converge on the underlying floating point
register file post-flattening.

Another example in x86 is that some registers can encode that they
should refer to either the first byte of one register, or the second
byte of another register. This only applies to some registers though,
and so only those would need to go through the flattening step.

Another major advantage is that this removes the need for flattening
functions on the ISA object. Having those, and treating the ISA object
as a TheISA::ISA instead of the more generic BaseISA, was done to make
the flattening functions inline, and to make them fold away in cases
where flattening is not necessary. This new scheme isn't *quite* as
streamline as that, since you'll actually need to check if something is
already flattened. You won't, however, need to check what type the
register is and then look up the right flattening function, so that will
likely compensate.

Change-Id: I3c648cc8c0776b0e1020504113445b7d033e665f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51227
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-08-09 09:17:53 +00:00
Bobby R. Bruce
22dd2065f9 misc: Update CONTRIBUTING.md to mention pre-commit
Change-Id: I4559274190ce38202ea47b0870f5bd51fcf418ef
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62055
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-08-05 04:58:23 +00:00
Bobby R. Bruce
dbee7bea9f misc: Add Black style update to .git-blame-ignore-revs
This commit adds a commit which applied Python Black to all Python
files, to .git-blame-ignore-revs.

.git-blame-ignore-revs contains commits that should be ignored from git
blame. It can be setup using:

```
git config --global blame.ignoreRevsFile .git-blame-ignore-revs
```

Change-Id: I02c309a40ea7d3b9ef3e6ecb05d98e1e333585a9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62052
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-08-05 04:58:23 +00:00
Bobby R. Bruce
c3d6b60927 util: Remove Python file from style hook checks
Since incorporation of Python black to check python files as a
pre-commit (added here:
https://gem5-review.googlesource.com/c/public/gem5/+/61111), we no
longer need to style-check Python via the style hook checks.

Change-Id: Iaf9e454a6274b26e202a4aaac0c891309fbc948f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62051
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-08-05 04:58:23 +00:00
Hoa Nguyen
6ca1138a31 scons: Fix scons ParseConfig error for SCons versions 4.4+
SCons 4.4 changed the ParseConfig user's function signature [1].
The function is now required to take `unique` as a parameter.

[1] d0106a9967

Change-Id: I3fa9fbf77ff3877187e15c63f5414889a53caefa
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62091
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-08-05 04:33:39 +00:00
Gabe Black
244f80dde1 arch: Eliminate the vecregs.hh switching header file.
Delete the headers that are in each arch, and remove it from the list of
switching header files in arch/SConscript.

Change-Id: Ic0089f83e83f76ad6308ecfb5007b5ef11e1d949
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50256
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-04 20:22:59 +00:00
Gabe Black
262463a867 misc: Stop including arch/vecregs.hh and fix transitive includes.
Change-Id: I7854e77517f52b7c19cdb91c67016315391fd87f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50255
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-04 20:22:44 +00:00
Gabe Black
3d7d426fa5 cpu: Generalize how register files are serialized.
Instead of explicitly serializing each type of register explicitly, and
using custom types, etc, store them as generic blocks of data. This lets
us get rid of the final use of TheISA::VecRegContainer and
TheISA::VecPredRegContainer.

Change-Id: I61dbd7825ffe35c41e1b7c8317590d06c21b4513
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50252
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-08-04 20:22:32 +00:00
32a206a2d0 systemc: fix hierarchical binding
Fix hierarchical bindings for multi_passthrough_target_socket. This bug
also was also present in the Accellera implementation in version 2.3.2
but was fixed in 2.3.3. This fix is analogous to the patch applied to
the Accellera implementation.

It allows to complete the binding also for hierarchical bindings.

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

Change-Id: I95497ad4b432b23412f2c0c8a3ef216af3372338
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62031
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-04 12:17:22 +00:00
Andreas Sandberg
d49c8f78fe tests: Use pre-commit to run some tests in Jenkins
The pre-commit tool is able to run style tests in a reproducible
manner. Run pre-commit from Jenkins.

Change-Id: Ia142a6f3b610410b5767515483b90bc3a09f2407
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61113
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-08-03 15:48:29 +00:00
Bobby R. Bruce
787204c92d python: Apply Black formatter to Python files
The command executed was `black src configs tests util`.

Change-Id: I8dfaa6ab04658fea37618127d6ac19270028d771
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47024
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-03 09:10:41 +00:00
Giacomo Travaglini
1cfaa8da83 arch-arm: Remove unimplemented miscreg handling in MSR imm
The checkFaultAccessAArch64SysReg function is now in charge
of returning the Undefined Instruction fault for unimplemented
registers

Change-Id: I75c00c6fbce33d1729a4923eae585260a8461db3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61971
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-02 20:45:51 +00:00
Bobby R. Bruce
e0d74f4b66 misc: Add .vscode to .gitignore
Change-Id: I5d9f14a298bdf57b0c369c20dac3b03c67cc94bb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61931
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-08-02 18:05:39 +00:00
Gabe Black
e425bcabd2 arch,cpu,sim: Store registers in InstRecord with InstResult.
The InstResult knows how to print registers without having to know about
their actual types.

Change-Id: Ib858e32a7b2fabbde4857165b9e88e87294942c8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50254
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-08-02 12:44:25 +00:00
Gabe Black
81e07670b9 cpu: Simplify and revamp the InstResult class.
The InstResult class is always used to store a register value, and also
only used to store a RegVal and not any more complex type like a
VecRegContainer. This is partially because the methods that *would*
store a complex result only have a pointer to work with, and don't have
a type to cast to to store the result in the InstResult.

This change reworks the InstResult class to hold the RegClass the
register goes with, and also either a standard RegVal, or a pointer to a
blob of memory holding the actual value if RegVal isn't appropriate. If
the InstResult has no RegClass, it is considered invalid.

To make working with InstResult easier, it also now has an "asString"
method which will just call into the RegClass's valString method with
the appropriate pointer.

By removing the ultimately unnecessary generality of the original class,
this change also simplifies InstResult significantly.

Change-Id: I71ace4da6c99b5dd82757e5365c493d795496fe5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50253
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-08-02 12:44:16 +00:00
Zhantong Qiu
f698ca9c27 tests: extend the test_hello_se to test on print-this binary
test_hello_se.py:
Added "take_params_progs" to store avaliable isa and the binary names.
Added two new parameters in function "verify_config" to take verifier
and input arguments for the binary.

simple_binary_run.py:
Added a new unrequired args called "arguments" to take input arguments
for the binary. Its default value is [ ] so the
"arguments = args.arguments" in the "set_se_workload" can run without
inputting any args.arguments.

Change-Id: Ib99dc92aa97060de5e1d34d9cac5800b82dab9e6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61771
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-08-02 03:41:02 +00:00
Wei-Han Chen
71e3ff0b7c configs: move cpu a2t, t2g from gic_hub to cpu_hub
Connections between cpu and gem5 lies in gic_hub now, but these are not
related to gic. So I create a subsystem in fastmodel cluster named
cpu_hub, and put those connections (a2t, t2g) there.

Change-Id: I18d9f80ce6f7f7f4a8290d1db5e48962294f43e5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61851
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-08-02 01:52:14 +00:00
Giacomo Travaglini
174adc2993 arch-arm: Revamp TLB invalidation by introducing TLBIOp::match
Most of the invalidation methods in the TLB class are
doing the same thing: looping over all entries, checking if
the entry matches a certain criteria, and invalidating it
in case it does.

The only specific bit is the matching function, therefore
we add a virtual TLBIOp::match method which allows us
to specialize different TLBIs and to provide a single
flush method in the TLB class

Change-Id: I0672ff958742ac7ebff8d30218f75127343f1a58
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61753
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
2022-07-30 08:59:49 +00:00
Giacomo Travaglini
1290d15973 arch-arm: Simplify TLB invalidation with flushMva
The method is no longer calling the lookup method which
had been complicated by the introduction of partial translations.
(which is now called during address translation only)

The lookup method is iterating over all TLB Entries until a non
partial translation is found. Using lookup in flushMva makes it
O(n^2). With this patch we iterate over the TLB entries only once
(making flushMva O(n))

Change-Id: I8f2ae56192812cee231baf6943068abea4d7ef91
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61752
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-30 08:59:49 +00:00
Giacomo Travaglini
bad3e14bd7 arch-arm: Fix IPAS2 invalidation
Fixing invalidation behaviour for the following stage 2 TLB maintainance
instructions

MISCREG_TLBI_IPAS2E1_Xt
MISCREG_TLBI_IPAS2LE1_X
MISCREG_TLBI_IPAS2E1_Xt
MISCREG_TLBI_IPAS2LE1_Xt

1) Do nothing if EL2 is not enabled in the current security state
2) If we are in secure state, the 63 bit of the Xt register selects
the security domain (s/ns) of the invalidated entries

Change-Id: I4573ed60ce619bcefd9cb05f00c5d3fcfa8d3199
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61751
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-30 08:59:49 +00:00
Gabe Black
cc4380b0d6 cpu,arch: Put the name of the RegClass into the RegClass.
Move the name of the RegClass out of constants which belong to the
RegId, and instead store them in the RegClass instances.

Change-Id: I1ddd4bc8467d5e3f178db7a11c8f8052f43fd7ec
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50251
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-07-29 19:30:51 +00:00
Gabe Black
7b1f05a34c arch-arm,cpu: Simplify the RegClass constructor(s).
Replace the two constructors with one that takes the truly mandantory
parameters, and then a function to derive a new RegClass with some sort
of adjustment, currently by adding custom ops, or setting a non-standard
register size.

Because the constructor and the modifier function are constexpr, they
should fold away and not actually create extra temporary copies of the
RegClass in the modifier functions.

Change-Id: I8acb755eb28fc8474ec453c51ad205a52eed9a8e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50249
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-07-29 19:30:27 +00:00
Giacomo Travaglini
e3ff57e477 arch-arm: Further clean up the AArch64 MSR/MRS decode
This is just rearranging special cases bringing them together within
read/write switch statements

Change-Id: I170aea2a251167d41070e35bef13b41353de2342
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61690
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
5a65aae091 arch-arm: Simplify AArch64 decode of unimplemented registers
Those registers are now handled through the fault callbacks

Change-Id: Id07c4d113260b749c24a895ed6e05f52c9f0eb9d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61689
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
d18b915008 arch-arm: Remove unimplemented flag from release dependant regs
We are instead just disabling read write permissions at every EL
if a specific release is not implemented

Change-Id: I677649c270a442dcd519339e2f64fb7927bf69cd
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61688
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>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
b7720a0995 arch-arm: MISCREG_IMPDEF_UNIMPL does not need unimplemented flag
The decode tree is checking for MISCREG_IMPDEF_UNIMPL before the
MISCREG_UNIMPLEMENTED flag

Faulting is handled anyway by the new fault callbacks

Change-Id: I600ac02913c2fd947c3a6b7f1f81111f21bff3f6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61687
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
7c52b0d9af arch-arm: Replace unimplemented+warnNotFail with callback
We are trying to deprecate the use of the MISCREG_IMPLEMENTED
flag.

Rather than using warnNotFail in conjunction with it, we
use the new faulting callback infostructure to deliver
either an Undefined Instruction or a warning with NoFault

Change-Id: Iee80171a6d28c55c9af069653306d6f8085faf78
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61686
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
c7b7314d8b arch-arm: Clear unused WARN_NOT_FAIL flag for AArch64 CMOs
The following AArch64 CMOs were flagged as warnNotFail even
if they are actually implemented and there is no reason
for them to fail:

MISCREG_DC_IVAC_Xt
MISCREG_DC_ZVA_Xt
MISCREG_DC_CVAC_Xt
MISCREG_DC_CVAU_Xt
MISCREG_DC_CIVAC_Xt

This is likely coming from AArch32 (those CMOs are unimplemented in
AArch32).

Please note: this patch is not changing anything behaviorally; the
warnOnFail flag is not considered in AArch64 unless the unimplemented
flag is also set (and this was not the case for those CMOs)

Change-Id: I40396016703b9eb48f69b0eb710d077f8c2b146b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61685
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
ce7448b53e arch-arm: Remove unimplemented flag from AArch64 registers
We don't need to explicitly set the unimplemented flag, we
can just avoid setting any read/write permission and that
will make the register implicitly unimplemented

Change-Id: I10add9f5744a027f893c56c7030cdfb69d79679c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61684
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
ef2573bc95 arch-arm: Convert to the new faulting logic
This patch is moving trapping behaviour modelled in
MiscRegOp64::trap to the MiscRegLUTEntry fault callbacks.

Change-Id: Idfca428e9e6669b747de0255888fc8a85a1f5d07
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61683
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
34f9e3525a arch-arm: Add generateTrap method to MiscRegOp64
Change-Id: I176cdb63284e146ce376344d895fdbf6c42b883d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61682
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
5afff98ee9 arch-arm: Add new trapping bitfields to the HCR register
Change-Id: Ie798594831790ae4ff551f68602b7505f0d4b237
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61681
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
01a0685d75 arch-arm: Use new faulting logic to handle SP_EL0
Change-Id: I518964b3e4d1abe153d2d175c765a6b46157cc3b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61680
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00