mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-24 01:25:33 +00:00
Added "top" attribute to mark top module in hierarchy
This commit is contained in:
parent
a4edecb0ca
commit
28093d9dd2
6 changed files with 63 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue