Utility functions¶
Manipulate windows with network data types¶
Header: mockturtle/utils/network_utils.hpp
-
template<typename Ntk, typename SubNtk>
void mockturtle::clone_subnetwork(Ntk const &ntk, std::vector<typename Ntk::node> const &inputs, std::vector<typename Ntk::signal> const &outputs, std::vector<typename Ntk::node> const &gates, SubNtk &subntk)¶ Constructs a (sub-)network from a window of another network.
The window is specified by three parameters: 1.)
inputsare the common support of all window nodes, they do not overlap withgates(i.e., the intersection ofinputsandgatesis the empty set). 2.)gatesare the nodes in the window, supported by theinputs(i.e.,gatesare in the transitive fanout of theinputs). 3.)outputsare signals (regular or complemented nodes) pointing to nodes ingatesorinputs. Not all fanouts of an output node are already part of the window.Required network functions for the source Ntk:
foreach_faninget_nodeget_constantis_complemented
Required network functions for the cloned SubNtk:
create_picreate_pocreate_notget_constant
- Parameters
ntk – A logic network
subntk – An empty network to be constructed
-
template<typename Ntk, typename SubNtk, typename BeginIter, typename EndIter, typename Fn>
void mockturtle::insert_ntk(Ntk &ntk, BeginIter begin, EndIter end, SubNtk const &subntk, Fn &&fn)¶ Inserts a network into another network.
Required network functions for the host Ntk:
get_constantcreate_not
Required network functions for the subnetwork SubNtk:
num_pisforeach_piforeach_poforeach_gateforeach_faninget_nodeis_complemented
- Parameters
ntk – The host logic network
begin – Begin iterator of signal inputs in the host network
end – End iterator of signal inputs in the host network
subntk – The sub-network
fn – Callback function