summaryrefslogtreecommitdiff
path: root/backends/blif/blif.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-11-24 05:03:43 +0100
committerClifford Wolf <clifford@clifford.at>2013-11-24 05:03:43 +0100
commit28093d9dd288484daa9df17585c1c9f174498359 (patch)
tree3940c6d3bd95f7c983c76cd6e54bd04216867f3d /backends/blif/blif.cc
parenta4edecb0cae0524b6f42d1a2c64af5a940c67a2f (diff)
Added "top" attribute to mark top module in hierarchy
Diffstat (limited to 'backends/blif/blif.cc')
-rw-r--r--backends/blif/blif.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/backends/blif/blif.cc b/backends/blif/blif.cc
index 27f08774..f5a98276 100644
--- a/backends/blif/blif.cc
+++ b/backends/blif/blif.cc
@@ -293,6 +293,11 @@ struct BlifBackend : public Backend {
}
extra_args(f, filename, args, argidx);
+ if (top_module_name.empty())
+ for (auto & mod_it:design->modules)
+ if (mod_it.second->get_bool_attribute("\\top"))
+ top_module_name = mod_it.first;
+
fprintf(f, "# Generated by %s\n", yosys_version_str);
std::vector<RTLIL::Module*> mod_list;