Internals: Make AstConstraintBefore an AstNodeStmt (#6280) (#8141)

AstConstraintBefore ('solve x before y') is a constraint item that appears
in constraint bodies alongside its siblings AstConstraintExpr,
AstConstraintUnique and AstConstraintIf, all of which are AstNodeStmt.
Part of #6280.
This commit is contained in:
Geza Lore 2026-08-18 11:19:40 +02:00 committed by GitHub
parent 2a9757bf38
commit 7c6b225b7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 16 deletions

View File

@ -1041,22 +1041,6 @@ public:
void isStatic(bool flag) { m_isStatic = flag; } void isStatic(bool flag) { m_isStatic = flag; }
bool isStatic() const { return m_isStatic; } bool isStatic() const { return m_isStatic; }
}; };
class AstConstraintBefore final : public AstNode {
// Constraint solve before item
// @astgen op1 := lhssp : List[AstNodeExpr]
// @astgen op2 := rhssp : List[AstNodeExpr]
public:
AstConstraintBefore(FileLine* fl, AstNodeExpr* lhssp, AstNodeExpr* rhssp)
: ASTGEN_SUPER_ConstraintBefore(fl) {
addLhssp(lhssp);
addRhssp(rhssp);
}
ASTGEN_MEMBERS_AstConstraintBefore;
bool isGateOptimizable() const override { return false; }
bool isPredictOptimizable() const override { return false; }
bool sameNode(const AstNode* /*samep*/) const override { return true; }
};
class AstCoverBin final : public AstNode { class AstCoverBin final : public AstNode {
// Captures data for a coverpoint 'bins' declaration // Captures data for a coverpoint 'bins' declaration
// @astgen op1 := rangesp : List[AstNode] // @astgen op1 := rangesp : List[AstNode]

View File

@ -461,6 +461,21 @@ public:
bool sameNode(const AstNode* samep) const override { return true; } // Ignore name in comments bool sameNode(const AstNode* samep) const override { return true; } // Ignore name in comments
virtual bool showAt() const { return m_showAt; } virtual bool showAt() const { return m_showAt; }
}; };
class AstConstraintBefore final : public AstNodeStmt {
// Constraint solve before item
// @astgen op1 := lhssp : List[AstNodeExpr]
// @astgen op2 := rhssp : List[AstNodeExpr]
public:
AstConstraintBefore(FileLine* fl, AstNodeExpr* lhssp, AstNodeExpr* rhssp)
: ASTGEN_SUPER_ConstraintBefore(fl) {
addLhssp(lhssp);
addRhssp(rhssp);
}
ASTGEN_MEMBERS_AstConstraintBefore;
bool isGateOptimizable() const override { return false; }
bool isPredictOptimizable() const override { return false; }
bool sameNode(const AstNode* /*samep*/) const override { return true; }
};
class AstConstraintExpr final : public AstNodeStmt { class AstConstraintExpr final : public AstNodeStmt {
// Constraint expression // Constraint expression
// @astgen op1 := exprp : AstNodeExpr // @astgen op1 := exprp : AstNodeExpr