Changeset 774 for branches/reconfiguration/platforms/tsar_generic_iob
- Timestamp:
- Aug 27, 2014, 10:50:02 AM (10 years ago)
- Location:
- branches/reconfiguration/platforms/tsar_generic_iob/scripts
- Files:
-
- 1 added
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/platforms/tsar_generic_iob/scripts/arch.py
r770 r774 1 1 #!/usr/bin/env python 2 2 import sys 3 3 from mapping import * 4 4 … … 344 344 return mapping 345 345 346 def main(x, y, p, hard_path, xml_path): 347 mapping = arch( x_size = x, 348 y_size = y, 349 nb_procs = p) 350 351 with open(xml_path, "w") as map_xml: 352 map_xml.write(mapping.xml()) 353 with open(hard_path, "w") as hard_config: 354 hard_config.write(mapping.hard_config()) 355 346 356 ################################# platform test ####################################################### 347 357 348 358 if __name__ == '__main__': 349 350 mapping = arch( x_size = 2, 351 y_size = 2, 352 nb_procs = 2 ) 353 354 # print mapping.netbsd_dts() 355 356 print mapping.xml() 357 358 # print mapping.giet_vsegs() 359 359 main( x_size = int(sys.argv[1]), 360 y_size = int(sys.argv[2]), 361 nb_procs = int(sys.argv[3])) 360 362 361 363 # Local Variables: -
branches/reconfiguration/platforms/tsar_generic_iob/scripts/run.py
r770 r774 3 3 # @author cfuguet <cesar.fuguet-tortolero@lip6.fr> 4 4 5 import sys 5 6 import os 6 import sys7 7 import subprocess 8 import arch 8 9 9 nprocs = 4 10 10 # define constants 11 11 configs = [] 12 12 configs.append([2 ,2 ]) … … 15 15 configs.append([16,16]) 16 16 17 nprocs = 4 18 19 assert len(sys.argv) > 1, "Introduce platform base directory path" 20 21 # goto platform base directory 22 os.chdir(sys.argv[1]) 23 17 24 # repeat while configurations is not empty 18 25 for x,y in configs: 19 confdir = os.getcwd() + " /conf/config_{}c/".format(x*y)26 confdir = os.getcwd() + "conf/config_{}c/".format(x*y) 20 27 21 28 # 1. generate configuration and ouput directories … … 23 30 os.makedirs(confdir + "config", 0755) 24 31 except OSError: 25 # directory already exists => do nothing 26 pass 32 pass # directory already exists => do nothing 27 33 28 34 # 2. generate hard_config.h and fault_config.h files 29 returncode = subprocess.call(["scripts/genmap", 30 "--x=" + str(x), 31 "--y=" + str(y), 32 "--p=" + str(nprocs), 33 "--arch=" + os.getcwd(), 34 "--path=" + confdir + "config" 35 ]) 36 if returncode != 0: 37 print "Error during genmap execution" 38 sys.exit(1) 35 arch.main( x = x, y = y, p = nprocs, 36 hard_path = confdir + "config/hard_config.h", 37 xml_path = confdir + "config/map.xml" ) 39 38 40 39 # 3. compile simulator executable
Note: See TracChangeset
for help on using the changeset viewer.