From 53807c8276b86e27709c969b77db697b4beede62 Mon Sep 17 00:00:00 2001 From: Matthew Poremba Date: Fri, 25 Sep 2020 10:04:38 -0700 Subject: [PATCH] configs,gpu-compute: Fixes to connect gmTokenPort When the TokenPort was moved from the GCN3 staging branch to develop the TokenPort was changed from being the port connecting the ComputeUnit to Ruby's vector memory port to a sideband port which inhibits requests to Ruby's vector memory port. As such, it needs to be explicitly connected as a new port. This changes the getPort method in ComputeUnit to be aware of the port as well as modifying the example config to connect to TCPs. The iteration to connect in the config file was modified since it was not properly connecting to TCPs each time and Ruby.py does not explicitly return a list of each MachineType. Change-Id: Ia70a6756b2af54d95e94d19bec5d8aadd3c2d5c0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35096 Reviewed-by: Matt Sinclair Reviewed-by: Jason Lowe-Power Maintainer: Matt Sinclair Tested-by: kokoro --- configs/example/apu_se.py | 12 ++++++++++-- src/gpu-compute/compute_unit.hh | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/configs/example/apu_se.py b/configs/example/apu_se.py index 2e24079c8..18640c809 100644 --- a/configs/example/apu_se.py +++ b/configs/example/apu_se.py @@ -566,6 +566,16 @@ gpu_port_idx = len(system.ruby._cpu_ports) \ - options.num_scalar_cache gpu_port_idx = gpu_port_idx - options.num_cp * 2 +# Connect token ports. For this we need to search through the list of all +# sequencers, since the TCP coalescers will not necessarily be first. Only +# TCP coalescers use a token port for back pressure. +token_port_idx = 0 +for i in range(len(system.ruby._cpu_ports)): + if isinstance(system.ruby._cpu_ports[i], VIPERCoalescer): + system.cpu[shader_idx].CUs[token_port_idx].gmTokenPort = \ + system.ruby._cpu_ports[i].gmTokenPort + token_port_idx += 1 + wavefront_size = options.wf_size for i in range(n_cu): # The pipeline issues wavefront_size number of uncoalesced requests @@ -573,8 +583,6 @@ for i in range(n_cu): for j in range(wavefront_size): system.cpu[shader_idx].CUs[i].memory_port[j] = \ system.ruby._cpu_ports[gpu_port_idx].slave[j] - system.cpu[shader_idx].CUs[i].gmTokenPort = \ - system.ruby._cpu_ports[gpu_port_idx].gmTokenPort gpu_port_idx += 1 for i in range(n_cu): diff --git a/src/gpu-compute/compute_unit.hh b/src/gpu-compute/compute_unit.hh index fe2091d31..2df4807d2 100644 --- a/src/gpu-compute/compute_unit.hh +++ b/src/gpu-compute/compute_unit.hh @@ -1015,6 +1015,8 @@ class ComputeUnit : public ClockedObject return sqcTLBPort; } else if (if_name == "ldsPort") { return ldsPort; + } else if (if_name == "gmTokenPort") { + return gmTokenPort; } else { return ClockedObject::getPort(if_name, idx); } -- 2.30.2