Changeset 775
- Timestamp:
- Aug 27, 2014, 10:50:05 AM (10 years ago)
- Location:
- branches/reconfiguration/platforms/tsar_generic_iob/scripts
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/platforms/tsar_generic_iob/scripts/run.py
-
Property
svn:executable
set to
*
r774 r775 7 7 import subprocess 8 8 import arch 9 import faultyprocs 9 10 10 11 # define constants … … 14 15 configs.append([8 ,8 ]) 15 16 configs.append([16,16]) 17 18 faultylist = [[(0,0,1), (0,1,1), (1,0,1), (1,0,2), (1,0,3), (1,1,1), (1,1,3)]] 16 19 17 20 nprocs = 4 … … 23 26 24 27 # repeat while configurations is not empty 25 for x,y in configs: 26 confdir = os.getcwd() + "conf/config_{}c/".format(x*y) 28 for faulty in faultylist: 29 for x,y in configs: 30 confdir = os.getcwd() + "conf/config_{}c/".format(x*y) 27 31 28 # 1. generate configuration and ouput directories29 try:30 os.makedirs(confdir + "config", 0755)31 except OSError:32 pass # directory already exists => do nothing32 # 1. generate configuration and ouput directories 33 try: 34 os.makedirs(confdir + "config", 0755) 35 except OSError: 36 pass # directory already exists => do nothing 33 37 34 # 2. generate hard_config.h and fault_config.h files 35 arch.main( x = x, y = y, p = nprocs, 36 hard_path = confdir + "config/hard_config.h", 37 xml_path = confdir + "config/map.xml" ) 38 # 2. generate hard_config.h and fault_config.h files 39 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") 38 43 39 # 3. compile simulator executable40 if os.path.exists("hard_config.h"): os.unlink("hard_config.h")41 os.symlink(confdir + "config/hard_config.h", "hard_config.h")42 subprocess.call("make")44 # 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") 43 48 44 # 4. compile distributed boot executable 45 dst = confdir + "config/boot_config.h" 46 if not os.path.exists(dst): 47 os.symlink(os.getcwd() + "/soft/config/boot_config.h", dst) 48 dst = confdir + "config/fault_config.h" 49 if not os.path.exists(dst): 50 os.symlink(os.getcwd() + "/soft/config/fault_config.h", dst) 51 subprocess.call(["make", 52 "-C", "soft", 53 "CONFDIR=" + confdir 54 ]) 49 # 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) 53 subprocess.call(["make", 54 "-C", "soft", 55 "CONFDIR=" + confdir 56 ]) 55 57 56 # 5. execute simulator57 os.environ["DISTRIBUTED_BOOT"] = "1"58 os.environ["SOCLIB_TTY"] = "FILES"59 with open(confdir + "log", "w") as log_file:60 subprocess.call(["./simul.x",61 "-SOFT" , "soft/build/soft.elf",62 "-DISK" , "/dev/null",63 "-NCYCLES", "10000000"],64 stdout=log_file,65 stderr=log_file,66 )58 # 5. execute simulator 59 os.environ["DISTRIBUTED_BOOT"] = "1" 60 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", 64 "-DISK" , "/dev/null", 65 "-NCYCLES", "10000000"], 66 stdout=log_file, 67 stderr=log_file, 68 ) 67 69 68 # 6. move simulation terminal output into the target config dir69 os.rename("term0", confdir + "term")70 # 6. move simulation terminal output into the target config dir 71 os.rename("term0", confdir + "term") 70 72 71 # end repeat 73 # end for each config 74 #end for each faulty 72 75 73 76 # vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab -
Property
svn:executable
set to
Note: See TracChangeset
for help on using the changeset viewer.