@@ -1801,10 +1801,17 @@ class emap_impl
1801
1801
/* try a multi-output match */
1802
1802
if ( ps.map_multioutput && node_tuple_match[index] < UINT32_MAX - 1 )
1803
1803
{
1804
- match_multioutput_exact<SwitchActivity>( *it, true );
1804
+ bool mapped = match_multioutput_exact<SwitchActivity>( *it, true );
1805
1805
1806
1806
/* propagate required time for the selected gates */
1807
- match_multioutput_propagate_required ( *it );
1807
+ if ( mapped )
1808
+ {
1809
+ match_multioutput_propagate_required ( *it );
1810
+ }
1811
+ else
1812
+ {
1813
+ match_propagate_required ( index );
1814
+ }
1808
1815
}
1809
1816
else
1810
1817
{
@@ -3021,6 +3028,19 @@ class emap_impl
3021
3028
return false ;
3022
3029
}
3023
3030
3031
+ /* if one of the outputs is not referenced, do not use multi-output gate */
3032
+ if ( last_round )
3033
+ {
3034
+ for ( uint32_t j = 0 ; j < max_multioutput_output_size; ++j )
3035
+ {
3036
+ uint32_t node_index = tuple_data[j].node_index ;
3037
+ if ( node_match[node_index].map_refs [2 ] == 0 )
3038
+ {
3039
+ return false ;
3040
+ }
3041
+ }
3042
+ }
3043
+
3024
3044
/* if "same match" and used in the cover dereference the leaves (reverse topo order) */
3025
3045
for ( int j = max_multioutput_output_size - 1 ; j >= 0 ; --j )
3026
3046
{
@@ -3041,28 +3061,9 @@ class emap_impl
3041
3061
}
3042
3062
}
3043
3063
3044
- /* if one of the outputs is not referenced, do not use multi-output gate */
3045
- bool skip = false ;
3046
- if ( last_round )
3047
- {
3048
- for ( uint32_t j = 0 ; j < max_multioutput_output_size; ++j )
3049
- {
3050
- uint32_t node_index = tuple_data[j].node_index ;
3051
- if ( node_match[node_index].map_refs [2 ] == 0 )
3052
- {
3053
- skip = true ;
3054
- break ;
3055
- }
3056
- }
3057
- }
3058
-
3059
- bool mapped_multioutput = false ;
3060
-
3061
3064
/* perform mapping */
3062
- if ( !skip )
3063
- {
3064
- mapped_multioutput = match_multioutput_exact_core<SwitchActivity>( tuple_data, best_exact_area );
3065
- }
3065
+ bool mapped_multioutput = false ;
3066
+ mapped_multioutput = match_multioutput_exact_core<SwitchActivity>( tuple_data, best_exact_area );
3066
3067
3067
3068
/* if "same match" and used in the cover reference the leaves (topo order) */
3068
3069
for ( auto j = 0 ; j < max_multioutput_output_size; ++j )
0 commit comments