diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-02-18 11:02:28 -0800 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2020-02-27 10:17:29 -0800 |
commit | 6bb3d9f9c09993960a5a91fa51f163a7e67e2503 (patch) | |
tree | 4e06827d7dfa711a2a5d1cd4702d5a0dfb4dddd5 /kernel | |
parent | 9dcf204dece518a48192a90ea962a9d630283e11 (diff) | |
download | yosys-6bb3d9f9c09993960a5a91fa51f163a7e67e2503.tar.gz yosys-6bb3d9f9c09993960a5a91fa51f163a7e67e2503.tar.bz2 yosys-6bb3d9f9c09993960a5a91fa51f163a7e67e2503.zip |
Make TimingInfo::TimingInfo(SigBit) constructor explicit
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/timinginfo.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/timinginfo.h b/kernel/timinginfo.h index 8d0904175..7855ddd15 100644 --- a/kernel/timinginfo.h +++ b/kernel/timinginfo.h @@ -31,8 +31,9 @@ struct TimingInfo { RTLIL::IdString name; int offset; - NameBit() {} - NameBit(const RTLIL::SigBit &b) : name(b.wire->name), offset(b.offset) {} + NameBit() : offset(0) {} + NameBit(const RTLIL::IdString name, int offset) : name(name), offset(offset) {} + explicit NameBit(const RTLIL::SigBit &b) : name(b.wire->name), offset(b.offset) {} bool operator==(const NameBit& nb) const { return nb.name == name && nb.offset == offset; } bool operator!=(const NameBit& nb) const { return !operator==(nb); } unsigned int hash() const { return mkhash_add(name.hash(), offset); } @@ -127,7 +128,7 @@ struct TimingInfo continue; } for (const auto &d : dst) { - auto &v = t.arrival[d]; + auto &v = t.arrival[NameBit(d)]; v = std::max(v, max); } } @@ -151,7 +152,7 @@ struct TimingInfo continue; } for (const auto &s : src) { - auto &v = t.required[s]; + auto &v = t.required[NameBit(s)]; v = std::max(v, max); } } |