Commit Graph

4852 Commits

Author SHA1 Message Date
Giacomo Travaglini
24dfe8a41c arch-arm: Do not use FEAT_SEL2 in SE mode
SecureEL2 doesn't make sense for a userspace only simulation

Change-Id: Ieda56cc6684f7c011b31ca754e971fb9a9fb6899
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51013
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2021-09-30 16:03:41 +00:00
Giacomo Travaglini
abbd0fbad9 arch-arm: Use ArmRelease in the ISA class
This is removing the cached boolean variables from the ISA class.
The ISA is now using a release object.

It is importing it from the ArmSystem in case of a FS simulation,
and it is using its own ArmRelease object in SE mode

This allows us to add/remove SE extensions from python, rather than
hardcoding them in the ISA constructor (in case of SE)

Change-Id: I2b0b2f113e7bb9e28ac86bf2139413e2a71eeb01
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51012
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2021-09-30 16:03:41 +00:00
Gabe Black
1a1ba692c3 sim: Move the MemPools object out of System and into SEWorkload.
This removes the need for all the FullSystem checks in the System class,
and simplifies that class in general.

Change-Id: Ie8a3bc67db9195027d2111009b15ca59221bdeb2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50348
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-30 00:30:49 +00:00
Giacomo Travaglini
152760ee51 arch-arm: Define an ArmRelease class to handle ISA extensions
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I3240853bd2123a6f24b2bb64c90ad457696f0d93
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51010
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-29 22:16:03 +00:00
Giacomo Travaglini
d1ddbdead8 arch-arm: Prefer haveEL over haveSecurity and haveVirtualization
The Arm architecture reference manual pseudocode checks for the presence
of an exception level (EL) over "security" and "virtualization"

Change-Id: Ia91a9d1848eddc40776627208386a13afdaafda3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51009
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-29 07:27:59 +00:00
Gabe Black
ede1ad4b8c arch,cpu,mem,sim: Fold arch/locked_mem.hh into the BaseISA class.
Turn the functions within it into virtual methods on the ISA classes.
Eliminate the implementation in MIPS, which was just copy pasted from
Alpha long ago. Fix some minor style issues in ARM. Remove templating.
Switch from using an "XC" type parameter to using the ThreadContext *
installed in all ISA classes.

The ARM version of these functions actually depend on the ExecContext
delaying writes to MiscRegs to work correctly. More insiduously than
that, they also depend on the conicidental ThreadContext like
availability of certain functions like contextId and getCpuPtr which
come from the class which happened to implement the type passed into XC.

To accomodate that, those functions need both a real ThreadContext, and
another object which is either an ExecContext or a ThreadContext
depending on how the method is called.

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

Change-Id: I68f95f7283f831776ba76bc5481bfffd18211bc4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50087
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-28 19:56:01 +00:00
Matthew Poremba
5a884fdab5 arch-vega: Fix VEGA_X86 build issues
The registerManager was not being dereferenced properly. Also remove
non-existant include file.

Change-Id: I5dac692abedc327ed83ee904e4c6ac5dac811e4c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47105
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-27 22:30:30 +00:00
Matthew Poremba
e51e698b74 arch-vega: Update instruction stats
These stats were moved to a Stats::Group but the instructions were not
updated to use the stats struct.

Change-Id: I49348e30bc0988a2a873f51bd7079c1f315649b4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47104
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-09-27 22:30:30 +00:00
Matthew Poremba
16de253c15 arch-vega: Add missing functions referenced by insts
Some instructions were referencing pc() and isExecMaskRegister() which
were not defined.

Change-Id: Ic5b3fa9057950ff85603fcb87447a81b6c7f274b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47103
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-09-27 22:30:30 +00:00
Matthew Poremba
dca86ddb8d arch-vega: Issue flat insts using on executedAs()
Similar to the flags issue in the previous patch, the FlatGlobal flag
does not exist. Change all of the flat instructions to use the same
issue logic as GCN3. A helper function is also added as loads and stores
use the same interface. The helper function can be more easily updated
to support global and scratch subtypes of flat instructions.

Change-Id: I394f1d4c59b029201fe2f6075c9dedb3a37dbe31
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50827
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Kyle Roarty <kyleroarty1716@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-27 22:30:30 +00:00
Matthew Poremba
753a2c8aac arch-vega: Update Vega instruction flags
The instructions file seems to be assuming a newer pipeline which is not
released. The flags are therefore not set in Vega as the newer pipeline
infers them. This adds back flags for MemoryRef instructions, fixes
waitcnt and removes CondBranch which was not checked and changed to
Branch.

This also removeds unused Cac flags and fixes the casing for ReadsEXEC
and WritesEXEC. The remaining flags are not used at all by the pipeline
and are removed to avoid confusion as to whether these are needed for
GCN3 or not.

Change-Id: I976cbd407a466e8ad77c84dbdc29082f49e28f3b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47102
Reviewed-by: Kyle Roarty <kyleroarty1716@gmail.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-09-27 22:30:30 +00:00
Gabe Black
cc75a47b84 python,scons: Move grammar.py and code_formatter.py into build_tools.
These are only used in a build, and so don't need to be built into gem5.
grammar.py is used by slicc and the fast model project file parser, and
code_formatter.py is only used by SConscripts.

Change-Id: Id43e62459d69f07fdb2ed125548a83e38bbb7590
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49396
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Maintainer: Gabe Black <gabe.black@gmail.com>
2021-09-24 21:23:27 +00:00
Giacomo Travaglini
ee95d0f04d arch-arm: SCTLR.WXN not used in S2AP
Change-Id: I141f7088fce0e7eed01491920f84774394143b4a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50667
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-22 13:22:58 +00:00
Giacomo Travaglini
17a5422bec arch-arm: Implement Armv8.2 FEAT_UAO
Change-Id: I87b25a65e706ed6486347806a540b1dbf25231cb
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50390
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-22 13:22:58 +00:00
Giacomo Travaglini
ee0e92a432 arch-arm: Remove SPSR write mask
We are currently masking out the PAN and UAO field when writing
to the SPSR_ELx register.
This is not needed and we should treat them as RES0 instead if
FEAT_PAN and FEAT_UAO are not implemented

Change-Id: Ib65e3744f365825d2414b8092b3a79324be461b4
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50389
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2021-09-22 13:22:58 +00:00
Daniel R. Carvalho
7a144c5d59 arch-arm: Fix memory leak of PMU events
Memory of PMU events was never being released.

Change-Id: I3cd9583103333008799f0873af3a490f847a21b5
Issued-on: https://gem5.atlassian.net/browse/GEM5-857
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38703
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-22 05:31:01 +00:00
Gabe Black
bec16fbc31 misc: Move MemPool based calls to the SEWorkload.
These currently proxy to the System object, but this is one step towards
moving the MemPool-s out of the System and into the SEWorkload where
they really should have been from the start.

Change-Id: Id27e7b874c283abf07bd892c8467a9cc52e2fdff
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50342
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-21 02:05:32 +00:00
Gabe Black
a024c9f19e arch-arm: Modify the AAPCS32 ABI implementation to use VecElems.
Use the VecElem register file when using the 32 bit ARM ABI. This is not
only consistent with an upcoming change which will make the 64 bit
vector registers and the 32 bit vector elements no longer act as views
into the same data, it also simplifies the implementation a little.

Change-Id: Ie8f17b764402a6331012f13b7605520512c2d5c9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50207
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-21 01:33:34 +00:00
Giacomo Travaglini
136809cc45 arch-arm: Use EL0 permission logic when checking unpriv reference
An unprivileged memory reference (LDTR and STTR) executed at EL1
should be regarded as an EL0 memory access

Change-Id: Iae5e6e582f9c5a57340f27a84db463bcb8996922
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50388
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-20 15:40:05 +00:00
Giacomo Travaglini
fde9e46951 arch-arm: Refactor AArch64 MMU permission check
This refactor of the MMU::checkPermissions64 method is moving
the TLB entry access permission bits (AP,XN...) checking into
new separate stage1 and stage2 helpers

Change-Id: If7d42538f5ea1ec21e918cccaf469fcb6a36d82b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50387
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-20 15:40:05 +00:00
Giacomo Travaglini
6b2faf3723 arch-arm: Remove unused TLBType
The cached state is global now (per-MMU)

Change-Id: I70bc847813086f678b4ff32722b7f6e3ceaae6f5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50527
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-20 09:03:19 +00:00
Giacomo Travaglini
377155c10b arch-arm: Syncronize GIC CPU interface when changing EL
From the GIC architecture specification (ihi0069) [1]

"The assertion and de-assertion of IRQs and FIQs are affected by the
current Exception level and Security state of the PE. As part of the
Context Synchronization that occurs as the result of taking or returning
from an exception, the CPU interface ensures that IRQ and FIQ are both
appropriately asserted or deasserted for the Exception level and
Security state that the PE is entering."

Kudos to Quentin Forcioli for finding the bug

[1]: https://developer.arm.com/documentation/ihi0069/latest

Change-Id: I10444a3aad5c06aabc13e1cbd70a32192531a31d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50508
Reviewed-by: Quentin Forcioli <quentin.forcioli@telecom-paris.fr>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-20 09:03:19 +00:00
Giacomo Travaglini
4000480a2f arch-arm: Define ArmFault::invoke32 to match invoke64
Just providing some symmetry to the ArmFault::invoke method

Change-Id: I244e69eee684b9935bea49cf28c6ed99a01192bf
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50507
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-20 09:03:19 +00:00
Quentin Forcioli
36d65d2976 arch-arm: Fixed EL2S system register trapping.
Prevent a disabled El2S from trapping a system register access from EL1S
This commit is part of series of commit to enable booting OPTEE on gem5.

Change-Id: I0258e15b21dd6a69a3e29e88b753825fad648cfd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49987
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-20 08:01:12 +00:00
Gabe Black
53238f891d arch: Ensure using namespace * doesn't leak from generated ISA files.
Only use "using namespace" with the *ISAInst namespace, not the top
level namespace. Also only using namespace *ISA, and not the gem5
namespace itself. The *ISAInst namespace is already in the gem5
namespace, and so will resolve names in it automatically.

Change-Id: Iebf3c9519c65baba073d73744665f8c98880804c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49887
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-18 19:09:47 +00:00
Jason Lowe-Power
a1fa9f94b8 arch-riscv: Remove unused stats
These stats were unused and caused a warning about legacy stats. From
what I can tell looking at the blame, they were never used.

Change-Id: If2886e91dd776c34354a79a4cbc447ffe5988982
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50068
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-09 15:01:38 +00:00
Gabe Black
00187b7bc3 x86,mem: Replace the x86 StoreCheck flag with READ_MODIFY_WRITE.
X86 had a private/arch specific request flag called StoreCheck which it
used to signal to the TLB that it should fault on a load if it would
have faulted had it been a store. That way, you can detect whether a
read-modify-write type of operation is going to fail due to a
translation problem during the read, and don't have to worry about not
doing anything architecturally visible until the store had succeeded,
while also making sure not to do the store part if the modify part
could fail.

It seems that Ruby had hijacked that flag and had an architecture
specific check which was looking for a load which was going to be
followed by a store. The x86 flag was never intended to communicate that
beyond the TLB, and this nominally architecture agnostic component
shouldn't be reaching into the ISA specific flags to try to get that
information.

Instead, this change introduces a new Request flag called
READ_MODIFY_WRITE which is used for the same purpose in x86, but in
general means that a load will be followed by a write in the near
future.

With this new globally applicable flag, the ruby Sequencer class no
longer needs to check what the arch is, nor does it need to access ISA
private data in the request flags. Always doing this check should be no
less efficient than before, because checking the arch involved calling
into the system object, while checking the flag only requires masking a
bit on the flags which the compiler probably already has floating around
for other logic in this function.

Change-Id: Ied5b744d31e7aa8bf25e399b6b321f9d2020a92f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48710
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabe.black@gmail.com>
2021-09-05 05:29:27 +00:00
Bobby R. Bruce
1853d57dc3 misc: Revert "arch,cpu,mem,sim: Fold arch/locked_mem.hh..."
This reverts commit a3f85217ab,
https://gem5-review.googlesource.com/c/public/gem5/+/48384

The reason for reverting this commit is it causes the Nightly build to
timeout: https://www.mail-archive.com/gem5-dev@gem5.org/msg40344.html

The exact cause of this failure was a stalling with the O3 processor on
ARM. The simulation reaches the following error and repeats until
timeout:

```
build/ARM/arch/arm/isa.cc:2634: warn: context 0: 2136500000 consecutive store conditional failures
```

The "realview-o3-ARM-x86_64-opt" test can replicate this:

```
./main.py run -j8 --uid
SuiteUID:tests/gem5/fs/linux/arm/test.py:realview-o3-ARM-x86_64-opt
```

Change-Id: I9e9a20753c2a25c143e6a73f58716feb41861cde
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49927
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-04 04:37:49 +00:00
Melissa Jost
737cdd7397 arch-riscv: Fixed a bug in pmp.cc
This commit fixes an issue that allowed illegal accesses to the
pmpTable to take place.

Change-Id: If517d0d9579260a8dd8a8d2e0c673564a649a728
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49870
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Ayaz Akram <yazakram@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-03 16:54:56 +00:00
Yu-hsin Wang
a670993522 arch-arm: add size check for AdvSIMD copy
imm5_pos and size are the output of findLsbSet. When imm5 is zero,
imm5_pos and size are 64 which will cause assert fail in the following
bits calls. We detect this case and return an Unknown instruction.

Change-Id: I4ed2513267fff5b5bdb81723617ff74fb9f82482
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49827
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-02 00:51:11 +00:00
Gabe Black
c4852b35dd arch-arm: Remove pointless makeSPs and makeZeros around fixed idxs.
In a few places, the makeSP helper function was being called on a fixed
register index, INTREG_SPX. That method would always return INTREG_SPX,
so this call was pointless.

Similarly, there were calls to makeZero on the fixed index INTREG_X31
which would return INTREG_ZERO.

It's not clear what the intention of this code was, so this change
simply removes the pointless calls, and makes it clearer what value is
actually being used by the instructions.

Change-Id: I604f013430f180566e1cc44939b145bc5f45f637
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49763
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2021-09-01 06:04:38 +00:00
Yu-hsin Wang
41093df363 fastmodel: export CortexR52 reset and halt signals
Change-Id: I44a26bad1a91009dbef586ab5d8eeee60352d51e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49651
Reviewed-by: Earl Ou <shunhsingou@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-01 04:47:54 +00:00
Yu-hsin Wang
f771ed96d7 fastmodel: export CortexR52 ext_slave port
Change-Id: I38788d934424cf264152fc689a3e48b84733f068
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49650
Reviewed-by: Earl Ou <shunhsingou@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-01 04:47:54 +00:00
Yu-hsin Wang
552b93168a fastmodel: add helper class for exporting amba_pv signal
To bridge amba_pv::signal_master_port<bool> with IntPins, we made a
helper class for the purpose. The SignalSender class can be exported as
a gem5 Port, receive the signal, and transfer to fastmodel.

Here's an example showing how it works

*.lisa
```
component
{
  slave port<Signal> reset;
}
```

evs.hh
```
class
{
  SignalSender reset;
}
```

evs.cc
```
constructor(Params &p) : reset(p.name + ".reset", 0)
{
  reset.signal_out.bind(Base::reset);
}

getPort
{
  return reset;
}
```

Change-Id: I0936f9ebb2cd60e975661ae78e590285da697771
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48943
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-01 04:47:47 +00:00
Gabe Black
dd59da928d arch-arm: For semihosting, mask reg value and not index.
In ArmSemihosting::call64, the *index* of X0 was masked to be 32 bits (a
noop), and then read using the TC, where I'm pretty sure what was
intended was to read the value and then mask what was returned.

Change-Id: I66cb845d4e97b1895072bd98de709256625c8e3f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49762
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-31 23:45:00 +00:00
Gabe Black
cd27e47558 arch-arm: Eliminate the INTREG_DUMMY integer register.
This register index was for an integer register which was just something
to return when the result should be thrown away. That's basically what
the zero register is/could already be used for. Replace INTREG_DUMMY
with INTREG_ZERO.

Also, change the type used for an index in SVE memory instructions from
IntRegIndex to RegIndex, since it's not actually storing an integer
register index, and g++ gets upset when you try to compare one against a
value which is out of range for that enum.

Change-Id: Ibdc488a2b55162a5f9e3d355126f6c48a99272a9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49223
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-31 14:42:50 +00:00
Gabe Black
a3f85217ab arch,cpu,mem,sim: Fold arch/locked_mem.hh into the BaseISA class.
Turn the functions within it into virtual methods on the ISA classes.
Eliminate the implementation in MIPS, which was just copy pasted from
Alpha long ago. Fix some minor style issues in ARM. Remove templating.
Switch from using an "XC" type parameter to using the ThreadContext *
installed in all ISA classes.

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

Change-Id: I19ee3a8fbe50a4d7907029c2dd2796d0e98e965f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48384
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-31 11:17:32 +00:00
Gabe Black
9fa9840691 scons: Turn the Blob method into a builder.
Build the blob .cc and .hh files in the same directory as the file
they're based off of. Move the GDB XML files into the arch directories
they go with.

Change-Id: I12fe48873312c3aba5910989d6e3049ebd5e5bbf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48136
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-08-28 04:19:40 +00:00
Gabe Black
28314ace87 fastmodel: Fix for the new gem5 namespace.
Change-Id: Iacb6291e6ee93aecf5208d283eab9c1b5938bb2b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49617
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-28 04:18:12 +00:00
Gabe Black
0eea587189 arm: Add methods to sync vector regs and vector reg elements.
If we've been using one and need to start using the other, this will
sync over the most up to date contents from the old one to the new one.

Change-Id: I8443928ac2d8694ee02fe8d2bf17dbf9a04e5a11
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49145
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-17 00:08:32 +00:00
Gabe Black
b070d1523a arch-x86: Use existing constants to simplify some code in operands.isa.
The "predicate"s for reading/writing some condition code registers were
written with constants which were built up from other constants which
represent individual bits in the condition code register. There are
existing constants which already exactly match those sets of bits, so we
can just use those instead of building up the same thing in-situ.

Change-Id: Iab5a5de04d0fd858414451531a357770ca9fde14
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49244
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-14 11:10:04 +00:00
Gabe Black
3815ad14d7 arch-x86: Fix how MediaOps sets the size of its operands.
Because MediaOps have two sizes, one for sources and one for
destinations, it does not have a single dataSize member to set the size
of its operands. This was difficult to correct at the time, so a
dataSize member was created which was fixed at 0, and the instructions
themselves would use srcSize and destSize internally to do the actual
computation.

That causes problems when tracing, since the printReg function needs to
know what size to use to print some registers properly, specifically
integer registers.

To now fix that problem, some SFINAE constructors have been added which
will either pass through a dataSize member if one exists, or pass
through a pointer to the instruction itself so that operand index
selector class can pick out the member that makes sense for it (destSize
for DestOp, srcSize for Src1Op and Src2Op).

Change-Id: I6b8259a5ab27f809b81453bcf987cc6d1be4811a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49203
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2021-08-14 05:41:54 +00:00
Gabe Black
a759336a08 arch-arm: Fix style in utility.hh.
Change-Id: I66262e63695680f5638ef057be05274445ba38ac
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49144
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2021-08-14 00:35:07 +00:00
Gabe Black
29b20c9742 arch-x86: Stop printing a source operand for the monitor instruction.
Like CPUID, all operands for this instruction are implicit and are not
written out when putting it into assembly. Stop printing a source
operand when generating disassembly in gem5.

Change-Id: I95898afdd9101ad393b3aace99536db602752a64
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49225
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2021-08-14 00:31:43 +00:00
Gabe Black
4ee5461300 arch-x86: Stop printing a source register for CPUID.
When disassembling the CPUID instruction, we were (for some reason)
printing a source register after the mneomic. The registers CPUID uses
are fixed, and it has no operands when written in assembly.

Change-Id: I5aee7f7a93cb84977cfe1fe387c5184aa740bc0e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49224
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2021-08-14 00:31:23 +00:00
Gabe Black
7f540a333d x86: Fix disassembly of syscall instructions.
These *used* to have a source register which was the syscall number.
That was not an actual property of the instruction, it was a property of
the syscall mechanism in Linux which had leaked into the implementation
of the instructions themselves.

That was corrected by removing that source register and letting the
syscall handling layer figure out which system call to invoke.

Unfortunately the SyscallInst format wasn't also updated, and when
printing the disassembly for those instructions, it would try to print
that source register. That instruction doesn't bother to set up a source
operand array since it doesn't actually have any, so that ended up
accessing random memory.

Change-Id: I20890ad69605983305a13f414ca59a5fa35d4d06
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49183
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-08-11 20:23:35 +00:00
Giacomo Travaglini
0a31476e1c arch-arm: Replace std::tie with C++17 structured binding
Change-Id: I856b60e91a0c8089ccc3560bdf9024b42206e170
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49084
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-11 08:20:34 +00:00
Gabe Black
9b1abd4d83 cpu: Use RegVal for VecElems instead of TheISA::VecElem.
If VecElem is a basic type, which is a reasonable assumption, it can be
contained in a RegVal. We still need to use the TheISA::VecElem type to
extract it from an actual vector, but then it can be passed around as a
RegVal.

Change-Id: I4dc470e7cc369499ce3686dd291eb3d93ca0819a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49124
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-11 04:48:02 +00:00
Gabe Black
f183942ab8 cpu: Rename RegClassInfo to RegClass.
Change-Id: I0456462d5d306fc93a1fe160e45ff6b1b49f3c25
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49103
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-09 20:04:51 +00:00
Gabe Black
64168fd4ea scons: Turn the ISA and GPU ISA lists into construction variables.
Change-Id: I4135709f5bceee959b5178a4700656aa782b1d6b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48965
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
2021-08-07 03:12:56 +00:00