Tristate support; merge from branch.

This commit is contained in:
Lane Brooks
2009-01-06 11:03:57 -05:00
committed by Wilson Snyder
parent 6f81a9cb1e
commit 0e4f9170fa
24 changed files with 1242 additions and 8 deletions
+24
View File
@@ -291,6 +291,14 @@ V3Number& V3Number::setSingleBits(char value) {
return *this;
}
V3Number& V3Number::setAllBits0() {
for (int i=0; i<words(); i++) { m_value[i] = m_valueX[i]=0; }
return *this;
}
V3Number& V3Number::setAllBits1() {
for (int i=0; i<words(); i++) { m_value[i]= ~0; m_valueX[i] = 0; }
return *this;
}
V3Number& V3Number::setAllBitsX() {
for (int i=0; i<words(); i++) { m_value[i]=m_valueX[i] = ~0; }
return *this;
@@ -584,6 +592,22 @@ V3Number& V3Number::opBitsXZ (const V3Number& lhs) { // 0/1->1, X/Z->0
}
return *this;
}
V3Number& V3Number::opBitsZ (const V3Number& lhs) { // 0/1->1, X/Z->0
// op i, L(lhs) bit return
setZero();
for(int bit=0; bit<this->width(); bit++) {
if (lhs.bitIsZ(bit)) { setBit(bit,1); }
}
return *this;
}
V3Number& V3Number::opBitsNonZ (const V3Number& lhs) { // 0/1->1, X/Z->0
// op i, L(lhs) bit return
setZero();
for(int bit=0; bit<this->width(); bit++) {
if (!lhs.bitIsZ(bit)) { setBit(bit,1); }
}
return *this;
}
//======================================================================
// Operators - Simple per-bit logical ops