0202174c by rmrf

PortDecl json dump

1 parent 851f1c1f
......@@ -29,10 +29,8 @@ string PortDecl::getName() const { return port_name_; }
FindTemplateTypes *PortDecl::getTemplateType() { return template_type_; }
void PortDecl::dump(llvm::raw_ostream &os, int tabn) {
// os << "PortDecl " << this << " '" << port_name_ << "' FindTemplateTypes "
// << template_type_;
os << "Port name: " << port_name_ << " ";
template_type_->printTemplateArguments(os);
//os << "Port name: " << port_name_ << " ";
//template_type_->printTemplateArguments(os);
dump_json();
}
......@@ -40,8 +38,17 @@ void PortDecl::dump(llvm::raw_ostream &os, int tabn) {
json PortDecl::dump_json() {
json port_j;
port_j["module_name"] = getName();
//port_j["template_type"]
port_j["port_name"] = getName();
// Template arguments
auto template_args{ template_type_->getTemplateArgumentsType() };
port_j["port_type"] = template_args[0].getTypeName();
template_args.erase( begin(template_args) );
for ( auto ait = begin(template_args); ait != end(template_args); ++ait ) {
port_j["port_arguments"].push_back( ait->getTypeName() );
}
std::cout << port_j.dump(4);
return port_j;
}
......
......@@ -34,9 +34,11 @@ public:
void dump(raw_ostream &, int tabn = 0);
json dump_json();
private:
// Name of the port
string port_name_;
// This holds the types for the port
FindTemplateTypes *template_type_;
};
} // namespace scpar
......
......@@ -13,7 +13,7 @@ namespace scpar {
using namespace std;
using namespace clang;
using json = nlohmann::json;
using json = nlohmann::json;
class ProcessDecl {
public:
......@@ -36,10 +36,13 @@ public:
protected:
// Process information
string process_type_;
// Name of the entry function
string entry_name_;
// Each process can have 1 entry function.
CXXMethodDecl *entry_method_decl_;
// This is a container that holds information about the
// entry function.
EntryFunctionContainer *entry_function_ptr_;
}; // End class ProcessDecl
......
......@@ -171,9 +171,9 @@ _systemcModel->addNetlist(findNetlist);
llvm::errs());
if (suspensionAutomata.initialize()) {
suspensionAutomata.genSusCFG();
suspensionAutomata.dumpSusCFG();
//suspensionAutomata.dumpSusCFG();
suspensionAutomata.genSauto();
suspensionAutomata.dumpSauto();
//suspensionAutomata.dumpSauto();
entryFunctionContainer.at(j)->addSusCFGAuto(suspensionAutomata);
}
}
......