Add a less operator to BddPortVarMap (#258)
bdd_port_var_map_, of type BddPortVarMap, is iterated over in Power::evalBddActivity. Previously the map used pointer comparison so the iteration order was non-deterministic. The computed density was therefore non-deterministic due to the non-associativity of floating-point addition. Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
This commit is contained in:
parent
fa70c6cf2b
commit
06f94cafd8
|
|
@ -34,7 +34,7 @@ struct DdManager;
|
||||||
|
|
||||||
namespace sta {
|
namespace sta {
|
||||||
|
|
||||||
typedef std::map<const LibertyPort*, DdNode*> BddPortVarMap;
|
typedef std::map<const LibertyPort*, DdNode*, LibertyPortLess> BddPortVarMap;
|
||||||
typedef std::map<unsigned, const LibertyPort*> BddVarIdxPortMap;
|
typedef std::map<unsigned, const LibertyPort*> BddVarIdxPortMap;
|
||||||
|
|
||||||
class Bdd : public StaState
|
class Bdd : public StaState
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,12 @@ enum class TableAxisVariable {
|
||||||
enum class PathType { clk, data, clk_and_data };
|
enum class PathType { clk, data, clk_and_data };
|
||||||
const int path_type_count = 2;
|
const int path_type_count = 2;
|
||||||
|
|
||||||
|
class LibertyPortLess
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool operator()(const LibertyPort *port1, const LibertyPort *port2) const;
|
||||||
|
};
|
||||||
|
|
||||||
class LibertyPortNameLess
|
class LibertyPortNameLess
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -2833,6 +2833,13 @@ sortByName(const LibertyPortSet *set)
|
||||||
return ports;
|
return ports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
LibertyPortLess::operator()(const LibertyPort *port1,
|
||||||
|
const LibertyPort *port2) const
|
||||||
|
{
|
||||||
|
return LibertyPort::less(port1, port2);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
LibertyPortNameLess::operator()(const LibertyPort *port1,
|
LibertyPortNameLess::operator()(const LibertyPort *port1,
|
||||||
const LibertyPort *port2) const
|
const LibertyPort *port2) const
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue