forked from github/verilator
Internals: Fix setBit not clearing X mask.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
parent
9a16001e51
commit
6bda57da5d
@ -56,10 +56,19 @@ public:
|
||||
V3Number& setDouble(double value);
|
||||
void setBit (int bit, char value) { // Note must be pre-zeroed!
|
||||
if (bit>=m_width) return;
|
||||
if (value=='0'||value==0) m_value [bit/32] &= ~(1UL<<(bit&31));
|
||||
else {
|
||||
if (value=='1'||value=='x'||value==1||value==3) m_value [bit/32] |= (1UL<<(bit&31));
|
||||
if (value=='z'||value=='x'||value==2||value==3) m_valueX[bit/32] |= (1UL<<(bit&31));
|
||||
uint32_t mask = (1UL<<(bit&31));
|
||||
if (value=='0' || value==0) {
|
||||
m_value [bit/32] &= ~mask;
|
||||
m_valueX[bit/32] &= ~mask;
|
||||
} else if (value=='1'|| value==1) {
|
||||
m_value [bit/32] |= mask;
|
||||
m_valueX[bit/32] &= ~mask;
|
||||
} else if (value=='z'|| value==3) {
|
||||
m_value [bit/32] &= ~mask;
|
||||
m_valueX[bit/32] |= mask;
|
||||
} else { // X
|
||||
m_value [bit/32] |= mask;
|
||||
m_valueX[bit/32] |= mask;
|
||||
}
|
||||
}
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user