mirror of https://github.com/YosysHQ/abc.git
Runtime improvements in decomposition
This commit is contained in:
parent
1632dc0d4e
commit
66cdd36d20
|
|
@ -134,8 +134,8 @@ public:
|
|||
|
||||
/* add cost if not support reducing */
|
||||
uint32_t additional_cost = ( num_vars - i > ps.lut_size ) ? 128 : 0;
|
||||
/* check for feasible solution that improves the cost */
|
||||
if ( cost <= ( 1 << ( ps.lut_size - i ) ) && cost + additional_cost < best_cost )
|
||||
/* check for feasible solution that improves the cost */ /* TODO: remove limit on cost */
|
||||
if ( cost <= ( 1 << ( ps.lut_size - i ) ) && cost + additional_cost < best_cost && cost < 12 )
|
||||
{
|
||||
best_tt = tt_p;
|
||||
permutations = perm;
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ int acd_evaluate( word * pTruth, unsigned nVars, int lutSize, unsigned *pdelay,
|
|||
ac_decomposition_stats st;
|
||||
|
||||
ac_decomposition_impl acd( tt, nVars, ps, &st );
|
||||
acd.run( *pdelay );
|
||||
int val = acd.compute_decomposition();
|
||||
int val = acd.run( *pdelay );
|
||||
// int val = acd.compute_decomposition();
|
||||
|
||||
if ( val < 0 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
// #include "base/main/main.h"
|
||||
#include "misc/util/abc_global.h"
|
||||
#include "map/if/if.h"
|
||||
|
||||
// ABC_NAMESPACE_HEADER_START
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,43 @@ inline void operator|=( dynamic_truth_table& first, const dynamic_truth_table& s
|
|||
template<uint32_t NumVars>
|
||||
inline void operator|=( static_truth_table<NumVars>& first, const static_truth_table<NumVars>& second )
|
||||
{
|
||||
first = binary_or( first, second );
|
||||
// first = binary_or( first, second );
|
||||
/* runtime improved version */
|
||||
if constexpr ( NumVars <= 6 )
|
||||
{
|
||||
first._bits |= second._bits;
|
||||
first.mask_bits();
|
||||
}
|
||||
else if constexpr ( NumVars == 7 )
|
||||
{
|
||||
first._bits[0] |= second._bits[0];
|
||||
first._bits[1] |= second._bits[1];
|
||||
}
|
||||
else if constexpr ( NumVars == 8 )
|
||||
{
|
||||
first._bits[0] |= second._bits[0];
|
||||
first._bits[1] |= second._bits[1];
|
||||
first._bits[2] |= second._bits[2];
|
||||
first._bits[3] |= second._bits[3];
|
||||
}
|
||||
else if constexpr ( NumVars == 9 )
|
||||
{
|
||||
first._bits[0] |= second._bits[0];
|
||||
first._bits[1] |= second._bits[1];
|
||||
first._bits[2] |= second._bits[2];
|
||||
first._bits[3] |= second._bits[3];
|
||||
first._bits[4] |= second._bits[4];
|
||||
first._bits[5] |= second._bits[5];
|
||||
first._bits[6] |= second._bits[6];
|
||||
first._bits[7] |= second._bits[7];
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( uint32_t i = 0; i < first.num_blocks(); ++i )
|
||||
{
|
||||
first._bits[i] |= second._bits[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace kitty
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
#include "opt/dau/dau.h"
|
||||
#include "misc/vec/vecHash.h"
|
||||
#include "misc/vec/vecWec.h"
|
||||
#include "ACD/ac_wrapper.h"
|
||||
#include "acd/ac_wrapper.h"
|
||||
|
||||
ABC_NAMESPACE_HEADER_START
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue