mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-07 01:54:10 +00:00
Small changes regarding cover() and check() in SigSpec
This commit is contained in:
parent
3a2c535777
commit
22ede43b3f
|
@ -1594,10 +1594,7 @@ void RTLIL::SigSpec::replace(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec
|
||||||
|
|
||||||
void RTLIL::SigSpec::replace(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec &with, RTLIL::SigSpec *other) const
|
void RTLIL::SigSpec::replace(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec &with, RTLIL::SigSpec *other) const
|
||||||
{
|
{
|
||||||
if (other)
|
cover("kernel.rtlil.sigspec.replace");
|
||||||
cover("kernel.rtlil.sigspec.replace_other");
|
|
||||||
else
|
|
||||||
cover("kernel.rtlil.sigspec.replace");
|
|
||||||
|
|
||||||
unpack();
|
unpack();
|
||||||
pattern.unpack();
|
pattern.unpack();
|
||||||
|
@ -1797,8 +1794,7 @@ void RTLIL::SigSpec::append(const RTLIL::SigSpec &signal)
|
||||||
bits_.insert(bits_.end(), signal.bits_.begin(), signal.bits_.end());
|
bits_.insert(bits_.end(), signal.bits_.begin(), signal.bits_.end());
|
||||||
|
|
||||||
width_ += signal.width_;
|
width_ += signal.width_;
|
||||||
|
// check();
|
||||||
check();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTLIL::SigSpec::append_bit(const RTLIL::SigBit &bit)
|
void RTLIL::SigSpec::append_bit(const RTLIL::SigBit &bit)
|
||||||
|
@ -1829,8 +1825,7 @@ void RTLIL::SigSpec::append_bit(const RTLIL::SigBit &bit)
|
||||||
}
|
}
|
||||||
|
|
||||||
width_++;
|
width_++;
|
||||||
|
// check();
|
||||||
check();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTLIL::SigSpec::extend(int width, bool is_signed)
|
void RTLIL::SigSpec::extend(int width, bool is_signed)
|
||||||
|
@ -1881,9 +1876,9 @@ RTLIL::SigSpec RTLIL::SigSpec::repeat(int num) const
|
||||||
return sig;
|
return sig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
void RTLIL::SigSpec::check() const
|
void RTLIL::SigSpec::check() const
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
|
||||||
if (packed())
|
if (packed())
|
||||||
{
|
{
|
||||||
cover("kernel.rtlil.sigspec.check.packed");
|
cover("kernel.rtlil.sigspec.check.packed");
|
||||||
|
@ -1916,8 +1911,8 @@ void RTLIL::SigSpec::check() const
|
||||||
assert(width_ == SIZE(bits_));
|
assert(width_ == SIZE(bits_));
|
||||||
assert(chunks_.empty());
|
assert(chunks_.empty());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool RTLIL::SigSpec::operator <(const RTLIL::SigSpec &other) const
|
bool RTLIL::SigSpec::operator <(const RTLIL::SigSpec &other) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -599,7 +599,11 @@ public:
|
||||||
operator std::vector<RTLIL::SigChunk>() const { return chunks(); }
|
operator std::vector<RTLIL::SigChunk>() const { return chunks(); }
|
||||||
operator std::vector<RTLIL::SigBit>() const { return bits(); }
|
operator std::vector<RTLIL::SigBit>() const { return bits(); }
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
void check() const;
|
void check() const;
|
||||||
|
#else
|
||||||
|
inline void check() const { }
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
inline RTLIL::SigBit &RTLIL::SigSpecIterator::operator*() const {
|
inline RTLIL::SigBit &RTLIL::SigSpecIterator::operator*() const {
|
||||||
|
|
Loading…
Reference in a new issue