mirror of
https://github.com/verilator/verilator.git
synced 2026-09-04 08:33:38 +02:00
Fix packed array select internal error, bug652.
This commit is contained in:
+4
-4
@@ -244,16 +244,16 @@ public:
|
||||
refDTypep(NULL);
|
||||
setOp2p(rangep);
|
||||
dtypep(NULL); // V3Width will resolve
|
||||
// For backward compatibility AstNodeArrayDType and others inherit width and signing from the subDType/base type
|
||||
widthFromSub(subDTypep());
|
||||
int width = subDTypep()->width() * rangep->elementsConst();
|
||||
widthForce(width,width);
|
||||
}
|
||||
AstPackArrayDType(FileLine* fl, AstNodeDType* dtp, AstRange* rangep)
|
||||
: AstNodeArrayDType(fl) {
|
||||
refDTypep(dtp);
|
||||
setOp2p(rangep);
|
||||
dtypep(this);
|
||||
// For backward compatibility AstNodeArrayDType and others inherit width and signing from the subDType/base type
|
||||
widthFromSub(subDTypep());
|
||||
int width = subDTypep()->width() * rangep->elementsConst();
|
||||
widthForce(width,width);
|
||||
}
|
||||
ASTNODE_NODE_FUNCS(PackArrayDType, PACKARRAYDTYPE)
|
||||
};
|
||||
|
||||
+4
-2
@@ -307,13 +307,15 @@ private:
|
||||
newp->dtypeFrom(adtypep);
|
||||
} else {
|
||||
// Need a slice data type, which is an array of the extracted type, but with (presumably) different size
|
||||
VNumRange newRange (msb, lsb, fromRange.littleEndian());
|
||||
AstNodeDType* vardtypep = new AstPackArrayDType(nodep->fileline(),
|
||||
adtypep->subDTypep(), // Need to strip off array reference
|
||||
new AstRange(nodep->fileline(), fromRange));
|
||||
new AstRange(nodep->fileline(), newRange));
|
||||
v3Global.rootp()->typeTablep()->addTypesp(vardtypep);
|
||||
newp->dtypeFrom(vardtypep);
|
||||
}
|
||||
if (debug()>=9) newp->dumpTree(cout,"--EXTBTn: ");
|
||||
//if (debug()>=9) newp->dumpTree(cout,"--EXTBTn: ");
|
||||
if (newp->widthMin()!=(int)newp->widthConst()) nodep->v3fatalSrc("Width mismatch");
|
||||
nodep->replaceWith(newp); pushDeletep(nodep); nodep=NULL;
|
||||
}
|
||||
else if (ddtypep->castBasicDType()) {
|
||||
|
||||
Reference in New Issue
Block a user