Skip to content

Commit

Permalink
Port to kitty.
Browse files Browse the repository at this point in the history
  • Loading branch information
msoeken committed Dec 13, 2017
1 parent 548e36a commit ced8497
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Expand Up @@ -66,7 +66,7 @@ class stg_map_luts_impl
/* if very small fall back to precomputed database */
if ( num_inputs <= params.max_cut_size )
{
auto tt = function.truth_table( 0 ).to_ulong();
auto tt = *function.truth_table( 0 ).begin(); /* function has only a single word, take its value */
stg_map_precomp( circ, tt, num_inputs, line_map, *params.map_precomp_params, *stats.map_precomp_stats );
return;
}
Expand Down
11 changes: 3 additions & 8 deletions src/classical/abc/gia/gia.cpp
Expand Up @@ -331,18 +331,13 @@ uint64_t gia_graph::lut_truth_table( int index ) const
return t & abc::Abc_Tt6Mask( 1 << lut_size( index ) );
}

tt gia_graph::truth_table( int output_index ) const
kitty::dynamic_truth_table gia_graph::truth_table( int output_index ) const
{
const auto num_words = abc::Abc_Truth6WordNum( num_inputs() );
const auto * words = abc::Gia_ObjComputeTruthTable( p_gia.get(), abc::Gia_ManCo( p_gia.get(), output_index ) );

tt func( words, words + num_words );

if ( num_inputs() < 6 )
{
tt_shrink( func, num_inputs() );
}

kitty::dynamic_truth_table func( num_inputs() );
kitty::create_from_words( func, words, words + num_words );
return func;
}

Expand Down
5 changes: 3 additions & 2 deletions src/classical/abc/gia/gia.hpp
Expand Up @@ -42,7 +42,8 @@

#include <core/properties.hpp>
#include <classical/aig.hpp>
#include <classical/utils/truth_table_utils.hpp>

#include <kitty/kitty.hpp>

#include <base/main/main.h>
#include <aig/gia/gia.h>
Expand Down Expand Up @@ -119,7 +120,7 @@ class gia_graph
void init_truth_tables() const;
uint64_t lut_truth_table( int index ) const;

tt truth_table( int output_index ) const;
kitty::dynamic_truth_table truth_table( int output_index ) const;

/// PRINTING

Expand Down

0 comments on commit ced8497

Please sign in to comment.