lsils / mockturtle

C++ logic network library
MIT License
210 stars 139 forks source link

mig_algebraic_depth_rewriting_splitters::run_selective is endless #548

Open Flians opened 2 years ago

Flians commented 2 years ago

When I run mig_algebraic_depth_rewriting_splitters for c5315.v with the parameter selective, I found that the run_selective is endless.

ps_alg_rewrite.strategy = mockturtle::mig_algebraic_depth_rewriting_params::selective;
mig_algebraic_depth_rewriting_splitters(mig, ps_alg_rewrite);

And while in mockturtle::buffer_insertion::optimize can be not finished:

    while ( true )
    {
      mark_critical_paths();

      topo_view topo{ntk};
      topo.foreach_node( [this, &counter]( auto n ) {
        if ( ntk.fanout_size( n ) == 0 || ntk.value( n ) == 0 )
          return;
        if ( reduce_depth( n ) )
        {
          mark_critical_paths();
        }
        else
        {
          ++counter;
        }
      } );

      if ( counter > ntk.size() )
        break;
    }

Can you help me solve it?

lee30sonia commented 2 years ago

Thanks for reporting. This part of the code is not well tested but is not planned to be worked on either in the near future. I would suggest to either

  1. use the other options (e.g. dfs as in the original experiment), or
  2. force a fixed upper bound on the number of loop iterations (e.g. by changing while(true) into for(auto i=0; i<10; ++i)) if you really want to use this option.