Network Conversion

Header: fiction/algorithms/network_transformation/network_conversion.hpp

template<typename NtkDest, typename NtkSrc>
NtkDest fiction::convert_network(const NtkSrc &ntk)

Converts a logic network into an equivalent one of another type. Thereby, this function is very similar to mockturtle::cleanup_dangling. However, it supports real buffer nodes used for fanouts and path balancing in fiction.

Note

In contrast to mockturtle::cleanup_dangling, this function returns ntk if NtkDest and NtkSrc are of the same type.

Template Parameters:
  • NtkDest – Type of the returned logic network.

  • NtkSrc – Type of the input logic network.

Parameters:

ntk – The input logic network.

Returns:

A logic network of type NtkDest that is logically equivalent to ntk.

Network Balancing

Header: fiction/algorithms/network_transformation/network_balancing.hpp

struct network_balancing_params

Parameters for the network balancing algorithm.

Public Members

bool unify_outputs = false

Flag to indicate that all output nodes should be in the same rank.

template<typename NtkDest, typename NtkSrc>
NtkDest fiction::network_balancing(const NtkSrc &ntk_src, network_balancing_params ps = {})

Balances a logic network with buffer nodes that compute the identity function. For this purpose, create_buf is utilized. Therefore, NtkDest should support identity nodes. If it does not, no new nodes will in fact be created. In either case, the returned network will be logically equivalent to the input one.

The process is rather naive and is not combined with fanout substitution.

The returned network is newly created from scratch because its type NtkDest may differ from NtkSrc.

Note

The physical design algorithms natively provided in fiction do not require their input networks to be balanced. If that is necessary, they will do it themselves. Providing already balanced networks may lead to substantial overhead.

Template Parameters:
  • NtkDest – Type of the returned logic network.

  • NtkSrc – Type of the input logic network.

Parameters:
  • ntk_src – The input logic network.

  • ps – Parameters.

Returns:

A path-balanced logic network of type NtkDest that is logically equivalent to ntk_src.

Fanout Substitution

Header: fiction/algorithms/network_transformation/fanout_substitution.hpp

struct fanout_substitution_params

Parameters for the fanout substitution algorithm.

Public Types

enum substitution_strategy

Breadth-first vs. depth-first fanout-tree substitution strategies.

Values:

enumerator BREADTH
enumerator DEPTH

Public Members

substitution_strategy strategy = BREADTH

Substitution strategy of high-degree fanout networks (depth-first vs. breadth-first).

uint32_t degree = 2ul

Maximum output degree of each fan-out node.

uint32_t threshold = 1ul

Maximum number of outputs any gate is allowed to have before substitution applies.

template<typename NtkDest, typename NtkSrc>
NtkDest fiction::fanout_substitution(const NtkSrc &ntk_src, fanout_substitution_params ps = {})

Substitutes high-output degrees in a logic network with fanout nodes that compute the identity function. For this purpose, create_buf is utilized. Therefore, NtkDest should support identity nodes. If it does not, no new nodes will in fact be created. In either case, the returned network will be logically equivalent to the input one.

The process is rather naive with two possible strategies to pick from: breath-first and depth-first. The former creates partially balanced fanout trees while the latter leads to fanout chains. Further parameterization includes thresholds for the maximum number of output each node and fanout is allowed to have.

The returned network is newly created from scratch because its type NtkDest may differ from NtkSrc.

Note

The physical design algorithms natively provided in fiction do not require their input networks to be fanout-substituted. If that is necessary, they will do it themselves. Providing already substituted networks does however allow for the control over maximum output degrees.

Template Parameters:
  • NtkDest – Type of the returned logic network.

  • NtkSrc – Type of the input logic network.

Parameters:
  • ntk_src – The input logic network.

  • ps – Parameters.

Returns:

A fanout-substituted logic network of type NtkDest that is logically equivalent to ntk_src.