gpu-compute: Fix FLAT insts decrementing lgkm count early
authorKyle Roarty <kyleroarty1716@gmail.com>
Thu, 24 Dec 2020 01:30:37 +0000 (19:30 -0600)
committerMatt Sinclair <mattdsinclair@gmail.com>
Thu, 7 Jan 2021 17:12:31 +0000 (17:12 +0000)
commitf6ec145fc080fa27a7427241e81668b729edc476
treeb3256d3844dd588929c90aa0984c2fbf235cfb81
parent3c0769bd257aba9b6dfe4b076cadd9ac23b52573
gpu-compute: Fix FLAT insts decrementing lgkm count early

FLAT instructions used to decrement lgkm count on execute, while the
GCN3 ISA specifies that lgkm count should be decremented on data being
returned or data being written.

This patch changes it so that lgkm is decremented after initiateAcc (for
stores) and after completeAcc (for loads) to better reflect the ISA
definition.

This fixes a bug where waitcnts would be satisfied even though the
memory access wasn't completed, which lead to instructions using the
wrong data.

Change-Id: I596cb031af9cda8d47a1b5e146e4a4ffd793d36c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38696
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/gpu-compute/global_memory_pipeline.cc
src/gpu-compute/gpu_dyn_inst.cc