Address review and refine branch cov

This commit is contained in:
Yilou Wang 2026-06-18 22:08:34 +02:00
parent 49e2002704
commit cb7263d991
2 changed files with 5 additions and 3 deletions

View File

@ -3837,9 +3837,8 @@ class WidthVisitor final : public VNVisitor {
// instance pointer), not a static instance. Mark the
// dtype virtual so a method call on it dispatches per
// instance instead of inlining to one fixed scope.
AstIfaceRefDType* const subRefp
= VN_CAST(subDtypep->skipRefp(), IfaceRefDType);
if (subRefp) {
if (AstIfaceRefDType* const subRefp
= VN_CAST(subDtypep->skipRefp(), IfaceRefDType)) {
AstIfaceRefDType* const newDtypep = new AstIfaceRefDType{
nodep->fileline(), subRefp->cellName(), subRefp->ifaceName()};
newDtypep->ifacep(subRefp->ifacep());

View File

@ -62,6 +62,9 @@ module t;
`checkd(oif.m.sub.cnt, 8'd1)
`checkd(drv.read_a(), 8'd1)
`checkd(oif.d.val, 8'd99)
// Direct (non-virtual) sub-interface method call: covers the non-virtual dtype path.
oif.a.bump();
`checkd(oif.a.cnt, 8'd2)
$write("*-* All Finished *-*\n");
$finish;
end