Commit 1b8b674f authored by Philipp Meyer's avatar Philipp Meyer

Choose minimal circuit by minimal number of and gates and latches

parent 56996938
......@@ -558,7 +558,8 @@ std::shared_ptr<AigerConstructor> AigerConstructor::findMinimalAiger(const mealy
thread.join();
}
literal_t min = std::numeric_limits<literal_t>::max();
std::tuple<literal_t,literal_t> min =
{ std::numeric_limits<literal_t>::max(), std::numeric_limits<literal_t>::max() };
for (const auto& conf : configurations) {
min = std::min(min, conf->size());
}
......@@ -568,7 +569,7 @@ std::shared_ptr<AigerConstructor> AigerConstructor::findMinimalAiger(const mealy
Abc_Start();
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
for (const auto& conf : configurations) {
if (min >= conf->size() / 10) {
if (std::get<0>(min) >= std::get<0>(conf->size()) / 10) {
// avoid time-consuming compression of huge circuits if there is already a much smaller solution
conf->compressAiger(pAbc);
min = std::min(min, conf->size());
......
......@@ -111,7 +111,11 @@ namespace aig {
void printBDDs(std::ostream& out) const;
inline literal_t size() { return aig->num_ands; }
inline literal_t num_ands() { return aig->num_ands; }
inline literal_t num_latches() { return aig->num_latches; }
inline std::tuple<literal_t,literal_t> size() {
return std::tuple<literal_t,literal_t>(num_ands(), num_latches());
}
static std::shared_ptr<AigerConstructor> findMinimalAiger(const mealy::MealyMachine& m, const bool use_labels, const bool use_minimal, const bool compress, const bool keepBDDs);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment