python: Import reduce function in FileSystemConfig
[gem5.git] / configs / example / apu_se.py
index 4e9c75fd6cea509e81587a7f5073af04936ee9e4..03418c32833bcce253cda06194879e6b206ae0e4 100644 (file)
@@ -174,6 +174,8 @@ parser.add_option("--numLdsBanks", type="int", default=32,
                   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 @@ for i in range(n_cu):
                                      localDataStore = \
                                      LdsState(banks = options.numLdsBanks,
                                               bankConflictPenalty = \
-                                              options.ldsBankConflictPenalty)))
+                                              options.ldsBankConflictPenalty,
+                                              size = options.lds_size)))
     wavefronts = []
     vrfs = []
     vrf_pool_mgrs = []
@@ -334,8 +337,6 @@ for i in range(n_cu):
 shader.CUs = compute_units
 
 ########################## Creating the CPU system ########################
-options.num_cpus = options.num_cpus
-
 # The shader core will be whatever is after the CPU cores are accounted for
 shader_idx = options.num_cpus
 
@@ -456,11 +457,18 @@ if options.env:
         env = [line.rstrip() for line in f]
 else:
     env = ['LD_LIBRARY_PATH=%s' % ':'.join([
-               "/proj/radl_tools/rocm-1.6/lib",
-               "/proj/radl_tools/rocm-1.6/hcc/lib64",
-               "/tool/pandora64/.package/libunwind-1.1/lib",
-               "/tool/pandora64/.package/gcc-6.4.0/lib64"
+               os.getenv('ROCM_PATH','/opt/rocm')+'/lib',
+               os.getenv('HCC_HOME','/opt/rocm/hcc')+'/lib',
+               os.getenv('HSA_PATH','/opt/rocm/hsa')+'/lib',
+               os.getenv('HIP_PATH','/opt/rocm/hip')+'/lib',
+               os.getenv('ROCM_PATH','/opt/rocm')+'/libhsakmt/lib',
+               os.getenv('ROCM_PATH','/opt/rocm')+'/miopen/lib',
+               os.getenv('ROCM_PATH','/opt/rocm')+'/miopengemm/lib',
+               os.getenv('ROCM_PATH','/opt/rocm')+'/hipblas/lib',
+               os.getenv('ROCM_PATH','/opt/rocm')+'/rocblas/lib',
+               "/usr/lib/x86_64-linux-gnu"
            ]),
+           'HOME=%s' % os.getenv('HOME','/'),
            "HSA_ENABLE_INTERRUPT=0"]
 
 process = Process(executable = executable, cmd = [options.cmd]
@@ -564,6 +572,8 @@ 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):
@@ -609,16 +619,15 @@ else:
 
 ########################## Start simulation ########################
 
-chroot = os.path.expanduser(options.chroot)
-redirect_paths = [RedirectPath(src = "/proc",
-                               dests = ["%s/fs/proc" % m5.options.outdir]),
-                  RedirectPath(src = "/sys",
-                               dests = ["%s/fs/sys"  % m5.options.outdir]),
-                  RedirectPath(src = "/tmp",
-                               dests = ["%s/fs/tmp"  % m5.options.outdir]),
-                  RedirectPath(src = "/dev/shm",
-                               dests = ["/dev/shm/%s/gem5_%s"  %
-                                   (getpass.getuser(), os.getpid())])]
+redirect_paths = [RedirectPath(app_path = "/proc",
+                               host_paths =
+                                ["%s/fs/proc" % m5.options.outdir]),
+                  RedirectPath(app_path = "/sys",
+                               host_paths =
+                                ["%s/fs/sys"  % m5.options.outdir]),
+                  RedirectPath(app_path = "/tmp",
+                               host_paths =
+                                ["%s/fs/tmp"  % m5.options.outdir])]
 
 system.redirect_paths = redirect_paths
 
@@ -674,6 +683,4 @@ elif options.fast_forward_pseudo_op:
 print("Ticks:", m5.curTick())
 print('Exiting because ', exit_event.getCause())
 
-FileSystemConfig.cleanup_filesystem(options)
-
 sys.exit(exit_event.getCode())