Fix nested packed arrays and structs, bug600.

IMPORTANT: Packed arrays are now represented as a single linear vector in
Verilated models this may affect packed arrays that are public or accessed via the VPI.
This commit is contained in:
Wilson Snyder
2013-01-14 21:49:22 -05:00
parent 057ca497dd
commit 8127a79cb1
23 changed files with 268 additions and 114 deletions
+2 -2
View File
@@ -86,7 +86,7 @@ private:
if (prettyName.find("._") != string::npos)
return "Inlined leading underscore";
}
if ((nodep->width()*nodep->dtypep()->arrayElements()) > 256) return "Wide bus/array > 256 bits";
if ((nodep->width()*nodep->dtypep()->arrayUnpackedElements()) > 256) return "Wide bus/array > 256 bits";
// We allow this, though tracing doesn't
// if (nodep->arrayp(1)) return "Unsupported: Multi-dimensional array";
return NULL;
@@ -209,7 +209,7 @@ private:
varp, chgVarp);
}
}
else if (AstNodeArrayDType* adtypep = dtypep->castNodeArrayDType()) {
else if (AstUnpackArrayDType* adtypep = dtypep->castUnpackArrayDType()) {
for (int index_docs=adtypep->lsb(); index_docs<=adtypep->msb()+1; ++index_docs) {
int index_code = index_docs - adtypep->lsb();
ToggleEnt newent (above.m_comment+string("[")+cvtToStr(index_docs)+"]",