diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-08-18 00:47:31 +0200 |
---|---|---|
committer | umarcor <unai.martinezcorral@ehu.eus> | 2021-08-23 16:35:37 +0200 |
commit | 32cb30ea5f674acd7ad7d5923fbd462be38d2046 (patch) | |
tree | 4deaed508b2ea469023308d561361a149bf13ba4 | |
parent | 94a3027f9108f0d81a84f7d52a3e4afe93c1eb66 (diff) | |
download | ghdl-32cb30ea5f674acd7ad7d5923fbd462be38d2046.tar.gz ghdl-32cb30ea5f674acd7ad7d5923fbd462be38d2046.tar.bz2 ghdl-32cb30ea5f674acd7ad7d5923fbd462be38d2046.zip |
Assertion messages are optional in assert statements.
-rw-r--r-- | pyGHDL/dom/Sequential.py | 9 |
1 files changed, 7 insertions, 2 deletions
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 |