Changeset 775


Ignore:
Timestamp:
Aug 27, 2014, 10:50:05 AM (10 years ago)
Author:
cfuguet
Message:

reconfiguration/tsar_generic_iob: introducing faultyprocs python module

  • This module generates the fault_config.h file for faulty processor simulation.
  • Using this module from the run.py module to generate the fault_config.h file with several configurations
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  
    77import subprocess
    88import arch
     9import faultyprocs
    910
    1011# define constants
     
    1415configs.append([8 ,8 ])
    1516configs.append([16,16])
     17
     18faultylist = [[(0,0,1), (0,1,1), (1,0,1), (1,0,2), (1,0,3), (1,1,1), (1,1,3)]]
    1619
    1720nprocs = 4
     
    2326
    2427# repeat while configurations is not empty
    25 for x,y in configs:
    26     confdir = os.getcwd() + "conf/config_{}c/".format(x*y)
     28for faulty in faultylist:
     29    for x,y in configs:
     30        confdir = os.getcwd() + "conf/config_{}c/".format(x*y)
    2731
    28     # 1. generate configuration and ouput directories
    29     try:
    30         os.makedirs(confdir + "config", 0755)
    31     except OSError:
    32         pass # directory already exists => do nothing
     32        # 1. generate configuration and ouput directories
     33        try:
     34            os.makedirs(confdir + "config", 0755)
     35        except OSError:
     36            pass # directory already exists => do nothing
    3337
    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")
    3843
    39     # 3. compile simulator executable
    40     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")
    4348
    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            ])
    5557
    56     # 5. execute simulator
    57     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                )
    6769
    68     # 6. move simulation terminal output into the target config dir
    69     os.rename("term0", confdir + "term")
     70        # 6. move simulation terminal output into the target config dir
     71        os.rename("term0", confdir + "term")
    7072
    71 # end repeat
     73        # end for each config
     74    #end for each faulty
    7275
    7376# vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab
Note: See TracChangeset for help on using the changeset viewer.