diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-11-24 05:03:43 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-11-24 05:03:43 +0100 |
commit | 28093d9dd288484daa9df17585c1c9f174498359 (patch) | |
tree | 3940c6d3bd95f7c983c76cd6e54bd04216867f3d /backends | |
parent | a4edecb0cae0524b6f42d1a2c64af5a940c67a2f (diff) | |
download | yosys-28093d9dd288484daa9df17585c1c9f174498359.tar.gz yosys-28093d9dd288484daa9df17585c1c9f174498359.tar.bz2 yosys-28093d9dd288484daa9df17585c1c9f174498359.zip |
Added "top" attribute to mark top module in hierarchy
Diffstat (limited to 'backends')
-rw-r--r-- | backends/blif/blif.cc | 5 | ||||
-rw-r--r-- | backends/edif/edif.cc | 5 | ||||
-rw-r--r-- | backends/spice/spice.cc | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/backends/blif/blif.cc b/backends/blif/blif.cc index 27f087746..f5a982760 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; diff --git a/backends/edif/edif.cc b/backends/edif/edif.cc index c5977bb1d..8843b3946 100644 --- a/backends/edif/edif.cc +++ b/backends/edif/edif.cc @@ -118,6 +118,11 @@ struct EdifBackend : 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; + for (auto module_it : design->modules) { RTLIL::Module *module = module_it.second; diff --git a/backends/spice/spice.cc b/backends/spice/spice.cc index 6c8a3ec98..e7926e90e 100644 --- a/backends/spice/spice.cc +++ b/backends/spice/spice.cc @@ -172,6 +172,11 @@ struct SpiceBackend : 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, "* SPICE netlist generated by %s\n", yosys_version_str); fprintf(f, "\n"); |