The-OpenROAD-Project / OpenSTA

OpenSTA engine
GNU General Public License v3.0
389 stars 170 forks source link

logicNot function used outside #if CUDD #80

Closed just22 closed 2 years ago

just22 commented 2 years ago

Greetings,

The code doesn't compile anymore when -DUSE_CUDD is passed to cmake.

The problem seems that in search/Sim.cc the function logicNot, defined within the #if CUDD #else branch, is then used outside too, in Sim::evalInstance.

Would the following patch be acceptable?

Index: search/Sim.cc
--- search/Sim.cc.orig
+++ search/Sim.cc
@@ -43,6 +43,15 @@ static Pin *
 findDrvrPin(const Pin *pin,
        Network *network);

+static LogicValue
+logicNot(LogicValue value)
+{
+  static LogicValue logic_not[5] = {LogicValue::one, LogicValue::zero,
+                   LogicValue::unknown, LogicValue::unknown,
+                   LogicValue::unknown};
+  return logic_not[int(value)];
+}
+
 #if CUDD

 Sim::Sim(StaState *sta) :
@@ -223,15 +232,6 @@ Sim::ensureNode(LibertyPort *port) const

 #else 
 // No CUDD.
-
-static LogicValue
-logicNot(LogicValue value)
-{
-  static LogicValue logic_not[5] = {LogicValue::one, LogicValue::zero,
-                   LogicValue::unknown, LogicValue::unknown,
-                   LogicValue::unknown};
-  return logic_not[int(value)];
-}

 static LogicValue
 logicOr(LogicValue value1,

-- Alessandro

jjcherry56 commented 2 years ago

yes, that would work but I decided to clean up some other things so it should work now