Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aletempiac committed May 6, 2024
1 parent 8a10355 commit c13cd02
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions include/mockturtle/algorithms/emap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,18 +721,26 @@ template<class Ntk, unsigned CutSize, unsigned NInputs, classification_type Conf
class emap_impl
{
private:
struct multi_match_data
union multi_match_data
{
uint32_t node_index;
uint32_t cut_index;
bool in_tfi;
uint64_t data{ 0 };
struct
{
uint64_t in_tfi : 1;
uint64_t cut_index : 31;
uint64_t node_index : 32;
};
};
struct multioutput_info
union multioutput_info
{
uint32_t index : 29;
uint32_t lowest_index : 1;
uint32_t highest_index : 1;
uint32_t has_info : 1;
uint32_t data;
struct
{
unsigned index : 29;
unsigned lowest_index : 1;
unsigned highest_index : 1;
unsigned has_info : 1;
};
};

public:
Expand Down Expand Up @@ -3699,7 +3707,7 @@ class emap_impl
{
/* 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].at( 0 );
multi_match_t& matches = multi_node_match[node_tuple_match[index].index][0];

/* find the corresponding cut */
uint32_t cut_p = 0;
Expand Down Expand Up @@ -3754,7 +3762,7 @@ class emap_impl
/* reset matches */
for ( multi_match_data const& entry : matches )
{
node_tuple_match[entry.node_index] = { 0 };
node_tuple_match[entry.node_index].data = 0;
}
}

Expand Down Expand Up @@ -5235,10 +5243,8 @@ 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 */
Expand Down Expand Up @@ -5491,7 +5497,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 */
bool in_tfi = multi_is_in_direct_tfi( ntk.index_to_node( index2 ), ntk.index_to_node( index1 ) );
uint32_t in_tfi = multi_is_in_direct_tfi( ntk.index_to_node( index2 ), ntk.index_to_node( index1 ) ) ? 0 : 1;
for ( auto& match : field )
match[0].in_tfi = in_tfi;
/* add a TFI dependency */
Expand Down Expand Up @@ -5559,7 +5565,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 )] = { 0 };
node_tuple_match[ntk.node_to_index( p )].data = 0;
return true;
} );
choice_ntk.remove_choice( g );
Expand Down

0 comments on commit c13cd02

Please sign in to comment.