Skip to content

Commit

Permalink
adds uvm components recognition to hierarchy dumper
Browse files Browse the repository at this point in the history
  • Loading branch information
eyck committed Aug 30, 2023
1 parent 4630887 commit 3e62bf3
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/sysc/scc/hierarchy_dumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,17 @@ struct Module {
{ }
};

const std::unordered_set<std::string> know_entities = {
const std::unordered_set<std::string> ignored_entities = {
"tlm_initiator_socket", "sc_export", "sc_thread_process", "sc_signal",
"sc_object", "sc_fifo", "sc_method_process", "sc_mutex", "sc_vector",
"sc_semaphore_ordered", "sc_variable", "sc_prim_channel", "tlm_signal", "sc_register"
"sc_semaphore_ordered", "sc_variable", "sc_prim_channel", "tlm_signal", "tlm_fifo",
"sc_register", "sc_buffer"
};

const std::unordered_set<std::string> module_entities = {
"sc_module", "uvm::uvm_root", "uvm::uvm_test", "uvm::uvm_env",
"uvm::uvm_component", "uvm::uvm_agent", "uvm::uvm_monitor", "uvm::uvm_scoreboard",
"uvm::uvm_driver", "uvm::uvm_sequencer"
};

std::string indent{" "};
Expand Down Expand Up @@ -144,7 +151,7 @@ std::vector<std::string> scanModule(sc_core::sc_object const* obj, Module *curre
return {};
SCCDEBUG() << indent*level<< obj->name() << "(" << obj->kind() << ")";
std::string kind{obj->kind()};
if (kind == "sc_module") {
if (module_entities.find(kind) != module_entities.end()) {
currentModule->submodules.push_back(
Module(obj->name(), name, type(*obj), false));
std::unordered_set<std::string> keep_outs;
Expand Down Expand Up @@ -194,8 +201,8 @@ std::vector<std::string> scanModule(sc_core::sc_object const* obj, Module *curre
} else if (auto const* optr = dynamic_cast<sc_core::sc_export_base const*>(obj)) {
sc_core::sc_interface const* pointer = optr->get_interface();
currentModule->ports.push_back(Port(obj->name(), name, pointer, true, obj->kind()));
} else if (know_entities.find(std::string(obj->kind())) == know_entities.end()) {
SCCWARN() << "object not known (" << std::string(obj->kind()) << ")";
} else if (ignored_entities.find(kind) == ignored_entities.end()) {
SCCWARN() << "object not known (" << kind << ")";
}
return {};
}
Expand Down

0 comments on commit 3e62bf3

Please sign in to comment.