27 llvm::dbgs() <<
"=============== ##### TEST NetlistMatcher ##### \n";);
29 MatchFinder netlist_registry{};
31 module_declaration_handler);
36 for (
const auto &inst : instances) {
38 auto ctordecl{mdecl->getConstructorDecl()};
39 if (ctordecl !=
nullptr) {
40 const FunctionDecl *fd{dyn_cast<FunctionDecl>(ctordecl)};
41 ctordecl->getBody(fd);
43 LLVM_DEBUG(llvm::dbgs() <<
"==============> RUN netlist matcher: "
44 << mdecl->getInstanceName() <<
"\n";);
47 LLVM_DEBUG(llvm::dbgs() <<
"==============> DONE netlist matcher\n";);
51 LLVM_DEBUG(netlist_matcher.dump();
52 llvm::dbgs() <<
"##### END TEST NetlistMatcher ##### \n";);
56 clang::TranslationUnitDecl *tu{
getContext().getTranslationUnitDecl()};
65 MatchFinder matchRegistry{};
68 module_declaration_handler.processInstanceCXXDecls(
getContext());
70 LLVM_DEBUG(llvm::dbgs() <<
"== Print module declarations pruned\n";
71 module_declaration_handler.dump();
72 llvm::dbgs() <<
"================ END =============== \n";);
78 if (scmain.isSCMainFound()) {
79 clang::FunctionDecl *fnDecl{scmain.getSCMainFunctionDecl()};
86 LLVM_DEBUG(llvm::dbgs() <<
"\n Could not find SCMain";);
95 auto found_module_declarations{
96 module_declaration_handler.getFoundModuleDeclarations()};
98 LLVM_DEBUG(llvm::dbgs() <<
"############# ============= NEW FIRE "
99 "============ ################\n";
100 llvm::dbgs() <<
"Size of module instances: "
101 << found_module_declarations.size() <<
"\n";);
103 for (
const auto &inst : found_module_declarations) {
104 clang::CXXRecordDecl *cxx_decl{inst.first};
136 instance_matcher_= base_instance_matcher;
147 llvm::dbgs() <<
"############# ===== END NEW FIRE ============ "
148 "################\n";
150 llvm::dbgs() <<
"=============== Populate sub-modules ============= \n";);
154 auto instance_matcher{module_declaration_handler.getInstanceMatcher()};
155 auto instance_map{instance_matcher.getInstanceMap()};
158 llvm::dbgs() <<
"- Print out all the instances in the instance map\n";);
162 llvm::dbgs() <<
"===========END Populate sub-modules ============= \n";);
174 llvm::dbgs() <<
"\nParsed SystemC model from systemc-clang\n";
175 llvm::dbgs() <<
"============= MODEL ============================\n";
177 llvm::dbgs() <<
"==============END========================\n";);
clang::FunctionDecl * getSCMainFunctionDecl() const