Fixes for older compilers
authorEddie Hung <eddie@fpgeh.com>
Thu, 20 Feb 2020 15:52:08 +0000 (07:52 -0800)
committerEddie Hung <eddie@fpgeh.com>
Thu, 27 Feb 2020 18:17:29 +0000 (10:17 -0800)
kernel/timinginfo.h
passes/techmap/abc9_ops.cc

index 7855ddd15db858db88cd77c6997dda7df47513ad..5a6f4aa2885dc4e2b683e16ea93c123eae8a0339 100644 (file)
@@ -38,7 +38,14 @@ struct TimingInfo
                bool operator!=(const NameBit& nb) const { return !operator==(nb); }
                unsigned int hash() const { return mkhash_add(name.hash(), offset); }
        };
-       typedef std::pair<NameBit,NameBit> BitBit;
+       struct BitBit
+       {
+               NameBit first, second;
+               BitBit(const NameBit &first, const NameBit &second) : first(first), second(second) {}
+               BitBit(const SigBit &first, const SigBit &second) : first(first), second(second) {}
+               bool operator==(const BitBit& bb) const { return bb.first == first && bb.second == second; }
+               unsigned int hash() const { return mkhash_add(first.hash(), second.hash()); }
+       };
 
        struct ModuleTiming
        {
index cffcc189e4609c6f11ebb0c75d98991cb79b410d..b0bd81698570560fb0e35ebf963780e1c902f0d0 100644 (file)
@@ -680,7 +680,7 @@ void prep_box(RTLIL::Design *design, bool dff_mode)
                                        first = false;
                                else
                                        ss << " ";
-                               auto jt = t.find(std::make_pair(TimingInfo::NameBit(i),TimingInfo::NameBit(o)));
+                               auto jt = t.find(TimingInfo::BitBit(i,o));
                                if (jt == t.end())
                                        ss << "-";
                                else