Fix FST tracing of wide arrays, bug1376.

This commit is contained in:
Wilson Snyder 2018-12-18 20:49:44 -05:00
parent e01c9df35e
commit 47107a5a36
2 changed files with 6 additions and 4 deletions

View File

@ -9,6 +9,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
**** For --xml, add additional information, bug1372. [Jonathan Kimmitt]
**** Fix FST tracing of wide arrays, bug1376. [Aleksander Osman]
**** Fix error when pattern assignment has too few elements, bug1378. [Viktor Tomov]

View File

@ -220,16 +220,16 @@ char* VerilatedFst::array2Str(const vluint32_t* newval, int bits) {
int bq = bits/32, br = bits%32;
m_valueStrBuffer.resize(bits+1);
char* s = m_valueStrBuffer.data();
for (int i = 0; i < br; ++i) {
*s = '0' + ((newval[bq]>>(br-i-1))&1);
++s;
}
for (int w = bq-1; w >= 0; --w) {
for (int i = 0; i < 32; ++i) {
*s = '0' + ((newval[w]>>(32-i-1))&1);
++s;
}
}
for (int i = 0; i < br; ++i) {
*s = '0' + ((newval[bq]>>(br-i-1))&1);
++s;
}
*s = '\0';
return m_valueStrBuffer.data();
}