configs: Add full path for learning_gem5 binaries
authorJason Lowe-Power <jason@lowepower.com>
Fri, 5 Apr 2019 01:36:23 +0000 (18:36 -0700)
committerJason Lowe-Power <jason@lowepower.com>
Mon, 8 Apr 2019 22:51:38 +0000 (22:51 +0000)
Change-Id: Ie48429d65e322136109a223ed404937989aae494
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17868
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
configs/learning_gem5/part1/simple.py
configs/learning_gem5/part1/two_level.py
configs/learning_gem5/part2/simple_cache.py
configs/learning_gem5/part2/simple_memobj.py

index c624de0aa7be9860e78a444efb527641ce8bb1a3..2947b7d119e6ebe67027ffd0fd8184ad03e646f0 100644 (file)
@@ -89,8 +89,11 @@ system.system_port = system.membus.slave
 # get ISA for the binary to run.
 isa = str(m5.defines.buildEnv['TARGET_ISA']).lower()
 
-# Run 'hello' and use the compiled ISA to find the binary
-binary = 'tests/test-progs/hello/bin/' + isa + '/linux/hello'
+# Default to running 'hello', use the compiled ISA to find the binary
+# grab the specific path to the binary
+thispath = os.path.dirname(os.path.realpath(__file__))
+binary = os.path.join(thispath, '../../../',
+                      'tests/test-progs/hello/bin/', isa, 'linux/hello')
 
 # Create a process for a simple "Hello World" application
 process = Process()
index b6f8781d21b5bf3088880a0d387e14910b48f1ed..dcf565a9a99a5efbaa00a11747ee3a87499d4690 100644 (file)
@@ -67,7 +67,10 @@ SimpleOpts.set_usage("usage: %prog [options] <binary to execute>")
 isa = str(m5.defines.buildEnv['TARGET_ISA']).lower()
 
 # Default to running 'hello', use the compiled ISA to find the binary
-binary = 'tests/test-progs/hello/bin/' + isa + '/linux/hello'
+# grab the specific path to the binary
+thispath = os.path.dirname(os.path.realpath(__file__))
+binary = os.path.join(thispath, '../../../',
+                      'tests/test-progs/hello/bin/', isa, 'linux/hello')
 
 # Check if there was a binary passed in via the command line and error if
 # there are too many arguments
index c65024233d1b6779fca56b5efcdce435c0d8f8db..5523b7fd47850306eb0730e41d3e513b80d71201 100644 (file)
@@ -88,8 +88,12 @@ system.system_port = system.membus.slave
 # Create a process for a simple "Hello World" application
 process = Process()
 # Set the command
+# grab the specific path to the binary
+thispath = os.path.dirname(os.path.realpath(__file__))
+binpath = os.path.join(thispath, '../../../',
+                       'tests/test-progs/hello/bin/x86/linux/hello')
 # cmd is a list which begins with the executable (like argv)
-process.cmd = ['tests/test-progs/hello/bin/x86/linux/hello']
+process.cmd = [binpath]
 # Set the cpu to use the process as its workload and create thread contexts
 system.cpu.workload = process
 system.cpu.createThreads()
index 24c6a24d6d5c0d983198e7f0e2931f70085d5233..b1432bd00b49a9e48964dc28a3514dc6f5b23f46 100644 (file)
@@ -86,8 +86,12 @@ system.system_port = system.membus.slave
 # Create a process for a simple "Hello World" application
 process = Process()
 # Set the command
+# grab the specific path to the binary
+thispath = os.path.dirname(os.path.realpath(__file__))
+binpath = os.path.join(thispath, '../../../',
+                       'tests/test-progs/hello/bin/x86/linux/hello')
 # cmd is a list which begins with the executable (like argv)
-process.cmd = ['tests/test-progs/hello/bin/x86/linux/hello']
+process.cmd = [binpath]
 # Set the cpu to use the process as its workload and create thread contexts
 system.cpu.workload = process
 system.cpu.createThreads()