diff --git a/README.md b/README.md index f8b52c5..e858a46 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # powerful heightened yielded Logic Synthesis (phyLS) -phyLS is based on the [mockturtle](https://github.com/lsils/mockturtle), it can optimize different logics attributes. -Currently, it supports AIG, MIG, XAG, and XMG based optimization. +phyLS is based on the [mockturtle](https://github.com/lsils/mockturtle) and the [abc](https://github.com/berkeley-abc/abc), it can optimize different logics attributes. +Currently, it supports mockturtle format(AIG, MIG, XAG, XMG) and abc format(AIG,GIA) based optimization. [Read the documentation here.](https://phyls.readthedocs.io/en/latest/) diff --git a/src/commands/functional_reduction.hpp b/src/commands/functional_reduction.hpp index 3a30a48..cff0f07 100644 --- a/src/commands/functional_reduction.hpp +++ b/src/commands/functional_reduction.hpp @@ -27,13 +27,17 @@ using namespace mockturtle; namespace alice { -class reduction_command : public command { +class fr_command : public command { public: - explicit reduction_command(const environment::ptr& env) + explicit fr_command(const environment::ptr& env) : command(env, "functional reduction [default = AIG]") { add_flag("--mig, -m", "functional reduction for MIG"); add_flag("--xag, -g", "functional reduction for XAG"); add_flag("--xmg, -x", "functional reduction for XMG"); + add_option("--tfi_node, -n", max_tfi_node, + "Maximum number of nodes in the TFI to be compared"); + add_flag("--saturation, -s", + "repeat until no further improvement can be found"); add_flag("--verbose, -v", "print the information"); } @@ -42,31 +46,40 @@ class reduction_command : public command { clock_t begin, end; double totalTime; + functional_reduction_params ps; + ps.max_TFI_nodes = max_tfi_node; + if (is_set("saturation")) ps.saturation = true; + + if (is_set("verbose")) { + ps.verbose = true; + ps.progress = true; + } + begin = clock(); if (is_set("mig")) { auto mig = store().current(); - functional_reduction(mig); + functional_reduction(mig, ps); mig = cleanup_dangling(mig); phyLS::print_stats(mig); store().extend(); store().current() = mig; } else if (is_set("xmg")) { auto xmg = store().current(); - functional_reduction(xmg); + functional_reduction(xmg, ps); xmg = cleanup_dangling(xmg); phyLS::print_stats(xmg); store().extend(); store().current() = xmg; } else if (is_set("xag")) { auto xag = store().current(); - functional_reduction(xag); + functional_reduction(xag, ps); xag = cleanup_dangling(xag); phyLS::print_stats(xag); store().extend(); store().current() = xag; } else { auto aig = store().current(); - functional_reduction(aig); + functional_reduction(aig, ps); aig = cleanup_dangling(aig); phyLS::print_stats(aig); store().extend(); @@ -80,9 +93,10 @@ class reduction_command : public command { } private: + int max_tfi_node = 500; }; -ALICE_ADD_COMMAND(reduction, "Synthesis") +ALICE_ADD_COMMAND(fr, "Synthesis") } // namespace alice