Last change
on this file since 809 was
778,
checked in by cfuguet, 10 years ago
|
reconfiguration/tsar_generic_iob: fixing python version incompatibility issues
|
File size:
842 bytes
|
Line | |
---|
1 | #!/usr/bin/python |
---|
2 | # @date 26 August, 2014 |
---|
3 | # @author cfuguet <cesar.fuguet-tortolero@lip6.fr> |
---|
4 | |
---|
5 | import sys |
---|
6 | |
---|
7 | def 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 | for x, y, l in faulty: |
---|
16 | content.append(" ({0} << 6) | ({1} << 2) | {2},\n".format(x, y, l)) |
---|
17 | |
---|
18 | content.append( "};\n" |
---|
19 | "#endif\n") |
---|
20 | |
---|
21 | with open(outpath, "w") as outfile: |
---|
22 | outfile.writelines(content) |
---|
23 | |
---|
24 | if __name__ == "__main__": |
---|
25 | faulty = [ (0,0,1), (0,1,1), (1,0,1), (1,0,2), (1,0,3), (1,1,1), (1,1,3)] |
---|
26 | generate(faulty, "fault.gen.h") |
---|
27 | |
---|
28 | # vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab |
---|
Note: See
TracBrowser
for help on using the repository browser.