52 #include "tce_config.h"
75 "Print missing operations from primitive operation set",
78 addOption(printPrimitive);
82 "Print all connections in adf.",
85 addOption(printConnections);
90 "Print the name of global connection register",
"g");
92 addOption(printGlobalRegister);
97 "Print missing connections to connection register",
100 addOption(printMissingConnections);
105 "Print all connections to the connection register.",
"r");
107 addOption(printRFConnections);
112 "Don't print any error messages.",
"e");
114 addOption(doNotPrintErrors);
119 "Write binary program as output.",
"w");
121 addOption(writeBinary);
125 return findOption(
"primitive")->isFlagOn();
129 return findOption(
"connections")->isFlagOn();
133 return findOption(
"global_register")->isFlagOn();
137 return findOption(
"missing")->isFlagOn();
141 return findOption(
"reg_connections")->isFlagOn();
145 return findOption(
"no_errors")->isFlagOn();
149 return findOption(
"binary")->isFlagOn();
153 cout <<
"dictionary_tool - Dictionary Tool "
162 int main(
int argc,
char* argv[]) {
179 cerr <<
"Illegal number of arguments" << endl;
194 cerr <<
"Error opening ADF file:" << endl
195 <<
"- Is the filename correct?" << endl
196 <<
"- Is the machine legal?" << endl;
212 for (
int i = 0; i < booleanResults.
errorCount(); i++) {
214 booleanResults.
error(i);
216 cerr << error.second << endl;
218 cerr <<
"Execution stopped." << endl;
222 bool gcrError =
false;
227 binaryProgram = validator->
profile(results);
230 cerr <<
"Check that all operations are found in OSAL." << endl;
231 cerr <<
"Create new ones with OSEd." << endl;
232 cerr <<
"Execution stopped." << endl;
239 string outputFile = adfFileName.append(
"_profiled.tpef");
241 TPEFWriter::instance().writeBinary(tpefOut, binaryProgram);
244 if (!
options.doNotPrintErrors()) {
245 for (
int i = 0; i < results.
errorCount(); i++) {
249 OPERATION_MISSING_FROM_THE_PRIMITIVE_OPERATION_SET) {
250 if (
options.printPrimitive()) {
251 cerr << error.second << endl;
254 else if (error.first ==
256 GLOBAL_CONNECTION_REGISTER_NOT_FOUND) {
257 if (
options.printGlobalRegister()) {
259 cerr << error.second << endl;
262 else if (error.first ==
264 MISSING_CONNECTION) {
265 if (
options.printMissingConnections()) {
266 cerr << error.second << endl;
270 cerr << error.second << endl;
275 if (
options.printGlobalRegister() && !gcrError) {
276 cout <<
"* The global connection register in the machine is: "
281 if (
options.printConnections()) {
285 if (
options.printRFConnections()) {