Kyle Roarty has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/31995 )

Change subject: configs: set hsaTopology properties from options
......................................................................

configs: set hsaTopology properties from options

This change sets the properties in hsaTopology to the proper values
specified by the user through command-line arguments. This ensures
that if the properties file is read by a program, it will return
the correct values for the simulated hardware.

This change also adds in a command-line argument for the lds size, as
it was the only other property used in hsaTopology that didn't have
a command-line argument. The default value (65536) is taken from
src/gpu-compute/LdsState.py

Change-Id: I17bb812491708f4221c39b738c906f1ad944614d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31995
Reviewed-by: Matt Sinclair <mattdsincl...@gmail.com>
Reviewed-by: Alexandru Duțu <alexandru.d...@amd.com>
Reviewed-by: Anthony Gutierrez <anthony.gutier...@amd.com>
Maintainer: Matt Sinclair <mattdsincl...@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutier...@amd.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M configs/example/apu_se.py
M configs/example/hsaTopology.py
2 files changed, 32 insertions(+), 26 deletions(-)

Approvals:
  Alexandru Duțu: Looks good to me, approved
  Anthony Gutierrez: Looks good to me, approved; Looks good to me, approved
Matt Sinclair: Looks good to me, but someone else must approve; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/configs/example/apu_se.py b/configs/example/apu_se.py
index 59dd4c5..03418c3 100644
--- a/configs/example/apu_se.py
+++ b/configs/example/apu_se.py
@@ -174,6 +174,8 @@
                   help="number of physical banks per LDS module")
 parser.add_option("--ldsBankConflictPenalty", type="int", default=1,
                   help="number of cycles per LDS bank conflict")
+parser.add_options("--lds-size", type="int", default=65536,
+                   help="Size of the LDS in bytes")
 parser.add_option('--fast-forward-pseudo-op', action='store_true',
                   help = 'fast forward using kvm until the m5_switchcpu'
                   ' pseudo-op is encountered, then switch cpus. subsequent'
@@ -290,7 +292,8 @@
                                      localDataStore = \
                                      LdsState(banks = options.numLdsBanks,
                                               bankConflictPenalty = \
- options.ldsBankConflictPenalty))) + options.ldsBankConflictPenalty,
+                                              size = options.lds_size)))
     wavefronts = []
     vrfs = []
     vrf_pool_mgrs = []
diff --git a/configs/example/hsaTopology.py b/configs/example/hsaTopology.py
index df24223..707a83d 100644
--- a/configs/example/hsaTopology.py
+++ b/configs/example/hsaTopology.py
@@ -36,6 +36,7 @@
 from os.path import join as joinpath
 from os.path import isdir
 from shutil import rmtree, copyfile
+from m5.util.convert import toFrequency

 def file_append(path, contents):
     with open(joinpath(*path), 'a') as f:
@@ -76,30 +77,32 @@

     # populate global node properties
     # NOTE: SIMD count triggers a valid GPU agent creation
-    # TODO: Really need to parse these from options
-    node_prop = 'cpu_cores_count %s\n' % options.num_cpus   + \
-                'simd_count 32\n'                           + \
-                'mem_banks_count 0\n'                       + \
-                'caches_count 0\n'                          + \
-                'io_links_count 0\n'                        + \
-                'cpu_core_id_base 16\n'                     + \
-                'simd_id_base 2147483648\n'                 + \
-                'max_waves_per_simd 40\n'                   + \
-                'lds_size_in_kb 64\n'                       + \
-                'gds_size_in_kb 0\n'                        + \
-                'wave_front_size 64\n'                      + \
-                'array_count 1\n'                           + \
-                'simd_arrays_per_engine 1\n'                + \
-                'cu_per_simd_array 10\n'                    + \
-                'simd_per_cu 4\n'                           + \
-                'max_slots_scratch_cu 32\n'                 + \
-                'vendor_id 4098\n'                          + \
-                'device_id 39028\n'                         + \
-                'location_id 8\n'                           + \
-                'max_engine_clk_fcompute 800\n'             + \
-                'local_mem_size 0\n'                        + \
-                'fw_version 699\n'                          + \
-                'capability 4738\n'                         + \
-                'max_engine_clk_ccompute 2100\n'
+ node_prop = 'cpu_cores_count %s\n' % options.num_cpus + \ + 'simd_count %s\n' \ + % (options.num_compute_units * options.simds_per_cu) + \ + 'mem_banks_count 0\n' + \ + 'caches_count 0\n' + \ + 'io_links_count 0\n' + \ + 'cpu_core_id_base 16\n' + \ + 'simd_id_base 2147483648\n' + \ + 'max_waves_per_simd %s\n' % options.wfs_per_simd + \ + 'lds_size_in_kb %s\n' % int(options.lds_size / 1024) + \ + 'gds_size_in_kb 0\n' + \ + 'wave_front_size %s\n' % options.wf_size + \ + 'array_count 1\n' + \ + 'simd_arrays_per_engine %s\n' % options.sa_per_complex + \ + 'cu_per_simd_array %s\n' % options.cu_per_sa + \ + 'simd_per_cu %s\n' % options.simds_per_cu + \ + 'max_slots_scratch_cu 32\n' + \ + 'vendor_id 4098\n' + \ + 'device_id 39028\n' + \ + 'location_id 8\n' + \ + 'max_engine_clk_fcompute %s\n' \ + % int(toFrequency(options.gpu_clock) / 1e6) + \ + 'local_mem_size 0\n' + \ + 'fw_version 699\n' + \ + 'capability 4738\n' + \ + 'max_engine_clk_ccompute %s\n' \
+                    % int(toFrequency(options.CPUClock) / 1e6)

     file_append((node_dir, 'properties'), node_prop)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/31995
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I17bb812491708f4221c39b738c906f1ad944614d
Gerrit-Change-Number: 31995
Gerrit-PatchSet: 3
Gerrit-Owner: Kyle Roarty <kyleroarty1...@gmail.com>
Gerrit-Reviewer: Alexandru Duțu <alexandru.d...@amd.com>
Gerrit-Reviewer: Anthony Gutierrez <anthony.gutier...@amd.com>
Gerrit-Reviewer: Kyle Roarty <kyleroarty1...@gmail.com>
Gerrit-Reviewer: Matt Sinclair <mattdsincl...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-CC: Bradford Beckmann <bradford.beckm...@gmail.com>
Gerrit-CC: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to