Gate-based network to node-based network

Header: mockturtle/algorithms/gates_to_nodes.hpp

Algorithm

template<class NtkDest, class NtkSource>
NtkDest mockturtle::gates_to_nodes(NtkSource const &ntk)

Translates a gate-based network into a node-based network.

A node will be created in the node-based network for every gate based on the gate function. Possible complemented fanins are merged into the node function.

Required network functions for parameter ntk (type NtkSource):

  • foreach_pi

  • foreach_gate

  • foreach_fanin

  • get_constant

  • get_node

  • is_constant

  • is_pi

  • is_complemented

  • node_function

Required network functions for return value (type NtkDest):

  • create_pi

  • create_po

  • create_node

  • create_not

  • get_constant

Parameters:

ntk – Network

template<class NtkDest, class NtkSrc>
NtkDest mockturtle::single_node_network(NtkSrc const &src)

Creates a new network with a single node per output.

This method can be applied to networks with a small number of primary inputs, to collapse all the logic of an output into a single node. The returning network must support arbitrary node functions, e.g., klut_network.