From 91ed15c38bb6fbdb3afca5c43b811fce848b8f1e Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Tue, 6 Feb 2024 17:49:51 +0100 Subject: [PATCH] fixup! Example pass for the scopeinfo index/lookup utils --- examples/cxx-api/scopeinfo_example.cc | 44 --------------------------- 1 file changed, 44 deletions(-) diff --git a/examples/cxx-api/scopeinfo_example.cc b/examples/cxx-api/scopeinfo_example.cc index 668764a0566..f163dff9eee 100644 --- a/examples/cxx-api/scopeinfo_example.cc +++ b/examples/cxx-api/scopeinfo_example.cc @@ -27,50 +27,6 @@ USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN -/* -static void dump_scope(int depth, const ScopeinfoIndex &info, ScopeinfoIndex::Scope scope); - -static void dump_entry(int depth, const ScopeinfoIndex &info, ScopeinfoIndex::ScopeEntry entry) -{ - const char *type; - const char *scope_type; - switch (info.data(entry).type) { - case ScopeinfoIndex::ScopeEntryData::Type::CELL: type = "cell"; scope_type = "module"; break; - case ScopeinfoIndex::ScopeEntryData::Type::WIRE: type = "wire"; scope_type = "struct"; break; - default: log_assert(false); - } - log("%*s- %s %s\n", depth, "", type, RTLIL::unescape_id(info.data(entry).name).c_str()); - if (info.data(entry).has_attribute(ID::src)) - log("%*s@ %s\n", depth + 2, "", info.data(entry).get_src_attribute().c_str()); - for (auto const &entry : info.data(entry).attributes()) - if (!entry.first.in(ID::src, ID::hdlname)) - log("%*s: %s = %s\n", depth + 2, "", log_id(entry.first), log_const(entry.second)); - if (info.data(entry).inner.valid()) { - dump_scope(depth + 2, info, info.data(entry).inner); - } else { - IdString scope_name = info.data(entry).scope_name(); - if (!scope_name.empty()) - log("%*s= %s %s\n", depth + 2, "", scope_type, RTLIL::unescape_id(scope_name).c_str()); - } -} - -static void dump_scope(int depth, const ScopeinfoIndex &info, ScopeinfoIndex::Scope scope) { - const char *type; - switch (info.data(scope).type) { - case ScopeinfoIndex::ScopeData::Type::MODULE: type = "module"; break; - case ScopeinfoIndex::ScopeData::Type::STRUCT: type = "struct"; break; - default: log_assert(false); - } - log("%*s+ %s %s\n", depth, "", type, RTLIL::unescape_id(info.data(scope).name()).c_str()); - if (info.data(scope).has_attribute(ID::src)) - log("%*s@ %s\n", depth + 2, "", info.data(scope).get_src_attribute().c_str()); - for (auto const &entry : info.data(scope).attributes()) - if (!entry.first.in(ID::src, ID::hdlname)) - log("%*s: %s = %s\n", depth + 2, "", log_id(entry.first), log_const(entry.second)); - for (auto entry : info.data(scope).entries) - dump_entry(depth + 2, info, entry.second); -}; -*/ struct ScopeinfoExamplePass : public Pass { ScopeinfoExamplePass() : Pass("scopeinfo_example", "dump scopeinfo") {} void help() override