mirror of
https://github.com/verilator/verilator.git
synced 2026-09-02 02:38:15 +02:00
Fix coverage of real arrays giving operator^ not defined
This commit is contained in:
+9
-2
@@ -122,8 +122,15 @@ class ClockVisitor final : public VNVisitor {
|
||||
AstNodeExpr* const origp = nodep->origp()->unlinkFrBack();
|
||||
AstNodeExpr* const changeWrp = nodep->changep()->unlinkFrBack();
|
||||
AstNodeExpr* const changeRdp = ConvertWriteRefsToRead::main(changeWrp->cloneTree(false));
|
||||
AstIf* const newp
|
||||
= new AstIf{nodep->fileline(), new AstXor{nodep->fileline(), origp, changeRdp}, incp};
|
||||
AstNodeExpr* comparedp = nullptr;
|
||||
// Xor will optimize better than Eq, when CoverToggle has bit selects,
|
||||
// but can only use Xor with non-opaque types
|
||||
if (const AstBasicDType* const bdtypep
|
||||
= VN_CAST(origp->dtypep()->skipRefp(), BasicDType)) {
|
||||
if (!bdtypep->isOpaque()) comparedp = new AstXor{nodep->fileline(), origp, changeRdp};
|
||||
}
|
||||
if (!comparedp) comparedp = AstEq::newTyped(nodep->fileline(), origp, changeRdp);
|
||||
AstIf* const newp = new AstIf{nodep->fileline(), comparedp, incp};
|
||||
// We could add another IF to detect posedges, and only increment if so.
|
||||
// It's another whole branch though versus a potential memory miss.
|
||||
// We'll go with the miss.
|
||||
|
||||
Reference in New Issue
Block a user