Commit Graph

19547 Commits

Author SHA1 Message Date
Matthew Poremba
8899291db6 dev-amdgpu: Fix interrupt handler address assignment
The interrupt handler's base address is sent via MMIO and must be
shifted by 8 bits to convert to a byte address. The current code is
shifting the MMIO dword first then assigning, resulting in the top 8
bits being shifted out.

This changeset fixes the issue by assigning the dword to the 64-bit
address first then shifting after. Similarly, the upper dword is cast to
a 64-bit value first before shifting.

This fixes some "fence fallback timeout" errors in the m5term output.
These timeouts become a problem because the driver will reset after a
few hundred of them, killing any running GPU applications as part of the
process.

Change-Id: I0beec313f533765c94063bcf4de8c65aacf2986b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65092
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-11-01 15:34:08 +00:00
Yu-hsin Wang
91cd599f05 systemc: sync the response error between gem5 packet and tlm payload
For now we don't return the correct error status to the upstream of the
protocol conversion bridge. This prevents from the requestor to
distinguish if the response is good or not. This change fixes the issue.

Change-Id: Iec2a388b50fb1bd4fd97ece19e9061138b0b0a1f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64591
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Earl Ou <shunhsingou@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-11-01 05:51:27 +00:00
Yu-hsin Wang
80c3bd3bdf mem: introduce bad command error to packet commands
The bad command is used to model a request is sent to target but the
target cannot make it. The bad command error is designed to model AXI
SLVERR.

Change-Id: I8142df36a5ed3e461493796266821a2b30a3415e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64872
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Earl Ou <shunhsingou@google.com>
2022-11-01 05:51:20 +00:00
Matthew Poremba
144ce7f12c dev-amdgpu: Fix GART PTE size
The GART table is a legacy 1-level page table primarily used for
supervisor mode accesses to GPUs. The PTE size is 64-bits, not 32-bit.
This causes memory sizes >3GB (in X86) to fail loading amdgpu driver.

This changeset fixes the issue by setting the GART mappings to the
correct data type.

Change-Id: Ibfba2443675fe28316d26afa5f1a14885fdce40c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65091
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2022-10-31 14:40:30 +00:00
Matthew Poremba
7b16b17e61 dev-amdgpu: Chunkify SDMA copies that use device memory
The current implementation of SDMA copy calls the GPU memory manager's
read/write method one time passing a physical address as the
source/destination. This implicitly assumes the physical addresses are
contiguous which is generally not true for large allocations. This
results in reading from/writing to the wrong address.

This changeset fixes the problem by copying large copies in chunks of
the minimum possible page size on the GPU (4kB). Each page is translated
seperately to ensure the correct physical address. The final copy "done"
callback is only used for the last transfer. The transfers should
complete in order so the copy command will not complete until all chunks
have been copied. Tested and verified on an application with a large
allocation (~5GB).

Change-Id: I27018a963da7133f5e49dec13b0475c3637c8765
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64752
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-31 14:30:24 +00:00
Matthew Poremba
6a4a12ebbd arch-vega: Improve non-native page size support
Vega allows for any integer multiple of 4kB pages. However, the current
implementation is designed for 4kB page primarily. In order to support
variable page sizes, the physical address calculation needs to be
updated to add the virtual page offset to the base physical address
rather than bitwise-OR. Bitwise-OR assumes physical pages are at
aligned to the page size which is generally not the case for very
large pages (1GB+).

This changeset changes all of the physical address computations to add
the virtual offset to the physical page address. This fixes many GPUFS
applications which use larger pages. The support was tested by
hipMalloc'ing ~5GB to induce a large page being created. The test
application now passes verification with this change.

Change-Id: Ic8d1475e001def443f3e4ab609449bca0c40b638
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64751
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-31 14:30:13 +00:00
Earl Ou
6fd2a64656 mem: implement ThreadBridge
ThreadBridge is used for communication between two SimObjects from
different threads (EventQueue).

Change-Id: I3e00df9184404599dfacef64b505cd0b64ee46aa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65071
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-31 01:05:16 +00:00
Bobby R. Bruce
3ab6a7496b stdlib: Move setting of checkpoints to set_workload funcs
It never made much sense to set checkpoint via the Simulator module as
Checkpoints are very tightly coupled with the Workload being run. This
change therefore moves the checkpoint to the set_workload functions.

Setting checkpoints via the Simulator is deprecated and will be removed
in a future release.

Change-Id: I24d2133b38a86423d3553ec888c917c5fe47b93d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64571
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-10-28 00:16:44 +00:00
Melissa Jost
ceac4b8f1a stdlib,configs: Update simpoint example to use the Workload
With the inclusion of the "x86-print-this-15000-with-simpoints"
workloads (introduced here:
https://gem5-review.googlesource.com/c/public/gem5-resources/+/64531)
This patch utilizes this workload for the simpoint examples.

Change-Id: I5e2c4a48206fd7108a33a4a64ac64235ea9f1f33
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64552
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-28 00:16:44 +00:00
Bobby R. Bruce
36e5feb0de stdlib: add 'get_simpoint' function to se_binary_workload.py
This function is necessary to obtain the workload from a board once set.
This is a stop-gap solution to get SimPoints working with SE workloads
but will need revision when implementing this functionality for FS.

Change-Id: Ided2b1a5867655a98730879524e0be61c3f20295
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64551
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Melissa Jost <mkjost@ucdavis.edu>
2022-10-28 00:16:44 +00:00
Melissa Jost
f1be0c808a stdlib: Added set_se_simpoint_workload to SEBinaryWorkload
Change-Id: I815d4aff655e96619a44fc6fc04b674a794056a2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64432
Reviewed-by: Melissa Jost <mkjost@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-10-28 00:16:44 +00:00
Bobby R. Bruce
87e774c1d5 arch-x86,sim-se: Add clone3 syscall
This also expands the syscall table for x86 to 450.

The clone3 version of the syscall puts the parameters in a struct. This
pulls out the parameters that gem5 uses and updates a couple of other
places with new flags and structs.

Reference:
https://github.com/torvalds/linux/blob/master/arch/x86/entry/syscalls/syscall_64.tbl

This is part of the reason for the failing Nightly tests:
https://jenkins.gem5.org/job/nightly/392/, triggered by updating the
tests to use Ubuntu 22.04

Change-Id: Ia934d54c391c6bd4f655bf65538d85371b6dbfb9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64931
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-10-27 23:57:43 +00:00
Giacomo Travaglini
c2541a8175 arch-arm: Use ThreadContext in ArmISA::currEL implementation
This is partly reverting a previous patch [1] which was
moving most functionalities within the ISA class.
This evidently does not work well with thread context implementations
which are bypassed by the ISA objects as noted by [2]

[1]: https://gem5-review.googlesource.com/c/public/gem5/+/53624
[2]: https://gem5-review.googlesource.com/c/public/gem5/+/64653

Change-Id: I0c91c76f690542219ffbbf53359531d9dea9e86d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64914
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-10-27 15:33:18 +00:00
Giacomo Travaglini
506bd9d9e7 dev-arm: Use ThreadContext instead if ISA in GICV3 cpu interface
Some CPU wrappers like the Fastmodel one do extend the
ThreadContext interface in order to retrieve system register
state... By bypassing the TC interface and by using the ISA
instead, we are basically forcing users to extend the ISA
as well to intercept these calls.

So with this patch we are making sure every system register is accessed
(like HCR_EL2 or SCR_EL3) through the thread context. This of course
does not apply to the CPU interface registers as we still use the ISA
storage for them.  In the future we should probably move that storage
from the ISA class to the Gicv3CPUInterface class itself

This is also simplifying Gicv3CPUInterface::isEL3OrMon:
currEL already covers the AArch32 case so no need to
differentiate between AArch32 and AArch64

Change-Id: I446a14a6e12b77e1a62040b3422f79ae52cc9eec
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64913
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-10-27 15:33:18 +00:00
Giacomo Travaglini
8a78358a30 arch-arm: Allow TarmacTracer to dump trace to a file
This patch is adding an outfile parameter to the TarmacTracer
This has 3 options:

1) stdoutput = dump to standard output (default behaviour)
2) stderror = dump to standard error
3) file = dump to a file. As there is one tracer per CPU,
this means every CPU will dump its trace to a different file,
named after the tracer name (e.g. cpu0.tracer, cpu1.tracer)

It is still possible to redirect to a file with option 1 and 2
thanks to common bash redirection. What the third option is
really buying us is the capability to dump CPU traces on
separate files, and to separate the trace output from the debug-flag
output

Change-Id: Icd2bcc721f8598d494c9efabdf5e092666ebdece
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63892
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-10-27 15:33:06 +00:00
Giacomo Travaglini
9a9de78811 dev-arm: Implement System Security Control registers
This block of system registers is part of the N1 SDP [1]

[1]: https://developer.arm.com/documentation/101489/0000/\
    Programmers-model/System-Security-Control-registers

Change-Id: I2ecf5cd247bd68eddcd359e91f3954070dbffaa8
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64951
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-10-27 10:33:38 +00:00
Giacomo Travaglini
4db981576e arch-arm: Setup ThreadContext in GICv3 cpu interface
Change-Id: If019b4b114031f880dff43e05658a162c201ea6a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64912
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-27 10:31:10 +00:00
Giacomo Travaglini
62ce119139 arch-arm: Always use AArch64 version of HCR/SCR
We are slowly replacing AArch32 code in favour of AArch64.

Change-Id: I2857a198a0169e882e5f997debc76808244ab42d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64911
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-10-27 10:31:10 +00:00
handsomeliu
a13549ebef scons: Capture TMPDIR envvar
During gem5 build, the compiler may produce some large intermediate
files. The default path is /tmp, but in some usecase, it's under a small
file system, and we may want to change the storage path to a sufficient
large file system. This CL captures TMPDIR environment variables, to
allow users change the default temporary directory.

Change-Id: Ib3fad301f36df9f3f08eb9b6cfeb4df1b7df5d1a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64873
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-27 09:17:41 +00:00
Mahyar Samani
32e4ac65a8 tests: Adding trusted stats for stats tests.
This changes adds the trusted stats required for comparing the
output stats from each test.

Change-Id: Id85f84f3086481f5d4b8eb7ee36e7a6f862782cc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58569
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-10-25 01:08:11 +00:00
Mahyar Samani
a3d2f68120 tests: Adding tests for gem5stats.
This change adds the first of many tests for the gem5stats.
The current test only considers a setup consisiting of
traffic generator, cache and memory.

Change-Id: I3ebe16131aed5bf6dad68de673f9491f1bea1c78
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55743
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2022-10-25 01:08:11 +00:00
Zhantong Qiu
84acdd4836 stdlib: add SimPoint checkpoint generator
The previous SimPoint warmup length was limited by the gaps between
the starting instruction of one SimPoint and the ending instruction of
the SimPoint before it. This was to prevent duplicate SimPoints, but it
can significantly limit the warmup length.
In this commit, the warmup length limitation will be extended to the
starting instruction of one SimPoint regardless of the gap between
SimPoints.
A SimPoint checkpoint generator is created to help taking checkpoints
for SimPoints and make sure multiple SimPoint checkpoints are taken
when there are multiple SimPoints sharing the same starting instruction

Change-Id: If95f6813e8cbf5c01e41135c1b1bb91ed2e950ad
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64351
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2022-10-22 00:23:19 +00:00
Sascha Bischoff
eed80d083e arch-arm: Set ZCR_ELx before updating vector length in decoder
For SVE it is possible to override the run-time vector length (VL) per
exception level by setting the value in the appropriate ZCR_ELx
registers. In general instructions query the appropriate registers
during execute() to determine the actual vector length. The exception
to this rule are the SVE Macromem instructions which use the VL to
determine the number of micro-ops to crack into during
decode. However, as there is no available ExecContext during the
decode stage these instructions rely on a cached value stored in the
decoder.

Previously we were updating the VL in the decoder using potentially
stale values of ZCR_ELx by calling the update before actually setting
the registers themselves. We now set the registers before updating the
decoder.

Change-Id: I0167095699f7f950ee99fc42c7c8292fe8938d28
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64331
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-10-21 16:07:54 +00:00
Bobby R. Bruce
c021bb6099 tests: Update presubmit.sh to use Clang-14
As of https://gem5-review.googlesource.com/c/public/gem5/+/64176 we now
support Clang-14. This patch therefore updates the Kokoro tests to
utilize this for the `ALL/gem5.fast` compilation. This should help catch
Clang compilation errors earlier.

Change-Id: I6b5bac47565823bbd413e006cfe577468b1bbb70
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64292
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-20 19:10:03 +00:00
Bobby R. Bruce
21cb85f201 tests: Updating the tests to use Ubuntu 22.04 docker image
As of https://gem5-review.googlesource.com/c/public/gem5/+/64177 we
support version 22.04. This patch therefore updates the testing
infrastructure (kokoro/quick, nightly/long, weekly/extra-long) to use
the Ubuntu 22.04 docker image.

The "jenkins/gem5art-tests.sh" test script has been updated to no longer
require the `pip upgrade`. This was needed for Ubuntu 20.04 as it
utilized an older version of pip which did not have all the dependencies
these tests requried. As of Ubuntu 20.04 this is no longer required.

Change-Id: Ia8f8b1b2c62ad5d5a8419cb31b6a1d2b6dff7ac9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64291
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-10-20 19:10:03 +00:00
Jason Lowe-Power
042d1433b9 arch-x86: Fix CPUID for most recent GLIBC
This change makes the default vendor string AuthenticAMD.

GLIBC now is much more strict about checking for the current system's
supported features. In Ubuntu 22.04, when trying to load a dynamically
linked file, the CPUID is checked for the required features. If they are
not there, an error saying ISA level too low is returned and the program
crashes.

The underlying issue is that GLIBC does not check and populate the
cpu_feature data structure if it does not detect a *known* CPU model.
The options are hardcoded. See the following file for the glibc code.

glibc/sysdeps/x86/cpu-features.c

Note that the cpu_features is not populated with the
COMMON_CPUID_INDEX_1 unless there is a known family, which is only set
if the vendor string matches a known vendor.

This change uses AuthenticAMD instead of the alternatives because the
checks in glibc are most simple (no special cases) for AuthenticAMD in
the init_cpu_features functions.

GLIBC has been unable to populate the cpu_features datastructure
correctly with gem5 for a long time. However, this has just now become a
problem for us because the library now is more strict on not allowing
code to execute unless the processor meets certain minimum requirements.

I believe the commit for GLIBC which caused this breakage is
ecce11aa0752735c4fd730da6e7c9e0b98e12fb8
See https://sourceware.org/pipermail/binutils/2020-October/113593.html
for more details on that commit.

Change-Id: I8eedb46f577361e749ad8d0adda4fd0753e99960
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64831
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-20 19:10:03 +00:00
Bobby R. Bruce
ebc2ad4165 arch-x86: Ignore Linux X86-64 syscall 334 "rseq"
Change-Id: Ibfba48de7d24e582a55bc6f2a9535891c42e89f7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64772
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-10-20 19:10:03 +00:00
Bobby R. Bruce
ed89490222 arch-x86: Expand Linux X86-64 Syscalls up to number 334
Change-Id: Ie5f102903362e5253aec62e931cfbf03e899106d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64771
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-10-20 19:10:03 +00:00
Jason Lowe-Power
1bb68ff893 stdlib,mem-ruby: Add DVM TBEs to CHI in stdlib
Change-Id: I12c7cf3aff5450c73c626c5272ae34d84dc612c3
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64691
Reviewed-by: Tiago Muck <tiago.muck@arm.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-20 02:34:26 +00:00
Jarvis Jia
a68e842332 mem-ruby: Fix replacement policy in MESI_Two_Level
The current MESI_Two_Level protocol's L1 caches updates the MRU information twice per request on misses -- once when the request reaches Ruby and once when the miss is returned from another level of the memory hierarchy.

Although this approach does not cause any correctness bugs for replacement policies like LRU since this request is the LRU in both cases, it does not work correctly for other policies like SecondChance and LFU, where updating the information twice (for misses) causes them to devolve to LRU.

Note that this was not directly a problem with Ruby previously, because it only supported LRU-based policies that were unaffected by this.  However, with the integration of 20879 Ruby now uses the same replacement policies as Classic (which has additional, non-LRU based replacement policies).

This patch resolves this problem by not updating the MRU information a second time for the misses. It has been tested and validated with the replacement policy tests.

Change-Id: I9e7e96a9d6c09f3d6b7daae7115ef091ac3bdc08
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64371
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-10-20 01:03:39 +00:00
Bobby R. Bruce
6840c5e7ea tests: Fix verifier '_iterable_regex' func for None regex
In the case where no regex was specified (i,e., `regex == None`), the
`_iterable_regex` function returned `None`. For the testlib to work this
function must return an iterable.

Without this patch it is not possible to compare two files without a
specifying a regex.

Change-Id: Ibc8a2f783c3b786dbdca6a4284850b594024f2f9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64851
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-10-20 00:45:45 +00:00
Jason Lowe-Power
dd4f3d1fa4 configs: Add example memory traffic runscript
This simple example shows how to use the test board to test the
bandwidth for an HBM2 pair of pseudo channels

Change-Id: I6235d0cb11909f5b4cc6442e419496c77425ba37
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64018
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2022-10-18 21:40:59 +00:00
Jason Lowe-Power
b3372a7053 stdlib: Update TestBoard to work with Simulator
This change makes minor updates to the TestBoard so that it can work
nicely with the Simulator module.

This change also makes the cache hierarchy optional for the TestBoard.

Change-Id: If46d53779164e87b6fc06176355be6b4ae05aa99
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64017
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Mahyar Samani <msamani@ucdavis.edu>
2022-10-18 21:40:59 +00:00
Jason Lowe-Power
b8e6e3aa43 python: Update -c to work like normal python
In python, when you use -c it consumes all subsequent parameters and
appends them to argv. Now, gem5 and python behave the same with -c.

Python:
> python -c "import sys; print(sys.argv)" --hello -j
['-c', '--hello', '-j']

gem5:
> gem5.opt -c "import sys; print(sys.argv)" --hello -j
gem5 Simulator System.  https://www.gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 version [DEVELOP-FOR-22.1]
gem5 compiled Oct 17 2022 15:47:46
gem5 started Oct 17 2022 15:53:45
gem5 executing on challenger, pid 4021103
command line: build/ALL/gem5.opt -c 'import sys; print(sys.argv)' --hello -j

['-c', '--hello', '-j']

Change-Id: I53e87712be9523e0583149235c9787c92618f884
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63151
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-10-18 18:00:02 +00:00
Yu-hsin Wang
32e7ce3f19 fastmodel: improve debug message for resource not found
The conversion logic between gem5 register id and iris resouce id is
duplicated in read and write function. Some of them also doesn't handle
the invalid id correctly. This change wraps the logic, fixes them, and
improves the debug messages by printing the register names.

Change-Id: I093d05f5f06d804d5f01988c2a7ffa60244c5516
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64651
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
2022-10-18 12:11:25 +00:00
Yu-hsin Wang
ca31ce92a1 scons: fix systrace header test
Latest compilers default checks the unused and uninitialized. Those
checks result in false negative of the header test. We fix it by
replacing the temp variable to (void *)1.

Btw, (void *)0 not works here because the function is declare with nonnull.
https://elixir.bootlin.com/glibc/latest/source/debug/execinfo.h#L38

Change-Id: I3b51faf7595b861bfbd131c0a42fd6d78a5e9698
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64652
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-10-18 12:11:25 +00:00
Jason Yu
bc914c949f sim,sim-se: Fixes the bug of missing "/" in path resolution
The syscall emulation did not correctly handle the scenario where the
base path does not end with "/". The "/" should be appended first
before the file name is appended. This commit fixes this bug.

Change-Id: I9a9b38d1885e46b2a0e42018fd7d68010c70133c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64471
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2022-10-18 05:49:24 +00:00
Bobby R. Bruce
2472b27c8f tests: Move 'riscvmatched-fs.py' example test to weekly
As of https://gem5-review.googlesource.com/c/public/gem5/+/64131, the
"configs/example/gem5_library/riscvmatched-fs.py' test was added to the
long/nightly test suite. This test is very long and the Nightly tests
are now timing out: https://jenkins.gem5.org/job/nightly/385/.

To solve this problem this test is being moved to the weekly tests.

Change-Id: I7956797b6ce1a813e1fdbbd38e8be61962d345a2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64671
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-17 22:44:14 +00:00
Giacomo Travaglini
221dc014db arch-arm: Use scoped enum for ExceptionClass
Change-Id: I42ce3c31dfe89b75658db4a79c6a29a43fd0d82b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64411
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
2022-10-17 09:00:59 +00:00
Giacomo Travaglini
a4dcd58569 arch-arm: Fix QDADD/QDSUB implementation
This got broken by a recent commit [1] which converted a bitwise
OR into the boolean version. While it conceptually made sense
as the saturateOp returns a boolean value, it is not taking
into consideration that saturateOp modifies the first argument
and the boolean version short-circuits the expression preventing
the second expression from being run if the first one is true

Therefore providing an incorrect midRes value.

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

Change-Id: Ibb9b3d37dcccda006006650ef759cdfe385dcfe2
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64612
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
2022-10-17 09:00:16 +00:00
Yu-hsin Wang
21020aa778 systemc: prevent from invalidate callback re-registration
Remove the redundant callback to save the memory.

Change-Id: Iafa6ada06f62ac2928a580c25ebbcbbe3f195670
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64474
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Earl Ou <shunhsingou@google.com>
2022-10-17 02:04:40 +00:00
Adrián Herrera Arcila
9e76e7a321 scons: fix protobuf action for imports
The current protoc_action generates declarations that impose the requirement
for .proto files to import from the BUILDDIR. This prevents .proto files to
import themselves relative to their own directory.

For example, if there are two files build/pkg/a.proto and build/pkg/b.proto,
and b.proto imports a.proto, it must do so as "import pkg/a.proto", as opposed
to "import a.proto"; otherwise, the generated declaration will give rise to a
compilation error.

This is a problem for EXTRAS where .proto files are gem5-independent, so
they cannot import from gem5's build directory. An example is
https://github.com/ARM-software/ATP-Engine

This commit changes the protoc_action so that declarations are generated
relative to the SOURCE directory. This enables .proto files to import
other .proto files within the same directory.

Note it is not possible to import other .proto files in different
directories, but support for it is not currently necessary.

More details on the proto path:
https://developers.google.com/protocol-buffers/docs/reference/cpp-generated#invocation

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

Change-Id: Ib3e67ae817f8ad0b6803c90d23469267eff16178
Signed-off-by: Adrián Herrera Arcila <adrian.herrera@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64491
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-10-15 14:22:03 +00:00
Giacomo Travaglini
039e9438c1 arch-arm: Fix linking error in aapcs64 unittests
This is fixing the undefined reference exposed by our nightly
run [1] by including the arch/arm/regs/int.cc source (needed
for the IntRegClassOps::flatten implementation) plus
sim/cur_tick.cc

[1]: https://www.mail-archive.com/gem5-dev@gem5.org/msg43249.html

Change-Id: I51a616ca2ef513f0068e531ebee17172d68cc738
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64611
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-15 13:24:39 +00:00
Bobby R. Bruce
07f4dd19ad util-docker: Create ALL/gem5.fast docker image with min-deps
This docker image contains ALL/gem5.fast compiled using the 22.04
min-dependencies image.

This image is available at gcr.io/gem5-test/gem5-all-min-dependencies:

```
docker pull gcr.io/gem5-test/gem5-all-min-dependencies
```

Change-Id: I0af4a629e7082df1d76a8459ebfc4fb0a91e2855
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64431
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-10-14 22:31:50 +00:00
Jason Yu
e501078787 sim-se,arch-riscv: Fixes file-related flags for riscv64 target
Previous file-related flags for the riscv64-unknown-linux-gnu target
do not match the actual
values, leading to incorrect behaviours in certain emulated syscalls.
This commit fixes the problem.

Change-Id: I38ff624c00e46e37672510af5a10f527b5f0842a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64472
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-10-14 17:18:06 +00:00
Matthew Poremba
a648be2338 dev-amdgpu: Add an SDMA data debug flag
This debug flag is used to print spammy SDMA DPRINTFs, such as an SDMA
copy printing the data of large transfers 8 bytes per line at a time. For
those prints, the SDMAEngine flag will now only print the first and last
qword of the transfer and the new SDMAData flag is needed for verbose
data printing. This makes the SDMAEngine flag still useful for verifying
copies in applications with predictable data such as square.

Additionally, the memory allocation/deallocation done solely for a print
statement is removed in favor of casting the data to the printed type.

Change-Id: I18c1918ef9085cca4570f79881ee63d510ccc32f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64452
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
2022-10-13 20:17:00 +00:00
Matthew Poremba
e48285c244 arch-vega: Implement PDE2 and PDE1 as PTE
Page directory entries (PDEs) can be interpreted as leaf node page
table entries (PTEs) if the "p" bit is set. This is used for flexible
page sizes in Vega. Currently there is only support for PDE level 0
entries which can be interpreted as 2MB pages. This changeset adds
support for PDE1 and PDE2 which can be used to represent 1GB and 512GB
pages. PDE1-as-PTE entries can be tested and were verified on
applications by allocating >2GB of data. PDE0 is untested due to being
too large for simulation, but the implementation is similar to PDE0
and PDE1.

Change-Id: I801cbb5ec79110d57d2db760cc689c2e5778f9bb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64451
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2022-10-13 20:17:00 +00:00
Yu-hsin Wang
a713d333e0 sysetmc: add missing NO_ACCESS flags in get_direct_mem_ptr
In the previous refactor, I remove the NO_ACCESS flag by incident. This
change adds the flag back.

Previous refactor: https://gem5-review.googlesource.com/c/public/gem5/+/63771

Change-Id: Ifd49b11ef6f76903f022072dd81020dea50fa103
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64392
Reviewed-by: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
2022-10-12 16:41:31 +00:00
Yu-hsin Wang
958b7f8ee8 sysetmc: fix the leak in TlmToGem5Bridge
In the previous refactor, I made a mistake causing memory leak. This
change fix the mistake.

Previous refactor: https://gem5-review.googlesource.com/c/public/gem5/+/63771

Change-Id: I244a990e00507a6b065af38c61f061bc5d72d90e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64391
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-12 16:41:31 +00:00
Giacomo Travaglini
9bac517337 tests: Run ALL unit-tests with the nightly script
The NULL run is missing ISA specific unit-tests

Change-Id: Ia468d2da0141c4834e932b63980ebe230912bfe2
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64312
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-10-12 10:34:02 +00:00