From 32cb30ea5f674acd7ad7d5923fbd462be38d2046 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 18 Aug 2021 00:47:31 +0200 Subject: Assertion messages are optional in assert statements. --- pyGHDL/dom/Sequential.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pyGHDL/dom') diff --git a/pyGHDL/dom/Sequential.py b/pyGHDL/dom/Sequential.py index f752b432d..a4eae8767 100644 --- a/pyGHDL/dom/Sequential.py +++ b/pyGHDL/dom/Sequential.py @@ -461,7 +461,7 @@ class SequentialAssertStatement(VHDLModel_SequentialAssertStatement, DOMMixin): self, assertNode: Iir, condition: Expression, - message: Expression, + message: Expression = None, severity: Expression = None, label: str = None, ): @@ -473,7 +473,12 @@ class SequentialAssertStatement(VHDLModel_SequentialAssertStatement, DOMMixin): from pyGHDL.dom._Translate import GetExpressionFromNode condition = GetExpressionFromNode(nodes.Get_Assertion_Condition(assertNode)) - message = GetExpressionFromNode(nodes.Get_Report_Expression(assertNode)) + messageNode = nodes.Get_Report_Expression(assertNode) + message = ( + None + if messageNode is nodes.Null_Iir + else GetExpressionFromNode(messageNode) + ) severityNode = nodes.Get_Severity_Expression(assertNode) severity = ( None -- cgit v1.2.3