mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Fix enums with X values. Test in next commit.
This commit is contained in:
@@ -625,6 +625,16 @@ bool V3Number::isLt(const V3Number& rhs) const {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
bool V3Number::isLtXZ(const V3Number& rhs) const {
|
||||
// Include X/Z in comparisons for sort ordering
|
||||
for (int bit=0; bit<max(this->width(),rhs.width()); bit++) {
|
||||
if (this->bitIs1(bit) && rhs.bitIs0(bit)) { return 1; }
|
||||
if (rhs.bitIs1(bit) && this->bitIs0(bit)) { return 0; }
|
||||
if (this->bitIsXZ(bit)) { return 1; }
|
||||
if (rhs.bitIsXZ(bit)) { return 0; }
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int V3Number::widthMin() const {
|
||||
for(int bit=width()-1; bit>0; bit--) {
|
||||
|
||||
Reference in New Issue
Block a user