source: trunk/symtab/make_idisa.py @ 2118

Last change on this file since 2118 was 1441, checked in by vla24, 8 years ago

SymbolTable?: added some missing files

File size: 837 bytes
Line 
1
2def ReadFile(fileName):
3        fin = open(fileName, "r")
4        xmlwfSrc = fin.readlines()
5        fin.close()
6        return xmlwfSrc
7
8def MakeIdisa(xmlwfSrc):
9        idisaXmlwf = ""
10        for src in xmlwfSrc:
11                if '''#include <../lib_simd.h>''' in src:
12                        idisaXmlwf += '''#include "../../../trunk/libgen/idisa_lib/idisa.hpp"\n'''
13                elif '''#include <../carryQ.h>''' in src:
14                        idisaXmlwf += '''#include "../../../trunk/libgen/idisa_lib/carryQ.hpp"\n'''
15                elif '''#include <../s2p.h>''' in src:
16                        idisaXmlwf += '''#include "../../../trunk/libgen/idisa_lib/s2p.hpp"\n'''
17                else:
18                        idisaXmlwf += src
19        return idisaXmlwf
20
21def WriteFile(fileName, xmlwfSrc):
22        fout = open(fileName, "w")
23        for src in xmlwfSrc:
24                fout.write(src)
25        fout.close()
26
27if __name__ == "__main__":
28       
29        xmlwfSrc = ReadFile("xmlwf.cpp")
30       
31        xmlwfSrc = MakeIdisa(xmlwfSrc)
32       
33        WriteFile("xmlwf.cpp", xmlwfSrc)
Note: See TracBrowser for help on using the repository browser.