1 #ifndef OOO_INSTRUMENTATION_H_INCLUDED_
2 #define OOO_INSTRUMENTATION_H_INCLUDED_
6 #include <unordered_set>
7 #include <unordered_map>
11 #include "../segment_graph/combined_data_conflict_table.h"
12 #include "../segment_graph/prediction_time_advance_table.h"
13 #include "../segment_graph/prediction_event_notification_table.h"
24 #ifndef DUMP_TABLE_THRESHOLD
25 #define DUMP_TABLE_THRESHOLD 42
55 #ifdef RISC_INSTRUMENT_CHNL_SCOPED_LOCK
56 SgType*, SgExpression*, SgExpression*,
58 SgClassDefinition*, std::map<SgNode*, int>&, std::string );
59 virtual void visit(SgNode* astNode);
66 #ifdef RISC_INSTRUMENT_CHNL_SCOPED_LOCK // skip user-channel protection
75 SgExpression* PrimChnlVarRefExp;
80 SgExpression* SCChnlVarRefExp;
81 #endif // RISC_INSTRUMENT_CHNL_SCOPED_LOCK // skip user-channel protection
93 public: std::unordered_set<SgNode*>
visited;
119 std::vector<std::string>& argv,
120 std::vector<std::string>& compilerCmdLine,
122 const std::string tool_name);
157 const std::string tool_name,
158 UnparseFormatHelp *unparseFormatHelp = NULL,
159 UnparseDelegate* unparseDelegate = NULL);
186 const std::string tool_name);
201 const std::string tool_name,
202 UnparseFormatHelp *unparseFormatHelp = NULL,
203 UnparseDelegate* unparseDelegate = NULL);
236 std::string design_file_name,
237 std::vector< std::vector<int> > &psg_seg_id_array,
238 std::vector<std::string> &file_names,
239 std::vector< std::vector<int> > &channel_seg_id_array,
240 std::vector<std::string> &channel_seg_id_array_names
int risc_compileOutput(SgProject *project, risc::tools::ParseStatus *parseStatus, const std::string tool_name)
Tailored SgProject::compileOutput for customized compiler. The original ROSE codes are at ~src/fronte...
Definition: ooo_instrumentation.cpp:1198
int counter
counter to get a unique variable name with number
Definition: ooo_instrumentation.cpp:33
int risc_compile(risc::Design &design, risc::tools::ParseStatus *parseStatus, const std::string tool_name)
This function compiles and links the unparsed source code file(s) using the customized compiler...
Definition: ooo_instrumentation.cpp:1405
This class represents a segment graph for a process.
Definition: segment_graph.h:79
void hack_instrument_fifo_read(SgFunctionCallExp *, SgExpression *)
Definition: ooo_instrumentation.cpp:59
void instrument_offset_before_and_after_b_transports(risc::sg::SegmentGraph &sg)
sets the segment offset value before and after b_transport
Definition: ooo_instrumentation.cpp:4160
Definition: prediction_time_advance_table.h:13
InstrumentationTraversal(SgClassDefinition *, std::map< SgNode *, int > &, std::string)
Definition: ooo_instrumentation.cpp:35
std::unordered_set< SgNode * > visited
Definition: ooo_instrumentation.h:93
void dump_table_to_file(risc::Design &design, risc::sg::SegmentGraph &sg, risc::sg::DataConflictTable *data_conflict_table, risc::sg::EventConflictTable *event_conflict_table, risc::sg::TimeAdvanceTable *time_advance_table, risc::sg::CombinedDataConflictTable *combined_data_conflict_table, risc::sg::PredictionTimeAdvanceTable *prediction_time_advance_table, risc::sg::PredictionEventNotificationTable *prediction_event_notification_table, risc::sg::PredictionEventNotificationTable *prediction_event_notification_table_no_indirect, risc::tools::ParseStatus *parseStatus)
This function dumps all the lookup tables to a file.
Definition: ooo_instrumentation.cpp:2961
SgClassDefinition * SCModuleClassDef
SgClassDefinition of "::sc_core::sc_module".
Definition: ooo_instrumentation.h:86
void instrument_wait_in_b_transports(risc::sg::SegmentGraph &sg)
changes the segment id passing from constants to variables in b_transports which are passed by thread...
Definition: ooo_instrumentation.cpp:4392
The conflicts are stored in the base class variable conflict_table_. The columns represent wait state...
Definition: event_conflict_table.h:32
int risc_backend(risc::Design &design, risc::tools::ParseStatus *parseStatus, const std::string tool_name, UnparseFormatHelp *unparseFormatHelp, UnparseDelegate *unparseDelegate)
Tailored backend for SystemC source files. The original ROSE codes are at ~src/roseSupport/utility_fu...
Definition: ooo_instrumentation.cpp:1473
Definition: combined_data_conflict_table.h:24
std::unordered_map< SgFunctionCallExp *, SgExpression * > map_fifoRead_id
Definition: ooo_instrumentation.h:94
int risc_link(SgProject *project, risc::tools::ParseStatus *parseStatus, const std::string tool_name)
Tailored SgProject::link for customized linker. The original ROSE codes are at ~src/frontend/SageIII/...
Definition: ooo_instrumentation.cpp:402
std::map< SgNode *, int > & FuncCallExptoID
Mapping from SgNode to segment ID.
Definition: ooo_instrumentation.h:91
This class represents the data conflict table among the individual segments. Two segments have a conf...
Definition: data_conflict_table.h:25
std::string design_file_name
Definition: ooo_instrumentation.h:63
SgFunctionDeclaration * first_func_decl_that_contains_wait
Definition: ooo_instrumentation.h:61
void instrument_functions_without_definitions(risc::sg::SegmentGraph &sg)
for test purpose now
void instrument_wait_in_channels(risc::sg::SegmentGraph &sg)
changes the segment id passing from constants to variables in channels which are passed by thread loc...
Definition: ooo_instrumentation.cpp:4025
SgClassDeclaration * first_module_decl
Definition: ooo_instrumentation.h:62
The AST traversal class.
Definition: ooo_instrumentation.h:51
Definition: prediction_event_notification_table.h:18
virtual void visit(SgNode *astNode)
Definition: ooo_instrumentation.cpp:86
void risc_buildCompilerCommandLineOptions(SgFile *file, std::vector< std::string > &argv, std::vector< std::string > &compilerCmdLine, risc::tools::ParseStatus *parseStatus, const std::string tool_name)
Tailored SgFile::buildCompilerCommandLineOptions for customized compiler. The original ROSE codes are...
Definition: ooo_instrumentation.cpp:596
int risc_compileOutputFile(SgFile *file, risc::tools::ParseStatus *parseStatus, const std::string tool_name)
Tailored SgFile::compileOutput for customized compiler. The original ROSE codes are at ~src/ROSETTA/G...
Definition: ooo_instrumentation.cpp:912
std::string generate_unique_name(std::string var_name)
generates a unique variable based on var_name
Definition: ooo_instrumentation.cpp:4614
void instrumentor(risc::Design &design, risc::sg::SegmentGraph &sg, risc::sg::DataConflictTable *data_conflict_table, risc::sg::EventConflictTable *event_conflict_table, risc::sg::TimeAdvanceTable *time_advance_table, risc::sg::CombinedDataConflictTable *combined_data_conflict_table, risc::sg::PredictionTimeAdvanceTable *prediction_time_advance_table, risc::sg::PredictionEventNotificationTable *prediction_event_notification_table, risc::sg::PredictionEventNotificationTable *prediction_event_notification_table_no_indirect, risc::tools::ParseStatus *parseStatus, std::string design_file_name, std::vector< std::vector< int > > &psg_seg_id_array, std::vector< std::string > &file_names, std::vector< std::vector< int > > &channel_seg_id_array, std::vector< std::string > &channel_seg_id_array_names)
This function instruments the AST tree of SystemC designs, and compiles unparsed source file(s) using...
Definition: ooo_instrumentation.cpp:1542
void instrument_port_calls(risc::sg::SegmentGraph &sg)
instruments the upcoming segments ids to thread local data
Definition: ooo_instrumentation.cpp:3859
void risc_unparse(risc::Design &design, risc::tools::ParseStatus *parseStatus, const std::string tool_name, UnparseFormatHelp *unparseFormatHelp, UnparseDelegate *unparseDelegate)
This function unparses AST trees to source code file(s)
Definition: ooo_instrumentation.cpp:1298
Definition: time_advance_table.h:18
bool _psg_off_instrumented
Definition: ooo_instrumentation.h:60