diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-08-17 10:44:34 +0200 |
---|---|---|
committer | umarcor <unai.martinezcorral@ehu.eus> | 2021-08-23 16:35:36 +0200 |
commit | 2488e55caba1c369785a93ab2578c4a1e0c40c65 (patch) | |
tree | eb6ec11eb8f67e264644e13aec3bcbda4b55bd22 /pyGHDL/dom/Sequential.py | |
parent | c34b020a8c1b6aa5083a637e3e9062c7a71b309a (diff) | |
download | ghdl-2488e55caba1c369785a93ab2578c4a1e0c40c65.tar.gz ghdl-2488e55caba1c369785a93ab2578c4a1e0c40c65.tar.bz2 ghdl-2488e55caba1c369785a93ab2578c4a1e0c40c65.zip |
Read condition, message and severity from asserts and reports.
Diffstat (limited to 'pyGHDL/dom/Sequential.py')
-rw-r--r-- | pyGHDL/dom/Sequential.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/pyGHDL/dom/Sequential.py b/pyGHDL/dom/Sequential.py index cb6fa5a8f..b0f1d2e97 100644 --- a/pyGHDL/dom/Sequential.py +++ b/pyGHDL/dom/Sequential.py @@ -466,19 +466,19 @@ class SequentialAssertStatement(VHDLModel_SequentialAssertStatement, DOMMixin): severity: Expression = None, label: str = None, ): - super().__init__(label, condition, message, severity, label) + super().__init__(condition, message, severity, label) DOMMixin.__init__(self, assertNode) - @classmethod - def parse(cls, assertNode: Iir, label: str) -> "SequentialAssertStatement": - from pyGHDL.dom._Utils import GetIirKindOfNode - from pyGHDL.dom._Translate import GetExpressionFromNode + @classmethod + def parse(cls, assertNode: Iir, label: str) -> "SequentialAssertStatement": + from pyGHDL.dom._Translate import GetExpressionFromNode - condition = "" - message = "" - severity = "" + condition = GetExpressionFromNode(nodes.Get_Assertion_Condition(assertNode)) + message = GetExpressionFromNode(nodes.Get_Report_Expression(assertNode)) + severityNode = nodes.Get_Severity_Expression(assertNode) + severity = None if severityNode is nodes.Null_Iir else GetExpressionFromNode(severityNode) - return cls(assertNode, condition, message, severity, label) + return cls(assertNode, condition, message, severity, label) @export @@ -490,15 +490,15 @@ class SequentialReportStatement(VHDLModel_SequentialReportStatement, DOMMixin): severity: Expression = None, label: str = None, ): - super().__init__(label, message, severity, label) + super().__init__(message, severity, label) DOMMixin.__init__(self, reportNode) - @classmethod - def parse(cls, reportNode: Iir, label: str) -> "SequentialReportStatement": - from pyGHDL.dom._Utils import GetIirKindOfNode - from pyGHDL.dom._Translate import GetExpressionFromNode + @classmethod + def parse(cls, reportNode: Iir, label: str) -> "SequentialReportStatement": + from pyGHDL.dom._Translate import GetExpressionFromNode - message = "" - severity = "" + message = GetExpressionFromNode(nodes.Get_Report_Expression(reportNode)) + severityNode = nodes.Get_Severity_Expression(reportNode) + severity = None if severityNode is nodes.Null_Iir else GetExpressionFromNode(severityNode) - return cls(reportNode, message, severity, label) + return cls(reportNode, message, severity, label) |