mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Ensure VarRef inherits dtype when varp is set.
Inlining used to set some VarRefs to point to new Var nodes, without updating the dtype of the VarRef to the dtype of the new Var. AstNode::sameTree does identity comparison on the dtype, so some trees that were semantically the same did not compare as such with sameTree because of the dtype. This in turn results in some missed opportunities for combining equivalent SenTree sensitivities when the clock came from outside.
This commit is contained in:
@@ -443,7 +443,6 @@ private:
|
||||
string newname = varrefp->name() + "__BRA__" + cvtToStr(i + offset) + "__KET__";
|
||||
AstVarXRef* newVarXRefp = new AstVarXRef(nodep->fileline(), newname, "", true);
|
||||
newVarXRefp->varp(newp->modVarp());
|
||||
newVarXRefp->dtypep(newp->modVarp()->dtypep());
|
||||
newp->exprp()->unlinkFrBack()->deleteTree();
|
||||
newp->exprp(newVarXRefp);
|
||||
if (!prevPinp) {
|
||||
|
||||
Reference in New Issue
Block a user