00001 #ifndef CTHREAD_ANALYZER_H_INCLUDED_
00002 #define CTHREAD_ANALYZER_H_INCLUDED_
00003
00004 #include "rose.h"
00005
00006 #include <vector>
00007 #include <set>
00008 #include <utility>
00009
00010 namespace risc
00011 {
00012
00013 class Module;
00014 class CThread;
00015 class Port;
00016
00017 typedef std::vector<CThread*> CThreadVector;
00018
00019 namespace sa
00020 {
00021
00022 typedef std::pair<Port*, SgBoolValExp*> ResetSignal;
00023
00024
00026 typedef std::pair<CThread*, std::set<SgVariableSymbol*> >
00027 CThreadUninitializedVariables;
00028 typedef std::set<CThreadUninitializedVariables>
00029 CThreadUninitializedVariablesSet;
00030
00032 typedef std::pair<ResetSignal*, CThreadVector> ResetSignalSensitiveCThreads;
00033 typedef std::set<ResetSignalSensitiveCThreads> ResetSignalSensitiveCThreadsSet;
00034
00036 typedef std::pair<ResetSignal*, std::set<SgVariableSymbol*> >
00037 ResetSignalUninitializedVariables;
00038 typedef std::set<ResetSignalUninitializedVariables>
00039 ResetSignalUninitializedVariablesSet;
00040
00041
00042 typedef std::pair<CThread*, ResetSignal*>
00043 CThreadResetSignalPair;
00044 typedef std::pair<CThreadResetSignalPair, std::vector<SgExpression*> >
00045 CThreadResetSignalExpressions;
00046 typedef std::vector<CThreadResetSignalExpressions>
00047 CThreadResetSignalExpressionsVector;
00048
00053 SgFunctionCallExp* find_first_wait_stmt(SgFunctionDefinition *func_def);
00054
00055
00062 std::set<SgFunctionCallExp*>
00063 traverse_for_non_nested_func_calls(SgFunctionDefinition *func_def);
00064
00065
00070 void
00071 collect_non_nested_expressions(SgFunctionDefinition *func_def,
00072 std::vector<SgExpression*> &before_wait,
00073 std::vector<SgExpression*> &after_wait);
00074
00075 CThreadUninitializedVariablesSet
00076 most_pessimistic_analysis(risc::Module &module);
00077
00078 CThreadUninitializedVariablesSet
00079 inter_thread_analysis(Module &module, CThreadVector *subset_of_cthreads = NULL);
00080
00081 ResetSignalUninitializedVariablesSet
00082 inter_reset_cthread_analysis(Module &module);
00083
00084 ResetSignalUninitializedVariablesSet
00085 inter_async_reset_cthread_analysis(Module &module);
00086
00087 CThreadResetSignalExpressionsVector
00088 get_cthread_reset_signal_expressions(Module &module);
00089
00090 CThreadResetSignalExpressionsVector
00091 get_cthread_async_reset_signal_expressions(Module &module);
00092
00093 void
00094 member_variable_filter(risc::Module &module, std::vector<SgNode*> variable);
00095
00096 void
00097 get_recursivly_nested_expressions_in_function(
00098 SgFunctionDefinition *root_function,
00099 std::vector<SgExpression*> &expressions);
00100
00101 std::set<SgFunctionDefinition*>
00102 get_called_functions_and_expressions(SgFunctionDefinition *root_function,
00103 std::vector<SgExpression*> &expressions);
00104
00105 }
00106
00107 }
00108
00109 #endif
00110
00111