diff --git a/include/mockturtle/algorithms/emap.hpp b/include/mockturtle/algorithms/emap.hpp index 17d34df26..1028d8e70 100644 --- a/include/mockturtle/algorithms/emap.hpp +++ b/include/mockturtle/algorithms/emap.hpp @@ -721,26 +721,18 @@ template const& n ) + void match_multi_add_cuts( node const& n ) { /* assume a single cut (current version) */ uint32_t index = ntk.node_to_index( n ); - multi_match_t& matches = multi_node_match[node_tuple_match[index].index][0]; + multi_match_t& matches = multi_node_match[node_tuple_match[index].index].at( 0 ); /* find the corresponding cut */ uint32_t cut_p = 0; @@ -3724,7 +3716,7 @@ class emap_impl if ( rcuts.size() == max_cut_num ) { match_multi_add_cuts_remove_entry( matches ); - return false; + return; } /* insert single cut variation if unique (for delay preservation) */ @@ -3739,7 +3731,7 @@ class emap_impl { rcuts.limit( rcuts.size() - 1 ); match_multi_add_cuts_remove_entry( matches ); - return false; + return; } } @@ -3762,7 +3754,7 @@ class emap_impl /* reset matches */ for ( multi_match_data const& entry : matches ) { - node_tuple_match[entry.node_index].data = 0; + node_tuple_match[entry.node_index] = { 0 }; } } @@ -5243,8 +5235,10 @@ class emap_impl multi_match_data new_data1, new_data2; new_data1.node_index = index1; new_data1.cut_index = multi_cut_set.size() - 1; + new_data1.in_tfi = false; new_data2.node_index = index2; new_data2.cut_index = multi_cut_set.size() - 1; + new_data2.in_tfi = false; multi_match_t p = { new_data1, new_data2 }; /* add cuts to the correct bucket */ @@ -5497,7 +5491,7 @@ class emap_impl if ( multi_is_in_tfi( ntk.index_to_node( index2 ), ntk.index_to_node( index1 ), cut ) ) { /* if there is a path of length > 1 linking node 1 and 2, save as TFI node */ - uint32_t in_tfi = multi_is_in_direct_tfi( ntk.index_to_node( index2 ), ntk.index_to_node( index1 ) ) ? 0 : 1; + bool in_tfi = multi_is_in_direct_tfi( ntk.index_to_node( index2 ), ntk.index_to_node( index1 ) ); for ( auto& match : field ) match[0].in_tfi = in_tfi; /* add a TFI dependency */ @@ -5565,7 +5559,7 @@ class emap_impl { /* fix cycle: remove multi-output match */ choice_ntk.foreach_choice( repr, [&]( auto const& p ) { - node_tuple_match[ntk.node_to_index( p )].data = 0; + node_tuple_match[ntk.node_to_index( p )] = { 0 }; return true; } ); choice_ntk.remove_choice( g );