Compare commits

...

2 Commits

Author SHA1 Message Date
Nick Brereton 733d58d132 Fix test output 2025-05-15 08:28:57 -04:00
Nick Brereton 6f6ffdc9d8 Assigning an interface to an interface should be unsupported, not illegal 2025-05-15 08:09:01 -04:00
2 changed files with 9 additions and 8 deletions

View File

@ -510,7 +510,8 @@ private:
if (VN_AS(rhsarrp->subDTypep()->skipRefp(), IfaceRefDType)->isVirtual())
return;
if (!VN_AS(lhsarrp->subDTypep()->skipRefp(), IfaceRefDType)->isVirtual()) {
nodep->lhsp()->v3error("Illegal target of assignment");
nodep->v3warn(E_UNSUPPORTED, "Unexpected target of interface assignment ["
<< rhsarrp->prettyDTypeNameQ() << "]");
return;
}
if (lhsarrp->elementsConst() != rhsarrp->elementsConst()) {
@ -549,11 +550,11 @@ private:
nodep->addNextHere(assignp);
}
VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep);
return;
}
} else {
iterateChildren(nodep);
}
}
iterateChildren(nodep);
}
//--------------------

View File

@ -1,17 +1,17 @@
%Error: t/t_interface_dearray_bad.v:23:7: Illegal target of assignment
: ... note: In instance 'tb_top'
%Error-UNSUPPORTED: t/t_interface_dearray_bad.v:23:9: Unexpected target of interface assignment ['IFACEREFDTYPE$[0:5]']
: ... note: In instance 'tb_top'
23 | a = f;
| ^
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
| ^
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error-UNSUPPORTED: t/t_interface_dearray_bad.v:26:13: Array size mismatch in interface assignment
: ... note: In instance 'tb_top'
26 | c.vif = b;
| ^
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: t/t_interface_dearray_bad.v:31:23: Expecting expression to be constant, but variable isn't const: 'i'
: ... note: In instance 'tb_top'
31 | d.vif[i] = a[i];
| ^
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
%Error-UNSUPPORTED: t/t_interface_dearray_bad.v:31:23: Non-constant index in RHS interface array selection
: ... note: In instance 'tb_top'
31 | d.vif[i] = a[i];