Collapse mapped network

Header: mockturtle/algorithms/collapse_mapped.hpp

The following example shows how to collapse a mapped network into a \(k\)-LUT network:

aig_network aig = ...;
mapping_view<aig_network, true> mapped_aig{aig};
lut_mapping<<aig_network, true>, true>( mapped_aig );
const auto klut = collapse_mapped_network<klut_network>( mapped_aig );
write_bench( klut, "/tmp/test.bench" );
template<class NtkDest, class NtkSource>
bool mockturtle::collapse_mapped_network(NtkDest &dest, NtkSource const &ntk)

Collapse mapped network into k-LUT network.

Collapses a mapped network into a k-LUT network. In the mapped network each cell is represented in terms of a collection of nodes from the subject graph. This method creates a new network in which each cell is represented by a single node.

This function performs some optimizations with respect to possible output complementations in the subject graph:

  • If an output driver is only used in positive form, nothing changes

  • If an output driver is only used in complemented form, the cell function of the node is negated.

  • If an output driver is used in both forms, two nodes will be created for the mapped node.

Required network functions for parameter ntk (type NtkSource):

  • has_mapping

  • get_constant

  • get_node

  • foreach_pi

  • foreach_po

  • foreach_node

  • foreach_cell_fanin

  • is_constant

  • is_pi

  • is_cell_root

  • cell_function

  • is_complemented

Required network functions for return value (type NtkDest):

  • get_constant

  • create_pi

  • create_node

  • create_not

template<class NtkDest, class NtkSource>
std::optional<NtkDest> mockturtle::collapse_mapped_network(NtkSource const &ntk)

Collapse mapped network into k-LUT network.

Collapses a mapped network into a k-LUT network. In the mapped network each cell is represented in terms of a collection of nodes from the subject graph. This method creates a new network in which each cell is represented by a single node.

This function performs some optimizations with respect to possible output complementations in the subject graph:

  • If an output driver is only used in positive form, nothing changes

  • If an output driver is only used in complemented form, the cell function of the node is negated.

  • If an output driver is used in both forms, two nodes will be created for the mapped node.

Required network functions for parameter ntk (type NtkSource):

  • has_mapping

  • get_constant

  • get_node

  • foreach_pi

  • foreach_po

  • foreach_node

  • foreach_cell_fanin

  • is_constant

  • is_pi

  • is_cell_root

  • cell_function

  • is_complemented

Required network functions for return value (type NtkDest):

  • get_constant

  • create_pi

  • create_node

  • create_not