Properties

MIG-based costs

In header mockturtle/properties/migcost.hpp functions are defined that can be used to compute costs relevant in majority-based emerging technologies.

template<class Ntk>
uint32_t mockturtle::num_inverters(Ntk const &ntk)

Counts number of inverters.

This number counts all nodes that need to be inverted. Multiple signals with complements to the same node are counted once.

Parameters:

ntk – Network

template<class Ntk>
uint32_t mockturtle::num_dangling_inputs(Ntk const &ntk)

Counts fanins which are primary inputs.

Parameters:

ntk – Network

Multiplicative complexity costs

In header mockturtle/properties/mccost.hpp functions are defined that can be used to compute costs based on the multiplicative complexity of the network.

template<class Ntk>
std::optional<uint32_t> mockturtle::multiplicative_complexity(Ntk const &ntk)

Computes the multiplicative complexity.

Computes and sums the multiplicative complexity of each gate in the network. Returns std::nullopt, if multiplicative complexity cannot be determined for some gate.

Parameters:

ntk – Network

template<class Ntk>
std::optional<uint32_t> mockturtle::multiplicative_complexity_depth(Ntk const &ntk)

Computes the multiplicative complexity depth.

Computes multiplicative complexity of each gate and the sum of them on the critical path in the network. Returns std::nullopt, if multiplicative complexity cannot be determined for some gate.

Parameters:

ntk – Network

Factored form literals costs

In header mockturtle/properties/litcost.hpp functions are defined that can be used to compute costs based on the factored form literal count of Boolean functions.

uint32_t mockturtle::factored_literal_cost(std::vector<kitty::cube> const &sop, uint32_t num_vars)

Counts number of literals of the factored form of a SOP.

This method computes the factored form of the SOP and returns its number of factored form literals.

Parameters:
  • sop – Sum-of-products

  • num_vars – Number of variables

uint32_t mockturtle::factored_literal_cost(kitty::dynamic_truth_table const &tt, bool try_both_polarities = false)

Counts number of literals of the factored form of a SOP.

This method computes the factored form of a completely specified function given as a truth table and returns its number of factored form literals.

Parameters:
  • tt – function as truth table

  • try_both_polarities – factoring is also tried for the negated TT

uint32_t mockturtle::factored_literal_cost(kitty::dynamic_truth_table const &tt, kitty::dynamic_truth_table const &dc, bool try_both_polarities = false)

Counts number of literals of the factored form of a SOP.

This method computes the factored form of an incompletely specified function given as a truth table and its don’t care set and returns its number of factored form literals.

Parameters:
  • tt – function as truth table

  • dc – don’t care set

  • try_both_polarities – factoring is also tried for the negated TT