Commit Graph

19401 Commits

Author SHA1 Message Date
Matthew Poremba
af4251f6ae dev-amdgpu: Rework SDMA RLC queue data structure
There can only ever be two RLC queues maximum. Use this information for
a simpler data structure to store doorbell information. The patch
changes the std::unordered_map previously used to std::array. This will
also be useful in avoiding erase-while-iterating issues needed to
unregister all queues at once.

Change-Id: I95600e40de51cb1a992a20bcebaf7580ea4d0be8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63172
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2022-09-09 04:13:49 +00:00
Matthew Poremba
12ec5f9172 dev-amdgpu: Rework framebuffer reads
Previously framebuffer reads would try reading from MMIO trace, special
addresses, and then anything previously written to a special address
range. This does not handle direct large BAR reads, causing incorrect
results in some applications that were doing this.

Rework the readFramebuffer method to do the following. Remove the MMIO
trace read altogether, as there were not any framebuffer reads from the
trace to begin with. Read special addresses first to avoid overwriting
by previous writes. Next read previous writes to special ranges. The
special range is the GART table. These are required for functional
translations. Lastly read from the device memory directly. This does a
functional read required by the PCIDevice read method which is
non-timing. Reading from device memory is preferred over the map type
used for GART to avoid duplication of a potentially huge amount of data.

With this changeset all but one of the HIP samples and HIP examples
applications now run and pass verification of results.

Change-Id: Id3b788bfc5eaf17cfa1897f25d26f3725d4db321
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63171
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2022-09-09 04:13:49 +00:00
Matthew Poremba
f91abb9770 arch-vega: Allow unaligned large host pages
The virtual and physical address for device memory are typically aligned
to the page size. On the host (x86), however, the physical address may
not be aligned to page size for large page sizes when mixed with 4kB
pages. As a result, the physical address calculation must add, rather
than bitwise-OR, the virtual page offset to the physical page number.
The virtual page offset on the GPU continues to use the variable page
bytes for masking and shifting.

Change-Id: I6563a1eb43d9b59577d32268b8645a7436304bcb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63034
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-09-09 04:13:49 +00:00
Matthew Poremba
4b35693bd2 dev-amdgpu: Forward RLC queue doorbells
Forward user queue doorbells to the SDMA. This is the final step needed
to enable RLC (user) queues to replace BLIT kernels.

Change-Id: I0c2ef70bb5414b82785ef437dd65d6c57798d24f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63033
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-09 04:13:49 +00:00
Matthew Poremba
a5dfb0718d dev-amdgpu: Add user-mode TranslationGen to SDMA
RLC queue do translation using user mode addresses. To support this, add
the final aperture translation needed to the SDMA engine.

Change-Id: I25841e240e3b44f66d26d503ab52b54379daa49a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63032
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-09-09 04:13:49 +00:00
Matthew Poremba
9ed39afe62 dev-amdgpu: Place all user-mode translations in MMHUB
The memory management hub ("mmhub") is an aperture that aliases the GPU
device memory. MMHUB addresses functionally map to the same device
address, with the exception that it is guaranteed not to overlap with
host memory. This is useful in gem5 for APIs with Addr type as it
prevents sending e.g., DMAs to the wrong place.

Change-Id: Ia296809a8dc2c5fbdeba6d70cd53215f9ab36c93
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63031
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-09 04:13:49 +00:00
Matthew Poremba
e0e2806fc4 dev-amdgpu: Add SDMA device translation helper
Adding a helper function to remove duplicate code in the copy packet
methods. Adds more comments on that code to explain what it is doing.
This could in theory also be used in other packets in the future.

Change-Id: Id0ed50c87260a2f12f53cb14e927f8c49bb99072
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62718
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-09-09 04:13:49 +00:00
Matthew Poremba
f20d12656a configs: Stop disabling SDMA in GPUFS config
Support has been added for SDMA RLC queues which are used for host to
device and device to host "memcpy" calls. Previously the SDMA engine was
disabled which caused GPU BLIT kernels to be called. This removes the
environment variable disabling SDMAs which has two main benefits:

 - It will be much easier to debug host/device transfer by using SDMA
   debug flag.
 - Simulation time is improved since we no longer need detailed GPU
   simulation to copy data and instead are doing a simple large DMA

Change-Id: I7524245731d301b5c26394318f2156ed6b4c983a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62717
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-09-09 04:13:49 +00:00
Matthew Poremba
58e072f8bf dev-amdgpu: Remove default callback in mem manager API
In almost all cases reading/writing using the GPU memory manager will
want to wait until that read or write is complete. Therefore, change the
API to not default to no callback so that the user must explicitly
specify nullptr indicating they do not want to wait for completion.

Updates a write call which cannot use a callback due to being atomic in
the base gpu device code.

Change-Id: Id19145d49c7cafc97e2e178819682cb97270a16a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62716
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2022-09-09 04:13:49 +00:00
Bobby R. Bruce
700f64c1c1 scons: Ensure style_hooks check exits if hook cannot install
If the pre-commit could not be installed the compilation would continue
as the exit code from running the pre-commit install script was not
read or processed. This commit adds a check. If the install is
unsuccessful the users is asked whether they want to continue the
compilation or not.

This check can be ignored with the '--ignore-style'. The tests have been
updated to include this flag in all cases we compile gem5 to ensure
tests remain automated and uninterrupted on Kokoro/Jenkins.

Change-Id: Iaf4db71300883b828b00d77784c9bb46b2698f89
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63012
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-09-08 18:31:08 +00:00
Bobby R. Bruce
92ab557947 configs: Use "arm64-ubuntu-20.04-boot" workload for example
The ARM Ubuntu Boot example was using 18.04. This commit updates this
example script to use the "arm64-ubuntu-20.04-boot" workload, added
here:
https://gem5-review.googlesource.com/c/public/gem5-resources/+/62662

Change-Id: I9cee16f739a5fa9281041fde242b5cd37e5be20b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62665
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-08 17:40:11 +00:00
Bobby R. Bruce
bb60998aa9 configs,tests: Update tests/configs for RISCV boot workload
As of this commit:
https://gem5-review.googlesource.com/c/public/gem5-resources/+/62659
we have a RISCV Ubuntu 20.04 boot workload. This patch applies it to
test scripts and example scripts where appropriate.

Change-Id: Ibf9bed1a978b6d2e456b528f64cf3a9d6dc0e568
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62664
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-08 17:40:11 +00:00
Bobby R. Bruce
af4fd2f2c6 tests,configs: Update x86 boot tests/examples with Workload
As of this commit:
https://gem5-review.googlesource.com/c/public/gem5-resources/+/62658
there is an x86-ubuntu-18.04-boot workload.

Where appropriate tests and example scripts have been updated to use
this workload.

Change-Id: I7c9dc8e0e53b1d3f4c365f0382b5f5d4224436f7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62663
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-09-08 17:40:11 +00:00
Giacomo Travaglini
bfcf5f0b91 arch-arm, kvm: Fix KVM_ARM_IRQ_VCPU2_SHIFT compilation error
After the following patch:

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

gem5 doesn't compile on Arm machines that don't define the
KVM_ARM_IRQ_VCPU2_SHIFT macro as the latter is not guarded anymore.

This patch fixes the problem by amending capIRQLineLayout2 to
rely on KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 only (which makes
sense) and moves back the KVM_ARM_IRQ_VCPU2_SHIFT guard
back to its original place

Change-Id: Ib6b6ef4014c2a54580cb3e5b0167d4ee1f7139ed
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63111
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-07 08:13:15 +00:00
Zhantong Qiu
07b693a186 stdlib, configs: stdlib SimPoints support and example scripts
simpoints-se-checkpoint.py & simpoints-se-restore.py:
These are two example scripts to show how to use SimPoints functions with
the stdlib.

se_binary_workload.py:
Allow se_binary_workload to take in SimPoint Class item and schedule
SimPoint exit events.

exit_event.py:
Added SIMPOINT_BEGIN and MAX_INSTS exit events.

simulator.py:
Added SIMPOINT_BEGIN and MAX_INSTS exit event scheduling functions.
They can schedule exit events before or during the simulation.

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

Change-Id: Iaa07a83de9dddc293b9f1a230aba8e35d4f5af6c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63154
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-09-07 02:20:08 +00:00
Zhantong Qiu
f08a4d2dc5 stdlib: cpu support for SimPoint and MAX_INSTS exit events
BaseCPU.py:
Linked "scheduleSimpointsInstStop" and "scheduleInstStopAnyThread" to
python

base.cc & base.hh:
Added scheduling functions for SimPoint and MAX_INSTS exit event.

abstract_core.py & base_cpu_core.py:
Added scheduling functions for SimPoint and MAX_INSTS exit event for stdlib
processor to access.

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

Change-Id: I98a0f93b46a220fdb3f350d8da359c24b4d66a58
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63153
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2022-09-06 18:48:51 +00:00
Zhantong Qiu
8fa5a8a668 stdlib: added SimPoint Class to stdlib
Added SimPoint Class to store workload needed SimPoints information.
It stores SimPoints starting instructions, SimPoints interval, SimPoints weight,
and warmup length for each SimPoint.

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

Change-Id: I47e4dc0c98801d42acef9b7ccbb629401c61ca40
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63132
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-06 18:48:20 +00:00
Zhantong Qiu
c16b717a60 stdlib: added three exit event generators
In exit_event_generators.py, added a dump/reset exit generator, a save
checkpoint generator, and a default generator for SimPoints.

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

Change-Id: Ie36e853a5ef992d6d293917ef2df2a3a8b8c68b9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63152
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-06 18:46:36 +00:00
Matthew Poremba
3465ff1e7d dev-amdgpu: Add callbacks for all SDMA GPUMemMgr reqs
SDMA write, copy, and ptePde use GPUMemMgr to write to device memory and
were dangerously not waiting for write completion which could result in
data not being completely written to memory, the data buffer being freed
and potentially reused in the simulator, or advancing to the next SDMA
packet before the previous one is complete.

This changeset adds callbacks for the corresponding "done" methods
similar to what the dmaVirt methods call when reading or writing to host
memory to fix this issue.

Change-Id: I44ce14c13f812ea2a7a76438e12a6ed7c6e0bff0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62715
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-03 16:05:58 +00:00
Matthew Poremba
404aa34855 dev-amdgpu: Track outstanding chunks in mem manager
Requests sent using the GPU memory manager are not guaranteed to be
ordered. As a result, the last chunk created by the chunk generator
could complete before all of the previous chunks are done. This will
trigger the final callback and may cause an SDMA/PM4/etc. packet that is
waiting for its completion to resume before the data is ready.

This is likely a fix for verification failures in many applications.
Currently this is tested on MatrixTranspose from the HIP cookbook which
now passes its verification step. It could also potentially fix other
race conditions between reads/writes from/to memory such as using a PTE
or PDE before it is written, etc.

Change-Id: Id6fb342d899db6bd0b86c80056ecf91eeb3026f5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62714
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-09-03 16:05:58 +00:00
Matthew Poremba
432329c853 dev-amdgpu: Allow device address source for SDMA COPY
Now that the memory manager can DMA read from device memory, allow the
linear copy SDMA packet to use device memory as a source. This is used
when copying memory from device to host when SDMA engines are enabled.
This improves simulation performance over using (simulated) BLIT kernels
with SDMA engines disabled.

Change-Id: I1f41b294022f0049d154a401c1dc885abb4f223b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62713
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-03 16:05:58 +00:00
Matthew Poremba
a531ff64c3 dev-amdgpu: Add memory manager readRequest method
This method reads arbitrary sized requests from *device* memory with the
ability to call a callback after the last chunk, similar to writeRequest
method.

Change-Id: I8fc22c45b650a632ea48dbed1e978ceeda34ffdd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62712
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-03 16:05:58 +00:00
Matthew Poremba
4211962f8c dev-amdgpu: Fix translation reading SDMA MQD ("RLC queue")
The RLC queue MQD address is a GART address, not a system address, so it
must be translated through the GART first.

Change-Id: Ie52b0e65ebf57141b8ba6f88a49989813750eeec
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62711
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2022-09-03 16:05:58 +00:00
Noah Katz
db5910dc5f cpu: Fixed false dependency decoder bugs for RISCV
Using the register destination to store an immediate result causes the isa parser to set the destination as a dependency, meaning the destination register from previous instructions must have a ready result before this instruction can issue. I fixed several cases where this occurs by using a non register intermediary value

Change-Id: Id2ccca820a4e072fa2cae81fa9153deb6a8d5c4c
Signed-off-by: Noah Katz <nkatz@rivosinc.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63052
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-03 00:55:09 +00:00
Bobby R. Bruce
5f40935da2 stdlib: Add 'common.Options' as a banned stdlib module
This commit adds the concept of a "banned module" to the stdlib. This
blocks the user from importing modules from elsewhere in the project
with known incompatibility to the stdlib.

'common.Options' has been added to this as 'common.Options' will import
options to an stdlib run which are not supported.

Issue-on: https://gem5.atlassian.net/browse/GEM5-1282
Change-Id: I8f2b1e24d03fab2872c735342dc8a1ff6528fb5d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63071
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-09-02 20:54:51 +00:00
Bobby R. Bruce
36a1b6a73d stdlib: Only set 'sim_quantum' value of KVM cores included
This commit:
https://gem5-review.googlesource.com/c/public/gem5/+/62471
set `sim_quantum` for any simulation done via the Simulator module.
However, this causes issues when setting exit events at a particular
tick. It resulted in the exit being off by the `sim_quantum` value. This
is required for KVM setups but is undesirable for non-KVM setups. Ergo,
this commit ensures the `sim_quantum` is only set in cases where KVM
cores are included in a simulation.

There are two items of note here:

1. When using the SwitchableProcessor the KVM cores may be switched out
   and therefore not accessable via the `get_cores` method. To get round
   this we check if the processor is a SwitchableProcessor and run an
   additionial check that _any_ of the cores in the SwitchableProcessor
   are KVM. This is a big hacky; the Processor API should be changed to
   make this easier.
2. This only partially fixes the problem of exit events being off given
   a specified tick. This will still occur in the case a
   SwitchableProcessor is used containing KVM cores. E.g., non-KVM cores
   will still be "off" when KVM cores are switched out. This issue will
   be addressed in a later commit.

Change-Id: Id966d76cd1630b6c41c5972fa9423c9e48eafaf6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63051
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-02 20:54:51 +00:00
Bobby R. Bruce
5a29fd6f8c util,scons: File util/pre-commit-install error message
The backticked (`...`) pip install command in the error messages was
being parsed by the shell script as a command to run when printed. This
fixes the problem by replacing the backticks with single-quotes.

Change-Id: Ib97f6cf9f8bd0eb8bc1beae70efd5277bb51544d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63011
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-02 18:42:18 +00:00
Bobby R. Bruce
3a1c9ad904 stdlib: Fix 'set_{text/json}_stats_output' in Simulator
These functions were using "os.is_path_exists_or_creatable". This is a
non-existant function. It has been replaced with a simple test to ensure
the specified stats file either exists or is creatable.

Change-Id: I9a1b2c575d18356fdc87c8b1848c09735e0f18e7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62971
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-09-02 18:42:18 +00:00
Gabe Black
d791827f17 scons: Add build_opts/ALL.
This enables all the ISAs, sets PROTOCOL to MI_example, and leaves
BUILD_GPU unset.

Change-Id: Id6243bb1b12fc70b8afee0aa213168ca421aff62
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62201
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-02 10:20:51 +00:00
Gabe Black
e05c6875a5 arch-x86,cpu: Override the int div latency local to x86.
Remove the ISA check when selecting the default integer division latency
for O3. Instead, create a different default FUPool which is specific to
x86.

Change-Id: I1ef9ee94f4b16aebe03e043df5cdc6167efe6e64
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52497
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-09-02 10:20:51 +00:00
Gabe Black
605c7ac88e arch,cpu: Distribute KVM checks and get rid of ISA switch statement.
Because tags don't work properly on SimObject()s right now (which will
be fixed by my SCons series), there are extra checks which manually
exclude files that should be excluded by their tags automatically.

Change-Id: Idb110269d6400ae6892eac994e673121e49b937c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52495
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-09-02 10:20:51 +00:00
Gabe Black
d759b42869 arch: Decentralize the arch tag TagImplies in arch/SConscript.
Put the TagImplies for each ISA in its own SConscript.

Change-Id: I90d72aa6f493ac2c27ec54e3ac02ff8151e2f518
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52494
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-02 10:20:51 +00:00
Gabe Black
190c47270e arch,cpu: Centralize the single arch CPU Simobject files.
The way these were set up, there would be a conflict between SimObject
files with the same name set up for different ISAs.

This change creates a single file which tries to determine how many ISAs
are enabled, and if there is exactly one, it creates a backwards
compatible alias for the ISA specific CPU types.

Change-Id: Iab358c2880d49222e814a98354c81d0f306fe1fc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52493
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-09-02 10:20:51 +00:00
Gabe Black
073c32be2c misc: Replace TARGET_ISA with USE_${ISA} variables.
The TARGET_ISA variable would let you select one ISA from a list of
possible ISAs. That has now been replaced with USE_ARM_ISA, USE_X86_ISA,
etc, variables which are boolean on or off. That will allow any number
of ISAs to be enabled or disabled individually. Enabling something other
than exactly one of these will probably prevent you from getting a
working gem5 binary, but those problems are being addressed in other,
parallel change series.

I decided to use the USE_ prefix since it was consistent with most other
on/off variables we have in gem5. One noteable exception is the
BUILD_GPU setting which, you could convincingly argue, is a better
prefix than USE_. Another option would be to use CONFIG_, in
anticipation of using a kconfig style config mechanism in gem5.

It seemed premature to start using a CONFIG_ prefix here, and if we
decide to switch to some other prefix like BUILD_, it should be a
purposeful choice and not something somebody just starts using.

Change-Id: I90fef2835aa4712782e6c1313fbf564d0ed45538
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52491
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-09-02 10:20:51 +00:00
Giacomo Travaglini
daf0cbb134 configs: Fix segfault when using --standard-switch and --repeat-switch
This is similar to:

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

We should really prune some of these options and take stronger
steps on discouraging se.py usage

Change-Id: Id750fb5731698a17d64ed60e65e1253c620c911e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62915
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-02 09:01:26 +00:00
Jui-Min Lee
c5c9f48e3f arch-riscv: Make ISA class the source of CSR info
Previously, all components assume the info in arch/riscv/regs/misc.hh to
be the single source of CSR info. That will however make adding
non-standard CSRs difficult as all those CSRs will need to go into the
same header & data structure and might conflict with each other.

In this CL, we add two new functions to the ISA class that provide
information about CSR. The rationale is that, the ISA class is already
the owner of CSR data, so it'll also be in a better position to provide
necessary CSR metadata. With the change, we can create two CPU models
with slightly different custom CSRs easily by creating two derived
RiscvISA classes and overriding the two functions.

We assume that, any customized CSR set is still compatible with standard
CSRs, so we could still utilize the same global map if only standard
CSRs are accessed in the use case.

Note that this does not necessarily mean you cannot or should not add
your customize CSRs into the MiscRegIndex enum. You'll usually still
required to do that to give each CSR an unique id. However, the ability
to override CSRDataMap/CSRMaskMap provide an opportunity to remap how
the CSR index encoded in the instruction maps to CSR, and also give you
a chance to make the read/write logic of certain custom CSRs different.

Change-Id: I168188bdb1baed11cb3e217eb021f289a13bb036
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62891
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-02 01:32:13 +00:00
Jiajie Chen
63556899e4 arch-x86: Fix gem5Op not writing to rax in time
This commit adds rax to the destination register of gem5Op and sets the
result correctly. So that in O3CPU, the correct register dependency is
determined and the following instructions can get the correct value.

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

Change-Id: Ic6e094a548648da09ee08e8d5f7d9afa5408b18e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62992
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-09-02 01:13:38 +00:00
Alexandru Dutu
241023329d arch-vega: DS_OR_B32 does not return data
The DS_OR_B32 instruction should not return data. This
changeset updates its implementation.

Change-Id: Ib5fccdbb69cd1ad2639bbf54824dc363a3fbf599
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62656
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2022-09-01 15:16:37 +00:00
Giacomo Travaglini
56de5df7af arch-arm: Properly assign the global tag to TLB entries
Translation entries from regimes with no ASID support are
tagged as global.

For complete translations we cannot simply check for the EL
being EL2 or EL3 as the EL2&0 translation regime does support
ASIDs to differentiate userspace host applications.

We therefore change the LongDescriptor::global method to cover
the EL2&0 case.

We also fix the partial translation logic which was labelling
partial translations as non global without checking for the
translation regime

Change-Id: I9375a34eba6ede97d70ed80e43ce363a57678d55
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62452
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-01 08:27:31 +00:00
Giacomo Travaglini
e0af8bc0ee util: Use dist_bigLITTLE as an example dist-gem5 node
This is one of the steps towards deprecating fs.py usage

With the patch we are updating the commandline and default
kernel + disk image to reflect a more modern version [1]

[1]: https://www.gem5.org/documentation/general_docs/\
    fullsystem/guest_binaries

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I82fd5d232b6fd9a1962d0896a1d9462caad7ebed
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62513
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-09-01 08:07:02 +00:00
Giacomo Travaglini
566cdd81a8 util: Warn line breaking the gem5-dist script
Once the switch node in a dist-gem5 simulation gets started it listens
the first available port starting from the initially supplied one.

To bind full system nodes to the switch, the switch logfile
is parsed for the exact port number.

This is fragile and it broke when the following line:

info: tcp_iface listening on port

changed to

build/ARM/dev/net/tcp_iface.cc:97: info: tcp_iface listening on port

This patch is fixing the problem with a more robust regex matching

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I2721b3c04653ac1e09878e80d8b1ea34ec1a0f73
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62512
Maintainer: Jason Lowe-Power <power.jg@gmail.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-09-01 08:07:02 +00:00
Giacomo Travaglini
0dc2a87666 dev-arm: Fix PCI range in VExpress_GEM5_Foundation
When we added the PCI mem range in the VExpress_GEM5_Foundation [1], we
meant to add a 256GiB region starting at 0x40 0000 0000.

By mistake the end address was set to 0x8 0000 0000 rather than
0x80 0000 0000

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

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I848b8fee11fb742939c9343aae4ee5205aa836e4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62511
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-09-01 08:07:02 +00:00
yiwkd2
411e986a91 stdlib: Add PrivateL1SharedL2CacheHierarchy
This is implemented based on PrivateL1PrivateL2CacheHierarchy

Following modifications are made.

* The associativities of caches are parameterized
* Only single L2bus and L2cache exist
* Connections of L2cache (i.e., l2bus - l2cache, membus - l2cache) are
done out of for loop which is repeated num_cpus times.

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

Change-Id: I1307954ffff4fab2bf5f61e225881b03a352a1e1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62655
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-01 03:22:56 +00:00
yiwkd2
9f206c2bfc mem-cache: Fix description for writeback_clean.
The description explains when we have to set this True (when a
downstream cache acts as a victim cache). Also, it describes general
(default) setup, but this seems inaccurate and not consistent with
default vaule.

Change-Id: I389adb0af0d6421e8a9672c4cf5d23510eb38242
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62832
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-01 03:22:29 +00:00
yiwkd2
a39f68d5fb stdlib: Fix default values in classic caches
By default, caches in classic memory system are assume to be a mostly
inclusive cache with respect to their upstream caches.
Therefore, `writeback_clean` should be `False` by default, which is
consistent with src/mem/cache/Cache.py

Change-Id: I1395690f7f5fafee7fb151906302877ada953861
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62831
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-01 03:22:07 +00:00
Bobby R. Bruce
86a8da1a32 tests: Improve Resource Downloader Test Suite
Theses improvements are:

1. Renames the test suite to the correct "ResourceDownloaderTestSuite".
   This was correctly named MD5FileTestSuite due to a copy-and-paste
   error.
2. Adds the `setUpClass` and `tearDownClass` from the Python's unittest
   framework. These are used to create the simple "resources.json" file
   used for testing, set the "GEM5_RESOURCE_JSON", and delete these when
   the test is complete.
3. The tests have been updated to utilize the improvements added in 2.

Change-Id: Ia54e45892452bf23b54c8b5a6bb4a94910d83c5f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62651
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-31 02:08:25 +00:00
Bobby R. Bruce
329a917c71 stdlib: Add Workload to the stdlib
This commit adds the concept of a "Workload" to the stdlib. Workloads
specify the details needed to run a particular gem5 workload on an
stdlib board. These are specified as part of gem5-resources and loaded
via the `Workload` class though can be specified locally via the
`CustomWorkload` class.

Tests are included in this commit to verify the functionality of these
Workloads.

Change-Id: I8840d281eb01ee4138f01ee499cae96bf7e0579d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62532
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-31 02:08:25 +00:00
Bobby R. Bruce
eb1242d96a stdlib: Remove deprecated "artifact" type
Change-Id: I40331242912d330bcd3924587c85211732e93f6f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62531
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-31 02:08:25 +00:00
Ayaz Akram
291be70b1e stdlib: fix HBM2Stack component get_mem_port
This change makes sure that the ruby directory controllers
see the entire address range covered by a single HBMCtrl
(including two pseudo channels/dram interfaces)

Change-Id: I89d01d7bc78e98ee0ef6113dc0c97de6acf2e256
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62873
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-30 09:01:49 +00:00
Jason Lowe-Power
74bdd087f9 configs: Fix stat names after switchable changes
b6e0e72d9 changed the names of the switchable processor cores. This
change updates the stats after the nightlies failed.

Change-Id: If349ff07dea08ad3999e02ee95da389bab903b3e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62791
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-28 14:04:23 +00:00