Transformations based on equivalence classes
Header: mockturtle/algorithms/equivalence_classes.hpp
Algorithms
-
template<class Ntk, class SynthesisFn>
signal<Ntk> mockturtle::apply_spectral_transformations(Ntk &dest, std::vector<kitty::detail::spectral_operation> const &transformations, std::vector<signal<Ntk>> const &leaves, SynthesisFn &&synthesis_fn) Applies a sequence of transformations to a network.
A synthesis function
synthesis_fncomputes a network intodestand computes an output signal. Both the inputs and the outputs to that synthesis function are transformed according totransformations, a sequence of spectral transformations. The vectorleavesare the original inputs to the output function, which is returned in terms of a signal into the network.The signature of
synthesis_fnissignal<Ntk>(Ntk&, std::vector<signal<Ntk>> const&).Note
An example on how to transform the AND function into the MAJ function is provided as test.
- Parameters:
dest – Destination network for synthesis
transformations – Sequence of spectral operations (see kitty)
leaves – Original inputs, which might be transformed
synthesis_fn – Synthesis function to create the inner function (without transformations)
-
template<class Ntk, class SynthesisFn>
signal<Ntk> mockturtle::apply_npn_transformations(Ntk &dest, uint32_t phase, std::vector<uint8_t> const &perm, std::vector<signal<Ntk>> const &leaves, SynthesisFn &&synthesis_fn) Applies NPN transformations to a network.
A synthesis function
synthesis_fncomputes a network intodestand computes an output signal. Both the inputs and the outputs to that synthesis function are transformed according tophaseandperm, based on NPN classification. The vectorleavesare the original inputs to the output function, which is returned in terms of a signal into the network.The signature of
synthesis_fnissignal<Ntk>(Ntk&, std::vector<signal<Ntk>> const&).- Parameters:
dest – Destination network for synthesis
phase – Input and output complementation
perm – Input permutation
leaves – Original inputs, which might be transformed
synthesis_fn – Synthesis function to create the inner function (without transformations)