Commit Graph

19442 Commits

Author SHA1 Message Date
Giacomo Travaglini
9f550d5519 systemc: Fix -Wunused-variable with structured binding
Change-Id: Ied66047c53dfc674557aeaf74fbba04c2b3d8359
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63831
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-09-27 08:36:31 +00:00
Jason Lowe-Power
a12ac1a877 tests: Fix errors in arm switcheroo
When switching to the all target, there is no longer a "DerivO3CPU" we
now need to drop the "Deriv"

Note that there are still some cases where it is valid to use "DerivO3"
where it is converted to drop the "Deriv" via a map.

Cleaning this up further is for future work.

Change-Id: Ide59eb3a5c7daf15c13afe395409f588562c1b54
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63851
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-09-26 22:43:03 +00:00
Yu-hsin Wang
d000ccf738 fastmodel: correct the control signal for AmbaFromTlmBridge
In AmbaToTlmBridge we copy the control signal from amba extension to
SystemC extension. This makes gem5 models can proceed the correct
control signals. We need to make the same thing in AmbaToTlmBridge for
fastmodel can proceed the correct control signals.

A practical example is given a request is generated by fastmodel CPU,
translated by gem5 MMU, and routed to a fastmodel target. The secure bit
may be changed by MMU according to the PTE. We need to update the amba
extension in AmbaFromTlmBridge to make the target get the correct
information.

Change-Id: I600be7ba21368f00c05426ac1db3c28efd6ca2ea
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63773
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-26 02:13:56 +00:00
Yu-hsin Wang
344e2ae823 systemc: associate tlm payload and gem5 packet in blocking interfaces
TlmToGem5Bridge only associates the tlm payload and gem5 packet in
nb_transport case. We should also do the samething in blocking
interfaces. Otherwise, the downstream Gem5ToTlmBridge cannot get the
correct payload.

Change-Id: I85b213402d58d68641615a6cea04961f4a15f1ba
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63772
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-26 02:13:56 +00:00
Yu-hsin Wang
5d35e22518 systemc: gem5_to_tlm bridge should reuse existed tlm payload
Given a data path initiated from SystemC, routed by gem5, and handled
by SystemC finally.

SystemC -> gem5 -> SystemC

The target SystemC needs to get the original transaction object.
Otherwise, it would lose the extensions in the payload.

To fix the issue, we moves the SenderState class to public for reachibility.
After that, we refactor the logic converting between payload and packet
to make sure they can use the correct instance. Finally, we fix the
potential address change during routing.

Change-Id: Ic6d24e98454f564f7dd6b43ad8c011e1ea7ea433
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63771
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-09-26 02:13:56 +00:00
Zhantong Qiu
f17c056760 util: added workbegin and workend in m5 util
Added m5 workbegin and m5 workend that can be used with out/m5

Change-Id: Ic2b1ac3c08dcae3f66fb65dffaa3a3358b717251
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63751
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-24 21:40:52 +00:00
Kaustav Goswami
c3e25af907 arch-arm,tests: added arm-linux-boot tests for the ArmBoard
This change adds ARM boot tests for the ArmBoard. The tests are
similar to existing boot tests which supports both m5 exit
instructions and a max-tick input format.

Change-Id: I9cb78424cf236e9092b4d4d34b68b1589b50ef37
Signed-off-by: Kaustav Goswami <kggoswami@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62194
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-09-23 17:16:01 +00:00
Bobby R. Bruce
d0cbb1c630 tests: Add test for riscvmatched-hello stdlib example
This test ensures the example script is still functioning and, by proxy,
does a simple test to ensure the riscvmatched board's SE workload
capabilities are still working.

Change-Id: I7c79856e84122c6737e1e9667b6e626b4622d04c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63591
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-23 16:19:09 +00:00
Bobby R. Bruce
b6966531fd misc: Reword CONTRIBUTING.md pre-commit documentation
This is a slight-rewording to make the usage of the pre-commit checks
clearer.

Change-Id: I73f9bfe7143a527c9e495cdf4d51e2aa857b43d5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63791
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-23 16:18:02 +00:00
Jasjeet Rangi
b6a75cb8de stdlib, configs: Add example SE mode script for RISCV matched
This script runs the riscv-hello binary from gem5 resources on the
RISCV matched prebuilt board found in the
src/python/gem5/prebuilt/riscvmatched/ directory.

Change-Id: I1b527588b0319e9ab853dfcbfa381db2137d1a98
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63571
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2022-09-23 04:42:23 +00:00
Daecheol You
82406b7740 configs: bug fix for misc node distribution
Wrong parameter is removed from the distributeNodes calling

Change-Id: I84cdf3e993d6b7852c4f134441d77a4b295e8574
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63731
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Tiago Muck <tiago.muck@arm.com>
2022-09-23 01:53:14 +00:00
Bobby R. Bruce
a4757bef47 tests: Add 'requires' tests for ALL/gem5
Change-Id: I58012b092dc1ec027474e2e45ad3e9809b31578b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63433
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-22 18:19:56 +00:00
Bobby R. Bruce
b94a6a50a5 tests: Update presubmit.sh to compile ALL/gem5.fast
This part of the Kokoro presubmit tests was designed to ensure gem5
still compiled sucessfully with Clang and to the '.fast' variant. ARM
was chosen arbitarily. Now that ALL exists, it makes more sense to use
it for this test.

Change-Id: Ia3593f7dd506205da13802a69094f4dd7019ab90
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63371
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-22 18:19:56 +00:00
Bobby R. Bruce
3b0cb574f5 tests: Update tests to use ALL/gem5.opt compilation
Where possible the gem5 tests have been updated to use the
build/ALL/gem5.opt compilation.

If a quick test requied a specific a ISA/protocol compilation they
were moved to the long/nightly set. This means all the quick/kokoro
tests are run with the build/ALL/gem5.opt compilation.

The learning_gem5 tests have been updated to use ALL/gem5.opt.

The equivilant examples on the website have been updated via:
https://gem5-review.googlesource.com/c/public/gem5-website/+/63336

Change-Id: I533689ad6848233867bdba9e9a43bb5840ed65c7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63374
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-09-22 18:19:56 +00:00
kunpai
2429a6dd58 stdlib: Added RiscvMatched prebuilt board
Modeled after the HiFive Unmatched.

For the cache, we inherited from AbstractClassicCacheHierarchy and
AbstractTwoLevelCacheHierarchy to make a PrivateL1PrivateL2 hierarchy
with the same associativity and sizes as the board. However, the L2
Size is kept as a parameter that can be set by the user.

The core is in-order, therefore we inherited from RISC-V MinorCPU and
used the same pipeline parameters as the ARM HPI CPU, except the
decodeToExecuteForwardDelay, which was increased to 2 to avoid a
PMC access fault.

For the processor, we initialized the core with an ID so that we can
return 4 cores in FS mode, which is the same as the real system,
and 1 in SE mode.

For the memory, we just have a single channel DDR4_2400 with a size of
16 GB and starting at 0x80000000.

For the board, we declared a Boolean variable as a parameter to assign
whether it is in FS mode or not. We inherited from KernelDiskWorkload
and SEBinaryWorkload and initialized the components of the board
according to the Boolean. The other parameters are the clock frequency
and the L2 cache size.

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

Change-Id: Ic2c066bb3a41dc2f42566ce971f9a665542f9771
Co-authored-by: Jasjeet Rangi <jasrangi@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63411
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-22 14:44:40 +00:00
Gabe Black
16690bc289 scons: Fix the default KVM_ISA setting.
The KVM_ISA setting was moved into a CONF dict, but the code which
ensured it had a default if there was no possible KVM hosting ISA was
still setting that variable in the base environment dict. This moves
the setting into the CONF dict instead.

Change-Id: I067c969dd761b2cdb098bcba6cd6a4b643d2d427
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63752
Reviewed-by: Earl Ou <shunhsingou@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
2022-09-22 07:56:47 +00:00
Daecheol You
e8ff8817e3 mem-ruby: bug fix for stale WriteBack
Finish_CopyBack_Stale is scheduled only when the requestor is the last
sharer. This prevents the cacahe evicting the line which was already
evicted while the stale WriteBack transaction was stalled.
Wrong condition check in Finish_CopyBack_Stale for eviction is also
removed.

Change-Id: Ib66acc1b9e4a6f7cea373e1fb37375427897d48d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63611
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-19 01:57:23 +00:00
Bobby R. Bruce
db8641fd7b stdlib: Add additional warns when get_runtime_isa used
While the `runtime` module's `get_runtime_isa` function throws a warning
to remind user's the function is deprecated, this was not always helpful
to a user when setting a processor without a target ISA.

This change adds additional warnings to the SimpleSwitchableProcessor
and the SimpleProcessor. These warnings explain not explicitly setting
the ISA via the processor's constructor is deprecated behavior.

Change-Id: I994ad8355e0d1c3f07374bebe2b59106fb04d212
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63331
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-16 03:16:36 +00:00
Bobby R. Bruce
3b832fceb9 scons: Update 'ALL' compilation to use MESI_Two_Level
The MI_Example coherence protocol is a poor default.

Change-Id: I2baec29ef18a9cb9f0d5751155935cae4621af5d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63372
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-15 19:06:45 +00:00
Bobby R. Bruce
8c1c60d43f tests: Update RISCV asmtests to use 'simple_binary_run.py'
The tests have been modified to be functionally equivalent but utilize
the standard library via the 'simple_binary_run.py' script.

Change-Id: Ib8b7a442a478d0fb152339ff5ba039412d0fef48
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63373
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-15 19:06:45 +00:00
Bobby R. Bruce
bcb9181db3 tests: Remove 'test_build' from the testlib
These gem5 builds are compiled automatically if required by a test.
Additionally, they are redundant given the existance of the compiler
tests, run daily.

Change-Id: I71141f82a86538a77384e684b9d261794e103b99
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63334
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-09-15 19:06:45 +00:00
Bobby R. Bruce
cc3940b69e tests: Add 'ALL' build to the compiler tests
Change-Id: I7f31a23999173e7cd06f3ee87e5e4f0ae42c54ea
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63333
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-15 19:06:45 +00:00
Bobby R. Bruce
f9e1b308c1 tests: Enable build/ALL/gem5 supported-isas-check tests
These tests were disabled until the build/ALL/gem5 compilation was
complete. These test the `gem5.runtime.get_supported_isas` function.

Change-Id: Ieac5676e9fed121f3cfe35e38f9748431824cbc0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63332
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-15 19:06:45 +00:00
Giacomo Travaglini
f448706dd5 arch-arm: Properly implement last level TLBIs
Prior to gem5 v21.2, partial translation entries were not cached within
the TLB, therefore Last Level (only) TLBI instructions were invalidating
every entry.

Now that we store translations from several lookup levels we are
currently over-invalidating partial translations. This patch is
adding a boolean flag to TLBIMVAA and TLBIMVA, allowing to discard
a match if the TLBI is targeting complete translations only
and the entry holds a partial translation

Change-Id: I86fa39c962355d9c566ee8aa29bebcd9967c8c57
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62453
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-15 17:24:06 +00:00
Luming Wang
fe6fc29b07 cpu: add BTBUpdates for BPredUnitStats
Current BPredUnitStats only contains BTBLookups. However, the number
of BTB updates is also needed to evaluate power consumption via McPAT.
Thus, this patch add BTBUpdates for BPredUnitStats.

Change-Id: I4c079b53f6585b5452022fe3fb516563c7d07f4e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63651
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-15 02:07:20 +00:00
Jui-Min Lee
e1ba253438 arch-riscv: Add flag for misaligned access check
Misaligned access is an optional feature of riscv isa, but it is always
enabled in current gem5 model. We add a flag into the ISA class to turn
off the feature.

Note this CL only consider the load/store instruction, but not the
instruction fetch itself. To support instruction address fault, we'll
need to modify the riscv decoder.

Change-Id: Iec4cba0e4fdcb96ce400deb00cff47e56c6d1e93
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63211
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
2022-09-14 02:22:47 +00:00
Bobby R. Bruce
17a46091fa tests: Remove '--ignore-style' from m5 weekly test build
The '--ignore-style' flag was added to the `scons build/x86/out/m5`
command in the weekly tests in this commit:
https://gem5-review.googlesource.com/c/public/gem5/+/63012

The m5 compilation does not attempt to run the style check hooks and, as
such, this command failed as the '--ignore-style' flag is not
recognized.

This caused the weekly tests to fail:
https://jenkins.gem5.org/job/weekly/76

This commit removes this flag.

Change-Id: Ic0320609ac5234be978743377f13dd1cf7f1e782
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63553
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-13 17:05:54 +00:00
Giacomo Travaglini
d9ed84902d sim: Fix serialize_handlers.test.cc on Arm platforms
The C and C++ standards allows the character type char to be signed or
unsigned, depending on the platform and compiler. Most systems,
including x86 GNU/Linux and Microsoft Windows, use signed char, but
those based on PowerPC and ARM processors typically use unsigned char

This means testing for:

EXPECT_FALSE(parser.parse("255", value));

is not portable as Arm platforms are able to convert 255 into an unsigned
character. We are fixing this portability issue by performing
different checks depending on the platform.

Maybe a better solution would be to explicitly set the sign of the
char (signed char in this case)

Change-Id: I44dd84378ea62ae21a6b03e1f35119bf85f8c799
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63539
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2022-09-13 08:46:56 +00:00
Mahyar Samani
8ba46bafb0 stdlib: Improving synthetic traffic generation.
This change adds a new traffic generator module to the standard
library that can read a .cfg file describing the traffic pattern
as a state machine. It wraps around the TrafficGen SimObject.
In addition it adds a method to ComplexGenerator to set the
traffic from outside using python generators like the example
found in configs/dram/sweep.py.

Change-Id: I5989bb900d26091e6e0e85ea63c741441b72069c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62473
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-13 07:14:51 +00:00
Bobby R. Bruce
26ea5a1c72 configs: Fix "gem5.resource" typo in riscv-ubuntu-run.py
This was causing the Nightly tests to fail:
https://jenkins.gem5.org/job/nightly/348/

The import should be "gem5.resources.workload".

Change-Id: I0ecd181a3c1120c44ebd0683e2a62bdc602a75bd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63391
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-09-12 18:44:28 +00:00
Tiago Muck
f6b2793b91 Revert "mem-ruby: bug fix for Finish_CopyBack_Stale"
This reverts commit f7cf47bc31.

Reason for revert: introduces an issue when handling a stale WriteBack

Change-Id: I4bd370911cb003c0c99e5fd14866b8c98afa80e2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63412
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-12 14:52:38 +00:00
Jason Lowe-Power
170c998b8f python: Enable -c in gem5 to mimic python
Adds a -c parameter to gem5 that works like python's -c to execute
commands from a string. This is to set up getting multiprocessing and
spawn to work in a later changeset.

Change-Id: I11a1dedb481fbe88898abc1e525d781ec3f66494
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63131
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-10 15:36:01 +00:00
Luming Wang
f43e722238 cpu: Fix RAS behaviour when both isReturn and isCall are set.
As discussed in [1], current BP cannot handle the instruction
with both isReturn and isCall on RAS. This hurts the performance
of coroutine-based programs.

This patch adjusts the behaviour of RAS. When the isReturn flag
is set, it will pop a RAS. Then, if the isCall flag is set, it
will push a RAS. Previous implementation only pop a RAS when both
isReturn and isCall are set.

This behaviour follows the RISC-V Spec [2]. Since other ISAs do
not have instructions that set both isCall and isReturn, this
patch has no impact on other ISAs.

[1] https://gem5-review.googlesource.com/c/public/gem5/+/58209
[2] https://github.com/riscv/riscv-isa-manual/releases/download/Ratified-IMAFDQC/riscv-spec-20191213.pdf

Change-Id: I52c01bbea41347711edff9ce9a03076e46aadc92
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63311
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-10 08:02:06 +00:00
Jasjeet Rangi
6807f70b81 cpu-minor: Add control instruction statistics to MinorCPU
Add control/branch instructions committed stat to Minor CPU. The stats
can be found in board.processor.cores.core.committedControl_0 in
stats.txt. The stats counted are IsControl, IsDirectControl,
IsIndirectControl, IsCondControl, IsUncondControl, IsCall, and IsReturn.
IsControl tracks the total control/branch instructions committed.

Use inst->staticInst->isControl() flag to determine if an instruction is
a control or not, and then using other flags in the StaticInstFlags to
determine the type of control instruction and tracking the committed
ones.

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

Change-Id: Iee1010fdf0fa4078ebe1c56b437295abdb5f4469
Co-authored-by: Kunal Pai <kunpai@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63358
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: ZHENGRONG WANG <seanyukigeek@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-09-10 00:08:56 +00:00
Daecheol You
f7cf47bc31 mem-ruby: bug fix for Finish_CopyBack_Stale
I made a mistake in the change below:
https://gem5-review.googlesource.com/c/public/gem5/+/58413

Checking the requestor in the sharer list for eviction
should be removed now. If the sharer count is zero, the requestor can't
be in the sharer list.

Change-Id: I304d2dd7df1aff4907801664a260c35c490a2136
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62991
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-09 20:38:20 +00:00
Jarvis Jia
b86088008a mem-ruby: Fix replacement policy updates with stores in MI_example
The current MI_example protocol's L1 caches updates the MRU information twice per store requests that miss -- once when the request reaches Ruby and once when the store 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 in 20880, and it modifies the store instead of the load in 62232.

Change-Id: I8436e3e537da0ee5841c59a94fa5e5c30105529f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63191
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2022-09-09 15:19:54 +00:00
Matthew Poremba
b623d26543 dev-amdgpu: Fix interrupt call for release mem
Both the client id and source id are incorrect for the release mem CP
packet. This changeset sets both to the correct value and adds asserts
that the value is declared in the client ID and source ID enums.

Change-Id: I4cc6c3a5f2a482e8f7dcd2a529c4a69bf71742c0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63177
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
9f5c0f2822 gpu-compute: dprint instruction requesting translation
When debugging strange addresses, it is extremely useful to know *what*
instruction calculated that address. This make it much easier to follow
assembly code backwards to find the source of an incorrect address.

This change adds a DPRINTF for GPUTLB that by default prints the
disassembly when a virtual address translation is sent to the TLB.

Change-Id: I5066c064a48c5c48696863eeccd8d011245ef7b2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63176
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-09 04:13:49 +00:00
Matthew Poremba
b919d9c5c9 arch-vega: Improve disasm for GLOBAL insts with scalar offset
The previous print statement was not clear that a scalar offset was
being used when printing disassembly, which made it slightly more
difficult to track down bugs related to this (relatively) rare usage of
global load/store instructions.

This change improves the disassembly to closer match the output of
hipcc's assembly code output.

Change-Id: I8514aedacb5b1db93d0586c408c4cf1ce77a7db3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63175
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
6c935657fd dev-amdgpu: Implement SDMA atomic packet
SDMA atomic packets are used in conjunction with RLC queues in SDMA for
synchronization similar to how HSA signals are used with BLIT kernels
when SDMA is disabled. Implement a skeleton of the SDMA atomic packet
methods as well as the atomic add64 operation.

The atomic add operation appears to be the only operation used in ROCm,
so this implementation is fairly complete. See:

https://github.com/RadeonOpenCompute/ROCR-Runtime/blob/
    rocm-4.2.x/src/core/runtime/amd_blit_sdma.cpp#L880

Change-Id: I62cc337f2ffe590bdb947b48053760ee8b3a6f32
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63174
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-09-09 04:13:49 +00:00
Matthew Poremba
9ea28bd782 dev-amdgpu: Implement SDMA RLC queue unmapping
The unmap queues packet specifies all non-static queues should be
unmapped which includes RLC queues in the SMDA. This functionality did
not exist before and is added in this changeset.

Fixes bug with rodinia_3.0/hip/bfs.

Change-Id: I80ca8cf8d89559625b5870745889b0a27916635e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63173
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
2022-09-09 04:13:49 +00:00
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