diff options
author | Pepijn de Vos <pepijndevos@gmail.com> | 2019-08-07 04:20:14 +0200 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2019-08-07 04:20:14 +0200 |
commit | 0331772c3ef05bad40b748542939ccafab2a9c68 (patch) | |
tree | ca0dd705571b8a031c02b6934d9e9fe85151b042 /src/vhdl/translate/trans-rtis.adb | |
parent | ce416ec62d20f1a592835efe5cbe49856d7085a2 (diff) | |
download | ghdl-0331772c3ef05bad40b748542939ccafab2a9c68.tar.gz ghdl-0331772c3ef05bad40b748542939ccafab2a9c68.tar.bz2 ghdl-0331772c3ef05bad40b748542939ccafab2a9c68.zip |
Add support for PSL assumptions, used in formal verification (#880)
* vhdl: make the parser understand PSL assume
* assume does not actually have report according to the spec. Just a property.
* add SPL assume to semantic analysis
* canonicalise PSL assume
* add assume to annotations
* add PSL assume to simulation code
* statement -> directive
* add assume to translation files
* update ticked24 testcase
* correctly parse assume
* add assume testcase
* refactor chunk of duplicated code
Diffstat (limited to 'src/vhdl/translate/trans-rtis.adb')
-rw-r--r-- | src/vhdl/translate/trans-rtis.adb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/vhdl/translate/trans-rtis.adb b/src/vhdl/translate/trans-rtis.adb index 96aacb8b0..e618aeb9b 100644 --- a/src/vhdl/translate/trans-rtis.adb +++ b/src/vhdl/translate/trans-rtis.adb @@ -322,6 +322,9 @@ package body Trans.Rtis is (Constr, Get_Identifier ("__ghdl_rtik_psl_assert"), Ghdl_Rtik_Psl_Assert); New_Enum_Literal + (Constr, Get_Identifier ("__ghdl_rtik_psl_assume"), + Ghdl_Rtik_Psl_Assume); + New_Enum_Literal (Constr, Get_Identifier ("__ghdl_rtik_psl_cover"), Ghdl_Rtik_Psl_Cover); New_Enum_Literal @@ -2042,8 +2045,10 @@ package body Trans.Rtis is case Get_Kind (Decl) is when Iir_Kind_Psl_Cover_Directive => Kind := Ghdl_Rtik_Psl_Cover; - when Iir_Kind_Psl_Assert_Statement => + when Iir_Kind_Psl_Assert_Directive => Kind := Ghdl_Rtik_Psl_Assert; + when Iir_Kind_Psl_Assume_Directive => + Kind := Ghdl_Rtik_Psl_Assume; when Iir_Kind_Psl_Endpoint_Declaration => Kind := Ghdl_Rtik_Psl_Endpoint; when others => @@ -2422,7 +2427,8 @@ package body Trans.Rtis is null; when Iir_Kind_Psl_Declaration => null; - when Iir_Kind_Psl_Assert_Statement + when Iir_Kind_Psl_Assert_Directive + | Iir_Kind_Psl_Assume_Directive | Iir_Kind_Psl_Cover_Directive | Iir_Kind_Psl_Endpoint_Declaration => Generate_Psl_Directive (Stmt); @@ -2994,7 +3000,8 @@ package body Trans.Rtis is when Iir_Kind_Process_Statement | Iir_Kind_Sensitized_Process_Statement => return Node_Info.Process_Rti_Const; - when Iir_Kind_Psl_Assert_Statement + when Iir_Kind_Psl_Assert_Directive + | Iir_Kind_Psl_Assume_Directive | Iir_Kind_Psl_Cover_Directive | Iir_Kind_Psl_Endpoint_Declaration => return Node_Info.Psl_Rti_Const; @@ -3035,7 +3042,8 @@ package body Trans.Rtis is when Iir_Kind_Process_Statement | Iir_Kind_Sensitized_Process_Statement => Ref := Get_Instance_Ref (Node_Info.Process_Scope); - when Iir_Kind_Psl_Assert_Statement + when Iir_Kind_Psl_Assert_Directive + | Iir_Kind_Psl_Assume_Directive | Iir_Kind_Psl_Cover_Directive | Iir_Kind_Psl_Endpoint_Declaration => Ref := Get_Instance_Ref (Node_Info.Psl_Scope); |