Commit Graph

13661 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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