mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Fix NBAs to unpacked arrays of unpacked structs (#5603)
This happened to work before #5516, by creating a whole shadow copy of the entire array. Revert back to that behaviour for now, it will be slow, but works still. Fixes #5590
This commit is contained in:
+8
-3
@@ -251,10 +251,11 @@ class DelayedVisitor final : public VNVisitor {
|
||||
const AstNodeDType* const dtypep = vscp->dtypep()->skipRefp();
|
||||
// Unpacked arrays
|
||||
if (const AstUnpackArrayDType* const uaDTypep = VN_CAST(dtypep, UnpackArrayDType)) {
|
||||
// Basic underlying type of elements, if any.
|
||||
AstBasicDType* const basicp = uaDTypep->basicp();
|
||||
// If used in a loop, we must have a dynamic commit queue. (Also works in suspendables)
|
||||
if (vscpInfo.m_inLoop) {
|
||||
// Arrays with compound element types are currently not supported in loops
|
||||
AstBasicDType* const basicp = uaDTypep->basicp();
|
||||
if (!basicp
|
||||
|| !(basicp->isIntegralOrPacked() //
|
||||
|| basicp->isDouble() //
|
||||
@@ -266,8 +267,12 @@ class DelayedVisitor final : public VNVisitor {
|
||||
}
|
||||
// In a suspendable of fork, we must use the unique flag scheme, TODO: why?
|
||||
if (vscpInfo.m_inSuspOrFork) return Scheme::FlagUnique;
|
||||
// Otherwise use the shared flag scheme
|
||||
return Scheme::FlagShared;
|
||||
// Otherwise if an array of packed/basic elements, use the shared flag scheme
|
||||
if (basicp) return Scheme::FlagShared;
|
||||
// Finally fall back on the shadow variable scheme, e.g. for
|
||||
// arrays of unpacked structs. This will be slow.
|
||||
// TODO: generic LHS scheme as discussed in #5092
|
||||
return Scheme::ShadowVar;
|
||||
}
|
||||
|
||||
// In a suspendable of fork, we must use the unique flag scheme, TODO: why?
|
||||
|
||||
Reference in New Issue
Block a user