Skip to content

Commit

Permalink
Docs and experiments update (#633)
Browse files Browse the repository at this point in the history
* Adding docs on write verilog, updating the experiment on emap

* Updating experiment on extract adders

* Adding CMake build types info on docs
  • Loading branch information
aletempiac authored Feb 22, 2024
1 parent 6efb33b commit a011b89
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ operation of the algorithms.

.. _ABC: https://github.com/berkeley-abc/abc

mockturtle can be configured using CMake build types. For performance,
configure CMake in release mode::

cmake -DCMAKE_BUILD_TYPE=Release ..

Using mockturtle as a library in another project
------------------------------------------------

Expand Down
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
5 changes: 4 additions & 1 deletion experiments/extract_adders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ int main()
}

/* Remove structural redundancies (increases the number of discoverable HAs/FAs) */
aig_balance( aig, { false } );
aig_balancing_params bps;
bps.minimize_levels = false;
bps.fast_mode = false;
aig_balance( aig, bps );

const uint32_t size_before = aig.num_gates();

Expand Down

0 comments on commit a011b89

Please sign in to comment.