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