Skip to content

Commit

Permalink
Update libraries and make code more generic (#136)
Browse files Browse the repository at this point in the history
* Update percy.

* Update fmt library.

* More generic exact_aig_resynthesis.

* More generic exact_resynthesis.

* Update kitty.

* Update kitty.
  • Loading branch information
msoeken authored Mar 31, 2019
1 parent a259f7d commit bb3d93d
Show file tree
Hide file tree
Showing 60 changed files with 8,242 additions and 4,850 deletions.
32 changes: 17 additions & 15 deletions include/mockturtle/algorithms/node_resynthesis/exact.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct exact_resynthesis_params
const klut_network klut = ...;
exact_resynthesis resyn( 3 );
exact_resynthesis<klut_network> resyn( 3 );
cut_rewriting( klut, resyn );
klut = cleanup_dangling( klut );
\endverbatim
Expand All @@ -108,7 +108,7 @@ struct exact_resynthesis_params
exact_resynthesis_params ps;
ps.cache = std::make_shared<exact_resynthesis_params::cache_map_t>();
exact_resynthesis resyn( 3, ps );
exact_resynthesis<klut_network> resyn( 3, ps );
cut_rewriting( klut, resyn );
klut = cleanup_dangling( klut );
Expand All @@ -118,6 +118,7 @@ struct exact_resynthesis_params
\endverbatim
*
*/
template<class Ntk = klut_network>
class exact_resynthesis
{
public:
Expand All @@ -128,17 +129,17 @@ class exact_resynthesis
}

template<typename LeavesIterator, typename Fn>
void operator()( klut_network& ntk, kitty::dynamic_truth_table const& function, LeavesIterator begin, LeavesIterator end, Fn&& fn )
void operator()( Ntk& ntk, kitty::dynamic_truth_table const& function, LeavesIterator begin, LeavesIterator end, Fn&& fn )
{
operator()( ntk, function, function.construct(), begin, end, fn );
}

template<typename LeavesIterator, typename Fn>
void operator()( klut_network& ntk, kitty::dynamic_truth_table const& function, kitty::dynamic_truth_table const& dont_cares, LeavesIterator begin, LeavesIterator end, Fn&& fn )
void operator()( Ntk& ntk, kitty::dynamic_truth_table const& function, kitty::dynamic_truth_table const& dont_cares, LeavesIterator begin, LeavesIterator end, Fn&& fn )
{
if ( static_cast<uint32_t>( function.num_vars() ) <= _fanin_size )
{
fn( ntk.create_node( std::vector<klut_network::signal>( begin, end ), function ) );
fn( ntk.create_node( std::vector<signal<Ntk>>( begin, end ), function ) );
return;
}

Expand Down Expand Up @@ -192,11 +193,11 @@ class exact_resynthesis
return;
}

std::vector<klut_network::signal> signals( begin, end );
std::vector<signal<Ntk>> signals( begin, end );

for ( auto i = 0; i < c->get_nr_steps(); ++i )
{
std::vector<klut_network::signal> fanin;
std::vector<signal<Ntk>> fanin;
for ( const auto& child : c->get_step( i ) )
{
fanin.emplace_back( signals[child] );
Expand Down Expand Up @@ -226,7 +227,7 @@ class exact_resynthesis
const aig_network aig = ...;
exact_aig_resynthesis resyn;
exact_aig_resynthesis<aig_network> resyn;
cut_rewriting( aig, resyn );
aig = cleanup_dangling( aig );
\endverbatim
Expand All @@ -242,20 +243,21 @@ class exact_resynthesis
.. code-block:: c++
const klut_network klut = ...;
const aig_network aig = ...;
exact_aig_resynthesis_params ps;
ps.cache = std::make_shared<exact_aig_resynthesis_params::cache_map_t>();
exact_aig_resynthesis resyn( ps );
cut_rewriting( klut, resyn );
klut = cleanup_dangling( klut );
exact_aig_resynthesis<aig_network> resyn( ps );
cut_rewriting( aig, resyn );
aig = cleanup_dangling( aig );
The underlying engine for this resynthesis function is percy_.
.. _percy: https://github.com/whaaswijk/percy
\endverbatim
*
*/
template<class Ntk = aig_network>
class exact_aig_resynthesis
{
public:
Expand All @@ -265,13 +267,13 @@ class exact_aig_resynthesis
}

template<typename LeavesIterator, typename Fn>
void operator()( aig_network& ntk, kitty::dynamic_truth_table const& function, LeavesIterator begin, LeavesIterator end, Fn&& fn )
void operator()( Ntk& ntk, kitty::dynamic_truth_table const& function, LeavesIterator begin, LeavesIterator end, Fn&& fn )
{
operator()( ntk, function, function.construct(), begin, end, fn );
}

template<typename LeavesIterator, typename Fn>
void operator()( aig_network& ntk, kitty::dynamic_truth_table const& function, kitty::dynamic_truth_table const& dont_cares, LeavesIterator begin, LeavesIterator end, Fn&& fn )
void operator()( Ntk& ntk, kitty::dynamic_truth_table const& function, kitty::dynamic_truth_table const& dont_cares, LeavesIterator begin, LeavesIterator end, Fn&& fn )
{
// TODO: special case for small functions (up to 2 variables)?

Expand Down Expand Up @@ -325,7 +327,7 @@ class exact_aig_resynthesis
return;
}

std::vector<aig_network::signal> signals( begin, end );
std::vector<signal<Ntk>> signals( begin, end );

for ( auto i = 0; i < c->get_nr_steps(); ++i )
{
Expand Down
94 changes: 0 additions & 94 deletions lib/fmt/fmt/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit bb3d93d

Please sign in to comment.