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
If
NtkDest
andNtkSrc
are of the same type, this function returnsntk
cleaned usingmockturtle::cleanup_dangling
.- 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 tontk
.
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.
-
bool unify_outputs = false
-
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 fromNtkSrc
.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 tontk_src
.
- class mnt.pyfiction.network_balancing_params
Parameters for the network balancing algorithm.
- property unify_outputs
Flag to indicate that all output nodes should be in the same rank.
- mnt.pyfiction.network_balancing(network: mnt.pyfiction.pyfiction.technology_network, params: mnt.pyfiction.pyfiction.network_balancing_params = <mnt.pyfiction.pyfiction.network_balancing_params object at 0x7b94bc783570>) mnt.pyfiction.pyfiction.technology_network
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 parameter
NtkDest
: Type of the returned logic network.
- Template parameter
NtkSrc
: Type of the input logic network.
- Parameter
ntk_src
: The input logic network.
- Parameter
ps
: Parameters.
- Returns:
A path-balanced logic network of type NtkDest that is logically equivalent to ntk_src.
- Template parameter
- mnt.pyfiction.is_balanced(network: mnt.pyfiction.pyfiction.technology_network, params: mnt.pyfiction.pyfiction.network_balancing_params = <mnt.pyfiction.pyfiction.network_balancing_params object at 0x7b94bc713730>) bool
Checks if a logic network is properly path-balanced with regard to the provided parameters.
- Template parameter
Ntk
: Logic network type.
- Parameter
ntk
: The logic network to check.
- Parameter
ps
: Parameters.
- Returns:
true iff ntk is properly path-balanced with regard to ps.
- Template parameter
Fanout Substitution
Header: fiction/algorithms/network_transformation/fanout_substitution.hpp
-
struct fanout_substitution_params
Parameters for the fanout substitution algorithm.
Public Types
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.
-
substitution_strategy strategy = BREADTH
-
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 fromNtkSrc
.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 tontk_src
.
- class mnt.pyfiction.fanout_substitution_params
Parameters for the fanout substitution algorithm.
- property degree
Maximum output degree of each fan-out node.
- property strategy
Substitution strategy of high-degree fanout networks (depth-first vs. breadth-first).
- property threshold
Maximum number of outputs any gate is allowed to have before substitution applies.
- class mnt.pyfiction.substitution_strategy
Breadth-first vs. depth-first fanout-tree substitution strategies.
Members:
BREADTH : Breadth-first substitution. Creates balanced fanout trees.
DEPTH : Depth-first substitution. Creates fanout trees with one deep branch.
- property name
- mnt.pyfiction.fanout_substitution(network: mnt.pyfiction.pyfiction.technology_network, params: mnt.pyfiction.pyfiction.fanout_substitution_params = <mnt.pyfiction.pyfiction.fanout_substitution_params object at 0x7b94bc782a70>) mnt.pyfiction.pyfiction.technology_network
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 parameter
NtkDest
: Type of the returned logic network.
- Template parameter
NtkSrc
: Type of the input logic network.
- Parameter
ntk_src
: The input logic network.
- Parameter
ps
: Parameters.
- Returns:
A fanout-substituted logic network of type NtkDest that is logically equivalent to ntk_src.
- Template parameter
- mnt.pyfiction.is_fanout_substituted(network: mnt.pyfiction.pyfiction.technology_network, params: mnt.pyfiction.pyfiction.fanout_substitution_params = <mnt.pyfiction.pyfiction.fanout_substitution_params object at 0x7b94bc901130>) bool
Checks if a logic network is properly fanout-substituted with regard to the provided parameters, i.e., if no node exceeds the specified fanout limits.
- Template parameter
Ntk
: Logic network type.
- Parameter
ntk
: The logic network to check.
- Parameter
ps
: Parameters.
- Returns:
true iff ntk is properly fanout-substituted with regard to ps.
- Template parameter
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 lt2 = {false}
2-input less-than gate.
-
bool gt2 = {false}
2-input greater-than gate.
-
bool le2 = {false}
2-input less-or-equal gate.
-
bool ge2 = {false}
2-input greater-or-equal 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.
-
mockturtle::map_params mapper_params = {}
-
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.
-
inline void report() const
-
template<typename Ntk>
tec_nt fiction::technology_mapping(const Ntk &ntk, const technology_mapping_params ¶ms = {}, 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.
- class mnt.pyfiction.technology_mapping_params
- property and2
2-input AND gate.
- property and3
3-input AND gate.
- property and_xor
3-input AND-XOR gate.
- property decay
Enforce the application of at least one constant input to three-input gates.
- property dot
3-input DOT gate.
- property gamble
3-input GAMBLE gate.
- property maj3
3-input MAJ gate.
- property mux
3-input MUX gate.
- property nand2
2-input NAND gate.
- property nor2
2-input NOR gate.
- property onehot
3-input ONEHOT gate.
- property or2
2-input OR gate.
- property or_and
3-input OR-AND gate.
- property xnor2
2-input XNOR gate.
- property xor2
2-input XOR gate.
- property xor_and
3-input XOR-AND gate.
- mnt.pyfiction.and_or_not() mnt.pyfiction.pyfiction.technology_mapping_params
Auxiliary function to create technology mapping parameters for AND, OR, and NOT gates.
- Returns:
Technology mapping parameters.
- mnt.pyfiction.and_or_not_maj() mnt.pyfiction.pyfiction.technology_mapping_params
Auxiliary function to create technology mapping parameters for AND, OR, NOT, and MAJ gates.
- Returns:
Technology mapping parameters.
- mnt.pyfiction.all_standard_2_input_functions() mnt.pyfiction.pyfiction.technology_mapping_params
Auxiliary function to create technology mapping parameters for AND, OR, NAND, NOR, XOR, XNOR, and NOT gates.
- Returns:
Technology mapping parameters.
- mnt.pyfiction.all_standard_3_input_functions() mnt.pyfiction.pyfiction.technology_mapping_params
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.
- mnt.pyfiction.all_supported_standard_functions() mnt.pyfiction.pyfiction.technology_mapping_params
Auxiliary function to create technology mapping parameters for all supported standard functions.
- Returns:
Technology mapping parameters.
- class mnt.pyfiction.technology_mapping_stats
Statistics for technology mapping.
- property mapper_stats
Statistics for mockturtle’s mapper.
- report(self: mnt.pyfiction.pyfiction.technology_mapping_stats) None
Report statistics.
- mnt.pyfiction.technology_mapping(network: mnt.pyfiction.pyfiction.technology_network, params: mnt.pyfiction.pyfiction.technology_mapping_params = <mnt.pyfiction.pyfiction.technology_mapping_params object at 0x7b94bc8f0a30>, stats: mnt.pyfiction.pyfiction.technology_mapping_stats = None) mnt.pyfiction.pyfiction.technology_network
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 parameter
Ntk
: Input logic network type.
- Parameter
ntk
: Input logic network.
- Parameter
params
: Technology mapping parameters.
- Parameter
pst
: Technology mapping statistics.
- Returns:
Mapped network exclusively using gates from the provided library.
- Template parameter
Delete Virtual PIs
Header: fiction/algorithms/network_transformation/delete_virtual_pis.hpp