Technology Network¶
A mockturtle logic network type that extends mockturtle::klut_network. It reimplements all node creation functions
to disable structural hashing. Furthermore, create_buf is overwritten such that it creates real buffer nodes that count
towards the size of the network and compute the identity function. In the same way, a buffer with more than one fanout
node is considered a fanout node (or splitter in some contexts) that copies an incoming signal to two or more data paths.
Network Types¶
Header: fiction/networks/technology_network.hpp
-
class technology_network : public mockturtle::klut_network¶
A
mockturtlelogic network type that extendsklut_network. It reimplements all node creation functions to disable structural hashing. Furthermore,create_bufis overwritten such that it creates real buffer nodes that count towards the size of the network and compute the identity function. In the same way, a buffer with more than one fanout node is considered a fanout node (or splitter in some contexts) that copies an incoming signal to two or more data paths.This network is used internally for most implemented FCN physical design algorithms and extends
klut_networkby some further convenience functions but is still fully compatible with the mockturtle network API. The function convert_network can be used to convert any other mockturtle network to this type.Most functions in this class are borrowed and reimplemented directly from
klut_networkand are, therefore, only sporadically documented where their behavior might differ. For information considermockturtle/networks/klut.hpp.Public Functions
-
inline technology_network()¶
Constructs a network sharing the supplied LUT storage.
-
inline technology_network clone() const¶
Returns a network with independent storage.
-
inline bool is_ci(const node &n) const noexcept¶
Checks whether a node is a combinational input in constant time.
A node is an input iff it is not a constant and has no fanins, because every gate has at least one fanin and
create_nodemaps functions without fanins to constants.klut_network::is_ciscans all inputs instead.- Parameters:
n – Node to consider.
- Returns:
trueiffnis a combinational input.
-
inline bool is_pi(const node &n) const noexcept¶
Checks whether a node is a primary input in constant time.
Equals
is_ci, because this network has no further kinds of combinational inputs.- Parameters:
n – Node to consider.
- Returns:
trueiffnis a primary input.
-
template<typename Fn>
inline void foreach_gate(Fn &&fn) const¶ Applies a function to every gate in constant time per node.
klut_network::foreach_gatetests every node withklut_network::is_ci, which scans all inputs.- Template Parameters:
Fn – Functor type.
- Parameters:
fn – Function to apply to each gate.
-
template<typename Fn>
inline void foreach_fanin(const node &n, Fn &&fn) const¶ Applies a function to every fanin of a node in constant time per node.
Constants and inputs have no fanins.
klut_network::foreach_fanintells inputs from gates withklut_network::is_ci, which scans all inputs.- Template Parameters:
Fn – Functor type.
- Parameters:
n – Node whose fanins to visit.
fn – Function to apply to each fanin.
-
inline bool is_po(const node &n) const¶
Checks whether a node is primary output by considering the signal pointing to it. This is possible because this network does not use complemented signals.
- Parameters:
n – Node to consider.
- Returns:
trueiffn’s signal is primary output.
-
inline signal create_buf(const signal &a)¶
Creates a buffer node in the network that computes the identity function and counts towards the network size and depth. A buffer node with more than one output is called a fanout.
- Parameters:
a – Incoming signal to the newly created buffer node.
- Returns:
Outgoing signal of the newly created buffer node.
-
inline signal create_not(const signal &a)¶
Creates a NOT gate with the supplied signal.
-
inline signal create_and(signal a, signal b)¶
Creates an AND gate with the supplied signals.
-
inline signal create_nand(signal a, signal b)¶
Creates a NAND gate with the supplied signals.
-
inline signal create_or(signal a, signal b)¶
Creates an OR gate with the supplied signals.
-
inline signal create_nor(signal a, signal b)¶
Creates a NOR gate with the supplied signals.
-
inline signal create_lt(signal a, signal b)¶
Creates an LT gate with the function
a & !b.
-
inline signal create_ge(signal a, signal b)¶
Creates a GE gate with the function
!a | b.
-
inline signal create_gt(signal a, signal b)¶
Creates a GT gate with the function
!a & b.
-
inline signal create_le(signal a, signal b)¶
Creates an LE gate with the function
a | !b.
-
inline signal create_xor(signal a, signal b)¶
Creates an XOR gate with the supplied signals.
-
inline signal create_xnor(signal a, signal b)¶
Creates an XNOR gate with the supplied signals.
-
inline signal create_maj(signal a, signal b, signal c)¶
Creates a MAJ gate with the supplied signals.
-
inline signal create_ite(signal a, signal b, signal c)¶
Creates an ITE gate with the supplied signals.
-
inline signal create_xor3(signal a, signal b, signal c)¶
Creates an XOR3 gate with the supplied signals.
-
inline signal create_dot(signal a, signal b, signal c)¶
Creates a DOT gate with the supplied signals.
-
inline signal create_nary_and(const std::vector<signal> &fs)¶
Reduces the supplied signals through a tree of binary AND gates.
An empty input returns constant
true; a single input returns that signal.
-
inline signal create_nary_or(const std::vector<signal> &fs)¶
Reduces the supplied signals through a tree of binary OR gates.
An empty input returns constant
false; a single input returns that signal.
-
inline signal create_nary_xor(const std::vector<signal> &fs)¶
Reduces the supplied signals through a tree of binary XOR gates.
An empty input returns constant
false; a single input returns that signal.
-
inline signal _create_node(const std::vector<signal> &children, uint32_t literal)¶
Disable structural hashing.
-
inline signal create_node(const std::vector<signal> &children, const kitty::dynamic_truth_table &function)¶
Disable structural hashing.
-
inline signal clone_node(const klut_network &other, const node &source, const std::vector<signal> &children)¶
Copies a node function with the supplied children.
-
inline bool is_buf(const node &n) const noexcept¶
Returns whether the given node
nis a buffer node, i.e., whetherncomputes the identity function and is not a PI. This also returnstrueon fanout nodes.- Parameters:
n – Node to consider.
- Returns:
trueiffnis a buffer node.
-
inline bool is_fanout(const node &n) const noexcept¶
Returns whether the given node
nis a fanout node, i.e., whethernis a buffer node and has more than one output signal.- Parameters:
n – Node to consider.
- Returns:
trueiffnis a fanout node.
-
inline bool is_inv(const node &n) const noexcept¶
Returns whether the given node
nis an inverter node.- Parameters:
n – Node to consider.
- Returns:
trueiffnis an inverter node.
-
inline bool is_and(const node &n) const noexcept¶
Returns whether the node implements the AND function.
-
inline bool is_nand(const node &n) const noexcept¶
Returns whether the node implements the NAND function.
-
inline bool is_or(const node &n) const noexcept¶
Returns whether the node implements the OR function.
-
inline bool is_nor(const node &n) const noexcept¶
Returns whether the node implements the NOR function.
-
inline bool is_lt(const node &n) const noexcept¶
Returns whether the node implements the LT function.
-
inline bool is_ge(const node &n) const noexcept¶
Returns whether the node implements the GE function.
-
inline bool is_gt(const node &n) const noexcept¶
Returns whether the node implements the GT function.
-
inline bool is_le(const node &n) const noexcept¶
Returns whether the node implements the LE function.
-
inline bool is_xor(const node &n) const noexcept¶
Returns whether the node implements the XOR function.
-
inline bool is_xnor(const node &n) const noexcept¶
Returns whether the node implements the XNOR function.
-
inline bool is_maj(const node &n) const noexcept¶
Returns whether the node implements the MAJ function.
-
inline bool is_ite(const node &n) const noexcept¶
Returns whether the node implements the ITE function.
-
inline bool is_xor3(const node &n) const noexcept¶
Returns whether the node implements the XOR3 function.
-
inline bool is_dot(const node &n) const noexcept¶
Returns whether the node implements the DOT function.
-
inline bool is_and3(const node &n) const noexcept¶
Returns whether the node implements the AND3 function.
-
inline bool is_xor_and(const node &n) const noexcept¶
Returns whether the node implements the XOR AND function.
-
inline bool is_or_and(const node &n) const noexcept¶
Returns whether the node implements the OR AND function.
-
inline bool is_onehot(const node &n) const noexcept¶
Returns whether the node implements the ONEHOT function.
-
inline bool is_gamble(const node &n) const noexcept¶
Returns whether the node implements the GAMBLE function.
-
inline bool is_and_xor(const node &n) const noexcept¶
Returns whether the node implements the AND XOR function.
-
inline void substitute_po_signals() noexcept¶
Adds additional buffer nodes for each primary output that does not already point to a buffer.
-
inline technology_network()¶
- class aig_network¶
An AND-inverter graph (AIG) with node and output names.
- class xag_network¶
An XOR-AND-inverter graph (XAG) with node and output names.
- class mig_network¶
A majority-inverter graph (MIG) with node and output names.
- class technology_network¶
A
mockturtlelogic network type that extendsklut_network. It reimplements all node creation functions to disable structural hashing. Furthermore,create_bufis overwritten such that it creates real buffer nodes that count towards the size of the network and compute the identity function. In the same way, a buffer with more than one fanout node is considered a fanout node (or splitter in some contexts) that copies an incoming signal to two or more data paths.This network is used internally for most implemented FCN physical design algorithms and extends
klut_networkby some further convenience functions but is still fully compatible with the mockturtle network API. The function convert_network can be used to convert any other mockturtle network to this type.Most functions in this class are borrowed and reimplemented directly from
klut_networkand are, therefore, only sporadically documented where their behavior might differ. For information considermockturtle/networks/klut.hpp.- is_buf(n: int) bool¶
Returns whether the given node
nis a buffer node, i.e., whetherncomputes the identity function and is not a PI. This also returnstrueon fanout nodes.- Parameters:
n – Node to consider.
- Returns:
trueiffnis a buffer node.
- is_fanout(n: int) bool¶
Returns whether the given node
nis a fanout node, i.e., whethernis a buffer node and has more than one output signal.- Parameters:
n – Node to consider.
- Returns:
trueiffnis a fanout node.