-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateInfNew.cpp
More file actions
120 lines (82 loc) · 2.19 KB
/
Copy pathcreateInfNew.cpp
File metadata and controls
120 lines (82 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include "rpucfg.h"
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <algorithm>
int RPUConfig::createPatchFile(const String &fileName)
{
int zz;
std::ofstream patchFile(fileName.c_str());
assert(patchFile);
const String & graphName = dfgGraph.name();
String GRAPHNAME = graphName;
std::transform(GRAPHNAME.begin(), GRAPHNAME.end(),
GRAPHNAME.begin(), ::toupper);
//upper graphName
char tempUperString[256];
strcpy(tempUperString,graphName.c_str());
int graphNamelength,i;
graphNamelength=strlen(tempUperString);
for(i=0;i<graphNamelength;i++)
{
tempUperString[i]=toupper(tempUperString[i]);
}
//upper end
char templiststring[256];
int listlength;
// "#include \"RPU"<<onRPUNum<<"_CWI.h\"\n\n\n";
for(zz = 0; zz < GroupRCANum; zz++)
{
patchFile<<
"#include \""<<locateGroupDFGList[zz]<<"_interface.h\"\n";
}
patchFile<<
"\n\n\n"
// "#ifndef RPU_"<<onRPUNum<<"_GROUP_"<<RPUGroupNum<<"_FLAG\n\n\n"
// "#define RPU_"<<onRPUNum<<"_GROUP_"<<RPUGroupNum<<"_FLAG\n\n\n"
"#define "<<tempUperString<<"_FUNC \\\n";
for(zz = 0; zz < GroupRCANum; zz++)
{
//upper locateGroupDFGList
strcpy(templiststring,locateGroupDFGList[zz]);
listlength = strlen(templiststring);
for(i=0;i<listlength;i++)
{
templiststring[i]=toupper(templiststring[i]);
}
//upper end
patchFile<<
"\t\t\t"<<templiststring<<"_DIN\\\n";
}
patchFile<<"\t\t\t"<<"GROUP"<<RPUGroupNum<<"_CWI\\\n";
//patchFile<<"\t\t\t"<<"while(!RPU0_done){ }\\\n";
for(zz = 0; zz < GroupRCANum; zz++)
{
//upper locateGroupDFGList
strcpy(templiststring,locateGroupDFGList[zz]);
listlength = strlen(templiststring);
for(i=0;i<listlength;i++)
{
templiststring[i]=toupper(templiststring[i]);
}
//upper end
if(zz!=GroupRCANum-1){
patchFile<<
"\t\t\t"<<templiststring<<"_DOUT\\\n";
}
else{
patchFile<<"\t\t\t"<<templiststring<<"_DOUT\n";
}
}
patchFile<<std::endl;
patchFile.close();
/*
patchFile<<
"#else\n\n"
"#define "<<tempUperString<<"_FUNC \\\n\n"
"#endif\n\n";
patchFile<<std::endl;
*/
return 0;
}