source: branches/reconfiguration/platforms/tsar_generic_iob/scripts/faultyprocs.py @ 893

Last change on this file since 893 was 890, checked in by cfuguet, 9 years ago

reconf: improve the onerun.py script in the tsar_generic_iob

  • Now, this module defines a run function which can be either called by the onerun's main function or by another module, if it has been imported.
  • Faulty cores are now passed as an argument. For each faulty core, pass the argument -fc X Y L, where X Y L are the core's coordinates.
  • Faulty routers are now passed as a pair X Y instead of XY integer. For each faulty router, pass the argument -fr X Y. This modification affects both, the top.cpp and onerun.py files.
File size: 873 bytes
Line 
1#!/usr/bin/python
2# @date   26 August, 2014
3# @author cfuguet <cesar.fuguet-tortolero@lip6.fr>
4
5import sys
6
7def generate(faulty, outpath):
8    content = []
9    content.append( "#ifndef FAULT_CONFIG_H\n"
10                    "#define FAULT_CONFIG_H\n"
11                    "static const int faulty_proc_ids[] =\n"
12                    "{\n"
13                    "    /*  X    |    Y     | L  */\n")
14
15    if faulty != None:
16        for x, y, l in faulty:
17            content.append("    ({0} << 6) | ({1} << 2) | {2},\n".format(x, y, l))
18
19    content.append( "};\n"
20                    "#endif\n")
21
22    with open(outpath, "w") as outfile:
23        outfile.writelines(content)
24
25if __name__ == "__main__":
26    faulty  = [ (0,0,1), (0,1,1), (1,0,1), (1,0,2), (1,0,3), (1,1,1), (1,1,3)]
27    generate(faulty, "fault.gen.h")
28
29# vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab
Note: See TracBrowser for help on using the repository browser.