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

Breadth-first substitution. Creates balanced fanout trees.

enumerator DEPTH

Depth-first substitution. Creates fanout trees with one deep branch.

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.

Technology Mapping

Header: fiction/algorithms/network_transformation/technology_mapping.hpp

struct technology_mapping_params

Public Members

mockturtle::map_params mapper_params = {}

mockturtle’s mapper parameters.

bool decay = {false}

Enforce the application of at least one constant input to three-input gates.

bool and2 = {false}

2-input AND gate.

bool nand2 = {false}

2-input NAND gate.

bool or2 = {false}

2-input OR gate.

bool nor2 = {false}

2-input NOR gate.

bool xor2 = {false}

2-input XOR gate.

bool xnor2 = {false}

2-input XNOR gate.

bool and3 = {false}

3-input AND gate.

bool xor_and = {false}

3-input XOR-AND gate.

bool or_and = {false}

3-input OR-AND gate.

bool onehot = {false}

3-input ONEHOT gate.

bool maj3 = {false}

3-input MAJ gate.

bool gamble = {false}

3-input GAMBLE gate.

bool dot = {false}

3-input DOT gate.

bool mux = {false}

3-input MUX gate.

bool and_xor = {false}

3-input AND-XOR gate.

inline technology_mapping_params fiction::and_or_not() noexcept

Auxiliary function to create technology mapping parameters for AND, OR, and NOT gates.

Returns:

Technology mapping parameters.

inline technology_mapping_params fiction::and_or_not_maj() noexcept

Auxiliary function to create technology mapping parameters for AND, OR, NOT, and MAJ gates.

Returns:

Technology mapping parameters.

inline technology_mapping_params fiction::all_standard_2_input_functions() noexcept

Auxiliary function to create technology mapping parameters for AND, OR, NAND, NOR, XOR, XNOR, and NOT gates.

Returns:

Technology mapping parameters.

inline technology_mapping_params fiction::all_standard_3_input_functions() noexcept

Auxiliary function to create technology mapping parameters for AND3, XOR_AND, OR_AND, ONEHOT, MAJ3, GAMBLE, DOT, MUX, and AND_XOR gates.

Returns:

Technology mapping parameters.

inline technology_mapping_params fiction::all_supported_standard_functions() noexcept

Auxiliary function to create technology mapping parameters for all supported standard functions.

Returns:

Technology mapping parameters.

struct technology_mapping_stats

Statistics for technology mapping.

Public Functions

inline void report() const

Report statistics.

Public Members

mockturtle::map_stats mapper_stats = {}

Statistics for mockturtle’s mapper.

template<typename Ntk>
tec_nt fiction::technology_mapping(const Ntk &ntk, const technology_mapping_params &params = {}, technology_mapping_stats *pst = nullptr)

Performs technology mapping on the given network. Technology mapping is the process of replacing the gates in a network with gates from a given technology library. This function utilizes mockturtle::map to perform the technology mapping. This function is a wrapper around that interface to provide a more convenient usage.

Template Parameters:

Ntk – Input logic network type.

Parameters:
  • ntk – Input logic network.

  • params – Technology mapping parameters.

  • pst – Technology mapping statistics.

Returns:

Mapped network exclusively using gates from the provided library.