Skip to content

Commit

Permalink
decompile vpiHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
alaindargelas committed Oct 6, 2023
1 parent 601d08a commit fbe6058
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions templates/vpi_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,21 @@ std::string decompile(const UHDM::any* handle) {
std::cout << out.str() << "\n";
return out.str();
}

std::string decompile(vpiHandle handle) {
if (handle == nullptr) {
std::cout << "NULL HANDLE\n";
return "NULL HANDLE";
}
UHDM::VisitedContainer visited;
vpi_show_ids(true);
std::stringstream out;
VpiVisitor visitor(out);
visitor.visit_object(handle, 0, "decompile", false);
std::cout << out.str() << "\n";
return out.str();
}

} // namespace UHDM

void vpi_show_ids(bool show) {
Expand Down
1 change: 1 addition & 0 deletions templates/vpi_visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void visit_designs(const std::vector<vpiHandle>& designs, std::ostream& out);
#ifndef SWIG
// For debug use in GDB
std::string decompile(const UHDM::any* handle);
std::string decompile(vpiHandle handle);

class VpiVisitor final {
private:
Expand Down

0 comments on commit fbe6058

Please sign in to comment.