mem-ruby: Enable set size increase
authorJohn Alsop <johnathan.alsop@amd.com>
Thu, 20 Apr 2017 15:26:39 +0000 (11:26 -0400)
committerJohn Alsop <johnathan.alsop@amd.com>
Wed, 5 Jun 2019 13:59:00 +0000 (13:59 +0000)
Add NUMBER_BITS_PER_SET environment variable to control
the size of the bitmask in Set.hh (default=64).
Necessary for configs which require >64 instances of a given
machine type. This can be set in the build_opts file, e.g.
by adding the following line:
NUMBER_BITS_PER_SET = <number>

Change-Id: I314a3cadca8ce975fcf4a60d9022494751688e88
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18968
Reviewed-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
SConstruct
build_opts/X86_MESI_Two_Level
src/mem/ruby/common/SConscript
src/mem/ruby/common/Set.hh

index 53b8c9deab1cd1df21786e1b45b74d43fde4fdbd..28999a5b584af1dd7ac1fcc8213e0719e4ef6330 100755 (executable)
@@ -1013,14 +1013,17 @@ sticky_vars.AddVariables(
     EnumVariable('PROTOCOL', 'Coherence protocol for Ruby', 'None',
                   all_protocols),
     EnumVariable('BACKTRACE_IMPL', 'Post-mortem dump implementation',
-                 backtrace_impls[-1], backtrace_impls)
+                 backtrace_impls[-1], backtrace_impls),
+    ('NUMBER_BITS_PER_SET', 'Max elements in set (default 64)',
+                 64),
     )
 
 # These variables get exported to #defines in config/*.hh (see src/SConscript).
 export_vars += ['USE_FENV', 'SS_COMPATIBLE_FP', 'TARGET_ISA', 'TARGET_GPU_ISA',
                 'CP_ANNOTATE', 'USE_POSIX_CLOCK', 'USE_KVM', 'USE_TUNTAP',
                 'PROTOCOL', 'HAVE_PROTOBUF', 'HAVE_VALGRIND',
-                'HAVE_PERF_ATTR_EXCLUDE_HOST', 'USE_PNG']
+                'HAVE_PERF_ATTR_EXCLUDE_HOST', 'USE_PNG',
+                'NUMBER_BITS_PER_SET']
 
 ###################################################
 #
index fc74d6f01d8cfa6a54467eb525fe7ff78d9f7bc2..eba850b331bb4090f80f6df0840d46943caaa0fc 100644 (file)
@@ -1,3 +1,4 @@
 TARGET_ISA = 'x86'
 CPU_MODELS = 'TimingSimpleCPU,O3CPU,AtomicSimpleCPU'
 PROTOCOL = 'MESI_Two_Level'
+NUMBER_BITS_PER_SET = '128'
index a19268cbad22d06daaa65837a2facadd11b6280e..b97391c0a136d4b03076c1f9b36c192ae5cb977e 100644 (file)
@@ -33,6 +33,8 @@ Import('*')
 if env['PROTOCOL'] == 'None':
     Return()
 
+env.Append(CPPDEFINES={'NUMBER_BITS_PER_SET': env['NUMBER_BITS_PER_SET']})
+
 Source('Address.cc')
 Source('BoolVec.cc')
 Source('Consumer.cc')
index cb01c9613b8a8e2c78b89b1936a895b4f4669e01..aba38f51e77e24e01240fd9eb1dcf8105f6d5a8b 100644 (file)
 #include "base/logging.hh"
 #include "mem/ruby/common/TypeDefines.hh"
 
-// Change for systems with more than 64 controllers of a particular type.
-const int NUMBER_BITS_PER_SET = 64;
-
 class Set
 {
   private:
     // Number of bits in use in this set.
+    // can be defined in build_opts file (default=64).
     int m_nSize;
     std::bitset<NUMBER_BITS_PER_SET> bits;