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/grt/grt-psl.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/grt/grt-psl.adb')
-rw-r--r-- | src/grt/grt-psl.adb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/grt/grt-psl.adb b/src/grt/grt-psl.adb index cf603a097..1fd3ad94f 100644 --- a/src/grt/grt-psl.adb +++ b/src/grt/grt-psl.adb @@ -40,6 +40,8 @@ package body Grt.Psl is Is_First : Boolean := True; Nbr_Assert_Failed : Ghdl_U32 := 0; Nbr_Assert_Passed : Ghdl_U32 := 0; + Nbr_Assume_Failed : Ghdl_U32 := 0; + Nbr_Assume_Passed : Ghdl_U32 := 0; Nbr_Cover_Failed : Ghdl_U32 := 0; Nbr_Cover_Passed : Ghdl_U32 := 0; @@ -96,6 +98,8 @@ package body Grt.Psl is case Ghdl_Rtiks_Psl (Rti.Kind) is when Ghdl_Rtik_Psl_Assert => Put (F, """assertion"""); + when Ghdl_Rtik_Psl_Assume => + Put (F, """assumption"""); when Ghdl_Rtik_Psl_Cover => Put (F, """cover"""); end case; @@ -130,6 +134,14 @@ package body Grt.Psl is Put (F, "failed"); Inc (Nbr_Assert_Failed); end if; + when Ghdl_Rtik_Psl_Assume => + if Val = 0 then + Put (F, "passed"); + Inc (Nbr_Assume_Passed); + else + Put (F, "failed"); + Inc (Nbr_Assume_Failed); + end if; when Ghdl_Rtik_Psl_Cover => if Val = 0 then Put (F, "not covered"); @@ -186,6 +198,16 @@ package body Grt.Psl is Put_U32 (F, Nbr_Assert_Passed); Put_Line (F, ","); + Put (F, " ""assume"": "); + Put_U32 (F, Nbr_Assume_Failed + Nbr_Assume_Passed); + Put_Line (F, ","); + Put (F, " ""assume-failure"": "); + Put_U32 (F, Nbr_Assume_Failed); + Put_Line (F, ","); + Put (F, " ""assume-pass"": "); + Put_U32 (F, Nbr_Assume_Passed); + Put_Line (F, ","); + Put (F, " ""cover"": "); Put_U32 (F, Nbr_Cover_Failed + Nbr_Cover_Passed); Put_Line (F, ","); |