@@ -775,9 +775,9 @@ void VerificImporter::merge_past_ffs(pool<RTLIL::Cell*> &candidates)
775
775
merge_past_ffs_clock (it.second , it.first .first , it.first .second );
776
776
}
777
777
778
- void VerificImporter::import_netlist (RTLIL::Design *design, Netlist *nl, std::set<Netlist*> &nl_todo, bool top )
778
+ void VerificImporter::import_netlist (RTLIL::Design *design, Netlist *nl, std::set<Netlist*> &nl_todo)
779
779
{
780
- std::string netlist_name = top ? nl->CellBaseName () : nl->Owner ()->Name ();
780
+ std::string netlist_name = nl-> GetAtt ( " \\ top" ) ? nl->CellBaseName () : nl->Owner ()->Name ();
781
781
std::string module_name = nl->IsOperator () ? " $verific$" + netlist_name : RTLIL::escape_id (netlist_name);
782
782
783
783
netlist = nl;
@@ -1768,7 +1768,7 @@ void verific_import(Design *design, const std::map<std::string,std::string> &par
1768
1768
if (veri_lib) veri_libs.InsertLast (veri_lib);
1769
1769
1770
1770
Map verific_params (STRING_HASH);
1771
- for (auto i : parameters)
1771
+ for (const auto & i : parameters)
1772
1772
verific_params.Insert (i.first .c_str (), i.second .c_str ());
1773
1773
1774
1774
if (top.empty ()) {
@@ -1800,8 +1800,10 @@ void verific_import(Design *design, const std::map<std::string,std::string> &par
1800
1800
int i;
1801
1801
1802
1802
FOREACH_ARRAY_ITEM (netlists, i, nl) {
1803
- if (top.empty () || nl->CellBaseName () == top)
1804
- nl_todo.insert (nl);
1803
+ if (top.empty () && nl->CellBaseName () != top)
1804
+ continue ;
1805
+ nl->AddAtt (new Att (" \\ top" , NULL ));
1806
+ nl_todo.insert (nl);
1805
1807
}
1806
1808
1807
1809
delete netlists;
@@ -1817,7 +1819,7 @@ void verific_import(Design *design, const std::map<std::string,std::string> &par
1817
1819
Netlist *nl = *nl_todo.begin ();
1818
1820
if (nl_done.count (nl) == 0 ) {
1819
1821
VerificImporter importer (false , false , false , false , false , false );
1820
- importer.import_netlist (design, nl, nl_todo, nl-> CellBaseName () == top );
1822
+ importer.import_netlist (design, nl, nl_todo);
1821
1823
}
1822
1824
nl_todo.erase (nl);
1823
1825
nl_done.insert (nl);
@@ -2322,8 +2324,10 @@ struct VerificPass : public Pass {
2322
2324
Netlist *nl;
2323
2325
int i;
2324
2326
2325
- FOREACH_ARRAY_ITEM (netlists, i, nl)
2327
+ FOREACH_ARRAY_ITEM (netlists, i, nl) {
2328
+ nl->AddAtt (new Att (" \\ top" , NULL ));
2326
2329
nl_todo.insert (nl);
2330
+ }
2327
2331
delete netlists;
2328
2332
}
2329
2333
0 commit comments