Changeset 844 for branches


Ignore:
Timestamp:
Oct 16, 2014, 10:57:42 AM (10 years ago)
Author:
cfuguet
Message:

reconf: introducing a compile-only option in the onerun.py script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py

    r841 r844  
    1010
    1111# get command-line arguments
    12 parser = argparse.ArgumentParser(description = 'Run simulation')
     12parser = argparse.ArgumentParser(description='Run simulation')
    1313
    1414parser.add_argument(
    15     type = str, dest = 'path',
    16     help = 'relative or absolute path to the platform')
     15    type=str, dest='path',
     16    help='relative or absolute path to the platform')
    1717
    1818parser.add_argument(
    19     '--output', '-o', type = str, dest = 'outpath', default = './output',
    20     help = 'relative or absolute path to the output directory')
     19    '--output', '-o', type=str, dest='outpath', default='./output',
     20    help='relative or absolute path to the output directory')
    2121
    2222parser.add_argument(
    23     '--xsize', '-x', type = int, dest = 'x', default = 2,
    24     help = '# of clusters in a row')
     23    '--xsize', '-x', type=int, dest='x', default=2,
     24    help='# of clusters in a row')
    2525
    2626parser.add_argument(
    27     '--ysize', '-y', type = int, dest = 'y', default = 2,
    28     help = '# of clusters in a column')
     27    '--ysize', '-y', type=int, dest='y', default=2,
     28    help='# of clusters in a column')
    2929
    3030parser.add_argument(
    31     '--nprocs', '-n', type = int, dest = 'nprocs', default = 4,
    32     help = '# of processors per cluster')
     31    '--nprocs', '-n', type=int, dest='nprocs', default=4,
     32    help='# of processors per cluster')
    3333
    3434parser.add_argument(
    35     '--quiet', '-q', type = bool, dest = 'quiet', default = False,
    36     help = 'be quiet!!!' )
     35    '--compile-only', '-c', dest='compileonly', action='store_true',
     36    help='generate config files and compile the platform. Do not simulate')
     37
     38parser.add_argument(
     39    '--quiet', '-q', dest='quiet', action='store_true',
     40    help='be quiet!!!')
    3741
    3842args = parser.parse_args()
    3943
    4044# faulty processor list
    41 faultylist = [(0,0,1), (0,0,2), (0,1,2)]
     45faultylist = [(0, 0, 1), (0, 0, 2), (0, 1, 2)]
    4246
    4347# translate the relative path (if needed) into an absolute path
     
    6569# 3. compile simulator executable
    6670dst = os.path.join(basedir, "hard_config.h")
    67 if os.path.lexists(dst): os.unlink(dst)
     71if os.path.lexists(dst):
     72    os.unlink(dst)
     73
    6874os.symlink(hardpath, dst)
    6975
     
    7682# 4. compile distributed boot executable
    7783dst = os.path.join(outdir, "config/boot_config.h")
    78 if os.path.lexists(dst): os.unlink(dst)
     84if os.path.lexists(dst):
     85    os.unlink(dst)
     86
    7987os.symlink(os.path.join(basedir, "soft/config/boot_config.h"), dst)
     88
     89# stop after compiling the platform when the compile-only option is activated
     90if args.compileonly == True:
     91    exit(0)
    8092
    8193print "[ run.py ] compiling distributed boot procedure"
     
    88100# 5. execute simulator
    89101os.environ["DISTRIBUTED_BOOT"] = "1"
    90 os.environ["SOCLIB_FB"] = "HEADLESS"
    91 if args.quiet: os.environ["SOCLIB_TTY"] = "FILES"
     102if args.quiet:
     103    os.environ["SOCLIB_FB"] = "HEADLESS"
     104    os.environ["SOCLIB_TTY"] = "FILES"
    92105
    93106if (args.x * args.y) <= 4:
Note: See TracChangeset for help on using the changeset viewer.