Skip to content

Commit

Permalink
Adding docs on write verilog, updating the experiment on emap
Browse files Browse the repository at this point in the history
  • Loading branch information
aletempiac committed Feb 22, 2024
1 parent 6efb33b commit 6f24f6e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/io/writers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ Write into structural Verilog files

.. doxygenfunction:: mockturtle::write_verilog(Ntk const&, std::ostream&, write_verilog_params const&)

.. doxygenfunction:: mockturtle::write_verilog_with_binding(Ntk const&, std::string const&, write_verilog_params const&)

.. doxygenfunction:: mockturtle::write_verilog_with_binding(Ntk const&, std::ostream&, write_verilog_params const&)

.. doxygenfunction:: mockturtle::write_verilog_with_cell(Ntk const&, std::string const&, write_verilog_params const&)

.. doxygenfunction:: mockturtle::write_verilog_with_cell(Ntk const&, std::ostream&, write_verilog_params const&)

Write into DIMACS files (CNF)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
11 changes: 11 additions & 0 deletions experiments/emap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
#include <fmt/format.h>
#include <lorina/aiger.hpp>
#include <lorina/genlib.hpp>
#include <mockturtle/algorithms/aig_balancing.hpp>
#include <mockturtle/algorithms/emap.hpp>
#include <mockturtle/io/aiger_reader.hpp>
#include <mockturtle/io/genlib_reader.hpp>
#include <mockturtle/io/write_verilog.hpp>
#include <mockturtle/networks/aig.hpp>
#include <mockturtle/networks/block.hpp>
#include <mockturtle/utils/name_utils.hpp>
Expand Down Expand Up @@ -76,6 +78,12 @@ int main()
continue;
}

/* remove structural redundancies */
aig_balancing_params bps;
bps.minimize_levels = false;
bps.fast_mode = false;
aig_balance( aig, bps );

const uint32_t size_before = aig.num_gates();
const uint32_t depth_before = depth_view( aig ).depth();

Expand All @@ -91,6 +99,9 @@ int main()
restore_pio_names_by_order( aig, res_names );
const auto cec = benchmark == "hyp" ? true : abc_cec_mapped_cell( res_names, benchmark, library );

/* write verilog netlist */
// write_verilog_with_cell( res_names, benchmark + "_mapped.v" );

exp( benchmark, size_before, res.compute_area(), depth_before, res.compute_worst_delay(), st.multioutput_gates, to_seconds( st.time_total ), cec );
}

Expand Down

0 comments on commit 6f24f6e

Please sign in to comment.