00001 #ifndef OOO_INSTRUMENTATION_H_INCLUDED_
00002 #define OOO_INSTRUMENTATION_H_INCLUDED_
00003
00004 #include <iostream>
00005 #include <cstdlib>
00006
00007 #include "rose.h"
00008
00009 namespace risc {
00010
00011 class Design;
00012
00013 namespace sg {
00014
00015 class DataConflictTable;
00016 class EventConflictTable;
00017 class SegmentGraph;
00018 class TimeAdvanceTable;
00019 }
00020
00021 namespace tools {
00022
00023 class ParseStatus;
00024 }
00025
00026 namespace inst {
00027
00032 class InstrumentationTraversal: public AstSimpleProcessing
00033 {
00034 public:
00035 InstrumentationTraversal(SgType*, SgExpression*, SgExpression*,
00036 SgClassDefinition*, std::map<SgNode*, int>&);
00037 virtual void visit(SgNode* astNode);
00038
00039 private:
00043 SgType* variableType;
00044
00048 SgExpression* PrimChnlVarRefExp;
00049
00053 SgExpression* SCChnlVarRefExp;
00054
00058 SgClassDefinition* SCModuleClassDef;
00059
00063 std::map<SgNode*, int>& FuncCallExptoID;
00064 };
00065
00072 int
00073 risc_link(SgProject* project, risc::tools::ParseStatus* parseStatus);
00074
00081 void
00082 risc_buildCompilerCommandLineOptions(SgFile* file,
00083 std::vector<std::string>& argv,
00084 std::vector<std::string>& compilerCmdLine,
00085 risc::tools::ParseStatus* parseStatus);
00086
00094 int
00095 risc_compileOutputFile(SgFile* file, risc::tools::ParseStatus* parseStatus);
00096
00104 int
00105 risc_compileOutput(SgProject* project, risc::tools::ParseStatus* parseStatus);
00106
00111 void
00112 risc_unparse(risc::Design &design,
00113 risc::tools::ParseStatus* parseStatus,
00114 UnparseFormatHelp *unparseFormatHelp = NULL,
00115 UnparseDelegate* unparseDelegate = NULL);
00116
00122 void
00123 risc_patch(risc::Design &design,
00124 risc::tools::ParseStatus* parseStatus,
00125 const char *methodPattern,
00126 const char *threadPattern,
00127 const char *cthreadPattern);
00128
00135 int
00136 risc_compile(risc::Design &design, risc::tools::ParseStatus* parseStatus);
00137
00144 int
00145 risc_backend(risc::Design &design,
00146 risc::tools::ParseStatus* parseStatus,
00147 UnparseFormatHelp *unparseFormatHelp = NULL,
00148 UnparseDelegate* unparseDelegate = NULL);
00149
00155 void
00156 instrumentor(risc::Design &design,
00157 risc::sg::SegmentGraph &sg,
00158 risc::sg::DataConflictTable* data_conflict_table,
00159 risc::sg::EventConflictTable* event_conflict_table,
00160 risc::sg::TimeAdvanceTable* time_advance_table,
00161 risc::tools::ParseStatus* parseStatus);
00162
00163
00164 }
00165
00166 }
00167
00168 #endif
00169
00170