Write into file formats¶
Write into AIGER files¶
Header: mockturtle/io/write_aiger.hpp
-
template<typename Ntk>
inline void mockturtle::write_aiger(Ntk const &aig, std::string const &filename)¶ Writes a combinational AIG network in binary AIGER format into a file.
This function should be only called on “clean” aig_networks, e.g., immediately after
cleanup_dangling
.Required network functions:
num_cis
num_cos
foreach_gate
foreach_fanin
foreach_po
get_node
is_complemented
node_to_index
- Parameters
aig – Combinational AIG network
filename – Filename
-
template<typename Ntk>
inline void mockturtle::write_aiger(Ntk const &aig, std::ostream &os)¶ Writes a combinational AIG network in binary AIGER format into a file.
This function should be only called on “clean” aig_networks, e.g., immediately after
cleanup_dangling
.Required network functions:
num_cis
num_cos
foreach_gate
foreach_fanin
foreach_po
get_node
is_complemented
node_to_index
- Parameters
aig – Combinational AIG network
os – Output stream
Write into BENCH files¶
Header: mockturtle/io/write_bench.hpp
-
template<class Ntk>
void mockturtle::write_bench(Ntk const &ntk, std::string const &filename)¶ Writes network in BENCH format into a file.
Required network functions:
is_constant
is_pi
is_complemented
get_node
num_pos
node_to_index
node_function
- Parameters
ntk – Network
filename – Filename
-
template<class Ntk>
void mockturtle::write_bench(Ntk const &ntk, std::ostream &os)¶ Writes network in BENCH format into output stream.
An overloaded variant exists that writes the network into a file.
Required network functions:
is_constant
is_pi
is_complemented
get_node
num_pos
node_to_index
node_function
- Parameters
ntk – Network
os – Output stream
Write into BLIF files¶
Header: mockturtle/io/write_blif.hpp
-
template<class Ntk>
void mockturtle::write_blif(Ntk const &ntk, std::string const &filename, write_blif_params const &ps = {})¶ Writes network in BLIF format into a file.
Required network functions:
fanin_size
foreach_fanin
foreach_pi
foreach_po
get_node
is_constant
is_pi
node_function
node_to_index
num_pis
num_pos
- Parameters
ntk – Network
filename – Filename
-
template<class Ntk>
void mockturtle::write_blif(Ntk const &ntk, std::ostream &os, write_blif_params const &ps = {})¶ Writes network in BLIF format into output stream.
An overloaded variant exists that writes the network into a file.
Required network functions:
fanin_size
foreach_fanin
foreach_pi
foreach_po
get_node
is_constant
is_pi
node_function
node_to_index
num_pis
num_pos
- Parameters
ntk – Network
os – Output stream
Write into structural Verilog files¶
Header: mockturtle/io/write_verilog.hpp
-
template<class Ntk>
void mockturtle::write_verilog(Ntk const &ntk, std::string const &filename, write_verilog_params const &ps = {})¶ Writes network in structural Verilog format into a file.
Required network functions:
num_pis
num_pos
foreach_pi
foreach_node
foreach_fanin
get_node
get_constant
is_constant
is_pi
is_and
is_or
is_xor
is_xor3
is_maj
node_to_index
- Parameters
ntk – Network
filename – Filename
-
template<class Ntk>
void mockturtle::write_verilog(Ntk const &ntk, std::ostream &os, write_verilog_params const &ps = {})¶ Writes network in structural Verilog format into output stream.
An overloaded variant exists that writes the network into a file.
Required network functions:
num_pis
num_pos
foreach_pi
foreach_node
foreach_fanin
get_node
get_constant
is_constant
is_pi
is_and
is_or
is_xor
is_xor3
is_maj
node_to_index
- Parameters
ntk – Network
os – Output stream
-
template<class Ntk>
void mockturtle::write_verilog(binding_view<Ntk> const &ntk, std::ostream &os, write_verilog_params const &ps = {})¶ Writes mapped network in structural Verilog format into output stream.
Required network functions:
num_pis
num_pos
foreach_pi
foreach_node
foreach_fanin
get_node
get_constant
is_constant
is_pi
node_to_index
- Parameters
ntk – Mapped network
os – Output stream
ps – Verilog parameters
Write into DIMACS files (CNF)¶
Header: mockturtle/io/write_cnf.hpp
Write into DOT files (Graphviz)¶
Header: mockturtle/io/write_dot.hpp
-
template<class Ntk, class Drawer = default_dot_drawer<Ntk>>
void mockturtle::write_dot(Ntk const &ntk, std::string const &filename, Drawer const &drawer = {})¶ Writes network in DOT format into a file.
Required network functions:
is_constant
is_pi
foreach_node
foreach_fanin
foreach_po
- Parameters
ntk – Network
filename – Filename
-
template<class Ntk, class Drawer = default_dot_drawer<Ntk>>
void mockturtle::write_dot(Ntk const &ntk, std::ostream &os, Drawer const &drawer = {})¶ Writes network in DOT format into output stream.
An overloaded variant exists that writes the network into a file.
Required network functions:
is_constant
is_pi
foreach_node
foreach_fanin
foreach_po
- Parameters
ntk – Network
os – Output stream
Write simulation patterns into file¶
Header: mockturtle/io/write_patterns.hpp
-
template<class Simulator>
void mockturtle::write_patterns(Simulator const &sim, std::string const &filename)¶ Writes simulation patterns.
The output contains
num_pis()
lines, each line contains a stream of simulation values of a primary input, represented in hexadecimal.- Parameters
sim – The
partial_simulator
orbit_packed_simulator
object containing simulation patternsfilename – Filename
-
template<class Simulator>
void mockturtle::write_patterns(Simulator const &sim, std::ostream &out = std::cout)¶ Writes simulation patterns.
The output contains
num_pis()
lines, each line contains a stream of simulation values of a primary input, represented in hexadecimal.- Parameters
sim – The
partial_simulator
orbit_packed_simulator
object containing simulation patternsout – Output stream