Code Monkey home page Code Monkey logo

Comments (3)

msoeken avatar msoeken commented on August 24, 2024

Hello,

Thanks for the question. The cell_window view is doing something different than you expect. Starting from some pivot node, which is a cell root, it creates a window around that node (bounded in size by some parameters) such that the window is covered itself by cells. So it does not cut through any cells. The motivation behind this is that you could throw away the current mapping of the window, remap it, and then insert it back into the original network without making the overall mapping inconsistent.

If you like to have a network structure around the cell then you can use cut_view instead.

I hope that this clarifies the problem.

from mockturtle.

marcelwa avatar marcelwa commented on August 24, 2024

Thanks for the quick response and the helpful comment! The cut_view does exactly what I want. Here is an updated version of the code above, just in case someone has the same question and comes across this issue:

template<class Ntk>
void print_cell_io( Ntk const& ntk ) // ntk is a mapped network
{
  ntk.foreach_node( [&]( auto const n ) {
    if ( ntk.is_constant( n ) || ntk.is_pi( n ) || !ntk.is_cell_root( n ) )
      return;

    std::vector<typename Ntk::node> leaves;
    ntk.foreach_cell_fanin( n, [&]( auto const f ) {
      leaves.push_back( f );
    } );

    std::cout << "cell has " << leaves.size() << " fanins\n";

    auto cut = mockturtle::cut_view( ntk, leaves, n );
    std::cout << "cut_view i/o = " << cut.num_pis() << "/" << cut.num_pos() << "\n";
  } );
}

Best regards!

from mockturtle.

msoeken avatar msoeken commented on August 24, 2024

Thanks for providing the updated example!

from mockturtle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.