Fix over-iterating dpi dimensions (#2703).

This commit is contained in:
Wilson Snyder 2020-12-15 22:09:24 -05:00
parent d9ef4ac435
commit c54360485e
2 changed files with 3 additions and 3 deletions

View File

@ -2640,7 +2640,7 @@ vluint32_t VerilatedVarProps::entSize() const {
size_t VerilatedVarProps::totalSize() const {
size_t size = entSize();
for (int udim = 0; udim <= udims(); ++udim) size *= m_unpacked[udim].elements();
for (int udim = 0; udim < udims(); ++udim) size *= m_unpacked[udim].elements();
return size;
}

View File

@ -75,8 +75,8 @@ class VerilatedVarProps VL_NOT_FINAL {
const vluint32_t m_magic; // Magic number
const VerilatedVarType m_vltype; // Data type
const VerilatedVarFlags m_vlflags; // Direction
const int m_pdims; // Packed dimensions
const int m_udims; // Unpacked dimensions
const int m_pdims; // Packed dimensions, 0 = none
const int m_udims; // Unpacked dimensions, 0 = none
VerilatedRange m_packed; // Packed array range
std::vector<VerilatedRange> m_unpacked; // Unpacked array ranges
void initUnpacked(const int* ulims) {