- Timestamp:
- Aug 27, 2014, 10:50:06 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/platforms/tsar_generic_iob/scripts/run.py
r775 r776 22 22 assert len(sys.argv) > 1, "Introduce platform base directory path" 23 23 24 # goto platform base directory 25 os.chdir(sys.argv[1]) 24 # translate the relative path (if needed) into an absolute path 25 basedir = os.path.abspath(sys.argv[1]) 26 print "[ run.py ] platform base directory: {}".format(basedir) 26 27 27 28 # repeat while configurations is not empty 28 29 for faulty in faultylist: 29 30 for x,y in configs: 30 confdir = os.getcwd() + "conf/config_{}c/".format(x*y) 31 confdir = "{}/conf/config_{}c".format(basedir, x*y) 32 print "[ run.py ] generating files for {}".format(confdir) 31 33 32 34 # 1. generate configuration and ouput directories 33 35 try: 34 os.makedirs(confdir + " config", 0755)36 os.makedirs(confdir + "/config", 0755) 35 37 except OSError: 36 38 pass # directory already exists => do nothing … … 38 40 # 2. generate hard_config.h and fault_config.h files 39 41 arch.main( x = x, y = y, p = nprocs, 40 hard_path = confdir + " config/hard_config.h",41 xml_path = confdir + " config/map.xml" )42 faultyprocs.generate(faulty, confdir + " config/fault_config.h")42 hard_path = confdir + "/config/hard_config.h", 43 xml_path = confdir + "/config/map.xml" ) 44 faultyprocs.generate(faulty, confdir + "/config/fault_config.h") 43 45 44 46 # 3. compile simulator executable 45 if os.path.exists("hard_config.h"): os.unlink("hard_config.h") 46 os.symlink(confdir + "config/hard_config.h", "hard_config.h") 47 subprocess.call("make") 47 dst = basedir + "/hard_config.h" 48 if os.path.lexists(dst): os.unlink(dst) 49 os.symlink(confdir + "/config/hard_config.h", dst) 50 subprocess.call(["make", 51 "-C", basedir 52 ]) 48 53 49 54 # 4. compile distributed boot executable 50 dst = confdir + " config/boot_config.h"51 if not os.path.exists(dst):52 os.symlink(os.getcwd()+ "/soft/config/boot_config.h", dst)55 dst = confdir + "/config/boot_config.h" 56 if os.path.lexists(dst): os.unlink(dst) 57 os.symlink(basedir + "/soft/config/boot_config.h", dst) 53 58 subprocess.call(["make", 54 "-C", "soft",59 "-C", basedir + "/soft", 55 60 "CONFDIR=" + confdir 56 61 ]) … … 59 64 os.environ["DISTRIBUTED_BOOT"] = "1" 60 65 os.environ["SOCLIB_TTY"] = "FILES" 61 with open(confdir + " log", "w") as log_file:62 subprocess.call([ "./simul.x",63 "-SOFT" , "soft/build/soft.elf",66 with open(confdir + "/log", "w") as log_file: 67 subprocess.call([basedir + "/simul.x", 68 "-SOFT" , basedir + "/soft/build/soft.elf", 64 69 "-DISK" , "/dev/null", 65 70 "-NCYCLES", "10000000"], … … 69 74 70 75 # 6. move simulation terminal output into the target config dir 71 os.rename("term0", confdir + " term")76 os.rename("term0", confdir + "/term") 72 77 73 78 # end for each config
Note: See TracChangeset
for help on using the changeset viewer.