Fix interface array connections with non-zero low declaration index.

This commit is contained in:
Wilson Snyder
2025-06-28 09:43:02 -04:00
parent f508dadc97
commit 62e5e3aa0c
4 changed files with 74 additions and 2 deletions
+2 -2
View File
@@ -373,7 +373,7 @@ private:
"Unsupported: Non-constant index when passing interface to module");
return;
}
const string index = AstNode::encodeNumber(constp->toSInt());
const string index = AstNode::encodeNumber(constp->toSInt() + arrp->lo());
if (VN_IS(arrselp->fromp(), SliceSel))
arrselp->fromp()->v3error("Unsupported: interface slices");
const AstVarRef* const varrefp = VN_CAST(arrselp->fromp(), VarRef);
@@ -482,7 +482,7 @@ private:
"Non-constant index in RHS interface array selection");
return;
}
const string index = AstNode::encodeNumber(constp->toSInt());
const string index = AstNode::encodeNumber(constp->toSInt() + arrp->lo());
const AstVarRef* const varrefp = VN_CAST(nodep->fromp(), VarRef);
UASSERT_OBJ(varrefp, nodep, "No interface varref under array");
AstVarXRef* const newp = new AstVarXRef{