Commit Graph

17606 Commits

Author SHA1 Message Date
Daniel R. Carvalho
b63a802033 base-stats: Remove info dependency from stats storage
Info depends on the storage type, not the other way around.

Change-Id: Ie3deca17b859a217c0c7bd833c017d9436eee4b0
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27083
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-07-09 11:24:10 +00:00
Daniel R. Carvalho
e9bdc92039 base-stats,tests: Add unit test for Stats::Group
Add a unit test for Stats::Group.

Three bugs were found: groups are able to add
themselves/null groups as their sub-groups, and
one can create a cyclic dependency of sub-groups.

The ADD_STAT macro is not being tested.

Change-Id: I52326994b3f75e313024f872d214e8c45943f44d
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43010
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-09 11:24:10 +00:00
Daniel R. Carvalho
d001f3f575 base-stats,tests: Add unit test for Stats::Info
Add a unit test for stats/info.

One test has been disabled due to not knowing the
expected behavior.

It is important to notice that Stats::Info can have
duplicate names using the new style. Stats::Group is
responsible for not allowing duplicate names in this
case.

Change-Id: I8b169d34c1309b37ba79fa9cf6895547b7e97fc0
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43009
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-09 11:24:10 +00:00
Daniel R. Carvalho
79bab1dc5d mem: Adopt a memory namespace for memories
Encapsulate every class inheriting from Abstract or Physical
memories, and the memory controller in a memory namespace.

Change-Id: I228f7e55efc395089e3616ae0a0a6325867bd782
Issued-on: https://gem5.atlassian.net/browse/GEM5-983
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47309
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-07-09 11:24:10 +00:00
Daniel R. Carvalho
5635b3aaa2 mem: Adopt the memory namespace in qos files
Encapsulate everything qos-related in the gem5::memory
namespace.

Change-Id: Ib906ddd6d76b9d4a56f2eb705efe6cd498829155
Issued-on: https://gem5.atlassian.net/browse/GEM5-983
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47308
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-07-09 11:24:10 +00:00
Kyle Roarty
06da510020 arch-vega: Add decoding for implemented insts
Certain instructions were implemented in instructions.cc,
but weren't actually being decoded by the decoder, causing
the decoder to return nullptr for valid instructions.

This patch fixes the decoder to return the proper instruction
class for implemented instructions

Change-Id: I8d8525a1c435147017cb38d9df8e1675986ef04b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47521
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Alex Dutu <alexandru.dutu@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-09 03:49:29 +00:00
Kyle Roarty
9fe9d83e5b arch-vega: Add missing return to flat_load_dwordx4
Change-Id: Ibf56c25a3d22d3c12ae2c1bb11f00f4a44b5919a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47520
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Alex Dutu <alexandru.dutu@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-09 03:49:29 +00:00
Kyle Roarty
cb73fe1959 arch-vega: Fix s_endpgm instruction
Copy over changes that had been made to s_engpgm in GCN3
but weren't added to the Vega implementation

Change-Id: I1063f83b1ce8f7c5e451c8c227265715c8f725b9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47519
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Alex Dutu <alexandru.dutu@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-09 03:49:29 +00:00
Bobby R. Bruce
8134902e8b tests,util-gem5art: Add presubmit tests for gem5art
Change-Id: I7c10155e74de1a073fda861d498632c1d4be42b9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47223
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-08 19:03:08 +00:00
Daniel R. Carvalho
80b5f43d29 sim: Align coding style of probes
Fix coding style of probes for the following aspects:
- Long lines
- Return type of multi-line functions
- Name of local parameters

Also, added missing overrides

Jira: https://gem5.atlassian.net/browse/GEM5-857

Change-Id: Ibd905d1941fc203ca8308f7a3930d58515b19a97
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38697
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2021-07-08 11:58:25 +00:00
Davide Basilio Bartolini
7bdd8b56e3 base-stats: Add basic test for hdf5 stats
Also rethrow hdf5 exceptions to propagate error message

Related JIRA issue: https://gem5.atlassian.net/browse/GEM5-1028

Change-Id: I67badcf261f04cd446d016a4ad3d7393bad9a6ba
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47740
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-08 10:33:35 +00:00
Davide Basilio Bartolini
86c3f08d13 base-stats: Fix stat descriptions
Change-Id: Ib43dc9261287f10c615786a0d533304ab55ac232
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47741
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-08 10:33:35 +00:00
Richard Cooper
c25ef2d191 arch-arm: Update ARMv8.1-PAN to allow unprivileged instructions.
Update the ARMv8.1-PAN implementation to allow specified unprivileged
instructions to execute even when the cpsr.pan bit is set. The
specified instructions generate memory requests with the
TLB::ArmFlags::UserMode flags bit set.

See sections D5.4.2 (About PSTATE.PAN) and G5.6.2 (About the PAN bit)
of the Arm Architecture Reference Manual for details.
https://developer.arm.com/documentation/ddi0487/latest/

Change-Id: I9e904e0154de72c2e4cc70cbc49b3c8407a3cb1d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47779
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-08 08:48:51 +00:00
Richard Cooper
04a4fb53ad misc: Fix nesting of namespace{} and if-endif.
Fix a build error caused by the misaligned nesting of namespace{} and
if-endif. Previously, if HAVE_TUNTAP is not defined then the gem5
namespace is not closed.

Change-Id: I5e45d2271f97bb9e38c91565adb6aff0a7b43744
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47761
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-08 08:48:08 +00:00
Richard Cooper
704ef29f4f arch-arm: Fix for build error in recent MacOS 11.
On a recent version of MacOS 11, the build fails due to the missing
sysctl.h include. Updated the preprocessor macros to include this file
for __APPLE__ builds.

Change-Id: I985d6c2ea97b82b32750bb562b2051f87d6c2e65
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47760
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-08 08:48:08 +00:00
Richard Cooper
cd76334a2a sim-se: Fix for build error in MacOS.
On MacOS the build fails because the types of readfds, writefds, and
errorfds cannot be automatically converted to fd_set*. Added casts
similar to the ones used for the FD_ZERO calls to help the compiler.

Change-Id: I40a2268f7f2ca1bece1ecafda52dfddf2212364d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47759
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-08 08:48:08 +00:00
Kyle Roarty
ebb6c4b99b gpu-compute: Check for WAX dependences
This adds checking if the destination registers are free or busy
in the operandsReady() function for both scalar and vector
registers. This allows us to catch WAX dependences between instructions.

Change-Id: I0fb0b29e9608fca0d90c059422d4d9500d5b2a7d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47539
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-08 01:18:01 +00:00
Kyle Roarty
02dd6b77ff arch-gcn3,arch-vega,gpu-compute: Move request counters
When the Vega ISA got committed, it lacked the request counter
tracking for memory requests that existed in the GCN3 code.

Instead of copying over the same lines from the GCN3 code to the Vega
code, this commit makes the various memory pipelines handle updating the
request counter information instead, as every memory instruction calls a
memory pipeline.

This commit also adds an issueRequest in scalar_memory_pipeline, as
previously, the gpuDynInsts were explicitly placed in the queue of
issuedRequests.

Change-Id: I5140d3b2f12be582f2ae9ff7c433167aeec5b68e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45347
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-08 01:18:01 +00:00
Kyle Roarty
3f9b03522c arch-gcn3,gpu-compute: Set gpuDynInst exec_mask before use
vector_register_file uses the exec_mask of a memory instruction in
order to determine if it should mark a register as in-use or not.
Previously, the exec_mask of memory instructions was only set on
execution of that instruction, which occurs after the code in
vector_register_file. This led to the code reading potentially garbage
data, leading to a scenario where a register would be marked used when
it shouldn't be.

This fix sets the exec_mask of memory instructions in schedule_stage,
which works because the only time the wavefront execMask() is updated is
on a instruction executing, and we know the previous instruction will
have executed by the time schedule_stage executes, due to the order the
pipeline is executed in.

This also undoes part of a patch from last year (62ec973) which treated
the symptom of accidental register allocation, without preventing the
registers from being allocated in the first place.

This patch also removes now redundant code that sets the exec_mask in
instructions.cc for memory instructions

Change-Id: Idabd35020000764fb06133ac2458606c1aaf6f04
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45346
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matthew Poremba <matthew.poremba@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-08 01:18:01 +00:00
Kyle Roarty
ccfee78f3a arch-gcn3: Read registers in execute instead of initiateAcc
Certain memory writes were reading their registers in
initiateAcc, which lead to scenarios where a subsequent instruction
would execute, clobbering the value in that register before the memory
writes' initiateAcc method was called, causing the memory write to read
wrong data.

This patch moves all register reads to execute, preventing the above
scenario from happening.

Change-Id: Iee107c19e4b82c2e172bf2d6cc95b79983a43d83
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45345
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Alex Dutu <alexandru.dutu@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2021-07-08 01:18:01 +00:00
Daniel R. Carvalho
5ff1fac819 misc: Rename Debug namespace as debug
As part of recent decisions regarding namespace
naming conventions, all namespaces will be changed
to snake case.

gem5::Debug became gem5::debug.

Change-Id: Ic04606baab3317d2e58ab3ca9b37fc201c406ee8
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47305
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 23:18:59 +00:00
Daniel R. Carvalho
7ded9b414c arch-arm: Rename debug variables
Pave the way for a "debug" namespace.

Change-Id: I1796711cbde527269637b30b0b09cd06c9e25fa1
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47304
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 23:18:59 +00:00
Daniel R. Carvalho
444cbe6250 cpu: Add a branch_prediction namespace
Encapsulate all branch-prediction-related files
in a branch_prediction namespace. This will allow
these files to be renamed to drop the BP suffix.

Issued-on: https://gem5.atlassian.net/browse/GEM5-982
Change-Id: I640c0caa846a3aade6fae95e9a93e4318ae9fca0
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47303
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 23:18:59 +00:00
Daniel R. Carvalho
60e4ad955d mem-ruby: Add a ruby namespace
Encapsulate all ruby-related files in a ruby namespace.

Change-Id: If642c9751ecefc35b45c5dd69d85e67813cc5224
Issued-on: https://gem5.atlassian.net/browse/GEM5-984
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47307
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 23:18:59 +00:00
Boris Shingarov
eeedf63c86 cpu: Check for instruction-count events before fetch
Instruction fetch should not commence if there already is an
instruction-count event in the queue.

The most conspicuous scenario where this leads to obvious breakage,
is guest debugging.  Imagine the first bytes in the program pointed to
by _start are invalid instruction encoding, and we pass the --wait-gdb
flag.  Then in GDB we set $pc to point to valid instructions, and we
"continue".  gem5 will abort with "invalid instruction".

This is not how real targets behave: neither software- (e.g. ptrace)
based debuggers, nor low-level (e.g. OpenOCD or XMD connected over
JTAG to debug early initialization code eg when the MMU has not been
switched on yet, etc.)  Fetching should start from where $pc was set
to.  This patch tries to model this behavior.

Change-Id: Ibce6fdbbb082edf1073ae96745bc7867878f99ca
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27587
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-07-07 22:55:06 +00:00
Boris Shingarov
c046e61216 base: Dump page table over RSP
Add a non-standard extension to the RSP protocol: the "." command
requests a dump of the simulated page table.
The dump consists of concatenated records, one record per page table
entry.  Each record contains the entry's "virtual" value written as
hex, followed by a colon (:), followed by the entry's "physical" value
written as hex, followed by a semicolon (;).

At the time of writing, one practical use of this feature (in
combination with the "shared_backstore" parameter) is extremely fast
Miranda-Ingalls simulation of JIT compilers.

Change-Id: I333ed11d4ce671251d0b93cddae3bbcea44ea4ca
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47719
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-07-07 22:54:27 +00:00
Hoa Nguyen
9a2efa07c5 scons: Explicitly add librt to scons
gem5 uses the `shm_open()` funciton from <sys/mman.h>.
This function requires linking to librt.

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

Change-Id: I461400e3cb7474a80a995b264af2e03b19fea29c
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47659
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 21:37:15 +00:00
Gabe Black
1c7c825757 arch,kern: Use CRTP to build open flags tables, not macros.
Change-Id: I433c064c66254c6e082fd6e37b4364576c2fbc3a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45903
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 18:05:51 +00:00
Bobby R. Bruce
4cfe934204 util-gem5art: Update .gitignore to ingore run results
Change-Id: Iedb944c2be7889dbf3d9eaabb78c4a1bc967af3e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47222
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-07-07 17:17:24 +00:00
Bobby R. Bruce
f1f101d981 util-gem5art: Fix the artifact test with incorrect git repo
The gem5art tests add the current repository as an artifact. Previously
this repository was called "gem5art". Since moving to the gem5 repo, it
is now called "gem5". Therefore the test checking the repository name
needed fixed.

Note: We need a better solution for testing gem5art's git functionality.
Using the current repository is not stable, as this fix shows. Noted
in Jira: https://gem5.atlassian.net/browse/GEM5-1013.

Change-Id: I017ff039ccb1c0a290f9aa1a09bd738c1820f88f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47220
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-07-07 17:17:24 +00:00
Bobby R. Bruce
512564fd73 util-docker: Add Python test dependencies to Docker
These are needed to run our Python tests

Change-Id: Ifd6904a59ad3b6217a337bd5e912c3e7e2e10c17
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47219
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 17:17:24 +00:00
Bobby R. Bruce
684ba89390 docker-util: Remove building of GCC 5 and 6 Docker images
Building of these images is no longer required as GCC 5 and 6 have been
dropped.

Change-Id: Ife0331843214fe545c5620a2f77ede3adb436700
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47462
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-07-07 15:48:25 +00:00
Bobby R. Bruce
263be6a994 misc,tests: Remove support for GCC 6
Supporting GCC 7 onwards will allow us to move to the C++17 standard.

Change-Id: I805945230d77dacdc6b0a863153b28276025ecdc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47460
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 15:48:25 +00:00
Giacomo Travaglini
3472fdadc3 arch-arm: Forward declare kvm_vcpu_init
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I6fa5be48498d1a8f9c070e9ded11e8cadd4b89a1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47679
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 08:44:24 +00:00
Giacomo Travaglini
d1cdcb311b misc: Move Mode and Translation from BaseTLB to BaseMMU
This is a step towards moving most of the TLB logic to the
MMU class.

Change-Id: Id6b1fb30aa89960705f165f9738f5b50aa1e6bdb
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46779
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 08:44:13 +00:00
Gabe Black
d58b4f004e misc: Remove typedef (struct|enum) Foo in cpp files.
In C, to refer to a type without a struct or enum tag on the type, you
need to typedef it like this:

typedef struct
{
} Foo;

Foo foo;

In C++, this is unnecessary:

struct Foo
{
};

Foo foo;

Remove all of the first form in C++ files and replace them with the
second form.

Change-Id: I37cc0d63b2777466dc6cc51eb5a3201de2e2cf43
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46199
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 08:35:12 +00:00
Hoa Nguyen
9b1ff519aa scons: Not compiling with systemc when host is RISCV
Compiling gem5 with systemc enabled results in the errors
described in https://gem5.atlassian.net/browse/GEM5-1027.

This change tells scons not to compile gem5 with systemc
when the host ISA is RISC-V.

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

Change-Id: I04e1bc722c9d702472152c9116d89938e8408047
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47660
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 06:09:26 +00:00
Gabe Black
ff3ffc7461 scons: Switch to c++17.
Change-Id: I90d121ab4dbf53f3bd30bcdb5f5101d9c7cdc437
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45902
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-07 05:43:39 +00:00
Giacomo Travaglini
3a72e669dc arch-arm: No need to copy haveLPAE when switching TLBs
When calling the TLB::takeOverFrom, there is no need to
copy the fixed haveLPAE variable as it is a system level
parameter (from ArmSystem) and it is assumed to be the same
for all TLBs (even the switched out)

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I0b010d18ae71e43290f7f76f229c1a231ff42ac0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46899
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-06 12:56:52 +00:00
Giacomo Travaglini
065c9ec3f9 arch-arm: Forward declare kvm_reg_list
The adoption of the gem5 namespace [1] broke aarch64 builds with
the following error:

build/ARM/arch/arm/kvm/base_cpu.cc:198:22: error: aggregate
'gem5::kvm_reg_list regs_probe' has incomplete type and cannot be
defined

In file included from build/ARM/arch/arm/kvm/base_cpu.cc:38:0:
build/ARM/arch/arm/kvm/base_cpu.hh:115:28: note: forward declaration of
'struct gem5::kvm_reg_list'
     std::unique_ptr<struct kvm_reg_list> tryGetRegList(uint64_t nelem)
const;

Forward declaring the struct defined in linux/kvm.hh (included in source
file) in the global namespace, rather than the gem5 one fixes the
problem

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

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I96c7d31aa4810edcf98e23cefeaf4895620b6444
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47619
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-06 12:41:18 +00:00
Daniel R. Carvalho
b8c42ff193 base: Avoid dereferencing end() in findNearest
When used with next_addr, findNearest will return the
next (even larger) address than the nearest larger
address. The problem is that when there is no valid
next, the function was dereferencing addrMap.end().

Fix this by marking next address as 0, since 0 is
not larger than any other address.

Places that use this function should be revisited
to make sure they account for this behavior, as
reported in the following Jira issue:
https://gem5.atlassian.net/browse/GEM5-936

Change-Id: I29ed80ff921b205209aeb5db05ffd3019d8595ce
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43591
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
2021-07-06 09:59:11 +00:00
Daniel R. Carvalho
c89971b0f8 base: Add error messages to BloomFilter::Perfect
Warn the user when they use BloomFilter::Perfect's
parameters incorrectly.

Change-Id: Ib493c5f508e47a5f18e43c023755ef960954f5cc
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44112
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-06 09:59:11 +00:00
Daniel R. Carvalho
4b2118ed4b misc: Remove sim/cur_tick dependency from sim/core.hh
Remove this unnecessary dependency. Fixed all incorrect
includes of sim/core.hh.

Change-Id: I3ae282dbaeb45fbf4630237a3ab9b1a593ffbe0c
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43592
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-06 09:59:11 +00:00
Laura Hinman
5b0596935d learning-gem5: Updated deprecated terms in simple.py
Updated terms include:
-`slave` is now `cpu_side_ports`
-`master` is now `mem_side_ports`
-`int_master` is now `int_requestor`
-`int_slave` is now `int_responder`

Change-Id: Ic5a0d722f3c3c529ecbdc33413b17b4f72180ef3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47639
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-07-05 23:31:33 +00:00
Sandipan Das
711f7a3009 arch-power: Add clone support
This adds support for the clone() system call using
which multiple cpus can be utilized in SE mode. For
this change, it should be noted that Linux on Power
uses the CLONE_BACKWARDS argument order.

Change-Id: Iac91a7d110d9f7a133b8e102ac113f48a431a0d6
Signed-off-by: Kevin Joe <0keik0de@gmail.com>
Signed-off-by: Chetan Agarwal <chetanag35@gmail.com>
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47579
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-05 18:41:35 +00:00
Sandipan Das
80becc6684 arch-power: Update copyrights
Change-Id: Ifabd1e7178b5250767a2b560b57570512b732278
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40948
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:20:26 +00:00
Sandipan Das
bef21a9f1c arch-power: Fix load-store timing sequence
To properly implement load-store instructions for use with
the TimingSimpleCPU model, the initiateAcc() part of the
instruction should only be responsible for performing the
effective address computation and then initiating memory
access.

The completeAcc() part of the instruction should then be
responsible for setting the condition register flags or
updating the base register based on the outcome of the
memory access. This fixes the following instructions:
  * Load Byte and Zero with Update (lbzu)
  * Load Halfword and Zero with Update (lhzu)
  * Load Halfword Algebraic with Update (lhau)
  * Load Word and Zero with Update (lwzu)
  * Load Doubleword with Update (ldu)
  * Load Floating Single with Update (lfsu)
  * Load Floating Double with Update (lfdu)
  * Load Byte and Zero with Update Indexed (lbzux)
  * Load Halfword and Zero with Update Indexed (lhzux)
  * Load Halfword Algebraic with Update Indexed (lhaux)
  * Load Word and Zero with Update Indexed (lwzux)
  * Load Word Algebraic with Update Indexed (lwaux)
  * Load Doubleword with Update Indexed (ldux)
  * Load Floating Single with Update Indexed (lfsux)
  * Load Floating Double with Update Indexed (lfdux)
  * Load Byte And Reserve Indexed (lbarx)
  * Load Halfword And Reserve Indexed (lharx)
  * Load Word And Reserve Indexed (lwarx)
  * Load Doubleword And Reserve Indexed (ldarx)
  * Store Byte with Update (stbu)
  * Store Halfword with Update (sthu)
  * Store Word with Update (stwu)
  * Store Doubleword with Update (stdu)
  * Store Byte with Update Indexed (stbux)
  * Store Halfword with Update Indexed (sthux)
  * Store Word with Update Indexed (stwux)
  * Store Doubleword with Update Indexed (stdux)
  * Store Byte Conditional Indexed (stbcx.)
  * Store Halfword Conditional Indexed (sthcx.)
  * Store Word Conditional Indexed (stwcx.)
  * Store Doubleword Conditional Indexed (stdcx.)
  * Store Floating Single with Update (stfsu)
  * Store Floating Double with Update (stdsu)
  * Store Floating Single with Update Indexed (stfsux)
  * Store Floating Double with Update Indexed (stfdux)

Change-Id: If5f720619ec3c40a90c1362a9dfc8cc204e57acf
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40947
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:20:15 +00:00
Sandipan Das
f019d9f866 arch-power: Add support for trapping user faults
This adds support for trapping into GDB when user-mode
faults such as those pertaining to alignment (SIGBUS),
traps (SIGTRAP) and unimplemented opcodes (SIGILL) are
encountered.

Change-Id: Ieb557abd4173b5acb4be6f0c30964aea1eba71a5
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47359
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:19:56 +00:00
Sandipan Das
065362ddfc arch-power: Add multi-mode debugging support
This adds multi-mode support for remote debugging via GDB
with the addition of the XML target description files for
both 32-bit and 64-bit variants of the Power architecture.
Proper byte order conversions have also been added.

MSR has now been modeled to some extent but it is still
not exposed by getRegs() since its a privileged register
that cannot be modified from userspace. Similarly, the
target descriptions require FPSCR to also be part of the
payload and hence, it has been added too.

Change-Id: I156fdccb791f161959dbb2c3dd8ab1e510d9cd4b
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40946
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:19:47 +00:00
Sandipan Das
6b37a7e02c arch-power: Fix process initialization
During process initialization, special purpose registers
should either be explicitly set or cleared. These contain
flag bits which might have unforseen side effects on the
execution of a program.

Change-Id: If7c5af9a93283a53717cc8cbba4bf373a7e40560
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40945
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-04 18:19:35 +00:00