systemc-clang 2.0.0
Parsing SystemC constructs
Loading...
Searching...
No Matches
Model.h
Go to the documentation of this file.
1#ifndef _MODEL_H_
2#define _MODEL_H_
3
5#include "EventContainer.h"
6#include "FindGlobalEvents.h"
7#include "FindNetlist.h"
8#include "FindSimTime.h"
9#include "ModuleInstance.h"
10
11#include <map>
12#include <string>
13#include <vector>
14
15#include "Matchers.h"
17#include "clang/AST/DeclCXX.h"
18
19namespace systemc_clang {
20using namespace clang;
21using namespace std;
22using namespace sc_ast_matchers;
23
24class Model {
25 public:
26 typedef std::pair<std::string, ModuleInstance *> modulePairType;
27 typedef std::vector<modulePairType> moduleMapType;
28
29 typedef std::pair<std::string, EventContainer *> eventPairType;
30 typedef std::map<std::string, EventContainer *> eventMapType;
31
32 typedef std::pair<ModuleInstance *, std::vector<ModuleInstance *>>
34 typedef std::map<ModuleInstance *, std::vector<ModuleInstance *>>
36
37 typedef pair<EntryFunctionContainer *, FindGPUMacro::forStmtGPUMacroMapType>
39 typedef map<EntryFunctionContainer *, FindGPUMacro::forStmtGPUMacroMapType>
41
42 Model();
43 virtual ~Model();
44
48 void addSCMain(FunctionDecl *);
52
53 // const moduleMapType &getModuleDecl();
54 ModuleInstance *getInstance(const std::string &instance_name);
55 ModuleInstance *getInstance(Decl *instance_decl);
57
60 std::vector<ModuleInstance *> &getInstances();
61 unsigned int getNumEvents();
62 std::vector<Transition *> getGSauto();
63 void dump(raw_ostream &);
64
65 private:
66 Model(const Model &);
67
68 protected:
69 std::vector<ModuleInstance *> module_instances_;
71
74 FunctionDecl *scmain_function_decl_;
80};
81} // namespace systemc_clang
82#endif
A container class to hold entry function information.
Container class to hold sc_event information.
std::map< std::string, clang::VarDecl * > globalEventMapType
map< string, portSignalMapType > instancePortSignalMapType
Definition FindNetlist.h:31
map< string, vector< string > > instanceListModuleMapType
Definition FindNetlist.h:34
map< string, string > instanceModuleMapType
Definition FindNetlist.h:25
map< string, string > portSignalMapType
Definition FindNetlist.h:28
map< string, string > simulationTimeMapType
Definition FindSimTime.h:18
ModuleInstance * getRootModuleInstance() const
Definition Model.cpp:29
std::pair< std::string, ModuleInstance * > modulePairType
Definition Model.h:26
void populateNestedModules()
Definition Model.cpp:9
ModuleInstance * root_module_inst_
Definition Model.h:70
FindNetlist::instanceModuleMapType instance_module_map_
Definition Model.h:75
FindNetlist::portSignalMapType port_signal_map_
Definition Model.h:76
std::vector< Transition * > getGSauto()
map< EntryFunctionContainer *, FindGPUMacro::forStmtGPUMacroMapType > entryFunctionGPUMacroMapType
Definition Model.h:40
eventMapType getEventMapType()
Definition Model.cpp:137
std::pair< std::string, EventContainer * > eventPairType
Definition Model.h:29
FunctionDecl * scmain_function_decl_
Definition Model.h:74
entryFunctionGPUMacroMapType entry_function_gpu_macro_map_
Definition Model.h:79
void addGlobalEvents(FindGlobalEvents::globalEventMapType)
Definition Model.cpp:90
FindNetlist::instancePortSignalMapType port_signal_instance_map_
Definition Model.h:77
std::map< ModuleInstance *, std::vector< ModuleInstance * > > moduleInstanceMapType
Definition Model.h:35
void addSimulationTime(FindSimTime::simulationTimeMapType)
Definition Model.cpp:80
std::map< std::string, EventContainer * > eventMapType
Definition Model.h:30
void addSCMain(FunctionDecl *)
Definition Model.cpp:100
void dump(raw_ostream &)
Definition Model.cpp:141
std::vector< modulePairType > moduleMapType
Definition Model.h:27
entryFunctionGPUMacroMapType getEntryFunctionGPUMacroMap()
Definition Model.cpp:129
ModuleInstance * getInstance(const std::string &instance_name)
Definition Model.cpp:102
void addInstance(ModuleInstance *)
Definition Model.cpp:76
FindSimTime::simulationTimeMapType simulation_time_
Definition Model.h:72
std::vector< ModuleInstance * > & getInstances()
Definition Model.cpp:133
eventMapType event_map_
Definition Model.h:73
void addEntryFunctionGPUMacroMap(entryFunctionGPUMacroMapType)
Definition Model.cpp:84
unsigned int getNumEvents()
Definition Model.cpp:139
virtual ~Model()
Definition Model.cpp:33
FindNetlist::instanceListModuleMapType module_instance_list_
Definition Model.h:78
std::pair< ModuleInstance *, std::vector< ModuleInstance * > > moduleInstancePairType
Definition Model.h:33
pair< EntryFunctionContainer *, FindGPUMacro::forStmtGPUMacroMapType > entryFunctionGPUMacroPairType
Definition Model.h:38
std::vector< ModuleInstance * > module_instances_
Definition Model.h:69
Model(const Model &)
Forward declarations.
Clang forward declarations.
Definition FindArgument.h:6