source: branches/reconfiguration/platforms/tsar_generic_iob/scripts/parse.py @ 778

Last change on this file since 778 was 777, checked in by cfuguet, 8 years ago

reconfiguration/tsar_generic_iob: adding parse.py script for stats harvesting

File size: 1.0 KB
Line 
1import os
2import sys
3
4def parse_ffstend(configs, confpath, outpath):
5    # write header
6    ffst_end = open(outpath, "w")
7    ffst_end.writelines([
8        "#  ffst end (cycles)\n",
9        "#  clusters cycles\n",
10        "\n"])
11
12    # repeat while configurations is not empty
13    for x,y in configs:
14        confdir = confpath + "/config_{}c/".format(x*y)
15
16        #  parse term log and get relevant information
17        with open(confdir + "term", "r") as termlog:
18            for line in termlog:
19                partitions = line.partition(':')
20                if partitions[0].strip() == "FFST (END)":
21                    value = int(partitions[2])
22                    ffst_end.write("{} {}\n".format(x*y, value))
23                    break
24
25    ffst_end.close()
26
27if __name__ == "__main__":
28    configs = []
29    configs.append([2 , 2 ])
30    configs.append([4 , 4 ])
31    configs.append([8 , 8 ])
32    configs.append([16, 16])
33
34    assert len(sys.argv) > 2, "Introduce config path and output path"
35
36    parse_ffstend(configs, sys.argv[1], sys.argv[2])
Note: See TracBrowser for help on using the repository browser.