AQFP Resynthesis

AQFP Resynthesis converts a given LUT network into an AQFP network and determines the gate-levels for the new network to optimize the additional buffers needed in path balancing.

Header: mockturtle/algorithms/aqfp/aqfp_resynthesis.hpp

template<class NtkDest, class NtkSrc, class NodeResynFn, class FanoutResynFn>
aqfp_resynthesis_result<NtkDest> mockturtle::aqfp_resynthesis(NtkDest &ntk_dest, NtkSrc const &ntk_src, NodeResynFn &&node_resyn_fn, FanoutResynFn &&fanout_resyn_fn, aqfp_resynthesis_params const &ps = {false}, aqfp_resynthesis_stats *pst = nullptr)

Re-synthesize a given source network as a path-balanced AQFP network.

The algorithm outputs an AQFP network with level assignments to its nodes and combinational outputs.

Example

aqfp_assumptions assume = { false, false, true, 4u };
aqfp_fanout_resyn fanout_resyn{ assume };

std::unordered_map<uint32_t, double> gate_costs = { { 3u, 6.0 }, { 5u, 10.0 } };
std::unordered_map<uint32_t, double> splitters = { { 1u, 2.0 }, { assume.splitter_capacity, 2.0 } };
aqfp_node_resyn_param ps{ assume, splitters, aqfp_node_resyn_strategy::delay };

aqfp_db<> db( gate_costs, splitters );
db.load_db( ... ); // from an input-stream (e.g., std::ifstream or std::stringstream)

aqfp_node_resyn node_resyn( db, ps );

klut_network src_ntk = ...;
aqfp_network dst_ntk;
auto res = aqfp_resynthesis( dst_ntk, src_ntk, node_resyn, fanout_resyn );

AQFP Node Resynthesis

AQFP Node Resynthesis resynthesizes a given LUT as a part of an AQFP network and determine the levels for the newly created gates.

Header: mockturtle/algorithms/aqfp/aqfp_node_resyn.hpp

struct aqfp_node_resyn

A callback to re-synthesize a node in an AQFP network.

A suitable AQFP sub-graph structure for a given node will be chosen from a database of AQFP structures.

Example

aqfp_assumptions assume = { false, false, true, 4u };
aqfp_fanout_resyn fanout_resyn{ assume };

std::unordered_map<uint32_t, double> gate_costs = { { 3u, 6.0 }, { 5u, 10.0 } };
std::unordered_map<uint32_t, double> splitters = { { 1u, 2.0 }, { assume.splitter_capacity, 2.0 } };
aqfp_node_resyn_param ps{ assume, splitters, aqfp_node_resyn_strategy::delay };

aqfp_db<> db( gate_costs, splitters );
db.load_db( ... ); // from an input-stream (e.g., std::ifstream or std::stringstream)

aqfp_node_resyn node_resyn( db, ps );

klut_network src_ntk = ...;
aqfp_network dst_ntk;
auto res = aqfp_resynthesis( dst_ntk, src_ntk, node_resyn, fanout_resyn );

Public Functions

inline aqfp_node_resyn(aqfp_db<> &db, const aqfp_node_resyn_param &ps)

Default constructor.

Parameters:
  • db – AQFP database.

  • ps – AQFP note re-synthesis parameters.

template<typename NtkDest, typename TruthTable, typename LeavesIterator, typename LevelUpdateCallback, typename ResynPerformedCallback>
inline void operator()(NtkDest &ntk_dest, const TruthTable &f, LeavesIterator leaves_begin, LeavesIterator leaves_end, LevelUpdateCallback &&level_update_callback, ResynPerformedCallback &&resyn_performed_callback)

Re-synthesize a given node as a sub-graph in an AQFP network.

Parameters:
  • ntk_dest – AQFP network that is being synthesized.

  • f – Function computed by the source node that is being re-synthesized.

  • leaves_begin – Iterator (begin) for the leaves of the source node.

  • leaves_end – Iterator (end) for the leaves of the source node.

  • level_update_callback – Callback with parameters (new node, level of the new node).

  • resyn_performed_callback – Callback with the signal that correspond to the source node and its level.

AQFP Fanout Resynthesis

After a LUT is resynthesized using AQFP Node Resynthesis, AQFP Fanout Resynthesis will be used to determine the starting levels of the fanins of subsequent LUTs.

Header: mockturtle/algorithms/aqfp/aqfp_fanout_resyn.hpp

struct aqfp_fanout_resyn

A callback to determine the fanout levels.

This is intended to be used with AQFP networks. Levels are determined assuming that a nearly-balanced splitter tree is used for each the considered fanout net.

Example

aqfp_assumptions assume = { false, false, true, 4u };
aqfp_fanout_resyn fanout_resyn{ assume };

std::unordered_map<uint32_t, double> gate_costs = { { 3u, 6.0 }, { 5u, 10.0 } };
std::unordered_map<uint32_t, double> splitters = { { 1u, 2.0 }, { assume.splitter_capacity, 2.0 } };
aqfp_node_resyn_param ps{ assume, splitters, aqfp_node_resyn_strategy::delay };

aqfp_db<> db( gate_costs, splitters );
db.load_db( ... ); // from an input-stream (e.g., std::ifstream or std::stringstream)

aqfp_node_resyn node_resyn( db, ps );

klut_network src_ntk = ...;
aqfp_network dst_ntk;
auto res = aqfp_resynthesis( dst_ntk, src_ntk, node_resyn, fanout_resyn );

Public Functions

inline aqfp_fanout_resyn(const aqfp_assumptions &assume)

Default constructor.

Parameters:

assume – AQFP synthesis assumptions (only the fields splitter_capacity and branch_pis will be used)

template<typename NtkSrc, typename FOutsSrc, typename NtkDest, typename FanoutNodeCallback, typename FanoutPoCallback>
inline void operator()(const NtkSrc &ntk_src, node<NtkSrc> n, FOutsSrc &fanouts_n, const NtkDest &ntk_dest, signal<NtkDest> f, uint32_t level_f, FanoutNodeCallback &&fanout_node_fn, FanoutPoCallback &&fanout_co_fn)

Determine the relative levels of fanouts of a node assuming a nearly balanced splitter tree.

Parameters:
  • ntk_src – Source network with depth() and level() member functions.

  • n – Node in ntk_src for which the fanout levels are to be determined.

  • fanouts_n – Fanout nodes of n in ntk_dest.

  • ntk_dest – Destination network which is being synthesized as an AQFP network.

  • f – The signal in ntk_dest that correspond to source node n.

  • level_f – The level of f in ntk_dest.

  • fanout_node_fn – Callback with arguments (source network node, level in destination network).

  • fanout_co_fn – Callback with arguments (index of the combinational output, level in destination network).