mirror of
https://github.com/verilator/verilator.git
synced 2025-01-31 18:54:03 +00:00
Fix unpacked-in-class pattern assignment
This commit is contained in:
parent
e3788e871e
commit
9dcda6947d
@ -67,6 +67,8 @@ class SliceVisitor final : public AstNVisitor {
|
|||||||
nodep->v3error(
|
nodep->v3error(
|
||||||
nodep->prettyTypeName()
|
nodep->prettyTypeName()
|
||||||
<< " is not an unpacked array, but is in an unpacked array context");
|
<< " is not an unpacked array, but is in an unpacked array context");
|
||||||
|
} else {
|
||||||
|
V3Error::incErrors(); // Otherwise might infinite loop
|
||||||
}
|
}
|
||||||
m_assignError = true;
|
m_assignError = true;
|
||||||
return nodep->cloneTree(false); // Likely will cause downstream errors
|
return nodep->cloneTree(false); // Likely will cause downstream errors
|
||||||
@ -107,7 +109,7 @@ class SliceVisitor final : public AstNVisitor {
|
|||||||
: offset));
|
: offset));
|
||||||
newp = new AstArraySel(nodep->fileline(), snodep->fromp()->cloneTree(false), leOffset);
|
newp = new AstArraySel(nodep->fileline(), snodep->fromp()->cloneTree(false), leOffset);
|
||||||
} else if (VN_IS(nodep, ArraySel) || VN_IS(nodep, NodeVarRef) || VN_IS(nodep, NodeSel)
|
} else if (VN_IS(nodep, ArraySel) || VN_IS(nodep, NodeVarRef) || VN_IS(nodep, NodeSel)
|
||||||
|| VN_IS(nodep, CMethodHard)) {
|
|| VN_IS(nodep, CMethodHard) || VN_IS(nodep, MemberSel)) {
|
||||||
UINFO(9, " cloneSel(" << elements << "," << offset << ") " << nodep << endl);
|
UINFO(9, " cloneSel(" << elements << "," << offset << ") " << nodep << endl);
|
||||||
int leOffset = !arrayp->rangep()->littleEndian()
|
int leOffset = !arrayp->rangep()->littleEndian()
|
||||||
? arrayp->rangep()->elementsConst() - 1 - offset
|
? arrayp->rangep()->elementsConst() - 1 - offset
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
''{b:'h1, i:'h2a, carray4:'{'h11, 'h22, 'h33, 'h44} }'
|
''{b:'h1, i:'h2a, carray4:'{'h11, 'h22, 'h33, 'h44} }'
|
||||||
|
''{b:'h1, i:'h2a, carray4:'{'h911, 'h922, 'h933, 'h944} }'
|
||||||
*-* All Finished *-*
|
*-* All Finished *-*
|
||||||
|
@ -30,6 +30,9 @@ module t (/*AUTOARG*/);
|
|||||||
c.carray4[3] = 16'h44;
|
c.carray4[3] = 16'h44;
|
||||||
$display("'%p'", c);
|
$display("'%p'", c);
|
||||||
|
|
||||||
|
c.carray4 = '{16'h911, 16'h922, 16'h933, 16'h944};
|
||||||
|
$display("'%p'", c);
|
||||||
|
|
||||||
$write("*-* All Finished *-*\n");
|
$write("*-* All Finished *-*\n");
|
||||||
$finish;
|
$finish;
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user