From 7c065f40cd0835e2a821ced2c42f86e722269c8a Mon Sep 17 00:00:00 2001 From: Nils Albartus Date: Thu, 1 Dec 2022 14:41:46 +0100 Subject: [PATCH] added failing boolean function test for abc --- tests/netlist/boolean_function.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/netlist/boolean_function.cpp b/tests/netlist/boolean_function.cpp index b18b40b5a73..de04a1225be 100644 --- a/tests/netlist/boolean_function.cpp +++ b/tests/netlist/boolean_function.cpp @@ -1059,6 +1059,18 @@ namespace hal { EXPECT_EQ(((a.clone() & c.clone()) | (b.clone() & ~c.clone()) | (a.clone() & b.clone())).simplify(), (b.clone() | c.clone()) & (a.clone() | ~c.clone())); } + + TEST(BooleanFunction, SimplificationABC) + { + const auto start = std::chrono::system_clock::now(); + + const auto function = BooleanFunction::from_string("((((0b0 | ((((0b1 & (! s2r_RNI7LA61(0))) & (! s4r17_i__[3]__)) & (! s2d2r(0)__[3]__)) & s2r(16)__[3]__)) | ((((0b1 & s2r_RNI7LA61(0)) & (! s4r17_i__[3]__)) & (! s2d2r(0)__[3]__)) & s2r(16)__[3]__)) | ((((0b1 & (! s2r_RNI7LA61(0))) & s4r17_i__[3]__) & (! s2d2r(0)__[3]__)) & s2r(16)__[3]__)) | ((((0b1 & (! s2r_RNI7LA61(0))) & (! s4r17_i__[3]__)) & s2d2r(0)__[3]__) & s2r(16)__[3]__))").get(); + const auto simplified = function.simplify(); + + const auto duration_in_seconds = std::chrono::duration(std::chrono::system_clock::now() - start).count(); + } + + TEST(BooleanFunction, SimplificationPerformance) { const auto start = std::chrono::system_clock::now();