aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-11 05:14:39 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-11 05:14:39 +0100
commit447d8371225b84145723ecb78461b8935f3216a0 (patch)
tree109de0f26b538fe3ee02e43616f581f5d030e4be /src/synth
parentd7ce45a42f681d063373b75dd4fb5118e13de1c0 (diff)
downloadghdl-447d8371225b84145723ecb78461b8935f3216a0.tar.gz
ghdl-447d8371225b84145723ecb78461b8935f3216a0.tar.bz2
ghdl-447d8371225b84145723ecb78461b8935f3216a0.zip
simul: improve assertion messages for psl
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/synth-vhdl_stmts.adb53
1 files changed, 30 insertions, 23 deletions
diff --git a/src/synth/synth-vhdl_stmts.adb b/src/synth/synth-vhdl_stmts.adb
index 6a9d0a348..969a70227 100644
--- a/src/synth/synth-vhdl_stmts.adb
+++ b/src/synth/synth-vhdl_stmts.adb
@@ -3408,7 +3408,7 @@ package body Synth.Vhdl_Stmts is
is
use Simple_IO;
Rep_Expr : constant Node := Get_Report_Expression (Stmt);
- Sev_Expr : constant Node := Get_Severity_Expression (Stmt);
+ Sev_Expr : Node;
Marker : Mark_Type;
Rep : Valtyp;
Sev : Valtyp;
@@ -3425,31 +3425,38 @@ package body Synth.Vhdl_Stmts is
end if;
Strip_Const (Rep);
end if;
- if Sev_Expr /= Null_Node then
- Sev := Synth_Expression (Syn_Inst, Sev_Expr);
- if Sev = No_Valtyp then
- Set_Error (Syn_Inst);
- Release_Expr_Pool (Marker);
- return;
+
+ if Get_Kind (Stmt) /= Iir_Kind_Psl_Cover_Directive then
+ Sev_Expr := Get_Severity_Expression (Stmt);
+
+ if Sev_Expr /= Null_Node then
+ Sev := Synth_Expression (Syn_Inst, Sev_Expr);
+ if Sev = No_Valtyp then
+ Set_Error (Syn_Inst);
+ Release_Expr_Pool (Marker);
+ return;
+ end if;
+ Strip_Const (Sev);
end if;
- Strip_Const (Sev);
- end if;
- if Sev = No_Valtyp then
- case Get_Kind (Stmt) is
- when Iir_Kind_Report_Statement
- | Iir_Kind_Psl_Cover_Directive =>
- Sev_V := Note_Severity;
- when Iir_Kind_Assertion_Statement
- | Iir_Kind_Concurrent_Assertion_Statement
- | Iir_Kind_Psl_Assert_Directive
- | Iir_Kind_Psl_Assume_Directive =>
- Sev_V := Error_Severity;
- when others =>
- raise Internal_Error;
- end case;
+ if Sev = No_Valtyp then
+ case Get_Kind (Stmt) is
+ when Iir_Kind_Report_Statement
+ | Iir_Kind_Psl_Cover_Directive =>
+ Sev_V := Note_Severity;
+ when Iir_Kind_Assertion_Statement
+ | Iir_Kind_Concurrent_Assertion_Statement
+ | Iir_Kind_Psl_Assert_Directive
+ | Iir_Kind_Psl_Assume_Directive =>
+ Sev_V := Error_Severity;
+ when others =>
+ raise Internal_Error;
+ end case;
+ else
+ Sev_V := Natural (Read_Discrete (Sev));
+ end if;
else
- Sev_V := Natural (Read_Discrete (Sev));
+ Sev_V := Note_Severity;
end if;
if Assertion_Report_Handler /= null then